@abi-software/flatmapvuer 0.6.0-vue3.8 → 0.6.1-vue3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +107 -107
  3. package/dist/flatmapvuer.js +17 -17
  4. package/dist/flatmapvuer.umd.cjs +2 -2
  5. package/dist/index.html +17 -17
  6. package/dist/style.css +1 -1
  7. package/package.json +84 -84
  8. package/public/index.html +17 -17
  9. package/src/App.vue +319 -318
  10. package/src/assets/_variables.scss +43 -43
  11. package/src/assets/styles.scss +5 -5
  12. package/src/components/AnnotationTool.vue +437 -437
  13. package/src/components/EventBus.js +3 -3
  14. package/src/components/ExternalResourceCard.vue +106 -106
  15. package/src/components/FlatmapVuer.vue +2129 -2129
  16. package/src/components/MultiFlatmapVuer.vue +613 -613
  17. package/src/components/ProvenancePopup.vue +490 -490
  18. package/src/components/SelectionsGroup.vue +255 -255
  19. package/src/components/Tooltip.vue +50 -50
  20. package/src/components/TreeControls.vue +231 -231
  21. package/src/components/index.js +7 -7
  22. package/src/components/legends/DynamicLegends.vue +106 -106
  23. package/src/components/legends/SvgLegends.vue +112 -112
  24. package/src/icons/flatmap-marker.js +1 -1
  25. package/src/icons/fonts/mapicon-species.svg +14 -14
  26. package/src/icons/fonts/mapicon-species.ttf +0 -0
  27. package/src/icons/fonts/mapicon-species.woff +0 -0
  28. package/src/icons/mapicon-species-style.css +42 -42
  29. package/src/icons/yellowstar.js +5 -5
  30. package/src/legends/legend.svg +25 -25
  31. package/src/main.js +4 -4
  32. package/src/nerve-map.js +99 -0
  33. package/src/services/flatmapQueries.js +451 -451
  34. package/vite.config.js +66 -66
  35. package/vite.static-build.js +12 -12
@@ -12,7 +12,7 @@ usage: app.provide(ID_INJECTION_KEY, {
12
12
  z-index:-1000 !important;
13
13
  top:0 !important;
14
14
  right:0 !important;
15
- `,ES=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function VS(e){const t=window.getComputedStyle(e),r=t.getPropertyValue("box-sizing"),n=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),i=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:ES.map(u=>`${u}:${t.getPropertyValue(u)}`).join(";"),paddingSize:n,borderSize:i,boxSizing:r}}function rp(e,t=1,r){var n;L4||(L4=document.createElement("textarea"),document.body.appendChild(L4));const{paddingSize:i,borderSize:a,boxSizing:u,contextStyle:o}=VS(e);L4.setAttribute("style",`${o};${SS}`),L4.value=e.value||e.placeholder||"";let f=L4.scrollHeight;const h={};u==="border-box"?f=f+a:u==="content-box"&&(f=f-i),L4.value="";const p=L4.scrollHeight-i;if(A2(t)){let m=p*t;u==="border-box"&&(m=m+i+a),f=Math.max(m,f),h.minHeight=`${m}px`}if(A2(r)){let m=p*r;u==="border-box"&&(m=m+i+a),f=Math.min(m,f)}return h.height=`${f}px`,(n=L4.parentNode)==null||n.removeChild(L4),L4=void 0,h}const DS=S1({id:{type:String,default:void 0},size:a6,disabled:Boolean,modelValue:{type:r1([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:r1([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:ln},prefixIcon:{type:ln},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:r1([Object,Array,String]),default:()=>ti({})},autofocus:{type:Boolean,default:!1}}),OS={[f2]:e=>C2(e),input:e=>C2(e),change:e=>C2(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},kS=["role"],PS=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],IS=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],BS=T.defineComponent({name:"ElInput",inheritAttrs:!1}),NS=T.defineComponent({...BS,props:DS,emits:OS,setup(e,{expose:t,emit:r}){const n=e,i=T.useAttrs(),a=T.useSlots(),u=T.computed(()=>{const et={};return n.containerRole==="combobox"&&(et["aria-haspopup"]=i["aria-haspopup"],et["aria-owns"]=i["aria-owns"],et["aria-expanded"]=i["aria-expanded"]),et}),o=T.computed(()=>[n.type==="textarea"?E.b():w.b(),w.m(v.value),w.is("disabled",b.value),w.is("exceed",yt.value),{[w.b("group")]:a.prepend||a.append,[w.bm("group","append")]:a.append,[w.bm("group","prepend")]:a.prepend,[w.m("prefix")]:a.prefix||n.prefixIcon,[w.m("suffix")]:a.suffix||n.suffixIcon||n.clearable||n.showPassword,[w.bm("suffix","password-clear")]:Ie.value&&Xe.value},i.class]),f=T.computed(()=>[w.e("wrapper"),w.is("focus",ie.value)]),h=tA({excludeKeys:T.computed(()=>Object.keys(u.value))}),{form:p,formItem:m}=Qn(),{inputId:g}=na(n,{formItemContext:m}),v=un(),b=ci(),w=Jt("input"),E=Jt("textarea"),H=T.shallowRef(),V=T.shallowRef(),I=T.ref(!1),N=T.ref(!1),R=T.ref(!1),z=T.ref(),Z=T.shallowRef(n.inputStyle),K=T.computed(()=>H.value||V.value),{wrapperRef:ee,isFocused:ie,handleFocus:de,handleBlur:ge}=ep(K,{afterBlur(){var et;n.validateEvent&&((et=m==null?void 0:m.validate)==null||et.call(m,"blur").catch(Rt=>S2(Rt)))}}),Ce=T.computed(()=>{var et;return(et=p==null?void 0:p.statusIcon)!=null?et:!1}),Re=T.computed(()=>(m==null?void 0:m.validateState)||""),Ze=T.computed(()=>Re.value&&pf[Re.value]),tt=T.computed(()=>R.value?ZC:FC),Ee=T.computed(()=>[i.style,n.inputStyle]),Ye=T.computed(()=>[n.inputStyle,Z.value,{resize:n.resize}]),Pt=T.computed(()=>an(n.modelValue)?"":String(n.modelValue)),Ie=T.computed(()=>n.clearable&&!b.value&&!n.readonly&&!!Pt.value&&(ie.value||I.value)),Xe=T.computed(()=>n.showPassword&&!b.value&&!n.readonly&&!!Pt.value&&(!!Pt.value||ie.value)),Tt=T.computed(()=>n.showWordLimit&&!!h.value.maxlength&&(n.type==="text"||n.type==="textarea")&&!b.value&&!n.readonly&&!n.showPassword),Je=T.computed(()=>Pt.value.length),yt=T.computed(()=>!!Tt.value&&Je.value>Number(h.value.maxlength)),At=T.computed(()=>!!a.suffix||!!n.suffixIcon||Ie.value||n.showPassword||Tt.value||!!Re.value&&Ce.value),[Et,Ve]=vS(H);j0(V,et=>{if(ze(),!Tt.value||n.resize!=="both")return;const Rt=et[0],{width:d1}=Rt.contentRect;z.value={right:`calc(100% - ${d1+15+6}px)`}});const Ne=()=>{const{type:et,autosize:Rt}=n;if(!(!M2||et!=="textarea"||!V.value))if(Rt){const d1=i3(Rt)?Rt.minRows:void 0,r2=i3(Rt)?Rt.maxRows:void 0,R2=rp(V.value,d1,r2);Z.value={overflowY:"hidden",...R2},T.nextTick(()=>{V.value.offsetHeight,Z.value=R2})}else Z.value={minHeight:rp(V.value).minHeight}},ze=(et=>{let Rt=!1;return()=>{var d1;if(Rt||!n.autosize)return;((d1=V.value)==null?void 0:d1.offsetParent)===null||(et(),Rt=!0)}})(Ne),Ke=()=>{const et=K.value,Rt=n.formatter?n.formatter(Pt.value):Pt.value;!et||et.value===Rt||(et.value=Rt)},gt=async et=>{Et();let{value:Rt}=et.target;if(n.formatter&&(Rt=n.parser?n.parser(Rt):Rt),!N.value){if(Rt===Pt.value){Ke();return}r(f2,Rt),r("input",Rt),await T.nextTick(),Ke(),Ve()}},pt=et=>{r("change",et.target.value)},mt=et=>{r("compositionstart",et),N.value=!0},Ht=et=>{var Rt;r("compositionupdate",et);const d1=(Rt=et.target)==null?void 0:Rt.value,r2=d1[d1.length-1]||"";N.value=!mf(r2)},Wt=et=>{r("compositionend",et),N.value&&(N.value=!1,gt(et))},_1=()=>{R.value=!R.value,t1()},t1=async()=>{var et;await T.nextTick(),(et=K.value)==null||et.focus()},V1=()=>{var et;return(et=K.value)==null?void 0:et.blur()},Pe=et=>{I.value=!1,r("mouseleave",et)},v1=et=>{I.value=!0,r("mouseenter",et)},P1=et=>{r("keydown",et)},Q1=()=>{var et;(et=K.value)==null||et.select()},Xt=()=>{r(f2,""),r("change",""),r("clear"),r("input","")};return T.watch(()=>n.modelValue,()=>{var et;T.nextTick(()=>Ne()),n.validateEvent&&((et=m==null?void 0:m.validate)==null||et.call(m,"change").catch(Rt=>S2(Rt)))}),T.watch(Pt,()=>Ke()),T.watch(()=>n.type,async()=>{await T.nextTick(),Ke(),Ne()}),T.onMounted(()=>{!n.formatter&&n.parser&&S2("ElInput","If you set the parser, you also need to set the formatter."),Ke(),T.nextTick(Ne)}),t({input:H,textarea:V,ref:K,textareaStyle:Ye,autosize:T.toRef(n,"autosize"),focus:t1,blur:V1,select:Q1,clear:Xt,resizeTextarea:Ne}),(et,Rt)=>T.withDirectives((T.openBlock(),T.createElementBlock("div",T.mergeProps(T.unref(u),{class:T.unref(o),style:T.unref(Ee),role:et.containerRole,onMouseenter:v1,onMouseleave:Pe}),[T.createCommentVNode(" input "),et.type!=="textarea"?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createCommentVNode(" prepend slot "),et.$slots.prepend?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(T.unref(w).be("group","prepend"))},[T.renderSlot(et.$slots,"prepend")],2)):T.createCommentVNode("v-if",!0),T.createElementVNode("div",{ref_key:"wrapperRef",ref:ee,class:T.normalizeClass(T.unref(f))},[T.createCommentVNode(" prefix slot "),et.$slots.prefix||et.prefixIcon?(T.openBlock(),T.createElementBlock("span",{key:0,class:T.normalizeClass(T.unref(w).e("prefix"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w).e("prefix-inner"))},[T.renderSlot(et.$slots,"prefix"),et.prefixIcon?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(w).e("icon"))},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(et.prefixIcon)))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0)],2)],2)):T.createCommentVNode("v-if",!0),T.createElementVNode("input",T.mergeProps({id:T.unref(g),ref_key:"input",ref:H,class:T.unref(w).e("inner")},T.unref(h),{type:et.showPassword?R.value?"text":"password":et.type,disabled:T.unref(b),formatter:et.formatter,parser:et.parser,readonly:et.readonly,autocomplete:et.autocomplete,tabindex:et.tabindex,"aria-label":et.label,placeholder:et.placeholder,style:et.inputStyle,form:n.form,autofocus:n.autofocus,onCompositionstart:mt,onCompositionupdate:Ht,onCompositionend:Wt,onInput:gt,onFocus:Rt[0]||(Rt[0]=(...d1)=>T.unref(de)&&T.unref(de)(...d1)),onBlur:Rt[1]||(Rt[1]=(...d1)=>T.unref(ge)&&T.unref(ge)(...d1)),onChange:pt,onKeydown:P1}),null,16,PS),T.createCommentVNode(" suffix slot "),T.unref(At)?(T.openBlock(),T.createElementBlock("span",{key:1,class:T.normalizeClass(T.unref(w).e("suffix"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w).e("suffix-inner"))},[!T.unref(Ie)||!T.unref(Xe)||!T.unref(Tt)?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.renderSlot(et.$slots,"suffix"),et.suffixIcon?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(w).e("icon"))},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(et.suffixIcon)))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0)],64)):T.createCommentVNode("v-if",!0),T.unref(Ie)?(T.openBlock(),T.createBlock(T.unref(U2),{key:1,class:T.normalizeClass([T.unref(w).e("icon"),T.unref(w).e("clear")]),onMousedown:T.withModifiers(T.unref(B5),["prevent"]),onClick:Xt},{default:T.withCtx(()=>[T.createVNode(T.unref(Lc))]),_:1},8,["class","onMousedown"])):T.createCommentVNode("v-if",!0),T.unref(Xe)?(T.openBlock(),T.createBlock(T.unref(U2),{key:2,class:T.normalizeClass([T.unref(w).e("icon"),T.unref(w).e("password")]),onClick:_1},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(T.unref(tt))))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0),T.unref(Tt)?(T.openBlock(),T.createElementBlock("span",{key:3,class:T.normalizeClass(T.unref(w).e("count"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w).e("count-inner"))},T.toDisplayString(T.unref(Je))+" / "+T.toDisplayString(T.unref(h).maxlength),3)],2)):T.createCommentVNode("v-if",!0),T.unref(Re)&&T.unref(Ze)&&T.unref(Ce)?(T.openBlock(),T.createBlock(T.unref(U2),{key:4,class:T.normalizeClass([T.unref(w).e("icon"),T.unref(w).e("validateIcon"),T.unref(w).is("loading",T.unref(Re)==="validating")])},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(T.unref(Ze))))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0)],2)],2)):T.createCommentVNode("v-if",!0)],2),T.createCommentVNode(" append slot "),et.$slots.append?(T.openBlock(),T.createElementBlock("div",{key:1,class:T.normalizeClass(T.unref(w).be("group","append"))},[T.renderSlot(et.$slots,"append")],2)):T.createCommentVNode("v-if",!0)],64)):(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[T.createCommentVNode(" textarea "),T.createElementVNode("textarea",T.mergeProps({id:T.unref(g),ref_key:"textarea",ref:V,class:T.unref(E).e("inner")},T.unref(h),{tabindex:et.tabindex,disabled:T.unref(b),readonly:et.readonly,autocomplete:et.autocomplete,style:T.unref(Ye),"aria-label":et.label,placeholder:et.placeholder,form:n.form,autofocus:n.autofocus,onCompositionstart:mt,onCompositionupdate:Ht,onCompositionend:Wt,onInput:gt,onFocus:Rt[2]||(Rt[2]=(...d1)=>T.unref(de)&&T.unref(de)(...d1)),onBlur:Rt[3]||(Rt[3]=(...d1)=>T.unref(ge)&&T.unref(ge)(...d1)),onChange:pt,onKeydown:P1}),null,16,IS),T.unref(Tt)?(T.openBlock(),T.createElementBlock("span",{key:0,style:T.normalizeStyle(z.value),class:T.normalizeClass(T.unref(w).e("count"))},T.toDisplayString(T.unref(Je))+" / "+T.toDisplayString(T.unref(h).maxlength),7)):T.createCommentVNode("v-if",!0)],64))],16,kS)),[[T.vShow,et.type!=="hidden"]])}});var FS=e1(NS,[["__file","input.vue"]]);const ls=g3(FS),ui=4,RS={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},jS=({move:e,size:t,bar:r})=>({[r.size]:t,transform:`translate${r.axis}(${e}%)`}),np=Symbol("scrollbarContextKey"),zS=S1({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),$S="Thumb";var ip=e1(T.defineComponent({__name:"thumb",props:zS,setup(e){const t=e,r=T.inject(np),n=Jt("scrollbar");r||HC($S,"can not inject scrollbar context");const i=T.ref(),a=T.ref(),u=T.ref({}),o=T.ref(!1);let f=!1,h=!1,p=M2?document.onselectstart:null;const m=T.computed(()=>RS[t.vertical?"vertical":"horizontal"]),g=T.computed(()=>jS({size:t.size,move:t.move,bar:m.value})),v=T.computed(()=>i.value[m.value.offset]**2/r.wrapElement[m.value.scrollSize]/t.ratio/a.value[m.value.offset]),b=z=>{var Z;if(z.stopPropagation(),z.ctrlKey||[1,2].includes(z.button))return;(Z=window.getSelection())==null||Z.removeAllRanges(),E(z);const K=z.currentTarget;K&&(u.value[m.value.axis]=K[m.value.offset]-(z[m.value.client]-K.getBoundingClientRect()[m.value.direction]))},w=z=>{if(!a.value||!i.value||!r.wrapElement)return;const Z=Math.abs(z.target.getBoundingClientRect()[m.value.direction]-z[m.value.client]),K=a.value[m.value.offset]/2,ee=(Z-K)*100*v.value/i.value[m.value.offset];r.wrapElement[m.value.scroll]=ee*r.wrapElement[m.value.scrollSize]/100},E=z=>{z.stopImmediatePropagation(),f=!0,document.addEventListener("mousemove",H),document.addEventListener("mouseup",V),p=document.onselectstart,document.onselectstart=()=>!1},H=z=>{if(!i.value||!a.value||f===!1)return;const Z=u.value[m.value.axis];if(!Z)return;const K=(i.value.getBoundingClientRect()[m.value.direction]-z[m.value.client])*-1,ee=a.value[m.value.offset]-Z,ie=(K-ee)*100*v.value/i.value[m.value.offset];r.wrapElement[m.value.scroll]=ie*r.wrapElement[m.value.scrollSize]/100},V=()=>{f=!1,u.value[m.value.axis]=0,document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",V),R(),h&&(o.value=!1)},I=()=>{h=!1,o.value=!!t.size},N=()=>{h=!0,o.value=f};T.onBeforeUnmount(()=>{R(),document.removeEventListener("mouseup",V)});const R=()=>{document.onselectstart!==p&&(document.onselectstart=p)};return rn(T.toRef(r,"scrollbarElement"),"mousemove",I),rn(T.toRef(r,"scrollbarElement"),"mouseleave",N),(z,Z)=>(T.openBlock(),T.createBlock(T.Transition,{name:T.unref(n).b("fade"),persisted:""},{default:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{ref_key:"instance",ref:i,class:T.normalizeClass([T.unref(n).e("bar"),T.unref(n).is(T.unref(m).key)]),onMousedown:w},[T.createElementVNode("div",{ref_key:"thumb",ref:a,class:T.normalizeClass(T.unref(n).e("thumb")),style:T.normalizeStyle(T.unref(g)),onMousedown:b},null,38)],34),[[T.vShow,z.always||o.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const ZS=S1({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}});var qS=e1(T.defineComponent({__name:"bar",props:ZS,setup(e,{expose:t}){const r=e,n=T.ref(0),i=T.ref(0);return t({handleScroll:u=>{if(u){const o=u.offsetHeight-ui,f=u.offsetWidth-ui;i.value=u.scrollTop*100/o*r.ratioY,n.value=u.scrollLeft*100/f*r.ratioX}}}),(u,o)=>(T.openBlock(),T.createElementBlock(T.Fragment,null,[T.createVNode(ip,{move:n.value,ratio:u.ratioX,size:u.width,always:u.always},null,8,["move","ratio","size","always"]),T.createVNode(ip,{move:i.value,ratio:u.ratioY,size:u.height,vertical:"",always:u.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const GS=S1({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:r1([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),US={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(A2)},Nc="ElScrollbar",WS=T.defineComponent({name:Nc}),XS=T.defineComponent({...WS,props:GS,emits:US,setup(e,{expose:t,emit:r}){const n=e,i=Jt("scrollbar");let a,u;const o=T.ref(),f=T.ref(),h=T.ref(),p=T.ref("0"),m=T.ref("0"),g=T.ref(),v=T.ref(1),b=T.ref(1),w=T.computed(()=>{const Z={};return n.height&&(Z.height=ei(n.height)),n.maxHeight&&(Z.maxHeight=ei(n.maxHeight)),[n.wrapStyle,Z]}),E=T.computed(()=>[n.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!n.native}]),H=T.computed(()=>[i.e("view"),n.viewClass]),V=()=>{var Z;f.value&&((Z=g.value)==null||Z.handleScroll(f.value),r("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function I(Z,K){i3(Z)?f.value.scrollTo(Z):A2(Z)&&A2(K)&&f.value.scrollTo(Z,K)}const N=Z=>{if(!A2(Z)){S2(Nc,"value must be a number");return}f.value.scrollTop=Z},R=Z=>{if(!A2(Z)){S2(Nc,"value must be a number");return}f.value.scrollLeft=Z},z=()=>{if(!f.value)return;const Z=f.value.offsetHeight-ui,K=f.value.offsetWidth-ui,ee=Z**2/f.value.scrollHeight,ie=K**2/f.value.scrollWidth,de=Math.max(ee,n.minSize),ge=Math.max(ie,n.minSize);v.value=ee/(Z-ee)/(de/(Z-de)),b.value=ie/(K-ie)/(ge/(K-ge)),m.value=de+ui<Z?`${de}px`:"",p.value=ge+ui<K?`${ge}px`:""};return T.watch(()=>n.noresize,Z=>{Z?(a==null||a(),u==null||u()):({stop:a}=j0(h,z),u=rn("resize",z))},{immediate:!0}),T.watch(()=>[n.maxHeight,n.height],()=>{n.native||T.nextTick(()=>{var Z;z(),f.value&&((Z=g.value)==null||Z.handleScroll(f.value))})}),T.provide(np,T.reactive({scrollbarElement:o,wrapElement:f})),T.onMounted(()=>{n.native||T.nextTick(()=>{z()})}),T.onUpdated(()=>z()),t({wrapRef:f,update:z,scrollTo:I,setScrollTop:N,setScrollLeft:R,handleScroll:V}),(Z,K)=>(T.openBlock(),T.createElementBlock("div",{ref_key:"scrollbarRef",ref:o,class:T.normalizeClass(T.unref(i).b())},[T.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:T.normalizeClass(T.unref(E)),style:T.normalizeStyle(T.unref(w)),onScroll:V},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(Z.tag),{id:Z.id,ref_key:"resizeRef",ref:h,class:T.normalizeClass(T.unref(H)),style:T.normalizeStyle(Z.viewStyle),role:Z.role,"aria-label":Z.ariaLabel,"aria-orientation":Z.ariaOrientation},{default:T.withCtx(()=>[T.renderSlot(Z.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),Z.native?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createBlock(qS,{key:0,ref_key:"barRef",ref:g,height:m.value,width:p.value,always:Z.always,"ratio-x":b.value,"ratio-y":v.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var KS=e1(XS,[["__file","scrollbar.vue"]]);const JS=g3(KS),Fc=Symbol("popper"),ap=Symbol("popperContent"),op=S1({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),YS=T.defineComponent({name:"ElPopper",inheritAttrs:!1}),eE=T.defineComponent({...YS,props:op,setup(e,{expose:t}){const r=e,n=T.ref(),i=T.ref(),a=T.ref(),u=T.ref(),o=T.computed(()=>r.role),f={triggerRef:n,popperInstanceRef:i,contentRef:a,referenceRef:u,role:o};return t(f),T.provide(Fc,f),(h,p)=>T.renderSlot(h.$slots,"default")}});var tE=e1(eE,[["__file","popper.vue"]]);const sp=S1({arrowOffset:{type:Number,default:5}}),rE=T.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),nE=T.defineComponent({...rE,props:sp,setup(e,{expose:t}){const r=e,n=Jt("popper"),{arrowOffset:i,arrowRef:a,arrowStyle:u}=T.inject(ap,void 0);return T.watch(()=>r.arrowOffset,o=>{i.value=o}),T.onBeforeUnmount(()=>{a.value=void 0}),t({arrowRef:a}),(o,f)=>(T.openBlock(),T.createElementBlock("span",{ref_key:"arrowRef",ref:a,class:T.normalizeClass(T.unref(n).e("arrow")),style:T.normalizeStyle(T.unref(u)),"data-popper-arrow":""},null,6))}});var iE=e1(nE,[["__file","arrow.vue"]]);const Rc="ElOnlyChild",aE=T.defineComponent({name:Rc,setup(e,{slots:t,attrs:r}){var n;const i=T.inject(Uf),a=_S((n=i==null?void 0:i.setForwardRef)!=null?n:B5);return()=>{var u;const o=(u=t.default)==null?void 0:u.call(t,r);if(!o)return null;if(o.length>1)return S2(Rc,"requires exact only one valid child."),null;const f=lp(o);return f?T.withDirectives(T.cloneVNode(f,r),[[a]]):(S2(Rc,"no valid child node found"),null)}}});function lp(e){if(!e)return null;const t=e;for(const r of t){if(i3(r))switch(r.type){case T.Comment:continue;case T.Text:case"svg":return cp(r);case T.Fragment:return lp(r.children);default:return r}return cp(r)}return null}function cp(e){const t=Jt("only-child");return T.createVNode("span",{class:t.e("content")},[e])}const up=S1({virtualRef:{type:r1(Object)},virtualTriggering:Boolean,onMouseenter:{type:r1(Function)},onMouseleave:{type:r1(Function)},onClick:{type:r1(Function)},onKeydown:{type:r1(Function)},onFocus:{type:r1(Function)},onBlur:{type:r1(Function)},onContextmenu:{type:r1(Function)},id:String,open:Boolean}),oE=T.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),sE=T.defineComponent({...oE,props:up,setup(e,{expose:t}){const r=e,{role:n,triggerRef:i}=T.inject(Fc,void 0);gS(i);const a=T.computed(()=>o.value?r.id:void 0),u=T.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),o=T.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),f=T.computed(()=>o.value?`${r.open}`:void 0);let h;return T.onMounted(()=>{T.watch(()=>r.virtualRef,p=>{p&&(i.value=tn(p))},{immediate:!0}),T.watch(i,(p,m)=>{h==null||h(),h=void 0,Z5(p)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(g=>{var v;const b=r[g];b&&(p.addEventListener(g.slice(2).toLowerCase(),b),(v=m==null?void 0:m.removeEventListener)==null||v.call(m,g.slice(2).toLowerCase(),b))}),h=T.watch([a,u,o,f],g=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((v,b)=>{an(g[b])?p.removeAttribute(v):p.setAttribute(v,g[b])})},{immediate:!0})),Z5(m)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(g=>m.removeAttribute(g))},{immediate:!0})}),T.onBeforeUnmount(()=>{h==null||h(),h=void 0}),t({triggerRef:i}),(p,m)=>p.virtualTriggering?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createBlock(T.unref(aE),T.mergeProps({key:0},p.$attrs,{"aria-controls":T.unref(a),"aria-describedby":T.unref(u),"aria-expanded":T.unref(f),"aria-haspopup":T.unref(o)}),{default:T.withCtx(()=>[T.renderSlot(p.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var lE=e1(sE,[["__file","trigger.vue"]]);const jc="focus-trap.focus-after-trapped",zc="focus-trap.focus-after-released",cE="focus-trap.focusout-prevented",Qp={cancelable:!0,bubbles:!1},uE={cancelable:!0,bubbles:!1},Tp="focusAfterTrapped",hp="focusAfterReleased",QE=Symbol("elFocusTrap"),$c=T.ref(),cs=T.ref(0),Zc=T.ref(0);let us=0;const dp=e=>{const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t},fp=(e,t)=>{for(const r of e)if(!TE(r,t))return r},TE=(e,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},hE=e=>{const t=dp(e),r=fp(t,e),n=fp(t.reverse(),e);return[r,n]},dE=e=>e instanceof HTMLInputElement&&"select"in e,Tn=(e,t)=>{if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),Zc.value=window.performance.now(),e!==r&&dE(e)&&t&&e.select()}};function pp(e,t){const r=[...e],n=e.indexOf(t);return n!==-1&&r.splice(n,1),r}const fE=()=>{let e=[];return{push:n=>{const i=e[0];i&&n!==i&&i.pause(),e=pp(e,n),e.unshift(n)},remove:n=>{var i,a;e=pp(e,n),(a=(i=e[0])==null?void 0:i.resume)==null||a.call(i)}}},pE=(e,t=!1)=>{const r=document.activeElement;for(const n of e)if(Tn(n,t),document.activeElement!==r)return},mp=fE(),mE=()=>cs.value>Zc.value,Qs=()=>{$c.value="pointer",cs.value=window.performance.now()},yp=()=>{$c.value="keyboard",cs.value=window.performance.now()},yE=()=>(T.onMounted(()=>{us===0&&(document.addEventListener("mousedown",Qs),document.addEventListener("touchstart",Qs),document.addEventListener("keydown",yp)),us++}),T.onBeforeUnmount(()=>{us--,us<=0&&(document.removeEventListener("mousedown",Qs),document.removeEventListener("touchstart",Qs),document.removeEventListener("keydown",yp))}),{focusReason:$c,lastUserFocusTimestamp:cs,lastAutomatedFocusTimestamp:Zc}),Ts=e=>new CustomEvent(cE,{...uE,detail:e}),gE=T.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Tp,hp,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const r=T.ref();let n,i;const{focusReason:a}=yE();dS(b=>{e.trapped&&!u.paused&&t("release-requested",b)});const u={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},o=b=>{if(!e.loop&&!e.trapped||u.paused)return;const{key:w,altKey:E,ctrlKey:H,metaKey:V,currentTarget:I,shiftKey:N}=b,{loop:R}=e,z=w===a3.tab&&!E&&!H&&!V,Z=document.activeElement;if(z&&Z){const K=I,[ee,ie]=hE(K);if(ee&&ie){if(!N&&Z===ie){const ge=Ts({focusReason:a.value});t("focusout-prevented",ge),ge.defaultPrevented||(b.preventDefault(),R&&Tn(ee,!0))}else if(N&&[ee,K].includes(Z)){const ge=Ts({focusReason:a.value});t("focusout-prevented",ge),ge.defaultPrevented||(b.preventDefault(),R&&Tn(ie,!0))}}else if(Z===K){const ge=Ts({focusReason:a.value});t("focusout-prevented",ge),ge.defaultPrevented||b.preventDefault()}}};T.provide(QE,{focusTrapRef:r,onKeydown:o}),T.watch(()=>e.focusTrapEl,b=>{b&&(r.value=b)},{immediate:!0}),T.watch([r],([b],[w])=>{b&&(b.addEventListener("keydown",o),b.addEventListener("focusin",p),b.addEventListener("focusout",m)),w&&(w.removeEventListener("keydown",o),w.removeEventListener("focusin",p),w.removeEventListener("focusout",m))});const f=b=>{t(Tp,b)},h=b=>t(hp,b),p=b=>{const w=T.unref(r);if(!w)return;const E=b.target,H=b.relatedTarget,V=E&&w.contains(E);e.trapped||H&&w.contains(H)||(n=H),V&&t("focusin",b),!u.paused&&e.trapped&&(V?i=E:Tn(i,!0))},m=b=>{const w=T.unref(r);if(!(u.paused||!w))if(e.trapped){const E=b.relatedTarget;!an(E)&&!w.contains(E)&&setTimeout(()=>{if(!u.paused&&e.trapped){const H=Ts({focusReason:a.value});t("focusout-prevented",H),H.defaultPrevented||Tn(i,!0)}},0)}else{const E=b.target;E&&w.contains(E)||t("focusout",b)}};async function g(){await T.nextTick();const b=T.unref(r);if(b){mp.push(u);const w=b.contains(document.activeElement)?n:document.activeElement;if(n=w,!b.contains(w)){const H=new Event(jc,Qp);b.addEventListener(jc,f),b.dispatchEvent(H),H.defaultPrevented||T.nextTick(()=>{let V=e.focusStartEl;C2(V)||(Tn(V),document.activeElement!==V&&(V="first")),V==="first"&&pE(dp(b),!0),(document.activeElement===w||V==="container")&&Tn(b)})}}}function v(){const b=T.unref(r);if(b){b.removeEventListener(jc,f);const w=new CustomEvent(zc,{...Qp,detail:{focusReason:a.value}});b.addEventListener(zc,h),b.dispatchEvent(w),!w.defaultPrevented&&(a.value=="keyboard"||!mE()||b.contains(document.activeElement))&&Tn(n??document.body),b.removeEventListener(zc,h),mp.remove(u)}}return T.onMounted(()=>{e.trapped&&g(),T.watch(()=>e.trapped,b=>{b?g():v()})}),T.onBeforeUnmount(()=>{e.trapped&&v()}),{onKeydown:o}}});function _E(e,t,r,n,i,a){return T.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var vE=e1(gE,[["render",_E],["__file","focus-trap.vue"]]);const xE=["fixed","absolute"],LE=S1({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:r1(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:rs,default:"bottom"},popperOptions:{type:r1(Object),default:()=>({})},strategy:{type:String,values:xE,default:"absolute"}}),gp=S1({...LE,id:String,style:{type:r1([String,Array,Object])},className:{type:r1([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:r1([String,Array,Object])},popperStyle:{type:r1([String,Array,Object])},referenceEl:{type:r1(Object)},triggerTargetEl:{type:r1(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),bE={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},wE=(e,t=[])=>{const{placement:r,strategy:n,popperOptions:i}=e,a={placement:r,strategy:n,...i,modifiers:[...ME(e),...t]};return CE(a,i==null?void 0:i.modifiers),a},HE=e=>{if(M2)return tn(e)};function ME(e){const{offset:t,gpuAcceleration:r,fallbackPlacements:n}=e;return[{name:"offset",options:{offset:[0,t??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function CE(e,t){t&&(e.modifiers=[...e.modifiers,...t??[]])}const AE=0,SE=e=>{const{popperInstanceRef:t,contentRef:r,triggerRef:n,role:i}=T.inject(Fc,void 0),a=T.ref(),u=T.ref(),o=T.computed(()=>({name:"eventListeners",enabled:!!e.visible})),f=T.computed(()=>{var H;const V=T.unref(a),I=(H=T.unref(u))!=null?H:AE;return{name:"arrow",enabled:!gC(V),options:{element:V,padding:I}}}),h=T.computed(()=>({onFirstUpdate:()=>{b()},...wE(e,[T.unref(f),T.unref(o)])})),p=T.computed(()=>HE(e.referenceEl)||T.unref(n)),{attributes:m,state:g,styles:v,update:b,forceUpdate:w,instanceRef:E}=QS(p,r,h);return T.watch(E,H=>t.value=H),T.onMounted(()=>{T.watch(()=>{var H;return(H=T.unref(p))==null?void 0:H.getBoundingClientRect()},()=>{b()})}),{attributes:m,arrowRef:a,contentRef:r,instanceRef:E,state:g,styles:v,role:i,forceUpdate:w,update:b}},EE=(e,{attributes:t,styles:r,role:n})=>{const{nextZIndex:i}=Jf(),a=Jt("popper"),u=T.computed(()=>T.unref(t).popper),o=T.ref(A2(e.zIndex)?e.zIndex:i()),f=T.computed(()=>[a.b(),a.is("pure",e.pure),a.is(e.effect),e.popperClass]),h=T.computed(()=>[{zIndex:T.unref(o)},T.unref(r).popper,e.popperStyle||{}]),p=T.computed(()=>n.value==="dialog"?"false":void 0),m=T.computed(()=>T.unref(r).arrow||{});return{ariaModal:p,arrowStyle:m,contentAttrs:u,contentClass:f,contentStyle:h,contentZIndex:o,updateZIndex:()=>{o.value=A2(e.zIndex)?e.zIndex:i()}}},VE=(e,t)=>{const r=T.ref(!1),n=T.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:h=>{var p;((p=h.detail)==null?void 0:p.focusReason)!=="pointer"&&(n.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:h=>{e.visible&&!r.value&&(h.target&&(n.value=h.target),r.value=!0)},onFocusoutPrevented:h=>{e.trapping||(h.detail.focusReason==="pointer"&&h.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,t("close")}}},DE=T.defineComponent({name:"ElPopperContent"}),OE=T.defineComponent({...DE,props:gp,emits:bE,setup(e,{expose:t,emit:r}){const n=e,{focusStartRef:i,trapped:a,onFocusAfterReleased:u,onFocusAfterTrapped:o,onFocusInTrap:f,onFocusoutPrevented:h,onReleaseRequested:p}=VE(n,r),{attributes:m,arrowRef:g,contentRef:v,styles:b,instanceRef:w,role:E,update:H}=SE(n),{ariaModal:V,arrowStyle:I,contentAttrs:N,contentClass:R,contentStyle:z,updateZIndex:Z}=EE(n,{styles:b,attributes:m,role:E}),K=T.inject(ra,void 0),ee=T.ref();T.provide(ap,{arrowStyle:I,arrowRef:g,arrowOffset:ee}),K&&(K.addInputId||K.removeInputId)&&T.provide(ra,{...K,addInputId:B5,removeInputId:B5});let ie;const de=(Ce=!0)=>{H(),Ce&&Z()},ge=()=>{de(!1),n.visible&&n.focusOnShow?a.value=!0:n.visible===!1&&(a.value=!1)};return T.onMounted(()=>{T.watch(()=>n.triggerTargetEl,(Ce,Re)=>{ie==null||ie(),ie=void 0;const Ze=T.unref(Ce||v.value),tt=T.unref(Re||v.value);Z5(Ze)&&(ie=T.watch([E,()=>n.ariaLabel,V,()=>n.id],Ee=>{["role","aria-label","aria-modal","id"].forEach((Ye,Pt)=>{an(Ee[Pt])?Ze.removeAttribute(Ye):Ze.setAttribute(Ye,Ee[Pt])})},{immediate:!0})),tt!==Ze&&Z5(tt)&&["role","aria-label","aria-modal","id"].forEach(Ee=>{tt.removeAttribute(Ee)})},{immediate:!0}),T.watch(()=>n.visible,ge,{immediate:!0})}),T.onBeforeUnmount(()=>{ie==null||ie(),ie=void 0}),t({popperContentRef:v,popperInstanceRef:w,updatePopper:de,contentStyle:z}),(Ce,Re)=>(T.openBlock(),T.createElementBlock("div",T.mergeProps({ref_key:"contentRef",ref:v},T.unref(N),{style:T.unref(z),class:T.unref(R),tabindex:"-1",onMouseenter:Re[0]||(Re[0]=Ze=>Ce.$emit("mouseenter",Ze)),onMouseleave:Re[1]||(Re[1]=Ze=>Ce.$emit("mouseleave",Ze))}),[T.createVNode(T.unref(vE),{trapped:T.unref(a),"trap-on-focus-in":!0,"focus-trap-el":T.unref(v),"focus-start-el":T.unref(i),onFocusAfterTrapped:T.unref(o),onFocusAfterReleased:T.unref(u),onFocusin:T.unref(f),onFocusoutPrevented:T.unref(h),onReleaseRequested:T.unref(p)},{default:T.withCtx(()=>[T.renderSlot(Ce.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var kE=e1(OE,[["__file","content.vue"]]);const PE=g3(tE),qc=Symbol("elTooltip"),J3=S1({...mS,...gp,appendTo:{type:r1([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:r1(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),ia=S1({...up,disabled:Boolean,trigger:{type:r1([String,Array]),default:"hover"},triggerKeys:{type:r1(Array),default:()=>[a3.enter,a3.space]}}),{useModelToggleProps:IE,useModelToggleEmits:BE,useModelToggle:NE}=vf("visible"),FE=S1({...op,...IE,...J3,...ia,...sp,showArrow:{type:Boolean,default:!0}}),RE=[...BE,"before-show","before-hide","show","hide","open","close"],jE=(e,t)=>K6(e)?e.includes(t):e===t,Qi=(e,t,r)=>n=>{jE(T.unref(e),t)&&r(n)},zE=T.defineComponent({name:"ElTooltipTrigger"}),$E=T.defineComponent({...zE,props:ia,setup(e,{expose:t}){const r=e,n=Jt("tooltip"),{controlled:i,id:a,open:u,onOpen:o,onClose:f,onToggle:h}=T.inject(qc,void 0),p=T.ref(null),m=()=>{if(T.unref(i)||r.disabled)return!0},g=T.toRef(r,"trigger"),v=mr(m,Qi(g,"hover",o)),b=mr(m,Qi(g,"hover",f)),w=mr(m,Qi(g,"click",N=>{N.button===0&&h(N)})),E=mr(m,Qi(g,"focus",o)),H=mr(m,Qi(g,"focus",f)),V=mr(m,Qi(g,"contextmenu",N=>{N.preventDefault(),h(N)})),I=mr(m,N=>{const{code:R}=N;r.triggerKeys.includes(R)&&(N.preventDefault(),h(N))});return t({triggerRef:p}),(N,R)=>(T.openBlock(),T.createBlock(T.unref(lE),{id:T.unref(a),"virtual-ref":N.virtualRef,open:T.unref(u),"virtual-triggering":N.virtualTriggering,class:T.normalizeClass(T.unref(n).e("trigger")),onBlur:T.unref(H),onClick:T.unref(w),onContextmenu:T.unref(V),onFocus:T.unref(E),onMouseenter:T.unref(v),onMouseleave:T.unref(b),onKeydown:T.unref(I)},{default:T.withCtx(()=>[T.renderSlot(N.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ZE=e1($E,[["__file","trigger.vue"]]);const qE=T.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),GE=T.defineComponent({...qE,props:J3,setup(e,{expose:t}){const r=e,{selector:n}=Gf(),i=Jt("tooltip"),a=T.ref(null),u=T.ref(!1),{controlled:o,id:f,open:h,trigger:p,onClose:m,onOpen:g,onShow:v,onHide:b,onBeforeShow:w,onBeforeHide:E}=T.inject(qc,void 0),H=T.computed(()=>r.transition||`${i.namespace.value}-fade-in-linear`),V=T.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);T.onBeforeUnmount(()=>{u.value=!0});const I=T.computed(()=>T.unref(V)?!0:T.unref(h)),N=T.computed(()=>r.disabled?!1:T.unref(h)),R=T.computed(()=>r.appendTo||n.value),z=T.computed(()=>{var Ee;return(Ee=r.style)!=null?Ee:{}}),Z=T.computed(()=>!T.unref(h)),K=()=>{b()},ee=()=>{if(T.unref(o))return!0},ie=mr(ee,()=>{r.enterable&&T.unref(p)==="hover"&&g()}),de=mr(ee,()=>{T.unref(p)==="hover"&&m()}),ge=()=>{var Ee,Ye;(Ye=(Ee=a.value)==null?void 0:Ee.updatePopper)==null||Ye.call(Ee),w==null||w()},Ce=()=>{E==null||E()},Re=()=>{v(),tt=ub(T.computed(()=>{var Ee;return(Ee=a.value)==null?void 0:Ee.popperContentRef}),()=>{if(T.unref(o))return;T.unref(p)!=="hover"&&m()})},Ze=()=>{r.virtualTriggering||m()};let tt;return T.watch(()=>T.unref(h),Ee=>{Ee||tt==null||tt()},{flush:"post"}),T.watch(()=>r.content,()=>{var Ee,Ye;(Ye=(Ee=a.value)==null?void 0:Ee.updatePopper)==null||Ye.call(Ee)}),t({contentRef:a}),(Ee,Ye)=>(T.openBlock(),T.createBlock(T.Teleport,{disabled:!Ee.teleported,to:T.unref(R)},[T.createVNode(T.Transition,{name:T.unref(H),onAfterLeave:K,onBeforeEnter:ge,onAfterEnter:Re,onBeforeLeave:Ce},{default:T.withCtx(()=>[T.unref(I)?T.withDirectives((T.openBlock(),T.createBlock(T.unref(kE),T.mergeProps({key:0,id:T.unref(f),ref_key:"contentRef",ref:a},Ee.$attrs,{"aria-label":Ee.ariaLabel,"aria-hidden":T.unref(Z),"boundaries-padding":Ee.boundariesPadding,"fallback-placements":Ee.fallbackPlacements,"gpu-acceleration":Ee.gpuAcceleration,offset:Ee.offset,placement:Ee.placement,"popper-options":Ee.popperOptions,strategy:Ee.strategy,effect:Ee.effect,enterable:Ee.enterable,pure:Ee.pure,"popper-class":Ee.popperClass,"popper-style":[Ee.popperStyle,T.unref(z)],"reference-el":Ee.referenceEl,"trigger-target-el":Ee.triggerTargetEl,visible:T.unref(N),"z-index":Ee.zIndex,onMouseenter:T.unref(ie),onMouseleave:T.unref(de),onBlur:Ze,onClose:T.unref(m)}),{default:T.withCtx(()=>[u.value?T.createCommentVNode("v-if",!0):T.renderSlot(Ee.$slots,"default",{key:0})]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[T.vShow,T.unref(N)]]):T.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"]))}});var UE=e1(GE,[["__file","content.vue"]]);const WE=["innerHTML"],XE={key:1},KE=T.defineComponent({name:"ElTooltip"}),JE=T.defineComponent({...KE,props:FE,emits:RE,setup(e,{expose:t,emit:r}){const n=e;pS();const i=ta(),a=T.ref(),u=T.ref(),o=()=>{var H;const V=T.unref(a);V&&((H=V.popperInstanceRef)==null||H.update())},f=T.ref(!1),h=T.ref(),{show:p,hide:m,hasUpdateHandler:g}=NE({indicator:f,toggleReason:h}),{onOpen:v,onClose:b}=yS({showAfter:T.toRef(n,"showAfter"),hideAfter:T.toRef(n,"hideAfter"),autoClose:T.toRef(n,"autoClose"),open:p,close:m}),w=T.computed(()=>on(n.visible)&&!g.value);T.provide(qc,{controlled:w,id:i,open:T.readonly(f),trigger:T.toRef(n,"trigger"),onOpen:H=>{v(H)},onClose:H=>{b(H)},onToggle:H=>{T.unref(f)?b(H):v(H)},onShow:()=>{r("show",h.value)},onHide:()=>{r("hide",h.value)},onBeforeShow:()=>{r("before-show",h.value)},onBeforeHide:()=>{r("before-hide",h.value)},updatePopper:o}),T.watch(()=>n.disabled,H=>{H&&f.value&&(f.value=!1)});const E=H=>{var V,I;const N=(I=(V=u.value)==null?void 0:V.contentRef)==null?void 0:I.popperContentRef,R=(H==null?void 0:H.relatedTarget)||document.activeElement;return N&&N.contains(R)};return T.onDeactivated(()=>f.value&&m()),t({popperRef:a,contentRef:u,isFocusInsideContent:E,updatePopper:o,onOpen:v,onClose:b,hide:m}),(H,V)=>(T.openBlock(),T.createBlock(T.unref(PE),{ref_key:"popperRef",ref:a,role:H.role},{default:T.withCtx(()=>[T.createVNode(ZE,{disabled:H.disabled,trigger:H.trigger,"trigger-keys":H.triggerKeys,"virtual-ref":H.virtualRef,"virtual-triggering":H.virtualTriggering},{default:T.withCtx(()=>[H.$slots.default?T.renderSlot(H.$slots,"default",{key:0}):T.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),T.createVNode(UE,{ref_key:"contentRef",ref:u,"aria-label":H.ariaLabel,"boundaries-padding":H.boundariesPadding,content:H.content,disabled:H.disabled,effect:H.effect,enterable:H.enterable,"fallback-placements":H.fallbackPlacements,"hide-after":H.hideAfter,"gpu-acceleration":H.gpuAcceleration,offset:H.offset,persistent:H.persistent,"popper-class":H.popperClass,"popper-style":H.popperStyle,placement:H.placement,"popper-options":H.popperOptions,pure:H.pure,"raw-content":H.rawContent,"reference-el":H.referenceEl,"trigger-target-el":H.triggerTargetEl,"show-after":H.showAfter,strategy:H.strategy,teleported:H.teleported,transition:H.transition,"virtual-triggering":H.virtualTriggering,"z-index":H.zIndex,"append-to":H.appendTo},{default:T.withCtx(()=>[T.renderSlot(H.$slots,"content",{},()=>[H.rawContent?(T.openBlock(),T.createElementBlock("span",{key:0,innerHTML:H.content},null,8,WE)):(T.openBlock(),T.createElementBlock("span",XE,T.toDisplayString(H.content),1))]),H.showArrow?(T.openBlock(),T.createBlock(T.unref(iE),{key:0,"arrow-offset":H.arrowOffset},null,8,["arrow-offset"])):T.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var YE=e1(JE,[["__file","tooltip.vue"]]);const Gc=g3(YE),_p=Symbol("buttonGroupContextKey"),eV=(e,t)=>{yf({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},T.computed(()=>e.type==="text"));const r=T.inject(_p,void 0),n=Ic("button"),{form:i}=Qn(),a=un(T.computed(()=>r==null?void 0:r.size)),u=ci(),o=T.ref(),f=T.useSlots(),h=T.computed(()=>e.type||(r==null?void 0:r.type)||""),p=T.computed(()=>{var b,w,E;return(E=(w=e.autoInsertSpace)!=null?w:(b=n.value)==null?void 0:b.autoInsertSpace)!=null?E:!1}),m=T.computed(()=>e.tag==="button"?{ariaDisabled:u.value||e.loading,disabled:u.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),g=T.computed(()=>{var b;const w=(b=f.default)==null?void 0:b.call(f);if(p.value&&(w==null?void 0:w.length)===1){const E=w[0];if((E==null?void 0:E.type)===T.Text){const H=E.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(H.trim())}}return!1});return{_disabled:u,_size:a,_type:h,_ref:o,_props:m,shouldAddSpace:g,handleClick:b=>{e.nativeType==="reset"&&(i==null||i.resetFields()),t("click",b)}}},Uc=S1({size:a6,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ln},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ln,default:()=>bc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:r1([String,Object]),default:"button"}}),tV={click:e=>e instanceof MouseEvent};function W2(e,t){rV(e)&&(e="100%");var r=nV(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function hs(e){return Math.min(1,Math.max(0,e))}function rV(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function nV(e){return typeof e=="string"&&e.indexOf("%")!==-1}function vp(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ds(e){return e<=1?"".concat(Number(e)*100,"%"):e}function o6(e){return e.length===1?"0"+e:String(e)}function iV(e,t,r){return{r:W2(e,255)*255,g:W2(t,255)*255,b:W2(r,255)*255}}function xp(e,t,r){e=W2(e,255),t=W2(t,255),r=W2(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=0,o=(n+i)/2;if(n===i)u=0,a=0;else{var f=n-i;switch(u=o>.5?f/(2-n-i):f/(n+i),n){case e:a=(t-r)/f+(t<r?6:0);break;case t:a=(r-e)/f+2;break;case r:a=(e-t)/f+4;break}a/=6}return{h:a,s:u,l:o}}function Wc(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function aV(e,t,r){var n,i,a;if(e=W2(e,360),t=W2(t,100),r=W2(r,100),t===0)i=r,a=r,n=r;else{var u=r<.5?r*(1+t):r+t-r*t,o=2*r-u;n=Wc(o,u,e+1/3),i=Wc(o,u,e),a=Wc(o,u,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function Lp(e,t,r){e=W2(e,255),t=W2(t,255),r=W2(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=n,o=n-i,f=n===0?0:o/n;if(n===i)a=0;else{switch(n){case e:a=(t-r)/o+(t<r?6:0);break;case t:a=(r-e)/o+2;break;case r:a=(e-t)/o+4;break}a/=6}return{h:a,s:f,v:u}}function oV(e,t,r){e=W2(e,360)*6,t=W2(t,100),r=W2(r,100);var n=Math.floor(e),i=e-n,a=r*(1-t),u=r*(1-i*t),o=r*(1-(1-i)*t),f=n%6,h=[r,u,a,a,o,r][f],p=[o,r,r,u,a,a][f],m=[a,a,o,r,r,u][f];return{r:h*255,g:p*255,b:m*255}}function bp(e,t,r,n){var i=[o6(Math.round(e).toString(16)),o6(Math.round(t).toString(16)),o6(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function sV(e,t,r,n,i){var a=[o6(Math.round(e).toString(16)),o6(Math.round(t).toString(16)),o6(Math.round(r).toString(16)),o6(lV(n))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function lV(e){return Math.round(parseFloat(e)*255).toString(16)}function wp(e){return Y3(e)/255}function Y3(e){return parseInt(e,16)}function cV(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Xc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function uV(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,o=!1;return typeof e=="string"&&(e=hV(e)),typeof e=="object"&&(xr(e.r)&&xr(e.g)&&xr(e.b)?(t=iV(e.r,e.g,e.b),u=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):xr(e.h)&&xr(e.s)&&xr(e.v)?(n=ds(e.s),i=ds(e.v),t=oV(e.h,n,i),u=!0,o="hsv"):xr(e.h)&&xr(e.s)&&xr(e.l)&&(n=ds(e.s),a=ds(e.l),t=aV(e.h,n,a),u=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=vp(r),{ok:u,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var QV="[-\\+]?\\d+%?",TV="[-\\+]?\\d*\\.\\d+%?",hn="(?:".concat(TV,")|(?:").concat(QV,")"),Kc="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),Jc="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),b4={CSS_UNIT:new RegExp(hn),rgb:new RegExp("rgb"+Kc),rgba:new RegExp("rgba"+Jc),hsl:new RegExp("hsl"+Kc),hsla:new RegExp("hsla"+Jc),hsv:new RegExp("hsv"+Kc),hsva:new RegExp("hsva"+Jc),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 hV(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Xc[e])e=Xc[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=b4.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=b4.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=b4.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=b4.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=b4.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=b4.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=b4.hex8.exec(e),r?{r:Y3(r[1]),g:Y3(r[2]),b:Y3(r[3]),a:wp(r[4]),format:t?"name":"hex8"}:(r=b4.hex6.exec(e),r?{r:Y3(r[1]),g:Y3(r[2]),b:Y3(r[3]),format:t?"name":"hex"}:(r=b4.hex4.exec(e),r?{r:Y3(r[1]+r[1]),g:Y3(r[2]+r[2]),b:Y3(r[3]+r[3]),a:wp(r[4]+r[4]),format:t?"name":"hex8"}:(r=b4.hex3.exec(e),r?{r:Y3(r[1]+r[1]),g:Y3(r[2]+r[2]),b:Y3(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function xr(e){return!!b4.CSS_UNIT.exec(String(e))}var dV=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=cV(t)),this.originalInput=t;var i=uV(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,i,a=t.r/255,u=t.g/255,o=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),u<=.03928?n=u/12.92:n=Math.pow((u+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=vp(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Lp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Lp(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=xp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=xp(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),bp(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sV(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(W2(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(W2(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+bp(this.r,this.g,this.b,!1),r=0,n=Object.entries(Xc);r<n.length;r++){var i=n[r],a=i[0],u=i[1];if(t===u)return a}return!1},e.prototype.toString=function(t){var r=!!t;t=t??this.format;var n=!1,i=this.a<1&&this.a>=0,a=!r&&i&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=hs(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=hs(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=hs(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=hs(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return new e(u)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,a=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,i=r.s,a=r.v,u=[],o=1/t;t--;)u.push(new e({h:n,s:i,v:a})),a=(a+o)%1;return u},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),i=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,i=[this],a=360/t,u=1;u<t;u++)i.push(new e({h:(n+u*a)%360,s:r.s,l:r.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function dn(e,t=20){return e.mix("#141414",t).toString()}function fV(e){const t=ci(),r=Jt("button");return T.computed(()=>{let n={};const i=e.color;if(i){const a=new dV(i),u=e.dark?a.tint(20).toString():dn(a,20);if(e.plain)n=r.cssVarBlock({"bg-color":e.dark?dn(a,90):a.tint(90).toString(),"text-color":i,"border-color":e.dark?dn(a,50):a.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":i,"hover-border-color":i,"active-bg-color":u,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":u}),t.value&&(n[r.cssVarBlockName("disabled-bg-color")]=e.dark?dn(a,90):a.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=e.dark?dn(a,50):a.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=e.dark?dn(a,80):a.tint(80).toString());else{const o=e.dark?dn(a,30):a.tint(30).toString(),f=a.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":i,"text-color":f,"border-color":i,"hover-bg-color":o,"hover-text-color":f,"hover-border-color":o,"active-bg-color":u,"active-border-color":u}),t.value){const h=e.dark?dn(a,50):a.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=h,n[r.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=h}}}return n})}const pV=T.defineComponent({name:"ElButton"}),mV=T.defineComponent({...pV,props:Uc,emits:tV,setup(e,{expose:t,emit:r}){const n=e,i=fV(n),a=Jt("button"),{_ref:u,_size:o,_type:f,_disabled:h,_props:p,shouldAddSpace:m,handleClick:g}=eV(n,r);return t({ref:u,size:o,type:f,disabled:h,shouldAddSpace:m}),(v,b)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(v.tag),T.mergeProps({ref_key:"_ref",ref:u},T.unref(p),{class:[T.unref(a).b(),T.unref(a).m(T.unref(f)),T.unref(a).m(T.unref(o)),T.unref(a).is("disabled",T.unref(h)),T.unref(a).is("loading",v.loading),T.unref(a).is("plain",v.plain),T.unref(a).is("round",v.round),T.unref(a).is("circle",v.circle),T.unref(a).is("text",v.text),T.unref(a).is("link",v.link),T.unref(a).is("has-bg",v.bg)],style:T.unref(i),onClick:T.unref(g)}),{default:T.withCtx(()=>[v.loading?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[v.$slots.loading?T.renderSlot(v.$slots,"loading",{key:0}):(T.openBlock(),T.createBlock(T.unref(U2),{key:1,class:T.normalizeClass(T.unref(a).is("loading"))},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(v.loadingIcon)))]),_:1},8,["class"]))],64)):v.icon||v.$slots.icon?(T.openBlock(),T.createBlock(T.unref(U2),{key:1},{default:T.withCtx(()=>[v.icon?(T.openBlock(),T.createBlock(T.resolveDynamicComponent(v.icon),{key:0})):T.renderSlot(v.$slots,"icon",{key:1})]),_:3})):T.createCommentVNode("v-if",!0),v.$slots.default?(T.openBlock(),T.createElementBlock("span",{key:2,class:T.normalizeClass({[T.unref(a).em("text","expand")]:T.unref(m)})},[T.renderSlot(v.$slots,"default")],2)):T.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var yV=e1(mV,[["__file","button.vue"]]);const gV={size:Uc.size,type:Uc.type},_V=T.defineComponent({name:"ElButtonGroup"}),vV=T.defineComponent({..._V,props:gV,setup(e){const t=e;T.provide(_p,T.reactive({size:T.toRef(t,"size"),type:T.toRef(t,"type")}));const r=Jt("button");return(n,i)=>(T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(`${T.unref(r).b("group")}`)},[T.renderSlot(n.$slots,"default")],2))}});var Hp=e1(vV,[["__file","button-group.vue"]]);const W4=g3(yV,{ButtonGroup:Hp});v4(Hp);var D=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xV(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}const fn=new Map;let Mp;M2&&(document.addEventListener("mousedown",e=>Mp=e),document.addEventListener("mouseup",e=>{for(const t of fn.values())for(const{documentHandler:r}of t)r(e,Mp)}));function Cp(e,t){let r=[];return Array.isArray(t.arg)?r=t.arg:Z5(t.arg)&&r.push(t.arg),function(n,i){const a=t.instance.popperRef,u=n.target,o=i==null?void 0:i.target,f=!t||!t.instance,h=!u||!o,p=e.contains(u)||e.contains(o),m=e===u,g=r.length&&r.some(b=>b==null?void 0:b.contains(u))||r.length&&r.includes(o),v=a&&(a.contains(u)||a.contains(o));f||h||p||m||g||v||t.value(n,i)}}const Ap={beforeMount(e,t){fn.has(e)||fn.set(e,[]),fn.get(e).push({documentHandler:Cp(e,t),bindingFn:t.value})},updated(e,t){fn.has(e)||fn.set(e,[]);const r=fn.get(e),n=r.findIndex(a=>a.bindingFn===t.oldValue),i={documentHandler:Cp(e,t),bindingFn:t.value};n>=0?r.splice(n,1,i):r.push(i)},unmounted(e){fn.delete(e)}},Sp={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:a6,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},Ep={[f2]:e=>C2(e)||A2(e)||on(e),change:e=>C2(e)||A2(e)||on(e)},Ti=Symbol("checkboxGroupContextKey"),LV=({model:e,isChecked:t})=>{const r=T.inject(Ti,void 0),n=T.computed(()=>{var a,u;const o=(a=r==null?void 0:r.max)==null?void 0:a.value,f=(u=r==null?void 0:r.min)==null?void 0:u.value;return!$5(o)&&e.value.length>=o&&!t.value||!$5(f)&&e.value.length<=f&&t.value});return{isDisabled:ci(T.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},bV=(e,{model:t,isLimitExceeded:r,hasOwnLabel:n,isDisabled:i,isLabeledByFormItem:a})=>{const u=T.inject(Ti,void 0),{formItem:o}=Qn(),{emit:f}=T.getCurrentInstance();function h(b){var w,E;return b===e.trueLabel||b===!0?(w=e.trueLabel)!=null?w:!0:(E=e.falseLabel)!=null?E:!1}function p(b,w){f("change",h(b),w)}function m(b){if(r.value)return;const w=b.target;f("change",h(w.checked),b)}async function g(b){r.value||!n.value&&!i.value&&a.value&&(b.composedPath().some(H=>H.tagName==="LABEL")||(t.value=h([!1,e.falseLabel].includes(t.value)),await T.nextTick(),p(t.value,b)))}const v=T.computed(()=>(u==null?void 0:u.validateEvent)||e.validateEvent);return T.watch(()=>e.modelValue,()=>{v.value&&(o==null||o.validate("change").catch(b=>S2(b)))}),{handleChange:m,onClickRoot:g}},wV=e=>{const t=T.ref(!1),{emit:r}=T.getCurrentInstance(),n=T.inject(Ti,void 0),i=T.computed(()=>$5(n)===!1),a=T.ref(!1);return{model:T.computed({get(){var o,f;return i.value?(o=n==null?void 0:n.modelValue)==null?void 0:o.value:(f=e.modelValue)!=null?f:t.value},set(o){var f,h;i.value&&K6(o)?(a.value=((f=n==null?void 0:n.max)==null?void 0:f.value)!==void 0&&o.length>(n==null?void 0:n.max.value),a.value===!1&&((h=n==null?void 0:n.changeEvent)==null||h.call(n,o))):(r(f2,o),t.value=o)}}),isGroup:i,isLimitExceeded:a}},HV=(e,t,{model:r})=>{const n=T.inject(Ti,void 0),i=T.ref(!1),a=T.computed(()=>{const h=r.value;return on(h)?h:K6(h)?i3(e.label)?h.map(T.toRaw).some(p=>vc(p,e.label)):h.map(T.toRaw).includes(e.label):h!=null?h===e.trueLabel:!!h}),u=un(T.computed(()=>{var h;return(h=n==null?void 0:n.size)==null?void 0:h.value}),{prop:!0}),o=un(T.computed(()=>{var h;return(h=n==null?void 0:n.size)==null?void 0:h.value})),f=T.computed(()=>!!t.default||!an(e.label));return{checkboxButtonSize:u,isChecked:a,isFocused:i,checkboxSize:o,hasOwnLabel:f}},MV=(e,{model:t})=>{function r(){K6(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&r()},Vp=(e,t)=>{const{formItem:r}=Qn(),{model:n,isGroup:i,isLimitExceeded:a}=wV(e),{isFocused:u,isChecked:o,checkboxButtonSize:f,checkboxSize:h,hasOwnLabel:p}=HV(e,t,{model:n}),{isDisabled:m}=LV({model:n,isChecked:o}),{inputId:g,isLabeledByFormItem:v}=na(e,{formItemContext:r,disableIdGeneration:p,disableIdManagement:i}),{handleChange:b,onClickRoot:w}=bV(e,{model:n,isLimitExceeded:a,hasOwnLabel:p,isDisabled:m,isLabeledByFormItem:v});return MV(e,{model:n}),{inputId:g,isLabeledByFormItem:v,isChecked:o,isDisabled:m,isFocused:u,checkboxButtonSize:f,checkboxSize:h,hasOwnLabel:p,model:n,handleChange:b,onClickRoot:w}},CV=["id","indeterminate","name","tabindex","disabled","true-value","false-value"],AV=["id","indeterminate","disabled","value","name","tabindex"],SV=T.defineComponent({name:"ElCheckbox"}),EV=T.defineComponent({...SV,props:Sp,emits:Ep,setup(e){const t=e,r=T.useSlots(),{inputId:n,isLabeledByFormItem:i,isChecked:a,isDisabled:u,isFocused:o,checkboxSize:f,hasOwnLabel:h,model:p,handleChange:m,onClickRoot:g}=Vp(t,r),v=Jt("checkbox"),b=T.computed(()=>[v.b(),v.m(f.value),v.is("disabled",u.value),v.is("bordered",t.border),v.is("checked",a.value)]),w=T.computed(()=>[v.e("input"),v.is("disabled",u.value),v.is("checked",a.value),v.is("indeterminate",t.indeterminate),v.is("focus",o.value)]);return(E,H)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(!T.unref(h)&&T.unref(i)?"span":"label"),{class:T.normalizeClass(T.unref(b)),"aria-controls":E.indeterminate?E.controls:null,onClick:T.unref(g)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w))},[E.trueLabel||E.falseLabel?T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:0,id:T.unref(n),"onUpdate:modelValue":H[0]||(H[0]=V=>T.isRef(p)?p.value=V:null),class:T.normalizeClass(T.unref(v).e("original")),type:"checkbox",indeterminate:E.indeterminate,name:E.name,tabindex:E.tabindex,disabled:T.unref(u),"true-value":E.trueLabel,"false-value":E.falseLabel,onChange:H[1]||(H[1]=(...V)=>T.unref(m)&&T.unref(m)(...V)),onFocus:H[2]||(H[2]=V=>o.value=!0),onBlur:H[3]||(H[3]=V=>o.value=!1),onClick:H[4]||(H[4]=T.withModifiers(()=>{},["stop"]))},null,42,CV)),[[T.vModelCheckbox,T.unref(p)]]):T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:1,id:T.unref(n),"onUpdate:modelValue":H[5]||(H[5]=V=>T.isRef(p)?p.value=V:null),class:T.normalizeClass(T.unref(v).e("original")),type:"checkbox",indeterminate:E.indeterminate,disabled:T.unref(u),value:E.label,name:E.name,tabindex:E.tabindex,onChange:H[6]||(H[6]=(...V)=>T.unref(m)&&T.unref(m)(...V)),onFocus:H[7]||(H[7]=V=>o.value=!0),onBlur:H[8]||(H[8]=V=>o.value=!1),onClick:H[9]||(H[9]=T.withModifiers(()=>{},["stop"]))},null,42,AV)),[[T.vModelCheckbox,T.unref(p)]]),T.createElementVNode("span",{class:T.normalizeClass(T.unref(v).e("inner"))},null,2)],2),T.unref(h)?(T.openBlock(),T.createElementBlock("span",{key:0,class:T.normalizeClass(T.unref(v).e("label"))},[T.renderSlot(E.$slots,"default"),E.$slots.default?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createTextVNode(T.toDisplayString(E.label),1)],64))],2)):T.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-controls","onClick"]))}});var VV=e1(EV,[["__file","checkbox.vue"]]);const DV=["name","tabindex","disabled","true-value","false-value"],OV=["name","tabindex","disabled","value"],kV=T.defineComponent({name:"ElCheckboxButton"}),PV=T.defineComponent({...kV,props:Sp,emits:Ep,setup(e){const t=e,r=T.useSlots(),{isFocused:n,isChecked:i,isDisabled:a,checkboxButtonSize:u,model:o,handleChange:f}=Vp(t,r),h=T.inject(Ti,void 0),p=Jt("checkbox"),m=T.computed(()=>{var v,b,w,E;const H=(b=(v=h==null?void 0:h.fill)==null?void 0:v.value)!=null?b:"";return{backgroundColor:H,borderColor:H,color:(E=(w=h==null?void 0:h.textColor)==null?void 0:w.value)!=null?E:"",boxShadow:H?`-1px 0 0 0 ${H}`:void 0}}),g=T.computed(()=>[p.b("button"),p.bm("button",u.value),p.is("disabled",a.value),p.is("checked",i.value),p.is("focus",n.value)]);return(v,b)=>(T.openBlock(),T.createElementBlock("label",{class:T.normalizeClass(T.unref(g))},[v.trueLabel||v.falseLabel?T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:0,"onUpdate:modelValue":b[0]||(b[0]=w=>T.isRef(o)?o.value=w:null),class:T.normalizeClass(T.unref(p).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:T.unref(a),"true-value":v.trueLabel,"false-value":v.falseLabel,onChange:b[1]||(b[1]=(...w)=>T.unref(f)&&T.unref(f)(...w)),onFocus:b[2]||(b[2]=w=>n.value=!0),onBlur:b[3]||(b[3]=w=>n.value=!1),onClick:b[4]||(b[4]=T.withModifiers(()=>{},["stop"]))},null,42,DV)),[[T.vModelCheckbox,T.unref(o)]]):T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:1,"onUpdate:modelValue":b[5]||(b[5]=w=>T.isRef(o)?o.value=w:null),class:T.normalizeClass(T.unref(p).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:T.unref(a),value:v.label,onChange:b[6]||(b[6]=(...w)=>T.unref(f)&&T.unref(f)(...w)),onFocus:b[7]||(b[7]=w=>n.value=!0),onBlur:b[8]||(b[8]=w=>n.value=!1),onClick:b[9]||(b[9]=T.withModifiers(()=>{},["stop"]))},null,42,OV)),[[T.vModelCheckbox,T.unref(o)]]),v.$slots.default||v.label?(T.openBlock(),T.createElementBlock("span",{key:2,class:T.normalizeClass(T.unref(p).be("button","inner")),style:T.normalizeStyle(T.unref(i)?T.unref(m):void 0)},[T.renderSlot(v.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(v.label),1)])],6)):T.createCommentVNode("v-if",!0)],2))}});var Dp=e1(PV,[["__file","checkbox-button.vue"]]);const IV=S1({modelValue:{type:r1(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:a6,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),BV={[f2]:e=>K6(e),change:e=>K6(e)},NV=T.defineComponent({name:"ElCheckboxGroup"}),FV=T.defineComponent({...NV,props:IV,emits:BV,setup(e,{emit:t}){const r=e,n=Jt("checkbox"),{formItem:i}=Qn(),{inputId:a,isLabeledByFormItem:u}=na(r,{formItemContext:i}),o=async h=>{t(f2,h),await T.nextTick(),t("change",h)},f=T.computed({get(){return r.modelValue},set(h){o(h)}});return T.provide(Ti,{...LC(T.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:f,changeEvent:o}),T.watch(()=>r.modelValue,()=>{r.validateEvent&&(i==null||i.validate("change").catch(h=>S2(h)))}),(h,p)=>{var m;return T.openBlock(),T.createBlock(T.resolveDynamicComponent(h.tag),{id:T.unref(a),class:T.normalizeClass(T.unref(n).b("group")),role:"group","aria-label":T.unref(u)?void 0:h.label||"checkbox-group","aria-labelledby":T.unref(u)?(m=T.unref(i))==null?void 0:m.labelId:void 0},{default:T.withCtx(()=>[T.renderSlot(h.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var Op=e1(FV,[["__file","checkbox-group.vue"]]);const fs=g3(VV,{CheckboxButton:Dp,CheckboxGroup:Op});v4(Dp);const eu=v4(Op),kp=S1({size:a6,disabled:Boolean,label:{type:[String,Number,Boolean],default:""}}),RV=S1({...kp,modelValue:{type:[String,Number,Boolean],default:""},name:{type:String,default:""},border:Boolean}),Pp={[f2]:e=>C2(e)||A2(e)||on(e),[es]:e=>C2(e)||A2(e)||on(e)},Ip=Symbol("radioGroupKey"),Bp=(e,t)=>{const r=T.ref(),n=T.inject(Ip,void 0),i=T.computed(()=>!!n),a=T.computed({get(){return i.value?n.modelValue:e.modelValue},set(p){i.value?n.changeEvent(p):t&&t(f2,p),r.value.checked=e.modelValue===e.label}}),u=un(T.computed(()=>n==null?void 0:n.size)),o=ci(T.computed(()=>n==null?void 0:n.disabled)),f=T.ref(!1),h=T.computed(()=>o.value||i.value&&a.value!==e.label?-1:0);return{radioRef:r,isGroup:i,radioGroup:n,focus:f,size:u,disabled:o,tabIndex:h,modelValue:a}},jV=["value","name","disabled"],zV=T.defineComponent({name:"ElRadio"}),$V=T.defineComponent({...zV,props:RV,emits:Pp,setup(e,{emit:t}){const r=e,n=Jt("radio"),{radioRef:i,radioGroup:a,focus:u,size:o,disabled:f,modelValue:h}=Bp(r,t);function p(){T.nextTick(()=>t("change",h.value))}return(m,g)=>{var v;return T.openBlock(),T.createElementBlock("label",{class:T.normalizeClass([T.unref(n).b(),T.unref(n).is("disabled",T.unref(f)),T.unref(n).is("focus",T.unref(u)),T.unref(n).is("bordered",m.border),T.unref(n).is("checked",T.unref(h)===m.label),T.unref(n).m(T.unref(o))])},[T.createElementVNode("span",{class:T.normalizeClass([T.unref(n).e("input"),T.unref(n).is("disabled",T.unref(f)),T.unref(n).is("checked",T.unref(h)===m.label)])},[T.withDirectives(T.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":g[0]||(g[0]=b=>T.isRef(h)?h.value=b:null),class:T.normalizeClass(T.unref(n).e("original")),value:m.label,name:m.name||((v=T.unref(a))==null?void 0:v.name),disabled:T.unref(f),type:"radio",onFocus:g[1]||(g[1]=b=>u.value=!0),onBlur:g[2]||(g[2]=b=>u.value=!1),onChange:p,onClick:g[3]||(g[3]=T.withModifiers(()=>{},["stop"]))},null,42,jV),[[T.vModelRadio,T.unref(h)]]),T.createElementVNode("span",{class:T.normalizeClass(T.unref(n).e("inner"))},null,2)],2),T.createElementVNode("span",{class:T.normalizeClass(T.unref(n).e("label")),onKeydown:g[4]||(g[4]=T.withModifiers(()=>{},["stop"]))},[T.renderSlot(m.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(m.label),1)])],34)],2)}}});var ZV=e1($V,[["__file","radio.vue"]]);const qV=S1({...kp,name:{type:String,default:""}}),GV=["value","name","disabled"],UV=T.defineComponent({name:"ElRadioButton"}),WV=T.defineComponent({...UV,props:qV,setup(e){const t=e,r=Jt("radio"),{radioRef:n,focus:i,size:a,disabled:u,modelValue:o,radioGroup:f}=Bp(t),h=T.computed(()=>({backgroundColor:(f==null?void 0:f.fill)||"",borderColor:(f==null?void 0:f.fill)||"",boxShadow:f!=null&&f.fill?`-1px 0 0 0 ${f.fill}`:"",color:(f==null?void 0:f.textColor)||""}));return(p,m)=>{var g;return T.openBlock(),T.createElementBlock("label",{class:T.normalizeClass([T.unref(r).b("button"),T.unref(r).is("active",T.unref(o)===p.label),T.unref(r).is("disabled",T.unref(u)),T.unref(r).is("focus",T.unref(i)),T.unref(r).bm("button",T.unref(a))])},[T.withDirectives(T.createElementVNode("input",{ref_key:"radioRef",ref:n,"onUpdate:modelValue":m[0]||(m[0]=v=>T.isRef(o)?o.value=v:null),class:T.normalizeClass(T.unref(r).be("button","original-radio")),value:p.label,type:"radio",name:p.name||((g=T.unref(f))==null?void 0:g.name),disabled:T.unref(u),onFocus:m[1]||(m[1]=v=>i.value=!0),onBlur:m[2]||(m[2]=v=>i.value=!1),onClick:m[3]||(m[3]=T.withModifiers(()=>{},["stop"]))},null,42,GV),[[T.vModelRadio,T.unref(o)]]),T.createElementVNode("span",{class:T.normalizeClass(T.unref(r).be("button","inner")),style:T.normalizeStyle(T.unref(o)===p.label?T.unref(h):{}),onKeydown:m[4]||(m[4]=T.withModifiers(()=>{},["stop"]))},[T.renderSlot(p.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(p.label),1)])],38)],2)}}});var Np=e1(WV,[["__file","radio-button.vue"]]);const XV=S1({id:{type:String,default:void 0},size:a6,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:""},fill:{type:String,default:""},label:{type:String,default:void 0},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0}}),KV=Pp,JV=["id","aria-label","aria-labelledby"],YV=T.defineComponent({name:"ElRadioGroup"}),eD=T.defineComponent({...YV,props:XV,emits:KV,setup(e,{emit:t}){const r=e,n=Jt("radio"),i=ta(),a=T.ref(),{formItem:u}=Qn(),{inputId:o,isLabeledByFormItem:f}=na(r,{formItemContext:u}),h=m=>{t(f2,m),T.nextTick(()=>t("change",m))};T.onMounted(()=>{const m=a.value.querySelectorAll("[type=radio]"),g=m[0];!Array.from(m).some(v=>v.checked)&&g&&(g.tabIndex=0)});const p=T.computed(()=>r.name||i.value);return T.provide(Ip,T.reactive({...T.toRefs(r),changeEvent:h,name:p})),T.watch(()=>r.modelValue,()=>{r.validateEvent&&(u==null||u.validate("change").catch(m=>S2(m)))}),(m,g)=>(T.openBlock(),T.createElementBlock("div",{id:T.unref(o),ref_key:"radioGroupRef",ref:a,class:T.normalizeClass(T.unref(n).b("group")),role:"radiogroup","aria-label":T.unref(f)?void 0:m.label||"radio-group","aria-labelledby":T.unref(f)?T.unref(u).labelId:void 0},[T.renderSlot(m.$slots,"default")],10,JV))}});var Fp=e1(eD,[["__file","radio-group.vue"]]);const Rp=g3(ZV,{RadioButton:Np,RadioGroup:Fp}),jp=v4(Fp);v4(Np);const zp=S1({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:wc,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),tD={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},rD=T.defineComponent({name:"ElTag"}),nD=T.defineComponent({...rD,props:zp,emits:tD,setup(e,{emit:t}){const r=e,n=un(),i=Jt("tag"),a=T.computed(()=>{const{type:f,hit:h,effect:p,closable:m,round:g}=r;return[i.b(),i.is("closable",m),i.m(f),i.m(n.value),i.m(p),i.is("hit",h),i.is("round",g)]}),u=f=>{t("close",f)},o=f=>{t("click",f)};return(f,h)=>f.disableTransitions?(T.openBlock(),T.createElementBlock("span",{key:0,class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle({backgroundColor:f.color}),onClick:o},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(i).e("content"))},[T.renderSlot(f.$slots,"default")],2),f.closable?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(i).e("close")),onClick:T.withModifiers(u,["stop"])},{default:T.withCtx(()=>[T.createVNode(T.unref(G5))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0)],6)):(T.openBlock(),T.createBlock(T.Transition,{key:1,name:`${T.unref(i).namespace.value}-zoom-in-center`,appear:""},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle({backgroundColor:f.color}),onClick:o},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(i).e("content"))},[T.renderSlot(f.$slots,"default")],2),f.closable?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(i).e("close")),onClick:T.withModifiers(u,["stop"])},{default:T.withCtx(()=>[T.createVNode(T.unref(G5))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var iD=e1(nD,[["__file","tag.vue"]]);const aD=g3(iD),$p=Symbol("rowContextKey"),oD=S1({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),sD=T.defineComponent({name:"ElRow"}),lD=T.defineComponent({...sD,props:oD,setup(e){const t=e,r=Jt("row"),n=T.computed(()=>t.gutter);T.provide($p,{gutter:n});const i=T.computed(()=>{const u={};return t.gutter&&(u.marginRight=u.marginLeft=`-${t.gutter/2}px`),u}),a=T.computed(()=>[r.b(),r.is(`justify-${t.justify}`,t.justify!=="start"),r.is(`align-${t.align}`,!!t.align)]);return(u,o)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(u.tag),{class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle(T.unref(i))},{default:T.withCtx(()=>[T.renderSlot(u.$slots,"default")]),_:3},8,["class","style"]))}});var cD=e1(lD,[["__file","row.vue"]]);const X4=g3(cD),uD=S1({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:r1([Number,Object]),default:()=>ti({})},sm:{type:r1([Number,Object]),default:()=>ti({})},md:{type:r1([Number,Object]),default:()=>ti({})},lg:{type:r1([Number,Object]),default:()=>ti({})},xl:{type:r1([Number,Object]),default:()=>ti({})}}),QD=T.defineComponent({name:"ElCol"}),TD=T.defineComponent({...QD,props:uD,setup(e){const t=e,{gutter:r}=T.inject($p,{gutter:T.computed(()=>0)}),n=Jt("col"),i=T.computed(()=>{const u={};return r.value&&(u.paddingLeft=u.paddingRight=`${r.value/2}px`),u}),a=T.computed(()=>{const u=[];return["span","offset","pull","push"].forEach(h=>{const p=t[h];A2(p)&&(h==="span"?u.push(n.b(`${t[h]}`)):p>0&&u.push(n.b(`${h}-${t[h]}`)))}),["xs","sm","md","lg","xl"].forEach(h=>{A2(t[h])?u.push(n.b(`${h}-${t[h]}`)):i3(t[h])&&Object.entries(t[h]).forEach(([p,m])=>{u.push(p!=="span"?n.b(`${h}-${p}-${m}`):n.b(`${h}-${m}`))})}),r.value&&u.push(n.is("guttered")),[n.b(),u]});return(u,o)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(u.tag),{class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle(T.unref(i))},{default:T.withCtx(()=>[T.renderSlot(u.$slots,"default")]),_:3},8,["class","style"]))}});var hD=e1(TD,[["__file","col.vue"]]);const Lr=g3(hD),dD=T.defineComponent({name:"ElCollapseTransition"}),fD=T.defineComponent({...dD,setup(e){const t=Jt("collapse-transition"),r=i=>{i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom},n={beforeEnter(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.style.height&&(i.dataset.elExistsHeight=i.style.height),i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0},enter(i){requestAnimationFrame(()=>{i.dataset.oldOverflow=i.style.overflow,i.dataset.elExistsHeight?i.style.maxHeight=i.dataset.elExistsHeight:i.scrollHeight!==0?i.style.maxHeight=`${i.scrollHeight}px`:i.style.maxHeight=0,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom,i.style.overflow="hidden"})},afterEnter(i){i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow},enterCancelled(i){r(i)},beforeLeave(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.dataset.oldOverflow=i.style.overflow,i.style.maxHeight=`${i.scrollHeight}px`,i.style.overflow="hidden"},leave(i){i.scrollHeight!==0&&(i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0)},afterLeave(i){r(i)},leaveCancelled(i){r(i)}};return(i,a)=>(T.openBlock(),T.createBlock(T.Transition,T.mergeProps({name:T.unref(t).b()},T.toHandlers(n)),{default:T.withCtx(()=>[T.renderSlot(i.$slots,"default")]),_:3},16,["name"]))}});var ps=e1(fD,[["__file","collapse-transition.vue"]]);ps.install=e=>{e.component(ps.name,ps)};const pD=ps,mD=S1({color:{type:r1(Object),required:!0},vertical:{type:Boolean,default:!1}});let tu=!1;function aa(e,t){if(!M2)return;const r=function(a){var u;(u=t.drag)==null||u.call(t,a)},n=function(a){var u;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,tu=!1,(u=t.end)==null||u.call(t,a)},i=function(a){var u;tu||(a.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),tu=!0,(u=t.start)==null||u.call(t,a))};e.addEventListener("mousedown",i),e.addEventListener("touchstart",i)}const yD=e=>{const t=T.getCurrentInstance(),r=T.shallowRef(),n=T.shallowRef();function i(u){u.target!==r.value&&a(u)}function a(u){if(!n.value||!r.value)return;const f=t.vnode.el.getBoundingClientRect(),{clientX:h,clientY:p}=tc(u);if(e.vertical){let m=p-f.top;m=Math.max(r.value.offsetHeight/2,m),m=Math.min(m,f.height-r.value.offsetHeight/2),e.color.set("alpha",Math.round((m-r.value.offsetHeight/2)/(f.height-r.value.offsetHeight)*100))}else{let m=h-f.left;m=Math.max(r.value.offsetWidth/2,m),m=Math.min(m,f.width-r.value.offsetWidth/2),e.color.set("alpha",Math.round((m-r.value.offsetWidth/2)/(f.width-r.value.offsetWidth)*100))}}return{thumb:r,bar:n,handleDrag:a,handleClick:i}},gD=(e,{bar:t,thumb:r,handleDrag:n})=>{const i=T.getCurrentInstance(),a=Jt("color-alpha-slider"),u=T.ref(0),o=T.ref(0),f=T.ref();function h(){if(!r.value||e.vertical)return 0;const V=i.vnode.el,I=e.color.get("alpha");return V?Math.round(I*(V.offsetWidth-r.value.offsetWidth/2)/100):0}function p(){if(!r.value)return 0;const V=i.vnode.el;if(!e.vertical)return 0;const I=e.color.get("alpha");return V?Math.round(I*(V.offsetHeight-r.value.offsetHeight/2)/100):0}function m(){if(e.color&&e.color.value){const{r:V,g:I,b:N}=e.color.toRgb();return`linear-gradient(to right, rgba(${V}, ${I}, ${N}, 0) 0%, rgba(${V}, ${I}, ${N}, 1) 100%)`}return""}function g(){u.value=h(),o.value=p(),f.value=m()}T.onMounted(()=>{if(!t.value||!r.value)return;const V={drag:I=>{n(I)},end:I=>{n(I)}};aa(t.value,V),aa(r.value,V),g()}),T.watch(()=>e.color.get("alpha"),()=>g()),T.watch(()=>e.color.value,()=>g());const v=T.computed(()=>[a.b(),a.is("vertical",e.vertical)]),b=T.computed(()=>a.e("bar")),w=T.computed(()=>a.e("thumb")),E=T.computed(()=>({background:f.value})),H=T.computed(()=>({left:ei(u.value),top:ei(o.value)}));return{rootKls:v,barKls:b,barStyle:E,thumbKls:w,thumbStyle:H,update:g}},_D=T.defineComponent({name:"ElColorAlphaSlider"}),vD=T.defineComponent({..._D,props:mD,setup(e,{expose:t}){const r=e,{bar:n,thumb:i,handleDrag:a,handleClick:u}=yD(r),{rootKls:o,barKls:f,barStyle:h,thumbKls:p,thumbStyle:m,update:g}=gD(r,{bar:n,thumb:i,handleDrag:a});return t({update:g,bar:n,thumb:i}),(v,b)=>(T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(T.unref(o))},[T.createElementVNode("div",{ref_key:"bar",ref:n,class:T.normalizeClass(T.unref(f)),style:T.normalizeStyle(T.unref(h)),onClick:b[0]||(b[0]=(...w)=>T.unref(u)&&T.unref(u)(...w))},null,6),T.createElementVNode("div",{ref_key:"thumb",ref:i,class:T.normalizeClass(T.unref(p)),style:T.normalizeStyle(T.unref(m))},null,6)],2))}});var xD=e1(vD,[["__file","alpha-slider.vue"]]);const LD=T.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(e){const t=Jt("color-hue-slider"),r=T.getCurrentInstance(),n=T.ref(),i=T.ref(),a=T.ref(0),u=T.ref(0),o=T.computed(()=>e.color.get("hue"));T.watch(()=>o.value,()=>{g()});function f(v){v.target!==n.value&&h(v)}function h(v){if(!i.value||!n.value)return;const w=r.vnode.el.getBoundingClientRect(),{clientX:E,clientY:H}=tc(v);let V;if(e.vertical){let I=H-w.top;I=Math.min(I,w.height-n.value.offsetHeight/2),I=Math.max(n.value.offsetHeight/2,I),V=Math.round((I-n.value.offsetHeight/2)/(w.height-n.value.offsetHeight)*360)}else{let I=E-w.left;I=Math.min(I,w.width-n.value.offsetWidth/2),I=Math.max(n.value.offsetWidth/2,I),V=Math.round((I-n.value.offsetWidth/2)/(w.width-n.value.offsetWidth)*360)}e.color.set("hue",V)}function p(){if(!n.value)return 0;const v=r.vnode.el;if(e.vertical)return 0;const b=e.color.get("hue");return v?Math.round(b*(v.offsetWidth-n.value.offsetWidth/2)/360):0}function m(){if(!n.value)return 0;const v=r.vnode.el;if(!e.vertical)return 0;const b=e.color.get("hue");return v?Math.round(b*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function g(){a.value=p(),u.value=m()}return T.onMounted(()=>{if(!i.value||!n.value)return;const v={drag:b=>{h(b)},end:b=>{h(b)}};aa(i.value,v),aa(n.value,v),g()}),{bar:i,thumb:n,thumbLeft:a,thumbTop:u,hueValue:o,handleClick:f,update:g,ns:t}}});function bD(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass([e.ns.b(),e.ns.is("vertical",e.vertical)])},[T.createElementVNode("div",{ref:"bar",class:T.normalizeClass(e.ns.e("bar")),onClick:t[0]||(t[0]=(...u)=>e.handleClick&&e.handleClick(...u))},null,2),T.createElementVNode("div",{ref:"thumb",class:T.normalizeClass(e.ns.e("thumb")),style:T.normalizeStyle({left:e.thumbLeft+"px",top:e.thumbTop+"px"})},null,6)],2)}var wD=e1(LD,[["render",bD],["__file","hue-slider.vue"]]);const HD=S1({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:a6,popperClass:{type:String,default:""},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},predefine:{type:r1(Array)},validateEvent:{type:Boolean,default:!0}}),MD={[f2]:e=>C2(e)||an(e),[es]:e=>C2(e)||an(e),activeChange:e=>C2(e)||an(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent},Zp=Symbol("colorPickerContextKey"),qp=function(e,t,r){return[e,t*r/((e=(2-t)*r)<1?e:2-e)||0,e/2]},CD=function(e){return typeof e=="string"&&e.includes(".")&&Number.parseFloat(e)===1},AD=function(e){return typeof e=="string"&&e.includes("%")},hi=function(e,t){CD(e)&&(e="100%");const r=AD(e);return e=Math.min(t,Math.max(0,Number.parseFloat(`${e}`))),r&&(e=Number.parseInt(`${e*t}`,10)/100),Math.abs(e-t)<1e-6?1:e%t/Number.parseFloat(t)},Gp={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},ms=e=>{e=Math.min(Math.round(e),255);const t=Math.floor(e/16),r=e%16;return`${Gp[t]||t}${Gp[r]||r}`},Up=function({r:e,g:t,b:r}){return Number.isNaN(+e)||Number.isNaN(+t)||Number.isNaN(+r)?"":`#${ms(e)}${ms(t)}${ms(r)}`},ru={A:10,B:11,C:12,D:13,E:14,F:15},s6=function(e){return e.length===2?(ru[e[0].toUpperCase()]||+e[0])*16+(ru[e[1].toUpperCase()]||+e[1]):ru[e[1].toUpperCase()]||+e[1]},SD=function(e,t,r){t=t/100,r=r/100;let n=t;const i=Math.max(r,.01);r*=2,t*=r<=1?r:2-r,n*=i<=1?i:2-i;const a=(r+t)/2,u=r===0?2*n/(i+n):2*t/(r+t);return{h:e,s:u*100,v:a*100}},Wp=(e,t,r)=>{e=hi(e,255),t=hi(t,255),r=hi(r,255);const n=Math.max(e,t,r),i=Math.min(e,t,r);let a;const u=n,o=n-i,f=n===0?0:o/n;if(n===i)a=0;else{switch(n){case e:{a=(t-r)/o+(t<r?6:0);break}case t:{a=(r-e)/o+2;break}case r:{a=(e-t)/o+4;break}}a/=6}return{h:a*360,s:f*100,v:u*100}},oa=function(e,t,r){e=hi(e,360)*6,t=hi(t,100),r=hi(r,100);const n=Math.floor(e),i=e-n,a=r*(1-t),u=r*(1-i*t),o=r*(1-(1-i)*t),f=n%6,h=[r,u,a,a,o,r][f],p=[o,r,r,u,a,a][f],m=[a,a,o,r,r,u][f];return{r:Math.round(h*255),g:Math.round(p*255),b:Math.round(m*255)}};class sa{constructor(t={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in t)Kn(t,r)&&(this[r]=t[r]);t.value?this.fromString(t.value):this.doOnChange()}set(t,r){if(arguments.length===1&&typeof t=="object"){for(const n in t)Kn(t,n)&&this.set(n,t[n]);return}this[`_${t}`]=r,this.doOnChange()}get(t){return t==="alpha"?Math.floor(this[`_${t}`]):this[`_${t}`]}toRgb(){return oa(this._hue,this._saturation,this._value)}fromString(t){if(!t){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,i,a)=>{this._hue=Math.max(0,Math.min(360,n)),this._saturation=Math.max(0,Math.min(100,i)),this._value=Math.max(0,Math.min(100,a)),this.doOnChange()};if(t.includes("hsl")){const n=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,a)=>a>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:a,v:u}=SD(n[0],n[1],n[2]);r(i,a,u)}}else if(t.includes("hsv")){const n=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,a)=>a>2?Number.parseFloat(i):Number.parseInt(i,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(t.includes("rgb")){const n=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,a)=>a>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:a,v:u}=Wp(n[0],n[1],n[2]);r(i,a,u)}}else if(t.includes("#")){const n=t.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let i,a,u;n.length===3?(i=s6(n[0]+n[0]),a=s6(n[1]+n[1]),u=s6(n[2]+n[2])):(n.length===6||n.length===8)&&(i=s6(n.slice(0,2)),a=s6(n.slice(2,4)),u=s6(n.slice(4,6))),n.length===8?this._alpha=s6(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:o,s:f,v:h}=Wp(i,a,u);r(o,f,h)}}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:r,_value:n,_alpha:i,format:a}=this;if(this.enableAlpha)switch(a){case"hsl":{const u=qp(t,r/100,n/100);this.value=`hsla(${t}, ${Math.round(u[1]*100)}%, ${Math.round(u[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${t}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${Up(oa(t,r,n))}${ms(i*255/100)}`;break}default:{const{r:u,g:o,b:f}=oa(t,r,n);this.value=`rgba(${u}, ${o}, ${f}, ${this.get("alpha")/100})`}}else switch(a){case"hsl":{const u=qp(t,r/100,n/100);this.value=`hsl(${t}, ${Math.round(u[1]*100)}%, ${Math.round(u[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${t}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:u,g:o,b:f}=oa(t,r,n);this.value=`rgb(${u}, ${o}, ${f})`;break}default:this.value=Up(oa(t,r,n))}}}const ED=T.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0}},setup(e){const t=Jt("color-predefine"),{currentColor:r}=T.inject(Zp),n=T.ref(a(e.colors,e.color));T.watch(()=>r.value,u=>{const o=new sa;o.fromString(u),n.value.forEach(f=>{f.selected=o.compare(f)})}),T.watchEffect(()=>{n.value=a(e.colors,e.color)});function i(u){e.color.fromString(e.colors[u])}function a(u,o){return u.map(f=>{const h=new sa;return h.enableAlpha=!0,h.format="rgba",h.fromString(f),h.selected=h.value===o.value,h})}return{rgbaColors:n,handleSelect:i,ns:t}}}),VD=["onClick"];function DD(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(e.ns.b())},[T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("colors"))},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.rgbaColors,(u,o)=>(T.openBlock(),T.createElementBlock("div",{key:e.colors[o],class:T.normalizeClass([e.ns.e("color-selector"),e.ns.is("alpha",u._alpha<100),{selected:u.selected}]),onClick:f=>e.handleSelect(o)},[T.createElementVNode("div",{style:T.normalizeStyle({backgroundColor:u.value})},null,4)],10,VD))),128))],2)],2)}var OD=e1(ED,[["render",DD],["__file","predefine.vue"]]);const kD=T.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(e){const t=Jt("color-svpanel"),r=T.getCurrentInstance(),n=T.ref(0),i=T.ref(0),a=T.ref("hsl(0, 100%, 50%)"),u=T.computed(()=>{const h=e.color.get("hue"),p=e.color.get("value");return{hue:h,value:p}});function o(){const h=e.color.get("saturation"),p=e.color.get("value"),m=r.vnode.el,{clientWidth:g,clientHeight:v}=m;i.value=h*g/100,n.value=(100-p)*v/100,a.value=`hsl(${e.color.get("hue")}, 100%, 50%)`}function f(h){const m=r.vnode.el.getBoundingClientRect(),{clientX:g,clientY:v}=tc(h);let b=g-m.left,w=v-m.top;b=Math.max(0,b),b=Math.min(b,m.width),w=Math.max(0,w),w=Math.min(w,m.height),i.value=b,n.value=w,e.color.set({saturation:b/m.width*100,value:100-w/m.height*100})}return T.watch(()=>u.value,()=>{o()}),T.onMounted(()=>{aa(r.vnode.el,{drag:h=>{f(h)},end:h=>{f(h)}}),o()}),{cursorTop:n,cursorLeft:i,background:a,colorValue:u,handleDrag:f,update:o,ns:t}}}),PD=[T.createElementVNode("div",null,null,-1)];function ID(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(e.ns.b()),style:T.normalizeStyle({backgroundColor:e.background})},[T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("white"))},null,2),T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("black"))},null,2),T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("cursor")),style:T.normalizeStyle({top:e.cursorTop+"px",left:e.cursorLeft+"px"})},PD,6)],6)}var BD=e1(kD,[["render",ID],["__file","sv-panel.vue"]]);const ND=["onKeydown"],FD=["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex"],RD=T.defineComponent({name:"ElColorPicker"}),jD=T.defineComponent({...RD,props:HD,emits:MD,setup(e,{expose:t,emit:r}){const n=e,{t:i}=ri(),a=Jt("color"),{formItem:u}=Qn(),o=un(),f=ci(),{inputId:h,isLabeledByFormItem:p}=na(n,{formItemContext:u}),m=T.ref(),g=T.ref(),v=T.ref(),b=T.ref(),w=T.ref(),E=T.ref(),{isFocused:H,handleFocus:V,handleBlur:I}=ep(w,{beforeBlur(ze){var Ke;return(Ke=b.value)==null?void 0:Ke.isFocusInsideContent(ze)},afterBlur(){tt(!1),Ie()}}),N=ze=>{if(f.value)return ut();V(ze)};let R=!0;const z=T.reactive(new sa({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),Z=T.ref(!1),K=T.ref(!1),ee=T.ref(""),ie=T.computed(()=>!n.modelValue&&!K.value?"transparent":Ze(z,n.showAlpha)),de=T.computed(()=>!n.modelValue&&!K.value?"":z.value),ge=T.computed(()=>p.value?void 0:n.label||i("el.colorpicker.defaultLabel")),Ce=T.computed(()=>p.value?u==null?void 0:u.labelId:void 0),Re=T.computed(()=>[a.b("picker"),a.is("disabled",f.value),a.bm("picker",o.value),a.is("focused",H.value)]);function Ze(ze,Ke){if(!(ze instanceof sa))throw new TypeError("color should be instance of _color Class");const{r:gt,g:pt,b:mt}=ze.toRgb();return Ke?`rgba(${gt}, ${pt}, ${mt}, ${ze.get("alpha")/100})`:`rgb(${gt}, ${pt}, ${mt})`}function tt(ze){Z.value=ze}const Ee=_c(tt,100,{leading:!0});function Ye(){f.value||tt(!0)}function Pt(){Ee(!1),Ie()}function Ie(){T.nextTick(()=>{n.modelValue?z.fromString(n.modelValue):(z.value="",T.nextTick(()=>{K.value=!1}))})}function Xe(){f.value||Ee(!Z.value)}function Tt(){z.fromString(ee.value)}function Je(){const ze=z.value;r(f2,ze),r("change",ze),n.validateEvent&&(u==null||u.validate("change").catch(Ke=>S2(Ke))),Ee(!1),T.nextTick(()=>{const Ke=new sa({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});z.compare(Ke)||Ie()})}function yt(){Ee(!1),r(f2,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(u==null||u.validate("change").catch(ze=>S2(ze))),Ie()}function At(ze){if(Z.value&&(Pt(),H.value)){const Ke=new FocusEvent("focus",ze);I(Ke)}}function Et(ze){ze.preventDefault(),ze.stopPropagation(),tt(!1),Ie()}function Ve(ze){switch(ze.code){case a3.enter:case a3.space:ze.preventDefault(),ze.stopPropagation(),Ye(),E.value.focus();break;case a3.esc:Et(ze);break}}function Ne(){w.value.focus()}function ut(){w.value.blur()}return T.onMounted(()=>{n.modelValue&&(ee.value=de.value)}),T.watch(()=>n.modelValue,ze=>{ze?ze&&ze!==z.value&&(R=!1,z.fromString(ze)):K.value=!1}),T.watch(()=>de.value,ze=>{ee.value=ze,R&&r("activeChange",ze),R=!0}),T.watch(()=>z.value,()=>{!n.modelValue&&!K.value&&(K.value=!0)}),T.watch(()=>Z.value,()=>{T.nextTick(()=>{var ze,Ke,gt;(ze=m.value)==null||ze.update(),(Ke=g.value)==null||Ke.update(),(gt=v.value)==null||gt.update()})}),T.provide(Zp,{currentColor:de}),t({color:z,show:Ye,hide:Pt,focus:Ne,blur:ut}),(ze,Ke)=>(T.openBlock(),T.createBlock(T.unref(Gc),{ref_key:"popper",ref:b,visible:Z.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[T.unref(a).be("picker","panel"),T.unref(a).b("dropdown"),ze.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",transition:`${T.unref(a).namespace.value}-zoom-in-top`,persistent:"",onHide:Ke[2]||(Ke[2]=gt=>tt(!1))},{content:T.withCtx(()=>[T.withDirectives((T.openBlock(),T.createElementBlock("div",{onKeydown:T.withKeys(Et,["esc"])},[T.createElementVNode("div",{class:T.normalizeClass(T.unref(a).be("dropdown","main-wrapper"))},[T.createVNode(wD,{ref_key:"hue",ref:m,class:"hue-slider",color:T.unref(z),vertical:""},null,8,["color"]),T.createVNode(BD,{ref_key:"sv",ref:g,color:T.unref(z)},null,8,["color"])],2),ze.showAlpha?(T.openBlock(),T.createBlock(xD,{key:0,ref_key:"alpha",ref:v,color:T.unref(z)},null,8,["color"])):T.createCommentVNode("v-if",!0),ze.predefine?(T.openBlock(),T.createBlock(OD,{key:1,ref:"predefine",color:T.unref(z),colors:ze.predefine},null,8,["color","colors"])):T.createCommentVNode("v-if",!0),T.createElementVNode("div",{class:T.normalizeClass(T.unref(a).be("dropdown","btns"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(a).be("dropdown","value"))},[T.createVNode(T.unref(ls),{ref_key:"inputRef",ref:E,modelValue:ee.value,"onUpdate:modelValue":Ke[0]||(Ke[0]=gt=>ee.value=gt),"validate-event":!1,size:"small",onKeyup:T.withKeys(Tt,["enter"]),onBlur:Tt},null,8,["modelValue","onKeyup"])],2),T.createVNode(T.unref(W4),{class:T.normalizeClass(T.unref(a).be("dropdown","link-btn")),text:"",size:"small",onClick:yt},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(T.unref(i)("el.colorpicker.clear")),1)]),_:1},8,["class"]),T.createVNode(T.unref(W4),{plain:"",size:"small",class:T.normalizeClass(T.unref(a).be("dropdown","btn")),onClick:Je},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(T.unref(i)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,ND)),[[T.unref(Ap),At]])]),default:T.withCtx(()=>[T.createElementVNode("div",{id:T.unref(h),ref_key:"triggerRef",ref:w,class:T.normalizeClass(T.unref(Re)),role:"button","aria-label":T.unref(ge),"aria-labelledby":T.unref(Ce),"aria-description":T.unref(i)("el.colorpicker.description",{color:ze.modelValue||""}),"aria-disabled":T.unref(f),tabindex:T.unref(f)?-1:ze.tabindex,onKeydown:Ve,onFocus:N,onBlur:Ke[1]||(Ke[1]=(...gt)=>T.unref(I)&&T.unref(I)(...gt))},[T.unref(f)?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(T.unref(a).be("picker","mask"))},null,2)):T.createCommentVNode("v-if",!0),T.createElementVNode("div",{class:T.normalizeClass(T.unref(a).be("picker","trigger")),onClick:Xe},[T.createElementVNode("span",{class:T.normalizeClass([T.unref(a).be("picker","color"),T.unref(a).is("alpha",ze.showAlpha)])},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(a).be("picker","color-inner")),style:T.normalizeStyle({backgroundColor:T.unref(ie)})},[T.withDirectives(T.createVNode(T.unref(U2),{class:T.normalizeClass([T.unref(a).be("picker","icon"),T.unref(a).is("icon-arrow-down")])},{default:T.withCtx(()=>[T.createVNode(T.unref(sn))]),_:1},8,["class"]),[[T.vShow,ze.modelValue||K.value]]),T.withDirectives(T.createVNode(T.unref(U2),{class:T.normalizeClass([T.unref(a).be("picker","empty"),T.unref(a).is("icon-close")])},{default:T.withCtx(()=>[T.createVNode(T.unref(G5))]),_:1},8,["class"]),[[T.vShow,!ze.modelValue&&!K.value]])],6)],2)],2)],42,FD)]),_:1},8,["visible","popper-class","transition"]))}});var zD=e1(jD,[["__file","color-picker.vue"]]);const $D=g3(zD),ZD=T.defineComponent({name:"ElContainer"}),qD=T.defineComponent({...ZD,props:{direction:{type:String}},setup(e){const t=e,r=T.useSlots(),n=Jt("container"),i=T.computed(()=>t.direction==="vertical"?!0:t.direction==="horizontal"?!1:r&&r.default?r.default().some(u=>{const o=u.type.name;return o==="ElHeader"||o==="ElFooter"}):!1);return(a,u)=>(T.openBlock(),T.createElementBlock("section",{class:T.normalizeClass([T.unref(n).b(),T.unref(n).is("vertical",T.unref(i))])},[T.renderSlot(a.$slots,"default")],2))}});var GD=e1(qD,[["__file","container.vue"]]);const UD=T.defineComponent({name:"ElAside"}),WD=T.defineComponent({...UD,props:{width:{type:String,default:null}},setup(e){const t=e,r=Jt("aside"),n=T.computed(()=>t.width?r.cssVarBlock({width:t.width}):{});return(i,a)=>(T.openBlock(),T.createElementBlock("aside",{class:T.normalizeClass(T.unref(r).b()),style:T.normalizeStyle(T.unref(n))},[T.renderSlot(i.$slots,"default")],6))}});var Xp=e1(WD,[["__file","aside.vue"]]);const XD=T.defineComponent({name:"ElFooter"}),KD=T.defineComponent({...XD,props:{height:{type:String,default:null}},setup(e){const t=e,r=Jt("footer"),n=T.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,a)=>(T.openBlock(),T.createElementBlock("footer",{class:T.normalizeClass(T.unref(r).b()),style:T.normalizeStyle(T.unref(n))},[T.renderSlot(i.$slots,"default")],6))}});var Kp=e1(KD,[["__file","footer.vue"]]);const JD=T.defineComponent({name:"ElHeader"}),YD=T.defineComponent({...JD,props:{height:{type:String,default:null}},setup(e){const t=e,r=Jt("header"),n=T.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,a)=>(T.openBlock(),T.createElementBlock("header",{class:T.normalizeClass(T.unref(r).b()),style:T.normalizeStyle(T.unref(n))},[T.renderSlot(i.$slots,"default")],6))}});var Jp=e1(YD,[["__file","header.vue"]]);const eO=T.defineComponent({name:"ElMain"}),tO=T.defineComponent({...eO,setup(e){const t=Jt("main");return(r,n)=>(T.openBlock(),T.createElementBlock("main",{class:T.normalizeClass(T.unref(t).b())},[T.renderSlot(r.$slots,"default")],2))}});var Yp=e1(tO,[["__file","main.vue"]]);const rO=g3(GD,{Aside:Xp,Footer:Kp,Header:Jp,Main:Yp});v4(Xp),v4(Kp),v4(Jp);const em=v4(Yp),nO=T.defineComponent({inheritAttrs:!1});function iO(e,t,r,n,i,a){return T.renderSlot(e.$slots,"default")}var aO=e1(nO,[["render",iO],["__file","collection.vue"]]);const oO=T.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function sO(e,t,r,n,i,a){return T.renderSlot(e.$slots,"default")}var lO=e1(oO,[["render",sO],["__file","collection-item.vue"]]);const cO="data-el-collection-item",uO=e=>{const t=`El${e}Collection`,r=`${t}Item`,n=Symbol(t),i=Symbol(r),a={...aO,name:t,setup(){const o=T.ref(null),f=new Map,h=()=>{const p=T.unref(o);if(!p)return[];const m=Array.from(p.querySelectorAll(`[${cO}]`));return[...f.values()].sort((v,b)=>m.indexOf(v.ref)-m.indexOf(b.ref))};T.provide(n,{itemMap:f,getItems:h,collectionRef:o})}},u={...lO,name:r,setup(o,{attrs:f}){const h=T.ref(null),p=T.inject(n,void 0);T.provide(i,{collectionItemRef:h}),T.onMounted(()=>{const m=T.unref(h);m&&p.itemMap.set(m,{ref:m,...f})}),T.onBeforeUnmount(()=>{const m=T.unref(h);p.itemMap.delete(m)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:a,ElCollectionItem:u}},nu=S1({trigger:ia.trigger,effect:{...J3.effect,default:"light"},type:{type:r1(String)},placement:{type:r1(String),default:"bottom"},popperOptions:{type:r1(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:r1([Number,String]),default:0},maxHeight:{type:r1([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:r1(Object)},teleported:J3.teleported});S1({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ln}}),S1({onKeydown:{type:r1(Function)}}),uO("Dropdown");const tm=Symbol("ElSelectGroup"),ys=Symbol("ElSelect");function QO(e,t){const r=T.inject(ys),n=T.inject(tm,{disabled:!1}),i=T.computed(()=>i3(e.value)),a=T.computed(()=>r.props.multiple?m(r.props.modelValue,e.value):g(e.value,r.props.modelValue)),u=T.computed(()=>{if(r.props.multiple){const w=r.props.modelValue||[];return!a.value&&w.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),o=T.computed(()=>e.label||(i.value?"":e.value)),f=T.computed(()=>e.value||e.label||""),h=T.computed(()=>e.disabled||t.groupDisabled||u.value),p=T.getCurrentInstance(),m=(w=[],E)=>{if(i.value){const H=r.props.valueKey;return w&&w.some(V=>T.toRaw(K3(V,H))===K3(E,H))}else return w&&w.includes(E)},g=(w,E)=>{if(i.value){const{valueKey:H}=r.props;return K3(w,H)===K3(E,H)}else return w===E},v=()=>{!e.disabled&&!n.disabled&&(r.hoverIndex=r.optionsArray.indexOf(p.proxy))};T.watch(()=>o.value,()=>{!e.created&&!r.props.remote&&r.setSelected()}),T.watch(()=>e.value,(w,E)=>{const{remote:H,valueKey:V}=r.props;if(Object.is(w,E)||(r.onOptionDestroy(E,p.proxy),r.onOptionCreate(p.proxy)),!e.created&&!H){if(V&&i3(w)&&i3(E)&&w[V]===E[V])return;r.setSelected()}}),T.watch(()=>n.disabled,()=>{t.groupDisabled=n.disabled},{immediate:!0});const{queryChange:b}=T.toRaw(r);return T.watch(b,w=>{const{query:E}=T.unref(w),H=new RegExp(wC(E),"i");t.visible=H.test(o.value)||e.created,t.visible||r.filteredOptionsCount--},{immediate:!0}),{select:r,currentLabel:o,currentValue:f,itemSelected:a,isDisabled:h,hoverItem:v}}const TO=T.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const t=Jt("select"),r=ta(),n=T.computed(()=>[t.be("dropdown","item"),t.is("disabled",T.unref(o)),{selected:T.unref(u),hover:T.unref(m)}]),i=T.reactive({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:a,itemSelected:u,isDisabled:o,select:f,hoverItem:h}=QO(e,i),{visible:p,hover:m}=T.toRefs(i),g=T.getCurrentInstance().proxy;f.onOptionCreate(g),T.onBeforeUnmount(()=>{const b=g.value,{selected:w}=f,H=(f.props.multiple?w:[w]).some(V=>V.value===g.value);T.nextTick(()=>{f.cachedOptions.get(b)===g&&!H&&f.cachedOptions.delete(b)}),f.onOptionDestroy(b,g)});function v(){e.disabled!==!0&&i.groupDisabled!==!0&&f.handleOptionSelect(g)}return{ns:t,id:r,containerKls:n,currentLabel:a,itemSelected:u,isDisabled:o,select:f,hoverItem:h,visible:p,hover:m,selectOptionClick:v,states:i}}}),hO=["id","aria-disabled","aria-selected"];function dO(e,t,r,n,i,a){return T.withDirectives((T.openBlock(),T.createElementBlock("li",{id:e.id,class:T.normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:t[0]||(t[0]=(...u)=>e.hoverItem&&e.hoverItem(...u)),onClick:t[1]||(t[1]=T.withModifiers((...u)=>e.selectOptionClick&&e.selectOptionClick(...u),["stop"]))},[T.renderSlot(e.$slots,"default",{},()=>[T.createElementVNode("span",null,T.toDisplayString(e.currentLabel),1)])],42,hO)),[[T.vShow,e.visible]])}var iu=e1(TO,[["render",dO],["__file","option.vue"]]);const fO=T.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=T.inject(ys),t=Jt("select"),r=T.computed(()=>e.props.popperClass),n=T.computed(()=>e.props.multiple),i=T.computed(()=>e.props.fitInputWidth),a=T.ref("");function u(){var o;a.value=`${(o=e.selectWrapper)==null?void 0:o.offsetWidth}px`}return T.onMounted(()=>{u(),j0(e.selectWrapper,u)}),{ns:t,minWidth:a,popperClass:r,isMultiple:n,isFitInputWidth:i}}});function pO(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:T.normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(e.ns.be("dropdown","header"))},[T.renderSlot(e.$slots,"header")],2)):T.createCommentVNode("v-if",!0),T.renderSlot(e.$slots,"default"),e.$slots.footer?(T.openBlock(),T.createElementBlock("div",{key:1,class:T.normalizeClass(e.ns.be("dropdown","footer"))},[T.renderSlot(e.$slots,"footer")],2)):T.createCommentVNode("v-if",!0)],6)}var mO=e1(fO,[["render",pO],["__file","select-dropdown.vue"]]);function yO(e){const{t}=ri();return T.reactive({options:new Map,cachedOptions:new Map,disabledOptions:new Map,createdLabel:null,createdSelected:!1,selected:e.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:t("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,prefixWidth:11,mouseEnter:!1,focused:!1})}const gO=(e,t,r)=>{const{t:n}=ri(),i=Jt("select");yf({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},T.computed(()=>e.suffixTransition===!1));const a=T.ref(null),u=T.ref(null),o=T.ref(null),f=T.ref(null),h=T.ref(null),p=T.ref(null),m=T.ref(null),g=T.ref(null),v=T.ref(),b=T.shallowRef({query:""}),w=T.shallowRef(""),E=T.ref([]);let H=0;const{form:V,formItem:I}=Qn(),N=T.computed(()=>!e.filterable||e.multiple||!t.visible),R=T.computed(()=>e.disabled||(V==null?void 0:V.disabled)),z=T.computed(()=>{const Ae=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!=="";return e.clearable&&!R.value&&t.inputHovering&&Ae}),Z=T.computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),K=T.computed(()=>i.is("reverse",Z.value&&t.visible&&e.suffixTransition)),ee=T.computed(()=>(V==null?void 0:V.statusIcon)&&(I==null?void 0:I.validateState)&&pf[I==null?void 0:I.validateState]),ie=T.computed(()=>e.remote?300:0),de=T.computed(()=>e.loading?e.loadingText||n("el.select.loading"):e.remote&&t.query===""&&t.options.size===0?!1:e.filterable&&t.query&&t.options.size>0&&t.filteredOptionsCount===0?e.noMatchText||n("el.select.noMatch"):t.options.size===0?e.noDataText||n("el.select.noData"):null),ge=T.computed(()=>{const Ae=Array.from(t.options.values()),ne=[];return E.value.forEach(U=>{const J=Ae.findIndex(oe=>oe.currentLabel===U);J>-1&&ne.push(Ae[J])}),ne.length>=Ae.length?ne:Ae}),Ce=T.computed(()=>Array.from(t.cachedOptions.values())),Re=T.computed(()=>{const Ae=ge.value.filter(ne=>!ne.created).some(ne=>ne.currentLabel===t.query);return e.filterable&&e.allowCreate&&t.query!==""&&!Ae}),Ze=un(),tt=T.computed(()=>["small"].includes(Ze.value)?"small":"default"),Ee=T.computed({get(){return t.visible&&de.value!==!1},set(Ae){t.visible=Ae}});T.watch([()=>R.value,()=>Ze.value,()=>V==null?void 0:V.size],()=>{T.nextTick(()=>{Ye()})}),T.watch(()=>e.placeholder,Ae=>{t.cachedPlaceHolder=t.currentPlaceholder=Ae,e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(t.currentPlaceholder="")}),T.watch(()=>e.modelValue,(Ae,ne)=>{e.multiple&&(Ye(),Ae&&Ae.length>0||u.value&&t.query!==""?t.currentPlaceholder="":t.currentPlaceholder=t.cachedPlaceHolder,e.filterable&&!e.reserveKeyword&&(t.query="",Pt(t.query))),Tt(),e.filterable&&!e.multiple&&(t.inputLength=20),!vc(Ae,ne)&&e.validateEvent&&(I==null||I.validate("change").catch(U=>S2(U)))},{flush:"post",deep:!0}),T.watch(()=>t.visible,Ae=>{var ne,U,J,oe,Qe;Ae?((U=(ne=f.value)==null?void 0:ne.updatePopper)==null||U.call(ne),e.filterable&&(t.filteredOptionsCount=t.optionsCount,t.query=e.remote?"":t.selectedLabel,(oe=(J=o.value)==null?void 0:J.focus)==null||oe.call(J),e.multiple?(Qe=u.value)==null||Qe.focus():t.selectedLabel&&(t.currentPlaceholder=`${t.selectedLabel}`,t.selectedLabel=""),Pt(t.query),!e.multiple&&!e.remote&&(b.value.query="",T.triggerRef(b),T.triggerRef(w)))):(e.filterable&&(X3(e.filterMethod)&&e.filterMethod(""),X3(e.remoteMethod)&&e.remoteMethod("")),t.query="",t.previousQuery=null,t.selectedLabel="",t.inputLength=20,t.menuVisibleOnFocus=!1,yt(),T.nextTick(()=>{u.value&&u.value.value===""&&t.selected.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}),e.multiple||(t.selected&&(e.filterable&&e.allowCreate&&t.createdSelected&&t.createdLabel?t.selectedLabel=t.createdLabel:t.selectedLabel=t.selected.currentLabel,e.filterable&&(t.query=t.selectedLabel)),e.filterable&&(t.currentPlaceholder=t.cachedPlaceHolder))),r.emit("visible-change",Ae)}),T.watch(()=>t.options.entries(),()=>{var Ae,ne,U;if(!M2)return;(ne=(Ae=f.value)==null?void 0:Ae.updatePopper)==null||ne.call(Ae),e.multiple&&Ye();const J=((U=m.value)==null?void 0:U.querySelectorAll("input"))||[];(!e.filterable&&!e.defaultFirstOption&&!$5(e.modelValue)||!Array.from(J).includes(document.activeElement))&&Tt(),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&Xe()},{flush:"post"}),T.watch(()=>t.hoverIndex,Ae=>{A2(Ae)&&Ae>-1?v.value=ge.value[Ae]||{}:v.value={},ge.value.forEach(ne=>{ne.hover=v.value===ne})});const Ye=()=>{T.nextTick(()=>{var Ae,ne;if(!a.value)return;const U=a.value.$el.querySelector("input");H=H||(U.clientHeight>0?U.clientHeight+2:0);const J=p.value,oe=getComputedStyle(U).getPropertyValue(i.cssVarName("input-height")),Qe=Number.parseFloat(oe)||KC(Ze.value||(V==null?void 0:V.size)),he=Ze.value||Qe===H||H<=0?Qe:H;!(U.offsetParent===null)&&(U.style.height=`${(t.selected.length===0?he:Math.max(J?J.clientHeight+(J.clientHeight>he?6:0):0,he))-2}px`),t.visible&&de.value!==!1&&((ne=(Ae=f.value)==null?void 0:Ae.updatePopper)==null||ne.call(Ae))})},Pt=async Ae=>{if(!(t.previousQuery===Ae||t.isOnComposition)){if(t.previousQuery===null&&(X3(e.filterMethod)||X3(e.remoteMethod))){t.previousQuery=Ae;return}t.previousQuery=Ae,T.nextTick(()=>{var ne,U;t.visible&&((U=(ne=f.value)==null?void 0:ne.updatePopper)==null||U.call(ne))}),t.hoverIndex=-1,e.multiple&&e.filterable&&T.nextTick(()=>{if(!R.value){const ne=u.value.value.length*15+20;t.inputLength=e.collapseTags?Math.min(50,ne):ne,Ie()}Ye()}),e.remote&&X3(e.remoteMethod)?(t.hoverIndex=-1,e.remoteMethod(Ae)):X3(e.filterMethod)?(e.filterMethod(Ae),T.triggerRef(w)):(t.filteredOptionsCount=t.optionsCount,b.value.query=Ae,T.triggerRef(b),T.triggerRef(w)),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&(await T.nextTick(),Xe())}},Ie=()=>{t.currentPlaceholder!==""&&(t.currentPlaceholder=u.value.value?"":t.cachedPlaceHolder)},Xe=()=>{const Ae=ge.value.filter(J=>J.visible&&!J.disabled&&!J.states.groupDisabled),ne=Ae.find(J=>J.created),U=Ae[0];t.hoverIndex=Wt(ge.value,ne||U)},Tt=()=>{var Ae;if(e.multiple)t.selectedLabel="";else{const U=Je(e.modelValue);(Ae=U.props)!=null&&Ae.created?(t.createdLabel=U.props.value,t.createdSelected=!0):t.createdSelected=!1,t.selectedLabel=U.currentLabel,t.selected=U,e.filterable&&(t.query=t.selectedLabel);return}const ne=[];Array.isArray(e.modelValue)&&e.modelValue.forEach(U=>{ne.push(Je(U))}),t.selected=ne,T.nextTick(()=>{Ye()})},Je=Ae=>{let ne;const U=rc(Ae).toLowerCase()==="object",J=rc(Ae).toLowerCase()==="null",oe=rc(Ae).toLowerCase()==="undefined";for(let Le=t.cachedOptions.size-1;Le>=0;Le--){const _e=Ce.value[Le];if(U?K3(_e.value,e.valueKey)===K3(Ae,e.valueKey):_e.value===Ae){ne={value:Ae,currentLabel:_e.currentLabel,isDisabled:_e.isDisabled};break}}if(ne)return ne;const Qe=U?Ae.label:!J&&!oe?Ae:"",he={value:Ae,currentLabel:Qe};return e.multiple&&(he.hitState=!1),he},yt=()=>{setTimeout(()=>{const Ae=e.valueKey;e.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(ne=>ge.value.findIndex(U=>K3(U,Ae)===K3(ne,Ae)))):t.hoverIndex=-1:t.hoverIndex=ge.value.findIndex(ne=>w1(ne)===w1(t.selected))},300)},At=()=>{var Ae,ne;Et(),(ne=(Ae=f.value)==null?void 0:Ae.updatePopper)==null||ne.call(Ae),e.multiple&&Ye()},Et=()=>{var Ae;t.inputWidth=(Ae=a.value)==null?void 0:Ae.$el.offsetWidth},Ve=()=>{e.filterable&&t.query!==t.selectedLabel&&(t.query=t.selectedLabel,Pt(t.query))},Ne=_c(()=>{Ve()},ie.value),ut=_c(Ae=>{Pt(Ae.target.value)},ie.value),ze=Ae=>{vc(e.modelValue,Ae)||r.emit(es,Ae)},Ke=Ae=>yC(Ae,ne=>!t.disabledOptions.has(ne)),gt=Ae=>{if(Ae.code!==a3.delete){if(Ae.target.value.length<=0&&!P1()){const ne=e.modelValue.slice(),U=Ke(ne);if(U<0)return;ne.splice(U,1),r.emit(f2,ne),ze(ne)}Ae.target.value.length===1&&e.modelValue.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}},pt=(Ae,ne)=>{const U=t.selected.indexOf(ne);if(U>-1&&!R.value){const J=e.modelValue.slice();J.splice(U,1),r.emit(f2,J),ze(J),r.emit("remove-tag",ne.value)}Ae.stopPropagation(),Rt()},mt=Ae=>{Ae.stopPropagation();const ne=e.multiple?[]:"";if(!C2(ne))for(const U of t.selected)U.isDisabled&&ne.push(U.value);r.emit(f2,ne),ze(ne),t.hoverIndex=-1,t.visible=!1,r.emit("clear"),Rt()},Ht=Ae=>{var ne;if(e.multiple){const U=(e.modelValue||[]).slice(),J=Wt(U,Ae.value);J>-1?U.splice(J,1):(e.multipleLimit<=0||U.length<e.multipleLimit)&&U.push(Ae.value),r.emit(f2,U),ze(U),Ae.created&&(t.query="",Pt(""),t.inputLength=20),e.filterable&&((ne=u.value)==null||ne.focus())}else r.emit(f2,Ae.value),ze(Ae.value),t.visible=!1;_1(),!t.visible&&T.nextTick(()=>{t1(Ae)})},Wt=(Ae=[],ne)=>{if(!i3(ne))return Ae.indexOf(ne);const U=e.valueKey;let J=-1;return Ae.some((oe,Qe)=>T.toRaw(K3(oe,U))===K3(ne,U)?(J=Qe,!0):!1),J},_1=()=>{const Ae=u.value||a.value;Ae&&(Ae==null||Ae.focus())},t1=Ae=>{var ne,U,J,oe,Qe;const he=Array.isArray(Ae)?Ae[0]:Ae;let Le=null;if(he!=null&&he.value){const _e=ge.value.filter(me=>me.value===he.value);_e.length>0&&(Le=_e[0].$el)}if(f.value&&Le){const _e=(oe=(J=(U=(ne=f.value)==null?void 0:ne.popperRef)==null?void 0:U.contentRef)==null?void 0:J.querySelector)==null?void 0:oe.call(J,`.${i.be("dropdown","wrap")}`);_e&&CC(_e,Le)}(Qe=g.value)==null||Qe.handleScroll()},V1=Ae=>{t.optionsCount++,t.filteredOptionsCount++,t.options.set(Ae.value,Ae),t.cachedOptions.set(Ae.value,Ae),Ae.disabled&&t.disabledOptions.set(Ae.value,Ae)},Pe=(Ae,ne)=>{t.options.get(Ae)===ne&&(t.optionsCount--,t.filteredOptionsCount--,t.options.delete(Ae))},v1=Ae=>{Ae.code!==a3.backspace&&P1(!1),t.inputLength=u.value.value.length*15+20,Ye()},P1=Ae=>{if(!Array.isArray(t.selected))return;const ne=Ke(t.selected.map(J=>J.value)),U=t.selected[ne];if(U)return Ae===!0||Ae===!1?(U.hitState=Ae,Ae):(U.hitState=!U.hitState,U.hitState)},Q1=Ae=>{const ne=Ae.target.value;if(Ae.type==="compositionend")t.isOnComposition=!1,T.nextTick(()=>Pt(ne));else{const U=ne[ne.length-1]||"";t.isOnComposition=!mf(U)}},Xt=()=>{T.nextTick(()=>t1(t.selected))},et=Ae=>{t.focused||((e.automaticDropdown||e.filterable)&&(e.filterable&&!t.visible&&(t.menuVisibleOnFocus=!0),t.visible=!0),t.focused=!0,r.emit("focus",Ae))},Rt=()=>{var Ae,ne;t.visible?(Ae=u.value||a.value)==null||Ae.focus():(ne=a.value)==null||ne.focus()},d1=()=>{var Ae,ne,U;t.visible=!1,(Ae=a.value)==null||Ae.blur(),(U=(ne=o.value)==null?void 0:ne.blur)==null||U.call(ne)},r2=Ae=>{var ne,U,J;(ne=f.value)!=null&&ne.isFocusInsideContent(Ae)||(U=h.value)!=null&&U.isFocusInsideContent(Ae)||(J=m.value)!=null&&J.contains(Ae.relatedTarget)||(t.visible&&l3(),t.focused=!1,r.emit("blur",Ae))},R2=Ae=>{mt(Ae)},l3=()=>{t.visible=!1},L3=Ae=>{t.visible&&(Ae.preventDefault(),Ae.stopPropagation(),t.visible=!1)},it=Ae=>{Ae&&!t.mouseEnter||R.value||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:(!f.value||!f.value.isFocusInsideContent())&&(t.visible=!t.visible),Rt())},c3=()=>{t.visible?ge.value[t.hoverIndex]&&Ht(ge.value[t.hoverIndex]):it()},w1=Ae=>i3(Ae.value)?K3(Ae.value,e.valueKey):Ae.value,R3=T.computed(()=>ge.value.filter(Ae=>Ae.visible).every(Ae=>Ae.disabled)),b3=T.computed(()=>e.multiple?t.selected.slice(0,e.maxCollapseTags):[]),at=T.computed(()=>e.multiple?t.selected.slice(e.maxCollapseTags):[]),qt=Ae=>{if(!t.visible){t.visible=!0;return}if(!(t.options.size===0||t.filteredOptionsCount===0)&&!t.isOnComposition&&!R3.value){Ae==="next"?(t.hoverIndex++,t.hoverIndex===t.options.size&&(t.hoverIndex=0)):Ae==="prev"&&(t.hoverIndex--,t.hoverIndex<0&&(t.hoverIndex=t.options.size-1));const ne=ge.value[t.hoverIndex];(ne.disabled===!0||ne.states.groupDisabled===!0||!ne.visible)&&qt(Ae),T.nextTick(()=>t1(v.value))}},jt=()=>{t.mouseEnter=!0},Q2=()=>{t.mouseEnter=!1},u3=(Ae,ne)=>{var U,J;pt(Ae,ne),(J=(U=h.value)==null?void 0:U.updatePopper)==null||J.call(U)},Zt=T.computed(()=>({maxWidth:`${T.unref(t.inputWidth)-32-(ee.value?22:0)}px`,width:"100%"}));return{optionList:E,optionsArray:ge,hoverOption:v,selectSize:Ze,handleResize:At,debouncedOnInputChange:Ne,debouncedQueryChange:ut,deletePrevTag:gt,deleteTag:pt,deleteSelected:mt,handleOptionSelect:Ht,scrollToOption:t1,readonly:N,resetInputHeight:Ye,showClose:z,iconComponent:Z,iconReverse:K,showNewOption:Re,collapseTagSize:tt,setSelected:Tt,managePlaceholder:Ie,selectDisabled:R,emptyText:de,toggleLastOptionHitState:P1,resetInputState:v1,handleComposition:Q1,onOptionCreate:V1,onOptionDestroy:Pe,handleMenuEnter:Xt,handleFocus:et,focus:Rt,blur:d1,handleBlur:r2,handleClearClick:R2,handleClose:l3,handleKeydownEscape:L3,toggleMenu:it,selectOption:c3,getValueKey:w1,navigateOptions:qt,handleDeleteTooltipTag:u3,dropMenuVisible:Ee,queryChange:b,groupQueryChange:w,showTagList:b3,collapseTagList:at,selectTagsStyle:Zt,reference:a,input:u,iOSInput:o,tooltipRef:f,tagTooltipRef:h,tags:p,selectWrapper:m,scrollbar:g,handleMouseEnter:jt,handleMouseLeave:Q2}};var _O=T.defineComponent({name:"ElOptions",emits:["update-options"],setup(e,{slots:t,emit:r}){let n=[];function i(a,u){if(a.length!==u.length)return!1;for(const[o]of a.entries())if(a[o]!=u[o])return!1;return!0}return()=>{var a,u;const o=(a=t.default)==null?void 0:a.call(t),f=[];function h(p){Array.isArray(p)&&p.forEach(m=>{var g,v,b,w;const E=(g=(m==null?void 0:m.type)||{})==null?void 0:g.name;E==="ElOptionGroup"?h(!C2(m.children)&&!Array.isArray(m.children)&&X3((v=m.children)==null?void 0:v.default)?(b=m.children)==null?void 0:b.default():m.children):E==="ElOption"?f.push((w=m.props)==null?void 0:w.label):Array.isArray(m.children)&&h(m.children)})}return o.length&&h((u=o[0])==null?void 0:u.children),i(f,n)||(n=f,r("update-options",f)),o}}});const rm="ElSelect",vO=T.defineComponent({name:rm,componentName:rm,components:{ElInput:ls,ElSelectMenu:mO,ElOption:iu,ElOptions:_O,ElTag:aD,ElScrollbar:JS,ElTooltip:Gc,ElIcon:U2},directives:{ClickOutside:Ap},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:JC},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:J3.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ln,default:Lc},fitInputWidth:Boolean,suffixIcon:{type:ln,default:sn},tagType:{...zp.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:rs,default:"bottom-start"},ariaLabel:{type:String,default:void 0}},emits:[f2,es,"remove-tag","clear","visible-change","focus","blur"],setup(e,t){const r=Jt("select"),n=Jt("input"),{t:i}=ri(),a=ta(),u=yO(e),{optionList:o,optionsArray:f,hoverOption:h,selectSize:p,readonly:m,handleResize:g,collapseTagSize:v,debouncedOnInputChange:b,debouncedQueryChange:w,deletePrevTag:E,deleteTag:H,deleteSelected:V,handleOptionSelect:I,scrollToOption:N,setSelected:R,resetInputHeight:z,managePlaceholder:Z,showClose:K,selectDisabled:ee,iconComponent:ie,iconReverse:de,showNewOption:ge,emptyText:Ce,toggleLastOptionHitState:Re,resetInputState:Ze,handleComposition:tt,onOptionCreate:Ee,onOptionDestroy:Ye,handleMenuEnter:Pt,handleFocus:Ie,focus:Xe,blur:Tt,handleBlur:Je,handleClearClick:yt,handleClose:At,handleKeydownEscape:Et,toggleMenu:Ve,selectOption:Ne,getValueKey:ut,navigateOptions:ze,handleDeleteTooltipTag:Ke,dropMenuVisible:gt,reference:pt,input:mt,iOSInput:Ht,tooltipRef:Wt,tagTooltipRef:_1,tags:t1,selectWrapper:V1,scrollbar:Pe,queryChange:v1,groupQueryChange:P1,handleMouseEnter:Q1,handleMouseLeave:Xt,showTagList:et,collapseTagList:Rt,selectTagsStyle:d1}=gO(e,u,t),{inputWidth:r2,selected:R2,inputLength:l3,filteredOptionsCount:L3,visible:it,selectedLabel:c3,hoverIndex:w1,query:R3,inputHovering:b3,currentPlaceholder:at,menuVisibleOnFocus:qt,isOnComposition:jt,options:Q2,cachedOptions:u3,optionsCount:Zt,prefixWidth:Ae}=T.toRefs(u),ne=T.computed(()=>{const Be=[r.b()],Fe=T.unref(p);return Fe&&Be.push(r.m(Fe)),e.disabled&&Be.push(r.m("disabled")),Be}),U=T.computed(()=>[r.e("tags"),r.is("disabled",T.unref(ee))]),J=T.computed(()=>[r.b("tags-wrapper"),{"has-prefix":T.unref(Ae)&&T.unref(R2).length}]),oe=T.computed(()=>[r.e("input"),r.is(T.unref(p)),r.is("disabled",T.unref(ee))]),Qe=T.computed(()=>[r.e("input"),r.is(T.unref(p)),r.em("input","iOS")]),he=T.computed(()=>[r.is("empty",!e.allowCreate&&!!T.unref(R3)&&T.unref(L3)===0)]),Le=T.computed(()=>({maxWidth:`${T.unref(r2)>123&&T.unref(R2).length>e.maxCollapseTags?T.unref(r2)-123:T.unref(r2)-75}px`})),_e=T.computed(()=>({marginLeft:`${T.unref(Ae)}px`,flexGrow:1,width:`${T.unref(l3)/(T.unref(r2)-32)}%`,maxWidth:`${T.unref(r2)-42}px`}));T.provide(ys,T.reactive({props:e,options:Q2,optionsArray:f,cachedOptions:u3,optionsCount:Zt,filteredOptionsCount:L3,hoverIndex:w1,handleOptionSelect:I,onOptionCreate:Ee,onOptionDestroy:Ye,selectWrapper:V1,selected:R2,setSelected:R,queryChange:v1,groupQueryChange:P1})),T.onMounted(()=>{u.cachedPlaceHolder=at.value=e.placeholder||(()=>i("el.select.placeholder")),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(at.value=""),j0(V1,g),e.remote&&e.multiple&&z(),T.nextTick(()=>{const Be=pt.value&&pt.value.$el;if(Be&&(r2.value=Be.getBoundingClientRect().width,t.slots.prefix)){const Fe=Be.querySelector(`.${n.e("prefix")}`);Ae.value=Math.max(Fe.getBoundingClientRect().width+11,30)}}),R()}),e.multiple&&!Array.isArray(e.modelValue)&&t.emit(f2,[]),!e.multiple&&Array.isArray(e.modelValue)&&t.emit(f2,"");const me=T.computed(()=>{var Be,Fe;return(Fe=(Be=Wt.value)==null?void 0:Be.popperRef)==null?void 0:Fe.contentRef});return{isIOS:cd,onOptionsRendered:Be=>{o.value=Be},prefixWidth:Ae,selectSize:p,readonly:m,handleResize:g,collapseTagSize:v,debouncedOnInputChange:b,debouncedQueryChange:w,deletePrevTag:E,deleteTag:H,handleDeleteTooltipTag:Ke,deleteSelected:V,handleOptionSelect:I,scrollToOption:N,inputWidth:r2,selected:R2,inputLength:l3,filteredOptionsCount:L3,visible:it,selectedLabel:c3,hoverIndex:w1,query:R3,inputHovering:b3,currentPlaceholder:at,menuVisibleOnFocus:qt,isOnComposition:jt,options:Q2,resetInputHeight:z,managePlaceholder:Z,showClose:K,selectDisabled:ee,iconComponent:ie,iconReverse:de,showNewOption:ge,emptyText:Ce,toggleLastOptionHitState:Re,resetInputState:Ze,handleComposition:tt,handleMenuEnter:Pt,handleFocus:Ie,focus:Xe,blur:Tt,handleBlur:Je,handleClearClick:yt,handleClose:At,handleKeydownEscape:Et,toggleMenu:Ve,selectOption:Ne,getValueKey:ut,navigateOptions:ze,dropMenuVisible:gt,reference:pt,input:mt,iOSInput:Ht,tooltipRef:Wt,popperPaneRef:me,tags:t1,selectWrapper:V1,scrollbar:Pe,wrapperKls:ne,tagsKls:U,tagWrapperKls:J,inputKls:oe,iOSInputKls:Qe,scrollbarKls:he,selectTagsStyle:d1,nsSelect:r,tagTextStyle:Le,inputStyle:_e,handleMouseEnter:Q1,handleMouseLeave:Xt,showTagList:et,collapseTagList:Rt,tagTooltipRef:_1,contentId:a,hoverOption:h}}}),xO=["disabled","autocomplete","aria-activedescendant","aria-controls","aria-expanded","aria-label"],LO=["disabled"],bO={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function wO(e,t,r,n,i,a){const u=T.resolveComponent("el-tag"),o=T.resolveComponent("el-tooltip"),f=T.resolveComponent("el-icon"),h=T.resolveComponent("el-input"),p=T.resolveComponent("el-option"),m=T.resolveComponent("el-options"),g=T.resolveComponent("el-scrollbar"),v=T.resolveComponent("el-select-menu"),b=T.resolveDirective("click-outside");return T.withDirectives((T.openBlock(),T.createElementBlock("div",{ref:"selectWrapper",class:T.normalizeClass(e.wrapperKls),onMouseenter:t[22]||(t[22]=(...w)=>e.handleMouseEnter&&e.handleMouseEnter(...w)),onMouseleave:t[23]||(t[23]=(...w)=>e.handleMouseLeave&&e.handleMouseLeave(...w)),onClick:t[24]||(t[24]=T.withModifiers((...w)=>e.toggleMenu&&e.toggleMenu(...w),["stop"]))},[T.createVNode(o,{ref:"tooltipRef",visible:e.dropMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:T.withCtx(()=>{var w,E;return[T.createElementVNode("div",{class:"select-trigger",onMouseenter:t[20]||(t[20]=H=>e.inputHovering=!0),onMouseleave:t[21]||(t[21]=H=>e.inputHovering=!1)},[e.multiple?(T.openBlock(),T.createElementBlock("div",{key:0,ref:"tags",tabindex:"-1",class:T.normalizeClass(e.tagsKls),style:T.normalizeStyle(e.selectTagsStyle),onClick:t[15]||(t[15]=(...H)=>e.focus&&e.focus(...H))},[e.collapseTags&&e.selected.length?(T.openBlock(),T.createBlock(T.Transition,{key:0,onAfterLeave:e.resetInputHeight},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.tagWrapperKls)},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.showTagList,H=>(T.openBlock(),T.createBlock(u,{key:e.getValueKey(H),closable:!e.selectDisabled&&!H.isDisabled,size:e.collapseTagSize,hit:H.hitState,type:e.tagType,"disable-transitions":"",onClose:V=>e.deleteTag(V,H)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text")),style:T.normalizeStyle(e.tagTextStyle)},T.toDisplayString(H.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),e.selected.length>e.maxCollapseTags?(T.openBlock(),T.createBlock(u,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:T.withCtx(()=>[e.collapseTagsTooltip?(T.openBlock(),T.createBlock(o,{key:0,ref:"tagTooltipRef",disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+T.toDisplayString(e.selected.length-e.maxCollapseTags),3)]),content:T.withCtx(()=>[T.createElementVNode("div",{class:T.normalizeClass(e.nsSelect.e("collapse-tags"))},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.collapseTagList,H=>(T.openBlock(),T.createElementBlock("div",{key:e.getValueKey(H),class:T.normalizeClass(e.nsSelect.e("collapse-tag"))},[T.createVNode(u,{class:"in-tooltip",closable:!e.selectDisabled&&!H.isDisabled,size:e.collapseTagSize,hit:H.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:V=>e.handleDeleteTooltipTag(V,H)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text")),style:T.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},T.toDisplayString(H.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(T.openBlock(),T.createElementBlock("span",{key:1,class:T.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+T.toDisplayString(e.selected.length-e.maxCollapseTags),3))]),_:1},8,["size","type"])):T.createCommentVNode("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):T.createCommentVNode("v-if",!0),e.collapseTags?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createBlock(T.Transition,{key:1,onAfterLeave:e.resetInputHeight},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.tagWrapperKls),style:T.normalizeStyle(e.prefixWidth&&e.selected.length?{marginLeft:`${e.prefixWidth}px`}:"")},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.selected,H=>(T.openBlock(),T.createBlock(u,{key:e.getValueKey(H),closable:!e.selectDisabled&&!H.isDisabled,size:e.collapseTagSize,hit:H.hitState,type:e.tagType,"disable-transitions":"",onClose:V=>e.deleteTag(V,H)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text")),style:T.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},T.toDisplayString(H.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],6)]),_:1},8,["onAfterLeave"])),e.filterable&&!e.selectDisabled?T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":t[0]||(t[0]=H=>e.query=H),type:"text",class:T.normalizeClass(e.inputKls),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:T.normalizeStyle(e.inputStyle),role:"combobox","aria-activedescendant":((w=e.hoverOption)==null?void 0:w.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:t[1]||(t[1]=(...H)=>e.handleFocus&&e.handleFocus(...H)),onBlur:t[2]||(t[2]=(...H)=>e.handleBlur&&e.handleBlur(...H)),onKeyup:t[3]||(t[3]=(...H)=>e.managePlaceholder&&e.managePlaceholder(...H)),onKeydown:[t[4]||(t[4]=(...H)=>e.resetInputState&&e.resetInputState(...H)),t[5]||(t[5]=T.withKeys(T.withModifiers(H=>e.navigateOptions("next"),["prevent"]),["down"])),t[6]||(t[6]=T.withKeys(T.withModifiers(H=>e.navigateOptions("prev"),["prevent"]),["up"])),t[7]||(t[7]=T.withKeys((...H)=>e.handleKeydownEscape&&e.handleKeydownEscape(...H),["esc"])),t[8]||(t[8]=T.withKeys(T.withModifiers((...H)=>e.selectOption&&e.selectOption(...H),["stop","prevent"]),["enter"])),t[9]||(t[9]=T.withKeys((...H)=>e.deletePrevTag&&e.deletePrevTag(...H),["delete"])),t[10]||(t[10]=T.withKeys(H=>e.visible=!1,["tab"]))],onCompositionstart:t[11]||(t[11]=(...H)=>e.handleComposition&&e.handleComposition(...H)),onCompositionupdate:t[12]||(t[12]=(...H)=>e.handleComposition&&e.handleComposition(...H)),onCompositionend:t[13]||(t[13]=(...H)=>e.handleComposition&&e.handleComposition(...H)),onInput:t[14]||(t[14]=(...H)=>e.debouncedQueryChange&&e.debouncedQueryChange(...H))},null,46,xO)),[[T.vModelText,e.query]]):T.createCommentVNode("v-if",!0)],6)):T.createCommentVNode("v-if",!0),e.isIOS&&!e.multiple&&e.filterable&&e.readonly?(T.openBlock(),T.createElementBlock("input",{key:1,ref:"iOSInput",class:T.normalizeClass(e.iOSInputKls),disabled:e.selectDisabled,type:"text"},null,10,LO)):T.createCommentVNode("v-if",!0),T.createVNode(h,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":t[16]||(t[16]=H=>e.selectedLabel=H),type:"text",placeholder:typeof e.currentPlaceholder=="function"?e.currentPlaceholder():e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:T.normalizeClass([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,role:"combobox","aria-activedescendant":((E=e.hoverOption)==null?void 0:E.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,label:e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[t[17]||(t[17]=T.withKeys(T.withModifiers(H=>e.navigateOptions("next"),["stop","prevent"]),["down"])),t[18]||(t[18]=T.withKeys(T.withModifiers(H=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),T.withKeys(T.withModifiers(e.selectOption,["stop","prevent"]),["enter"]),T.withKeys(e.handleKeydownEscape,["esc"]),t[19]||(t[19]=T.withKeys(H=>e.visible=!1,["tab"]))]},T.createSlots({suffix:T.withCtx(()=>[e.iconComponent&&!e.showClose?(T.openBlock(),T.createBlock(f,{key:0,class:T.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(T.openBlock(),T.createBlock(f,{key:1,class:T.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:T.withCtx(()=>[T.createElementVNode("div",bO,[T.renderSlot(e.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","aria-activedescendant","aria-controls","aria-expanded","label","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]}),content:T.withCtx(()=>[T.createVNode(v,null,T.createSlots({default:T.withCtx(()=>[T.withDirectives(T.createVNode(g,{id:e.contentId,ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:T.normalizeClass(e.scrollbarKls),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:T.withCtx(()=>[e.showNewOption?(T.openBlock(),T.createBlock(p,{key:0,value:e.query,created:!0},null,8,["value"])):T.createCommentVNode("v-if",!0),T.createVNode(m,{onUpdateOptions:e.onOptionsRendered},{default:T.withCtx(()=>[T.renderSlot(e.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[T.vShow,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&e.options.size===0)?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[e.$slots.empty?T.renderSlot(e.$slots,"empty",{key:0}):(T.openBlock(),T.createElementBlock("p",{key:1,class:T.normalizeClass(e.nsSelect.be("dropdown","empty"))},T.toDisplayString(e.emptyText),3))],64)):T.createCommentVNode("v-if",!0)]),_:2},[e.$slots.header?{name:"header",fn:T.withCtx(()=>[T.renderSlot(e.$slots,"header")])}:void 0,e.$slots.footer?{name:"footer",fn:T.withCtx(()=>[T.renderSlot(e.$slots,"footer")])}:void 0]),1024)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[b,e.handleClose,e.popperPaneRef]])}var HO=e1(vO,[["render",wO],["__file","select.vue"]]);const MO=T.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=Jt("select"),r=T.ref(!0),n=T.getCurrentInstance(),i=T.ref([]);T.provide(tm,T.reactive({...T.toRefs(e)}));const a=T.inject(ys);T.onMounted(()=>{i.value=u(n.subTree)});const u=f=>{const h=[];return Array.isArray(f.children)&&f.children.forEach(p=>{var m;p.type&&p.type.name==="ElOption"&&p.component&&p.component.proxy?h.push(p.component.proxy):(m=p.children)!=null&&m.length&&h.push(...u(p))}),h},{groupQueryChange:o}=T.toRaw(a);return T.watch(o,()=>{r.value=i.value.some(f=>f.visible===!0)},{flush:"post"}),{visible:r,ns:t}}});function CO(e,t,r,n,i,a){return T.withDirectives((T.openBlock(),T.createElementBlock("ul",{class:T.normalizeClass(e.ns.be("group","wrap"))},[T.createElementVNode("li",{class:T.normalizeClass(e.ns.be("group","title"))},T.toDisplayString(e.label),3),T.createElementVNode("li",null,[T.createElementVNode("ul",{class:T.normalizeClass(e.ns.b("group"))},[T.renderSlot(e.$slots,"default")],2)])],2)),[[T.vShow,e.visible]])}var nm=e1(MO,[["render",CO],["__file","option-group.vue"]]);const di=g3(HO,{Option:iu,OptionGroup:nm}),gs=v4(iu);v4(nm);const AO=S1({trigger:ia.trigger,placement:nu.placement,disabled:ia.disabled,visible:J3.visible,transition:J3.transition,popperOptions:nu.popperOptions,tabindex:nu.tabindex,content:J3.content,popperStyle:J3.popperStyle,popperClass:J3.popperClass,enterable:{...J3.enterable,default:!0},effect:{...J3.effect,default:"light"},teleported:J3.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),SO={"update:visible":e=>on(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},EO="onUpdate:visible",VO=T.defineComponent({name:"ElPopover"}),DO=T.defineComponent({...VO,props:AO,emits:SO,setup(e,{expose:t,emit:r}){const n=e,i=T.computed(()=>n[EO]),a=Jt("popover"),u=T.ref(),o=T.computed(()=>{var E;return(E=T.unref(u))==null?void 0:E.popperRef}),f=T.computed(()=>[{width:ei(n.width)},n.popperStyle]),h=T.computed(()=>[a.b(),n.popperClass,{[a.m("plain")]:!!n.content}]),p=T.computed(()=>n.transition===`${a.namespace.value}-fade-in-linear`),m=()=>{var E;(E=u.value)==null||E.hide()},g=()=>{r("before-enter")},v=()=>{r("before-leave")},b=()=>{r("after-enter")},w=()=>{r("update:visible",!1),r("after-leave")};return t({popperRef:o,hide:m}),(E,H)=>(T.openBlock(),T.createBlock(T.unref(Gc),T.mergeProps({ref_key:"tooltipRef",ref:u},E.$attrs,{trigger:E.trigger,placement:E.placement,disabled:E.disabled,visible:E.visible,transition:E.transition,"popper-options":E.popperOptions,tabindex:E.tabindex,content:E.content,offset:E.offset,"show-after":E.showAfter,"hide-after":E.hideAfter,"auto-close":E.autoClose,"show-arrow":E.showArrow,"aria-label":E.title,effect:E.effect,enterable:E.enterable,"popper-class":T.unref(h),"popper-style":T.unref(f),teleported:E.teleported,persistent:E.persistent,"gpu-acceleration":T.unref(p),"onUpdate:visible":T.unref(i),onBeforeShow:g,onBeforeHide:v,onShow:b,onHide:w}),{content:T.withCtx(()=>[E.title?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(T.unref(a).e("title")),role:"title"},T.toDisplayString(E.title),3)):T.createCommentVNode("v-if",!0),T.renderSlot(E.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(E.content),1)])]),default:T.withCtx(()=>[E.$slots.reference?T.renderSlot(E.$slots,"reference",{key:0}):T.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var OO=e1(DO,[["__file","popover.vue"]]);const im=(e,t)=>{const r=t.arg||t.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=e)};var kO={mounted(e,t){im(e,t)},updated(e,t){im(e,t)}};const am=WC(kO,"popover"),_s=g3(OO,{directive:am}),fi="$treeNodeId",om=function(e,t){!t||t[fi]||Object.defineProperty(t,fi,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},au=function(e,t){return e?t[e]:t[fi]},ou=(e,t,r)=>{const n=e.value.currentNode;r();const i=e.value.currentNode;n!==i&&t("current-change",i?i.data:null,i)},su=e=>{let t=!0,r=!0,n=!0;for(let i=0,a=e.length;i<a;i++){const u=e[i];(u.checked!==!0||u.indeterminate)&&(t=!1,u.disabled||(n=!1)),(u.checked!==!1||u.indeterminate)&&(r=!1)}return{all:t,none:r,allWithoutDisable:n,half:!t&&!r}},vs=function(e){if(e.childNodes.length===0||e.loading)return;const{all:t,none:r,half:n}=su(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):n?(e.checked=!1,e.indeterminate=!0):r&&(e.checked=!1,e.indeterminate=!1);const i=e.parent;!i||i.level===0||e.store.checkStrictly||vs(i)},xs=function(e,t){const r=e.store.props,n=e.data||{},i=r[t];if(typeof i=="function")return i(n,e);if(typeof i=="string")return n[i];if(typeof i>"u"){const a=n[t];return a===void 0?"":a}};let PO=0,lu=class J9{constructor(t){this.id=PO++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in t)Kn(t,r)&&(this[r]=t[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const r=t.props;if(r&&typeof r.isLeaf<"u"){const a=xs(this,"isLeaf");typeof a=="boolean"&&(this.isLeafByUser=a)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||om(this,this.data),!this.data)return;const n=t.defaultExpandedKeys,i=t.key;i&&n&&n.includes(this.key)&&this.expand(null,t.autoExpandParent),i&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(t){Array.isArray(t)||om(this,t),this.data=t,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=xs(this,"children")||[];for(let n=0,i=r.length;n<i;n++)this.insertChild({data:r[n]})}get label(){return xs(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return xs(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return t.childNodes[r+1]}return null}get previousSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return r>0?t.childNodes[r-1]:null}return null}contains(t,r=!0){return(this.childNodes||[]).some(n=>n===t||r&&n.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,r,n){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof J9)){if(!n){const i=this.getChildren(!0);i.includes(t.data)||(typeof r>"u"||r<0?i.push(t.data):i.splice(r,0,t.data))}Object.assign(t,{parent:this,store:this.store}),t=T.reactive(new J9(t)),t instanceof J9&&t.initialize()}t.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),this.updateLeafState()}insertBefore(t,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(t,n)}insertAfter(t,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(t,n)}removeChild(t){const r=this.getChildren()||[],n=r.indexOf(t.data);n>-1&&r.splice(n,1);const i=this.childNodes.indexOf(t);i>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(i,1)),this.updateLeafState()}removeChildByData(t){let r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===t){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(t,r){const n=()=>{if(r){let i=this.parent;for(;i.level>0;)i.expanded=!0,i=i.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(i=>{i.canFocus=!0})};this.shouldLoadData()?this.loadData(i=>{Array.isArray(i)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vs(this),n())}):n()}doCreateChildren(t,r={}){t.forEach(n=>{this.insertChild(Object.assign({data:n},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const t=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!t||t.length===0;return}this.isLeaf=!1}setChecked(t,r,n,i){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:u,allWithoutDisable:o}=su(this.childNodes);!this.isLeaf&&!u&&o&&(this.checked=!1,t=!1);const f=()=>{if(r){const h=this.childNodes;for(let g=0,v=h.length;g<v;g++){const b=h[g];i=i||t!==!1;const w=b.disabled?b.checked:i;b.setChecked(w,r,!0,i)}const{half:p,all:m}=su(h);m||(this.checked=m,this.indeterminate=p)}};if(this.shouldLoadData()){this.loadData(()=>{f(),vs(this)},{checked:t!==!1});return}else f()}const a=this.parent;!a||a.level===0||n||vs(a)}getChildren(t=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let i="children";return n&&(i=n.children||"children"),r[i]===void 0&&(r[i]=null),t&&!r[i]&&(r[i]=[]),r[i]}updateChildren(){const t=this.getChildren()||[],r=this.childNodes.map(a=>a.data),n={},i=[];t.forEach((a,u)=>{const o=a[fi];!!o&&r.findIndex(h=>h[fi]===o)>=0?n[o]={index:u,data:a}:i.push({index:u,data:a})}),this.store.lazy||r.forEach(a=>{n[a[fi]]||this.removeChildByData(a)}),i.forEach(({index:a,data:u})=>{this.insertChild({data:u},a)}),this.updateLeafState()}loadData(t,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,i)};this.store.load(this,n)}else t&&t.call(this)}};class IO{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const r in t)Kn(t,r)&&(this[r]=t[r]);this.nodesMap={}}initialize(){if(this.root=new lu({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const t=this.load;t(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(t){const r=this.filterNodeMethod,n=this.lazy,i=function(a){const u=a.root?a.root.childNodes:a.childNodes;if(u.forEach(o=>{o.visible=r.call(o,t,o.data,o),i(o)}),!a.visible&&u.length){let o=!0;o=!u.some(f=>f.visible),a.root?a.root.visible=o===!1:a.visible=o===!1}t&&a.visible&&!a.isLeaf&&!n&&a.expand()};i(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof lu)return t;const r=i3(t)?au(this.key,t):t;return this.nodesMap[r]||null}insertBefore(t,r){const n=this.getNode(r);n.parent.insertBefore({data:t},n)}insertAfter(t,r){const n=this.getNode(r);n.parent.insertAfter({data:t},n)}remove(t){const r=this.getNode(t);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(t,r){const n=r?this.getNode(r):this.root;n&&n.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],r=this.nodesMap;t.forEach(n=>{const i=r[n];i&&i.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const r=this.key;!t||!t.data||(r?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,r=!1){const n=[],i=function(a){(a.root?a.root.childNodes:a.childNodes).forEach(o=>{(o.checked||r&&o.indeterminate)&&(!t||t&&o.isLeaf)&&n.push(o.data),i(o)})};return i(this),n}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const t=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(a=>{a.indeterminate&&t.push(a.data),r(a)})};return r(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],r=this.nodesMap;for(const n in r)Kn(r,n)&&t.push(r[n]);return t}updateChildren(t,r){const n=this.nodesMap[t];if(!n)return;const i=n.childNodes;for(let a=i.length-1;a>=0;a--){const u=i[a];this.remove(u.data)}for(let a=0,u=r.length;a<u;a++){const o=r[a];this.append(o,n.data)}}_setCheckedKeys(t,r=!1,n){const i=this._getAllNodes().sort((o,f)=>f.level-o.level),a=Object.create(null),u=Object.keys(n);i.forEach(o=>o.setChecked(!1,!1));for(let o=0,f=i.length;o<f;o++){const h=i[o],p=h.data[t].toString();if(!u.includes(p)){h.checked&&!a[p]&&h.setChecked(!1,!1);continue}let g=h.parent;for(;g&&g.level>0;)a[g.data[t]]=!0,g=g.parent;if(h.isLeaf||this.checkStrictly){h.setChecked(!0,!1);continue}if(h.setChecked(!0,!0),r){h.setChecked(!1,!1);const v=function(b){b.childNodes.forEach(E=>{E.isLeaf||E.setChecked(!1,!1),v(E)})};v(h)}}}setCheckedNodes(t,r=!1){const n=this.key,i={};t.forEach(a=>{i[(a||{})[n]]=!0}),this._setCheckedKeys(n,r,i)}setCheckedKeys(t,r=!1){this.defaultCheckedKeys=t;const n=this.key,i={};t.forEach(a=>{i[a]=!0}),this._setCheckedKeys(n,r,i)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(t,r,n){const i=this.getNode(t);i&&i.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,r=!0){const n=t[this.key],i=this.nodesMap[n];this.setCurrentNode(i),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,r=!0){if(t==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(t);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const BO=T.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=Jt("tree"),r=T.inject("NodeInstance"),n=T.inject("RootTree");return()=>{const i=e.node,{data:a,store:u}=i;return e.renderContent?e.renderContent(T.h,{_self:r,node:i,data:a,store:u}):T.renderSlot(n.ctx.slots,"default",{node:i,data:a},()=>[T.h("span",{class:t.be("node","label")},[i.label])])}}});var NO=e1(BO,[["__file","tree-node-content.vue"]]);function sm(e){const t=T.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{e.node!==n&&e.node.collapse()},children:[]};return t&&t.children.push(r),T.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(e.accordion)for(const i of r.children)i.treeNodeExpand(n)}}}const lm=Symbol("dragEvents");function FO({props:e,ctx:t,el$:r,dropIndicator$:n,store:i}){const a=Jt("tree"),u=T.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),o=({event:p,treeNode:m})=>{if(typeof e.allowDrag=="function"&&!e.allowDrag(m.node))return p.preventDefault(),!1;p.dataTransfer.effectAllowed="move";try{p.dataTransfer.setData("text/plain","")}catch{}u.value.draggingNode=m,t.emit("node-drag-start",m.node,p)},f=({event:p,treeNode:m})=>{const g=m,v=u.value.dropNode;v&&v.node.id!==g.node.id&&r6(v.$el,a.is("drop-inner"));const b=u.value.draggingNode;if(!b||!g)return;let w=!0,E=!0,H=!0,V=!0;typeof e.allowDrop=="function"&&(w=e.allowDrop(b.node,g.node,"prev"),V=E=e.allowDrop(b.node,g.node,"inner"),H=e.allowDrop(b.node,g.node,"next")),p.dataTransfer.dropEffect=E||w||H?"move":"none",(w||E||H)&&(v==null?void 0:v.node.id)!==g.node.id&&(v&&t.emit("node-drag-leave",b.node,v.node,p),t.emit("node-drag-enter",b.node,g.node,p)),(w||E||H)&&(u.value.dropNode=g),g.node.nextSibling===b.node&&(H=!1),g.node.previousSibling===b.node&&(w=!1),g.node.contains(b.node,!1)&&(E=!1),(b.node===g.node||b.node.contains(g.node))&&(w=!1,E=!1,H=!1);const I=g.$el.querySelector(`.${a.be("node","content")}`).getBoundingClientRect(),N=r.value.getBoundingClientRect();let R;const z=w?E?.25:H?.45:1:-1,Z=H?E?.75:w?.55:0:1;let K=-9999;const ee=p.clientY-I.top;ee<I.height*z?R="before":ee>I.height*Z?R="after":E?R="inner":R="none";const ie=g.$el.querySelector(`.${a.be("node","expand-icon")}`).getBoundingClientRect(),de=n.value;R==="before"?K=ie.top-N.top:R==="after"&&(K=ie.bottom-N.top),de.style.top=`${K}px`,de.style.left=`${ie.right-N.left}px`,R==="inner"?xc(g.$el,a.is("drop-inner")):r6(g.$el,a.is("drop-inner")),u.value.showDropIndicator=R==="before"||R==="after",u.value.allowDrop=u.value.showDropIndicator||V,u.value.dropType=R,t.emit("node-drag-over",b.node,g.node,p)},h=p=>{const{draggingNode:m,dropType:g,dropNode:v}=u.value;if(p.preventDefault(),p.dataTransfer.dropEffect="move",m&&v){const b={data:m.node.data};g!=="none"&&m.node.remove(),g==="before"?v.node.parent.insertBefore(b,v.node):g==="after"?v.node.parent.insertAfter(b,v.node):g==="inner"&&v.node.insertChild(b),g!=="none"&&i.value.registerNode(b),r6(v.$el,a.is("drop-inner")),t.emit("node-drag-end",m.node,v.node,g,p),g!=="none"&&t.emit("node-drop",m.node,v.node,g,p)}m&&!v&&t.emit("node-drag-end",m.node,null,g,p),u.value.showDropIndicator=!1,u.value.draggingNode=null,u.value.dropNode=null,u.value.allowDrop=!0};return T.provide(lm,{treeNodeDragStart:o,treeNodeDragOver:f,treeNodeDragEnd:h}),{dragState:u}}const RO=T.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:pD,ElCheckbox:fs,NodeContent:NO,ElIcon:U2,Loading:bc},props:{node:{type:lu,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const r=Jt("tree"),{broadcastExpanded:n}=sm(e),i=T.inject("RootTree"),a=T.ref(!1),u=T.ref(!1),o=T.ref(null),f=T.ref(null),h=T.ref(null),p=T.inject(lm),m=T.getCurrentInstance();T.provide("NodeInstance",m),i||S2("Tree","Can not find node's tree."),e.node.expanded&&(a.value=!0,u.value=!0);const g=i.props.props.children||"children";T.watch(()=>{const ee=e.node.data[g];return ee&&[...ee]},()=>{e.node.updateChildren()}),T.watch(()=>e.node.indeterminate,ee=>{w(e.node.checked,ee)}),T.watch(()=>e.node.checked,ee=>{w(ee,e.node.indeterminate)}),T.watch(()=>e.node.expanded,ee=>{T.nextTick(()=>a.value=ee),ee&&(u.value=!0)});const v=ee=>au(i.props.nodeKey,ee.data),b=ee=>{const ie=e.props.class;if(!ie)return{};let de;if(X3(ie)){const{data:ge}=ee;de=ie(ge,ee)}else de=ie;return C2(de)?{[de]:!0}:de},w=(ee,ie)=>{(o.value!==ee||f.value!==ie)&&i.ctx.emit("check-change",e.node.data,ee,ie),o.value=ee,f.value=ie},E=ee=>{ou(i.store,i.ctx.emit,()=>i.store.value.setCurrentNode(e.node)),i.currentNode.value=e.node,i.props.expandOnClickNode&&V(),i.props.checkOnClickNode&&!e.node.disabled&&I(null,{target:{checked:!e.node.checked}}),i.ctx.emit("node-click",e.node.data,e.node,m,ee)},H=ee=>{i.instance.vnode.props.onNodeContextmenu&&(ee.stopPropagation(),ee.preventDefault()),i.ctx.emit("node-contextmenu",ee,e.node.data,e.node,m)},V=()=>{e.node.isLeaf||(a.value?(i.ctx.emit("node-collapse",e.node.data,e.node,m),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,m)))},I=(ee,ie)=>{e.node.setChecked(ie.target.checked,!i.props.checkStrictly),T.nextTick(()=>{const de=i.store.value;i.ctx.emit("check",e.node.data,{checkedNodes:de.getCheckedNodes(),checkedKeys:de.getCheckedKeys(),halfCheckedNodes:de.getHalfCheckedNodes(),halfCheckedKeys:de.getHalfCheckedKeys()})})};return{ns:r,node$:h,tree:i,expanded:a,childNodeRendered:u,oldChecked:o,oldIndeterminate:f,getNodeKey:v,getNodeClass:b,handleSelectChange:w,handleClick:E,handleContextMenu:H,handleExpandIconClick:V,handleCheckChange:I,handleChildNodeExpand:(ee,ie,de)=>{n(ie),i.ctx.emit("node-expand",ee,ie,de)},handleDragStart:ee=>{i.props.draggable&&p.treeNodeDragStart({event:ee,treeNode:e})},handleDragOver:ee=>{ee.preventDefault(),i.props.draggable&&p.treeNodeDragOver({event:ee,treeNode:{$el:h.value,node:e.node}})},handleDrop:ee=>{ee.preventDefault()},handleDragEnd:ee=>{i.props.draggable&&p.treeNodeDragEnd(ee)},CaretRight:DC}}}),jO=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],zO=["aria-expanded"];function $O(e,t,r,n,i,a){const u=T.resolveComponent("el-icon"),o=T.resolveComponent("el-checkbox"),f=T.resolveComponent("loading"),h=T.resolveComponent("node-content"),p=T.resolveComponent("el-tree-node"),m=T.resolveComponent("el-collapse-transition");return T.withDirectives((T.openBlock(),T.createElementBlock("div",{ref:"node$",class:T.normalizeClass([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=T.withModifiers((...g)=>e.handleClick&&e.handleClick(...g),["stop"])),onContextmenu:t[2]||(t[2]=(...g)=>e.handleContextMenu&&e.handleContextMenu(...g)),onDragstart:t[3]||(t[3]=T.withModifiers((...g)=>e.handleDragStart&&e.handleDragStart(...g),["stop"])),onDragover:t[4]||(t[4]=T.withModifiers((...g)=>e.handleDragOver&&e.handleDragOver(...g),["stop"])),onDragend:t[5]||(t[5]=T.withModifiers((...g)=>e.handleDragEnd&&e.handleDragEnd(...g),["stop"])),onDrop:t[6]||(t[6]=T.withModifiers((...g)=>e.handleDrop&&e.handleDrop(...g),["stop"]))},[T.createElementVNode("div",{class:T.normalizeClass(e.ns.be("node","content")),style:T.normalizeStyle({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(T.openBlock(),T.createBlock(u,{key:0,class:T.normalizeClass([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:T.withModifiers(e.handleExpandIconClick,["stop"])},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0),e.showCheckbox?(T.openBlock(),T.createBlock(o,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=T.withModifiers(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):T.createCommentVNode("v-if",!0),e.node.loading?(T.openBlock(),T.createBlock(u,{key:2,class:T.normalizeClass([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:T.withCtx(()=>[T.createVNode(f)]),_:1},8,["class"])):T.createCommentVNode("v-if",!0),T.createVNode(h,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),T.createVNode(m,null,{default:T.withCtx(()=>[!e.renderAfterExpand||e.childNodeRendered?T.withDirectives((T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.node.childNodes,g=>(T.openBlock(),T.createBlock(p,{key:e.getNodeKey(g),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:g,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,zO)),[[T.vShow,e.expanded]]):T.createCommentVNode("v-if",!0)]),_:1})],42,jO)),[[T.vShow,e.node.visible]])}var ZO=e1(RO,[["render",$O],["__file","tree-node.vue"]]);function qO({el$:e},t){const r=Jt("tree"),n=T.shallowRef([]),i=T.shallowRef([]);T.onMounted(()=>{u()}),T.onUpdated(()=>{n.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))}),T.watch(i,o=>{o.forEach(f=>{f.setAttribute("tabindex","-1")})}),rn(e,"keydown",o=>{const f=o.target;if(!f.className.includes(r.b("node")))return;const h=o.code;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const p=n.value.indexOf(f);let m;if([a3.up,a3.down].includes(h)){if(o.preventDefault(),h===a3.up){m=p===-1?0:p!==0?p-1:n.value.length-1;const v=m;for(;!t.value.getNode(n.value[m].dataset.key).canFocus;){if(m--,m===v){m=-1;break}m<0&&(m=n.value.length-1)}}else{m=p===-1?0:p<n.value.length-1?p+1:0;const v=m;for(;!t.value.getNode(n.value[m].dataset.key).canFocus;){if(m++,m===v){m=-1;break}m>=n.value.length&&(m=0)}}m!==-1&&n.value[m].focus()}[a3.left,a3.right].includes(h)&&(o.preventDefault(),f.click());const g=f.querySelector('[type="checkbox"]');[a3.enter,a3.space].includes(h)&&g&&(o.preventDefault(),g.click())});const u=()=>{var o;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const f=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(f.length){f[0].setAttribute("tabindex","0");return}(o=n.value[0])==null||o.setAttribute("tabindex","0")}}const GO=T.defineComponent({name:"ElTree",components:{ElTreeNode:ZO},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:ln}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:r}=ri(),n=Jt("tree"),i=T.ref(new IO({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));i.value.initialize();const a=T.ref(i.value.root),u=T.ref(null),o=T.ref(null),f=T.ref(null),{broadcastExpanded:h}=sm(e),{dragState:p}=FO({props:e,ctx:t,el$:o,dropIndicator$:f,store:i});qO({el$:o},i);const m=T.computed(()=>{const{childNodes:Ee}=a.value;return!Ee||Ee.length===0||Ee.every(({visible:Ye})=>!Ye)});T.watch(()=>e.currentNodeKey,Ee=>{i.value.setCurrentNodeKey(Ee)}),T.watch(()=>e.defaultCheckedKeys,Ee=>{i.value.setDefaultCheckedKey(Ee)}),T.watch(()=>e.defaultExpandedKeys,Ee=>{i.value.setDefaultExpandedKeys(Ee)}),T.watch(()=>e.data,Ee=>{i.value.setData(Ee)},{deep:!0}),T.watch(()=>e.checkStrictly,Ee=>{i.value.checkStrictly=Ee});const g=Ee=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(Ee)},v=Ee=>au(e.nodeKey,Ee.data),b=Ee=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const Ye=i.value.getNode(Ee);if(!Ye)return[];const Pt=[Ye.data];let Ie=Ye.parent;for(;Ie&&Ie!==a.value;)Pt.push(Ie.data),Ie=Ie.parent;return Pt.reverse()},w=(Ee,Ye)=>i.value.getCheckedNodes(Ee,Ye),E=Ee=>i.value.getCheckedKeys(Ee),H=()=>{const Ee=i.value.getCurrentNode();return Ee?Ee.data:null},V=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const Ee=H();return Ee?Ee[e.nodeKey]:null},I=(Ee,Ye)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(Ee,Ye)},N=(Ee,Ye)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(Ee,Ye)},R=(Ee,Ye,Pt)=>{i.value.setChecked(Ee,Ye,Pt)},z=()=>i.value.getHalfCheckedNodes(),Z=()=>i.value.getHalfCheckedKeys(),K=(Ee,Ye=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");ou(i,t.emit,()=>i.value.setUserCurrentNode(Ee,Ye))},ee=(Ee,Ye=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");ou(i,t.emit,()=>i.value.setCurrentNodeKey(Ee,Ye))},ie=Ee=>i.value.getNode(Ee),de=Ee=>{i.value.remove(Ee)},ge=(Ee,Ye)=>{i.value.append(Ee,Ye)},Ce=(Ee,Ye)=>{i.value.insertBefore(Ee,Ye)},Re=(Ee,Ye)=>{i.value.insertAfter(Ee,Ye)},Ze=(Ee,Ye,Pt)=>{h(Ye),t.emit("node-expand",Ee,Ye,Pt)},tt=(Ee,Ye)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(Ee,Ye)};return T.provide("RootTree",{ctx:t,props:e,store:i,root:a,currentNode:u,instance:T.getCurrentInstance()}),T.provide(ra,void 0),{ns:n,store:i,root:a,currentNode:u,dragState:p,el$:o,dropIndicator$:f,isEmpty:m,filter:g,getNodeKey:v,getNodePath:b,getCheckedNodes:w,getCheckedKeys:E,getCurrentNode:H,getCurrentKey:V,setCheckedNodes:I,setCheckedKeys:N,setChecked:R,getHalfCheckedNodes:z,getHalfCheckedKeys:Z,setCurrentNode:K,setCurrentKey:ee,t:r,getNode:ie,remove:de,append:ge,insertBefore:Ce,insertAfter:Re,handleNodeExpand:Ze,updateKeyChildren:tt}}});function UO(e,t,r,n,i,a){const u=T.resolveComponent("el-tree-node");return T.openBlock(),T.createElementBlock("div",{ref:"el$",class:T.normalizeClass([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.root.childNodes,o=>(T.openBlock(),T.createBlock(u,{key:e.getNodeKey(o),node:o,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(e.ns.e("empty-block"))},[T.renderSlot(e.$slots,"empty",{},()=>{var o;return[T.createElementVNode("span",{class:T.normalizeClass(e.ns.e("empty-text"))},T.toDisplayString((o=e.emptyText)!=null?o:e.t("el.tree.emptyText")),3)]})],2)):T.createCommentVNode("v-if",!0),T.withDirectives(T.createElementVNode("div",{ref:"dropIndicator$",class:T.normalizeClass(e.ns.e("drop-indicator"))},null,2),[[T.vShow,e.dragState.showDropIndicator]])],2)}var Ls=e1(GO,[["render",UO],["__file","tree.vue"]]);Ls.install=e=>{e.component(Ls.name,Ls)};const cm=Ls;function WO(e){let t;const r=T.ref(!1),n=T.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function i(g){n.text=g}function a(){const g=n.parent,v=m.ns;if(!g.vLoadingAddClassList){let b=g.getAttribute("loading-number");b=Number.parseInt(b)-1,b?g.setAttribute("loading-number",b.toString()):(r6(g,v.bm("parent","relative")),g.removeAttribute("loading-number")),r6(g,v.bm("parent","hidden"))}u(),p.unmount()}function u(){var g,v;(v=(g=m.$el)==null?void 0:g.parentNode)==null||v.removeChild(m.$el)}function o(){var g;e.beforeClose&&!e.beforeClose()||(r.value=!0,clearTimeout(t),t=window.setTimeout(f,400),n.visible=!1,(g=e.closed)==null||g.call(e))}function f(){if(!r.value)return;const g=n.parent;r.value=!1,g.vLoadingAddClassList=void 0,a()}const h=T.defineComponent({name:"ElLoading",setup(g,{expose:v}){const{ns:b,zIndex:w}=LS("loading");return v({ns:b,zIndex:w}),()=>{const E=n.spinner||n.svg,H=T.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...E?{innerHTML:E}:{}},[T.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),V=n.text?T.h("p",{class:b.b("text")},[n.text]):void 0;return T.h(T.Transition,{name:b.b("fade"),onAfterLeave:f},{default:T.withCtx(()=>[T.withDirectives(T.createVNode("div",{style:{backgroundColor:n.background||""},class:[b.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[T.h("div",{class:b.b("spinner")},[H,V])]),[[T.vShow,n.visible]])])})}}}),p=T.createApp(h),m=p.mount(document.createElement("div"));return{...T.toRefs(n),setText:i,removeElLoadingChild:u,close:o,handleAfterLeave:f,vm:m,get $el(){return m.$el}}}let bs;const cu=function(e={}){if(!M2)return;const t=XO(e);if(t.fullscreen&&bs)return bs;const r=WO({...t,closed:()=>{var i;(i=t.closed)==null||i.call(t),t.fullscreen&&(bs=void 0)}});KO(t,t.parent,r),um(t,t.parent,r),t.parent.vLoadingAddClassList=()=>um(t,t.parent,r);let n=t.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",t.parent.setAttribute("loading-number",n),t.parent.appendChild(r.$el),T.nextTick(()=>r.visible.value=t.visible),t.fullscreen&&(bs=r),r},XO=e=>{var t,r,n,i;let a;return C2(e.target)?a=(t=document.querySelector(e.target))!=null?t:document.body:a=e.target||document.body,{parent:a===document.body||e.body?document.body:a,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:a===document.body&&((r=e.fullscreen)!=null?r:!0),lock:(n=e.lock)!=null?n:!1,customClass:e.customClass||"",visible:(i=e.visible)!=null?i:!0,target:a}},KO=async(e,t,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,i={};if(e.fullscreen)r.originalPosition.value=q5(document.body,"position"),r.originalOverflow.value=q5(document.body,"overflow"),i.zIndex=n();else if(e.parent===document.body){r.originalPosition.value=q5(document.body,"position"),await T.nextTick();for(const a of["top","left"]){const u=a==="top"?"scrollTop":"scrollLeft";i[a]=`${e.target.getBoundingClientRect()[a]+document.body[u]+document.documentElement[u]-Number.parseInt(q5(document.body,`margin-${a}`),10)}px`}for(const a of["height","width"])i[a]=`${e.target.getBoundingClientRect()[a]}px`}else r.originalPosition.value=q5(t,"position");for(const[a,u]of Object.entries(i))r.$el.style[a]=u},um=(e,t,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?r6(t,n.bm("parent","relative")):xc(t,n.bm("parent","relative")),e.fullscreen&&e.lock?xc(t,n.bm("parent","hidden")):r6(t,n.bm("parent","hidden"))},uu=Symbol("ElLoading"),Qm=(e,t)=>{var r,n,i,a;const u=t.instance,o=g=>i3(t.value)?t.value[g]:void 0,f=g=>{const v=C2(g)&&(u==null?void 0:u[g])||g;return v&&T.ref(v)},h=g=>f(o(g)||e.getAttribute(`element-loading-${Hb(g)}`)),p=(r=o("fullscreen"))!=null?r:t.modifiers.fullscreen,m={text:h("text"),svg:h("svg"),svgViewBox:h("svgViewBox"),spinner:h("spinner"),background:h("background"),customClass:h("customClass"),fullscreen:p,target:(n=o("target"))!=null?n:p?void 0:e,body:(i=o("body"))!=null?i:t.modifiers.body,lock:(a=o("lock"))!=null?a:t.modifiers.lock};e[uu]={options:m,instance:cu(m)}},JO=(e,t)=>{for(const r of Object.keys(t))T.isRef(t[r])&&(t[r].value=e[r])},ws={mounted(e,t){t.value&&Qm(e,t)},updated(e,t){const r=e[uu];t.oldValue!==t.value&&(t.value&&!t.oldValue?Qm(e,t):t.value&&t.oldValue?i3(t.value)&&JO(t.value,r.options):r==null||r.instance.close())},unmounted(e){var t;(t=e[uu])==null||t.instance.close()}},YO={install(e){e.directive("loading",ws),e.config.globalProperties.$loading=cu},directive:ws,service:cu},br=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},ek={name:"ExternalResourceCard",components:{Button:W4},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:T.shallowRef(zC)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){window.open(e,"_blank")}}},tk={class:"resource-container"};function rk(e,t,r,n,i,a){const u=W4;return T.openBlock(),T.createElementBlock("div",tk,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.resources,o=>(T.openBlock(),T.createElementBlock("div",{key:o.id,class:"resource"},[o.id==="pubmed"?(T.openBlock(),T.createBlock(u,{key:0,class:"button",icon:e.ElIconNotebook,onClick:f=>a.openUrl(o.url)},{default:T.withCtx(()=>[T.createTextVNode(" Open publications in pubmed ")]),_:2},1032,["icon","onClick"])):T.createCommentVNode("",!0)]))),128))])}const Tm=br(ek,[["render",rk],["__scopeId","data-v-e3aa8e1a"]]);function nk(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const Hs=new nk,ik=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),ak=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},ok={name:"ProvenancePopup",components:{Button:W4,Container:rO,Icon:U2,ExternalResourceCard:Tm,ElIconArrowUp:J0,ElIconArrowDown:sn,ElIconWarning:df},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Observed in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return ik(e)},capitalise:function(e){return ak(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Hs.emit("onActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name)})},openAxons:function(){Hs.emit("onActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name)})},openDendrites:function(){Hs.emit("onActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name)})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e}}},la=e=>(T.pushScopeId("data-v-822227e4"),e=e(),T.popScopeId(),e),sk={key:0,class:"main"},lk={key:0,class:"block"},ck={class:"title"},uk={key:0,class:"subtitle"},Qk={key:1,class:"block"},Tk={class:"title"},hk={class:"content-container scrollbar"},dk={key:0,class:"block"},fk=la(()=>T.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),pk={style:{"word-break":"keep-all"}},mk=la(()=>T.createElementVNode("i",null,"Origin",-1)),yk={key:0,class:"seperator"},gk={key:1,class:"block"},_k=la(()=>T.createElementVNode("div",{class:"attribute-title"},"Components",-1)),vk={key:0,class:"seperator"},xk={key:2,class:"block"},Lk=la(()=>T.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),bk=la(()=>T.createElementVNode("span",{style:{"word-break":"keep-all"}},[T.createElementVNode("i",null,"Destination"),T.createTextVNode(" is where the axons terminate ")],-1)),wk={key:0,class:"seperator"};function Hk(e,t,r,n,i,a){const u=J0,o=U2,f=sn,h=df,p=_s,m=W4,g=Tm,v=ws;return r.entry?T.withDirectives((T.openBlock(),T.createElementBlock("div",sk,[r.entry.title?(T.openBlock(),T.createElementBlock("div",lk,[T.createElementVNode("span",ck,T.toDisplayString(a.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(T.openBlock(),T.createElementBlock("div",uk,T.toDisplayString(a.provSpeciesDescription),1)):T.createCommentVNode("",!0)])):(T.openBlock(),T.createElementBlock("div",Qk,[T.createElementVNode("span",Tk,T.toDisplayString(r.entry.featureId),1)])),T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=b=>e.showDetails=!1)},[T.createTextVNode(" Hide path information "),T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(u)]),_:1})],512),[[T.vShow,e.showDetails]]),T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=b=>e.showDetails=!0)},[T.createTextVNode(" Show path information "),T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(f)]),_:1})],512),[[T.vShow,!e.showDetails]]),T.createVNode(T.Transition,{name:"slide-fade"},{default:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",hk,[T.createTextVNode(T.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(T.openBlock(),T.createElementBlock("div",dk,[T.createElementVNode("div",null,[fk,T.createVNode(p,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:T.withCtx(()=>[T.createVNode(o,{class:"info"},{default:T.withCtx(()=>[T.createVNode(h)]),_:1}),T.createElementVNode("span",pk,[mk,T.createTextVNode(" "+T.toDisplayString(a.originDescription),1)])]),_:1})]),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.entry.origins,(b,w)=>(T.openBlock(),T.createElementBlock("div",{class:"attribute-content",key:b},[T.createTextVNode(T.toDisplayString(a.capitalise(b))+" ",1),w!=r.entry.origins.length-1?(T.openBlock(),T.createElementBlock("div",yk)):T.createCommentVNode("",!0)]))),128)),T.withDirectives(T.createVNode(m,{class:"button",onClick:a.openDendrites},{default:T.withCtx(()=>[T.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[T.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0]])])):T.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(T.openBlock(),T.createElementBlock("div",gk,[_k,(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.entry.components,(b,w)=>(T.openBlock(),T.createElementBlock("div",{class:"attribute-content",key:b},[T.createTextVNode(T.toDisplayString(a.capitalise(b))+" ",1),w!=r.entry.components.length-1?(T.openBlock(),T.createElementBlock("div",vk)):T.createCommentVNode("",!0)]))),128))])):T.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(T.openBlock(),T.createElementBlock("div",xk,[T.createElementVNode("div",null,[Lk,T.createVNode(p,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:T.withCtx(()=>[T.createVNode(o,{class:"info"},{default:T.withCtx(()=>[T.createVNode(h)]),_:1}),bk]),_:1})]),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.entry.destinations,(b,w)=>(T.openBlock(),T.createElementBlock("div",{class:"attribute-content",key:b},[T.createTextVNode(T.toDisplayString(a.capitalise(b))+" ",1),w!=r.entry.destinations.length-1?(T.openBlock(),T.createElementBlock("div",wk)):T.createCommentVNode("",!0)]))),128)),T.withDirectives(T.createVNode(m,{class:"button",onClick:a.openAxons},{default:T.withCtx(()=>[T.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[T.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0]])])):T.createCommentVNode("",!0),T.withDirectives(T.createVNode(m,{class:"button",onClick:a.openAll},{default:T.withCtx(()=>[T.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[T.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0]]),T.createVNode(g,{resources:a.resources},null,8,["resources"])],512),[[T.vShow,e.showDetails]])]),_:1})])),[[v,e.loading]]):T.createCommentVNode("",!0)}const hm=br(ok,[["render",Hk],["__scopeId","data-v-822227e4"]]);var dm={},Ms={},fm={exports:{}};/*! js-cookie v3.0.5 | MIT */(function(e,t){(function(r,n){e.exports=n()})(D,function(){function r(u){for(var o=1;o<arguments.length;o++){var f=arguments[o];for(var h in f)u[h]=f[h]}return u}var n={read:function(u){return u[0]==='"'&&(u=u.slice(1,-1)),u.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(u){return encodeURIComponent(u).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function i(u,o){function f(p,m,g){if(!(typeof document>"u")){g=r({},o,g),typeof g.expires=="number"&&(g.expires=new Date(Date.now()+g.expires*864e5)),g.expires&&(g.expires=g.expires.toUTCString()),p=encodeURIComponent(p).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var v="";for(var b in g)g[b]&&(v+="; "+b,g[b]!==!0&&(v+="="+g[b].split(";")[0]));return document.cookie=p+"="+u.write(m,p)+v}}function h(p){if(!(typeof document>"u"||arguments.length&&!p)){for(var m=document.cookie?document.cookie.split("; "):[],g={},v=0;v<m.length;v++){var b=m[v].split("="),w=b.slice(1).join("=");try{var E=decodeURIComponent(b[0]);if(g[E]=u.read(w,E),p===E)break}catch{}}return p?g[p]:g}}return Object.create({set:f,get:h,remove:function(p,m){f(p,"",r({},m,{expires:-1}))},withAttributes:function(p){return i(this.converter,r({},this.attributes,p))},withConverter:function(p){return i(r({},this.converter,p),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(u)}})}var a=i(n,{path:"/"});return a})})(fm);var Mk=fm.exports,K4=D&&D.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},w2=D&&D.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ck=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},pn,ca,_3,J4,l6;Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.AnnotationService=void 0;const Cs=Ck(Mk),Ak=1e4;class Sk{constructor(t){pn.add(this),ca.set(this,void 0),_3.set(this,null),J4.set(this,null),t.slice(-1)==="/"?K4(this,ca,t.slice(0,-1),"f"):K4(this,ca,t,"f")}get currentUser(){return w2(this,J4,"f")}get currentError(){return w2(this,_3,"f")}async authenticate(){K4(this,_3,null,"f"),K4(this,J4,null,"f");const t=await w2(this,pn,"m",l6).call(this,"authenticate");return"error"in t?(Cs.default.remove("annotation-key"),Promise.resolve(w2(this,_3,"f"))):(Cs.default.set("annotation-key",t.session,{secure:!0,expires:1}),K4(this,J4,t.data,"f"),Promise.resolve(w2(this,J4,"f")))}async unauthenticate(){K4(this,_3,null,"f"),K4(this,J4,null,"f");const t=await w2(this,pn,"m",l6).call(this,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(w2(this,_3,"f"))}async annotatedItemIds(t){const r=await w2(this,pn,"m",l6).call(this,"items/","GET",{resource:t});return"error"in r?Promise.resolve(w2(this,_3,"f")):Promise.resolve(r)}async itemAnnotations(t,r){const n=await w2(this,pn,"m",l6).call(this,"annotations/","GET",{resource:t,item:r});return"error"in n?Promise.resolve(w2(this,_3,"f")):Promise.resolve(n)}async annotation(t){const r=await w2(this,pn,"m",l6).call(this,"annotation/","GET",{annotation:t});return"error"in r?Promise.resolve(w2(this,_3,"f")):Promise.resolve(r)}async addAnnotation(t){if(w2(this,J4,"f")&&w2(this,J4,"f").canUpdate){const r=Object.assign({creator:w2(this,J4,"f"),created:new Date().toISOString()},t),n=await w2(this,pn,"m",l6).call(this,"annotation/","POST",{data:r});if(!("error"in n))return Promise.resolve(n);K4(this,_3,n,"f")}else K4(this,_3,{error:"user cannot add annotation"},"f");return Promise.resolve(w2(this,_3,"f"))}}Ms.AnnotationService=Sk,ca=new WeakMap,_3=new WeakMap,J4=new WeakMap,pn=new WeakSet,l6=async function(t,r="GET",n={}){let i=!0;const a=new AbortController;setTimeout(()=>{i&&(console.log("Annotation server timeout..."),a.abort())},Ak);const u={method:r,signal:a.signal};let o=`${w2(this,ca,"f")}/${t}`;const f=Cs.default.get("user-token")||"",h=Cs.default.get("annotation-key")||"";if(r==="GET"){const m=[];for(const[g,v]of Object.entries(n))m.push(`${g}=${encodeURIComponent(JSON.stringify(v))}`);m.push(`key=${encodeURIComponent(f)}`),m.push(`session=${encodeURIComponent(h)}`),o+="?"+m.join("&"),u.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(r==="POST"){const m=Object.assign({key:f,session:h},n);u.body=JSON.stringify(m),u.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const p=await fetch(o,u);return i=!1,p.ok?Promise.resolve(await p.json()):(K4(this,_3,{error:`${p.status} ${p.statusText}`},"f"),Promise.resolve(w2(this,_3,"f")))},function(e){var t=D&&D.__createBinding||(Object.create?function(n,i,a,u){u===void 0&&(u=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,u,o)}:function(n,i,a,u){u===void 0&&(u=a),n[u]=i[a]}),r=D&&D.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ms,e)}(dm);const Ek={name:"AnnotationTool",components:{Button:W4,Col:Lr,Input:ls,Main:em,Row:X4,Select:di,ElIconArrowUp:J0,ElIconArrowDown:sn,ElIconEdit:Tf,ElIconClose:G5},props:{annotationEntry:{type:Object}},inject:["flatmapAPI"],data:function(){return{displayPair:{"Feature ID":"featureId",Tooltip:"label",Models:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:["DOI:","PMID:"],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:""}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId}},methods:{evidenceEntered:function(e){e&&(this.evidence.push(this.evidencePrefix+e),this.newEvidence="")},formatTime:function(e){const t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(e).toLocaleDateString(void 0,t)},updatePrevSubmissions:function(){this.$annotator&&this.authenticated&&this.annotationEntry.resourceId&&this.annotationEntry.featureId&&this.$annotator.itemAnnotations(this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)})},submit:function(){if((this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const n=r.replace("DOI:","https://doi.org/");e.push(new URL(n))}else if(r.includes("PMID:")){const n=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(n))}});const t={resource:this.annotationEntry.resourceId,item:this.annotationEntry.featureId,evidence:e,comment:this.comment};this.$annotator.addAnnotation(t).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"})}},removeEvidence:function(e){this.evidence.splice(e,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""}},watch:{annotationEntry:{handler:function(){this.resetSubmission(),this.updatePrevSubmissions()},immediate:!1,deep:!1}},mounted:function(){this.$annotator||(this.$annotator=new dm.AnnotationService(`${this.flatmapAPI}annotator`)),this.$annotator.authenticate().then(e=>{e.name&&e.email?(this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},c6=e=>(T.pushScopeId("data-v-18380efb"),e=e(),T.popScopeId(),e),Vk={class:"block"},Dk=c6(()=>T.createElementVNode("span",{class:"title"},"Feature Annotations",-1)),Ok=c6(()=>T.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),kk=c6(()=>T.createElementVNode("strong",null,"Evidence: ",-1)),Pk=["href"],Ik=c6(()=>T.createElementVNode("strong",null,"Comment: ",-1)),Bk=c6(()=>T.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),Nk=c6(()=>T.createElementVNode("strong",null,"Evidvence:",-1)),Fk=c6(()=>T.createElementVNode("strong",null,"Comment:",-1)),Rk={class:"sub-title"};function jk(e,t,r,n,i,a){const u=X4,o=J0,f=U2,h=sn,p=Tf,m=Lr,g=G5,v=gs,b=di,w=ls,E=W4,H=em;return T.openBlock(),T.createBlock(H,{class:"main"},{default:T.withCtx(()=>[T.createElementVNode("div",Vk,[T.createVNode(u,{class:"info-field"},{default:T.withCtx(()=>[Dk]),_:1}),r.annotationEntry?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.displayPair,(V,I)=>T.withDirectives((T.openBlock(),T.createBlock(u,{class:"dialog-text",key:V},{default:T.withCtx(()=>[T.createElementVNode("strong",null,T.toDisplayString(I)+": ",1),T.createTextVNode(" "+T.toDisplayString(r.annotationEntry[V]),1)]),_:2},1024)),[[T.vShow,r.annotationEntry[V]]])),128)),e.prevSubs.length>0?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=V=>e.showSubmissions=!1)},[T.createTextVNode(" Hide previous submissions "),T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(o)]),_:1})],512),[[T.vShow,e.showSubmissions]]),T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=V=>e.showSubmissions=!0)},[T.createTextVNode(" Show previous "+T.toDisplayString(e.prevSubs.length)+" submission(s) ",1),T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(h)]),_:1})],512),[[T.vShow,!e.showSubmissions]]),e.showSubmissions?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createVNode(u,{class:"dialog-spacer"}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Ok]),_:1}),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.prevSubs,(V,I)=>(T.openBlock(),T.createElementBlock("div",{class:"entry",key:I},[T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[T.createElementVNode("strong",null,T.toDisplayString(a.formatTime(V.created)),1),T.createTextVNode(" "+T.toDisplayString(V.creator.name),1)]),_:2},1024),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[kk,(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(V.evidence,N=>(T.openBlock(),T.createBlock(u,{key:N,class:"dialog-text"},{default:T.withCtx(()=>[T.createElementVNode("a",{href:N,target:"_blank"},T.toDisplayString(N),9,Pk)]),_:2},1024))),128))]),_:2},1024),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Ik,T.createTextVNode(" "+T.toDisplayString(V.comment),1)]),_:2},1024)]))),128))],64)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0),e.authenticated?(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[a.isEditable?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createVNode(u,{class:"dialog-spacer"}),e.editing?(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Bk]),_:1}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Nk]),_:1}),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.evidence,(V,I)=>(T.openBlock(),T.createBlock(u,{key:V},{default:T.withCtx(()=>[T.createVNode(m,{span:20},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(e.evidence[I]),1)]),_:2},1024),T.createVNode(m,{span:4},{default:T.withCtx(()=>[T.createVNode(f,{class:"standard-icon"},{default:T.withCtx(()=>[T.createVNode(g)]),_:1})]),_:1})]),_:2},1024))),128)),T.createVNode(u,null,{default:T.withCtx(()=>[T.createVNode(w,{size:"mini",placeholder:"Enter",modelValue:e.newEvidence,"onUpdate:modelValue":t[3]||(t[3]=V=>e.newEvidence=V),onChange:t[4]||(t[4]=V=>a.evidenceEntered(V))},{prepend:T.withCtx(()=>[T.createVNode(b,{teleported:!1,modelValue:e.evidencePrefix,"onUpdate:modelValue":t[2]||(t[2]=V=>e.evidencePrefix=V),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.evidencePrefixes,V=>(T.openBlock(),T.createBlock(v,{key:V,label:V,value:V},{default:T.withCtx(()=>[T.createVNode(u,null,{default:T.withCtx(()=>[T.createVNode(m,{span:12},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(V),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1}),T.createVNode(u,null,{default:T.withCtx(()=>[Fk]),_:1}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[T.createVNode(w,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:e.comment,"onUpdate:modelValue":t[5]||(t[5]=V=>e.comment=V)},null,8,["modelValue"])]),_:1}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[T.createVNode(E,{class:"button",type:"primary",plain:"",onClick:a.submit},{default:T.withCtx(()=>[T.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(T.openBlock(),T.createBlock(u,{key:0},{default:T.withCtx(()=>[T.createVNode(f,{class:"standard-icon"},{default:T.withCtx(()=>[T.createVNode(p)]),_:1})]),_:1})),e.errorMessage?(T.openBlock(),T.createBlock(u,{key:2,class:"dialog-text"},{default:T.withCtx(()=>[T.createElementVNode("strong",Rk,T.toDisplayString(e.errorMessage),1)]),_:1})):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)])]),_:1})}const pm=br(Ek,[["render",jk],["__scopeId","data-v-18380efb"]]),zk={name:"Tooltip",components:{AnnotationTool:pm,ProvenancePopup:hm},props:{entry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}}},$k={class:"tooltip-container"};function Zk(e,t,r,n,i,a){const u=pm,o=hm;return T.openBlock(),T.createElementBlock("div",$k,[r.annotationDisplay?(T.openBlock(),T.createBlock(u,{key:0,annotationEntry:r.annotationEntry},null,8,["annotationEntry"])):(T.openBlock(),T.createBlock(o,{key:1,entry:r.entry},null,8,["entry"]))])}const Qu=br(zk,[["render",Zk],["__scopeId","data-v-ab5392fa"]]),qk={name:"SelectionsGroup",components:{Checkbox:fs,CheckboxGroup:eu,Col:Lr,Row:X4},methods:{reset:function(){this.checkAll=!0,this.checkedItems=[],this.selections.forEach(e=>{!("enabled"in e)||e.enabled===!0?this.checkedItems.push(e[this.identifierKey]):this.checkAll=!1})},visibilityToggle:function(e,t){this.$emit("changed",{key:e,value:t})},handleCheckedItemsChange:function(e){let t=e.length;this.checkAll=t===this.selections.length},handleCheckAllChange:function(e){this.checkedItems=e?this.selections.map(t=>t[this.identifierKey]):[],this.$emit("checkAll",{keys:this.selections.map(t=>t[this.identifierKey]),value:e})},getBackgroundStyles:function(e){return"colour"in e&&this.colourStyle==="background"?{background:e.colour}:{}},hasLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}}},props:{colourStyle:{type:String,default:"line"},identifierKey:{type:String,default:"id"},labelKey:{type:String,default:"label"},title:{type:String,default:""},selections:{type:Array,default:function(){return[]}}},computed:{isIndeterminate:function(){return!(this.checkedItems.length===0||this.checkAll)}},data:function(){return{checkedItems:[],checkAll:!0}},mounted:function(){this.reset()}},Gk={class:"selections-container"},Uk={class:"checkall-display-text"},Wk={class:"checkbox-group-inner"},Xk={class:"checkbox-container"};function Kk(e,t,r,n,i,a){const u=Lr,o=fs,f=X4,h=eu;return T.openBlock(),T.createElementBlock("div",Gk,[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(u,{span:12},{default:T.withCtx(()=>[T.createElementVNode("div",Uk,T.toDisplayString(r.title),1)]),_:1}),T.createVNode(u,{span:12},{default:T.withCtx(()=>[r.selections&&r.selections.length>1?(T.openBlock(),T.createBlock(o,{key:0,class:"all-checkbox",indeterminate:a.isIndeterminate,modelValue:e.checkAll,"onUpdate:modelValue":t[0]||(t[0]=p=>e.checkAll=p),onChange:a.handleCheckAllChange},{default:T.withCtx(()=>[T.createTextVNode("Display all")]),_:1},8,["indeterminate","modelValue","onChange"])):T.createCommentVNode("",!0)]),_:1})]),_:1}),T.createVNode(h,{modelValue:e.checkedItems,"onUpdate:modelValue":t[1]||(t[1]=p=>e.checkedItems=p),size:"small",class:"checkbox-group",onChange:a.handleCheckedItemsChange},{default:T.withCtx(()=>[T.createElementVNode("div",Wk,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.selections,p=>(T.openBlock(),T.createBlock(f,{key:p[r.identifierKey],label:p[r.identifierKey]},{default:T.withCtx(()=>[T.createElementVNode("div",Xk,[T.createVNode(o,{class:"my-checkbox",label:p[r.identifierKey],onChange:m=>a.visibilityToggle(p[r.identifierKey],m),checked:!("enabled"in p)||p.enabled===!0},{default:T.withCtx(()=>[T.createVNode(f,{class:"checkbox-row"},{default:T.withCtx(()=>[a.hasLineStyles(p)?(T.openBlock(),T.createBlock(u,{key:0,span:4},{default:T.withCtx(()=>[T.createElementVNode("div",{class:"path-visual",style:T.normalizeStyle(a.getLineStyles(p))},null,4)]),_:2},1024)):T.createCommentVNode("",!0),T.createVNode(u,{span:20},{default:T.withCtx(()=>[T.createElementVNode("div",{style:T.normalizeStyle(a.getBackgroundStyles(p))},T.toDisplayString(p[r.labelKey]),5)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","onChange","checked"])])]),_:2},1032,["label"]))),128))])]),_:1},8,["modelValue","onChange"])])}const mm=br(qk,[["render",Kk],["__scopeId","data-v-4d3741da"]]),Jk={name:"TreeControls",components:{Checkbox:fs,CheckboxGroup:eu,ColorPicker:$D,Row:X4,Tree:cm},props:{treeData:{type:Array,default:function(){return[]}},active:{type:String,default:""},hover:{type:String,default:""}},data:function(){return{defaultExpandedKeys:["All"]}},unmounted:function(){this.sortedPrimitiveGroups=void 0},methods:{nodeIsActive:function(e){return this.active===e.models},nodeIsHover:function(e){return this.hover===e.models},changeActiveByNode:function(e){e.models&&this.$emit("change-active",e.models)},changeHoverByNode:function(){},checkChanged:function(e,t){const r=t.checkedKeys.includes(e.key);e.key==="All"?this.$emit("checkAll",r):this.$emit("changed",{key:e.key,value:r})},getBackgroundStyles:function(e){return"colour"in e?{background:e.colour}:{}}}},Yk=e=>(T.pushScopeId("data-v-df242013"),e=e(),T.popScopeId(),e),eP={class:"container"},tP=Yk(()=>T.createElementVNode("div",{class:"title-text"},"Systems",-1)),rP={class:"tree-container"},nP=["onClick","onMouseover"];function iP(e,t,r,n,i,a){const u=Lr,o=X4,f=cm;return T.openBlock(),T.createElementBlock("div",eP,[T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(u,{span:12},{default:T.withCtx(()=>[tP]),_:1})]),_:1}),T.createElementVNode("div",rP,[T.createVNode(f,{ref:"tree","node-key":"key","show-checkbox":"","check-strictly":!1,data:r.treeData,"render-after-expand":!1,"default-expanded-keys":e.defaultExpandedKeys,onCheck:a.checkChanged},{default:T.withCtx(({node:h,data:p})=>[T.createElementVNode("span",{class:T.normalizeClass(["region-tree-node",{activeItem:a.nodeIsActive(p),hoverItem:a.nodeIsHover(p)}]),onClick:m=>a.changeActiveByNode(p),onMouseover:m=>a.changeHoverByNode(p)},[T.createElementVNode("div",{style:T.normalizeStyle(a.getBackgroundStyles(p))},T.toDisplayString(h.label),5)],42,nP)]),_:1},8,["data","default-expanded-keys","onCheck"])])])}const ym=br(Jk,[["render",iP],["__scopeId","data-v-df242013"]]),aP={name:"SvgLegends"},oP=e=>(T.pushScopeId("data-v-88079d87"),e=e(),T.popScopeId(),e),sP={class:"legends-container"},lP={version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 500 500",style:{"enable-background":"new 0 0 500 500"},xmlns:"http://www.w3.org/2000/svg","xmlns:bx":"https://boxy-svg.com"},cP=[T.createStaticVNode('<defs data-v-88079d87><bx:grid height="30.447" width="32.516" x="0" y="0" data-v-88079d87></bx:grid></defs><path class="st0 st0-translate" d="M61.3,103.8c-15.9,0-28.8-12.3-28.8-27.3c0-15,13-27.3,28.8-27.3s28.8,12.3,28.8,27.3 C90.1,91.5,77.2,103.8,61.3,103.8z" data-v-88079d87></path><path class="st1" d="M40.3,356.1C29.5,345,29.8,328,41.5,317.5c11.7-10.5,29.6-9.9,40.7,1.1c11.1,11,10.5,28.1-1.2,38.5 C69.3,367.4,51.1,366.9,40.3,356.1z" data-v-88079d87></path><path class="st2" d="M61.2,396.9c-5.3,9.3-15.3,15.1-26.1,15.1l-0.4,0.6c5.1,9,5.1,20,0,29l0.4,0.6c10.7,0,20.8,5.8,26.1,15.1 c5.3-9.3,15.3-15.1,26.1-15.1c-5.3-9.3-5.3-20.9,0-30.4C76.6,412.1,66.7,406.3,61.2,396.9z" data-v-88079d87></path><text transform="matrix(0.9908 0 0 1 118.0161 171.7975)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Tissue region </text><path class="st6" d="M40.9,231.1c11.3-10.6,29.5-10.6,40.8,0c11.3,10.6,11.3,27.9,0,38.5c-11.3,10.6-29.5,10.6-40.8,0 C29.7,259,29.7,241.7,40.9,231.1z" data-v-88079d87></path><text transform="matrix(0.9908 0 0 1 118.0161 257.675)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Brain nuclei </text><text transform="matrix(0.9908 0 0 1 118.0903 345.5266)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Ganglia </text><text transform="matrix(0.9908 0 0 1 118.0903 433.1613)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Ganglionated nerve plexus </text>',9)],uP=oP(()=>T.createElementVNode("svg",{width:"72px",height:"72px",viewBox:"0 0 24 24",fill:"yellow"},null,-1));function QP(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",sP,[(T.openBlock(),T.createElementBlock("svg",lP,cP)),uP])}const gm=br(aP,[["render",QP],["__scopeId","data-v-88079d87"]]),TP='<div class="flatmap-marker"><svg display="block" height="41px" width="27px" viewBox="0 0 27 41"><g fill-rule="nonzero"><g transform="translate(3.0, 29.0)" fill="#000000"><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="9.5" ry="4.77275007"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="8.5" ry="4.29549936"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="7.5" ry="3.81822308"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="6.5" ry="3.34094679"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="5.5" ry="2.86367051"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="4.5" ry="2.38636864"></ellipse></g><g fill="#005974"><path 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"></path></g><g opacity="0.25" fill="#000000"><path 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"></path></g><g transform="translate(6.0, 7.0)" fill="#FFFFFF"></g><g transform="translate(8.0, 8.0)"><circle fill="#000000" opacity="0.25" cx="5.5" cy="5.5" r="5.4999962"></circle><circle fill="#FFFFFF" cx="5.5" cy="5.5" r="5.4999962"></circle></g></g></svg></div>',As=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},ua={},_m=async function(e,t){return ua&&ua.hasOwnProperty(t)?ua[t]:new Promise(r=>{fetch(`${e}knowledge/label/${t}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),ua[t]=i,r(i)}).catch(n=>{console.error("Error:",n),ua[t]=t,r(t)})})},Ss=function(e,t){let r=JSON.stringify(e),n=JSON.stringify(t);return r.indexOf(n)!==-1};let hP=function(){this.initialise=function(e){this.flatmapApi=e,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(e){let t=[];e.feature.hyperlinks&&e.feature.hyperlinks.length>0?t=e.feature.hyperlinks:t=this.urls.map(i=>({url:i,id:"pubmed"}));let r;if(e.provenanceTaxonomy){r=[];for(let i=0;e.provenanceTaxonomy.length>i;i++)r.push(await _m(this.flatmapAPI,e.provenanceTaxonomy[i]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:e.label,featureId:e.resource,hyperlinks:t,provenanceTaxonomy:e.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(e,t){let r=[];return e.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),t),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),t)}),r},this.createLabelLookup=function(e){return new Promise(t=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(e)};fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{const a=i.keys.indexOf("entity"),u=i.keys.indexOf("label");a>-1&&u>-1&&i.values.forEach(o=>{r[o[a]]=o[u],this.uberons.push({id:o[a],name:o[u]})}),t(r)})})},this.buildConnectivitySqlStatement=function(e){let t="select knowledge from knowledge where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildLabelSqlStatement=function(e){let t="select entity, label from labels where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.findAllIdsFromConnectivity=function(e){let t=e.connectivity.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=As(t),n=[],i=!1;return r.forEach(a=>{i=!1,Ss(e.axons,a)&&(i=!0),Ss(e.dendrites,a)&&(i=!0),i||n.push(a)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(e){this.controller&&this.controller.abort(),this.controller=new AbortController;const t=this.controller.signal,r=e.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;const n={sql:this.buildConnectivitySqlStatement(r)};let i=new Promise(o=>{fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:t}).then(f=>f.json()).then(f=>{if(this.connectivityExists(f)){let h=JSON.parse(f.values[0][0]);this.processConnectivity(h).then(()=>{o(!0)})}else o(!1)}).catch(f=>{console.error("Error:",f),o(!1)})}),a=await this.pubmedQueryOnIds(e);return await Promise.all([i,a])},this.connectivityExists=function(e){return!!(e.values&&e.values.length>0&&JSON.parse(e.values[0][0]).connectivity&&JSON.parse(e.values[0][0]).connectivity.length>0)},this.createLabelFromNeuralNode=function(e,t){let r=t[e[0]];return e.length===2&&e[1].length>0&&e[1].forEach(n=>{t[n]==null?r+=`, ${n}`:r+=`, ${t[n]}`}),r},this.flattenAndFindDatasets=function(e,t,r){let n=this.flattenConntectivity(e),i=this.flattenConntectivity(t),a=this.flattenConntectivity(r);this.destinationsWithDatasets=this.uberons.filter(u=>i.indexOf(u.id)!==-1),this.originsWithDatasets=this.uberons.filter(u=>a.indexOf(u.id)!==-1),this.componentsWithDatasets=this.uberons.filter(u=>n.indexOf(u.id)!==-1)},this.processConnectivity=function(e){return new Promise(t=>{let r=this.findComponents(e),n=As(e.axons),i=As(e.dendrites),a=this.findAllIdsFromConnectivity(e);this.createLabelLookup(a).then(u=>{this.destinations=n.map(o=>this.createLabelFromNeuralNode(o,u)),this.origins=i.map(o=>this.createLabelFromNeuralNode(o,u)),this.components=r.map(o=>this.createLabelFromNeuralNode(o,u)),this.flattenAndFindDatasets(r,n,i),t(!0)})})},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=As(t),n=[],i=!1;return r.forEach(a=>{i=!1,Ss(e.axons,a)&&(i=!0),Ss(e.dendrites,a)&&(i=!0),i||n.push(a)}),n},this.stripPMIDPrefix=function(e){return e.split(":")[1]},this.buildPubmedSqlStatement=function(e){let t="select distinct publication from publications where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildPubmedSqlStatementForModels=function(e){return`select distinct publication from publications where entity = '${e}'`},this.flatmapQuery=function(e){const t={sql:e};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(e){return new Promise(t=>{const r=e.resource,n=e.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(a=>{a.values.length>0?(this.urls=[this.pubmedSearchUrl(a.values.map(u=>this.stripPMIDPrefix(u[0])))],t(!0)):this.pubmedQueryOnModels(n).then(u=>{t(u)})})})},this.pubmedQueryOnModels=function(e){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(e)).then(t=>Array.isArray(t.values)&&t.values.length>0?(this.urls=[this.pubmedSearchUrl(t.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(e){let t="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;return r.append("term",e),t+r.toString()}};const dP='<svg width="195px" height="24px" viewBox="0 0 160 24" fill="yellow"><path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/><text x="42" y="50%" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#000000">Featured dataset marker</text></svg>';var vm={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof window<"u"?window:D,function(){if(typeof window>"u")return null;var r=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),n=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(p){return r.setTimeout(p,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(p){r.clearTimeout(p)};function a(p,m){var g=Object.prototype.toString.call(p),v=g==="[object Array]"||g==="[object NodeList]"||g==="[object HTMLCollection]"||g==="[object Object]"||typeof jQuery<"u"&&p instanceof jQuery||typeof Elements<"u"&&p instanceof Elements,b=0,w=p.length;if(v)for(;b<w;b++)m(p[b]);else m(p)}function u(p){if(!p.getBoundingClientRect)return{width:p.offsetWidth,height:p.offsetHeight};var m=p.getBoundingClientRect();return{width:Math.round(m.width),height:Math.round(m.height)}}function o(p,m){Object.keys(m).forEach(function(g){p.style[g]=m[g]})}var f=function(p,m){var g=0;function v(){var w=[];this.add=function(V){w.push(V)};var E,H;this.call=function(V){for(E=0,H=w.length;E<H;E++)w[E].call(this,V)},this.remove=function(V){var I=[];for(E=0,H=w.length;E<H;E++)w[E]!==V&&I.push(w[E]);w=I},this.length=function(){return w.length}}function b(w,E){if(w){if(w.resizedAttached){w.resizedAttached.add(E);return}w.resizedAttached=new v,w.resizedAttached.add(E),w.resizeSensor=document.createElement("div"),w.resizeSensor.dir="ltr",w.resizeSensor.className="resize-sensor";var H={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},V={position:"absolute",left:"0px",top:"0px",transition:"0s"};o(w.resizeSensor,H);var I=document.createElement("div");I.className="resize-sensor-expand",o(I,H);var N=document.createElement("div");o(N,V),I.appendChild(N);var R=document.createElement("div");R.className="resize-sensor-shrink",o(R,H);var z=document.createElement("div");o(z,V),o(z,{width:"200%",height:"200%"}),R.appendChild(z),w.resizeSensor.appendChild(I),w.resizeSensor.appendChild(R),w.appendChild(w.resizeSensor);var Z=window.getComputedStyle(w),K=Z?Z.getPropertyValue("position"):null;K!=="absolute"&&K!=="relative"&&K!=="fixed"&&K!=="sticky"&&(w.style.position="relative");var ee=!1,ie=0,de=u(w),ge=0,Ce=0,Re=!0;g=0;var Ze=function(){var Ie=w.offsetWidth,Xe=w.offsetHeight;N.style.width=Ie+10+"px",N.style.height=Xe+10+"px",I.scrollLeft=Ie+10,I.scrollTop=Xe+10,R.scrollLeft=Ie+10,R.scrollTop=Xe+10},tt=function(){if(Re){var Ie=w.offsetWidth===0&&w.offsetHeight===0;if(Ie){g||(g=n(function(){g=0,tt()}));return}else Re=!1}Ze()};w.resizeSensor.resetSensor=tt;var Ee=function(){ie=0,ee&&(ge=de.width,Ce=de.height,w.resizedAttached&&w.resizedAttached.call(de))},Ye=function(){de=u(w),ee=de.width!==ge||de.height!==Ce,ee&&!ie&&(ie=n(Ee)),tt()},Pt=function(Ie,Xe,Tt){Ie.attachEvent?Ie.attachEvent("on"+Xe,Tt):Ie.addEventListener(Xe,Tt)};Pt(I,"scroll",Ye),Pt(R,"scroll",Ye),g=n(function(){g=0,tt()})}}a(p,function(w){b(w,m)}),this.detach=function(w){g||(i(g),g=0),f.detach(p,w)},this.reset=function(){p.resizeSensor.resetSensor()}};if(f.reset=function(p){a(p,function(m){m.resizeSensor.resetSensor()})},f.detach=function(p,m){a(p,function(g){g&&(g.resizedAttached&&typeof m=="function"&&(g.resizedAttached.remove(m),g.resizedAttached.length())||g.resizeSensor&&(g.contains(g.resizeSensor)&&g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached))})},typeof MutationObserver<"u"){var h=new MutationObserver(function(p){for(var m in p)if(p.hasOwnProperty(m))for(var g=p[m].addedNodes,v=0;v<g.length;v++)g[v].resizeSensor&&f.reset(g[v])});document.addEventListener("DOMContentLoaded",function(p){h.observe(document.body,{childList:!0,subtree:!0})})}return f})})(vm);var fP=vm.exports;const pP=Yc(fP);var xm={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(D,function(){var r,n,i;function a(o,f){if(!r)r=f;else if(!n)n=f;else{var h="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",p={};r(p),i=f(p),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([h],{type:"text/javascript"})))}}a(["exports"],function(o){function f(c,s,Q,y){return new(Q||(Q=Promise))(function(x,C){function S(j){try{B(y.next(j))}catch(q){C(q)}}function O(j){try{B(y.throw(j))}catch(q){C(q)}}function B(j){var q;j.done?x(j.value):(q=j.value,q instanceof Q?q:new Q(function(X){X(q)})).then(S,O)}B((y=y.apply(c,s||[])).next())})}function h(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}typeof SuppressedError=="function"&&SuppressedError;var p=m;function m(c,s){this.x=c,this.y=s}m.prototype={clone:function(){return new m(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,s){return this.clone()._rotateAround(c,s)},matMult:function(c){return this.clone()._matMult(c)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var s=c.x-this.x,Q=c.y-this.y;return s*s+Q*Q},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,s){return Math.atan2(this.x*s-this.y*c,this.x*c+this.y*s)},_matMult:function(c){var s=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=s,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var s=Math.cos(c),Q=Math.sin(c),y=Q*this.x+s*this.y;return this.x=s*this.x-Q*this.y,this.y=y,this},_rotateAround:function(c,s){var Q=Math.cos(c),y=Math.sin(c),x=s.y+y*(this.x-s.x)+Q*(this.y-s.y);return this.x=s.x+Q*(this.x-s.x)-y*(this.y-s.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},m.convert=function(c){return c instanceof m?c:Array.isArray(c)?new m(c[0],c[1]):c};var g=h(p),v=b;function b(c,s,Q,y){this.cx=3*c,this.bx=3*(Q-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(y-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=s,this.p2x=Q,this.p2y=y}b.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,s){if(s===void 0&&(s=1e-6),c<0)return 0;if(c>1)return 1;for(var Q=c,y=0;y<8;y++){var x=this.sampleCurveX(Q)-c;if(Math.abs(x)<s)return Q;var C=this.sampleCurveDerivativeX(Q);if(Math.abs(C)<1e-6)break;Q-=x/C}var S=0,O=1;for(Q=c,y=0;y<20&&(x=this.sampleCurveX(Q),!(Math.abs(x-c)<s));y++)c>x?S=Q:O=Q,Q=.5*(O-S)+S;return Q},solve:function(c,s){return this.sampleCurveY(this.solveCurveX(c,s))}};var w=h(v);let E,H;function V(){return E==null&&(E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),E}function I(){if(H==null&&(H=!1,V())){const s=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(s){for(let y=0;y<5*5;y++){const x=4*y;s.fillStyle=`rgb(${x},${x+1},${x+2})`,s.fillRect(y%5,Math.floor(y/5),1,1)}const Q=s.getImageData(0,0,5,5).data;for(let y=0;y<5*5*4;y++)if(y%4!=3&&Q[y]!==y){H=!0;break}}}return H||!1}function N(c,s,Q,y){const x=new w(c,s,Q,y);return function(C){return x.solve(C)}}const R=N(.25,.1,.25,1);function z(c,s,Q){return Math.min(Q,Math.max(s,c))}function Z(c,s,Q){const y=Q-s,x=((c-s)%y+y)%y+s;return x===s?Q:x}function K(c,...s){for(const Q of s)for(const y in Q)c[y]=Q[y];return c}let ee=1;function ie(c,s,Q){const y={};for(const x in c)y[x]=s.call(Q||this,c[x],x,c);return y}function de(c,s,Q){const y={};for(const x in c)s.call(Q||this,c[x],x,c)&&(y[x]=c[x]);return y}function ge(c){return Array.isArray(c)?c.map(ge):typeof c=="object"&&c?ie(c,ge):c}const Ce={};function Re(c){Ce[c]||(typeof console<"u"&&console.warn(c),Ce[c]=!0)}function Ze(c,s,Q){return(Q.y-c.y)*(s.x-c.x)>(s.y-c.y)*(Q.x-c.x)}function tt(c){let s=0;for(let Q,y,x=0,C=c.length,S=C-1;x<C;S=x++)Q=c[x],y=c[S],s+=(y.x-Q.x)*(Q.y+y.y);return s}function Ee(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let Ye=null;function Pt(c){return typeof ImageBitmap<"u"&&c instanceof ImageBitmap}const Ie="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Xe(c,s,Q,y,x){return f(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const C=new VideoFrame(c,{timestamp:0});try{const S=C==null?void 0:C.format;if(!S||!S.startsWith("BGR")&&!S.startsWith("RGB"))throw new Error(`Unrecognized format ${S}`);const O=S.startsWith("BGR"),B=new Uint8ClampedArray(y*x*4);if(yield C.copyTo(B,function(j,q,X,Y,re){const ae=4*Math.max(-q,0),le=(Math.max(0,X)-X)*Y*4+ae,fe=4*Y,ye=Math.max(0,q),He=Math.max(0,X);return{rect:{x:ye,y:He,width:Math.min(j.width,q+Y)-ye,height:Math.min(j.height,X+re)-He},layout:[{offset:le,stride:fe}]}}(c,s,Q,y,x)),O)for(let j=0;j<B.length;j+=4){const q=B[j];B[j]=B[j+2],B[j+2]=q}return B}finally{C.close()}})}let Tt,Je,yt,At;const Et={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(c){const s=requestAnimationFrame(c);return{cancel:()=>cancelAnimationFrame(s)}},getImageData(c,s=0){return this.getImageCanvasContext(c).getImageData(-s,-s,c.width+2*s,c.height+2*s)},getImageCanvasContext(c){const s=window.document.createElement("canvas"),Q=s.getContext("2d",{willReadFrequently:!0});if(!Q)throw new Error("failed to create canvas 2d context");return s.width=c.width,s.height=c.height,Q.drawImage(c,0,0,c.width,c.height),Q},resolveURL:c=>(yt||(yt=document.createElement("a")),yt.href=c,yt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(At==null&&(At=matchMedia("(prefers-reduced-motion: reduce)")),At.matches)}},Ve={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Ne extends Error{constructor(s,Q,y,x){super(`AJAXError: ${Q} (${s}): ${y}`),this.status=s,this.statusText=Q,this.url=y,this.body=x}}const ut=Ee()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,ze=c=>Ve.REGISTERED_PROTOCOLS[c.substring(0,c.indexOf("://"))];function Ke(c,s){const Q=new AbortController,y=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,cache:c.cache,referrer:ut(),signal:Q.signal});let x=!1,C=!1;return c.type==="json"&&y.headers.set("Accept","application/json"),C||fetch(y).then(S=>S.ok?(O=>{(c.type==="arrayBuffer"||c.type==="image"?O.arrayBuffer():c.type==="json"?O.json():O.text()).then(B=>{C||(x=!0,s(null,B,O.headers.get("Cache-Control"),O.headers.get("Expires")))}).catch(B=>{C||s(new Error(B.message))})})(S):S.blob().then(O=>s(new Ne(S.status,S.statusText,c.url,O)))).catch(S=>{S.code!==20&&s(new Error(S.message))}),{cancel:()=>{C=!0,x||Q.abort()}}}const gt=function(c,s){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(Ee()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s);if(!Ee())return(ze(c.url)||Ke)(c,s)}if(!(/^file:/.test(Q=c.url)||/^file:/.test(ut())&&!/^\w+:/.test(Q))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Ke(c,s);if(Ee()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s,void 0,!0)}var Q;return function(y,x){const C=new XMLHttpRequest;C.open(y.method||"GET",y.url,!0),y.type!=="arrayBuffer"&&y.type!=="image"||(C.responseType="arraybuffer");for(const S in y.headers)C.setRequestHeader(S,y.headers[S]);return y.type==="json"&&(C.responseType="text",C.setRequestHeader("Accept","application/json")),C.withCredentials=y.credentials==="include",C.onerror=()=>{x(new Error(C.statusText))},C.onload=()=>{if((C.status>=200&&C.status<300||C.status===0)&&C.response!==null){let S=C.response;if(y.type==="json")try{S=JSON.parse(C.response)}catch(O){return x(O)}x(null,S,C.getResponseHeader("Cache-Control"),C.getResponseHeader("Expires"))}else{const S=new Blob([C.response],{type:C.getResponseHeader("Content-Type")});x(new Ne(C.status,C.statusText,y.url,S))}},C.send(y.body),{cancel:()=>C.abort()}}(c,s)},pt=function(c,s){return gt(K(c,{type:"arrayBuffer"}),s)};function mt(c){if(!c||c.indexOf("://")<=0||c.indexOf("data:image/")===0||c.indexOf("blob:")===0)return!0;const s=new URL(c),Q=window.location;return s.protocol===Q.protocol&&s.host===Q.host}function Ht(c,s,Q){Q[c]&&Q[c].indexOf(s)!==-1||(Q[c]=Q[c]||[],Q[c].push(s))}function Wt(c,s,Q){if(Q&&Q[c]){const y=Q[c].indexOf(s);y!==-1&&Q[c].splice(y,1)}}class _1{constructor(s,Q={}){K(this,Q),this.type=s}}class t1 extends _1{constructor(s,Q={}){super("error",K({error:s},Q))}}class V1{on(s,Q){return this._listeners=this._listeners||{},Ht(s,Q,this._listeners),this}off(s,Q){return Wt(s,Q,this._listeners),Wt(s,Q,this._oneTimeListeners),this}once(s,Q){return Q?(this._oneTimeListeners=this._oneTimeListeners||{},Ht(s,Q,this._oneTimeListeners),this):new Promise(y=>this.once(s,y))}fire(s,Q){typeof s=="string"&&(s=new _1(s,Q||{}));const y=s.type;if(this.listens(y)){s.target=this;const x=this._listeners&&this._listeners[y]?this._listeners[y].slice():[];for(const O of x)O.call(this,s);const C=this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[];for(const O of C)Wt(y,O,this._oneTimeListeners),O.call(this,s);const S=this._eventedParent;S&&(K(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),S.fire(s))}else s instanceof t1&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,Q){return this._eventedParent=s,this._eventedParentData=Q,this}}var Pe={$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"},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":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 v1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function P1(c,s){const Q={};for(const y in c)y!=="ref"&&(Q[y]=c[y]);return v1.forEach(y=>{y in s&&(Q[y]=s[y])}),Q}function Q1(c,s){if(Array.isArray(c)){if(!Array.isArray(s)||c.length!==s.length)return!1;for(let Q=0;Q<c.length;Q++)if(!Q1(c[Q],s[Q]))return!1;return!0}if(typeof c=="object"&&c!==null&&s!==null){if(typeof s!="object"||Object.keys(c).length!==Object.keys(s).length)return!1;for(const Q in c)if(!Q1(c[Q],s[Q]))return!1;return!0}return c===s}const Xt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function et(c,s,Q){Q.push({command:Xt.addSource,args:[c,s[c]]})}function Rt(c,s,Q){s.push({command:Xt.removeSource,args:[c]}),Q[c]=!0}function d1(c,s,Q,y){Rt(c,Q,y),et(c,s,Q)}function r2(c,s,Q){let y;for(y in c[Q])if(Object.prototype.hasOwnProperty.call(c[Q],y)&&y!=="data"&&!Q1(c[Q][y],s[Q][y]))return!1;for(y in s[Q])if(Object.prototype.hasOwnProperty.call(s[Q],y)&&y!=="data"&&!Q1(c[Q][y],s[Q][y]))return!1;return!0}function R2(c,s,Q,y,x,C){let S;for(S in s=s||{},c=c||{})Object.prototype.hasOwnProperty.call(c,S)&&(Q1(c[S],s[S])||Q.push({command:C,args:[y,S,s[S],x]}));for(S in s)Object.prototype.hasOwnProperty.call(s,S)&&!Object.prototype.hasOwnProperty.call(c,S)&&(Q1(c[S],s[S])||Q.push({command:C,args:[y,S,s[S],x]}))}function l3(c){return c.id}function L3(c,s){return c[s.id]=s,c}class it{constructor(s,Q,y,x){this.message=(s?`${s}: `:"")+y,x&&(this.identifier=x),Q!=null&&Q.__line__&&(this.line=Q.__line__)}}function c3(c,...s){for(const Q of s)for(const y in Q)c[y]=Q[y];return c}class w1 extends Error{constructor(s,Q){super(Q),this.message=Q,this.key=s}}class R3{constructor(s,Q=[]){this.parent=s,this.bindings={};for(const[y,x]of Q)this.bindings[y]=x}concat(s){return new R3(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const b3={kind:"null"},at={kind:"number"},qt={kind:"string"},jt={kind:"boolean"},Q2={kind:"color"},u3={kind:"object"},Zt={kind:"value"},Ae={kind:"collator"},ne={kind:"formatted"},U={kind:"padding"},J={kind:"resolvedImage"},oe={kind:"variableAnchorOffsetCollection"};function Qe(c,s){return{kind:"array",itemType:c,N:s}}function he(c){if(c.kind==="array"){const s=he(c.itemType);return typeof c.N=="number"?`array<${s}, ${c.N}>`:c.itemType.kind==="value"?"array":`array<${s}>`}return c.kind}const Le=[b3,at,qt,jt,Q2,ne,u3,Qe(Zt),U,J,oe];function _e(c,s){if(s.kind==="error")return null;if(c.kind==="array"){if(s.kind==="array"&&(s.N===0&&s.itemType.kind==="value"||!_e(c.itemType,s.itemType))&&(typeof c.N!="number"||c.N===s.N))return null}else{if(c.kind===s.kind)return null;if(c.kind==="value"){for(const Q of Le)if(!_e(Q,s))return null}}return`Expected ${he(c)} but found ${he(s)} instead.`}function me(c,s){return s.some(Q=>Q.kind===c.kind)}function be(c,s){return s.some(Q=>Q==="null"?c===null:Q==="array"?Array.isArray(c):Q==="object"?c&&!Array.isArray(c)&&typeof c=="object":Q===typeof c)}function Be(c,s){return c.kind==="array"&&s.kind==="array"?c.itemType.kind===s.itemType.kind&&typeof c.N=="number":c.kind===s.kind}const Fe=.96422,qe=.82521,Dt=4/29,$t=6/29,Lt=3*$t*$t,kt=$t*$t*$t,Gt=Math.PI/180,x1=180/Math.PI;function C1(c){return(c%=360)<0&&(c+=360),c}function h1([c,s,Q,y]){let x,C;const S=j2((.2225045*(c=T1(c))+.7168786*(s=T1(s))+.0606169*(Q=T1(Q)))/1);c===s&&s===Q?x=C=S:(x=j2((.4360747*c+.3850649*s+.1430804*Q)/Fe),C=j2((.0139322*c+.0971045*s+.7141733*Q)/qe));const O=116*S-16;return[O<0?0:O,500*(x-S),200*(S-C),y]}function T1(c){return c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function j2(c){return c>kt?Math.pow(c,1/3):c/Lt+Dt}function D1([c,s,Q,y]){let x=(c+16)/116,C=isNaN(s)?x:x+s/500,S=isNaN(Q)?x:x-Q/200;return x=1*V2(x),C=Fe*V2(C),S=qe*V2(S),[T2(3.1338561*C-1.6168667*x-.4906146*S),T2(-.9787684*C+1.9161415*x+.033454*S),T2(.0719453*C-.2289914*x+1.4052427*S),y]}function T2(c){return(c=c<=.00304?12.92*c:1.055*Math.pow(c,1/2.4)-.055)<0?0:c>1?1:c}function V2(c){return c>$t?c*c*c:Lt*(c-Dt)}function j3(c){return parseInt(c.padEnd(2,c),16)/255}function Zl(c,s){return En(s?c/100:c,0,1)}function En(c,s,Q){return Math.min(Math.max(s,c),Q)}function Vn(c){return!c.some(Number.isNaN)}const YT={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 H1{constructor(s,Q,y,x=1,C=!0){this.r=s,this.g=Q,this.b=y,this.a=x,C||(this.r*=x,this.g*=x,this.b*=x,x||this.overwriteGetter("rgb",[s,Q,y,x]))}static parse(s){if(s instanceof H1)return s;if(typeof s!="string")return;const Q=function(y){if((y=y.toLowerCase().trim())==="transparent")return[0,0,0,0];const x=YT[y];if(x){const[S,O,B]=x;return[S/255,O/255,B/255,1]}if(y.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(y)){const S=y.length<6?1:2;let O=1;return[j3(y.slice(O,O+=S)),j3(y.slice(O,O+=S)),j3(y.slice(O,O+=S)),j3(y.slice(O,O+S)||"ff")]}if(y.startsWith("rgb")){const S=y.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(S){const[O,B,j,q,X,Y,re,ae,le,fe,ye,He]=S,ve=[q||" ",re||" ",fe].join("");if(ve===" "||ve===" /"||ve===",,"||ve===",,,"){const Me=[j,Y,le].join(""),De=Me==="%%%"?100:Me===""?255:0;if(De){const $e=[En(+B/De,0,1),En(+X/De,0,1),En(+ae/De,0,1),ye?Zl(+ye,He):1];if(Vn($e))return $e}}return}}const C=y.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(C){const[S,O,B,j,q,X,Y,re,ae]=C,le=[B||" ",q||" ",Y].join("");if(le===" "||le===" /"||le===",,"||le===",,,"){const fe=[+O,En(+j,0,100),En(+X,0,100),re?Zl(+re,ae):1];if(Vn(fe))return function([ye,He,ve,Me]){function De($e){const dt=($e+ye/30)%12,wt=He*Math.min(ve,1-ve);return ve-wt*Math.max(-1,Math.min(dt-3,9-dt,1))}return ye=C1(ye),He/=100,ve/=100,[De(0),De(8),De(4),Me]}(fe)}}}(s);return Q?new H1(...Q,!1):void 0}get rgb(){const{r:s,g:Q,b:y,a:x}=this,C=x||1/0;return this.overwriteGetter("rgb",[s/C,Q/C,y/C,x])}get hcl(){return this.overwriteGetter("hcl",function(s){const[Q,y,x,C]=h1(s),S=Math.sqrt(y*y+x*x);return[Math.round(1e4*S)?C1(Math.atan2(x,y)*x1):NaN,S,Q,C]}(this.rgb))}get lab(){return this.overwriteGetter("lab",h1(this.rgb))}overwriteGetter(s,Q){return Object.defineProperty(this,s,{value:Q}),Q}toString(){const[s,Q,y,x]=this.rgb;return`rgba(${[s,Q,y].map(C=>Math.round(255*C)).join(",")},${x})`}}H1.black=new H1(0,0,0,1),H1.white=new H1(1,1,1,1),H1.transparent=new H1(0,0,0,0),H1.red=new H1(1,0,0,1);class Po{constructor(s,Q,y){this.sensitivity=s?Q?"variant":"case":Q?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,Q){return this.collator.compare(s,Q)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Yi{constructor(s,Q,y,x,C){this.text=s,this.image=Q,this.scale=y,this.fontStack=x,this.textColor=C}}class z2{constructor(s){this.sections=s}static fromString(s){return new z2([new Yi(s,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(s=>s.text.length!==0||s.image&&s.image.name.length!==0)}static factory(s){return s instanceof z2?s:z2.fromString(s)}toString(){return this.sections.length===0?"":this.sections.map(s=>s.text).join("")}}class w3{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof w3)return s;if(typeof s=="number")return new w3([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const Q of s)if(typeof Q!="number")return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new w3(s)}}toString(){return JSON.stringify(this.values)}}const eh=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class z3{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof z3)return s;if(Array.isArray(s)&&!(s.length<1)&&s.length%2==0){for(let Q=0;Q<s.length;Q+=2){const y=s[Q],x=s[Q+1];if(typeof y!="string"||!eh.has(y)||!Array.isArray(x)||x.length!==2||typeof x[0]!="number"||typeof x[1]!="number")return}return new z3(s)}}toString(){return JSON.stringify(this.values)}}class D2{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new D2({name:s,available:!1}):null}}function e5(c,s,Q,y){return typeof c=="number"&&c>=0&&c<=255&&typeof s=="number"&&s>=0&&s<=255&&typeof Q=="number"&&Q>=0&&Q<=255?y===void 0||typeof y=="number"&&y>=0&&y<=1?null:`Invalid rgba value [${[c,s,Q,y].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof y=="number"?[c,s,Q,y]:[c,s,Q]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Dn(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof H1||c instanceof Po||c instanceof z2||c instanceof w3||c instanceof z3||c instanceof D2)return!0;if(Array.isArray(c)){for(const s of c)if(!Dn(s))return!1;return!0}if(typeof c=="object"){for(const s in c)if(!Dn(c[s]))return!1;return!0}return!1}function Z1(c){if(c===null)return b3;if(typeof c=="string")return qt;if(typeof c=="boolean")return jt;if(typeof c=="number")return at;if(c instanceof H1)return Q2;if(c instanceof Po)return Ae;if(c instanceof z2)return ne;if(c instanceof w3)return U;if(c instanceof z3)return oe;if(c instanceof D2)return J;if(Array.isArray(c)){const s=c.length;let Q;for(const y of c){const x=Z1(y);if(Q){if(Q===x)continue;Q=Zt;break}Q=x}return Qe(Q||Zt,s)}return u3}function p1(c){const s=typeof c;return c===null?"":s==="string"||s==="number"||s==="boolean"?String(c):c instanceof H1||c instanceof z2||c instanceof w3||c instanceof z3||c instanceof D2?c.toString():JSON.stringify(c)}class Nr{constructor(s,Q){this.type=s,this.value=Q}static parse(s,Q){if(s.length!==2)return Q.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!Dn(s[1]))return Q.error("invalid value");const y=s[1];let x=Z1(y);const C=Q.expectedType;return x.kind!=="array"||x.N!==0||!C||C.kind!=="array"||typeof C.N=="number"&&C.N!==0||(x=C),new Nr(x,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class J1{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const t5={string:qt,number:at,boolean:jt,object:u3};class $3{constructor(s,Q){this.type=s,this.args=Q}static parse(s,Q){if(s.length<2)return Q.error("Expected at least one argument.");let y,x=1;const C=s[0];if(C==="array"){let O,B;if(s.length>2){const j=s[1];if(typeof j!="string"||!(j in t5)||j==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);O=t5[j],x++}else O=Zt;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return Q.error('The length argument to "array" must be a positive integer literal',2);B=s[2],x++}y=Qe(O,B)}else{if(!t5[C])throw new Error(`Types doesn't contain name = ${C}`);y=t5[C]}const S=[];for(;x<s.length;x++){const O=Q.parse(s[x],x,Zt);if(!O)return null;S.push(O)}return new $3(y,S)}evaluate(s){for(let Q=0;Q<this.args.length;Q++){const y=this.args[Q].evaluate(s);if(!_e(this.type,Z1(y)))return y;if(Q===this.args.length-1)throw new J1(`Expected value to be of type ${he(this.type)}, but found ${he(Z1(y))} instead.`)}throw new Error}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const Io={"to-boolean":jt,"to-color":Q2,"to-number":at,"to-string":qt};class lr{constructor(s,Q){this.type=s,this.args=Q}static parse(s,Q){if(s.length<2)return Q.error("Expected at least one argument.");const y=s[0];if(!Io[y])throw new Error(`Can't parse ${y} as it is not part of the known types`);if((y==="to-boolean"||y==="to-string")&&s.length!==2)return Q.error("Expected one argument.");const x=Io[y],C=[];for(let S=1;S<s.length;S++){const O=Q.parse(s[S],S,Zt);if(!O)return null;C.push(O)}return new lr(x,C)}evaluate(s){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(s);case"color":{let Q,y;for(const x of this.args){if(Q=x.evaluate(s),y=null,Q instanceof H1)return Q;if(typeof Q=="string"){const C=s.parseColor(Q);if(C)return C}else if(Array.isArray(Q)&&(y=Q.length<3||Q.length>4?`Invalid rbga value ${JSON.stringify(Q)}: expected an array containing either three or four numeric values.`:e5(Q[0],Q[1],Q[2],Q[3]),!y))return new H1(Q[0]/255,Q[1]/255,Q[2]/255,Q[3])}throw new J1(y||`Could not parse color from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"padding":{let Q;for(const y of this.args){Q=y.evaluate(s);const x=w3.parse(Q);if(x)return x}throw new J1(`Could not parse padding from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"variableAnchorOffsetCollection":{let Q;for(const y of this.args){Q=y.evaluate(s);const x=z3.parse(Q);if(x)return x}throw new J1(`Could not parse variableAnchorOffsetCollection from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"number":{let Q=null;for(const y of this.args){if(Q=y.evaluate(s),Q===null)return 0;const x=Number(Q);if(!isNaN(x))return x}throw new J1(`Could not convert ${JSON.stringify(Q)} to number.`)}case"formatted":return z2.fromString(p1(this.args[0].evaluate(s)));case"resolvedImage":return D2.fromString(p1(this.args[0].evaluate(s)));default:return p1(this.args[0].evaluate(s))}}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const ql=["Unknown","Point","LineString","Polygon"];class Bo{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"?ql[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(s){let Q=this._parseColorCache[s];return Q||(Q=this._parseColorCache[s]=H1.parse(s)),Q}}class r5{constructor(s,Q,y=[],x,C=new R3,S=[]){this.registry=s,this.path=y,this.key=y.map(O=>`[${O}]`).join(""),this.scope=C,this.errors=S,this.expectedType=x,this._isConstant=Q}parse(s,Q,y,x,C={}){return Q?this.concat(Q,y,x)._parse(s,C):this._parse(s,C)}_parse(s,Q){function y(x,C,S){return S==="assert"?new $3(C,[x]):S==="coerce"?new lr(C,[x]):x}if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const x=s[0];if(typeof x!="string")return this.error(`Expression name must be a string, but found ${typeof x} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const C=this.registry[x];if(C){let S=C.parse(s,this);if(!S)return null;if(this.expectedType){const O=this.expectedType,B=S.type;if(O.kind!=="string"&&O.kind!=="number"&&O.kind!=="boolean"&&O.kind!=="object"&&O.kind!=="array"||B.kind!=="value")if(O.kind!=="color"&&O.kind!=="formatted"&&O.kind!=="resolvedImage"||B.kind!=="value"&&B.kind!=="string")if(O.kind!=="padding"||B.kind!=="value"&&B.kind!=="number"&&B.kind!=="array")if(O.kind!=="variableAnchorOffsetCollection"||B.kind!=="value"&&B.kind!=="array"){if(this.checkSubtype(O,B))return null}else S=y(S,O,Q.typeAnnotation||"coerce");else S=y(S,O,Q.typeAnnotation||"coerce");else S=y(S,O,Q.typeAnnotation||"coerce");else S=y(S,O,Q.typeAnnotation||"assert")}if(!(S instanceof Nr)&&S.type.kind!=="resolvedImage"&&this._isConstant(S)){const O=new Bo;try{S=new Nr(S.type,S.evaluate(O))}catch(B){return this.error(B.message),null}}return S}return this.error(`Unknown expression "${x}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,Q,y){const x=typeof s=="number"?this.path.concat(s):this.path,C=y?this.scope.concat(y):this.scope;return new r5(this.registry,this._isConstant,x,Q||null,C,this.errors)}error(s,...Q){const y=`${this.key}${Q.map(x=>`[${x}]`).join("")}`;this.errors.push(new w1(y,s))}checkSubtype(s,Q){const y=_e(s,Q);return y&&this.error(y),y}}class n5{constructor(s,Q,y){this.type=Ae,this.locale=y,this.caseSensitive=s,this.diacriticSensitive=Q}static parse(s,Q){if(s.length!==2)return Q.error("Expected one argument.");const y=s[1];if(typeof y!="object"||Array.isArray(y))return Q.error("Collator options argument must be an object.");const x=Q.parse(y["case-sensitive"]!==void 0&&y["case-sensitive"],1,jt);if(!x)return null;const C=Q.parse(y["diacritic-sensitive"]!==void 0&&y["diacritic-sensitive"],1,jt);if(!C)return null;let S=null;return y.locale&&(S=Q.parse(y.locale,1,qt),!S)?null:new n5(x,C,S)}evaluate(s){return new Po(this.caseSensitive.evaluate(s),this.diacriticSensitive.evaluate(s),this.locale?this.locale.evaluate(s):null)}eachChild(s){s(this.caseSensitive),s(this.diacriticSensitive),this.locale&&s(this.locale)}outputDefined(){return!1}}const cr=8192;function No(c,s){c[0]=Math.min(c[0],s[0]),c[1]=Math.min(c[1],s[1]),c[2]=Math.max(c[2],s[0]),c[3]=Math.max(c[3],s[1])}function S6(c,s){return!(c[0]<=s[0]||c[2]>=s[2]||c[1]<=s[1]||c[3]>=s[3])}function Gl(c,s){const Q=(180+c[0])/360,y=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,x=Math.pow(2,s.z);return[Math.round(Q*x*cr),Math.round(y*x*cr)]}function th(c,s,Q){const y=c[0]-s[0],x=c[1]-s[1],C=c[0]-Q[0],S=c[1]-Q[1];return y*S-C*x==0&&y*C<=0&&x*S<=0}function Fo(c,s){let Q=!1;for(let S=0,O=s.length;S<O;S++){const B=s[S];for(let j=0,q=B.length;j<q-1;j++){if(th(c,B[j],B[j+1]))return!1;(x=B[j])[1]>(y=c)[1]!=(C=B[j+1])[1]>y[1]&&y[0]<(C[0]-x[0])*(y[1]-x[1])/(C[1]-x[1])+x[0]&&(Q=!Q)}}var y,x,C;return Q}function Ro(c,s){for(let Q=0;Q<s.length;Q++)if(Fo(c,s[Q]))return!0;return!1}function Ul(c,s,Q,y){const x=y[0]-Q[0],C=y[1]-Q[1],S=(c[0]-Q[0])*C-x*(c[1]-Q[1]),O=(s[0]-Q[0])*C-x*(s[1]-Q[1]);return S>0&&O<0||S<0&&O>0}function rh(c,s,Q){for(const j of Q)for(let q=0;q<j.length-1;++q)if((O=[(S=j[q+1])[0]-(C=j[q])[0],S[1]-C[1]])[0]*(B=[(x=s)[0]-(y=c)[0],x[1]-y[1]])[1]-O[1]*B[0]!=0&&Ul(y,x,C,S)&&Ul(C,S,y,x))return!0;var y,x,C,S,O,B;return!1}function Wl(c,s){for(let Q=0;Q<c.length;++Q)if(!Fo(c[Q],s))return!1;for(let Q=0;Q<c.length-1;++Q)if(rh(c[Q],c[Q+1],s))return!1;return!0}function Xl(c,s){for(let Q=0;Q<s.length;Q++)if(Wl(c,s[Q]))return!0;return!1}function i5(c,s,Q){const y=[];for(let x=0;x<c.length;x++){const C=[];for(let S=0;S<c[x].length;S++){const O=Gl(c[x][S],Q);No(s,O),C.push(O)}y.push(C)}return y}function Kl(c,s,Q){const y=[];for(let x=0;x<c.length;x++){const C=i5(c[x],s,Q);y.push(C)}return y}function Jl(c,s,Q,y){if(c[0]<Q[0]||c[0]>Q[2]){const x=.5*y;let C=c[0]-Q[0]>x?-y:Q[0]-c[0]>x?y:0;C===0&&(C=c[0]-Q[2]>x?-y:Q[2]-c[0]>x?y:0),c[0]+=C}No(s,c)}function jo(c,s,Q,y){const x=Math.pow(2,y.z)*cr,C=[y.x*cr,y.y*cr],S=[];for(const O of c)for(const B of O){const j=[B.x+C[0],B.y+C[1]];Jl(j,s,Q,x),S.push(j)}return S}function zo(c,s,Q,y){const x=Math.pow(2,y.z)*cr,C=[y.x*cr,y.y*cr],S=[];for(const B of c){const j=[];for(const q of B){const X=[q.x+C[0],q.y+C[1]];No(s,X),j.push(X)}S.push(j)}if(s[2]-s[0]<=x/2){(O=s)[0]=O[1]=1/0,O[2]=O[3]=-1/0;for(const B of S)for(const j of B)Jl(j,s,Q,x)}var O;return S}class Fr{constructor(s,Q){this.type=jt,this.geojson=s,this.geometries=Q}static parse(s,Q){if(s.length!==2)return Q.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(Dn(s[1])){const y=s[1];if(y.type==="FeatureCollection")for(let x=0;x<y.features.length;++x){const C=y.features[x].geometry.type;if(C==="Polygon"||C==="MultiPolygon")return new Fr(y,y.features[x].geometry)}else if(y.type==="Feature"){const x=y.geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new Fr(y,y.geometry)}else if(y.type==="Polygon"||y.type==="MultiPolygon")return new Fr(y,y)}return Q.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(s){if(s.geometry()!=null&&s.canonicalID()!=null){if(s.geometryType()==="Point")return function(Q,y){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],S=Q.canonicalID();if(y.type==="Polygon"){const O=i5(y.coordinates,C,S),B=jo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Fo(j,O))return!1}if(y.type==="MultiPolygon"){const O=Kl(y.coordinates,C,S),B=jo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Ro(j,O))return!1}return!0}(s,this.geometries);if(s.geometryType()==="LineString")return function(Q,y){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],S=Q.canonicalID();if(y.type==="Polygon"){const O=i5(y.coordinates,C,S),B=zo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Wl(j,O))return!1}if(y.type==="MultiPolygon"){const O=Kl(y.coordinates,C,S),B=zo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Xl(j,O))return!1}return!0}(s,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class a5{constructor(s,Q){this.type=Q.type,this.name=s,this.boundExpression=Q}static parse(s,Q){if(s.length!==2||typeof s[1]!="string")return Q.error("'var' expression requires exactly one string literal argument.");const y=s[1];return Q.scope.has(y)?new a5(y,Q.scope.get(y)):Q.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Z3{constructor(s,Q,y,x){this.name=s,this.type=Q,this._evaluate=y,this.args=x}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,Q){const y=s[0],x=Z3.definitions[y];if(!x)return Q.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);const C=Array.isArray(x)?x[0]:x.type,S=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,O=S.filter(([j])=>!Array.isArray(j)||j.length===s.length-1);let B=null;for(const[j,q]of O){B=new r5(Q.registry,o5,Q.path,null,Q.scope);const X=[];let Y=!1;for(let re=1;re<s.length;re++){const ae=s[re],le=Array.isArray(j)?j[re-1]:j.type,fe=B.parse(ae,1+X.length,le);if(!fe){Y=!0;break}X.push(fe)}if(!Y)if(Array.isArray(j)&&j.length!==X.length)B.error(`Expected ${j.length} arguments, but found ${X.length} instead.`);else{for(let re=0;re<X.length;re++){const ae=Array.isArray(j)?j[re]:j.type,le=X[re];B.concat(re+1).checkSubtype(ae,le.type)}if(B.errors.length===0)return new Z3(y,C,q,X)}}if(O.length===1)Q.errors.push(...B.errors);else{const j=(O.length?O:S).map(([X])=>{return Y=X,Array.isArray(Y)?`(${Y.map(he).join(", ")})`:`(${he(Y.type)}...)`;var Y}).join(" | "),q=[];for(let X=1;X<s.length;X++){const Y=Q.parse(s[X],1+q.length);if(!Y)return null;q.push(he(Y.type))}Q.error(`Expected arguments of type ${j}, but found (${q.join(", ")}) instead.`)}return null}static register(s,Q){Z3.definitions=Q;for(const y in Q)s[y]=Z3}}function o5(c){if(c instanceof a5)return o5(c.boundExpression);if(c instanceof Z3&&c.name==="error"||c instanceof n5||c instanceof Fr)return!1;const s=c instanceof lr||c instanceof $3;let Q=!0;return c.eachChild(y=>{Q=s?Q&&o5(y):Q&&y instanceof Nr}),!!Q&&s5(c)&&l5(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function s5(c){if(c instanceof Z3&&(c.name==="get"&&c.args.length===1||c.name==="feature-state"||c.name==="has"&&c.args.length===1||c.name==="properties"||c.name==="geometry-type"||c.name==="id"||/^filter-/.test(c.name))||c instanceof Fr)return!1;let s=!0;return c.eachChild(Q=>{s&&!s5(Q)&&(s=!1)}),s}function E6(c){if(c instanceof Z3&&c.name==="feature-state")return!1;let s=!0;return c.eachChild(Q=>{s&&!E6(Q)&&(s=!1)}),s}function l5(c,s){if(c instanceof Z3&&s.indexOf(c.name)>=0)return!1;let Q=!0;return c.eachChild(y=>{Q&&!l5(y,s)&&(Q=!1)}),Q}function On(c,s){const Q=c.length-1;let y,x,C=0,S=Q,O=0;for(;C<=S;)if(O=Math.floor((C+S)/2),y=c[O],x=c[O+1],y<=s){if(O===Q||s<x)return O;C=O+1}else{if(!(y>s))throw new J1("Input is not a number.");S=O-1}return 0}class ur{constructor(s,Q,y){this.type=s,this.input=Q,this.labels=[],this.outputs=[];for(const[x,C]of y)this.labels.push(x),this.outputs.push(C)}static parse(s,Q){if(s.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return Q.error("Expected an even number of arguments.");const y=Q.parse(s[1],1,at);if(!y)return null;const x=[];let C=null;Q.expectedType&&Q.expectedType.kind!=="value"&&(C=Q.expectedType);for(let S=1;S<s.length;S+=2){const O=S===1?-1/0:s[S],B=s[S+1],j=S,q=S+1;if(typeof O!="number")return Q.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',j);if(x.length&&x[x.length-1][0]>=O)return Q.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',j);const X=Q.parse(B,q,C);if(!X)return null;C=C||X.type,x.push([O,X])}return new ur(C,y,x)}evaluate(s){const Q=this.labels,y=this.outputs;if(Q.length===1)return y[0].evaluate(s);const x=this.input.evaluate(s);if(x<=Q[0])return y[0].evaluate(s);const C=Q.length;return x>=Q[C-1]?y[C-1].evaluate(s):y[On(Q,x)].evaluate(s)}eachChild(s){s(this.input);for(const Q of this.outputs)s(Q)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function c1(c,s,Q){return c+Q*(s-c)}function c5(c,s,Q){return c.map((y,x)=>c1(y,s[x],Q))}const H3={number:c1,color:function(c,s,Q,y="rgb"){switch(y){case"rgb":{const[x,C,S,O]=c5(c.rgb,s.rgb,Q);return new H1(x,C,S,O,!1)}case"hcl":{const[x,C,S,O]=c.hcl,[B,j,q,X]=s.hcl;let Y,re;if(isNaN(x)||isNaN(B))isNaN(x)?isNaN(B)?Y=NaN:(Y=B,S!==1&&S!==0||(re=j)):(Y=x,q!==1&&q!==0||(re=C));else{let He=B-x;B>x&&He>180?He-=360:B<x&&x-B>180&&(He+=360),Y=x+Q*He}const[ae,le,fe,ye]=function([He,ve,Me,De]){return He=isNaN(He)?0:He*Gt,D1([Me,Math.cos(He)*ve,Math.sin(He)*ve,De])}([Y,re??c1(C,j,Q),c1(S,q,Q),c1(O,X,Q)]);return new H1(ae,le,fe,ye,!1)}case"lab":{const[x,C,S,O]=D1(c5(c.lab,s.lab,Q));return new H1(x,C,S,O,!1)}}},array:c5,padding:function(c,s,Q){return new w3(c5(c.values,s.values,Q))},variableAnchorOffsetCollection:function(c,s,Q){const y=c.values,x=s.values;if(y.length!==x.length)throw new J1(`Cannot interpolate values of different length. from: ${c.toString()}, to: ${s.toString()}`);const C=[];for(let S=0;S<y.length;S+=2){if(y[S]!==x[S])throw new J1(`Cannot interpolate values containing mismatched anchors. from[${S}]: ${y[S]}, to[${S}]: ${x[S]}`);C.push(y[S]);const[O,B]=y[S+1],[j,q]=x[S+1];C.push([c1(O,j,Q),c1(B,q,Q)])}return new z3(C)}};class M3{constructor(s,Q,y,x,C){this.type=s,this.operator=Q,this.interpolation=y,this.input=x,this.labels=[],this.outputs=[];for(const[S,O]of C)this.labels.push(S),this.outputs.push(O)}static interpolationFactor(s,Q,y,x){let C=0;if(s.name==="exponential")C=$o(Q,s.base,y,x);else if(s.name==="linear")C=$o(Q,1,y,x);else if(s.name==="cubic-bezier"){const S=s.controlPoints;C=new w(S[0],S[1],S[2],S[3]).solve($o(Q,1,y,x))}return C}static parse(s,Q){let[y,x,C,...S]=s;if(!Array.isArray(x)||x.length===0)return Q.error("Expected an interpolation type expression.",1);if(x[0]==="linear")x={name:"linear"};else if(x[0]==="exponential"){const j=x[1];if(typeof j!="number")return Q.error("Exponential interpolation requires a numeric base.",1,1);x={name:"exponential",base:j}}else{if(x[0]!=="cubic-bezier")return Q.error(`Unknown interpolation type ${String(x[0])}`,1,0);{const j=x.slice(1);if(j.length!==4||j.some(q=>typeof q!="number"||q<0||q>1))return Q.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);x={name:"cubic-bezier",controlPoints:j}}}if(s.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return Q.error("Expected an even number of arguments.");if(C=Q.parse(C,2,at),!C)return null;const O=[];let B=null;y==="interpolate-hcl"||y==="interpolate-lab"?B=Q2:Q.expectedType&&Q.expectedType.kind!=="value"&&(B=Q.expectedType);for(let j=0;j<S.length;j+=2){const q=S[j],X=S[j+1],Y=j+3,re=j+4;if(typeof q!="number")return Q.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Y);if(O.length&&O[O.length-1][0]>=q)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Y);const ae=Q.parse(X,re,B);if(!ae)return null;B=B||ae.type,O.push([q,ae])}return Be(B,at)||Be(B,Q2)||Be(B,U)||Be(B,oe)||Be(B,Qe(at))?new M3(B,y,x,C,O):Q.error(`Type ${he(B)} is not interpolatable.`)}evaluate(s){const Q=this.labels,y=this.outputs;if(Q.length===1)return y[0].evaluate(s);const x=this.input.evaluate(s);if(x<=Q[0])return y[0].evaluate(s);const C=Q.length;if(x>=Q[C-1])return y[C-1].evaluate(s);const S=On(Q,x),O=M3.interpolationFactor(this.interpolation,x,Q[S],Q[S+1]),B=y[S].evaluate(s),j=y[S+1].evaluate(s);switch(this.operator){case"interpolate":return H3[this.type.kind](B,j,O);case"interpolate-hcl":return H3.color(B,j,O,"hcl");case"interpolate-lab":return H3.color(B,j,O,"lab")}}eachChild(s){s(this.input);for(const Q of this.outputs)s(Q)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function $o(c,s,Q,y){const x=y-Q,C=c-Q;return x===0?0:s===1?C/x:(Math.pow(s,C)-1)/(Math.pow(s,x)-1)}class u5{constructor(s,Q){this.type=s,this.args=Q}static parse(s,Q){if(s.length<2)return Q.error("Expectected at least one argument.");let y=null;const x=Q.expectedType;x&&x.kind!=="value"&&(y=x);const C=[];for(const O of s.slice(1)){const B=Q.parse(O,1+C.length,y,void 0,{typeAnnotation:"omit"});if(!B)return null;y=y||B.type,C.push(B)}if(!y)throw new Error("No output type");const S=x&&C.some(O=>_e(x,O.type));return new u5(S?Zt:y,C)}evaluate(s){let Q,y=null,x=0;for(const C of this.args)if(x++,y=C.evaluate(s),y&&y instanceof D2&&!y.available&&(Q||(Q=y.name),y=null,x===this.args.length&&(y=Q)),y!==null)break;return y}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class Q5{constructor(s,Q){this.type=Q.type,this.bindings=[].concat(s),this.result=Q}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const Q of this.bindings)s(Q[1]);s(this.result)}static parse(s,Q){if(s.length<4)return Q.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const y=[];for(let C=1;C<s.length-1;C+=2){const S=s[C];if(typeof S!="string")return Q.error(`Expected string, but found ${typeof S} instead.`,C);if(/[^a-zA-Z0-9_]/.test(S))return Q.error("Variable names must contain only alphanumeric characters or '_'.",C);const O=Q.parse(s[C+1],C+1);if(!O)return null;y.push([S,O])}const x=Q.parse(s[s.length-1],s.length-1,Q.expectedType,y);return x?new Q5(y,x):null}outputDefined(){return this.result.outputDefined()}}class Zo{constructor(s,Q,y){this.type=s,this.index=Q,this.input=y}static parse(s,Q){if(s.length!==3)return Q.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,at),x=Q.parse(s[2],2,Qe(Q.expectedType||Zt));return y&&x?new Zo(x.type.itemType,y,x):null}evaluate(s){const Q=this.index.evaluate(s),y=this.input.evaluate(s);if(Q<0)throw new J1(`Array index out of bounds: ${Q} < 0.`);if(Q>=y.length)throw new J1(`Array index out of bounds: ${Q} > ${y.length-1}.`);if(Q!==Math.floor(Q))throw new J1(`Array index must be an integer, but found ${Q} instead.`);return y[Q]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class qo{constructor(s,Q){this.type=jt,this.needle=s,this.haystack=Q}static parse(s,Q){if(s.length!==3)return Q.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,Zt),x=Q.parse(s[2],2,Zt);return y&&x?me(y.type,[jt,qt,at,b3,Zt])?new qo(y,x):Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${he(y.type)} instead`):null}evaluate(s){const Q=this.needle.evaluate(s),y=this.haystack.evaluate(s);if(!y)return!1;if(!be(Q,["boolean","string","number","null"]))throw new J1(`Expected first argument to be of type boolean, string, number or null, but found ${he(Z1(Q))} instead.`);if(!be(y,["string","array"]))throw new J1(`Expected second argument to be of type array or string, but found ${he(Z1(y))} instead.`);return y.indexOf(Q)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class T5{constructor(s,Q,y){this.type=at,this.needle=s,this.haystack=Q,this.fromIndex=y}static parse(s,Q){if(s.length<=2||s.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,Zt),x=Q.parse(s[2],2,Zt);if(!y||!x)return null;if(!me(y.type,[jt,qt,at,b3,Zt]))return Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${he(y.type)} instead`);if(s.length===4){const C=Q.parse(s[3],3,at);return C?new T5(y,x,C):null}return new T5(y,x)}evaluate(s){const Q=this.needle.evaluate(s),y=this.haystack.evaluate(s);if(!be(Q,["boolean","string","number","null"]))throw new J1(`Expected first argument to be of type boolean, string, number or null, but found ${he(Z1(Q))} instead.`);if(!be(y,["string","array"]))throw new J1(`Expected second argument to be of type array or string, but found ${he(Z1(y))} instead.`);if(this.fromIndex){const x=this.fromIndex.evaluate(s);return y.indexOf(Q,x)}return y.indexOf(Q)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Go{constructor(s,Q,y,x,C,S){this.inputType=s,this.type=Q,this.input=y,this.cases=x,this.outputs=C,this.otherwise=S}static parse(s,Q){if(s.length<5)return Q.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return Q.error("Expected an even number of arguments.");let y,x;Q.expectedType&&Q.expectedType.kind!=="value"&&(x=Q.expectedType);const C={},S=[];for(let j=2;j<s.length-1;j+=2){let q=s[j];const X=s[j+1];Array.isArray(q)||(q=[q]);const Y=Q.concat(j);if(q.length===0)return Y.error("Expected at least one branch label.");for(const ae of q){if(typeof ae!="number"&&typeof ae!="string")return Y.error("Branch labels must be numbers or strings.");if(typeof ae=="number"&&Math.abs(ae)>Number.MAX_SAFE_INTEGER)return Y.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ae=="number"&&Math.floor(ae)!==ae)return Y.error("Numeric branch labels must be integer values.");if(y){if(Y.checkSubtype(y,Z1(ae)))return null}else y=Z1(ae);if(C[String(ae)]!==void 0)return Y.error("Branch labels must be unique.");C[String(ae)]=S.length}const re=Q.parse(X,j,x);if(!re)return null;x=x||re.type,S.push(re)}const O=Q.parse(s[1],1,Zt);if(!O)return null;const B=Q.parse(s[s.length-1],s.length-1,x);return B?O.type.kind!=="value"&&Q.concat(1).checkSubtype(y,O.type)?null:new Go(y,x,O,C,S,B):null}evaluate(s){const Q=this.input.evaluate(s);return(Z1(Q)===this.inputType&&this.outputs[this.cases[Q]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Uo{constructor(s,Q,y){this.type=s,this.branches=Q,this.otherwise=y}static parse(s,Q){if(s.length<4)return Q.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return Q.error("Expected an odd number of arguments.");let y;Q.expectedType&&Q.expectedType.kind!=="value"&&(y=Q.expectedType);const x=[];for(let S=1;S<s.length-1;S+=2){const O=Q.parse(s[S],S,jt);if(!O)return null;const B=Q.parse(s[S+1],S+1,y);if(!B)return null;x.push([O,B]),y=y||B.type}const C=Q.parse(s[s.length-1],s.length-1,y);if(!C)return null;if(!y)throw new Error("Can't infer output type");return new Uo(y,x,C)}evaluate(s){for(const[Q,y]of this.branches)if(Q.evaluate(s))return y.evaluate(s);return this.otherwise.evaluate(s)}eachChild(s){for(const[Q,y]of this.branches)s(Q),s(y);s(this.otherwise)}outputDefined(){return this.branches.every(([s,Q])=>Q.outputDefined())&&this.otherwise.outputDefined()}}class h5{constructor(s,Q,y,x){this.type=s,this.input=Q,this.beginIndex=y,this.endIndex=x}static parse(s,Q){if(s.length<=2||s.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,Zt),x=Q.parse(s[2],2,at);if(!y||!x)return null;if(!me(y.type,[Qe(Zt),qt,Zt]))return Q.error(`Expected first argument to be of type array or string, but found ${he(y.type)} instead`);if(s.length===4){const C=Q.parse(s[3],3,at);return C?new h5(y.type,y,x,C):null}return new h5(y.type,y,x)}evaluate(s){const Q=this.input.evaluate(s),y=this.beginIndex.evaluate(s);if(!be(Q,["string","array"]))throw new J1(`Expected first argument to be of type array or string, but found ${he(Z1(Q))} instead.`);if(this.endIndex){const x=this.endIndex.evaluate(s);return Q.slice(y,x)}return Q.slice(y)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function Yl(c,s){return c==="=="||c==="!="?s.kind==="boolean"||s.kind==="string"||s.kind==="number"||s.kind==="null"||s.kind==="value":s.kind==="string"||s.kind==="number"||s.kind==="value"}function e9(c,s,Q,y){return y.compare(s,Q)===0}function kn(c,s,Q){const y=c!=="=="&&c!=="!=";return class ob{constructor(C,S,O){this.type=jt,this.lhs=C,this.rhs=S,this.collator=O,this.hasUntypedArgument=C.type.kind==="value"||S.type.kind==="value"}static parse(C,S){if(C.length!==3&&C.length!==4)return S.error("Expected two or three arguments.");const O=C[0];let B=S.parse(C[1],1,Zt);if(!B)return null;if(!Yl(O,B.type))return S.concat(1).error(`"${O}" comparisons are not supported for type '${he(B.type)}'.`);let j=S.parse(C[2],2,Zt);if(!j)return null;if(!Yl(O,j.type))return S.concat(2).error(`"${O}" comparisons are not supported for type '${he(j.type)}'.`);if(B.type.kind!==j.type.kind&&B.type.kind!=="value"&&j.type.kind!=="value")return S.error(`Cannot compare types '${he(B.type)}' and '${he(j.type)}'.`);y&&(B.type.kind==="value"&&j.type.kind!=="value"?B=new $3(j.type,[B]):B.type.kind!=="value"&&j.type.kind==="value"&&(j=new $3(B.type,[j])));let q=null;if(C.length===4){if(B.type.kind!=="string"&&j.type.kind!=="string"&&B.type.kind!=="value"&&j.type.kind!=="value")return S.error("Cannot use collator to compare non-string types.");if(q=S.parse(C[3],3,Ae),!q)return null}return new ob(B,j,q)}evaluate(C){const S=this.lhs.evaluate(C),O=this.rhs.evaluate(C);if(y&&this.hasUntypedArgument){const B=Z1(S),j=Z1(O);if(B.kind!==j.kind||B.kind!=="string"&&B.kind!=="number")throw new J1(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${B.kind}, ${j.kind}) instead.`)}if(this.collator&&!y&&this.hasUntypedArgument){const B=Z1(S),j=Z1(O);if(B.kind!=="string"||j.kind!=="string")return s(C,S,O)}return this.collator?Q(C,S,O,this.collator.evaluate(C)):s(C,S,O)}eachChild(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)}outputDefined(){return!0}}}const nh=kn("==",function(c,s,Q){return s===Q},e9),ih=kn("!=",function(c,s,Q){return s!==Q},function(c,s,Q,y){return!e9(0,s,Q,y)}),ah=kn("<",function(c,s,Q){return s<Q},function(c,s,Q,y){return y.compare(s,Q)<0}),oh=kn(">",function(c,s,Q){return s>Q},function(c,s,Q,y){return y.compare(s,Q)>0}),sh=kn("<=",function(c,s,Q){return s<=Q},function(c,s,Q,y){return y.compare(s,Q)<=0}),lh=kn(">=",function(c,s,Q){return s>=Q},function(c,s,Q,y){return y.compare(s,Q)>=0});class Wo{constructor(s,Q,y,x,C){this.type=qt,this.number=s,this.locale=Q,this.currency=y,this.minFractionDigits=x,this.maxFractionDigits=C}static parse(s,Q){if(s.length!==3)return Q.error("Expected two arguments.");const y=Q.parse(s[1],1,at);if(!y)return null;const x=s[2];if(typeof x!="object"||Array.isArray(x))return Q.error("NumberFormat options argument must be an object.");let C=null;if(x.locale&&(C=Q.parse(x.locale,1,qt),!C))return null;let S=null;if(x.currency&&(S=Q.parse(x.currency,1,qt),!S))return null;let O=null;if(x["min-fraction-digits"]&&(O=Q.parse(x["min-fraction-digits"],1,at),!O))return null;let B=null;return x["max-fraction-digits"]&&(B=Q.parse(x["max-fraction-digits"],1,at),!B)?null:new Wo(y,C,S,O,B)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class d5{constructor(s){this.type=ne,this.sections=s}static parse(s,Q){if(s.length<2)return Q.error("Expected at least one argument.");const y=s[1];if(!Array.isArray(y)&&typeof y=="object")return Q.error("First argument must be an image or text section.");const x=[];let C=!1;for(let S=1;S<=s.length-1;++S){const O=s[S];if(C&&typeof O=="object"&&!Array.isArray(O)){C=!1;let B=null;if(O["font-scale"]&&(B=Q.parse(O["font-scale"],1,at),!B))return null;let j=null;if(O["text-font"]&&(j=Q.parse(O["text-font"],1,Qe(qt)),!j))return null;let q=null;if(O["text-color"]&&(q=Q.parse(O["text-color"],1,Q2),!q))return null;const X=x[x.length-1];X.scale=B,X.font=j,X.textColor=q}else{const B=Q.parse(s[S],1,Zt);if(!B)return null;const j=B.type.kind;if(j!=="string"&&j!=="value"&&j!=="null"&&j!=="resolvedImage")return Q.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");C=!0,x.push({content:B,scale:null,font:null,textColor:null})}}return new d5(x)}evaluate(s){return new z2(this.sections.map(Q=>{const y=Q.content.evaluate(s);return Z1(y)===J?new Yi("",y,null,null,null):new Yi(p1(y),null,Q.scale?Q.scale.evaluate(s):null,Q.font?Q.font.evaluate(s).join(","):null,Q.textColor?Q.textColor.evaluate(s):null)}))}eachChild(s){for(const Q of this.sections)s(Q.content),Q.scale&&s(Q.scale),Q.font&&s(Q.font),Q.textColor&&s(Q.textColor)}outputDefined(){return!1}}class Xo{constructor(s){this.type=J,this.input=s}static parse(s,Q){if(s.length!==2)return Q.error("Expected two arguments.");const y=Q.parse(s[1],1,qt);return y?new Xo(y):Q.error("No image name provided.")}evaluate(s){const Q=this.input.evaluate(s),y=D2.fromString(Q);return y&&s.availableImages&&(y.available=s.availableImages.indexOf(Q)>-1),y}eachChild(s){s(this.input)}outputDefined(){return!1}}class Ko{constructor(s){this.type=at,this.input=s}static parse(s,Q){if(s.length!==2)return Q.error(`Expected 1 argument, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1);return y?y.type.kind!=="array"&&y.type.kind!=="string"&&y.type.kind!=="value"?Q.error(`Expected argument of type string or array, but found ${he(y.type)} instead.`):new Ko(y):null}evaluate(s){const Q=this.input.evaluate(s);if(typeof Q=="string"||Array.isArray(Q))return Q.length;throw new J1(`Expected value to be of type string or array, but found ${he(Z1(Q))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Pn={"==":nh,"!=":ih,">":oh,"<":ah,">=":lh,"<=":sh,array:$3,at:Zo,boolean:$3,case:Uo,coalesce:u5,collator:n5,format:d5,image:Xo,in:qo,"index-of":T5,interpolate:M3,"interpolate-hcl":M3,"interpolate-lab":M3,length:Ko,let:Q5,literal:Nr,match:Go,number:$3,"number-format":Wo,object:$3,slice:h5,step:ur,string:$3,"to-boolean":lr,"to-color":lr,"to-number":lr,"to-string":lr,var:a5,within:Fr};function t9(c,[s,Q,y,x]){s=s.evaluate(c),Q=Q.evaluate(c),y=y.evaluate(c);const C=x?x.evaluate(c):1,S=e5(s,Q,y,C);if(S)throw new J1(S);return new H1(s/255,Q/255,y/255,C,!1)}function r9(c,s){return c in s}function Jo(c,s){const Q=s[c];return Q===void 0?null:Q}function Rr(c){return{type:c}}function n9(c){return{result:"success",value:c}}function Qr(c){return{result:"error",value:c}}function In(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function i9(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function Yo(c){return!!c.expression&&c.expression.interpolated}function m1(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function q1(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function ch(c){return c}function u1(c,s){const Q=s.type==="color",y=c.stops&&typeof c.stops[0][0]=="object",x=y||!(y||c.property!==void 0),C=c.type||(Yo(s)?"exponential":"interval");if(Q||s.type==="padding"){const q=Q?H1.parse:w3.parse;(c=c3({},c)).stops&&(c.stops=c.stops.map(X=>[X[0],q(X[1])])),c.default=q(c.default?c.default:s.default)}if(c.colorSpace&&(S=c.colorSpace)!=="rgb"&&S!=="hcl"&&S!=="lab")throw new Error(`Unknown color space: "${c.colorSpace}"`);var S;let O,B,j;if(C==="exponential")O=V6;else if(C==="interval")O=z1;else if(C==="categorical"){O=G1,B=Object.create(null);for(const q of c.stops)B[q[0]]=q[1];j=typeof c.stops[0][0]}else{if(C!=="identity")throw new Error(`Unknown function type "${C}"`);O=a9}if(y){const q={},X=[];for(let ae=0;ae<c.stops.length;ae++){const le=c.stops[ae],fe=le[0].zoom;q[fe]===void 0&&(q[fe]={zoom:fe,type:c.type,property:c.property,default:c.default,stops:[]},X.push(fe)),q[fe].stops.push([le[0].value,le[1]])}const Y=[];for(const ae of X)Y.push([q[ae].zoom,u1(q[ae],s)]);const re={name:"linear"};return{kind:"composite",interpolationType:re,interpolationFactor:M3.interpolationFactor.bind(void 0,re),zoomStops:Y.map(ae=>ae[0]),evaluate:({zoom:ae},le)=>V6({stops:Y,base:c.base},s,ae).evaluate(ae,le)}}if(x){const q=C==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:q,interpolationFactor:M3.interpolationFactor.bind(void 0,q),zoomStops:c.stops.map(X=>X[0]),evaluate:({zoom:X})=>O(c,s,X,B,j)}}return{kind:"source",evaluate(q,X){const Y=X&&X.properties?X.properties[c.property]:void 0;return Y===void 0?jr(c.default,s.default):O(c,s,Y,B,j)}}}function jr(c,s,Q){return c!==void 0?c:s!==void 0?s:Q!==void 0?Q:void 0}function G1(c,s,Q,y,x){return jr(typeof Q===x?y[Q]:void 0,c.default,s.default)}function z1(c,s,Q){if(m1(Q)!=="number")return jr(c.default,s.default);const y=c.stops.length;if(y===1||Q<=c.stops[0][0])return c.stops[0][1];if(Q>=c.stops[y-1][0])return c.stops[y-1][1];const x=On(c.stops.map(C=>C[0]),Q);return c.stops[x][1]}function V6(c,s,Q){const y=c.base!==void 0?c.base:1;if(m1(Q)!=="number")return jr(c.default,s.default);const x=c.stops.length;if(x===1||Q<=c.stops[0][0])return c.stops[0][1];if(Q>=c.stops[x-1][0])return c.stops[x-1][1];const C=On(c.stops.map(q=>q[0]),Q),S=function(q,X,Y,re){const ae=re-Y,le=q-Y;return ae===0?0:X===1?le/ae:(Math.pow(X,le)-1)/(Math.pow(X,ae)-1)}(Q,y,c.stops[C][0],c.stops[C+1][0]),O=c.stops[C][1],B=c.stops[C+1][1],j=H3[s.type]||ch;return typeof O.evaluate=="function"?{evaluate(...q){const X=O.evaluate.apply(void 0,q),Y=B.evaluate.apply(void 0,q);if(X!==void 0&&Y!==void 0)return j(X,Y,S,c.colorSpace)}}:j(O,B,S,c.colorSpace)}function a9(c,s,Q){switch(s.type){case"color":Q=H1.parse(Q);break;case"formatted":Q=z2.fromString(Q.toString());break;case"resolvedImage":Q=D2.fromString(Q.toString());break;case"padding":Q=w3.parse(Q);break;default:m1(Q)===s.type||s.type==="enum"&&s.values[Q]||(Q=void 0)}return jr(Q,c.default,s.default)}Z3.register(Pn,{error:[{kind:"error"},[qt],(c,[s])=>{throw new J1(s.evaluate(c))}],typeof:[qt,[Zt],(c,[s])=>he(Z1(s.evaluate(c)))],"to-rgba":[Qe(at,4),[Q2],(c,[s])=>{const[Q,y,x,C]=s.evaluate(c).rgb;return[255*Q,255*y,255*x,C]}],rgb:[Q2,[at,at,at],t9],rgba:[Q2,[at,at,at,at],t9],has:{type:jt,overloads:[[[qt],(c,[s])=>r9(s.evaluate(c),c.properties())],[[qt,u3],(c,[s,Q])=>r9(s.evaluate(c),Q.evaluate(c))]]},get:{type:Zt,overloads:[[[qt],(c,[s])=>Jo(s.evaluate(c),c.properties())],[[qt,u3],(c,[s,Q])=>Jo(s.evaluate(c),Q.evaluate(c))]]},"feature-state":[Zt,[qt],(c,[s])=>Jo(s.evaluate(c),c.featureState||{})],properties:[u3,[],c=>c.properties()],"geometry-type":[qt,[],c=>c.geometryType()],id:[Zt,[],c=>c.id()],zoom:[at,[],c=>c.globals.zoom],"heatmap-density":[at,[],c=>c.globals.heatmapDensity||0],"line-progress":[at,[],c=>c.globals.lineProgress||0],accumulated:[Zt,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[at,Rr(at),(c,s)=>{let Q=0;for(const y of s)Q+=y.evaluate(c);return Q}],"*":[at,Rr(at),(c,s)=>{let Q=1;for(const y of s)Q*=y.evaluate(c);return Q}],"-":{type:at,overloads:[[[at,at],(c,[s,Q])=>s.evaluate(c)-Q.evaluate(c)],[[at],(c,[s])=>-s.evaluate(c)]]},"/":[at,[at,at],(c,[s,Q])=>s.evaluate(c)/Q.evaluate(c)],"%":[at,[at,at],(c,[s,Q])=>s.evaluate(c)%Q.evaluate(c)],ln2:[at,[],()=>Math.LN2],pi:[at,[],()=>Math.PI],e:[at,[],()=>Math.E],"^":[at,[at,at],(c,[s,Q])=>Math.pow(s.evaluate(c),Q.evaluate(c))],sqrt:[at,[at],(c,[s])=>Math.sqrt(s.evaluate(c))],log10:[at,[at],(c,[s])=>Math.log(s.evaluate(c))/Math.LN10],ln:[at,[at],(c,[s])=>Math.log(s.evaluate(c))],log2:[at,[at],(c,[s])=>Math.log(s.evaluate(c))/Math.LN2],sin:[at,[at],(c,[s])=>Math.sin(s.evaluate(c))],cos:[at,[at],(c,[s])=>Math.cos(s.evaluate(c))],tan:[at,[at],(c,[s])=>Math.tan(s.evaluate(c))],asin:[at,[at],(c,[s])=>Math.asin(s.evaluate(c))],acos:[at,[at],(c,[s])=>Math.acos(s.evaluate(c))],atan:[at,[at],(c,[s])=>Math.atan(s.evaluate(c))],min:[at,Rr(at),(c,s)=>Math.min(...s.map(Q=>Q.evaluate(c)))],max:[at,Rr(at),(c,s)=>Math.max(...s.map(Q=>Q.evaluate(c)))],abs:[at,[at],(c,[s])=>Math.abs(s.evaluate(c))],round:[at,[at],(c,[s])=>{const Q=s.evaluate(c);return Q<0?-Math.round(-Q):Math.round(Q)}],floor:[at,[at],(c,[s])=>Math.floor(s.evaluate(c))],ceil:[at,[at],(c,[s])=>Math.ceil(s.evaluate(c))],"filter-==":[jt,[qt,Zt],(c,[s,Q])=>c.properties()[s.value]===Q.value],"filter-id-==":[jt,[Zt],(c,[s])=>c.id()===s.value],"filter-type-==":[jt,[qt],(c,[s])=>c.geometryType()===s.value],"filter-<":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y<x}],"filter-id-<":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q<y}],"filter->":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y>x}],"filter-id->":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q>y}],"filter-<=":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y<=x}],"filter-id-<=":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q<=y}],"filter->=":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y>=x}],"filter-id->=":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q>=y}],"filter-has":[jt,[Zt],(c,[s])=>s.value in c.properties()],"filter-has-id":[jt,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[jt,[Qe(qt)],(c,[s])=>s.value.indexOf(c.geometryType())>=0],"filter-id-in":[jt,[Qe(Zt)],(c,[s])=>s.value.indexOf(c.id())>=0],"filter-in-small":[jt,[qt,Qe(Zt)],(c,[s,Q])=>Q.value.indexOf(c.properties()[s.value])>=0],"filter-in-large":[jt,[qt,Qe(Zt)],(c,[s,Q])=>function(y,x,C,S){for(;C<=S;){const O=C+S>>1;if(x[O]===y)return!0;x[O]>y?S=O-1:C=O+1}return!1}(c.properties()[s.value],Q.value,0,Q.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(c,[s,Q])=>s.evaluate(c)&&Q.evaluate(c)],[Rr(jt),(c,s)=>{for(const Q of s)if(!Q.evaluate(c))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(c,[s,Q])=>s.evaluate(c)||Q.evaluate(c)],[Rr(jt),(c,s)=>{for(const Q of s)if(Q.evaluate(c))return!0;return!1}]]},"!":[jt,[jt],(c,[s])=>!s.evaluate(c)],"is-supported-script":[jt,[qt],(c,[s])=>{const Q=c.globals&&c.globals.isSupportedScript;return!Q||Q(s.evaluate(c))}],upcase:[qt,[qt],(c,[s])=>s.evaluate(c).toUpperCase()],downcase:[qt,[qt],(c,[s])=>s.evaluate(c).toLowerCase()],concat:[qt,Rr(Zt),(c,s)=>s.map(Q=>p1(Q.evaluate(c))).join("")],"resolved-locale":[qt,[Ae],(c,[s])=>s.evaluate(c).resolvedLocale()]});class e0{constructor(s,Q){var y;this.expression=s,this._warningHistory={},this._evaluator=new Bo,this._defaultValue=Q?(y=Q).type==="color"&&q1(y.default)?new H1(0,0,0,0):y.type==="color"?H1.parse(y.default)||null:y.type==="padding"?w3.parse(y.default)||null:y.type==="variableAnchorOffsetCollection"?z3.parse(y.default)||null:y.default===void 0?null:y.default:null,this._enumValues=Q&&Q.type==="enum"?Q.values:null}evaluateWithoutErrorHandling(s,Q,y,x,C,S){return this._evaluator.globals=s,this._evaluator.feature=Q,this._evaluator.featureState=y,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=S,this.expression.evaluate(this._evaluator)}evaluate(s,Q,y,x,C,S){this._evaluator.globals=s,this._evaluator.feature=Q||null,this._evaluator.featureState=y||null,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=S||null;try{const O=this.expression.evaluate(this._evaluator);if(O==null||typeof O=="number"&&O!=O)return this._defaultValue;if(this._enumValues&&!(O in this._enumValues))throw new J1(`Expected value to be one of ${Object.keys(this._enumValues).map(B=>JSON.stringify(B)).join(", ")}, but found ${JSON.stringify(O)} instead.`);return O}catch(O){return this._warningHistory[O.message]||(this._warningHistory[O.message]=!0,typeof console<"u"&&console.warn(O.message)),this._defaultValue}}}function f5(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in Pn}function p5(c,s){const Q=new r5(Pn,o5,[],s?function(x){const C={color:Q2,string:qt,number:at,enum:qt,boolean:jt,formatted:ne,padding:U,resolvedImage:J,variableAnchorOffsetCollection:oe};return x.type==="array"?Qe(C[x.value]||Zt,x.length):C[x.type]}(s):void 0),y=Q.parse(c,void 0,void 0,void 0,s&&s.type==="string"?{typeAnnotation:"coerce"}:void 0);return y?n9(new e0(y,s)):Qr(Q.errors)}class t0{constructor(s,Q){this.kind=s,this._styleExpression=Q,this.isStateDependent=s!=="constant"&&!E6(Q.expression)}evaluateWithoutErrorHandling(s,Q,y,x,C,S){return this._styleExpression.evaluateWithoutErrorHandling(s,Q,y,x,C,S)}evaluate(s,Q,y,x,C,S){return this._styleExpression.evaluate(s,Q,y,x,C,S)}}class m5{constructor(s,Q,y,x){this.kind=s,this.zoomStops=y,this._styleExpression=Q,this.isStateDependent=s!=="camera"&&!E6(Q.expression),this.interpolationType=x}evaluateWithoutErrorHandling(s,Q,y,x,C,S){return this._styleExpression.evaluateWithoutErrorHandling(s,Q,y,x,C,S)}evaluate(s,Q,y,x,C,S){return this._styleExpression.evaluate(s,Q,y,x,C,S)}interpolationFactor(s,Q,y){return this.interpolationType?M3.interpolationFactor(this.interpolationType,s,Q,y):0}}function r0(c,s){const Q=p5(c,s);if(Q.result==="error")return Q;const y=Q.value.expression,x=s5(y);if(!x&&!In(s))return Qr([new w1("","data expressions not supported")]);const C=l5(y,["zoom"]);if(!C&&!i9(s))return Qr([new w1("","zoom expressions not supported")]);const S=O6(y);return S||C?S instanceof w1?Qr([S]):S instanceof M3&&!Yo(s)?Qr([new w1("",'"interpolate" expressions cannot be used with this property')]):n9(S?new m5(x?"camera":"composite",Q.value,S.labels,S instanceof M3?S.interpolation:void 0):new t0(x?"constant":"source",Q.value)):Qr([new w1("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class D6{constructor(s,Q){this._parameters=s,this._specification=Q,c3(this,u1(this._parameters,this._specification))}static deserialize(s){return new D6(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function O6(c){let s=null;if(c instanceof Q5)s=O6(c.result);else if(c instanceof u5){for(const Q of c.args)if(s=O6(Q),s)break}else(c instanceof ur||c instanceof M3)&&c.input instanceof Z3&&c.input.name==="zoom"&&(s=c);return s instanceof w1||c.eachChild(Q=>{const y=O6(Q);y instanceof w1?s=y:!s&&y?s=new w1("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&y&&s!==y&&(s=new w1("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function k6(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(const s of c.slice(1))if(!k6(s)&&typeof s!="boolean")return!1;return!0;default:return!0}}const uh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function n0(c){if(c==null)return{filter:()=>!0,needGeometry:!1};k6(c)||(c=y5(c));const s=p5(c,uh);if(s.result==="error")throw new Error(s.value.map(Q=>`${Q.key}: ${Q.message}`).join(", "));return{filter:(Q,y,x)=>s.value.evaluate(Q,y,{},x),needGeometry:o9(c)}}function Qh(c,s){return c<s?-1:c>s?1:0}function o9(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let s=1;s<c.length;s++)if(o9(c[s]))return!0;return!1}function y5(c){if(!c)return!0;const s=c[0];return c.length<=1?s!=="any":s==="=="?i0(c[1],c[2],"=="):s==="!="?P6(i0(c[1],c[2],"==")):s==="<"||s===">"||s==="<="||s===">="?i0(c[1],c[2],s):s==="any"?(Q=c.slice(1),["any"].concat(Q.map(y5))):s==="all"?["all"].concat(c.slice(1).map(y5)):s==="none"?["all"].concat(c.slice(1).map(y5).map(P6)):s==="in"?s9(c[1],c.slice(2)):s==="!in"?P6(s9(c[1],c.slice(2))):s==="has"?l9(c[1]):s==="!has"?P6(l9(c[1])):s!=="within"||c;var Q}function i0(c,s,Q){switch(c){case"$type":return[`filter-type-${Q}`,s];case"$id":return[`filter-id-${Q}`,s];default:return[`filter-${Q}`,c,s]}}function s9(c,s){if(s.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(Q=>typeof Q!=typeof s[0])?["filter-in-large",c,["literal",s.sort(Qh)]]:["filter-in-small",c,["literal",s]]}}function l9(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function P6(c){return["!",c]}function g5(c){const s=typeof c;if(s==="number"||s==="boolean"||s==="string"||c==null)return JSON.stringify(c);if(Array.isArray(c)){let x="[";for(const C of c)x+=`${g5(C)},`;return`${x}]`}const Q=Object.keys(c).sort();let y="{";for(let x=0;x<Q.length;x++)y+=`${JSON.stringify(Q[x])}:${g5(c[Q[x]])},`;return`${y}}`}function _5(c){let s="";for(const Q of v1)s+=`/${g5(c[Q])}`;return s}function c9(c){const s=c.value;return s?[new it(c.key,s,"constants have been deprecated as of v8")]:[]}function Y1(c){return c instanceof Number||c instanceof String||c instanceof Boolean?c.valueOf():c}function zr(c){if(Array.isArray(c))return c.map(zr);if(c instanceof Object&&!(c instanceof Number||c instanceof String||c instanceof Boolean)){const s={};for(const Q in c)s[Q]=zr(c[Q]);return s}return Y1(c)}function Q3(c){const s=c.key,Q=c.value,y=c.valueSpec||{},x=c.objectElementValidators||{},C=c.style,S=c.styleSpec,O=c.validateSpec;let B=[];const j=m1(Q);if(j!=="object")return[new it(s,Q,`object expected, ${j} found`)];for(const q in Q){const X=q.split(".")[0],Y=y[X]||y["*"];let re;if(x[X])re=x[X];else if(y[X])re=O;else if(x["*"])re=x["*"];else{if(!y["*"]){B.push(new it(s,Q[q],`unknown property "${q}"`));continue}re=O}B=B.concat(re({key:(s&&`${s}.`)+q,value:Q[q],valueSpec:Y,style:C,styleSpec:S,object:Q,objectKey:q,validateSpec:O},Q))}for(const q in y)x[q]||y[q].required&&y[q].default===void 0&&Q[q]===void 0&&B.push(new it(s,Q,`missing required property "${q}"`));return B}function Bn(c){const s=c.value,Q=c.valueSpec,y=c.style,x=c.styleSpec,C=c.key,S=c.arrayElementValidator||c.validateSpec;if(m1(s)!=="array")return[new it(C,s,`array expected, ${m1(s)} found`)];if(Q.length&&s.length!==Q.length)return[new it(C,s,`array length ${Q.length} expected, length ${s.length} found`)];if(Q["min-length"]&&s.length<Q["min-length"])return[new it(C,s,`array length at least ${Q["min-length"]} expected, length ${s.length} found`)];let O={type:Q.value,values:Q.values};x.$version<7&&(O.function=Q.function),m1(Q.value)==="object"&&(O=Q.value);let B=[];for(let j=0;j<s.length;j++)B=B.concat(S({array:s,arrayIndex:j,value:s[j],valueSpec:O,validateSpec:c.validateSpec,style:y,styleSpec:x,key:`${C}[${j}]`}));return B}function I6(c){const s=c.key,Q=c.value,y=c.valueSpec;let x=m1(Q);return x==="number"&&Q!=Q&&(x="NaN"),x!=="number"?[new it(s,Q,`number expected, ${x} found`)]:"minimum"in y&&Q<y.minimum?[new it(s,Q,`${Q} is less than the minimum value ${y.minimum}`)]:"maximum"in y&&Q>y.maximum?[new it(s,Q,`${Q} is greater than the maximum value ${y.maximum}`)]:[]}function v5(c){const s=c.valueSpec,Q=Y1(c.value.type);let y,x,C,S={};const O=Q!=="categorical"&&c.value.property===void 0,B=!O,j=m1(c.value.stops)==="array"&&m1(c.value.stops[0])==="array"&&m1(c.value.stops[0][0])==="object",q=Q3({key:c.key,value:c.value,valueSpec:c.styleSpec.function,validateSpec:c.validateSpec,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(re){if(Q==="identity")return[new it(re.key,re.value,'identity function may not have a "stops" property')];let ae=[];const le=re.value;return ae=ae.concat(Bn({key:re.key,value:le,valueSpec:re.valueSpec,validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec,arrayElementValidator:X})),m1(le)==="array"&&le.length===0&&ae.push(new it(re.key,le,"array must have at least one stop")),ae},default:function(re){return re.validateSpec({key:re.key,value:re.value,valueSpec:s,validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec})}}});return Q==="identity"&&O&&q.push(new it(c.key,c.value,'missing required property "property"')),Q==="identity"||c.value.stops||q.push(new it(c.key,c.value,'missing required property "stops"')),Q==="exponential"&&c.valueSpec.expression&&!Yo(c.valueSpec)&&q.push(new it(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(B&&!In(c.valueSpec)?q.push(new it(c.key,c.value,"property functions not supported")):O&&!i9(c.valueSpec)&&q.push(new it(c.key,c.value,"zoom functions not supported"))),Q!=="categorical"&&!j||c.value.property!==void 0||q.push(new it(c.key,c.value,'"property" property is required')),q;function X(re){let ae=[];const le=re.value,fe=re.key;if(m1(le)!=="array")return[new it(fe,le,`array expected, ${m1(le)} found`)];if(le.length!==2)return[new it(fe,le,`array length 2 expected, length ${le.length} found`)];if(j){if(m1(le[0])!=="object")return[new it(fe,le,`object expected, ${m1(le[0])} found`)];if(le[0].zoom===void 0)return[new it(fe,le,"object stop key must have zoom")];if(le[0].value===void 0)return[new it(fe,le,"object stop key must have value")];if(C&&C>Y1(le[0].zoom))return[new it(fe,le[0].zoom,"stop zoom values must appear in ascending order")];Y1(le[0].zoom)!==C&&(C=Y1(le[0].zoom),x=void 0,S={}),ae=ae.concat(Q3({key:`${fe}[0]`,value:le[0],valueSpec:{zoom:{}},validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec,objectElementValidators:{zoom:I6,value:Y}}))}else ae=ae.concat(Y({key:`${fe}[0]`,value:le[0],valueSpec:{},validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec},le));return f5(zr(le[1]))?ae.concat([new it(`${fe}[1]`,le[1],"expressions are not allowed in function stops.")]):ae.concat(re.validateSpec({key:`${fe}[1]`,value:le[1],valueSpec:s,validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec}))}function Y(re,ae){const le=m1(re.value),fe=Y1(re.value),ye=re.value!==null?re.value:ae;if(y){if(le!==y)return[new it(re.key,ye,`${le} stop domain type must match previous stop domain type ${y}`)]}else y=le;if(le!=="number"&&le!=="string"&&le!=="boolean")return[new it(re.key,ye,"stop domain value must be a number, string, or boolean")];if(le!=="number"&&Q!=="categorical"){let He=`number expected, ${le} found`;return In(s)&&Q===void 0&&(He+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new it(re.key,ye,He)]}return Q!=="categorical"||le!=="number"||isFinite(fe)&&Math.floor(fe)===fe?Q!=="categorical"&&le==="number"&&x!==void 0&&fe<x?[new it(re.key,ye,"stop domain values must appear in ascending order")]:(x=fe,Q==="categorical"&&fe in S?[new it(re.key,ye,"stop domain values must be unique")]:(S[fe]=!0,[])):[new it(re.key,ye,`integer expected, found ${fe}`)]}}function $r(c){const s=(c.expressionContext==="property"?r0:p5)(zr(c.value),c.valueSpec);if(s.result==="error")return s.value.map(y=>new it(`${c.key}${y.key}`,c.value,y.message));const Q=s.value.expression||s.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!Q.outputDefined())return[new it(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!E6(Q))return[new it(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!E6(Q))return[new it(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!l5(Q,["zoom","feature-state"]))return[new it(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!s5(Q))return[new it(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function B6(c){const s=c.key,Q=c.value,y=c.valueSpec,x=[];return Array.isArray(y.values)?y.values.indexOf(Y1(Q))===-1&&x.push(new it(s,Q,`expected one of [${y.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(y.values).indexOf(Y1(Q))===-1&&x.push(new it(s,Q,`expected one of [${Object.keys(y.values).join(", ")}], ${JSON.stringify(Q)} found`)),x}function Nn(c){return k6(zr(c.value))?$r(c3({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):u9(c)}function u9(c){const s=c.value,Q=c.key;if(m1(s)!=="array")return[new it(Q,s,`array expected, ${m1(s)} found`)];const y=c.styleSpec;let x,C=[];if(s.length<1)return[new it(Q,s,"filter array must have at least 1 element")];switch(C=C.concat(B6({key:`${Q}[0]`,value:s[0],valueSpec:y.filter_operator,style:c.style,styleSpec:c.styleSpec})),Y1(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&Y1(s[1])==="$type"&&C.push(new it(Q,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":s.length!==3&&C.push(new it(Q,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(x=m1(s[1]),x!=="string"&&C.push(new it(`${Q}[1]`,s[1],`string expected, ${x} found`)));for(let S=2;S<s.length;S++)x=m1(s[S]),Y1(s[1])==="$type"?C=C.concat(B6({key:`${Q}[${S}]`,value:s[S],valueSpec:y.geometry_type,style:c.style,styleSpec:c.styleSpec})):x!=="string"&&x!=="number"&&x!=="boolean"&&C.push(new it(`${Q}[${S}]`,s[S],`string, number, or boolean expected, ${x} found`));break;case"any":case"all":case"none":for(let S=1;S<s.length;S++)C=C.concat(u9({key:`${Q}[${S}]`,value:s[S],style:c.style,styleSpec:c.styleSpec}));break;case"has":case"!has":x=m1(s[1]),s.length!==2?C.push(new it(Q,s,`filter array for "${s[0]}" operator must have 2 elements`)):x!=="string"&&C.push(new it(`${Q}[1]`,s[1],`string expected, ${x} found`));break;case"within":x=m1(s[1]),s.length!==2?C.push(new it(Q,s,`filter array for "${s[0]}" operator must have 2 elements`)):x!=="object"&&C.push(new it(`${Q}[1]`,s[1],`object expected, ${x} found`))}return C}function Q9(c,s){const Q=c.key,y=c.validateSpec,x=c.style,C=c.styleSpec,S=c.value,O=c.objectKey,B=C[`${s}_${c.layerType}`];if(!B)return[];const j=O.match(/^(.*)-transition$/);if(s==="paint"&&j&&B[j[1]]&&B[j[1]].transition)return y({key:Q,value:S,valueSpec:C.transition,style:x,styleSpec:C});const q=c.valueSpec||B[O];if(!q)return[new it(Q,S,`unknown property "${O}"`)];let X;if(m1(S)==="string"&&In(q)&&!q.tokens&&(X=/^{([^}]+)}$/.exec(S)))return[new it(Q,S,`"${O}" does not support interpolation syntax
15
+ `,ES=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function VS(e){const t=window.getComputedStyle(e),r=t.getPropertyValue("box-sizing"),n=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),i=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:ES.map(u=>`${u}:${t.getPropertyValue(u)}`).join(";"),paddingSize:n,borderSize:i,boxSizing:r}}function rp(e,t=1,r){var n;L4||(L4=document.createElement("textarea"),document.body.appendChild(L4));const{paddingSize:i,borderSize:a,boxSizing:u,contextStyle:o}=VS(e);L4.setAttribute("style",`${o};${SS}`),L4.value=e.value||e.placeholder||"";let f=L4.scrollHeight;const h={};u==="border-box"?f=f+a:u==="content-box"&&(f=f-i),L4.value="";const p=L4.scrollHeight-i;if(A2(t)){let m=p*t;u==="border-box"&&(m=m+i+a),f=Math.max(m,f),h.minHeight=`${m}px`}if(A2(r)){let m=p*r;u==="border-box"&&(m=m+i+a),f=Math.min(m,f)}return h.height=`${f}px`,(n=L4.parentNode)==null||n.removeChild(L4),L4=void 0,h}const DS=S1({id:{type:String,default:void 0},size:a6,disabled:Boolean,modelValue:{type:r1([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:r1([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:ln},prefixIcon:{type:ln},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:r1([Object,Array,String]),default:()=>ti({})},autofocus:{type:Boolean,default:!1}}),OS={[f2]:e=>C2(e),input:e=>C2(e),change:e=>C2(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},kS=["role"],PS=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],IS=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],BS=T.defineComponent({name:"ElInput",inheritAttrs:!1}),NS=T.defineComponent({...BS,props:DS,emits:OS,setup(e,{expose:t,emit:r}){const n=e,i=T.useAttrs(),a=T.useSlots(),u=T.computed(()=>{const et={};return n.containerRole==="combobox"&&(et["aria-haspopup"]=i["aria-haspopup"],et["aria-owns"]=i["aria-owns"],et["aria-expanded"]=i["aria-expanded"]),et}),o=T.computed(()=>[n.type==="textarea"?E.b():w.b(),w.m(v.value),w.is("disabled",b.value),w.is("exceed",yt.value),{[w.b("group")]:a.prepend||a.append,[w.bm("group","append")]:a.append,[w.bm("group","prepend")]:a.prepend,[w.m("prefix")]:a.prefix||n.prefixIcon,[w.m("suffix")]:a.suffix||n.suffixIcon||n.clearable||n.showPassword,[w.bm("suffix","password-clear")]:Ie.value&&Xe.value},i.class]),f=T.computed(()=>[w.e("wrapper"),w.is("focus",ie.value)]),h=tA({excludeKeys:T.computed(()=>Object.keys(u.value))}),{form:p,formItem:m}=Qn(),{inputId:g}=na(n,{formItemContext:m}),v=un(),b=ci(),w=Jt("input"),E=Jt("textarea"),H=T.shallowRef(),V=T.shallowRef(),I=T.ref(!1),N=T.ref(!1),R=T.ref(!1),z=T.ref(),Z=T.shallowRef(n.inputStyle),K=T.computed(()=>H.value||V.value),{wrapperRef:ee,isFocused:ie,handleFocus:de,handleBlur:ge}=ep(K,{afterBlur(){var et;n.validateEvent&&((et=m==null?void 0:m.validate)==null||et.call(m,"blur").catch(Rt=>S2(Rt)))}}),Ce=T.computed(()=>{var et;return(et=p==null?void 0:p.statusIcon)!=null?et:!1}),Re=T.computed(()=>(m==null?void 0:m.validateState)||""),Ze=T.computed(()=>Re.value&&pf[Re.value]),tt=T.computed(()=>R.value?ZC:FC),Ee=T.computed(()=>[i.style,n.inputStyle]),Ye=T.computed(()=>[n.inputStyle,Z.value,{resize:n.resize}]),Pt=T.computed(()=>an(n.modelValue)?"":String(n.modelValue)),Ie=T.computed(()=>n.clearable&&!b.value&&!n.readonly&&!!Pt.value&&(ie.value||I.value)),Xe=T.computed(()=>n.showPassword&&!b.value&&!n.readonly&&!!Pt.value&&(!!Pt.value||ie.value)),Tt=T.computed(()=>n.showWordLimit&&!!h.value.maxlength&&(n.type==="text"||n.type==="textarea")&&!b.value&&!n.readonly&&!n.showPassword),Je=T.computed(()=>Pt.value.length),yt=T.computed(()=>!!Tt.value&&Je.value>Number(h.value.maxlength)),At=T.computed(()=>!!a.suffix||!!n.suffixIcon||Ie.value||n.showPassword||Tt.value||!!Re.value&&Ce.value),[Et,Ve]=vS(H);j0(V,et=>{if(ze(),!Tt.value||n.resize!=="both")return;const Rt=et[0],{width:d1}=Rt.contentRect;z.value={right:`calc(100% - ${d1+15+6}px)`}});const Ne=()=>{const{type:et,autosize:Rt}=n;if(!(!M2||et!=="textarea"||!V.value))if(Rt){const d1=i3(Rt)?Rt.minRows:void 0,r2=i3(Rt)?Rt.maxRows:void 0,R2=rp(V.value,d1,r2);Z.value={overflowY:"hidden",...R2},T.nextTick(()=>{V.value.offsetHeight,Z.value=R2})}else Z.value={minHeight:rp(V.value).minHeight}},ze=(et=>{let Rt=!1;return()=>{var d1;if(Rt||!n.autosize)return;((d1=V.value)==null?void 0:d1.offsetParent)===null||(et(),Rt=!0)}})(Ne),Ke=()=>{const et=K.value,Rt=n.formatter?n.formatter(Pt.value):Pt.value;!et||et.value===Rt||(et.value=Rt)},gt=async et=>{Et();let{value:Rt}=et.target;if(n.formatter&&(Rt=n.parser?n.parser(Rt):Rt),!N.value){if(Rt===Pt.value){Ke();return}r(f2,Rt),r("input",Rt),await T.nextTick(),Ke(),Ve()}},pt=et=>{r("change",et.target.value)},mt=et=>{r("compositionstart",et),N.value=!0},Ht=et=>{var Rt;r("compositionupdate",et);const d1=(Rt=et.target)==null?void 0:Rt.value,r2=d1[d1.length-1]||"";N.value=!mf(r2)},Wt=et=>{r("compositionend",et),N.value&&(N.value=!1,gt(et))},_1=()=>{R.value=!R.value,t1()},t1=async()=>{var et;await T.nextTick(),(et=K.value)==null||et.focus()},V1=()=>{var et;return(et=K.value)==null?void 0:et.blur()},Pe=et=>{I.value=!1,r("mouseleave",et)},v1=et=>{I.value=!0,r("mouseenter",et)},P1=et=>{r("keydown",et)},Q1=()=>{var et;(et=K.value)==null||et.select()},Xt=()=>{r(f2,""),r("change",""),r("clear"),r("input","")};return T.watch(()=>n.modelValue,()=>{var et;T.nextTick(()=>Ne()),n.validateEvent&&((et=m==null?void 0:m.validate)==null||et.call(m,"change").catch(Rt=>S2(Rt)))}),T.watch(Pt,()=>Ke()),T.watch(()=>n.type,async()=>{await T.nextTick(),Ke(),Ne()}),T.onMounted(()=>{!n.formatter&&n.parser&&S2("ElInput","If you set the parser, you also need to set the formatter."),Ke(),T.nextTick(Ne)}),t({input:H,textarea:V,ref:K,textareaStyle:Ye,autosize:T.toRef(n,"autosize"),focus:t1,blur:V1,select:Q1,clear:Xt,resizeTextarea:Ne}),(et,Rt)=>T.withDirectives((T.openBlock(),T.createElementBlock("div",T.mergeProps(T.unref(u),{class:T.unref(o),style:T.unref(Ee),role:et.containerRole,onMouseenter:v1,onMouseleave:Pe}),[T.createCommentVNode(" input "),et.type!=="textarea"?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createCommentVNode(" prepend slot "),et.$slots.prepend?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(T.unref(w).be("group","prepend"))},[T.renderSlot(et.$slots,"prepend")],2)):T.createCommentVNode("v-if",!0),T.createElementVNode("div",{ref_key:"wrapperRef",ref:ee,class:T.normalizeClass(T.unref(f))},[T.createCommentVNode(" prefix slot "),et.$slots.prefix||et.prefixIcon?(T.openBlock(),T.createElementBlock("span",{key:0,class:T.normalizeClass(T.unref(w).e("prefix"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w).e("prefix-inner"))},[T.renderSlot(et.$slots,"prefix"),et.prefixIcon?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(w).e("icon"))},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(et.prefixIcon)))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0)],2)],2)):T.createCommentVNode("v-if",!0),T.createElementVNode("input",T.mergeProps({id:T.unref(g),ref_key:"input",ref:H,class:T.unref(w).e("inner")},T.unref(h),{type:et.showPassword?R.value?"text":"password":et.type,disabled:T.unref(b),formatter:et.formatter,parser:et.parser,readonly:et.readonly,autocomplete:et.autocomplete,tabindex:et.tabindex,"aria-label":et.label,placeholder:et.placeholder,style:et.inputStyle,form:n.form,autofocus:n.autofocus,onCompositionstart:mt,onCompositionupdate:Ht,onCompositionend:Wt,onInput:gt,onFocus:Rt[0]||(Rt[0]=(...d1)=>T.unref(de)&&T.unref(de)(...d1)),onBlur:Rt[1]||(Rt[1]=(...d1)=>T.unref(ge)&&T.unref(ge)(...d1)),onChange:pt,onKeydown:P1}),null,16,PS),T.createCommentVNode(" suffix slot "),T.unref(At)?(T.openBlock(),T.createElementBlock("span",{key:1,class:T.normalizeClass(T.unref(w).e("suffix"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w).e("suffix-inner"))},[!T.unref(Ie)||!T.unref(Xe)||!T.unref(Tt)?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.renderSlot(et.$slots,"suffix"),et.suffixIcon?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(w).e("icon"))},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(et.suffixIcon)))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0)],64)):T.createCommentVNode("v-if",!0),T.unref(Ie)?(T.openBlock(),T.createBlock(T.unref(U2),{key:1,class:T.normalizeClass([T.unref(w).e("icon"),T.unref(w).e("clear")]),onMousedown:T.withModifiers(T.unref(B5),["prevent"]),onClick:Xt},{default:T.withCtx(()=>[T.createVNode(T.unref(Lc))]),_:1},8,["class","onMousedown"])):T.createCommentVNode("v-if",!0),T.unref(Xe)?(T.openBlock(),T.createBlock(T.unref(U2),{key:2,class:T.normalizeClass([T.unref(w).e("icon"),T.unref(w).e("password")]),onClick:_1},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(T.unref(tt))))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0),T.unref(Tt)?(T.openBlock(),T.createElementBlock("span",{key:3,class:T.normalizeClass(T.unref(w).e("count"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w).e("count-inner"))},T.toDisplayString(T.unref(Je))+" / "+T.toDisplayString(T.unref(h).maxlength),3)],2)):T.createCommentVNode("v-if",!0),T.unref(Re)&&T.unref(Ze)&&T.unref(Ce)?(T.openBlock(),T.createBlock(T.unref(U2),{key:4,class:T.normalizeClass([T.unref(w).e("icon"),T.unref(w).e("validateIcon"),T.unref(w).is("loading",T.unref(Re)==="validating")])},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(T.unref(Ze))))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0)],2)],2)):T.createCommentVNode("v-if",!0)],2),T.createCommentVNode(" append slot "),et.$slots.append?(T.openBlock(),T.createElementBlock("div",{key:1,class:T.normalizeClass(T.unref(w).be("group","append"))},[T.renderSlot(et.$slots,"append")],2)):T.createCommentVNode("v-if",!0)],64)):(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[T.createCommentVNode(" textarea "),T.createElementVNode("textarea",T.mergeProps({id:T.unref(g),ref_key:"textarea",ref:V,class:T.unref(E).e("inner")},T.unref(h),{tabindex:et.tabindex,disabled:T.unref(b),readonly:et.readonly,autocomplete:et.autocomplete,style:T.unref(Ye),"aria-label":et.label,placeholder:et.placeholder,form:n.form,autofocus:n.autofocus,onCompositionstart:mt,onCompositionupdate:Ht,onCompositionend:Wt,onInput:gt,onFocus:Rt[2]||(Rt[2]=(...d1)=>T.unref(de)&&T.unref(de)(...d1)),onBlur:Rt[3]||(Rt[3]=(...d1)=>T.unref(ge)&&T.unref(ge)(...d1)),onChange:pt,onKeydown:P1}),null,16,IS),T.unref(Tt)?(T.openBlock(),T.createElementBlock("span",{key:0,style:T.normalizeStyle(z.value),class:T.normalizeClass(T.unref(w).e("count"))},T.toDisplayString(T.unref(Je))+" / "+T.toDisplayString(T.unref(h).maxlength),7)):T.createCommentVNode("v-if",!0)],64))],16,kS)),[[T.vShow,et.type!=="hidden"]])}});var FS=e1(NS,[["__file","input.vue"]]);const ls=g3(FS),ui=4,RS={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},jS=({move:e,size:t,bar:r})=>({[r.size]:t,transform:`translate${r.axis}(${e}%)`}),np=Symbol("scrollbarContextKey"),zS=S1({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),$S="Thumb";var ip=e1(T.defineComponent({__name:"thumb",props:zS,setup(e){const t=e,r=T.inject(np),n=Jt("scrollbar");r||HC($S,"can not inject scrollbar context");const i=T.ref(),a=T.ref(),u=T.ref({}),o=T.ref(!1);let f=!1,h=!1,p=M2?document.onselectstart:null;const m=T.computed(()=>RS[t.vertical?"vertical":"horizontal"]),g=T.computed(()=>jS({size:t.size,move:t.move,bar:m.value})),v=T.computed(()=>i.value[m.value.offset]**2/r.wrapElement[m.value.scrollSize]/t.ratio/a.value[m.value.offset]),b=z=>{var Z;if(z.stopPropagation(),z.ctrlKey||[1,2].includes(z.button))return;(Z=window.getSelection())==null||Z.removeAllRanges(),E(z);const K=z.currentTarget;K&&(u.value[m.value.axis]=K[m.value.offset]-(z[m.value.client]-K.getBoundingClientRect()[m.value.direction]))},w=z=>{if(!a.value||!i.value||!r.wrapElement)return;const Z=Math.abs(z.target.getBoundingClientRect()[m.value.direction]-z[m.value.client]),K=a.value[m.value.offset]/2,ee=(Z-K)*100*v.value/i.value[m.value.offset];r.wrapElement[m.value.scroll]=ee*r.wrapElement[m.value.scrollSize]/100},E=z=>{z.stopImmediatePropagation(),f=!0,document.addEventListener("mousemove",H),document.addEventListener("mouseup",V),p=document.onselectstart,document.onselectstart=()=>!1},H=z=>{if(!i.value||!a.value||f===!1)return;const Z=u.value[m.value.axis];if(!Z)return;const K=(i.value.getBoundingClientRect()[m.value.direction]-z[m.value.client])*-1,ee=a.value[m.value.offset]-Z,ie=(K-ee)*100*v.value/i.value[m.value.offset];r.wrapElement[m.value.scroll]=ie*r.wrapElement[m.value.scrollSize]/100},V=()=>{f=!1,u.value[m.value.axis]=0,document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",V),R(),h&&(o.value=!1)},I=()=>{h=!1,o.value=!!t.size},N=()=>{h=!0,o.value=f};T.onBeforeUnmount(()=>{R(),document.removeEventListener("mouseup",V)});const R=()=>{document.onselectstart!==p&&(document.onselectstart=p)};return rn(T.toRef(r,"scrollbarElement"),"mousemove",I),rn(T.toRef(r,"scrollbarElement"),"mouseleave",N),(z,Z)=>(T.openBlock(),T.createBlock(T.Transition,{name:T.unref(n).b("fade"),persisted:""},{default:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{ref_key:"instance",ref:i,class:T.normalizeClass([T.unref(n).e("bar"),T.unref(n).is(T.unref(m).key)]),onMousedown:w},[T.createElementVNode("div",{ref_key:"thumb",ref:a,class:T.normalizeClass(T.unref(n).e("thumb")),style:T.normalizeStyle(T.unref(g)),onMousedown:b},null,38)],34),[[T.vShow,z.always||o.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const ZS=S1({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}});var qS=e1(T.defineComponent({__name:"bar",props:ZS,setup(e,{expose:t}){const r=e,n=T.ref(0),i=T.ref(0);return t({handleScroll:u=>{if(u){const o=u.offsetHeight-ui,f=u.offsetWidth-ui;i.value=u.scrollTop*100/o*r.ratioY,n.value=u.scrollLeft*100/f*r.ratioX}}}),(u,o)=>(T.openBlock(),T.createElementBlock(T.Fragment,null,[T.createVNode(ip,{move:n.value,ratio:u.ratioX,size:u.width,always:u.always},null,8,["move","ratio","size","always"]),T.createVNode(ip,{move:i.value,ratio:u.ratioY,size:u.height,vertical:"",always:u.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const GS=S1({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:r1([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),US={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(A2)},Nc="ElScrollbar",WS=T.defineComponent({name:Nc}),XS=T.defineComponent({...WS,props:GS,emits:US,setup(e,{expose:t,emit:r}){const n=e,i=Jt("scrollbar");let a,u;const o=T.ref(),f=T.ref(),h=T.ref(),p=T.ref("0"),m=T.ref("0"),g=T.ref(),v=T.ref(1),b=T.ref(1),w=T.computed(()=>{const Z={};return n.height&&(Z.height=ei(n.height)),n.maxHeight&&(Z.maxHeight=ei(n.maxHeight)),[n.wrapStyle,Z]}),E=T.computed(()=>[n.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!n.native}]),H=T.computed(()=>[i.e("view"),n.viewClass]),V=()=>{var Z;f.value&&((Z=g.value)==null||Z.handleScroll(f.value),r("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function I(Z,K){i3(Z)?f.value.scrollTo(Z):A2(Z)&&A2(K)&&f.value.scrollTo(Z,K)}const N=Z=>{if(!A2(Z)){S2(Nc,"value must be a number");return}f.value.scrollTop=Z},R=Z=>{if(!A2(Z)){S2(Nc,"value must be a number");return}f.value.scrollLeft=Z},z=()=>{if(!f.value)return;const Z=f.value.offsetHeight-ui,K=f.value.offsetWidth-ui,ee=Z**2/f.value.scrollHeight,ie=K**2/f.value.scrollWidth,de=Math.max(ee,n.minSize),ge=Math.max(ie,n.minSize);v.value=ee/(Z-ee)/(de/(Z-de)),b.value=ie/(K-ie)/(ge/(K-ge)),m.value=de+ui<Z?`${de}px`:"",p.value=ge+ui<K?`${ge}px`:""};return T.watch(()=>n.noresize,Z=>{Z?(a==null||a(),u==null||u()):({stop:a}=j0(h,z),u=rn("resize",z))},{immediate:!0}),T.watch(()=>[n.maxHeight,n.height],()=>{n.native||T.nextTick(()=>{var Z;z(),f.value&&((Z=g.value)==null||Z.handleScroll(f.value))})}),T.provide(np,T.reactive({scrollbarElement:o,wrapElement:f})),T.onMounted(()=>{n.native||T.nextTick(()=>{z()})}),T.onUpdated(()=>z()),t({wrapRef:f,update:z,scrollTo:I,setScrollTop:N,setScrollLeft:R,handleScroll:V}),(Z,K)=>(T.openBlock(),T.createElementBlock("div",{ref_key:"scrollbarRef",ref:o,class:T.normalizeClass(T.unref(i).b())},[T.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:T.normalizeClass(T.unref(E)),style:T.normalizeStyle(T.unref(w)),onScroll:V},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(Z.tag),{id:Z.id,ref_key:"resizeRef",ref:h,class:T.normalizeClass(T.unref(H)),style:T.normalizeStyle(Z.viewStyle),role:Z.role,"aria-label":Z.ariaLabel,"aria-orientation":Z.ariaOrientation},{default:T.withCtx(()=>[T.renderSlot(Z.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),Z.native?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createBlock(qS,{key:0,ref_key:"barRef",ref:g,height:m.value,width:p.value,always:Z.always,"ratio-x":b.value,"ratio-y":v.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var KS=e1(XS,[["__file","scrollbar.vue"]]);const JS=g3(KS),Fc=Symbol("popper"),ap=Symbol("popperContent"),op=S1({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),YS=T.defineComponent({name:"ElPopper",inheritAttrs:!1}),eE=T.defineComponent({...YS,props:op,setup(e,{expose:t}){const r=e,n=T.ref(),i=T.ref(),a=T.ref(),u=T.ref(),o=T.computed(()=>r.role),f={triggerRef:n,popperInstanceRef:i,contentRef:a,referenceRef:u,role:o};return t(f),T.provide(Fc,f),(h,p)=>T.renderSlot(h.$slots,"default")}});var tE=e1(eE,[["__file","popper.vue"]]);const sp=S1({arrowOffset:{type:Number,default:5}}),rE=T.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),nE=T.defineComponent({...rE,props:sp,setup(e,{expose:t}){const r=e,n=Jt("popper"),{arrowOffset:i,arrowRef:a,arrowStyle:u}=T.inject(ap,void 0);return T.watch(()=>r.arrowOffset,o=>{i.value=o}),T.onBeforeUnmount(()=>{a.value=void 0}),t({arrowRef:a}),(o,f)=>(T.openBlock(),T.createElementBlock("span",{ref_key:"arrowRef",ref:a,class:T.normalizeClass(T.unref(n).e("arrow")),style:T.normalizeStyle(T.unref(u)),"data-popper-arrow":""},null,6))}});var iE=e1(nE,[["__file","arrow.vue"]]);const Rc="ElOnlyChild",aE=T.defineComponent({name:Rc,setup(e,{slots:t,attrs:r}){var n;const i=T.inject(Uf),a=_S((n=i==null?void 0:i.setForwardRef)!=null?n:B5);return()=>{var u;const o=(u=t.default)==null?void 0:u.call(t,r);if(!o)return null;if(o.length>1)return S2(Rc,"requires exact only one valid child."),null;const f=lp(o);return f?T.withDirectives(T.cloneVNode(f,r),[[a]]):(S2(Rc,"no valid child node found"),null)}}});function lp(e){if(!e)return null;const t=e;for(const r of t){if(i3(r))switch(r.type){case T.Comment:continue;case T.Text:case"svg":return cp(r);case T.Fragment:return lp(r.children);default:return r}return cp(r)}return null}function cp(e){const t=Jt("only-child");return T.createVNode("span",{class:t.e("content")},[e])}const up=S1({virtualRef:{type:r1(Object)},virtualTriggering:Boolean,onMouseenter:{type:r1(Function)},onMouseleave:{type:r1(Function)},onClick:{type:r1(Function)},onKeydown:{type:r1(Function)},onFocus:{type:r1(Function)},onBlur:{type:r1(Function)},onContextmenu:{type:r1(Function)},id:String,open:Boolean}),oE=T.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),sE=T.defineComponent({...oE,props:up,setup(e,{expose:t}){const r=e,{role:n,triggerRef:i}=T.inject(Fc,void 0);gS(i);const a=T.computed(()=>o.value?r.id:void 0),u=T.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),o=T.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),f=T.computed(()=>o.value?`${r.open}`:void 0);let h;return T.onMounted(()=>{T.watch(()=>r.virtualRef,p=>{p&&(i.value=tn(p))},{immediate:!0}),T.watch(i,(p,m)=>{h==null||h(),h=void 0,Z5(p)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(g=>{var v;const b=r[g];b&&(p.addEventListener(g.slice(2).toLowerCase(),b),(v=m==null?void 0:m.removeEventListener)==null||v.call(m,g.slice(2).toLowerCase(),b))}),h=T.watch([a,u,o,f],g=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((v,b)=>{an(g[b])?p.removeAttribute(v):p.setAttribute(v,g[b])})},{immediate:!0})),Z5(m)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(g=>m.removeAttribute(g))},{immediate:!0})}),T.onBeforeUnmount(()=>{h==null||h(),h=void 0}),t({triggerRef:i}),(p,m)=>p.virtualTriggering?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createBlock(T.unref(aE),T.mergeProps({key:0},p.$attrs,{"aria-controls":T.unref(a),"aria-describedby":T.unref(u),"aria-expanded":T.unref(f),"aria-haspopup":T.unref(o)}),{default:T.withCtx(()=>[T.renderSlot(p.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var lE=e1(sE,[["__file","trigger.vue"]]);const jc="focus-trap.focus-after-trapped",zc="focus-trap.focus-after-released",cE="focus-trap.focusout-prevented",Qp={cancelable:!0,bubbles:!1},uE={cancelable:!0,bubbles:!1},Tp="focusAfterTrapped",hp="focusAfterReleased",QE=Symbol("elFocusTrap"),$c=T.ref(),cs=T.ref(0),Zc=T.ref(0);let us=0;const dp=e=>{const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t},fp=(e,t)=>{for(const r of e)if(!TE(r,t))return r},TE=(e,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},hE=e=>{const t=dp(e),r=fp(t,e),n=fp(t.reverse(),e);return[r,n]},dE=e=>e instanceof HTMLInputElement&&"select"in e,Tn=(e,t)=>{if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),Zc.value=window.performance.now(),e!==r&&dE(e)&&t&&e.select()}};function pp(e,t){const r=[...e],n=e.indexOf(t);return n!==-1&&r.splice(n,1),r}const fE=()=>{let e=[];return{push:n=>{const i=e[0];i&&n!==i&&i.pause(),e=pp(e,n),e.unshift(n)},remove:n=>{var i,a;e=pp(e,n),(a=(i=e[0])==null?void 0:i.resume)==null||a.call(i)}}},pE=(e,t=!1)=>{const r=document.activeElement;for(const n of e)if(Tn(n,t),document.activeElement!==r)return},mp=fE(),mE=()=>cs.value>Zc.value,Qs=()=>{$c.value="pointer",cs.value=window.performance.now()},yp=()=>{$c.value="keyboard",cs.value=window.performance.now()},yE=()=>(T.onMounted(()=>{us===0&&(document.addEventListener("mousedown",Qs),document.addEventListener("touchstart",Qs),document.addEventListener("keydown",yp)),us++}),T.onBeforeUnmount(()=>{us--,us<=0&&(document.removeEventListener("mousedown",Qs),document.removeEventListener("touchstart",Qs),document.removeEventListener("keydown",yp))}),{focusReason:$c,lastUserFocusTimestamp:cs,lastAutomatedFocusTimestamp:Zc}),Ts=e=>new CustomEvent(cE,{...uE,detail:e}),gE=T.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Tp,hp,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const r=T.ref();let n,i;const{focusReason:a}=yE();dS(b=>{e.trapped&&!u.paused&&t("release-requested",b)});const u={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},o=b=>{if(!e.loop&&!e.trapped||u.paused)return;const{key:w,altKey:E,ctrlKey:H,metaKey:V,currentTarget:I,shiftKey:N}=b,{loop:R}=e,z=w===a3.tab&&!E&&!H&&!V,Z=document.activeElement;if(z&&Z){const K=I,[ee,ie]=hE(K);if(ee&&ie){if(!N&&Z===ie){const ge=Ts({focusReason:a.value});t("focusout-prevented",ge),ge.defaultPrevented||(b.preventDefault(),R&&Tn(ee,!0))}else if(N&&[ee,K].includes(Z)){const ge=Ts({focusReason:a.value});t("focusout-prevented",ge),ge.defaultPrevented||(b.preventDefault(),R&&Tn(ie,!0))}}else if(Z===K){const ge=Ts({focusReason:a.value});t("focusout-prevented",ge),ge.defaultPrevented||b.preventDefault()}}};T.provide(QE,{focusTrapRef:r,onKeydown:o}),T.watch(()=>e.focusTrapEl,b=>{b&&(r.value=b)},{immediate:!0}),T.watch([r],([b],[w])=>{b&&(b.addEventListener("keydown",o),b.addEventListener("focusin",p),b.addEventListener("focusout",m)),w&&(w.removeEventListener("keydown",o),w.removeEventListener("focusin",p),w.removeEventListener("focusout",m))});const f=b=>{t(Tp,b)},h=b=>t(hp,b),p=b=>{const w=T.unref(r);if(!w)return;const E=b.target,H=b.relatedTarget,V=E&&w.contains(E);e.trapped||H&&w.contains(H)||(n=H),V&&t("focusin",b),!u.paused&&e.trapped&&(V?i=E:Tn(i,!0))},m=b=>{const w=T.unref(r);if(!(u.paused||!w))if(e.trapped){const E=b.relatedTarget;!an(E)&&!w.contains(E)&&setTimeout(()=>{if(!u.paused&&e.trapped){const H=Ts({focusReason:a.value});t("focusout-prevented",H),H.defaultPrevented||Tn(i,!0)}},0)}else{const E=b.target;E&&w.contains(E)||t("focusout",b)}};async function g(){await T.nextTick();const b=T.unref(r);if(b){mp.push(u);const w=b.contains(document.activeElement)?n:document.activeElement;if(n=w,!b.contains(w)){const H=new Event(jc,Qp);b.addEventListener(jc,f),b.dispatchEvent(H),H.defaultPrevented||T.nextTick(()=>{let V=e.focusStartEl;C2(V)||(Tn(V),document.activeElement!==V&&(V="first")),V==="first"&&pE(dp(b),!0),(document.activeElement===w||V==="container")&&Tn(b)})}}}function v(){const b=T.unref(r);if(b){b.removeEventListener(jc,f);const w=new CustomEvent(zc,{...Qp,detail:{focusReason:a.value}});b.addEventListener(zc,h),b.dispatchEvent(w),!w.defaultPrevented&&(a.value=="keyboard"||!mE()||b.contains(document.activeElement))&&Tn(n??document.body),b.removeEventListener(zc,h),mp.remove(u)}}return T.onMounted(()=>{e.trapped&&g(),T.watch(()=>e.trapped,b=>{b?g():v()})}),T.onBeforeUnmount(()=>{e.trapped&&v()}),{onKeydown:o}}});function _E(e,t,r,n,i,a){return T.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var vE=e1(gE,[["render",_E],["__file","focus-trap.vue"]]);const xE=["fixed","absolute"],LE=S1({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:r1(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:rs,default:"bottom"},popperOptions:{type:r1(Object),default:()=>({})},strategy:{type:String,values:xE,default:"absolute"}}),gp=S1({...LE,id:String,style:{type:r1([String,Array,Object])},className:{type:r1([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:r1([String,Array,Object])},popperStyle:{type:r1([String,Array,Object])},referenceEl:{type:r1(Object)},triggerTargetEl:{type:r1(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),bE={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},wE=(e,t=[])=>{const{placement:r,strategy:n,popperOptions:i}=e,a={placement:r,strategy:n,...i,modifiers:[...ME(e),...t]};return CE(a,i==null?void 0:i.modifiers),a},HE=e=>{if(M2)return tn(e)};function ME(e){const{offset:t,gpuAcceleration:r,fallbackPlacements:n}=e;return[{name:"offset",options:{offset:[0,t??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function CE(e,t){t&&(e.modifiers=[...e.modifiers,...t??[]])}const AE=0,SE=e=>{const{popperInstanceRef:t,contentRef:r,triggerRef:n,role:i}=T.inject(Fc,void 0),a=T.ref(),u=T.ref(),o=T.computed(()=>({name:"eventListeners",enabled:!!e.visible})),f=T.computed(()=>{var H;const V=T.unref(a),I=(H=T.unref(u))!=null?H:AE;return{name:"arrow",enabled:!gC(V),options:{element:V,padding:I}}}),h=T.computed(()=>({onFirstUpdate:()=>{b()},...wE(e,[T.unref(f),T.unref(o)])})),p=T.computed(()=>HE(e.referenceEl)||T.unref(n)),{attributes:m,state:g,styles:v,update:b,forceUpdate:w,instanceRef:E}=QS(p,r,h);return T.watch(E,H=>t.value=H),T.onMounted(()=>{T.watch(()=>{var H;return(H=T.unref(p))==null?void 0:H.getBoundingClientRect()},()=>{b()})}),{attributes:m,arrowRef:a,contentRef:r,instanceRef:E,state:g,styles:v,role:i,forceUpdate:w,update:b}},EE=(e,{attributes:t,styles:r,role:n})=>{const{nextZIndex:i}=Jf(),a=Jt("popper"),u=T.computed(()=>T.unref(t).popper),o=T.ref(A2(e.zIndex)?e.zIndex:i()),f=T.computed(()=>[a.b(),a.is("pure",e.pure),a.is(e.effect),e.popperClass]),h=T.computed(()=>[{zIndex:T.unref(o)},T.unref(r).popper,e.popperStyle||{}]),p=T.computed(()=>n.value==="dialog"?"false":void 0),m=T.computed(()=>T.unref(r).arrow||{});return{ariaModal:p,arrowStyle:m,contentAttrs:u,contentClass:f,contentStyle:h,contentZIndex:o,updateZIndex:()=>{o.value=A2(e.zIndex)?e.zIndex:i()}}},VE=(e,t)=>{const r=T.ref(!1),n=T.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:h=>{var p;((p=h.detail)==null?void 0:p.focusReason)!=="pointer"&&(n.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:h=>{e.visible&&!r.value&&(h.target&&(n.value=h.target),r.value=!0)},onFocusoutPrevented:h=>{e.trapping||(h.detail.focusReason==="pointer"&&h.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,t("close")}}},DE=T.defineComponent({name:"ElPopperContent"}),OE=T.defineComponent({...DE,props:gp,emits:bE,setup(e,{expose:t,emit:r}){const n=e,{focusStartRef:i,trapped:a,onFocusAfterReleased:u,onFocusAfterTrapped:o,onFocusInTrap:f,onFocusoutPrevented:h,onReleaseRequested:p}=VE(n,r),{attributes:m,arrowRef:g,contentRef:v,styles:b,instanceRef:w,role:E,update:H}=SE(n),{ariaModal:V,arrowStyle:I,contentAttrs:N,contentClass:R,contentStyle:z,updateZIndex:Z}=EE(n,{styles:b,attributes:m,role:E}),K=T.inject(ra,void 0),ee=T.ref();T.provide(ap,{arrowStyle:I,arrowRef:g,arrowOffset:ee}),K&&(K.addInputId||K.removeInputId)&&T.provide(ra,{...K,addInputId:B5,removeInputId:B5});let ie;const de=(Ce=!0)=>{H(),Ce&&Z()},ge=()=>{de(!1),n.visible&&n.focusOnShow?a.value=!0:n.visible===!1&&(a.value=!1)};return T.onMounted(()=>{T.watch(()=>n.triggerTargetEl,(Ce,Re)=>{ie==null||ie(),ie=void 0;const Ze=T.unref(Ce||v.value),tt=T.unref(Re||v.value);Z5(Ze)&&(ie=T.watch([E,()=>n.ariaLabel,V,()=>n.id],Ee=>{["role","aria-label","aria-modal","id"].forEach((Ye,Pt)=>{an(Ee[Pt])?Ze.removeAttribute(Ye):Ze.setAttribute(Ye,Ee[Pt])})},{immediate:!0})),tt!==Ze&&Z5(tt)&&["role","aria-label","aria-modal","id"].forEach(Ee=>{tt.removeAttribute(Ee)})},{immediate:!0}),T.watch(()=>n.visible,ge,{immediate:!0})}),T.onBeforeUnmount(()=>{ie==null||ie(),ie=void 0}),t({popperContentRef:v,popperInstanceRef:w,updatePopper:de,contentStyle:z}),(Ce,Re)=>(T.openBlock(),T.createElementBlock("div",T.mergeProps({ref_key:"contentRef",ref:v},T.unref(N),{style:T.unref(z),class:T.unref(R),tabindex:"-1",onMouseenter:Re[0]||(Re[0]=Ze=>Ce.$emit("mouseenter",Ze)),onMouseleave:Re[1]||(Re[1]=Ze=>Ce.$emit("mouseleave",Ze))}),[T.createVNode(T.unref(vE),{trapped:T.unref(a),"trap-on-focus-in":!0,"focus-trap-el":T.unref(v),"focus-start-el":T.unref(i),onFocusAfterTrapped:T.unref(o),onFocusAfterReleased:T.unref(u),onFocusin:T.unref(f),onFocusoutPrevented:T.unref(h),onReleaseRequested:T.unref(p)},{default:T.withCtx(()=>[T.renderSlot(Ce.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var kE=e1(OE,[["__file","content.vue"]]);const PE=g3(tE),qc=Symbol("elTooltip"),J3=S1({...mS,...gp,appendTo:{type:r1([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:r1(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),ia=S1({...up,disabled:Boolean,trigger:{type:r1([String,Array]),default:"hover"},triggerKeys:{type:r1(Array),default:()=>[a3.enter,a3.space]}}),{useModelToggleProps:IE,useModelToggleEmits:BE,useModelToggle:NE}=vf("visible"),FE=S1({...op,...IE,...J3,...ia,...sp,showArrow:{type:Boolean,default:!0}}),RE=[...BE,"before-show","before-hide","show","hide","open","close"],jE=(e,t)=>K6(e)?e.includes(t):e===t,Qi=(e,t,r)=>n=>{jE(T.unref(e),t)&&r(n)},zE=T.defineComponent({name:"ElTooltipTrigger"}),$E=T.defineComponent({...zE,props:ia,setup(e,{expose:t}){const r=e,n=Jt("tooltip"),{controlled:i,id:a,open:u,onOpen:o,onClose:f,onToggle:h}=T.inject(qc,void 0),p=T.ref(null),m=()=>{if(T.unref(i)||r.disabled)return!0},g=T.toRef(r,"trigger"),v=mr(m,Qi(g,"hover",o)),b=mr(m,Qi(g,"hover",f)),w=mr(m,Qi(g,"click",N=>{N.button===0&&h(N)})),E=mr(m,Qi(g,"focus",o)),H=mr(m,Qi(g,"focus",f)),V=mr(m,Qi(g,"contextmenu",N=>{N.preventDefault(),h(N)})),I=mr(m,N=>{const{code:R}=N;r.triggerKeys.includes(R)&&(N.preventDefault(),h(N))});return t({triggerRef:p}),(N,R)=>(T.openBlock(),T.createBlock(T.unref(lE),{id:T.unref(a),"virtual-ref":N.virtualRef,open:T.unref(u),"virtual-triggering":N.virtualTriggering,class:T.normalizeClass(T.unref(n).e("trigger")),onBlur:T.unref(H),onClick:T.unref(w),onContextmenu:T.unref(V),onFocus:T.unref(E),onMouseenter:T.unref(v),onMouseleave:T.unref(b),onKeydown:T.unref(I)},{default:T.withCtx(()=>[T.renderSlot(N.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ZE=e1($E,[["__file","trigger.vue"]]);const qE=T.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),GE=T.defineComponent({...qE,props:J3,setup(e,{expose:t}){const r=e,{selector:n}=Gf(),i=Jt("tooltip"),a=T.ref(null),u=T.ref(!1),{controlled:o,id:f,open:h,trigger:p,onClose:m,onOpen:g,onShow:v,onHide:b,onBeforeShow:w,onBeforeHide:E}=T.inject(qc,void 0),H=T.computed(()=>r.transition||`${i.namespace.value}-fade-in-linear`),V=T.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);T.onBeforeUnmount(()=>{u.value=!0});const I=T.computed(()=>T.unref(V)?!0:T.unref(h)),N=T.computed(()=>r.disabled?!1:T.unref(h)),R=T.computed(()=>r.appendTo||n.value),z=T.computed(()=>{var Ee;return(Ee=r.style)!=null?Ee:{}}),Z=T.computed(()=>!T.unref(h)),K=()=>{b()},ee=()=>{if(T.unref(o))return!0},ie=mr(ee,()=>{r.enterable&&T.unref(p)==="hover"&&g()}),de=mr(ee,()=>{T.unref(p)==="hover"&&m()}),ge=()=>{var Ee,Ye;(Ye=(Ee=a.value)==null?void 0:Ee.updatePopper)==null||Ye.call(Ee),w==null||w()},Ce=()=>{E==null||E()},Re=()=>{v(),tt=ub(T.computed(()=>{var Ee;return(Ee=a.value)==null?void 0:Ee.popperContentRef}),()=>{if(T.unref(o))return;T.unref(p)!=="hover"&&m()})},Ze=()=>{r.virtualTriggering||m()};let tt;return T.watch(()=>T.unref(h),Ee=>{Ee||tt==null||tt()},{flush:"post"}),T.watch(()=>r.content,()=>{var Ee,Ye;(Ye=(Ee=a.value)==null?void 0:Ee.updatePopper)==null||Ye.call(Ee)}),t({contentRef:a}),(Ee,Ye)=>(T.openBlock(),T.createBlock(T.Teleport,{disabled:!Ee.teleported,to:T.unref(R)},[T.createVNode(T.Transition,{name:T.unref(H),onAfterLeave:K,onBeforeEnter:ge,onAfterEnter:Re,onBeforeLeave:Ce},{default:T.withCtx(()=>[T.unref(I)?T.withDirectives((T.openBlock(),T.createBlock(T.unref(kE),T.mergeProps({key:0,id:T.unref(f),ref_key:"contentRef",ref:a},Ee.$attrs,{"aria-label":Ee.ariaLabel,"aria-hidden":T.unref(Z),"boundaries-padding":Ee.boundariesPadding,"fallback-placements":Ee.fallbackPlacements,"gpu-acceleration":Ee.gpuAcceleration,offset:Ee.offset,placement:Ee.placement,"popper-options":Ee.popperOptions,strategy:Ee.strategy,effect:Ee.effect,enterable:Ee.enterable,pure:Ee.pure,"popper-class":Ee.popperClass,"popper-style":[Ee.popperStyle,T.unref(z)],"reference-el":Ee.referenceEl,"trigger-target-el":Ee.triggerTargetEl,visible:T.unref(N),"z-index":Ee.zIndex,onMouseenter:T.unref(ie),onMouseleave:T.unref(de),onBlur:Ze,onClose:T.unref(m)}),{default:T.withCtx(()=>[u.value?T.createCommentVNode("v-if",!0):T.renderSlot(Ee.$slots,"default",{key:0})]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[T.vShow,T.unref(N)]]):T.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"]))}});var UE=e1(GE,[["__file","content.vue"]]);const WE=["innerHTML"],XE={key:1},KE=T.defineComponent({name:"ElTooltip"}),JE=T.defineComponent({...KE,props:FE,emits:RE,setup(e,{expose:t,emit:r}){const n=e;pS();const i=ta(),a=T.ref(),u=T.ref(),o=()=>{var H;const V=T.unref(a);V&&((H=V.popperInstanceRef)==null||H.update())},f=T.ref(!1),h=T.ref(),{show:p,hide:m,hasUpdateHandler:g}=NE({indicator:f,toggleReason:h}),{onOpen:v,onClose:b}=yS({showAfter:T.toRef(n,"showAfter"),hideAfter:T.toRef(n,"hideAfter"),autoClose:T.toRef(n,"autoClose"),open:p,close:m}),w=T.computed(()=>on(n.visible)&&!g.value);T.provide(qc,{controlled:w,id:i,open:T.readonly(f),trigger:T.toRef(n,"trigger"),onOpen:H=>{v(H)},onClose:H=>{b(H)},onToggle:H=>{T.unref(f)?b(H):v(H)},onShow:()=>{r("show",h.value)},onHide:()=>{r("hide",h.value)},onBeforeShow:()=>{r("before-show",h.value)},onBeforeHide:()=>{r("before-hide",h.value)},updatePopper:o}),T.watch(()=>n.disabled,H=>{H&&f.value&&(f.value=!1)});const E=H=>{var V,I;const N=(I=(V=u.value)==null?void 0:V.contentRef)==null?void 0:I.popperContentRef,R=(H==null?void 0:H.relatedTarget)||document.activeElement;return N&&N.contains(R)};return T.onDeactivated(()=>f.value&&m()),t({popperRef:a,contentRef:u,isFocusInsideContent:E,updatePopper:o,onOpen:v,onClose:b,hide:m}),(H,V)=>(T.openBlock(),T.createBlock(T.unref(PE),{ref_key:"popperRef",ref:a,role:H.role},{default:T.withCtx(()=>[T.createVNode(ZE,{disabled:H.disabled,trigger:H.trigger,"trigger-keys":H.triggerKeys,"virtual-ref":H.virtualRef,"virtual-triggering":H.virtualTriggering},{default:T.withCtx(()=>[H.$slots.default?T.renderSlot(H.$slots,"default",{key:0}):T.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),T.createVNode(UE,{ref_key:"contentRef",ref:u,"aria-label":H.ariaLabel,"boundaries-padding":H.boundariesPadding,content:H.content,disabled:H.disabled,effect:H.effect,enterable:H.enterable,"fallback-placements":H.fallbackPlacements,"hide-after":H.hideAfter,"gpu-acceleration":H.gpuAcceleration,offset:H.offset,persistent:H.persistent,"popper-class":H.popperClass,"popper-style":H.popperStyle,placement:H.placement,"popper-options":H.popperOptions,pure:H.pure,"raw-content":H.rawContent,"reference-el":H.referenceEl,"trigger-target-el":H.triggerTargetEl,"show-after":H.showAfter,strategy:H.strategy,teleported:H.teleported,transition:H.transition,"virtual-triggering":H.virtualTriggering,"z-index":H.zIndex,"append-to":H.appendTo},{default:T.withCtx(()=>[T.renderSlot(H.$slots,"content",{},()=>[H.rawContent?(T.openBlock(),T.createElementBlock("span",{key:0,innerHTML:H.content},null,8,WE)):(T.openBlock(),T.createElementBlock("span",XE,T.toDisplayString(H.content),1))]),H.showArrow?(T.openBlock(),T.createBlock(T.unref(iE),{key:0,"arrow-offset":H.arrowOffset},null,8,["arrow-offset"])):T.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var YE=e1(JE,[["__file","tooltip.vue"]]);const Gc=g3(YE),_p=Symbol("buttonGroupContextKey"),eV=(e,t)=>{yf({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},T.computed(()=>e.type==="text"));const r=T.inject(_p,void 0),n=Ic("button"),{form:i}=Qn(),a=un(T.computed(()=>r==null?void 0:r.size)),u=ci(),o=T.ref(),f=T.useSlots(),h=T.computed(()=>e.type||(r==null?void 0:r.type)||""),p=T.computed(()=>{var b,w,E;return(E=(w=e.autoInsertSpace)!=null?w:(b=n.value)==null?void 0:b.autoInsertSpace)!=null?E:!1}),m=T.computed(()=>e.tag==="button"?{ariaDisabled:u.value||e.loading,disabled:u.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),g=T.computed(()=>{var b;const w=(b=f.default)==null?void 0:b.call(f);if(p.value&&(w==null?void 0:w.length)===1){const E=w[0];if((E==null?void 0:E.type)===T.Text){const H=E.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(H.trim())}}return!1});return{_disabled:u,_size:a,_type:h,_ref:o,_props:m,shouldAddSpace:g,handleClick:b=>{e.nativeType==="reset"&&(i==null||i.resetFields()),t("click",b)}}},Uc=S1({size:a6,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ln},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ln,default:()=>bc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:r1([String,Object]),default:"button"}}),tV={click:e=>e instanceof MouseEvent};function W2(e,t){rV(e)&&(e="100%");var r=nV(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function hs(e){return Math.min(1,Math.max(0,e))}function rV(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function nV(e){return typeof e=="string"&&e.indexOf("%")!==-1}function vp(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ds(e){return e<=1?"".concat(Number(e)*100,"%"):e}function o6(e){return e.length===1?"0"+e:String(e)}function iV(e,t,r){return{r:W2(e,255)*255,g:W2(t,255)*255,b:W2(r,255)*255}}function xp(e,t,r){e=W2(e,255),t=W2(t,255),r=W2(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=0,o=(n+i)/2;if(n===i)u=0,a=0;else{var f=n-i;switch(u=o>.5?f/(2-n-i):f/(n+i),n){case e:a=(t-r)/f+(t<r?6:0);break;case t:a=(r-e)/f+2;break;case r:a=(e-t)/f+4;break}a/=6}return{h:a,s:u,l:o}}function Wc(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function aV(e,t,r){var n,i,a;if(e=W2(e,360),t=W2(t,100),r=W2(r,100),t===0)i=r,a=r,n=r;else{var u=r<.5?r*(1+t):r+t-r*t,o=2*r-u;n=Wc(o,u,e+1/3),i=Wc(o,u,e),a=Wc(o,u,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function Lp(e,t,r){e=W2(e,255),t=W2(t,255),r=W2(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,u=n,o=n-i,f=n===0?0:o/n;if(n===i)a=0;else{switch(n){case e:a=(t-r)/o+(t<r?6:0);break;case t:a=(r-e)/o+2;break;case r:a=(e-t)/o+4;break}a/=6}return{h:a,s:f,v:u}}function oV(e,t,r){e=W2(e,360)*6,t=W2(t,100),r=W2(r,100);var n=Math.floor(e),i=e-n,a=r*(1-t),u=r*(1-i*t),o=r*(1-(1-i)*t),f=n%6,h=[r,u,a,a,o,r][f],p=[o,r,r,u,a,a][f],m=[a,a,o,r,r,u][f];return{r:h*255,g:p*255,b:m*255}}function bp(e,t,r,n){var i=[o6(Math.round(e).toString(16)),o6(Math.round(t).toString(16)),o6(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function sV(e,t,r,n,i){var a=[o6(Math.round(e).toString(16)),o6(Math.round(t).toString(16)),o6(Math.round(r).toString(16)),o6(lV(n))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function lV(e){return Math.round(parseFloat(e)*255).toString(16)}function wp(e){return Y3(e)/255}function Y3(e){return parseInt(e,16)}function cV(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Xc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function uV(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,o=!1;return typeof e=="string"&&(e=hV(e)),typeof e=="object"&&(xr(e.r)&&xr(e.g)&&xr(e.b)?(t=iV(e.r,e.g,e.b),u=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):xr(e.h)&&xr(e.s)&&xr(e.v)?(n=ds(e.s),i=ds(e.v),t=oV(e.h,n,i),u=!0,o="hsv"):xr(e.h)&&xr(e.s)&&xr(e.l)&&(n=ds(e.s),a=ds(e.l),t=aV(e.h,n,a),u=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=vp(r),{ok:u,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var QV="[-\\+]?\\d+%?",TV="[-\\+]?\\d*\\.\\d+%?",hn="(?:".concat(TV,")|(?:").concat(QV,")"),Kc="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),Jc="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),b4={CSS_UNIT:new RegExp(hn),rgb:new RegExp("rgb"+Kc),rgba:new RegExp("rgba"+Jc),hsl:new RegExp("hsl"+Kc),hsla:new RegExp("hsla"+Jc),hsv:new RegExp("hsv"+Kc),hsva:new RegExp("hsva"+Jc),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 hV(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Xc[e])e=Xc[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=b4.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=b4.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=b4.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=b4.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=b4.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=b4.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=b4.hex8.exec(e),r?{r:Y3(r[1]),g:Y3(r[2]),b:Y3(r[3]),a:wp(r[4]),format:t?"name":"hex8"}:(r=b4.hex6.exec(e),r?{r:Y3(r[1]),g:Y3(r[2]),b:Y3(r[3]),format:t?"name":"hex"}:(r=b4.hex4.exec(e),r?{r:Y3(r[1]+r[1]),g:Y3(r[2]+r[2]),b:Y3(r[3]+r[3]),a:wp(r[4]+r[4]),format:t?"name":"hex8"}:(r=b4.hex3.exec(e),r?{r:Y3(r[1]+r[1]),g:Y3(r[2]+r[2]),b:Y3(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function xr(e){return!!b4.CSS_UNIT.exec(String(e))}var dV=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=cV(t)),this.originalInput=t;var i=uV(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,i,a=t.r/255,u=t.g/255,o=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),u<=.03928?n=u/12.92:n=Math.pow((u+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=vp(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Lp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Lp(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=xp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=xp(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),bp(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sV(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(W2(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(W2(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+bp(this.r,this.g,this.b,!1),r=0,n=Object.entries(Xc);r<n.length;r++){var i=n[r],a=i[0],u=i[1];if(t===u)return a}return!1},e.prototype.toString=function(t){var r=!!t;t=t??this.format;var n=!1,i=this.a<1&&this.a>=0,a=!r&&i&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=hs(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=hs(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=hs(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=hs(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return new e(u)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,a=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,i=r.s,a=r.v,u=[],o=1/t;t--;)u.push(new e({h:n,s:i,v:a})),a=(a+o)%1;return u},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),i=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,i=[this],a=360/t,u=1;u<t;u++)i.push(new e({h:(n+u*a)%360,s:r.s,l:r.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function dn(e,t=20){return e.mix("#141414",t).toString()}function fV(e){const t=ci(),r=Jt("button");return T.computed(()=>{let n={};const i=e.color;if(i){const a=new dV(i),u=e.dark?a.tint(20).toString():dn(a,20);if(e.plain)n=r.cssVarBlock({"bg-color":e.dark?dn(a,90):a.tint(90).toString(),"text-color":i,"border-color":e.dark?dn(a,50):a.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":i,"hover-border-color":i,"active-bg-color":u,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":u}),t.value&&(n[r.cssVarBlockName("disabled-bg-color")]=e.dark?dn(a,90):a.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=e.dark?dn(a,50):a.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=e.dark?dn(a,80):a.tint(80).toString());else{const o=e.dark?dn(a,30):a.tint(30).toString(),f=a.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":i,"text-color":f,"border-color":i,"hover-bg-color":o,"hover-text-color":f,"hover-border-color":o,"active-bg-color":u,"active-border-color":u}),t.value){const h=e.dark?dn(a,50):a.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=h,n[r.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=h}}}return n})}const pV=T.defineComponent({name:"ElButton"}),mV=T.defineComponent({...pV,props:Uc,emits:tV,setup(e,{expose:t,emit:r}){const n=e,i=fV(n),a=Jt("button"),{_ref:u,_size:o,_type:f,_disabled:h,_props:p,shouldAddSpace:m,handleClick:g}=eV(n,r);return t({ref:u,size:o,type:f,disabled:h,shouldAddSpace:m}),(v,b)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(v.tag),T.mergeProps({ref_key:"_ref",ref:u},T.unref(p),{class:[T.unref(a).b(),T.unref(a).m(T.unref(f)),T.unref(a).m(T.unref(o)),T.unref(a).is("disabled",T.unref(h)),T.unref(a).is("loading",v.loading),T.unref(a).is("plain",v.plain),T.unref(a).is("round",v.round),T.unref(a).is("circle",v.circle),T.unref(a).is("text",v.text),T.unref(a).is("link",v.link),T.unref(a).is("has-bg",v.bg)],style:T.unref(i),onClick:T.unref(g)}),{default:T.withCtx(()=>[v.loading?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[v.$slots.loading?T.renderSlot(v.$slots,"loading",{key:0}):(T.openBlock(),T.createBlock(T.unref(U2),{key:1,class:T.normalizeClass(T.unref(a).is("loading"))},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(v.loadingIcon)))]),_:1},8,["class"]))],64)):v.icon||v.$slots.icon?(T.openBlock(),T.createBlock(T.unref(U2),{key:1},{default:T.withCtx(()=>[v.icon?(T.openBlock(),T.createBlock(T.resolveDynamicComponent(v.icon),{key:0})):T.renderSlot(v.$slots,"icon",{key:1})]),_:3})):T.createCommentVNode("v-if",!0),v.$slots.default?(T.openBlock(),T.createElementBlock("span",{key:2,class:T.normalizeClass({[T.unref(a).em("text","expand")]:T.unref(m)})},[T.renderSlot(v.$slots,"default")],2)):T.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var yV=e1(mV,[["__file","button.vue"]]);const gV={size:Uc.size,type:Uc.type},_V=T.defineComponent({name:"ElButtonGroup"}),vV=T.defineComponent({..._V,props:gV,setup(e){const t=e;T.provide(_p,T.reactive({size:T.toRef(t,"size"),type:T.toRef(t,"type")}));const r=Jt("button");return(n,i)=>(T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(`${T.unref(r).b("group")}`)},[T.renderSlot(n.$slots,"default")],2))}});var Hp=e1(vV,[["__file","button-group.vue"]]);const W4=g3(yV,{ButtonGroup:Hp});v4(Hp);var D=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xV(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}const fn=new Map;let Mp;M2&&(document.addEventListener("mousedown",e=>Mp=e),document.addEventListener("mouseup",e=>{for(const t of fn.values())for(const{documentHandler:r}of t)r(e,Mp)}));function Cp(e,t){let r=[];return Array.isArray(t.arg)?r=t.arg:Z5(t.arg)&&r.push(t.arg),function(n,i){const a=t.instance.popperRef,u=n.target,o=i==null?void 0:i.target,f=!t||!t.instance,h=!u||!o,p=e.contains(u)||e.contains(o),m=e===u,g=r.length&&r.some(b=>b==null?void 0:b.contains(u))||r.length&&r.includes(o),v=a&&(a.contains(u)||a.contains(o));f||h||p||m||g||v||t.value(n,i)}}const Ap={beforeMount(e,t){fn.has(e)||fn.set(e,[]),fn.get(e).push({documentHandler:Cp(e,t),bindingFn:t.value})},updated(e,t){fn.has(e)||fn.set(e,[]);const r=fn.get(e),n=r.findIndex(a=>a.bindingFn===t.oldValue),i={documentHandler:Cp(e,t),bindingFn:t.value};n>=0?r.splice(n,1,i):r.push(i)},unmounted(e){fn.delete(e)}},Sp={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:a6,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},Ep={[f2]:e=>C2(e)||A2(e)||on(e),change:e=>C2(e)||A2(e)||on(e)},Ti=Symbol("checkboxGroupContextKey"),LV=({model:e,isChecked:t})=>{const r=T.inject(Ti,void 0),n=T.computed(()=>{var a,u;const o=(a=r==null?void 0:r.max)==null?void 0:a.value,f=(u=r==null?void 0:r.min)==null?void 0:u.value;return!$5(o)&&e.value.length>=o&&!t.value||!$5(f)&&e.value.length<=f&&t.value});return{isDisabled:ci(T.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},bV=(e,{model:t,isLimitExceeded:r,hasOwnLabel:n,isDisabled:i,isLabeledByFormItem:a})=>{const u=T.inject(Ti,void 0),{formItem:o}=Qn(),{emit:f}=T.getCurrentInstance();function h(b){var w,E;return b===e.trueLabel||b===!0?(w=e.trueLabel)!=null?w:!0:(E=e.falseLabel)!=null?E:!1}function p(b,w){f("change",h(b),w)}function m(b){if(r.value)return;const w=b.target;f("change",h(w.checked),b)}async function g(b){r.value||!n.value&&!i.value&&a.value&&(b.composedPath().some(H=>H.tagName==="LABEL")||(t.value=h([!1,e.falseLabel].includes(t.value)),await T.nextTick(),p(t.value,b)))}const v=T.computed(()=>(u==null?void 0:u.validateEvent)||e.validateEvent);return T.watch(()=>e.modelValue,()=>{v.value&&(o==null||o.validate("change").catch(b=>S2(b)))}),{handleChange:m,onClickRoot:g}},wV=e=>{const t=T.ref(!1),{emit:r}=T.getCurrentInstance(),n=T.inject(Ti,void 0),i=T.computed(()=>$5(n)===!1),a=T.ref(!1);return{model:T.computed({get(){var o,f;return i.value?(o=n==null?void 0:n.modelValue)==null?void 0:o.value:(f=e.modelValue)!=null?f:t.value},set(o){var f,h;i.value&&K6(o)?(a.value=((f=n==null?void 0:n.max)==null?void 0:f.value)!==void 0&&o.length>(n==null?void 0:n.max.value),a.value===!1&&((h=n==null?void 0:n.changeEvent)==null||h.call(n,o))):(r(f2,o),t.value=o)}}),isGroup:i,isLimitExceeded:a}},HV=(e,t,{model:r})=>{const n=T.inject(Ti,void 0),i=T.ref(!1),a=T.computed(()=>{const h=r.value;return on(h)?h:K6(h)?i3(e.label)?h.map(T.toRaw).some(p=>vc(p,e.label)):h.map(T.toRaw).includes(e.label):h!=null?h===e.trueLabel:!!h}),u=un(T.computed(()=>{var h;return(h=n==null?void 0:n.size)==null?void 0:h.value}),{prop:!0}),o=un(T.computed(()=>{var h;return(h=n==null?void 0:n.size)==null?void 0:h.value})),f=T.computed(()=>!!t.default||!an(e.label));return{checkboxButtonSize:u,isChecked:a,isFocused:i,checkboxSize:o,hasOwnLabel:f}},MV=(e,{model:t})=>{function r(){K6(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&r()},Vp=(e,t)=>{const{formItem:r}=Qn(),{model:n,isGroup:i,isLimitExceeded:a}=wV(e),{isFocused:u,isChecked:o,checkboxButtonSize:f,checkboxSize:h,hasOwnLabel:p}=HV(e,t,{model:n}),{isDisabled:m}=LV({model:n,isChecked:o}),{inputId:g,isLabeledByFormItem:v}=na(e,{formItemContext:r,disableIdGeneration:p,disableIdManagement:i}),{handleChange:b,onClickRoot:w}=bV(e,{model:n,isLimitExceeded:a,hasOwnLabel:p,isDisabled:m,isLabeledByFormItem:v});return MV(e,{model:n}),{inputId:g,isLabeledByFormItem:v,isChecked:o,isDisabled:m,isFocused:u,checkboxButtonSize:f,checkboxSize:h,hasOwnLabel:p,model:n,handleChange:b,onClickRoot:w}},CV=["id","indeterminate","name","tabindex","disabled","true-value","false-value"],AV=["id","indeterminate","disabled","value","name","tabindex"],SV=T.defineComponent({name:"ElCheckbox"}),EV=T.defineComponent({...SV,props:Sp,emits:Ep,setup(e){const t=e,r=T.useSlots(),{inputId:n,isLabeledByFormItem:i,isChecked:a,isDisabled:u,isFocused:o,checkboxSize:f,hasOwnLabel:h,model:p,handleChange:m,onClickRoot:g}=Vp(t,r),v=Jt("checkbox"),b=T.computed(()=>[v.b(),v.m(f.value),v.is("disabled",u.value),v.is("bordered",t.border),v.is("checked",a.value)]),w=T.computed(()=>[v.e("input"),v.is("disabled",u.value),v.is("checked",a.value),v.is("indeterminate",t.indeterminate),v.is("focus",o.value)]);return(E,H)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(!T.unref(h)&&T.unref(i)?"span":"label"),{class:T.normalizeClass(T.unref(b)),"aria-controls":E.indeterminate?E.controls:null,onClick:T.unref(g)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(T.unref(w))},[E.trueLabel||E.falseLabel?T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:0,id:T.unref(n),"onUpdate:modelValue":H[0]||(H[0]=V=>T.isRef(p)?p.value=V:null),class:T.normalizeClass(T.unref(v).e("original")),type:"checkbox",indeterminate:E.indeterminate,name:E.name,tabindex:E.tabindex,disabled:T.unref(u),"true-value":E.trueLabel,"false-value":E.falseLabel,onChange:H[1]||(H[1]=(...V)=>T.unref(m)&&T.unref(m)(...V)),onFocus:H[2]||(H[2]=V=>o.value=!0),onBlur:H[3]||(H[3]=V=>o.value=!1),onClick:H[4]||(H[4]=T.withModifiers(()=>{},["stop"]))},null,42,CV)),[[T.vModelCheckbox,T.unref(p)]]):T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:1,id:T.unref(n),"onUpdate:modelValue":H[5]||(H[5]=V=>T.isRef(p)?p.value=V:null),class:T.normalizeClass(T.unref(v).e("original")),type:"checkbox",indeterminate:E.indeterminate,disabled:T.unref(u),value:E.label,name:E.name,tabindex:E.tabindex,onChange:H[6]||(H[6]=(...V)=>T.unref(m)&&T.unref(m)(...V)),onFocus:H[7]||(H[7]=V=>o.value=!0),onBlur:H[8]||(H[8]=V=>o.value=!1),onClick:H[9]||(H[9]=T.withModifiers(()=>{},["stop"]))},null,42,AV)),[[T.vModelCheckbox,T.unref(p)]]),T.createElementVNode("span",{class:T.normalizeClass(T.unref(v).e("inner"))},null,2)],2),T.unref(h)?(T.openBlock(),T.createElementBlock("span",{key:0,class:T.normalizeClass(T.unref(v).e("label"))},[T.renderSlot(E.$slots,"default"),E.$slots.default?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createTextVNode(T.toDisplayString(E.label),1)],64))],2)):T.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-controls","onClick"]))}});var VV=e1(EV,[["__file","checkbox.vue"]]);const DV=["name","tabindex","disabled","true-value","false-value"],OV=["name","tabindex","disabled","value"],kV=T.defineComponent({name:"ElCheckboxButton"}),PV=T.defineComponent({...kV,props:Sp,emits:Ep,setup(e){const t=e,r=T.useSlots(),{isFocused:n,isChecked:i,isDisabled:a,checkboxButtonSize:u,model:o,handleChange:f}=Vp(t,r),h=T.inject(Ti,void 0),p=Jt("checkbox"),m=T.computed(()=>{var v,b,w,E;const H=(b=(v=h==null?void 0:h.fill)==null?void 0:v.value)!=null?b:"";return{backgroundColor:H,borderColor:H,color:(E=(w=h==null?void 0:h.textColor)==null?void 0:w.value)!=null?E:"",boxShadow:H?`-1px 0 0 0 ${H}`:void 0}}),g=T.computed(()=>[p.b("button"),p.bm("button",u.value),p.is("disabled",a.value),p.is("checked",i.value),p.is("focus",n.value)]);return(v,b)=>(T.openBlock(),T.createElementBlock("label",{class:T.normalizeClass(T.unref(g))},[v.trueLabel||v.falseLabel?T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:0,"onUpdate:modelValue":b[0]||(b[0]=w=>T.isRef(o)?o.value=w:null),class:T.normalizeClass(T.unref(p).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:T.unref(a),"true-value":v.trueLabel,"false-value":v.falseLabel,onChange:b[1]||(b[1]=(...w)=>T.unref(f)&&T.unref(f)(...w)),onFocus:b[2]||(b[2]=w=>n.value=!0),onBlur:b[3]||(b[3]=w=>n.value=!1),onClick:b[4]||(b[4]=T.withModifiers(()=>{},["stop"]))},null,42,DV)),[[T.vModelCheckbox,T.unref(o)]]):T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:1,"onUpdate:modelValue":b[5]||(b[5]=w=>T.isRef(o)?o.value=w:null),class:T.normalizeClass(T.unref(p).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:T.unref(a),value:v.label,onChange:b[6]||(b[6]=(...w)=>T.unref(f)&&T.unref(f)(...w)),onFocus:b[7]||(b[7]=w=>n.value=!0),onBlur:b[8]||(b[8]=w=>n.value=!1),onClick:b[9]||(b[9]=T.withModifiers(()=>{},["stop"]))},null,42,OV)),[[T.vModelCheckbox,T.unref(o)]]),v.$slots.default||v.label?(T.openBlock(),T.createElementBlock("span",{key:2,class:T.normalizeClass(T.unref(p).be("button","inner")),style:T.normalizeStyle(T.unref(i)?T.unref(m):void 0)},[T.renderSlot(v.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(v.label),1)])],6)):T.createCommentVNode("v-if",!0)],2))}});var Dp=e1(PV,[["__file","checkbox-button.vue"]]);const IV=S1({modelValue:{type:r1(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:a6,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),BV={[f2]:e=>K6(e),change:e=>K6(e)},NV=T.defineComponent({name:"ElCheckboxGroup"}),FV=T.defineComponent({...NV,props:IV,emits:BV,setup(e,{emit:t}){const r=e,n=Jt("checkbox"),{formItem:i}=Qn(),{inputId:a,isLabeledByFormItem:u}=na(r,{formItemContext:i}),o=async h=>{t(f2,h),await T.nextTick(),t("change",h)},f=T.computed({get(){return r.modelValue},set(h){o(h)}});return T.provide(Ti,{...LC(T.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:f,changeEvent:o}),T.watch(()=>r.modelValue,()=>{r.validateEvent&&(i==null||i.validate("change").catch(h=>S2(h)))}),(h,p)=>{var m;return T.openBlock(),T.createBlock(T.resolveDynamicComponent(h.tag),{id:T.unref(a),class:T.normalizeClass(T.unref(n).b("group")),role:"group","aria-label":T.unref(u)?void 0:h.label||"checkbox-group","aria-labelledby":T.unref(u)?(m=T.unref(i))==null?void 0:m.labelId:void 0},{default:T.withCtx(()=>[T.renderSlot(h.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var Op=e1(FV,[["__file","checkbox-group.vue"]]);const fs=g3(VV,{CheckboxButton:Dp,CheckboxGroup:Op});v4(Dp);const eu=v4(Op),kp=S1({size:a6,disabled:Boolean,label:{type:[String,Number,Boolean],default:""}}),RV=S1({...kp,modelValue:{type:[String,Number,Boolean],default:""},name:{type:String,default:""},border:Boolean}),Pp={[f2]:e=>C2(e)||A2(e)||on(e),[es]:e=>C2(e)||A2(e)||on(e)},Ip=Symbol("radioGroupKey"),Bp=(e,t)=>{const r=T.ref(),n=T.inject(Ip,void 0),i=T.computed(()=>!!n),a=T.computed({get(){return i.value?n.modelValue:e.modelValue},set(p){i.value?n.changeEvent(p):t&&t(f2,p),r.value.checked=e.modelValue===e.label}}),u=un(T.computed(()=>n==null?void 0:n.size)),o=ci(T.computed(()=>n==null?void 0:n.disabled)),f=T.ref(!1),h=T.computed(()=>o.value||i.value&&a.value!==e.label?-1:0);return{radioRef:r,isGroup:i,radioGroup:n,focus:f,size:u,disabled:o,tabIndex:h,modelValue:a}},jV=["value","name","disabled"],zV=T.defineComponent({name:"ElRadio"}),$V=T.defineComponent({...zV,props:RV,emits:Pp,setup(e,{emit:t}){const r=e,n=Jt("radio"),{radioRef:i,radioGroup:a,focus:u,size:o,disabled:f,modelValue:h}=Bp(r,t);function p(){T.nextTick(()=>t("change",h.value))}return(m,g)=>{var v;return T.openBlock(),T.createElementBlock("label",{class:T.normalizeClass([T.unref(n).b(),T.unref(n).is("disabled",T.unref(f)),T.unref(n).is("focus",T.unref(u)),T.unref(n).is("bordered",m.border),T.unref(n).is("checked",T.unref(h)===m.label),T.unref(n).m(T.unref(o))])},[T.createElementVNode("span",{class:T.normalizeClass([T.unref(n).e("input"),T.unref(n).is("disabled",T.unref(f)),T.unref(n).is("checked",T.unref(h)===m.label)])},[T.withDirectives(T.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":g[0]||(g[0]=b=>T.isRef(h)?h.value=b:null),class:T.normalizeClass(T.unref(n).e("original")),value:m.label,name:m.name||((v=T.unref(a))==null?void 0:v.name),disabled:T.unref(f),type:"radio",onFocus:g[1]||(g[1]=b=>u.value=!0),onBlur:g[2]||(g[2]=b=>u.value=!1),onChange:p,onClick:g[3]||(g[3]=T.withModifiers(()=>{},["stop"]))},null,42,jV),[[T.vModelRadio,T.unref(h)]]),T.createElementVNode("span",{class:T.normalizeClass(T.unref(n).e("inner"))},null,2)],2),T.createElementVNode("span",{class:T.normalizeClass(T.unref(n).e("label")),onKeydown:g[4]||(g[4]=T.withModifiers(()=>{},["stop"]))},[T.renderSlot(m.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(m.label),1)])],34)],2)}}});var ZV=e1($V,[["__file","radio.vue"]]);const qV=S1({...kp,name:{type:String,default:""}}),GV=["value","name","disabled"],UV=T.defineComponent({name:"ElRadioButton"}),WV=T.defineComponent({...UV,props:qV,setup(e){const t=e,r=Jt("radio"),{radioRef:n,focus:i,size:a,disabled:u,modelValue:o,radioGroup:f}=Bp(t),h=T.computed(()=>({backgroundColor:(f==null?void 0:f.fill)||"",borderColor:(f==null?void 0:f.fill)||"",boxShadow:f!=null&&f.fill?`-1px 0 0 0 ${f.fill}`:"",color:(f==null?void 0:f.textColor)||""}));return(p,m)=>{var g;return T.openBlock(),T.createElementBlock("label",{class:T.normalizeClass([T.unref(r).b("button"),T.unref(r).is("active",T.unref(o)===p.label),T.unref(r).is("disabled",T.unref(u)),T.unref(r).is("focus",T.unref(i)),T.unref(r).bm("button",T.unref(a))])},[T.withDirectives(T.createElementVNode("input",{ref_key:"radioRef",ref:n,"onUpdate:modelValue":m[0]||(m[0]=v=>T.isRef(o)?o.value=v:null),class:T.normalizeClass(T.unref(r).be("button","original-radio")),value:p.label,type:"radio",name:p.name||((g=T.unref(f))==null?void 0:g.name),disabled:T.unref(u),onFocus:m[1]||(m[1]=v=>i.value=!0),onBlur:m[2]||(m[2]=v=>i.value=!1),onClick:m[3]||(m[3]=T.withModifiers(()=>{},["stop"]))},null,42,GV),[[T.vModelRadio,T.unref(o)]]),T.createElementVNode("span",{class:T.normalizeClass(T.unref(r).be("button","inner")),style:T.normalizeStyle(T.unref(o)===p.label?T.unref(h):{}),onKeydown:m[4]||(m[4]=T.withModifiers(()=>{},["stop"]))},[T.renderSlot(p.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(p.label),1)])],38)],2)}}});var Np=e1(WV,[["__file","radio-button.vue"]]);const XV=S1({id:{type:String,default:void 0},size:a6,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:""},fill:{type:String,default:""},label:{type:String,default:void 0},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0}}),KV=Pp,JV=["id","aria-label","aria-labelledby"],YV=T.defineComponent({name:"ElRadioGroup"}),eD=T.defineComponent({...YV,props:XV,emits:KV,setup(e,{emit:t}){const r=e,n=Jt("radio"),i=ta(),a=T.ref(),{formItem:u}=Qn(),{inputId:o,isLabeledByFormItem:f}=na(r,{formItemContext:u}),h=m=>{t(f2,m),T.nextTick(()=>t("change",m))};T.onMounted(()=>{const m=a.value.querySelectorAll("[type=radio]"),g=m[0];!Array.from(m).some(v=>v.checked)&&g&&(g.tabIndex=0)});const p=T.computed(()=>r.name||i.value);return T.provide(Ip,T.reactive({...T.toRefs(r),changeEvent:h,name:p})),T.watch(()=>r.modelValue,()=>{r.validateEvent&&(u==null||u.validate("change").catch(m=>S2(m)))}),(m,g)=>(T.openBlock(),T.createElementBlock("div",{id:T.unref(o),ref_key:"radioGroupRef",ref:a,class:T.normalizeClass(T.unref(n).b("group")),role:"radiogroup","aria-label":T.unref(f)?void 0:m.label||"radio-group","aria-labelledby":T.unref(f)?T.unref(u).labelId:void 0},[T.renderSlot(m.$slots,"default")],10,JV))}});var Fp=e1(eD,[["__file","radio-group.vue"]]);const Rp=g3(ZV,{RadioButton:Np,RadioGroup:Fp}),jp=v4(Fp);v4(Np);const zp=S1({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:wc,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),tD={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},rD=T.defineComponent({name:"ElTag"}),nD=T.defineComponent({...rD,props:zp,emits:tD,setup(e,{emit:t}){const r=e,n=un(),i=Jt("tag"),a=T.computed(()=>{const{type:f,hit:h,effect:p,closable:m,round:g}=r;return[i.b(),i.is("closable",m),i.m(f),i.m(n.value),i.m(p),i.is("hit",h),i.is("round",g)]}),u=f=>{t("close",f)},o=f=>{t("click",f)};return(f,h)=>f.disableTransitions?(T.openBlock(),T.createElementBlock("span",{key:0,class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle({backgroundColor:f.color}),onClick:o},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(i).e("content"))},[T.renderSlot(f.$slots,"default")],2),f.closable?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(i).e("close")),onClick:T.withModifiers(u,["stop"])},{default:T.withCtx(()=>[T.createVNode(T.unref(G5))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0)],6)):(T.openBlock(),T.createBlock(T.Transition,{key:1,name:`${T.unref(i).namespace.value}-zoom-in-center`,appear:""},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle({backgroundColor:f.color}),onClick:o},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(i).e("content"))},[T.renderSlot(f.$slots,"default")],2),f.closable?(T.openBlock(),T.createBlock(T.unref(U2),{key:0,class:T.normalizeClass(T.unref(i).e("close")),onClick:T.withModifiers(u,["stop"])},{default:T.withCtx(()=>[T.createVNode(T.unref(G5))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var iD=e1(nD,[["__file","tag.vue"]]);const aD=g3(iD),$p=Symbol("rowContextKey"),oD=S1({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),sD=T.defineComponent({name:"ElRow"}),lD=T.defineComponent({...sD,props:oD,setup(e){const t=e,r=Jt("row"),n=T.computed(()=>t.gutter);T.provide($p,{gutter:n});const i=T.computed(()=>{const u={};return t.gutter&&(u.marginRight=u.marginLeft=`-${t.gutter/2}px`),u}),a=T.computed(()=>[r.b(),r.is(`justify-${t.justify}`,t.justify!=="start"),r.is(`align-${t.align}`,!!t.align)]);return(u,o)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(u.tag),{class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle(T.unref(i))},{default:T.withCtx(()=>[T.renderSlot(u.$slots,"default")]),_:3},8,["class","style"]))}});var cD=e1(lD,[["__file","row.vue"]]);const X4=g3(cD),uD=S1({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:r1([Number,Object]),default:()=>ti({})},sm:{type:r1([Number,Object]),default:()=>ti({})},md:{type:r1([Number,Object]),default:()=>ti({})},lg:{type:r1([Number,Object]),default:()=>ti({})},xl:{type:r1([Number,Object]),default:()=>ti({})}}),QD=T.defineComponent({name:"ElCol"}),TD=T.defineComponent({...QD,props:uD,setup(e){const t=e,{gutter:r}=T.inject($p,{gutter:T.computed(()=>0)}),n=Jt("col"),i=T.computed(()=>{const u={};return r.value&&(u.paddingLeft=u.paddingRight=`${r.value/2}px`),u}),a=T.computed(()=>{const u=[];return["span","offset","pull","push"].forEach(h=>{const p=t[h];A2(p)&&(h==="span"?u.push(n.b(`${t[h]}`)):p>0&&u.push(n.b(`${h}-${t[h]}`)))}),["xs","sm","md","lg","xl"].forEach(h=>{A2(t[h])?u.push(n.b(`${h}-${t[h]}`)):i3(t[h])&&Object.entries(t[h]).forEach(([p,m])=>{u.push(p!=="span"?n.b(`${h}-${p}-${m}`):n.b(`${h}-${m}`))})}),r.value&&u.push(n.is("guttered")),[n.b(),u]});return(u,o)=>(T.openBlock(),T.createBlock(T.resolveDynamicComponent(u.tag),{class:T.normalizeClass(T.unref(a)),style:T.normalizeStyle(T.unref(i))},{default:T.withCtx(()=>[T.renderSlot(u.$slots,"default")]),_:3},8,["class","style"]))}});var hD=e1(TD,[["__file","col.vue"]]);const Lr=g3(hD),dD=T.defineComponent({name:"ElCollapseTransition"}),fD=T.defineComponent({...dD,setup(e){const t=Jt("collapse-transition"),r=i=>{i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom},n={beforeEnter(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.style.height&&(i.dataset.elExistsHeight=i.style.height),i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0},enter(i){requestAnimationFrame(()=>{i.dataset.oldOverflow=i.style.overflow,i.dataset.elExistsHeight?i.style.maxHeight=i.dataset.elExistsHeight:i.scrollHeight!==0?i.style.maxHeight=`${i.scrollHeight}px`:i.style.maxHeight=0,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom,i.style.overflow="hidden"})},afterEnter(i){i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow},enterCancelled(i){r(i)},beforeLeave(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.dataset.oldOverflow=i.style.overflow,i.style.maxHeight=`${i.scrollHeight}px`,i.style.overflow="hidden"},leave(i){i.scrollHeight!==0&&(i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0)},afterLeave(i){r(i)},leaveCancelled(i){r(i)}};return(i,a)=>(T.openBlock(),T.createBlock(T.Transition,T.mergeProps({name:T.unref(t).b()},T.toHandlers(n)),{default:T.withCtx(()=>[T.renderSlot(i.$slots,"default")]),_:3},16,["name"]))}});var ps=e1(fD,[["__file","collapse-transition.vue"]]);ps.install=e=>{e.component(ps.name,ps)};const pD=ps,mD=S1({color:{type:r1(Object),required:!0},vertical:{type:Boolean,default:!1}});let tu=!1;function aa(e,t){if(!M2)return;const r=function(a){var u;(u=t.drag)==null||u.call(t,a)},n=function(a){var u;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,tu=!1,(u=t.end)==null||u.call(t,a)},i=function(a){var u;tu||(a.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),tu=!0,(u=t.start)==null||u.call(t,a))};e.addEventListener("mousedown",i),e.addEventListener("touchstart",i)}const yD=e=>{const t=T.getCurrentInstance(),r=T.shallowRef(),n=T.shallowRef();function i(u){u.target!==r.value&&a(u)}function a(u){if(!n.value||!r.value)return;const f=t.vnode.el.getBoundingClientRect(),{clientX:h,clientY:p}=tc(u);if(e.vertical){let m=p-f.top;m=Math.max(r.value.offsetHeight/2,m),m=Math.min(m,f.height-r.value.offsetHeight/2),e.color.set("alpha",Math.round((m-r.value.offsetHeight/2)/(f.height-r.value.offsetHeight)*100))}else{let m=h-f.left;m=Math.max(r.value.offsetWidth/2,m),m=Math.min(m,f.width-r.value.offsetWidth/2),e.color.set("alpha",Math.round((m-r.value.offsetWidth/2)/(f.width-r.value.offsetWidth)*100))}}return{thumb:r,bar:n,handleDrag:a,handleClick:i}},gD=(e,{bar:t,thumb:r,handleDrag:n})=>{const i=T.getCurrentInstance(),a=Jt("color-alpha-slider"),u=T.ref(0),o=T.ref(0),f=T.ref();function h(){if(!r.value||e.vertical)return 0;const V=i.vnode.el,I=e.color.get("alpha");return V?Math.round(I*(V.offsetWidth-r.value.offsetWidth/2)/100):0}function p(){if(!r.value)return 0;const V=i.vnode.el;if(!e.vertical)return 0;const I=e.color.get("alpha");return V?Math.round(I*(V.offsetHeight-r.value.offsetHeight/2)/100):0}function m(){if(e.color&&e.color.value){const{r:V,g:I,b:N}=e.color.toRgb();return`linear-gradient(to right, rgba(${V}, ${I}, ${N}, 0) 0%, rgba(${V}, ${I}, ${N}, 1) 100%)`}return""}function g(){u.value=h(),o.value=p(),f.value=m()}T.onMounted(()=>{if(!t.value||!r.value)return;const V={drag:I=>{n(I)},end:I=>{n(I)}};aa(t.value,V),aa(r.value,V),g()}),T.watch(()=>e.color.get("alpha"),()=>g()),T.watch(()=>e.color.value,()=>g());const v=T.computed(()=>[a.b(),a.is("vertical",e.vertical)]),b=T.computed(()=>a.e("bar")),w=T.computed(()=>a.e("thumb")),E=T.computed(()=>({background:f.value})),H=T.computed(()=>({left:ei(u.value),top:ei(o.value)}));return{rootKls:v,barKls:b,barStyle:E,thumbKls:w,thumbStyle:H,update:g}},_D=T.defineComponent({name:"ElColorAlphaSlider"}),vD=T.defineComponent({..._D,props:mD,setup(e,{expose:t}){const r=e,{bar:n,thumb:i,handleDrag:a,handleClick:u}=yD(r),{rootKls:o,barKls:f,barStyle:h,thumbKls:p,thumbStyle:m,update:g}=gD(r,{bar:n,thumb:i,handleDrag:a});return t({update:g,bar:n,thumb:i}),(v,b)=>(T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(T.unref(o))},[T.createElementVNode("div",{ref_key:"bar",ref:n,class:T.normalizeClass(T.unref(f)),style:T.normalizeStyle(T.unref(h)),onClick:b[0]||(b[0]=(...w)=>T.unref(u)&&T.unref(u)(...w))},null,6),T.createElementVNode("div",{ref_key:"thumb",ref:i,class:T.normalizeClass(T.unref(p)),style:T.normalizeStyle(T.unref(m))},null,6)],2))}});var xD=e1(vD,[["__file","alpha-slider.vue"]]);const LD=T.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(e){const t=Jt("color-hue-slider"),r=T.getCurrentInstance(),n=T.ref(),i=T.ref(),a=T.ref(0),u=T.ref(0),o=T.computed(()=>e.color.get("hue"));T.watch(()=>o.value,()=>{g()});function f(v){v.target!==n.value&&h(v)}function h(v){if(!i.value||!n.value)return;const w=r.vnode.el.getBoundingClientRect(),{clientX:E,clientY:H}=tc(v);let V;if(e.vertical){let I=H-w.top;I=Math.min(I,w.height-n.value.offsetHeight/2),I=Math.max(n.value.offsetHeight/2,I),V=Math.round((I-n.value.offsetHeight/2)/(w.height-n.value.offsetHeight)*360)}else{let I=E-w.left;I=Math.min(I,w.width-n.value.offsetWidth/2),I=Math.max(n.value.offsetWidth/2,I),V=Math.round((I-n.value.offsetWidth/2)/(w.width-n.value.offsetWidth)*360)}e.color.set("hue",V)}function p(){if(!n.value)return 0;const v=r.vnode.el;if(e.vertical)return 0;const b=e.color.get("hue");return v?Math.round(b*(v.offsetWidth-n.value.offsetWidth/2)/360):0}function m(){if(!n.value)return 0;const v=r.vnode.el;if(!e.vertical)return 0;const b=e.color.get("hue");return v?Math.round(b*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function g(){a.value=p(),u.value=m()}return T.onMounted(()=>{if(!i.value||!n.value)return;const v={drag:b=>{h(b)},end:b=>{h(b)}};aa(i.value,v),aa(n.value,v),g()}),{bar:i,thumb:n,thumbLeft:a,thumbTop:u,hueValue:o,handleClick:f,update:g,ns:t}}});function bD(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass([e.ns.b(),e.ns.is("vertical",e.vertical)])},[T.createElementVNode("div",{ref:"bar",class:T.normalizeClass(e.ns.e("bar")),onClick:t[0]||(t[0]=(...u)=>e.handleClick&&e.handleClick(...u))},null,2),T.createElementVNode("div",{ref:"thumb",class:T.normalizeClass(e.ns.e("thumb")),style:T.normalizeStyle({left:e.thumbLeft+"px",top:e.thumbTop+"px"})},null,6)],2)}var wD=e1(LD,[["render",bD],["__file","hue-slider.vue"]]);const HD=S1({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:a6,popperClass:{type:String,default:""},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},predefine:{type:r1(Array)},validateEvent:{type:Boolean,default:!0}}),MD={[f2]:e=>C2(e)||an(e),[es]:e=>C2(e)||an(e),activeChange:e=>C2(e)||an(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent},Zp=Symbol("colorPickerContextKey"),qp=function(e,t,r){return[e,t*r/((e=(2-t)*r)<1?e:2-e)||0,e/2]},CD=function(e){return typeof e=="string"&&e.includes(".")&&Number.parseFloat(e)===1},AD=function(e){return typeof e=="string"&&e.includes("%")},hi=function(e,t){CD(e)&&(e="100%");const r=AD(e);return e=Math.min(t,Math.max(0,Number.parseFloat(`${e}`))),r&&(e=Number.parseInt(`${e*t}`,10)/100),Math.abs(e-t)<1e-6?1:e%t/Number.parseFloat(t)},Gp={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},ms=e=>{e=Math.min(Math.round(e),255);const t=Math.floor(e/16),r=e%16;return`${Gp[t]||t}${Gp[r]||r}`},Up=function({r:e,g:t,b:r}){return Number.isNaN(+e)||Number.isNaN(+t)||Number.isNaN(+r)?"":`#${ms(e)}${ms(t)}${ms(r)}`},ru={A:10,B:11,C:12,D:13,E:14,F:15},s6=function(e){return e.length===2?(ru[e[0].toUpperCase()]||+e[0])*16+(ru[e[1].toUpperCase()]||+e[1]):ru[e[1].toUpperCase()]||+e[1]},SD=function(e,t,r){t=t/100,r=r/100;let n=t;const i=Math.max(r,.01);r*=2,t*=r<=1?r:2-r,n*=i<=1?i:2-i;const a=(r+t)/2,u=r===0?2*n/(i+n):2*t/(r+t);return{h:e,s:u*100,v:a*100}},Wp=(e,t,r)=>{e=hi(e,255),t=hi(t,255),r=hi(r,255);const n=Math.max(e,t,r),i=Math.min(e,t,r);let a;const u=n,o=n-i,f=n===0?0:o/n;if(n===i)a=0;else{switch(n){case e:{a=(t-r)/o+(t<r?6:0);break}case t:{a=(r-e)/o+2;break}case r:{a=(e-t)/o+4;break}}a/=6}return{h:a*360,s:f*100,v:u*100}},oa=function(e,t,r){e=hi(e,360)*6,t=hi(t,100),r=hi(r,100);const n=Math.floor(e),i=e-n,a=r*(1-t),u=r*(1-i*t),o=r*(1-(1-i)*t),f=n%6,h=[r,u,a,a,o,r][f],p=[o,r,r,u,a,a][f],m=[a,a,o,r,r,u][f];return{r:Math.round(h*255),g:Math.round(p*255),b:Math.round(m*255)}};class sa{constructor(t={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in t)Kn(t,r)&&(this[r]=t[r]);t.value?this.fromString(t.value):this.doOnChange()}set(t,r){if(arguments.length===1&&typeof t=="object"){for(const n in t)Kn(t,n)&&this.set(n,t[n]);return}this[`_${t}`]=r,this.doOnChange()}get(t){return t==="alpha"?Math.floor(this[`_${t}`]):this[`_${t}`]}toRgb(){return oa(this._hue,this._saturation,this._value)}fromString(t){if(!t){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,i,a)=>{this._hue=Math.max(0,Math.min(360,n)),this._saturation=Math.max(0,Math.min(100,i)),this._value=Math.max(0,Math.min(100,a)),this.doOnChange()};if(t.includes("hsl")){const n=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,a)=>a>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:a,v:u}=SD(n[0],n[1],n[2]);r(i,a,u)}}else if(t.includes("hsv")){const n=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,a)=>a>2?Number.parseFloat(i):Number.parseInt(i,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(t.includes("rgb")){const n=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,a)=>a>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:a,v:u}=Wp(n[0],n[1],n[2]);r(i,a,u)}}else if(t.includes("#")){const n=t.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let i,a,u;n.length===3?(i=s6(n[0]+n[0]),a=s6(n[1]+n[1]),u=s6(n[2]+n[2])):(n.length===6||n.length===8)&&(i=s6(n.slice(0,2)),a=s6(n.slice(2,4)),u=s6(n.slice(4,6))),n.length===8?this._alpha=s6(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:o,s:f,v:h}=Wp(i,a,u);r(o,f,h)}}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:r,_value:n,_alpha:i,format:a}=this;if(this.enableAlpha)switch(a){case"hsl":{const u=qp(t,r/100,n/100);this.value=`hsla(${t}, ${Math.round(u[1]*100)}%, ${Math.round(u[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${t}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${Up(oa(t,r,n))}${ms(i*255/100)}`;break}default:{const{r:u,g:o,b:f}=oa(t,r,n);this.value=`rgba(${u}, ${o}, ${f}, ${this.get("alpha")/100})`}}else switch(a){case"hsl":{const u=qp(t,r/100,n/100);this.value=`hsl(${t}, ${Math.round(u[1]*100)}%, ${Math.round(u[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${t}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:u,g:o,b:f}=oa(t,r,n);this.value=`rgb(${u}, ${o}, ${f})`;break}default:this.value=Up(oa(t,r,n))}}}const ED=T.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0}},setup(e){const t=Jt("color-predefine"),{currentColor:r}=T.inject(Zp),n=T.ref(a(e.colors,e.color));T.watch(()=>r.value,u=>{const o=new sa;o.fromString(u),n.value.forEach(f=>{f.selected=o.compare(f)})}),T.watchEffect(()=>{n.value=a(e.colors,e.color)});function i(u){e.color.fromString(e.colors[u])}function a(u,o){return u.map(f=>{const h=new sa;return h.enableAlpha=!0,h.format="rgba",h.fromString(f),h.selected=h.value===o.value,h})}return{rgbaColors:n,handleSelect:i,ns:t}}}),VD=["onClick"];function DD(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(e.ns.b())},[T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("colors"))},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.rgbaColors,(u,o)=>(T.openBlock(),T.createElementBlock("div",{key:e.colors[o],class:T.normalizeClass([e.ns.e("color-selector"),e.ns.is("alpha",u._alpha<100),{selected:u.selected}]),onClick:f=>e.handleSelect(o)},[T.createElementVNode("div",{style:T.normalizeStyle({backgroundColor:u.value})},null,4)],10,VD))),128))],2)],2)}var OD=e1(ED,[["render",DD],["__file","predefine.vue"]]);const kD=T.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(e){const t=Jt("color-svpanel"),r=T.getCurrentInstance(),n=T.ref(0),i=T.ref(0),a=T.ref("hsl(0, 100%, 50%)"),u=T.computed(()=>{const h=e.color.get("hue"),p=e.color.get("value");return{hue:h,value:p}});function o(){const h=e.color.get("saturation"),p=e.color.get("value"),m=r.vnode.el,{clientWidth:g,clientHeight:v}=m;i.value=h*g/100,n.value=(100-p)*v/100,a.value=`hsl(${e.color.get("hue")}, 100%, 50%)`}function f(h){const m=r.vnode.el.getBoundingClientRect(),{clientX:g,clientY:v}=tc(h);let b=g-m.left,w=v-m.top;b=Math.max(0,b),b=Math.min(b,m.width),w=Math.max(0,w),w=Math.min(w,m.height),i.value=b,n.value=w,e.color.set({saturation:b/m.width*100,value:100-w/m.height*100})}return T.watch(()=>u.value,()=>{o()}),T.onMounted(()=>{aa(r.vnode.el,{drag:h=>{f(h)},end:h=>{f(h)}}),o()}),{cursorTop:n,cursorLeft:i,background:a,colorValue:u,handleDrag:f,update:o,ns:t}}}),PD=[T.createElementVNode("div",null,null,-1)];function ID(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass(e.ns.b()),style:T.normalizeStyle({backgroundColor:e.background})},[T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("white"))},null,2),T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("black"))},null,2),T.createElementVNode("div",{class:T.normalizeClass(e.ns.e("cursor")),style:T.normalizeStyle({top:e.cursorTop+"px",left:e.cursorLeft+"px"})},PD,6)],6)}var BD=e1(kD,[["render",ID],["__file","sv-panel.vue"]]);const ND=["onKeydown"],FD=["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex"],RD=T.defineComponent({name:"ElColorPicker"}),jD=T.defineComponent({...RD,props:HD,emits:MD,setup(e,{expose:t,emit:r}){const n=e,{t:i}=ri(),a=Jt("color"),{formItem:u}=Qn(),o=un(),f=ci(),{inputId:h,isLabeledByFormItem:p}=na(n,{formItemContext:u}),m=T.ref(),g=T.ref(),v=T.ref(),b=T.ref(),w=T.ref(),E=T.ref(),{isFocused:H,handleFocus:V,handleBlur:I}=ep(w,{beforeBlur(ze){var Ke;return(Ke=b.value)==null?void 0:Ke.isFocusInsideContent(ze)},afterBlur(){tt(!1),Ie()}}),N=ze=>{if(f.value)return ut();V(ze)};let R=!0;const z=T.reactive(new sa({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),Z=T.ref(!1),K=T.ref(!1),ee=T.ref(""),ie=T.computed(()=>!n.modelValue&&!K.value?"transparent":Ze(z,n.showAlpha)),de=T.computed(()=>!n.modelValue&&!K.value?"":z.value),ge=T.computed(()=>p.value?void 0:n.label||i("el.colorpicker.defaultLabel")),Ce=T.computed(()=>p.value?u==null?void 0:u.labelId:void 0),Re=T.computed(()=>[a.b("picker"),a.is("disabled",f.value),a.bm("picker",o.value),a.is("focused",H.value)]);function Ze(ze,Ke){if(!(ze instanceof sa))throw new TypeError("color should be instance of _color Class");const{r:gt,g:pt,b:mt}=ze.toRgb();return Ke?`rgba(${gt}, ${pt}, ${mt}, ${ze.get("alpha")/100})`:`rgb(${gt}, ${pt}, ${mt})`}function tt(ze){Z.value=ze}const Ee=_c(tt,100,{leading:!0});function Ye(){f.value||tt(!0)}function Pt(){Ee(!1),Ie()}function Ie(){T.nextTick(()=>{n.modelValue?z.fromString(n.modelValue):(z.value="",T.nextTick(()=>{K.value=!1}))})}function Xe(){f.value||Ee(!Z.value)}function Tt(){z.fromString(ee.value)}function Je(){const ze=z.value;r(f2,ze),r("change",ze),n.validateEvent&&(u==null||u.validate("change").catch(Ke=>S2(Ke))),Ee(!1),T.nextTick(()=>{const Ke=new sa({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});z.compare(Ke)||Ie()})}function yt(){Ee(!1),r(f2,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(u==null||u.validate("change").catch(ze=>S2(ze))),Ie()}function At(ze){if(Z.value&&(Pt(),H.value)){const Ke=new FocusEvent("focus",ze);I(Ke)}}function Et(ze){ze.preventDefault(),ze.stopPropagation(),tt(!1),Ie()}function Ve(ze){switch(ze.code){case a3.enter:case a3.space:ze.preventDefault(),ze.stopPropagation(),Ye(),E.value.focus();break;case a3.esc:Et(ze);break}}function Ne(){w.value.focus()}function ut(){w.value.blur()}return T.onMounted(()=>{n.modelValue&&(ee.value=de.value)}),T.watch(()=>n.modelValue,ze=>{ze?ze&&ze!==z.value&&(R=!1,z.fromString(ze)):K.value=!1}),T.watch(()=>de.value,ze=>{ee.value=ze,R&&r("activeChange",ze),R=!0}),T.watch(()=>z.value,()=>{!n.modelValue&&!K.value&&(K.value=!0)}),T.watch(()=>Z.value,()=>{T.nextTick(()=>{var ze,Ke,gt;(ze=m.value)==null||ze.update(),(Ke=g.value)==null||Ke.update(),(gt=v.value)==null||gt.update()})}),T.provide(Zp,{currentColor:de}),t({color:z,show:Ye,hide:Pt,focus:Ne,blur:ut}),(ze,Ke)=>(T.openBlock(),T.createBlock(T.unref(Gc),{ref_key:"popper",ref:b,visible:Z.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[T.unref(a).be("picker","panel"),T.unref(a).b("dropdown"),ze.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",transition:`${T.unref(a).namespace.value}-zoom-in-top`,persistent:"",onHide:Ke[2]||(Ke[2]=gt=>tt(!1))},{content:T.withCtx(()=>[T.withDirectives((T.openBlock(),T.createElementBlock("div",{onKeydown:T.withKeys(Et,["esc"])},[T.createElementVNode("div",{class:T.normalizeClass(T.unref(a).be("dropdown","main-wrapper"))},[T.createVNode(wD,{ref_key:"hue",ref:m,class:"hue-slider",color:T.unref(z),vertical:""},null,8,["color"]),T.createVNode(BD,{ref_key:"sv",ref:g,color:T.unref(z)},null,8,["color"])],2),ze.showAlpha?(T.openBlock(),T.createBlock(xD,{key:0,ref_key:"alpha",ref:v,color:T.unref(z)},null,8,["color"])):T.createCommentVNode("v-if",!0),ze.predefine?(T.openBlock(),T.createBlock(OD,{key:1,ref:"predefine",color:T.unref(z),colors:ze.predefine},null,8,["color","colors"])):T.createCommentVNode("v-if",!0),T.createElementVNode("div",{class:T.normalizeClass(T.unref(a).be("dropdown","btns"))},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(a).be("dropdown","value"))},[T.createVNode(T.unref(ls),{ref_key:"inputRef",ref:E,modelValue:ee.value,"onUpdate:modelValue":Ke[0]||(Ke[0]=gt=>ee.value=gt),"validate-event":!1,size:"small",onKeyup:T.withKeys(Tt,["enter"]),onBlur:Tt},null,8,["modelValue","onKeyup"])],2),T.createVNode(T.unref(W4),{class:T.normalizeClass(T.unref(a).be("dropdown","link-btn")),text:"",size:"small",onClick:yt},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(T.unref(i)("el.colorpicker.clear")),1)]),_:1},8,["class"]),T.createVNode(T.unref(W4),{plain:"",size:"small",class:T.normalizeClass(T.unref(a).be("dropdown","btn")),onClick:Je},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(T.unref(i)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,ND)),[[T.unref(Ap),At]])]),default:T.withCtx(()=>[T.createElementVNode("div",{id:T.unref(h),ref_key:"triggerRef",ref:w,class:T.normalizeClass(T.unref(Re)),role:"button","aria-label":T.unref(ge),"aria-labelledby":T.unref(Ce),"aria-description":T.unref(i)("el.colorpicker.description",{color:ze.modelValue||""}),"aria-disabled":T.unref(f),tabindex:T.unref(f)?-1:ze.tabindex,onKeydown:Ve,onFocus:N,onBlur:Ke[1]||(Ke[1]=(...gt)=>T.unref(I)&&T.unref(I)(...gt))},[T.unref(f)?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(T.unref(a).be("picker","mask"))},null,2)):T.createCommentVNode("v-if",!0),T.createElementVNode("div",{class:T.normalizeClass(T.unref(a).be("picker","trigger")),onClick:Xe},[T.createElementVNode("span",{class:T.normalizeClass([T.unref(a).be("picker","color"),T.unref(a).is("alpha",ze.showAlpha)])},[T.createElementVNode("span",{class:T.normalizeClass(T.unref(a).be("picker","color-inner")),style:T.normalizeStyle({backgroundColor:T.unref(ie)})},[T.withDirectives(T.createVNode(T.unref(U2),{class:T.normalizeClass([T.unref(a).be("picker","icon"),T.unref(a).is("icon-arrow-down")])},{default:T.withCtx(()=>[T.createVNode(T.unref(sn))]),_:1},8,["class"]),[[T.vShow,ze.modelValue||K.value]]),T.withDirectives(T.createVNode(T.unref(U2),{class:T.normalizeClass([T.unref(a).be("picker","empty"),T.unref(a).is("icon-close")])},{default:T.withCtx(()=>[T.createVNode(T.unref(G5))]),_:1},8,["class"]),[[T.vShow,!ze.modelValue&&!K.value]])],6)],2)],2)],42,FD)]),_:1},8,["visible","popper-class","transition"]))}});var zD=e1(jD,[["__file","color-picker.vue"]]);const $D=g3(zD),ZD=T.defineComponent({name:"ElContainer"}),qD=T.defineComponent({...ZD,props:{direction:{type:String}},setup(e){const t=e,r=T.useSlots(),n=Jt("container"),i=T.computed(()=>t.direction==="vertical"?!0:t.direction==="horizontal"?!1:r&&r.default?r.default().some(u=>{const o=u.type.name;return o==="ElHeader"||o==="ElFooter"}):!1);return(a,u)=>(T.openBlock(),T.createElementBlock("section",{class:T.normalizeClass([T.unref(n).b(),T.unref(n).is("vertical",T.unref(i))])},[T.renderSlot(a.$slots,"default")],2))}});var GD=e1(qD,[["__file","container.vue"]]);const UD=T.defineComponent({name:"ElAside"}),WD=T.defineComponent({...UD,props:{width:{type:String,default:null}},setup(e){const t=e,r=Jt("aside"),n=T.computed(()=>t.width?r.cssVarBlock({width:t.width}):{});return(i,a)=>(T.openBlock(),T.createElementBlock("aside",{class:T.normalizeClass(T.unref(r).b()),style:T.normalizeStyle(T.unref(n))},[T.renderSlot(i.$slots,"default")],6))}});var Xp=e1(WD,[["__file","aside.vue"]]);const XD=T.defineComponent({name:"ElFooter"}),KD=T.defineComponent({...XD,props:{height:{type:String,default:null}},setup(e){const t=e,r=Jt("footer"),n=T.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,a)=>(T.openBlock(),T.createElementBlock("footer",{class:T.normalizeClass(T.unref(r).b()),style:T.normalizeStyle(T.unref(n))},[T.renderSlot(i.$slots,"default")],6))}});var Kp=e1(KD,[["__file","footer.vue"]]);const JD=T.defineComponent({name:"ElHeader"}),YD=T.defineComponent({...JD,props:{height:{type:String,default:null}},setup(e){const t=e,r=Jt("header"),n=T.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,a)=>(T.openBlock(),T.createElementBlock("header",{class:T.normalizeClass(T.unref(r).b()),style:T.normalizeStyle(T.unref(n))},[T.renderSlot(i.$slots,"default")],6))}});var Jp=e1(YD,[["__file","header.vue"]]);const eO=T.defineComponent({name:"ElMain"}),tO=T.defineComponent({...eO,setup(e){const t=Jt("main");return(r,n)=>(T.openBlock(),T.createElementBlock("main",{class:T.normalizeClass(T.unref(t).b())},[T.renderSlot(r.$slots,"default")],2))}});var Yp=e1(tO,[["__file","main.vue"]]);const rO=g3(GD,{Aside:Xp,Footer:Kp,Header:Jp,Main:Yp});v4(Xp),v4(Kp),v4(Jp);const em=v4(Yp),nO=T.defineComponent({inheritAttrs:!1});function iO(e,t,r,n,i,a){return T.renderSlot(e.$slots,"default")}var aO=e1(nO,[["render",iO],["__file","collection.vue"]]);const oO=T.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function sO(e,t,r,n,i,a){return T.renderSlot(e.$slots,"default")}var lO=e1(oO,[["render",sO],["__file","collection-item.vue"]]);const cO="data-el-collection-item",uO=e=>{const t=`El${e}Collection`,r=`${t}Item`,n=Symbol(t),i=Symbol(r),a={...aO,name:t,setup(){const o=T.ref(null),f=new Map,h=()=>{const p=T.unref(o);if(!p)return[];const m=Array.from(p.querySelectorAll(`[${cO}]`));return[...f.values()].sort((v,b)=>m.indexOf(v.ref)-m.indexOf(b.ref))};T.provide(n,{itemMap:f,getItems:h,collectionRef:o})}},u={...lO,name:r,setup(o,{attrs:f}){const h=T.ref(null),p=T.inject(n,void 0);T.provide(i,{collectionItemRef:h}),T.onMounted(()=>{const m=T.unref(h);m&&p.itemMap.set(m,{ref:m,...f})}),T.onBeforeUnmount(()=>{const m=T.unref(h);p.itemMap.delete(m)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:a,ElCollectionItem:u}},nu=S1({trigger:ia.trigger,effect:{...J3.effect,default:"light"},type:{type:r1(String)},placement:{type:r1(String),default:"bottom"},popperOptions:{type:r1(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:r1([Number,String]),default:0},maxHeight:{type:r1([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:r1(Object)},teleported:J3.teleported});S1({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ln}}),S1({onKeydown:{type:r1(Function)}}),uO("Dropdown");const tm=Symbol("ElSelectGroup"),ys=Symbol("ElSelect");function QO(e,t){const r=T.inject(ys),n=T.inject(tm,{disabled:!1}),i=T.computed(()=>i3(e.value)),a=T.computed(()=>r.props.multiple?m(r.props.modelValue,e.value):g(e.value,r.props.modelValue)),u=T.computed(()=>{if(r.props.multiple){const w=r.props.modelValue||[];return!a.value&&w.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),o=T.computed(()=>e.label||(i.value?"":e.value)),f=T.computed(()=>e.value||e.label||""),h=T.computed(()=>e.disabled||t.groupDisabled||u.value),p=T.getCurrentInstance(),m=(w=[],E)=>{if(i.value){const H=r.props.valueKey;return w&&w.some(V=>T.toRaw(K3(V,H))===K3(E,H))}else return w&&w.includes(E)},g=(w,E)=>{if(i.value){const{valueKey:H}=r.props;return K3(w,H)===K3(E,H)}else return w===E},v=()=>{!e.disabled&&!n.disabled&&(r.hoverIndex=r.optionsArray.indexOf(p.proxy))};T.watch(()=>o.value,()=>{!e.created&&!r.props.remote&&r.setSelected()}),T.watch(()=>e.value,(w,E)=>{const{remote:H,valueKey:V}=r.props;if(Object.is(w,E)||(r.onOptionDestroy(E,p.proxy),r.onOptionCreate(p.proxy)),!e.created&&!H){if(V&&i3(w)&&i3(E)&&w[V]===E[V])return;r.setSelected()}}),T.watch(()=>n.disabled,()=>{t.groupDisabled=n.disabled},{immediate:!0});const{queryChange:b}=T.toRaw(r);return T.watch(b,w=>{const{query:E}=T.unref(w),H=new RegExp(wC(E),"i");t.visible=H.test(o.value)||e.created,t.visible||r.filteredOptionsCount--},{immediate:!0}),{select:r,currentLabel:o,currentValue:f,itemSelected:a,isDisabled:h,hoverItem:v}}const TO=T.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const t=Jt("select"),r=ta(),n=T.computed(()=>[t.be("dropdown","item"),t.is("disabled",T.unref(o)),{selected:T.unref(u),hover:T.unref(m)}]),i=T.reactive({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:a,itemSelected:u,isDisabled:o,select:f,hoverItem:h}=QO(e,i),{visible:p,hover:m}=T.toRefs(i),g=T.getCurrentInstance().proxy;f.onOptionCreate(g),T.onBeforeUnmount(()=>{const b=g.value,{selected:w}=f,H=(f.props.multiple?w:[w]).some(V=>V.value===g.value);T.nextTick(()=>{f.cachedOptions.get(b)===g&&!H&&f.cachedOptions.delete(b)}),f.onOptionDestroy(b,g)});function v(){e.disabled!==!0&&i.groupDisabled!==!0&&f.handleOptionSelect(g)}return{ns:t,id:r,containerKls:n,currentLabel:a,itemSelected:u,isDisabled:o,select:f,hoverItem:h,visible:p,hover:m,selectOptionClick:v,states:i}}}),hO=["id","aria-disabled","aria-selected"];function dO(e,t,r,n,i,a){return T.withDirectives((T.openBlock(),T.createElementBlock("li",{id:e.id,class:T.normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:t[0]||(t[0]=(...u)=>e.hoverItem&&e.hoverItem(...u)),onClick:t[1]||(t[1]=T.withModifiers((...u)=>e.selectOptionClick&&e.selectOptionClick(...u),["stop"]))},[T.renderSlot(e.$slots,"default",{},()=>[T.createElementVNode("span",null,T.toDisplayString(e.currentLabel),1)])],42,hO)),[[T.vShow,e.visible]])}var iu=e1(TO,[["render",dO],["__file","option.vue"]]);const fO=T.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=T.inject(ys),t=Jt("select"),r=T.computed(()=>e.props.popperClass),n=T.computed(()=>e.props.multiple),i=T.computed(()=>e.props.fitInputWidth),a=T.ref("");function u(){var o;a.value=`${(o=e.selectWrapper)==null?void 0:o.offsetWidth}px`}return T.onMounted(()=>{u(),j0(e.selectWrapper,u)}),{ns:t,minWidth:a,popperClass:r,isMultiple:n,isFitInputWidth:i}}});function pO(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",{class:T.normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:T.normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(e.ns.be("dropdown","header"))},[T.renderSlot(e.$slots,"header")],2)):T.createCommentVNode("v-if",!0),T.renderSlot(e.$slots,"default"),e.$slots.footer?(T.openBlock(),T.createElementBlock("div",{key:1,class:T.normalizeClass(e.ns.be("dropdown","footer"))},[T.renderSlot(e.$slots,"footer")],2)):T.createCommentVNode("v-if",!0)],6)}var mO=e1(fO,[["render",pO],["__file","select-dropdown.vue"]]);function yO(e){const{t}=ri();return T.reactive({options:new Map,cachedOptions:new Map,disabledOptions:new Map,createdLabel:null,createdSelected:!1,selected:e.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:t("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,prefixWidth:11,mouseEnter:!1,focused:!1})}const gO=(e,t,r)=>{const{t:n}=ri(),i=Jt("select");yf({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},T.computed(()=>e.suffixTransition===!1));const a=T.ref(null),u=T.ref(null),o=T.ref(null),f=T.ref(null),h=T.ref(null),p=T.ref(null),m=T.ref(null),g=T.ref(null),v=T.ref(),b=T.shallowRef({query:""}),w=T.shallowRef(""),E=T.ref([]);let H=0;const{form:V,formItem:I}=Qn(),N=T.computed(()=>!e.filterable||e.multiple||!t.visible),R=T.computed(()=>e.disabled||(V==null?void 0:V.disabled)),z=T.computed(()=>{const Ae=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!=="";return e.clearable&&!R.value&&t.inputHovering&&Ae}),Z=T.computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),K=T.computed(()=>i.is("reverse",Z.value&&t.visible&&e.suffixTransition)),ee=T.computed(()=>(V==null?void 0:V.statusIcon)&&(I==null?void 0:I.validateState)&&pf[I==null?void 0:I.validateState]),ie=T.computed(()=>e.remote?300:0),de=T.computed(()=>e.loading?e.loadingText||n("el.select.loading"):e.remote&&t.query===""&&t.options.size===0?!1:e.filterable&&t.query&&t.options.size>0&&t.filteredOptionsCount===0?e.noMatchText||n("el.select.noMatch"):t.options.size===0?e.noDataText||n("el.select.noData"):null),ge=T.computed(()=>{const Ae=Array.from(t.options.values()),ne=[];return E.value.forEach(U=>{const J=Ae.findIndex(oe=>oe.currentLabel===U);J>-1&&ne.push(Ae[J])}),ne.length>=Ae.length?ne:Ae}),Ce=T.computed(()=>Array.from(t.cachedOptions.values())),Re=T.computed(()=>{const Ae=ge.value.filter(ne=>!ne.created).some(ne=>ne.currentLabel===t.query);return e.filterable&&e.allowCreate&&t.query!==""&&!Ae}),Ze=un(),tt=T.computed(()=>["small"].includes(Ze.value)?"small":"default"),Ee=T.computed({get(){return t.visible&&de.value!==!1},set(Ae){t.visible=Ae}});T.watch([()=>R.value,()=>Ze.value,()=>V==null?void 0:V.size],()=>{T.nextTick(()=>{Ye()})}),T.watch(()=>e.placeholder,Ae=>{t.cachedPlaceHolder=t.currentPlaceholder=Ae,e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(t.currentPlaceholder="")}),T.watch(()=>e.modelValue,(Ae,ne)=>{e.multiple&&(Ye(),Ae&&Ae.length>0||u.value&&t.query!==""?t.currentPlaceholder="":t.currentPlaceholder=t.cachedPlaceHolder,e.filterable&&!e.reserveKeyword&&(t.query="",Pt(t.query))),Tt(),e.filterable&&!e.multiple&&(t.inputLength=20),!vc(Ae,ne)&&e.validateEvent&&(I==null||I.validate("change").catch(U=>S2(U)))},{flush:"post",deep:!0}),T.watch(()=>t.visible,Ae=>{var ne,U,J,oe,Qe;Ae?((U=(ne=f.value)==null?void 0:ne.updatePopper)==null||U.call(ne),e.filterable&&(t.filteredOptionsCount=t.optionsCount,t.query=e.remote?"":t.selectedLabel,(oe=(J=o.value)==null?void 0:J.focus)==null||oe.call(J),e.multiple?(Qe=u.value)==null||Qe.focus():t.selectedLabel&&(t.currentPlaceholder=`${t.selectedLabel}`,t.selectedLabel=""),Pt(t.query),!e.multiple&&!e.remote&&(b.value.query="",T.triggerRef(b),T.triggerRef(w)))):(e.filterable&&(X3(e.filterMethod)&&e.filterMethod(""),X3(e.remoteMethod)&&e.remoteMethod("")),t.query="",t.previousQuery=null,t.selectedLabel="",t.inputLength=20,t.menuVisibleOnFocus=!1,yt(),T.nextTick(()=>{u.value&&u.value.value===""&&t.selected.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}),e.multiple||(t.selected&&(e.filterable&&e.allowCreate&&t.createdSelected&&t.createdLabel?t.selectedLabel=t.createdLabel:t.selectedLabel=t.selected.currentLabel,e.filterable&&(t.query=t.selectedLabel)),e.filterable&&(t.currentPlaceholder=t.cachedPlaceHolder))),r.emit("visible-change",Ae)}),T.watch(()=>t.options.entries(),()=>{var Ae,ne,U;if(!M2)return;(ne=(Ae=f.value)==null?void 0:Ae.updatePopper)==null||ne.call(Ae),e.multiple&&Ye();const J=((U=m.value)==null?void 0:U.querySelectorAll("input"))||[];(!e.filterable&&!e.defaultFirstOption&&!$5(e.modelValue)||!Array.from(J).includes(document.activeElement))&&Tt(),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&Xe()},{flush:"post"}),T.watch(()=>t.hoverIndex,Ae=>{A2(Ae)&&Ae>-1?v.value=ge.value[Ae]||{}:v.value={},ge.value.forEach(ne=>{ne.hover=v.value===ne})});const Ye=()=>{T.nextTick(()=>{var Ae,ne;if(!a.value)return;const U=a.value.$el.querySelector("input");H=H||(U.clientHeight>0?U.clientHeight+2:0);const J=p.value,oe=getComputedStyle(U).getPropertyValue(i.cssVarName("input-height")),Qe=Number.parseFloat(oe)||KC(Ze.value||(V==null?void 0:V.size)),he=Ze.value||Qe===H||H<=0?Qe:H;!(U.offsetParent===null)&&(U.style.height=`${(t.selected.length===0?he:Math.max(J?J.clientHeight+(J.clientHeight>he?6:0):0,he))-2}px`),t.visible&&de.value!==!1&&((ne=(Ae=f.value)==null?void 0:Ae.updatePopper)==null||ne.call(Ae))})},Pt=async Ae=>{if(!(t.previousQuery===Ae||t.isOnComposition)){if(t.previousQuery===null&&(X3(e.filterMethod)||X3(e.remoteMethod))){t.previousQuery=Ae;return}t.previousQuery=Ae,T.nextTick(()=>{var ne,U;t.visible&&((U=(ne=f.value)==null?void 0:ne.updatePopper)==null||U.call(ne))}),t.hoverIndex=-1,e.multiple&&e.filterable&&T.nextTick(()=>{if(!R.value){const ne=u.value.value.length*15+20;t.inputLength=e.collapseTags?Math.min(50,ne):ne,Ie()}Ye()}),e.remote&&X3(e.remoteMethod)?(t.hoverIndex=-1,e.remoteMethod(Ae)):X3(e.filterMethod)?(e.filterMethod(Ae),T.triggerRef(w)):(t.filteredOptionsCount=t.optionsCount,b.value.query=Ae,T.triggerRef(b),T.triggerRef(w)),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&(await T.nextTick(),Xe())}},Ie=()=>{t.currentPlaceholder!==""&&(t.currentPlaceholder=u.value.value?"":t.cachedPlaceHolder)},Xe=()=>{const Ae=ge.value.filter(J=>J.visible&&!J.disabled&&!J.states.groupDisabled),ne=Ae.find(J=>J.created),U=Ae[0];t.hoverIndex=Wt(ge.value,ne||U)},Tt=()=>{var Ae;if(e.multiple)t.selectedLabel="";else{const U=Je(e.modelValue);(Ae=U.props)!=null&&Ae.created?(t.createdLabel=U.props.value,t.createdSelected=!0):t.createdSelected=!1,t.selectedLabel=U.currentLabel,t.selected=U,e.filterable&&(t.query=t.selectedLabel);return}const ne=[];Array.isArray(e.modelValue)&&e.modelValue.forEach(U=>{ne.push(Je(U))}),t.selected=ne,T.nextTick(()=>{Ye()})},Je=Ae=>{let ne;const U=rc(Ae).toLowerCase()==="object",J=rc(Ae).toLowerCase()==="null",oe=rc(Ae).toLowerCase()==="undefined";for(let Le=t.cachedOptions.size-1;Le>=0;Le--){const _e=Ce.value[Le];if(U?K3(_e.value,e.valueKey)===K3(Ae,e.valueKey):_e.value===Ae){ne={value:Ae,currentLabel:_e.currentLabel,isDisabled:_e.isDisabled};break}}if(ne)return ne;const Qe=U?Ae.label:!J&&!oe?Ae:"",he={value:Ae,currentLabel:Qe};return e.multiple&&(he.hitState=!1),he},yt=()=>{setTimeout(()=>{const Ae=e.valueKey;e.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(ne=>ge.value.findIndex(U=>K3(U,Ae)===K3(ne,Ae)))):t.hoverIndex=-1:t.hoverIndex=ge.value.findIndex(ne=>w1(ne)===w1(t.selected))},300)},At=()=>{var Ae,ne;Et(),(ne=(Ae=f.value)==null?void 0:Ae.updatePopper)==null||ne.call(Ae),e.multiple&&Ye()},Et=()=>{var Ae;t.inputWidth=(Ae=a.value)==null?void 0:Ae.$el.offsetWidth},Ve=()=>{e.filterable&&t.query!==t.selectedLabel&&(t.query=t.selectedLabel,Pt(t.query))},Ne=_c(()=>{Ve()},ie.value),ut=_c(Ae=>{Pt(Ae.target.value)},ie.value),ze=Ae=>{vc(e.modelValue,Ae)||r.emit(es,Ae)},Ke=Ae=>yC(Ae,ne=>!t.disabledOptions.has(ne)),gt=Ae=>{if(Ae.code!==a3.delete){if(Ae.target.value.length<=0&&!P1()){const ne=e.modelValue.slice(),U=Ke(ne);if(U<0)return;ne.splice(U,1),r.emit(f2,ne),ze(ne)}Ae.target.value.length===1&&e.modelValue.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}},pt=(Ae,ne)=>{const U=t.selected.indexOf(ne);if(U>-1&&!R.value){const J=e.modelValue.slice();J.splice(U,1),r.emit(f2,J),ze(J),r.emit("remove-tag",ne.value)}Ae.stopPropagation(),Rt()},mt=Ae=>{Ae.stopPropagation();const ne=e.multiple?[]:"";if(!C2(ne))for(const U of t.selected)U.isDisabled&&ne.push(U.value);r.emit(f2,ne),ze(ne),t.hoverIndex=-1,t.visible=!1,r.emit("clear"),Rt()},Ht=Ae=>{var ne;if(e.multiple){const U=(e.modelValue||[]).slice(),J=Wt(U,Ae.value);J>-1?U.splice(J,1):(e.multipleLimit<=0||U.length<e.multipleLimit)&&U.push(Ae.value),r.emit(f2,U),ze(U),Ae.created&&(t.query="",Pt(""),t.inputLength=20),e.filterable&&((ne=u.value)==null||ne.focus())}else r.emit(f2,Ae.value),ze(Ae.value),t.visible=!1;_1(),!t.visible&&T.nextTick(()=>{t1(Ae)})},Wt=(Ae=[],ne)=>{if(!i3(ne))return Ae.indexOf(ne);const U=e.valueKey;let J=-1;return Ae.some((oe,Qe)=>T.toRaw(K3(oe,U))===K3(ne,U)?(J=Qe,!0):!1),J},_1=()=>{const Ae=u.value||a.value;Ae&&(Ae==null||Ae.focus())},t1=Ae=>{var ne,U,J,oe,Qe;const he=Array.isArray(Ae)?Ae[0]:Ae;let Le=null;if(he!=null&&he.value){const _e=ge.value.filter(me=>me.value===he.value);_e.length>0&&(Le=_e[0].$el)}if(f.value&&Le){const _e=(oe=(J=(U=(ne=f.value)==null?void 0:ne.popperRef)==null?void 0:U.contentRef)==null?void 0:J.querySelector)==null?void 0:oe.call(J,`.${i.be("dropdown","wrap")}`);_e&&CC(_e,Le)}(Qe=g.value)==null||Qe.handleScroll()},V1=Ae=>{t.optionsCount++,t.filteredOptionsCount++,t.options.set(Ae.value,Ae),t.cachedOptions.set(Ae.value,Ae),Ae.disabled&&t.disabledOptions.set(Ae.value,Ae)},Pe=(Ae,ne)=>{t.options.get(Ae)===ne&&(t.optionsCount--,t.filteredOptionsCount--,t.options.delete(Ae))},v1=Ae=>{Ae.code!==a3.backspace&&P1(!1),t.inputLength=u.value.value.length*15+20,Ye()},P1=Ae=>{if(!Array.isArray(t.selected))return;const ne=Ke(t.selected.map(J=>J.value)),U=t.selected[ne];if(U)return Ae===!0||Ae===!1?(U.hitState=Ae,Ae):(U.hitState=!U.hitState,U.hitState)},Q1=Ae=>{const ne=Ae.target.value;if(Ae.type==="compositionend")t.isOnComposition=!1,T.nextTick(()=>Pt(ne));else{const U=ne[ne.length-1]||"";t.isOnComposition=!mf(U)}},Xt=()=>{T.nextTick(()=>t1(t.selected))},et=Ae=>{t.focused||((e.automaticDropdown||e.filterable)&&(e.filterable&&!t.visible&&(t.menuVisibleOnFocus=!0),t.visible=!0),t.focused=!0,r.emit("focus",Ae))},Rt=()=>{var Ae,ne;t.visible?(Ae=u.value||a.value)==null||Ae.focus():(ne=a.value)==null||ne.focus()},d1=()=>{var Ae,ne,U;t.visible=!1,(Ae=a.value)==null||Ae.blur(),(U=(ne=o.value)==null?void 0:ne.blur)==null||U.call(ne)},r2=Ae=>{var ne,U,J;(ne=f.value)!=null&&ne.isFocusInsideContent(Ae)||(U=h.value)!=null&&U.isFocusInsideContent(Ae)||(J=m.value)!=null&&J.contains(Ae.relatedTarget)||(t.visible&&l3(),t.focused=!1,r.emit("blur",Ae))},R2=Ae=>{mt(Ae)},l3=()=>{t.visible=!1},L3=Ae=>{t.visible&&(Ae.preventDefault(),Ae.stopPropagation(),t.visible=!1)},it=Ae=>{Ae&&!t.mouseEnter||R.value||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:(!f.value||!f.value.isFocusInsideContent())&&(t.visible=!t.visible),Rt())},c3=()=>{t.visible?ge.value[t.hoverIndex]&&Ht(ge.value[t.hoverIndex]):it()},w1=Ae=>i3(Ae.value)?K3(Ae.value,e.valueKey):Ae.value,R3=T.computed(()=>ge.value.filter(Ae=>Ae.visible).every(Ae=>Ae.disabled)),b3=T.computed(()=>e.multiple?t.selected.slice(0,e.maxCollapseTags):[]),at=T.computed(()=>e.multiple?t.selected.slice(e.maxCollapseTags):[]),qt=Ae=>{if(!t.visible){t.visible=!0;return}if(!(t.options.size===0||t.filteredOptionsCount===0)&&!t.isOnComposition&&!R3.value){Ae==="next"?(t.hoverIndex++,t.hoverIndex===t.options.size&&(t.hoverIndex=0)):Ae==="prev"&&(t.hoverIndex--,t.hoverIndex<0&&(t.hoverIndex=t.options.size-1));const ne=ge.value[t.hoverIndex];(ne.disabled===!0||ne.states.groupDisabled===!0||!ne.visible)&&qt(Ae),T.nextTick(()=>t1(v.value))}},jt=()=>{t.mouseEnter=!0},Q2=()=>{t.mouseEnter=!1},u3=(Ae,ne)=>{var U,J;pt(Ae,ne),(J=(U=h.value)==null?void 0:U.updatePopper)==null||J.call(U)},Zt=T.computed(()=>({maxWidth:`${T.unref(t.inputWidth)-32-(ee.value?22:0)}px`,width:"100%"}));return{optionList:E,optionsArray:ge,hoverOption:v,selectSize:Ze,handleResize:At,debouncedOnInputChange:Ne,debouncedQueryChange:ut,deletePrevTag:gt,deleteTag:pt,deleteSelected:mt,handleOptionSelect:Ht,scrollToOption:t1,readonly:N,resetInputHeight:Ye,showClose:z,iconComponent:Z,iconReverse:K,showNewOption:Re,collapseTagSize:tt,setSelected:Tt,managePlaceholder:Ie,selectDisabled:R,emptyText:de,toggleLastOptionHitState:P1,resetInputState:v1,handleComposition:Q1,onOptionCreate:V1,onOptionDestroy:Pe,handleMenuEnter:Xt,handleFocus:et,focus:Rt,blur:d1,handleBlur:r2,handleClearClick:R2,handleClose:l3,handleKeydownEscape:L3,toggleMenu:it,selectOption:c3,getValueKey:w1,navigateOptions:qt,handleDeleteTooltipTag:u3,dropMenuVisible:Ee,queryChange:b,groupQueryChange:w,showTagList:b3,collapseTagList:at,selectTagsStyle:Zt,reference:a,input:u,iOSInput:o,tooltipRef:f,tagTooltipRef:h,tags:p,selectWrapper:m,scrollbar:g,handleMouseEnter:jt,handleMouseLeave:Q2}};var _O=T.defineComponent({name:"ElOptions",emits:["update-options"],setup(e,{slots:t,emit:r}){let n=[];function i(a,u){if(a.length!==u.length)return!1;for(const[o]of a.entries())if(a[o]!=u[o])return!1;return!0}return()=>{var a,u;const o=(a=t.default)==null?void 0:a.call(t),f=[];function h(p){Array.isArray(p)&&p.forEach(m=>{var g,v,b,w;const E=(g=(m==null?void 0:m.type)||{})==null?void 0:g.name;E==="ElOptionGroup"?h(!C2(m.children)&&!Array.isArray(m.children)&&X3((v=m.children)==null?void 0:v.default)?(b=m.children)==null?void 0:b.default():m.children):E==="ElOption"?f.push((w=m.props)==null?void 0:w.label):Array.isArray(m.children)&&h(m.children)})}return o.length&&h((u=o[0])==null?void 0:u.children),i(f,n)||(n=f,r("update-options",f)),o}}});const rm="ElSelect",vO=T.defineComponent({name:rm,componentName:rm,components:{ElInput:ls,ElSelectMenu:mO,ElOption:iu,ElOptions:_O,ElTag:aD,ElScrollbar:JS,ElTooltip:Gc,ElIcon:U2},directives:{ClickOutside:Ap},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:JC},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:J3.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ln,default:Lc},fitInputWidth:Boolean,suffixIcon:{type:ln,default:sn},tagType:{...zp.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:rs,default:"bottom-start"},ariaLabel:{type:String,default:void 0}},emits:[f2,es,"remove-tag","clear","visible-change","focus","blur"],setup(e,t){const r=Jt("select"),n=Jt("input"),{t:i}=ri(),a=ta(),u=yO(e),{optionList:o,optionsArray:f,hoverOption:h,selectSize:p,readonly:m,handleResize:g,collapseTagSize:v,debouncedOnInputChange:b,debouncedQueryChange:w,deletePrevTag:E,deleteTag:H,deleteSelected:V,handleOptionSelect:I,scrollToOption:N,setSelected:R,resetInputHeight:z,managePlaceholder:Z,showClose:K,selectDisabled:ee,iconComponent:ie,iconReverse:de,showNewOption:ge,emptyText:Ce,toggleLastOptionHitState:Re,resetInputState:Ze,handleComposition:tt,onOptionCreate:Ee,onOptionDestroy:Ye,handleMenuEnter:Pt,handleFocus:Ie,focus:Xe,blur:Tt,handleBlur:Je,handleClearClick:yt,handleClose:At,handleKeydownEscape:Et,toggleMenu:Ve,selectOption:Ne,getValueKey:ut,navigateOptions:ze,handleDeleteTooltipTag:Ke,dropMenuVisible:gt,reference:pt,input:mt,iOSInput:Ht,tooltipRef:Wt,tagTooltipRef:_1,tags:t1,selectWrapper:V1,scrollbar:Pe,queryChange:v1,groupQueryChange:P1,handleMouseEnter:Q1,handleMouseLeave:Xt,showTagList:et,collapseTagList:Rt,selectTagsStyle:d1}=gO(e,u,t),{inputWidth:r2,selected:R2,inputLength:l3,filteredOptionsCount:L3,visible:it,selectedLabel:c3,hoverIndex:w1,query:R3,inputHovering:b3,currentPlaceholder:at,menuVisibleOnFocus:qt,isOnComposition:jt,options:Q2,cachedOptions:u3,optionsCount:Zt,prefixWidth:Ae}=T.toRefs(u),ne=T.computed(()=>{const Be=[r.b()],Fe=T.unref(p);return Fe&&Be.push(r.m(Fe)),e.disabled&&Be.push(r.m("disabled")),Be}),U=T.computed(()=>[r.e("tags"),r.is("disabled",T.unref(ee))]),J=T.computed(()=>[r.b("tags-wrapper"),{"has-prefix":T.unref(Ae)&&T.unref(R2).length}]),oe=T.computed(()=>[r.e("input"),r.is(T.unref(p)),r.is("disabled",T.unref(ee))]),Qe=T.computed(()=>[r.e("input"),r.is(T.unref(p)),r.em("input","iOS")]),he=T.computed(()=>[r.is("empty",!e.allowCreate&&!!T.unref(R3)&&T.unref(L3)===0)]),Le=T.computed(()=>({maxWidth:`${T.unref(r2)>123&&T.unref(R2).length>e.maxCollapseTags?T.unref(r2)-123:T.unref(r2)-75}px`})),_e=T.computed(()=>({marginLeft:`${T.unref(Ae)}px`,flexGrow:1,width:`${T.unref(l3)/(T.unref(r2)-32)}%`,maxWidth:`${T.unref(r2)-42}px`}));T.provide(ys,T.reactive({props:e,options:Q2,optionsArray:f,cachedOptions:u3,optionsCount:Zt,filteredOptionsCount:L3,hoverIndex:w1,handleOptionSelect:I,onOptionCreate:Ee,onOptionDestroy:Ye,selectWrapper:V1,selected:R2,setSelected:R,queryChange:v1,groupQueryChange:P1})),T.onMounted(()=>{u.cachedPlaceHolder=at.value=e.placeholder||(()=>i("el.select.placeholder")),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(at.value=""),j0(V1,g),e.remote&&e.multiple&&z(),T.nextTick(()=>{const Be=pt.value&&pt.value.$el;if(Be&&(r2.value=Be.getBoundingClientRect().width,t.slots.prefix)){const Fe=Be.querySelector(`.${n.e("prefix")}`);Ae.value=Math.max(Fe.getBoundingClientRect().width+11,30)}}),R()}),e.multiple&&!Array.isArray(e.modelValue)&&t.emit(f2,[]),!e.multiple&&Array.isArray(e.modelValue)&&t.emit(f2,"");const me=T.computed(()=>{var Be,Fe;return(Fe=(Be=Wt.value)==null?void 0:Be.popperRef)==null?void 0:Fe.contentRef});return{isIOS:cd,onOptionsRendered:Be=>{o.value=Be},prefixWidth:Ae,selectSize:p,readonly:m,handleResize:g,collapseTagSize:v,debouncedOnInputChange:b,debouncedQueryChange:w,deletePrevTag:E,deleteTag:H,handleDeleteTooltipTag:Ke,deleteSelected:V,handleOptionSelect:I,scrollToOption:N,inputWidth:r2,selected:R2,inputLength:l3,filteredOptionsCount:L3,visible:it,selectedLabel:c3,hoverIndex:w1,query:R3,inputHovering:b3,currentPlaceholder:at,menuVisibleOnFocus:qt,isOnComposition:jt,options:Q2,resetInputHeight:z,managePlaceholder:Z,showClose:K,selectDisabled:ee,iconComponent:ie,iconReverse:de,showNewOption:ge,emptyText:Ce,toggleLastOptionHitState:Re,resetInputState:Ze,handleComposition:tt,handleMenuEnter:Pt,handleFocus:Ie,focus:Xe,blur:Tt,handleBlur:Je,handleClearClick:yt,handleClose:At,handleKeydownEscape:Et,toggleMenu:Ve,selectOption:Ne,getValueKey:ut,navigateOptions:ze,dropMenuVisible:gt,reference:pt,input:mt,iOSInput:Ht,tooltipRef:Wt,popperPaneRef:me,tags:t1,selectWrapper:V1,scrollbar:Pe,wrapperKls:ne,tagsKls:U,tagWrapperKls:J,inputKls:oe,iOSInputKls:Qe,scrollbarKls:he,selectTagsStyle:d1,nsSelect:r,tagTextStyle:Le,inputStyle:_e,handleMouseEnter:Q1,handleMouseLeave:Xt,showTagList:et,collapseTagList:Rt,tagTooltipRef:_1,contentId:a,hoverOption:h}}}),xO=["disabled","autocomplete","aria-activedescendant","aria-controls","aria-expanded","aria-label"],LO=["disabled"],bO={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function wO(e,t,r,n,i,a){const u=T.resolveComponent("el-tag"),o=T.resolveComponent("el-tooltip"),f=T.resolveComponent("el-icon"),h=T.resolveComponent("el-input"),p=T.resolveComponent("el-option"),m=T.resolveComponent("el-options"),g=T.resolveComponent("el-scrollbar"),v=T.resolveComponent("el-select-menu"),b=T.resolveDirective("click-outside");return T.withDirectives((T.openBlock(),T.createElementBlock("div",{ref:"selectWrapper",class:T.normalizeClass(e.wrapperKls),onMouseenter:t[22]||(t[22]=(...w)=>e.handleMouseEnter&&e.handleMouseEnter(...w)),onMouseleave:t[23]||(t[23]=(...w)=>e.handleMouseLeave&&e.handleMouseLeave(...w)),onClick:t[24]||(t[24]=T.withModifiers((...w)=>e.toggleMenu&&e.toggleMenu(...w),["stop"]))},[T.createVNode(o,{ref:"tooltipRef",visible:e.dropMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:T.withCtx(()=>{var w,E;return[T.createElementVNode("div",{class:"select-trigger",onMouseenter:t[20]||(t[20]=H=>e.inputHovering=!0),onMouseleave:t[21]||(t[21]=H=>e.inputHovering=!1)},[e.multiple?(T.openBlock(),T.createElementBlock("div",{key:0,ref:"tags",tabindex:"-1",class:T.normalizeClass(e.tagsKls),style:T.normalizeStyle(e.selectTagsStyle),onClick:t[15]||(t[15]=(...H)=>e.focus&&e.focus(...H))},[e.collapseTags&&e.selected.length?(T.openBlock(),T.createBlock(T.Transition,{key:0,onAfterLeave:e.resetInputHeight},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.tagWrapperKls)},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.showTagList,H=>(T.openBlock(),T.createBlock(u,{key:e.getValueKey(H),closable:!e.selectDisabled&&!H.isDisabled,size:e.collapseTagSize,hit:H.hitState,type:e.tagType,"disable-transitions":"",onClose:V=>e.deleteTag(V,H)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text")),style:T.normalizeStyle(e.tagTextStyle)},T.toDisplayString(H.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),e.selected.length>e.maxCollapseTags?(T.openBlock(),T.createBlock(u,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:T.withCtx(()=>[e.collapseTagsTooltip?(T.openBlock(),T.createBlock(o,{key:0,ref:"tagTooltipRef",disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+T.toDisplayString(e.selected.length-e.maxCollapseTags),3)]),content:T.withCtx(()=>[T.createElementVNode("div",{class:T.normalizeClass(e.nsSelect.e("collapse-tags"))},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.collapseTagList,H=>(T.openBlock(),T.createElementBlock("div",{key:e.getValueKey(H),class:T.normalizeClass(e.nsSelect.e("collapse-tag"))},[T.createVNode(u,{class:"in-tooltip",closable:!e.selectDisabled&&!H.isDisabled,size:e.collapseTagSize,hit:H.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:V=>e.handleDeleteTooltipTag(V,H)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text")),style:T.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},T.toDisplayString(H.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(T.openBlock(),T.createElementBlock("span",{key:1,class:T.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+T.toDisplayString(e.selected.length-e.maxCollapseTags),3))]),_:1},8,["size","type"])):T.createCommentVNode("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):T.createCommentVNode("v-if",!0),e.collapseTags?T.createCommentVNode("v-if",!0):(T.openBlock(),T.createBlock(T.Transition,{key:1,onAfterLeave:e.resetInputHeight},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.tagWrapperKls),style:T.normalizeStyle(e.prefixWidth&&e.selected.length?{marginLeft:`${e.prefixWidth}px`}:"")},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.selected,H=>(T.openBlock(),T.createBlock(u,{key:e.getValueKey(H),closable:!e.selectDisabled&&!H.isDisabled,size:e.collapseTagSize,hit:H.hitState,type:e.tagType,"disable-transitions":"",onClose:V=>e.deleteTag(V,H)},{default:T.withCtx(()=>[T.createElementVNode("span",{class:T.normalizeClass(e.nsSelect.e("tags-text")),style:T.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},T.toDisplayString(H.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],6)]),_:1},8,["onAfterLeave"])),e.filterable&&!e.selectDisabled?T.withDirectives((T.openBlock(),T.createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":t[0]||(t[0]=H=>e.query=H),type:"text",class:T.normalizeClass(e.inputKls),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:T.normalizeStyle(e.inputStyle),role:"combobox","aria-activedescendant":((w=e.hoverOption)==null?void 0:w.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:t[1]||(t[1]=(...H)=>e.handleFocus&&e.handleFocus(...H)),onBlur:t[2]||(t[2]=(...H)=>e.handleBlur&&e.handleBlur(...H)),onKeyup:t[3]||(t[3]=(...H)=>e.managePlaceholder&&e.managePlaceholder(...H)),onKeydown:[t[4]||(t[4]=(...H)=>e.resetInputState&&e.resetInputState(...H)),t[5]||(t[5]=T.withKeys(T.withModifiers(H=>e.navigateOptions("next"),["prevent"]),["down"])),t[6]||(t[6]=T.withKeys(T.withModifiers(H=>e.navigateOptions("prev"),["prevent"]),["up"])),t[7]||(t[7]=T.withKeys((...H)=>e.handleKeydownEscape&&e.handleKeydownEscape(...H),["esc"])),t[8]||(t[8]=T.withKeys(T.withModifiers((...H)=>e.selectOption&&e.selectOption(...H),["stop","prevent"]),["enter"])),t[9]||(t[9]=T.withKeys((...H)=>e.deletePrevTag&&e.deletePrevTag(...H),["delete"])),t[10]||(t[10]=T.withKeys(H=>e.visible=!1,["tab"]))],onCompositionstart:t[11]||(t[11]=(...H)=>e.handleComposition&&e.handleComposition(...H)),onCompositionupdate:t[12]||(t[12]=(...H)=>e.handleComposition&&e.handleComposition(...H)),onCompositionend:t[13]||(t[13]=(...H)=>e.handleComposition&&e.handleComposition(...H)),onInput:t[14]||(t[14]=(...H)=>e.debouncedQueryChange&&e.debouncedQueryChange(...H))},null,46,xO)),[[T.vModelText,e.query]]):T.createCommentVNode("v-if",!0)],6)):T.createCommentVNode("v-if",!0),e.isIOS&&!e.multiple&&e.filterable&&e.readonly?(T.openBlock(),T.createElementBlock("input",{key:1,ref:"iOSInput",class:T.normalizeClass(e.iOSInputKls),disabled:e.selectDisabled,type:"text"},null,10,LO)):T.createCommentVNode("v-if",!0),T.createVNode(h,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":t[16]||(t[16]=H=>e.selectedLabel=H),type:"text",placeholder:typeof e.currentPlaceholder=="function"?e.currentPlaceholder():e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:T.normalizeClass([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,role:"combobox","aria-activedescendant":((E=e.hoverOption)==null?void 0:E.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,label:e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[t[17]||(t[17]=T.withKeys(T.withModifiers(H=>e.navigateOptions("next"),["stop","prevent"]),["down"])),t[18]||(t[18]=T.withKeys(T.withModifiers(H=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),T.withKeys(T.withModifiers(e.selectOption,["stop","prevent"]),["enter"]),T.withKeys(e.handleKeydownEscape,["esc"]),t[19]||(t[19]=T.withKeys(H=>e.visible=!1,["tab"]))]},T.createSlots({suffix:T.withCtx(()=>[e.iconComponent&&!e.showClose?(T.openBlock(),T.createBlock(f,{key:0,class:T.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):T.createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(T.openBlock(),T.createBlock(f,{key:1,class:T.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:T.withCtx(()=>[T.createElementVNode("div",bO,[T.renderSlot(e.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","aria-activedescendant","aria-controls","aria-expanded","label","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]}),content:T.withCtx(()=>[T.createVNode(v,null,T.createSlots({default:T.withCtx(()=>[T.withDirectives(T.createVNode(g,{id:e.contentId,ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:T.normalizeClass(e.scrollbarKls),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:T.withCtx(()=>[e.showNewOption?(T.openBlock(),T.createBlock(p,{key:0,value:e.query,created:!0},null,8,["value"])):T.createCommentVNode("v-if",!0),T.createVNode(m,{onUpdateOptions:e.onOptionsRendered},{default:T.withCtx(()=>[T.renderSlot(e.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[T.vShow,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&e.options.size===0)?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[e.$slots.empty?T.renderSlot(e.$slots,"empty",{key:0}):(T.openBlock(),T.createElementBlock("p",{key:1,class:T.normalizeClass(e.nsSelect.be("dropdown","empty"))},T.toDisplayString(e.emptyText),3))],64)):T.createCommentVNode("v-if",!0)]),_:2},[e.$slots.header?{name:"header",fn:T.withCtx(()=>[T.renderSlot(e.$slots,"header")])}:void 0,e.$slots.footer?{name:"footer",fn:T.withCtx(()=>[T.renderSlot(e.$slots,"footer")])}:void 0]),1024)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[b,e.handleClose,e.popperPaneRef]])}var HO=e1(vO,[["render",wO],["__file","select.vue"]]);const MO=T.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=Jt("select"),r=T.ref(!0),n=T.getCurrentInstance(),i=T.ref([]);T.provide(tm,T.reactive({...T.toRefs(e)}));const a=T.inject(ys);T.onMounted(()=>{i.value=u(n.subTree)});const u=f=>{const h=[];return Array.isArray(f.children)&&f.children.forEach(p=>{var m;p.type&&p.type.name==="ElOption"&&p.component&&p.component.proxy?h.push(p.component.proxy):(m=p.children)!=null&&m.length&&h.push(...u(p))}),h},{groupQueryChange:o}=T.toRaw(a);return T.watch(o,()=>{r.value=i.value.some(f=>f.visible===!0)},{flush:"post"}),{visible:r,ns:t}}});function CO(e,t,r,n,i,a){return T.withDirectives((T.openBlock(),T.createElementBlock("ul",{class:T.normalizeClass(e.ns.be("group","wrap"))},[T.createElementVNode("li",{class:T.normalizeClass(e.ns.be("group","title"))},T.toDisplayString(e.label),3),T.createElementVNode("li",null,[T.createElementVNode("ul",{class:T.normalizeClass(e.ns.b("group"))},[T.renderSlot(e.$slots,"default")],2)])],2)),[[T.vShow,e.visible]])}var nm=e1(MO,[["render",CO],["__file","option-group.vue"]]);const di=g3(HO,{Option:iu,OptionGroup:nm}),gs=v4(iu);v4(nm);const AO=S1({trigger:ia.trigger,placement:nu.placement,disabled:ia.disabled,visible:J3.visible,transition:J3.transition,popperOptions:nu.popperOptions,tabindex:nu.tabindex,content:J3.content,popperStyle:J3.popperStyle,popperClass:J3.popperClass,enterable:{...J3.enterable,default:!0},effect:{...J3.effect,default:"light"},teleported:J3.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),SO={"update:visible":e=>on(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},EO="onUpdate:visible",VO=T.defineComponent({name:"ElPopover"}),DO=T.defineComponent({...VO,props:AO,emits:SO,setup(e,{expose:t,emit:r}){const n=e,i=T.computed(()=>n[EO]),a=Jt("popover"),u=T.ref(),o=T.computed(()=>{var E;return(E=T.unref(u))==null?void 0:E.popperRef}),f=T.computed(()=>[{width:ei(n.width)},n.popperStyle]),h=T.computed(()=>[a.b(),n.popperClass,{[a.m("plain")]:!!n.content}]),p=T.computed(()=>n.transition===`${a.namespace.value}-fade-in-linear`),m=()=>{var E;(E=u.value)==null||E.hide()},g=()=>{r("before-enter")},v=()=>{r("before-leave")},b=()=>{r("after-enter")},w=()=>{r("update:visible",!1),r("after-leave")};return t({popperRef:o,hide:m}),(E,H)=>(T.openBlock(),T.createBlock(T.unref(Gc),T.mergeProps({ref_key:"tooltipRef",ref:u},E.$attrs,{trigger:E.trigger,placement:E.placement,disabled:E.disabled,visible:E.visible,transition:E.transition,"popper-options":E.popperOptions,tabindex:E.tabindex,content:E.content,offset:E.offset,"show-after":E.showAfter,"hide-after":E.hideAfter,"auto-close":E.autoClose,"show-arrow":E.showArrow,"aria-label":E.title,effect:E.effect,enterable:E.enterable,"popper-class":T.unref(h),"popper-style":T.unref(f),teleported:E.teleported,persistent:E.persistent,"gpu-acceleration":T.unref(p),"onUpdate:visible":T.unref(i),onBeforeShow:g,onBeforeHide:v,onShow:b,onHide:w}),{content:T.withCtx(()=>[E.title?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(T.unref(a).e("title")),role:"title"},T.toDisplayString(E.title),3)):T.createCommentVNode("v-if",!0),T.renderSlot(E.$slots,"default",{},()=>[T.createTextVNode(T.toDisplayString(E.content),1)])]),default:T.withCtx(()=>[E.$slots.reference?T.renderSlot(E.$slots,"reference",{key:0}):T.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var OO=e1(DO,[["__file","popover.vue"]]);const im=(e,t)=>{const r=t.arg||t.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=e)};var kO={mounted(e,t){im(e,t)},updated(e,t){im(e,t)}};const am=WC(kO,"popover"),_s=g3(OO,{directive:am}),fi="$treeNodeId",om=function(e,t){!t||t[fi]||Object.defineProperty(t,fi,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},au=function(e,t){return e?t[e]:t[fi]},ou=(e,t,r)=>{const n=e.value.currentNode;r();const i=e.value.currentNode;n!==i&&t("current-change",i?i.data:null,i)},su=e=>{let t=!0,r=!0,n=!0;for(let i=0,a=e.length;i<a;i++){const u=e[i];(u.checked!==!0||u.indeterminate)&&(t=!1,u.disabled||(n=!1)),(u.checked!==!1||u.indeterminate)&&(r=!1)}return{all:t,none:r,allWithoutDisable:n,half:!t&&!r}},vs=function(e){if(e.childNodes.length===0||e.loading)return;const{all:t,none:r,half:n}=su(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):n?(e.checked=!1,e.indeterminate=!0):r&&(e.checked=!1,e.indeterminate=!1);const i=e.parent;!i||i.level===0||e.store.checkStrictly||vs(i)},xs=function(e,t){const r=e.store.props,n=e.data||{},i=r[t];if(typeof i=="function")return i(n,e);if(typeof i=="string")return n[i];if(typeof i>"u"){const a=n[t];return a===void 0?"":a}};let PO=0,lu=class J9{constructor(t){this.id=PO++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in t)Kn(t,r)&&(this[r]=t[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const r=t.props;if(r&&typeof r.isLeaf<"u"){const a=xs(this,"isLeaf");typeof a=="boolean"&&(this.isLeafByUser=a)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||om(this,this.data),!this.data)return;const n=t.defaultExpandedKeys,i=t.key;i&&n&&n.includes(this.key)&&this.expand(null,t.autoExpandParent),i&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(t){Array.isArray(t)||om(this,t),this.data=t,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=xs(this,"children")||[];for(let n=0,i=r.length;n<i;n++)this.insertChild({data:r[n]})}get label(){return xs(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return xs(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return t.childNodes[r+1]}return null}get previousSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return r>0?t.childNodes[r-1]:null}return null}contains(t,r=!0){return(this.childNodes||[]).some(n=>n===t||r&&n.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,r,n){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof J9)){if(!n){const i=this.getChildren(!0);i.includes(t.data)||(typeof r>"u"||r<0?i.push(t.data):i.splice(r,0,t.data))}Object.assign(t,{parent:this,store:this.store}),t=T.reactive(new J9(t)),t instanceof J9&&t.initialize()}t.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),this.updateLeafState()}insertBefore(t,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(t,n)}insertAfter(t,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(t,n)}removeChild(t){const r=this.getChildren()||[],n=r.indexOf(t.data);n>-1&&r.splice(n,1);const i=this.childNodes.indexOf(t);i>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(i,1)),this.updateLeafState()}removeChildByData(t){let r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===t){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(t,r){const n=()=>{if(r){let i=this.parent;for(;i.level>0;)i.expanded=!0,i=i.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(i=>{i.canFocus=!0})};this.shouldLoadData()?this.loadData(i=>{Array.isArray(i)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vs(this),n())}):n()}doCreateChildren(t,r={}){t.forEach(n=>{this.insertChild(Object.assign({data:n},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const t=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!t||t.length===0;return}this.isLeaf=!1}setChecked(t,r,n,i){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:u,allWithoutDisable:o}=su(this.childNodes);!this.isLeaf&&!u&&o&&(this.checked=!1,t=!1);const f=()=>{if(r){const h=this.childNodes;for(let g=0,v=h.length;g<v;g++){const b=h[g];i=i||t!==!1;const w=b.disabled?b.checked:i;b.setChecked(w,r,!0,i)}const{half:p,all:m}=su(h);m||(this.checked=m,this.indeterminate=p)}};if(this.shouldLoadData()){this.loadData(()=>{f(),vs(this)},{checked:t!==!1});return}else f()}const a=this.parent;!a||a.level===0||n||vs(a)}getChildren(t=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let i="children";return n&&(i=n.children||"children"),r[i]===void 0&&(r[i]=null),t&&!r[i]&&(r[i]=[]),r[i]}updateChildren(){const t=this.getChildren()||[],r=this.childNodes.map(a=>a.data),n={},i=[];t.forEach((a,u)=>{const o=a[fi];!!o&&r.findIndex(h=>h[fi]===o)>=0?n[o]={index:u,data:a}:i.push({index:u,data:a})}),this.store.lazy||r.forEach(a=>{n[a[fi]]||this.removeChildByData(a)}),i.forEach(({index:a,data:u})=>{this.insertChild({data:u},a)}),this.updateLeafState()}loadData(t,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,i)};this.store.load(this,n)}else t&&t.call(this)}};class IO{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const r in t)Kn(t,r)&&(this[r]=t[r]);this.nodesMap={}}initialize(){if(this.root=new lu({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const t=this.load;t(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(t){const r=this.filterNodeMethod,n=this.lazy,i=function(a){const u=a.root?a.root.childNodes:a.childNodes;if(u.forEach(o=>{o.visible=r.call(o,t,o.data,o),i(o)}),!a.visible&&u.length){let o=!0;o=!u.some(f=>f.visible),a.root?a.root.visible=o===!1:a.visible=o===!1}t&&a.visible&&!a.isLeaf&&!n&&a.expand()};i(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof lu)return t;const r=i3(t)?au(this.key,t):t;return this.nodesMap[r]||null}insertBefore(t,r){const n=this.getNode(r);n.parent.insertBefore({data:t},n)}insertAfter(t,r){const n=this.getNode(r);n.parent.insertAfter({data:t},n)}remove(t){const r=this.getNode(t);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(t,r){const n=r?this.getNode(r):this.root;n&&n.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],r=this.nodesMap;t.forEach(n=>{const i=r[n];i&&i.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const r=this.key;!t||!t.data||(r?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,r=!1){const n=[],i=function(a){(a.root?a.root.childNodes:a.childNodes).forEach(o=>{(o.checked||r&&o.indeterminate)&&(!t||t&&o.isLeaf)&&n.push(o.data),i(o)})};return i(this),n}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const t=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(a=>{a.indeterminate&&t.push(a.data),r(a)})};return r(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],r=this.nodesMap;for(const n in r)Kn(r,n)&&t.push(r[n]);return t}updateChildren(t,r){const n=this.nodesMap[t];if(!n)return;const i=n.childNodes;for(let a=i.length-1;a>=0;a--){const u=i[a];this.remove(u.data)}for(let a=0,u=r.length;a<u;a++){const o=r[a];this.append(o,n.data)}}_setCheckedKeys(t,r=!1,n){const i=this._getAllNodes().sort((o,f)=>f.level-o.level),a=Object.create(null),u=Object.keys(n);i.forEach(o=>o.setChecked(!1,!1));for(let o=0,f=i.length;o<f;o++){const h=i[o],p=h.data[t].toString();if(!u.includes(p)){h.checked&&!a[p]&&h.setChecked(!1,!1);continue}let g=h.parent;for(;g&&g.level>0;)a[g.data[t]]=!0,g=g.parent;if(h.isLeaf||this.checkStrictly){h.setChecked(!0,!1);continue}if(h.setChecked(!0,!0),r){h.setChecked(!1,!1);const v=function(b){b.childNodes.forEach(E=>{E.isLeaf||E.setChecked(!1,!1),v(E)})};v(h)}}}setCheckedNodes(t,r=!1){const n=this.key,i={};t.forEach(a=>{i[(a||{})[n]]=!0}),this._setCheckedKeys(n,r,i)}setCheckedKeys(t,r=!1){this.defaultCheckedKeys=t;const n=this.key,i={};t.forEach(a=>{i[a]=!0}),this._setCheckedKeys(n,r,i)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(t,r,n){const i=this.getNode(t);i&&i.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,r=!0){const n=t[this.key],i=this.nodesMap[n];this.setCurrentNode(i),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,r=!0){if(t==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(t);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const BO=T.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=Jt("tree"),r=T.inject("NodeInstance"),n=T.inject("RootTree");return()=>{const i=e.node,{data:a,store:u}=i;return e.renderContent?e.renderContent(T.h,{_self:r,node:i,data:a,store:u}):T.renderSlot(n.ctx.slots,"default",{node:i,data:a},()=>[T.h("span",{class:t.be("node","label")},[i.label])])}}});var NO=e1(BO,[["__file","tree-node-content.vue"]]);function sm(e){const t=T.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{e.node!==n&&e.node.collapse()},children:[]};return t&&t.children.push(r),T.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(e.accordion)for(const i of r.children)i.treeNodeExpand(n)}}}const lm=Symbol("dragEvents");function FO({props:e,ctx:t,el$:r,dropIndicator$:n,store:i}){const a=Jt("tree"),u=T.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),o=({event:p,treeNode:m})=>{if(typeof e.allowDrag=="function"&&!e.allowDrag(m.node))return p.preventDefault(),!1;p.dataTransfer.effectAllowed="move";try{p.dataTransfer.setData("text/plain","")}catch{}u.value.draggingNode=m,t.emit("node-drag-start",m.node,p)},f=({event:p,treeNode:m})=>{const g=m,v=u.value.dropNode;v&&v.node.id!==g.node.id&&r6(v.$el,a.is("drop-inner"));const b=u.value.draggingNode;if(!b||!g)return;let w=!0,E=!0,H=!0,V=!0;typeof e.allowDrop=="function"&&(w=e.allowDrop(b.node,g.node,"prev"),V=E=e.allowDrop(b.node,g.node,"inner"),H=e.allowDrop(b.node,g.node,"next")),p.dataTransfer.dropEffect=E||w||H?"move":"none",(w||E||H)&&(v==null?void 0:v.node.id)!==g.node.id&&(v&&t.emit("node-drag-leave",b.node,v.node,p),t.emit("node-drag-enter",b.node,g.node,p)),(w||E||H)&&(u.value.dropNode=g),g.node.nextSibling===b.node&&(H=!1),g.node.previousSibling===b.node&&(w=!1),g.node.contains(b.node,!1)&&(E=!1),(b.node===g.node||b.node.contains(g.node))&&(w=!1,E=!1,H=!1);const I=g.$el.querySelector(`.${a.be("node","content")}`).getBoundingClientRect(),N=r.value.getBoundingClientRect();let R;const z=w?E?.25:H?.45:1:-1,Z=H?E?.75:w?.55:0:1;let K=-9999;const ee=p.clientY-I.top;ee<I.height*z?R="before":ee>I.height*Z?R="after":E?R="inner":R="none";const ie=g.$el.querySelector(`.${a.be("node","expand-icon")}`).getBoundingClientRect(),de=n.value;R==="before"?K=ie.top-N.top:R==="after"&&(K=ie.bottom-N.top),de.style.top=`${K}px`,de.style.left=`${ie.right-N.left}px`,R==="inner"?xc(g.$el,a.is("drop-inner")):r6(g.$el,a.is("drop-inner")),u.value.showDropIndicator=R==="before"||R==="after",u.value.allowDrop=u.value.showDropIndicator||V,u.value.dropType=R,t.emit("node-drag-over",b.node,g.node,p)},h=p=>{const{draggingNode:m,dropType:g,dropNode:v}=u.value;if(p.preventDefault(),p.dataTransfer.dropEffect="move",m&&v){const b={data:m.node.data};g!=="none"&&m.node.remove(),g==="before"?v.node.parent.insertBefore(b,v.node):g==="after"?v.node.parent.insertAfter(b,v.node):g==="inner"&&v.node.insertChild(b),g!=="none"&&i.value.registerNode(b),r6(v.$el,a.is("drop-inner")),t.emit("node-drag-end",m.node,v.node,g,p),g!=="none"&&t.emit("node-drop",m.node,v.node,g,p)}m&&!v&&t.emit("node-drag-end",m.node,null,g,p),u.value.showDropIndicator=!1,u.value.draggingNode=null,u.value.dropNode=null,u.value.allowDrop=!0};return T.provide(lm,{treeNodeDragStart:o,treeNodeDragOver:f,treeNodeDragEnd:h}),{dragState:u}}const RO=T.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:pD,ElCheckbox:fs,NodeContent:NO,ElIcon:U2,Loading:bc},props:{node:{type:lu,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const r=Jt("tree"),{broadcastExpanded:n}=sm(e),i=T.inject("RootTree"),a=T.ref(!1),u=T.ref(!1),o=T.ref(null),f=T.ref(null),h=T.ref(null),p=T.inject(lm),m=T.getCurrentInstance();T.provide("NodeInstance",m),i||S2("Tree","Can not find node's tree."),e.node.expanded&&(a.value=!0,u.value=!0);const g=i.props.props.children||"children";T.watch(()=>{const ee=e.node.data[g];return ee&&[...ee]},()=>{e.node.updateChildren()}),T.watch(()=>e.node.indeterminate,ee=>{w(e.node.checked,ee)}),T.watch(()=>e.node.checked,ee=>{w(ee,e.node.indeterminate)}),T.watch(()=>e.node.expanded,ee=>{T.nextTick(()=>a.value=ee),ee&&(u.value=!0)});const v=ee=>au(i.props.nodeKey,ee.data),b=ee=>{const ie=e.props.class;if(!ie)return{};let de;if(X3(ie)){const{data:ge}=ee;de=ie(ge,ee)}else de=ie;return C2(de)?{[de]:!0}:de},w=(ee,ie)=>{(o.value!==ee||f.value!==ie)&&i.ctx.emit("check-change",e.node.data,ee,ie),o.value=ee,f.value=ie},E=ee=>{ou(i.store,i.ctx.emit,()=>i.store.value.setCurrentNode(e.node)),i.currentNode.value=e.node,i.props.expandOnClickNode&&V(),i.props.checkOnClickNode&&!e.node.disabled&&I(null,{target:{checked:!e.node.checked}}),i.ctx.emit("node-click",e.node.data,e.node,m,ee)},H=ee=>{i.instance.vnode.props.onNodeContextmenu&&(ee.stopPropagation(),ee.preventDefault()),i.ctx.emit("node-contextmenu",ee,e.node.data,e.node,m)},V=()=>{e.node.isLeaf||(a.value?(i.ctx.emit("node-collapse",e.node.data,e.node,m),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,m)))},I=(ee,ie)=>{e.node.setChecked(ie.target.checked,!i.props.checkStrictly),T.nextTick(()=>{const de=i.store.value;i.ctx.emit("check",e.node.data,{checkedNodes:de.getCheckedNodes(),checkedKeys:de.getCheckedKeys(),halfCheckedNodes:de.getHalfCheckedNodes(),halfCheckedKeys:de.getHalfCheckedKeys()})})};return{ns:r,node$:h,tree:i,expanded:a,childNodeRendered:u,oldChecked:o,oldIndeterminate:f,getNodeKey:v,getNodeClass:b,handleSelectChange:w,handleClick:E,handleContextMenu:H,handleExpandIconClick:V,handleCheckChange:I,handleChildNodeExpand:(ee,ie,de)=>{n(ie),i.ctx.emit("node-expand",ee,ie,de)},handleDragStart:ee=>{i.props.draggable&&p.treeNodeDragStart({event:ee,treeNode:e})},handleDragOver:ee=>{ee.preventDefault(),i.props.draggable&&p.treeNodeDragOver({event:ee,treeNode:{$el:h.value,node:e.node}})},handleDrop:ee=>{ee.preventDefault()},handleDragEnd:ee=>{i.props.draggable&&p.treeNodeDragEnd(ee)},CaretRight:DC}}}),jO=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],zO=["aria-expanded"];function $O(e,t,r,n,i,a){const u=T.resolveComponent("el-icon"),o=T.resolveComponent("el-checkbox"),f=T.resolveComponent("loading"),h=T.resolveComponent("node-content"),p=T.resolveComponent("el-tree-node"),m=T.resolveComponent("el-collapse-transition");return T.withDirectives((T.openBlock(),T.createElementBlock("div",{ref:"node$",class:T.normalizeClass([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=T.withModifiers((...g)=>e.handleClick&&e.handleClick(...g),["stop"])),onContextmenu:t[2]||(t[2]=(...g)=>e.handleContextMenu&&e.handleContextMenu(...g)),onDragstart:t[3]||(t[3]=T.withModifiers((...g)=>e.handleDragStart&&e.handleDragStart(...g),["stop"])),onDragover:t[4]||(t[4]=T.withModifiers((...g)=>e.handleDragOver&&e.handleDragOver(...g),["stop"])),onDragend:t[5]||(t[5]=T.withModifiers((...g)=>e.handleDragEnd&&e.handleDragEnd(...g),["stop"])),onDrop:t[6]||(t[6]=T.withModifiers((...g)=>e.handleDrop&&e.handleDrop(...g),["stop"]))},[T.createElementVNode("div",{class:T.normalizeClass(e.ns.be("node","content")),style:T.normalizeStyle({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(T.openBlock(),T.createBlock(u,{key:0,class:T.normalizeClass([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:T.withModifiers(e.handleExpandIconClick,["stop"])},{default:T.withCtx(()=>[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):T.createCommentVNode("v-if",!0),e.showCheckbox?(T.openBlock(),T.createBlock(o,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=T.withModifiers(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):T.createCommentVNode("v-if",!0),e.node.loading?(T.openBlock(),T.createBlock(u,{key:2,class:T.normalizeClass([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:T.withCtx(()=>[T.createVNode(f)]),_:1},8,["class"])):T.createCommentVNode("v-if",!0),T.createVNode(h,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),T.createVNode(m,null,{default:T.withCtx(()=>[!e.renderAfterExpand||e.childNodeRendered?T.withDirectives((T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.node.childNodes,g=>(T.openBlock(),T.createBlock(p,{key:e.getNodeKey(g),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:g,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,zO)),[[T.vShow,e.expanded]]):T.createCommentVNode("v-if",!0)]),_:1})],42,jO)),[[T.vShow,e.node.visible]])}var ZO=e1(RO,[["render",$O],["__file","tree-node.vue"]]);function qO({el$:e},t){const r=Jt("tree"),n=T.shallowRef([]),i=T.shallowRef([]);T.onMounted(()=>{u()}),T.onUpdated(()=>{n.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))}),T.watch(i,o=>{o.forEach(f=>{f.setAttribute("tabindex","-1")})}),rn(e,"keydown",o=>{const f=o.target;if(!f.className.includes(r.b("node")))return;const h=o.code;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const p=n.value.indexOf(f);let m;if([a3.up,a3.down].includes(h)){if(o.preventDefault(),h===a3.up){m=p===-1?0:p!==0?p-1:n.value.length-1;const v=m;for(;!t.value.getNode(n.value[m].dataset.key).canFocus;){if(m--,m===v){m=-1;break}m<0&&(m=n.value.length-1)}}else{m=p===-1?0:p<n.value.length-1?p+1:0;const v=m;for(;!t.value.getNode(n.value[m].dataset.key).canFocus;){if(m++,m===v){m=-1;break}m>=n.value.length&&(m=0)}}m!==-1&&n.value[m].focus()}[a3.left,a3.right].includes(h)&&(o.preventDefault(),f.click());const g=f.querySelector('[type="checkbox"]');[a3.enter,a3.space].includes(h)&&g&&(o.preventDefault(),g.click())});const u=()=>{var o;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const f=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(f.length){f[0].setAttribute("tabindex","0");return}(o=n.value[0])==null||o.setAttribute("tabindex","0")}}const GO=T.defineComponent({name:"ElTree",components:{ElTreeNode:ZO},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:ln}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:r}=ri(),n=Jt("tree"),i=T.ref(new IO({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));i.value.initialize();const a=T.ref(i.value.root),u=T.ref(null),o=T.ref(null),f=T.ref(null),{broadcastExpanded:h}=sm(e),{dragState:p}=FO({props:e,ctx:t,el$:o,dropIndicator$:f,store:i});qO({el$:o},i);const m=T.computed(()=>{const{childNodes:Ee}=a.value;return!Ee||Ee.length===0||Ee.every(({visible:Ye})=>!Ye)});T.watch(()=>e.currentNodeKey,Ee=>{i.value.setCurrentNodeKey(Ee)}),T.watch(()=>e.defaultCheckedKeys,Ee=>{i.value.setDefaultCheckedKey(Ee)}),T.watch(()=>e.defaultExpandedKeys,Ee=>{i.value.setDefaultExpandedKeys(Ee)}),T.watch(()=>e.data,Ee=>{i.value.setData(Ee)},{deep:!0}),T.watch(()=>e.checkStrictly,Ee=>{i.value.checkStrictly=Ee});const g=Ee=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(Ee)},v=Ee=>au(e.nodeKey,Ee.data),b=Ee=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const Ye=i.value.getNode(Ee);if(!Ye)return[];const Pt=[Ye.data];let Ie=Ye.parent;for(;Ie&&Ie!==a.value;)Pt.push(Ie.data),Ie=Ie.parent;return Pt.reverse()},w=(Ee,Ye)=>i.value.getCheckedNodes(Ee,Ye),E=Ee=>i.value.getCheckedKeys(Ee),H=()=>{const Ee=i.value.getCurrentNode();return Ee?Ee.data:null},V=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const Ee=H();return Ee?Ee[e.nodeKey]:null},I=(Ee,Ye)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(Ee,Ye)},N=(Ee,Ye)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(Ee,Ye)},R=(Ee,Ye,Pt)=>{i.value.setChecked(Ee,Ye,Pt)},z=()=>i.value.getHalfCheckedNodes(),Z=()=>i.value.getHalfCheckedKeys(),K=(Ee,Ye=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");ou(i,t.emit,()=>i.value.setUserCurrentNode(Ee,Ye))},ee=(Ee,Ye=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");ou(i,t.emit,()=>i.value.setCurrentNodeKey(Ee,Ye))},ie=Ee=>i.value.getNode(Ee),de=Ee=>{i.value.remove(Ee)},ge=(Ee,Ye)=>{i.value.append(Ee,Ye)},Ce=(Ee,Ye)=>{i.value.insertBefore(Ee,Ye)},Re=(Ee,Ye)=>{i.value.insertAfter(Ee,Ye)},Ze=(Ee,Ye,Pt)=>{h(Ye),t.emit("node-expand",Ee,Ye,Pt)},tt=(Ee,Ye)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(Ee,Ye)};return T.provide("RootTree",{ctx:t,props:e,store:i,root:a,currentNode:u,instance:T.getCurrentInstance()}),T.provide(ra,void 0),{ns:n,store:i,root:a,currentNode:u,dragState:p,el$:o,dropIndicator$:f,isEmpty:m,filter:g,getNodeKey:v,getNodePath:b,getCheckedNodes:w,getCheckedKeys:E,getCurrentNode:H,getCurrentKey:V,setCheckedNodes:I,setCheckedKeys:N,setChecked:R,getHalfCheckedNodes:z,getHalfCheckedKeys:Z,setCurrentNode:K,setCurrentKey:ee,t:r,getNode:ie,remove:de,append:ge,insertBefore:Ce,insertAfter:Re,handleNodeExpand:Ze,updateKeyChildren:tt}}});function UO(e,t,r,n,i,a){const u=T.resolveComponent("el-tree-node");return T.openBlock(),T.createElementBlock("div",{ref:"el$",class:T.normalizeClass([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.root.childNodes,o=>(T.openBlock(),T.createBlock(u,{key:e.getNodeKey(o),node:o,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(e.ns.e("empty-block"))},[T.renderSlot(e.$slots,"empty",{},()=>{var o;return[T.createElementVNode("span",{class:T.normalizeClass(e.ns.e("empty-text"))},T.toDisplayString((o=e.emptyText)!=null?o:e.t("el.tree.emptyText")),3)]})],2)):T.createCommentVNode("v-if",!0),T.withDirectives(T.createElementVNode("div",{ref:"dropIndicator$",class:T.normalizeClass(e.ns.e("drop-indicator"))},null,2),[[T.vShow,e.dragState.showDropIndicator]])],2)}var Ls=e1(GO,[["render",UO],["__file","tree.vue"]]);Ls.install=e=>{e.component(Ls.name,Ls)};const cm=Ls;function WO(e){let t;const r=T.ref(!1),n=T.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function i(g){n.text=g}function a(){const g=n.parent,v=m.ns;if(!g.vLoadingAddClassList){let b=g.getAttribute("loading-number");b=Number.parseInt(b)-1,b?g.setAttribute("loading-number",b.toString()):(r6(g,v.bm("parent","relative")),g.removeAttribute("loading-number")),r6(g,v.bm("parent","hidden"))}u(),p.unmount()}function u(){var g,v;(v=(g=m.$el)==null?void 0:g.parentNode)==null||v.removeChild(m.$el)}function o(){var g;e.beforeClose&&!e.beforeClose()||(r.value=!0,clearTimeout(t),t=window.setTimeout(f,400),n.visible=!1,(g=e.closed)==null||g.call(e))}function f(){if(!r.value)return;const g=n.parent;r.value=!1,g.vLoadingAddClassList=void 0,a()}const h=T.defineComponent({name:"ElLoading",setup(g,{expose:v}){const{ns:b,zIndex:w}=LS("loading");return v({ns:b,zIndex:w}),()=>{const E=n.spinner||n.svg,H=T.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...E?{innerHTML:E}:{}},[T.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),V=n.text?T.h("p",{class:b.b("text")},[n.text]):void 0;return T.h(T.Transition,{name:b.b("fade"),onAfterLeave:f},{default:T.withCtx(()=>[T.withDirectives(T.createVNode("div",{style:{backgroundColor:n.background||""},class:[b.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[T.h("div",{class:b.b("spinner")},[H,V])]),[[T.vShow,n.visible]])])})}}}),p=T.createApp(h),m=p.mount(document.createElement("div"));return{...T.toRefs(n),setText:i,removeElLoadingChild:u,close:o,handleAfterLeave:f,vm:m,get $el(){return m.$el}}}let bs;const cu=function(e={}){if(!M2)return;const t=XO(e);if(t.fullscreen&&bs)return bs;const r=WO({...t,closed:()=>{var i;(i=t.closed)==null||i.call(t),t.fullscreen&&(bs=void 0)}});KO(t,t.parent,r),um(t,t.parent,r),t.parent.vLoadingAddClassList=()=>um(t,t.parent,r);let n=t.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",t.parent.setAttribute("loading-number",n),t.parent.appendChild(r.$el),T.nextTick(()=>r.visible.value=t.visible),t.fullscreen&&(bs=r),r},XO=e=>{var t,r,n,i;let a;return C2(e.target)?a=(t=document.querySelector(e.target))!=null?t:document.body:a=e.target||document.body,{parent:a===document.body||e.body?document.body:a,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:a===document.body&&((r=e.fullscreen)!=null?r:!0),lock:(n=e.lock)!=null?n:!1,customClass:e.customClass||"",visible:(i=e.visible)!=null?i:!0,target:a}},KO=async(e,t,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,i={};if(e.fullscreen)r.originalPosition.value=q5(document.body,"position"),r.originalOverflow.value=q5(document.body,"overflow"),i.zIndex=n();else if(e.parent===document.body){r.originalPosition.value=q5(document.body,"position"),await T.nextTick();for(const a of["top","left"]){const u=a==="top"?"scrollTop":"scrollLeft";i[a]=`${e.target.getBoundingClientRect()[a]+document.body[u]+document.documentElement[u]-Number.parseInt(q5(document.body,`margin-${a}`),10)}px`}for(const a of["height","width"])i[a]=`${e.target.getBoundingClientRect()[a]}px`}else r.originalPosition.value=q5(t,"position");for(const[a,u]of Object.entries(i))r.$el.style[a]=u},um=(e,t,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?r6(t,n.bm("parent","relative")):xc(t,n.bm("parent","relative")),e.fullscreen&&e.lock?xc(t,n.bm("parent","hidden")):r6(t,n.bm("parent","hidden"))},uu=Symbol("ElLoading"),Qm=(e,t)=>{var r,n,i,a;const u=t.instance,o=g=>i3(t.value)?t.value[g]:void 0,f=g=>{const v=C2(g)&&(u==null?void 0:u[g])||g;return v&&T.ref(v)},h=g=>f(o(g)||e.getAttribute(`element-loading-${Hb(g)}`)),p=(r=o("fullscreen"))!=null?r:t.modifiers.fullscreen,m={text:h("text"),svg:h("svg"),svgViewBox:h("svgViewBox"),spinner:h("spinner"),background:h("background"),customClass:h("customClass"),fullscreen:p,target:(n=o("target"))!=null?n:p?void 0:e,body:(i=o("body"))!=null?i:t.modifiers.body,lock:(a=o("lock"))!=null?a:t.modifiers.lock};e[uu]={options:m,instance:cu(m)}},JO=(e,t)=>{for(const r of Object.keys(t))T.isRef(t[r])&&(t[r].value=e[r])},ws={mounted(e,t){t.value&&Qm(e,t)},updated(e,t){const r=e[uu];t.oldValue!==t.value&&(t.value&&!t.oldValue?Qm(e,t):t.value&&t.oldValue?i3(t.value)&&JO(t.value,r.options):r==null||r.instance.close())},unmounted(e){var t;(t=e[uu])==null||t.instance.close()}},YO={install(e){e.directive("loading",ws),e.config.globalProperties.$loading=cu},directive:ws,service:cu},br=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},ek={name:"ExternalResourceCard",components:{Button:W4},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:T.shallowRef(zC)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){window.open(e,"_blank")}}},tk={class:"resource-container"};function rk(e,t,r,n,i,a){const u=W4;return T.openBlock(),T.createElementBlock("div",tk,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.resources,o=>(T.openBlock(),T.createElementBlock("div",{key:o.id,class:"resource"},[o.id==="pubmed"?(T.openBlock(),T.createBlock(u,{key:0,class:"button",icon:e.ElIconNotebook,onClick:f=>a.openUrl(o.url)},{default:T.withCtx(()=>[T.createTextVNode(" Open publications in pubmed ")]),_:2},1032,["icon","onClick"])):T.createCommentVNode("",!0)]))),128))])}const Tm=br(ek,[["render",rk],["__scopeId","data-v-1160491b"]]);function nk(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const Hs=new nk,ik=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),ak=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},ok={name:"ProvenancePopup",components:{Button:W4,Container:rO,Icon:U2,ExternalResourceCard:Tm,ElIconArrowUp:J0,ElIconArrowDown:sn,ElIconWarning:df},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Observed in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return ik(e)},capitalise:function(e){return ak(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Hs.emit("onActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name)})},openAxons:function(){Hs.emit("onActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name)})},openDendrites:function(){Hs.emit("onActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name)})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e}}},la=e=>(T.pushScopeId("data-v-5464af49"),e=e(),T.popScopeId(),e),sk={key:0,class:"main"},lk={key:0,class:"block"},ck={class:"title"},uk={key:0,class:"subtitle"},Qk={key:1,class:"block"},Tk={class:"title"},hk={class:"content-container scrollbar"},dk={key:0,class:"block"},fk=la(()=>T.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),pk={style:{"word-break":"keep-all"}},mk=la(()=>T.createElementVNode("i",null,"Origin",-1)),yk={key:0,class:"seperator"},gk={key:1,class:"block"},_k=la(()=>T.createElementVNode("div",{class:"attribute-title"},"Components",-1)),vk={key:0,class:"seperator"},xk={key:2,class:"block"},Lk=la(()=>T.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),bk=la(()=>T.createElementVNode("span",{style:{"word-break":"keep-all"}},[T.createElementVNode("i",null,"Destination"),T.createTextVNode(" is where the axons terminate ")],-1)),wk={key:0,class:"seperator"};function Hk(e,t,r,n,i,a){const u=J0,o=U2,f=sn,h=df,p=_s,m=W4,g=Tm,v=ws;return r.entry?T.withDirectives((T.openBlock(),T.createElementBlock("div",sk,[r.entry.title?(T.openBlock(),T.createElementBlock("div",lk,[T.createElementVNode("span",ck,T.toDisplayString(a.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(T.openBlock(),T.createElementBlock("div",uk,T.toDisplayString(a.provSpeciesDescription),1)):T.createCommentVNode("",!0)])):(T.openBlock(),T.createElementBlock("div",Qk,[T.createElementVNode("span",Tk,T.toDisplayString(r.entry.featureId),1)])),T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=b=>e.showDetails=!1)},[T.createTextVNode(" Hide path information "),T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(u)]),_:1})],512),[[T.vShow,e.showDetails]]),T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=b=>e.showDetails=!0)},[T.createTextVNode(" Show path information "),T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(f)]),_:1})],512),[[T.vShow,!e.showDetails]]),T.createVNode(T.Transition,{name:"slide-fade"},{default:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",hk,[T.createTextVNode(T.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(T.openBlock(),T.createElementBlock("div",dk,[T.createElementVNode("div",null,[fk,T.createVNode(p,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:T.withCtx(()=>[T.createVNode(o,{class:"info"},{default:T.withCtx(()=>[T.createVNode(h)]),_:1}),T.createElementVNode("span",pk,[mk,T.createTextVNode(" "+T.toDisplayString(a.originDescription),1)])]),_:1})]),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.entry.origins,(b,w)=>(T.openBlock(),T.createElementBlock("div",{class:"attribute-content",key:b},[T.createTextVNode(T.toDisplayString(a.capitalise(b))+" ",1),w!=r.entry.origins.length-1?(T.openBlock(),T.createElementBlock("div",yk)):T.createCommentVNode("",!0)]))),128)),T.withDirectives(T.createVNode(m,{class:"button",onClick:a.openDendrites},{default:T.withCtx(()=>[T.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[T.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0]])])):T.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(T.openBlock(),T.createElementBlock("div",gk,[_k,(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.entry.components,(b,w)=>(T.openBlock(),T.createElementBlock("div",{class:"attribute-content",key:b},[T.createTextVNode(T.toDisplayString(a.capitalise(b))+" ",1),w!=r.entry.components.length-1?(T.openBlock(),T.createElementBlock("div",vk)):T.createCommentVNode("",!0)]))),128))])):T.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(T.openBlock(),T.createElementBlock("div",xk,[T.createElementVNode("div",null,[Lk,T.createVNode(p,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:T.withCtx(()=>[T.createVNode(o,{class:"info"},{default:T.withCtx(()=>[T.createVNode(h)]),_:1}),bk]),_:1})]),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.entry.destinations,(b,w)=>(T.openBlock(),T.createElementBlock("div",{class:"attribute-content",key:b},[T.createTextVNode(T.toDisplayString(a.capitalise(b))+" ",1),w!=r.entry.destinations.length-1?(T.openBlock(),T.createElementBlock("div",wk)):T.createCommentVNode("",!0)]))),128)),T.withDirectives(T.createVNode(m,{class:"button",onClick:a.openAxons},{default:T.withCtx(()=>[T.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[T.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0]])])):T.createCommentVNode("",!0),T.withDirectives(T.createVNode(m,{class:"button",onClick:a.openAll},{default:T.withCtx(()=>[T.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[T.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0]]),T.createVNode(g,{resources:a.resources},null,8,["resources"])],512),[[T.vShow,e.showDetails]])]),_:1})])),[[v,e.loading]]):T.createCommentVNode("",!0)}const hm=br(ok,[["render",Hk],["__scopeId","data-v-5464af49"]]);var dm={},Ms={},fm={exports:{}};/*! js-cookie v3.0.5 | MIT */(function(e,t){(function(r,n){e.exports=n()})(D,function(){function r(u){for(var o=1;o<arguments.length;o++){var f=arguments[o];for(var h in f)u[h]=f[h]}return u}var n={read:function(u){return u[0]==='"'&&(u=u.slice(1,-1)),u.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(u){return encodeURIComponent(u).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function i(u,o){function f(p,m,g){if(!(typeof document>"u")){g=r({},o,g),typeof g.expires=="number"&&(g.expires=new Date(Date.now()+g.expires*864e5)),g.expires&&(g.expires=g.expires.toUTCString()),p=encodeURIComponent(p).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var v="";for(var b in g)g[b]&&(v+="; "+b,g[b]!==!0&&(v+="="+g[b].split(";")[0]));return document.cookie=p+"="+u.write(m,p)+v}}function h(p){if(!(typeof document>"u"||arguments.length&&!p)){for(var m=document.cookie?document.cookie.split("; "):[],g={},v=0;v<m.length;v++){var b=m[v].split("="),w=b.slice(1).join("=");try{var E=decodeURIComponent(b[0]);if(g[E]=u.read(w,E),p===E)break}catch{}}return p?g[p]:g}}return Object.create({set:f,get:h,remove:function(p,m){f(p,"",r({},m,{expires:-1}))},withAttributes:function(p){return i(this.converter,r({},this.attributes,p))},withConverter:function(p){return i(r({},this.converter,p),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(u)}})}var a=i(n,{path:"/"});return a})})(fm);var Mk=fm.exports,K4=D&&D.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},w2=D&&D.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ck=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},pn,ca,_3,J4,l6;Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.AnnotationService=void 0;const Cs=Ck(Mk),Ak=1e4;class Sk{constructor(t){pn.add(this),ca.set(this,void 0),_3.set(this,null),J4.set(this,null),t.slice(-1)==="/"?K4(this,ca,t.slice(0,-1),"f"):K4(this,ca,t,"f")}get currentUser(){return w2(this,J4,"f")}get currentError(){return w2(this,_3,"f")}async authenticate(){K4(this,_3,null,"f"),K4(this,J4,null,"f");const t=await w2(this,pn,"m",l6).call(this,"authenticate");return"error"in t?(Cs.default.remove("annotation-key"),Promise.resolve(w2(this,_3,"f"))):(Cs.default.set("annotation-key",t.session,{secure:!0,expires:1}),K4(this,J4,t.data,"f"),Promise.resolve(w2(this,J4,"f")))}async unauthenticate(){K4(this,_3,null,"f"),K4(this,J4,null,"f");const t=await w2(this,pn,"m",l6).call(this,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(w2(this,_3,"f"))}async annotatedItemIds(t){const r=await w2(this,pn,"m",l6).call(this,"items/","GET",{resource:t});return"error"in r?Promise.resolve(w2(this,_3,"f")):Promise.resolve(r)}async itemAnnotations(t,r){const n=await w2(this,pn,"m",l6).call(this,"annotations/","GET",{resource:t,item:r});return"error"in n?Promise.resolve(w2(this,_3,"f")):Promise.resolve(n)}async annotation(t){const r=await w2(this,pn,"m",l6).call(this,"annotation/","GET",{annotation:t});return"error"in r?Promise.resolve(w2(this,_3,"f")):Promise.resolve(r)}async addAnnotation(t){if(w2(this,J4,"f")&&w2(this,J4,"f").canUpdate){const r=Object.assign({creator:w2(this,J4,"f"),created:new Date().toISOString()},t),n=await w2(this,pn,"m",l6).call(this,"annotation/","POST",{data:r});if(!("error"in n))return Promise.resolve(n);K4(this,_3,n,"f")}else K4(this,_3,{error:"user cannot add annotation"},"f");return Promise.resolve(w2(this,_3,"f"))}}Ms.AnnotationService=Sk,ca=new WeakMap,_3=new WeakMap,J4=new WeakMap,pn=new WeakSet,l6=async function(t,r="GET",n={}){let i=!0;const a=new AbortController;setTimeout(()=>{i&&(console.log("Annotation server timeout..."),a.abort())},Ak);const u={method:r,signal:a.signal};let o=`${w2(this,ca,"f")}/${t}`;const f=Cs.default.get("user-token")||"",h=Cs.default.get("annotation-key")||"";if(r==="GET"){const m=[];for(const[g,v]of Object.entries(n))m.push(`${g}=${encodeURIComponent(JSON.stringify(v))}`);m.push(`key=${encodeURIComponent(f)}`),m.push(`session=${encodeURIComponent(h)}`),o+="?"+m.join("&"),u.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(r==="POST"){const m=Object.assign({key:f,session:h},n);u.body=JSON.stringify(m),u.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const p=await fetch(o,u);return i=!1,p.ok?Promise.resolve(await p.json()):(K4(this,_3,{error:`${p.status} ${p.statusText}`},"f"),Promise.resolve(w2(this,_3,"f")))},function(e){var t=D&&D.__createBinding||(Object.create?function(n,i,a,u){u===void 0&&(u=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,u,o)}:function(n,i,a,u){u===void 0&&(u=a),n[u]=i[a]}),r=D&&D.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ms,e)}(dm);const Ek={name:"AnnotationTool",components:{Button:W4,Col:Lr,Input:ls,Main:em,Row:X4,Select:di,ElIconArrowUp:J0,ElIconArrowDown:sn,ElIconEdit:Tf,ElIconClose:G5},props:{annotationEntry:{type:Object}},inject:["flatmapAPI"],data:function(){return{displayPair:{"Feature ID":"featureId",Tooltip:"label",Models:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:["DOI:","PMID:"],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:""}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId}},methods:{evidenceEntered:function(e){e&&(this.evidence.push(this.evidencePrefix+e),this.newEvidence="")},formatTime:function(e){const t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(e).toLocaleDateString(void 0,t)},updatePrevSubmissions:function(){this.$annotator&&this.authenticated&&this.annotationEntry.resourceId&&this.annotationEntry.featureId&&this.$annotator.itemAnnotations(this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)})},submit:function(){if((this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const n=r.replace("DOI:","https://doi.org/");e.push(new URL(n))}else if(r.includes("PMID:")){const n=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(n))}});const t={resource:this.annotationEntry.resourceId,item:this.annotationEntry.featureId,evidence:e,comment:this.comment};this.$annotator.addAnnotation(t).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"})}},removeEvidence:function(e){this.evidence.splice(e,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""}},watch:{annotationEntry:{handler:function(){this.resetSubmission(),this.updatePrevSubmissions()},immediate:!1,deep:!1}},mounted:function(){this.$annotator||(this.$annotator=new dm.AnnotationService(`${this.flatmapAPI}annotator`)),this.$annotator.authenticate().then(e=>{e.name&&e.email?(this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},c6=e=>(T.pushScopeId("data-v-23ee0a25"),e=e(),T.popScopeId(),e),Vk={class:"block"},Dk=c6(()=>T.createElementVNode("span",{class:"title"},"Feature Annotations",-1)),Ok=c6(()=>T.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),kk=c6(()=>T.createElementVNode("strong",null,"Evidence: ",-1)),Pk=["href"],Ik=c6(()=>T.createElementVNode("strong",null,"Comment: ",-1)),Bk=c6(()=>T.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),Nk=c6(()=>T.createElementVNode("strong",null,"Evidvence:",-1)),Fk=c6(()=>T.createElementVNode("strong",null,"Comment:",-1)),Rk={class:"sub-title"};function jk(e,t,r,n,i,a){const u=X4,o=J0,f=U2,h=sn,p=Tf,m=Lr,g=G5,v=gs,b=di,w=ls,E=W4,H=em;return T.openBlock(),T.createBlock(H,{class:"main"},{default:T.withCtx(()=>[T.createElementVNode("div",Vk,[T.createVNode(u,{class:"info-field"},{default:T.withCtx(()=>[Dk]),_:1}),r.annotationEntry?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.displayPair,(V,I)=>T.withDirectives((T.openBlock(),T.createBlock(u,{class:"dialog-text",key:V},{default:T.withCtx(()=>[T.createElementVNode("strong",null,T.toDisplayString(I)+": ",1),T.createTextVNode(" "+T.toDisplayString(r.annotationEntry[V]),1)]),_:2},1024)),[[T.vShow,r.annotationEntry[V]]])),128)),e.prevSubs.length>0?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=V=>e.showSubmissions=!1)},[T.createTextVNode(" Hide previous submissions "),T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(o)]),_:1})],512),[[T.vShow,e.showSubmissions]]),T.withDirectives(T.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=V=>e.showSubmissions=!0)},[T.createTextVNode(" Show previous "+T.toDisplayString(e.prevSubs.length)+" submission(s) ",1),T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(h)]),_:1})],512),[[T.vShow,!e.showSubmissions]]),e.showSubmissions?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createVNode(u,{class:"dialog-spacer"}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Ok]),_:1}),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.prevSubs,(V,I)=>(T.openBlock(),T.createElementBlock("div",{class:"entry",key:I},[T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[T.createElementVNode("strong",null,T.toDisplayString(a.formatTime(V.created)),1),T.createTextVNode(" "+T.toDisplayString(V.creator.name),1)]),_:2},1024),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[kk,(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(V.evidence,N=>(T.openBlock(),T.createBlock(u,{key:N,class:"dialog-text"},{default:T.withCtx(()=>[T.createElementVNode("a",{href:N,target:"_blank"},T.toDisplayString(N),9,Pk)]),_:2},1024))),128))]),_:2},1024),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Ik,T.createTextVNode(" "+T.toDisplayString(V.comment),1)]),_:2},1024)]))),128))],64)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0),e.authenticated?(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[a.isEditable?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[T.createVNode(u,{class:"dialog-spacer"}),e.editing?(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Bk]),_:1}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[Nk]),_:1}),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.evidence,(V,I)=>(T.openBlock(),T.createBlock(u,{key:V},{default:T.withCtx(()=>[T.createVNode(m,{span:20},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(e.evidence[I]),1)]),_:2},1024),T.createVNode(m,{span:4},{default:T.withCtx(()=>[T.createVNode(f,{class:"standard-icon"},{default:T.withCtx(()=>[T.createVNode(g)]),_:1})]),_:1})]),_:2},1024))),128)),T.createVNode(u,null,{default:T.withCtx(()=>[T.createVNode(w,{size:"mini",placeholder:"Enter",modelValue:e.newEvidence,"onUpdate:modelValue":t[3]||(t[3]=V=>e.newEvidence=V),onChange:t[4]||(t[4]=V=>a.evidenceEntered(V))},{prepend:T.withCtx(()=>[T.createVNode(b,{teleported:!1,modelValue:e.evidencePrefix,"onUpdate:modelValue":t[2]||(t[2]=V=>e.evidencePrefix=V),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.evidencePrefixes,V=>(T.openBlock(),T.createBlock(v,{key:V,label:V,value:V},{default:T.withCtx(()=>[T.createVNode(u,null,{default:T.withCtx(()=>[T.createVNode(m,{span:12},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(V),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1}),T.createVNode(u,null,{default:T.withCtx(()=>[Fk]),_:1}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[T.createVNode(w,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:e.comment,"onUpdate:modelValue":t[5]||(t[5]=V=>e.comment=V)},null,8,["modelValue"])]),_:1}),T.createVNode(u,{class:"dialog-text"},{default:T.withCtx(()=>[T.createVNode(E,{class:"button",type:"primary",plain:"",onClick:a.submit},{default:T.withCtx(()=>[T.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(T.openBlock(),T.createBlock(u,{key:0},{default:T.withCtx(()=>[T.createVNode(f,{class:"standard-icon"},{default:T.withCtx(()=>[T.createVNode(p)]),_:1})]),_:1})),e.errorMessage?(T.openBlock(),T.createBlock(u,{key:2,class:"dialog-text"},{default:T.withCtx(()=>[T.createElementVNode("strong",Rk,T.toDisplayString(e.errorMessage),1)]),_:1})):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)])]),_:1})}const pm=br(Ek,[["render",jk],["__scopeId","data-v-23ee0a25"]]),zk={name:"Tooltip",components:{AnnotationTool:pm,ProvenancePopup:hm},props:{entry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}}},$k={class:"tooltip-container"};function Zk(e,t,r,n,i,a){const u=pm,o=hm;return T.openBlock(),T.createElementBlock("div",$k,[r.annotationDisplay?(T.openBlock(),T.createBlock(u,{key:0,annotationEntry:r.annotationEntry},null,8,["annotationEntry"])):(T.openBlock(),T.createBlock(o,{key:1,entry:r.entry},null,8,["entry"]))])}const Qu=br(zk,[["render",Zk],["__scopeId","data-v-193cf123"]]),qk={name:"SelectionsGroup",components:{Checkbox:fs,CheckboxGroup:eu,Col:Lr,Row:X4},methods:{reset:function(){this.checkAll=!0,this.checkedItems=[],this.selections.forEach(e=>{!("enabled"in e)||e.enabled===!0?this.checkedItems.push(e[this.identifierKey]):this.checkAll=!1})},visibilityToggle:function(e,t){this.$emit("changed",{key:e,value:t})},handleCheckedItemsChange:function(e){let t=e.length;this.checkAll=t===this.selections.length},handleCheckAllChange:function(e){this.checkedItems=e?this.selections.map(t=>t[this.identifierKey]):[],this.$emit("checkAll",{keys:this.selections.map(t=>t[this.identifierKey]),value:e})},getBackgroundStyles:function(e){return"colour"in e&&this.colourStyle==="background"?{background:e.colour}:{}},hasLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}}},props:{colourStyle:{type:String,default:"line"},identifierKey:{type:String,default:"id"},labelKey:{type:String,default:"label"},title:{type:String,default:""},selections:{type:Array,default:function(){return[]}}},computed:{isIndeterminate:function(){return!(this.checkedItems.length===0||this.checkAll)}},data:function(){return{checkedItems:[],checkAll:!0}},mounted:function(){this.reset()}},Gk={class:"selections-container"},Uk={class:"checkall-display-text"},Wk={class:"checkbox-group-inner"},Xk={class:"checkbox-container"};function Kk(e,t,r,n,i,a){const u=Lr,o=fs,f=X4,h=eu;return T.openBlock(),T.createElementBlock("div",Gk,[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(u,{span:12},{default:T.withCtx(()=>[T.createElementVNode("div",Uk,T.toDisplayString(r.title),1)]),_:1}),T.createVNode(u,{span:12},{default:T.withCtx(()=>[r.selections&&r.selections.length>1?(T.openBlock(),T.createBlock(o,{key:0,class:"all-checkbox",indeterminate:a.isIndeterminate,modelValue:e.checkAll,"onUpdate:modelValue":t[0]||(t[0]=p=>e.checkAll=p),onChange:a.handleCheckAllChange},{default:T.withCtx(()=>[T.createTextVNode("Display all")]),_:1},8,["indeterminate","modelValue","onChange"])):T.createCommentVNode("",!0)]),_:1})]),_:1}),T.createVNode(h,{modelValue:e.checkedItems,"onUpdate:modelValue":t[1]||(t[1]=p=>e.checkedItems=p),size:"small",class:"checkbox-group",onChange:a.handleCheckedItemsChange},{default:T.withCtx(()=>[T.createElementVNode("div",Wk,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.selections,p=>(T.openBlock(),T.createBlock(f,{key:p[r.identifierKey],label:p[r.identifierKey]},{default:T.withCtx(()=>[T.createElementVNode("div",Xk,[T.createVNode(o,{class:"my-checkbox",label:p[r.identifierKey],onChange:m=>a.visibilityToggle(p[r.identifierKey],m),checked:!("enabled"in p)||p.enabled===!0},{default:T.withCtx(()=>[T.createVNode(f,{class:"checkbox-row"},{default:T.withCtx(()=>[a.hasLineStyles(p)?(T.openBlock(),T.createBlock(u,{key:0,span:4},{default:T.withCtx(()=>[T.createElementVNode("div",{class:"path-visual",style:T.normalizeStyle(a.getLineStyles(p))},null,4)]),_:2},1024)):T.createCommentVNode("",!0),T.createVNode(u,{span:20},{default:T.withCtx(()=>[T.createElementVNode("div",{style:T.normalizeStyle(a.getBackgroundStyles(p))},T.toDisplayString(p[r.labelKey]),5)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","onChange","checked"])])]),_:2},1032,["label"]))),128))])]),_:1},8,["modelValue","onChange"])])}const mm=br(qk,[["render",Kk],["__scopeId","data-v-9c4fff49"]]),Jk={name:"TreeControls",components:{Checkbox:fs,CheckboxGroup:eu,ColorPicker:$D,Row:X4,Tree:cm},props:{treeData:{type:Array,default:function(){return[]}},active:{type:String,default:""},hover:{type:String,default:""}},data:function(){return{defaultExpandedKeys:["All"]}},unmounted:function(){this.sortedPrimitiveGroups=void 0},methods:{nodeIsActive:function(e){return this.active===e.models},nodeIsHover:function(e){return this.hover===e.models},changeActiveByNode:function(e){e.models&&this.$emit("change-active",e.models)},changeHoverByNode:function(){},checkChanged:function(e,t){const r=t.checkedKeys.includes(e.key);e.key==="All"?this.$emit("checkAll",r):this.$emit("changed",{key:e.key,value:r})},getBackgroundStyles:function(e){return"colour"in e?{background:e.colour}:{}}}},Yk=e=>(T.pushScopeId("data-v-27e4d901"),e=e(),T.popScopeId(),e),eP={class:"container"},tP=Yk(()=>T.createElementVNode("div",{class:"title-text"},"Systems",-1)),rP={class:"tree-container"},nP=["onClick","onMouseover"];function iP(e,t,r,n,i,a){const u=Lr,o=X4,f=cm;return T.openBlock(),T.createElementBlock("div",eP,[T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(u,{span:12},{default:T.withCtx(()=>[tP]),_:1})]),_:1}),T.createElementVNode("div",rP,[T.createVNode(f,{ref:"tree","node-key":"key","show-checkbox":"","check-strictly":!1,data:r.treeData,"render-after-expand":!1,"default-expanded-keys":e.defaultExpandedKeys,onCheck:a.checkChanged},{default:T.withCtx(({node:h,data:p})=>[T.createElementVNode("span",{class:T.normalizeClass(["region-tree-node",{activeItem:a.nodeIsActive(p),hoverItem:a.nodeIsHover(p)}]),onClick:m=>a.changeActiveByNode(p),onMouseover:m=>a.changeHoverByNode(p)},[T.createElementVNode("div",{style:T.normalizeStyle(a.getBackgroundStyles(p))},T.toDisplayString(h.label),5)],42,nP)]),_:1},8,["data","default-expanded-keys","onCheck"])])])}const ym=br(Jk,[["render",iP],["__scopeId","data-v-27e4d901"]]),aP={name:"SvgLegends"},oP=e=>(T.pushScopeId("data-v-7a368b29"),e=e(),T.popScopeId(),e),sP={class:"legends-container"},lP={version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 500 500",style:{"enable-background":"new 0 0 500 500"},xmlns:"http://www.w3.org/2000/svg","xmlns:bx":"https://boxy-svg.com"},cP=[T.createStaticVNode('<defs data-v-7a368b29><bx:grid height="30.447" width="32.516" x="0" y="0" data-v-7a368b29></bx:grid></defs><path class="st0 st0-translate" d="M61.3,103.8c-15.9,0-28.8-12.3-28.8-27.3c0-15,13-27.3,28.8-27.3s28.8,12.3,28.8,27.3 C90.1,91.5,77.2,103.8,61.3,103.8z" data-v-7a368b29></path><path class="st1" d="M40.3,356.1C29.5,345,29.8,328,41.5,317.5c11.7-10.5,29.6-9.9,40.7,1.1c11.1,11,10.5,28.1-1.2,38.5 C69.3,367.4,51.1,366.9,40.3,356.1z" data-v-7a368b29></path><path class="st2" d="M61.2,396.9c-5.3,9.3-15.3,15.1-26.1,15.1l-0.4,0.6c5.1,9,5.1,20,0,29l0.4,0.6c10.7,0,20.8,5.8,26.1,15.1 c5.3-9.3,15.3-15.1,26.1-15.1c-5.3-9.3-5.3-20.9,0-30.4C76.6,412.1,66.7,406.3,61.2,396.9z" data-v-7a368b29></path><text transform="matrix(0.9908 0 0 1 118.0161 171.7975)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Tissue region </text><path class="st6" d="M40.9,231.1c11.3-10.6,29.5-10.6,40.8,0c11.3,10.6,11.3,27.9,0,38.5c-11.3,10.6-29.5,10.6-40.8,0 C29.7,259,29.7,241.7,40.9,231.1z" data-v-7a368b29></path><text transform="matrix(0.9908 0 0 1 118.0161 257.675)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Brain nuclei </text><text transform="matrix(0.9908 0 0 1 118.0903 345.5266)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Ganglia </text><text transform="matrix(0.9908 0 0 1 118.0903 433.1613)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Ganglionated nerve plexus </text>',9)],uP=oP(()=>T.createElementVNode("svg",{width:"72px",height:"72px",viewBox:"0 0 24 24",fill:"yellow"},null,-1));function QP(e,t,r,n,i,a){return T.openBlock(),T.createElementBlock("div",sP,[(T.openBlock(),T.createElementBlock("svg",lP,cP)),uP])}const gm=br(aP,[["render",QP],["__scopeId","data-v-7a368b29"]]),TP='<div class="flatmap-marker"><svg display="block" height="41px" width="27px" viewBox="0 0 27 41"><g fill-rule="nonzero"><g transform="translate(3.0, 29.0)" fill="#000000"><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="9.5" ry="4.77275007"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="8.5" ry="4.29549936"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="7.5" ry="3.81822308"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="6.5" ry="3.34094679"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="5.5" ry="2.86367051"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="4.5" ry="2.38636864"></ellipse></g><g fill="#005974"><path 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"></path></g><g opacity="0.25" fill="#000000"><path 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"></path></g><g transform="translate(6.0, 7.0)" fill="#FFFFFF"></g><g transform="translate(8.0, 8.0)"><circle fill="#000000" opacity="0.25" cx="5.5" cy="5.5" r="5.4999962"></circle><circle fill="#FFFFFF" cx="5.5" cy="5.5" r="5.4999962"></circle></g></g></svg></div>',As=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},ua={},_m=async function(e,t){return ua&&ua.hasOwnProperty(t)?ua[t]:new Promise(r=>{fetch(`${e}knowledge/label/${t}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),ua[t]=i,r(i)}).catch(n=>{console.error("Error:",n),ua[t]=t,r(t)})})},Ss=function(e,t){let r=JSON.stringify(e),n=JSON.stringify(t);return r.indexOf(n)!==-1};let hP=function(){this.initialise=function(e){this.flatmapApi=e,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(e){let t=[];e.feature.hyperlinks&&e.feature.hyperlinks.length>0?t=e.feature.hyperlinks:t=this.urls.map(i=>({url:i,id:"pubmed"}));let r;if(e.provenanceTaxonomy){r=[];for(let i=0;e.provenanceTaxonomy.length>i;i++)r.push(await _m(this.flatmapAPI,e.provenanceTaxonomy[i]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:e.label,featureId:e.resource,hyperlinks:t,provenanceTaxonomy:e.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(e,t){let r=[];return e.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),t),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),t)}),r},this.createLabelLookup=function(e){return new Promise(t=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(e)};fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{const a=i.keys.indexOf("entity"),u=i.keys.indexOf("label");a>-1&&u>-1&&i.values.forEach(o=>{r[o[a]]=o[u],this.uberons.push({id:o[a],name:o[u]})}),t(r)})})},this.buildConnectivitySqlStatement=function(e){let t="select knowledge from knowledge where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildLabelSqlStatement=function(e){let t="select entity, label from labels where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.findAllIdsFromConnectivity=function(e){let t=e.connectivity.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=As(t),n=[],i=!1;return r.forEach(a=>{i=!1,Ss(e.axons,a)&&(i=!0),Ss(e.dendrites,a)&&(i=!0),i||n.push(a)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(e){this.controller&&this.controller.abort(),this.controller=new AbortController;const t=this.controller.signal,r=e.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;const n={sql:this.buildConnectivitySqlStatement(r)};let i=new Promise(o=>{fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:t}).then(f=>f.json()).then(f=>{if(this.connectivityExists(f)){let h=JSON.parse(f.values[0][0]);this.processConnectivity(h).then(()=>{o(!0)})}else o(!1)}).catch(f=>{console.error("Error:",f),o(!1)})}),a=await this.pubmedQueryOnIds(e);return await Promise.all([i,a])},this.connectivityExists=function(e){return!!(e.values&&e.values.length>0&&JSON.parse(e.values[0][0]).connectivity&&JSON.parse(e.values[0][0]).connectivity.length>0)},this.createLabelFromNeuralNode=function(e,t){let r=t[e[0]];return e.length===2&&e[1].length>0&&e[1].forEach(n=>{t[n]==null?r+=`, ${n}`:r+=`, ${t[n]}`}),r},this.flattenAndFindDatasets=function(e,t,r){let n=this.flattenConntectivity(e),i=this.flattenConntectivity(t),a=this.flattenConntectivity(r);this.destinationsWithDatasets=this.uberons.filter(u=>i.indexOf(u.id)!==-1),this.originsWithDatasets=this.uberons.filter(u=>a.indexOf(u.id)!==-1),this.componentsWithDatasets=this.uberons.filter(u=>n.indexOf(u.id)!==-1)},this.processConnectivity=function(e){return new Promise(t=>{let r=this.findComponents(e),n=As(e.axons),i=As(e.dendrites),a=this.findAllIdsFromConnectivity(e);this.createLabelLookup(a).then(u=>{this.destinations=n.map(o=>this.createLabelFromNeuralNode(o,u)),this.origins=i.map(o=>this.createLabelFromNeuralNode(o,u)),this.components=r.map(o=>this.createLabelFromNeuralNode(o,u)),this.flattenAndFindDatasets(r,n,i),t(!0)})})},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=As(t),n=[],i=!1;return r.forEach(a=>{i=!1,Ss(e.axons,a)&&(i=!0),Ss(e.dendrites,a)&&(i=!0),i||n.push(a)}),n},this.stripPMIDPrefix=function(e){return e.split(":")[1]},this.buildPubmedSqlStatement=function(e){let t="select distinct publication from publications where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildPubmedSqlStatementForModels=function(e){return`select distinct publication from publications where entity = '${e}'`},this.flatmapQuery=function(e){const t={sql:e};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(e){return new Promise(t=>{const r=e.resource,n=e.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(a=>{a.values.length>0?(this.urls=[this.pubmedSearchUrl(a.values.map(u=>this.stripPMIDPrefix(u[0])))],t(!0)):this.pubmedQueryOnModels(n).then(u=>{t(u)})})})},this.pubmedQueryOnModels=function(e){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(e)).then(t=>Array.isArray(t.values)&&t.values.length>0?(this.urls=[this.pubmedSearchUrl(t.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(e){let t="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;return r.append("term",e),t+r.toString()}};const dP='<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow"><path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/><text x="42" y="50%" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#000000">Featured dataset marker</text></svg>';var vm={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof window<"u"?window:D,function(){if(typeof window>"u")return null;var r=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),n=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(p){return r.setTimeout(p,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(p){r.clearTimeout(p)};function a(p,m){var g=Object.prototype.toString.call(p),v=g==="[object Array]"||g==="[object NodeList]"||g==="[object HTMLCollection]"||g==="[object Object]"||typeof jQuery<"u"&&p instanceof jQuery||typeof Elements<"u"&&p instanceof Elements,b=0,w=p.length;if(v)for(;b<w;b++)m(p[b]);else m(p)}function u(p){if(!p.getBoundingClientRect)return{width:p.offsetWidth,height:p.offsetHeight};var m=p.getBoundingClientRect();return{width:Math.round(m.width),height:Math.round(m.height)}}function o(p,m){Object.keys(m).forEach(function(g){p.style[g]=m[g]})}var f=function(p,m){var g=0;function v(){var w=[];this.add=function(V){w.push(V)};var E,H;this.call=function(V){for(E=0,H=w.length;E<H;E++)w[E].call(this,V)},this.remove=function(V){var I=[];for(E=0,H=w.length;E<H;E++)w[E]!==V&&I.push(w[E]);w=I},this.length=function(){return w.length}}function b(w,E){if(w){if(w.resizedAttached){w.resizedAttached.add(E);return}w.resizedAttached=new v,w.resizedAttached.add(E),w.resizeSensor=document.createElement("div"),w.resizeSensor.dir="ltr",w.resizeSensor.className="resize-sensor";var H={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},V={position:"absolute",left:"0px",top:"0px",transition:"0s"};o(w.resizeSensor,H);var I=document.createElement("div");I.className="resize-sensor-expand",o(I,H);var N=document.createElement("div");o(N,V),I.appendChild(N);var R=document.createElement("div");R.className="resize-sensor-shrink",o(R,H);var z=document.createElement("div");o(z,V),o(z,{width:"200%",height:"200%"}),R.appendChild(z),w.resizeSensor.appendChild(I),w.resizeSensor.appendChild(R),w.appendChild(w.resizeSensor);var Z=window.getComputedStyle(w),K=Z?Z.getPropertyValue("position"):null;K!=="absolute"&&K!=="relative"&&K!=="fixed"&&K!=="sticky"&&(w.style.position="relative");var ee=!1,ie=0,de=u(w),ge=0,Ce=0,Re=!0;g=0;var Ze=function(){var Ie=w.offsetWidth,Xe=w.offsetHeight;N.style.width=Ie+10+"px",N.style.height=Xe+10+"px",I.scrollLeft=Ie+10,I.scrollTop=Xe+10,R.scrollLeft=Ie+10,R.scrollTop=Xe+10},tt=function(){if(Re){var Ie=w.offsetWidth===0&&w.offsetHeight===0;if(Ie){g||(g=n(function(){g=0,tt()}));return}else Re=!1}Ze()};w.resizeSensor.resetSensor=tt;var Ee=function(){ie=0,ee&&(ge=de.width,Ce=de.height,w.resizedAttached&&w.resizedAttached.call(de))},Ye=function(){de=u(w),ee=de.width!==ge||de.height!==Ce,ee&&!ie&&(ie=n(Ee)),tt()},Pt=function(Ie,Xe,Tt){Ie.attachEvent?Ie.attachEvent("on"+Xe,Tt):Ie.addEventListener(Xe,Tt)};Pt(I,"scroll",Ye),Pt(R,"scroll",Ye),g=n(function(){g=0,tt()})}}a(p,function(w){b(w,m)}),this.detach=function(w){g||(i(g),g=0),f.detach(p,w)},this.reset=function(){p.resizeSensor.resetSensor()}};if(f.reset=function(p){a(p,function(m){m.resizeSensor.resetSensor()})},f.detach=function(p,m){a(p,function(g){g&&(g.resizedAttached&&typeof m=="function"&&(g.resizedAttached.remove(m),g.resizedAttached.length())||g.resizeSensor&&(g.contains(g.resizeSensor)&&g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached))})},typeof MutationObserver<"u"){var h=new MutationObserver(function(p){for(var m in p)if(p.hasOwnProperty(m))for(var g=p[m].addedNodes,v=0;v<g.length;v++)g[v].resizeSensor&&f.reset(g[v])});document.addEventListener("DOMContentLoaded",function(p){h.observe(document.body,{childList:!0,subtree:!0})})}return f})})(vm);var fP=vm.exports;const pP=Yc(fP);var xm={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(D,function(){var r,n,i;function a(o,f){if(!r)r=f;else if(!n)n=f;else{var h="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",p={};r(p),i=f(p),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([h],{type:"text/javascript"})))}}a(["exports"],function(o){function f(c,s,Q,y){return new(Q||(Q=Promise))(function(x,C){function S(j){try{B(y.next(j))}catch(q){C(q)}}function O(j){try{B(y.throw(j))}catch(q){C(q)}}function B(j){var q;j.done?x(j.value):(q=j.value,q instanceof Q?q:new Q(function(X){X(q)})).then(S,O)}B((y=y.apply(c,s||[])).next())})}function h(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}typeof SuppressedError=="function"&&SuppressedError;var p=m;function m(c,s){this.x=c,this.y=s}m.prototype={clone:function(){return new m(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,s){return this.clone()._rotateAround(c,s)},matMult:function(c){return this.clone()._matMult(c)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var s=c.x-this.x,Q=c.y-this.y;return s*s+Q*Q},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,s){return Math.atan2(this.x*s-this.y*c,this.x*c+this.y*s)},_matMult:function(c){var s=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=s,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var s=Math.cos(c),Q=Math.sin(c),y=Q*this.x+s*this.y;return this.x=s*this.x-Q*this.y,this.y=y,this},_rotateAround:function(c,s){var Q=Math.cos(c),y=Math.sin(c),x=s.y+y*(this.x-s.x)+Q*(this.y-s.y);return this.x=s.x+Q*(this.x-s.x)-y*(this.y-s.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},m.convert=function(c){return c instanceof m?c:Array.isArray(c)?new m(c[0],c[1]):c};var g=h(p),v=b;function b(c,s,Q,y){this.cx=3*c,this.bx=3*(Q-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(y-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=s,this.p2x=Q,this.p2y=y}b.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,s){if(s===void 0&&(s=1e-6),c<0)return 0;if(c>1)return 1;for(var Q=c,y=0;y<8;y++){var x=this.sampleCurveX(Q)-c;if(Math.abs(x)<s)return Q;var C=this.sampleCurveDerivativeX(Q);if(Math.abs(C)<1e-6)break;Q-=x/C}var S=0,O=1;for(Q=c,y=0;y<20&&(x=this.sampleCurveX(Q),!(Math.abs(x-c)<s));y++)c>x?S=Q:O=Q,Q=.5*(O-S)+S;return Q},solve:function(c,s){return this.sampleCurveY(this.solveCurveX(c,s))}};var w=h(v);let E,H;function V(){return E==null&&(E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),E}function I(){if(H==null&&(H=!1,V())){const s=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(s){for(let y=0;y<5*5;y++){const x=4*y;s.fillStyle=`rgb(${x},${x+1},${x+2})`,s.fillRect(y%5,Math.floor(y/5),1,1)}const Q=s.getImageData(0,0,5,5).data;for(let y=0;y<5*5*4;y++)if(y%4!=3&&Q[y]!==y){H=!0;break}}}return H||!1}function N(c,s,Q,y){const x=new w(c,s,Q,y);return function(C){return x.solve(C)}}const R=N(.25,.1,.25,1);function z(c,s,Q){return Math.min(Q,Math.max(s,c))}function Z(c,s,Q){const y=Q-s,x=((c-s)%y+y)%y+s;return x===s?Q:x}function K(c,...s){for(const Q of s)for(const y in Q)c[y]=Q[y];return c}let ee=1;function ie(c,s,Q){const y={};for(const x in c)y[x]=s.call(Q||this,c[x],x,c);return y}function de(c,s,Q){const y={};for(const x in c)s.call(Q||this,c[x],x,c)&&(y[x]=c[x]);return y}function ge(c){return Array.isArray(c)?c.map(ge):typeof c=="object"&&c?ie(c,ge):c}const Ce={};function Re(c){Ce[c]||(typeof console<"u"&&console.warn(c),Ce[c]=!0)}function Ze(c,s,Q){return(Q.y-c.y)*(s.x-c.x)>(s.y-c.y)*(Q.x-c.x)}function tt(c){let s=0;for(let Q,y,x=0,C=c.length,S=C-1;x<C;S=x++)Q=c[x],y=c[S],s+=(y.x-Q.x)*(Q.y+y.y);return s}function Ee(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let Ye=null;function Pt(c){return typeof ImageBitmap<"u"&&c instanceof ImageBitmap}const Ie="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Xe(c,s,Q,y,x){return f(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const C=new VideoFrame(c,{timestamp:0});try{const S=C==null?void 0:C.format;if(!S||!S.startsWith("BGR")&&!S.startsWith("RGB"))throw new Error(`Unrecognized format ${S}`);const O=S.startsWith("BGR"),B=new Uint8ClampedArray(y*x*4);if(yield C.copyTo(B,function(j,q,X,Y,re){const ae=4*Math.max(-q,0),le=(Math.max(0,X)-X)*Y*4+ae,fe=4*Y,ye=Math.max(0,q),He=Math.max(0,X);return{rect:{x:ye,y:He,width:Math.min(j.width,q+Y)-ye,height:Math.min(j.height,X+re)-He},layout:[{offset:le,stride:fe}]}}(c,s,Q,y,x)),O)for(let j=0;j<B.length;j+=4){const q=B[j];B[j]=B[j+2],B[j+2]=q}return B}finally{C.close()}})}let Tt,Je,yt,At;const Et={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(c){const s=requestAnimationFrame(c);return{cancel:()=>cancelAnimationFrame(s)}},getImageData(c,s=0){return this.getImageCanvasContext(c).getImageData(-s,-s,c.width+2*s,c.height+2*s)},getImageCanvasContext(c){const s=window.document.createElement("canvas"),Q=s.getContext("2d",{willReadFrequently:!0});if(!Q)throw new Error("failed to create canvas 2d context");return s.width=c.width,s.height=c.height,Q.drawImage(c,0,0,c.width,c.height),Q},resolveURL:c=>(yt||(yt=document.createElement("a")),yt.href=c,yt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(At==null&&(At=matchMedia("(prefers-reduced-motion: reduce)")),At.matches)}},Ve={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Ne extends Error{constructor(s,Q,y,x){super(`AJAXError: ${Q} (${s}): ${y}`),this.status=s,this.statusText=Q,this.url=y,this.body=x}}const ut=Ee()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,ze=c=>Ve.REGISTERED_PROTOCOLS[c.substring(0,c.indexOf("://"))];function Ke(c,s){const Q=new AbortController,y=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,cache:c.cache,referrer:ut(),signal:Q.signal});let x=!1,C=!1;return c.type==="json"&&y.headers.set("Accept","application/json"),C||fetch(y).then(S=>S.ok?(O=>{(c.type==="arrayBuffer"||c.type==="image"?O.arrayBuffer():c.type==="json"?O.json():O.text()).then(B=>{C||(x=!0,s(null,B,O.headers.get("Cache-Control"),O.headers.get("Expires")))}).catch(B=>{C||s(new Error(B.message))})})(S):S.blob().then(O=>s(new Ne(S.status,S.statusText,c.url,O)))).catch(S=>{S.code!==20&&s(new Error(S.message))}),{cancel:()=>{C=!0,x||Q.abort()}}}const gt=function(c,s){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(Ee()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s);if(!Ee())return(ze(c.url)||Ke)(c,s)}if(!(/^file:/.test(Q=c.url)||/^file:/.test(ut())&&!/^\w+:/.test(Q))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Ke(c,s);if(Ee()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,s,void 0,!0)}var Q;return function(y,x){const C=new XMLHttpRequest;C.open(y.method||"GET",y.url,!0),y.type!=="arrayBuffer"&&y.type!=="image"||(C.responseType="arraybuffer");for(const S in y.headers)C.setRequestHeader(S,y.headers[S]);return y.type==="json"&&(C.responseType="text",C.setRequestHeader("Accept","application/json")),C.withCredentials=y.credentials==="include",C.onerror=()=>{x(new Error(C.statusText))},C.onload=()=>{if((C.status>=200&&C.status<300||C.status===0)&&C.response!==null){let S=C.response;if(y.type==="json")try{S=JSON.parse(C.response)}catch(O){return x(O)}x(null,S,C.getResponseHeader("Cache-Control"),C.getResponseHeader("Expires"))}else{const S=new Blob([C.response],{type:C.getResponseHeader("Content-Type")});x(new Ne(C.status,C.statusText,y.url,S))}},C.send(y.body),{cancel:()=>C.abort()}}(c,s)},pt=function(c,s){return gt(K(c,{type:"arrayBuffer"}),s)};function mt(c){if(!c||c.indexOf("://")<=0||c.indexOf("data:image/")===0||c.indexOf("blob:")===0)return!0;const s=new URL(c),Q=window.location;return s.protocol===Q.protocol&&s.host===Q.host}function Ht(c,s,Q){Q[c]&&Q[c].indexOf(s)!==-1||(Q[c]=Q[c]||[],Q[c].push(s))}function Wt(c,s,Q){if(Q&&Q[c]){const y=Q[c].indexOf(s);y!==-1&&Q[c].splice(y,1)}}class _1{constructor(s,Q={}){K(this,Q),this.type=s}}class t1 extends _1{constructor(s,Q={}){super("error",K({error:s},Q))}}class V1{on(s,Q){return this._listeners=this._listeners||{},Ht(s,Q,this._listeners),this}off(s,Q){return Wt(s,Q,this._listeners),Wt(s,Q,this._oneTimeListeners),this}once(s,Q){return Q?(this._oneTimeListeners=this._oneTimeListeners||{},Ht(s,Q,this._oneTimeListeners),this):new Promise(y=>this.once(s,y))}fire(s,Q){typeof s=="string"&&(s=new _1(s,Q||{}));const y=s.type;if(this.listens(y)){s.target=this;const x=this._listeners&&this._listeners[y]?this._listeners[y].slice():[];for(const O of x)O.call(this,s);const C=this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[];for(const O of C)Wt(y,O,this._oneTimeListeners),O.call(this,s);const S=this._eventedParent;S&&(K(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),S.fire(s))}else s instanceof t1&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,Q){return this._eventedParent=s,this._eventedParentData=Q,this}}var Pe={$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"},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":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 v1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function P1(c,s){const Q={};for(const y in c)y!=="ref"&&(Q[y]=c[y]);return v1.forEach(y=>{y in s&&(Q[y]=s[y])}),Q}function Q1(c,s){if(Array.isArray(c)){if(!Array.isArray(s)||c.length!==s.length)return!1;for(let Q=0;Q<c.length;Q++)if(!Q1(c[Q],s[Q]))return!1;return!0}if(typeof c=="object"&&c!==null&&s!==null){if(typeof s!="object"||Object.keys(c).length!==Object.keys(s).length)return!1;for(const Q in c)if(!Q1(c[Q],s[Q]))return!1;return!0}return c===s}const Xt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function et(c,s,Q){Q.push({command:Xt.addSource,args:[c,s[c]]})}function Rt(c,s,Q){s.push({command:Xt.removeSource,args:[c]}),Q[c]=!0}function d1(c,s,Q,y){Rt(c,Q,y),et(c,s,Q)}function r2(c,s,Q){let y;for(y in c[Q])if(Object.prototype.hasOwnProperty.call(c[Q],y)&&y!=="data"&&!Q1(c[Q][y],s[Q][y]))return!1;for(y in s[Q])if(Object.prototype.hasOwnProperty.call(s[Q],y)&&y!=="data"&&!Q1(c[Q][y],s[Q][y]))return!1;return!0}function R2(c,s,Q,y,x,C){let S;for(S in s=s||{},c=c||{})Object.prototype.hasOwnProperty.call(c,S)&&(Q1(c[S],s[S])||Q.push({command:C,args:[y,S,s[S],x]}));for(S in s)Object.prototype.hasOwnProperty.call(s,S)&&!Object.prototype.hasOwnProperty.call(c,S)&&(Q1(c[S],s[S])||Q.push({command:C,args:[y,S,s[S],x]}))}function l3(c){return c.id}function L3(c,s){return c[s.id]=s,c}class it{constructor(s,Q,y,x){this.message=(s?`${s}: `:"")+y,x&&(this.identifier=x),Q!=null&&Q.__line__&&(this.line=Q.__line__)}}function c3(c,...s){for(const Q of s)for(const y in Q)c[y]=Q[y];return c}class w1 extends Error{constructor(s,Q){super(Q),this.message=Q,this.key=s}}class R3{constructor(s,Q=[]){this.parent=s,this.bindings={};for(const[y,x]of Q)this.bindings[y]=x}concat(s){return new R3(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const b3={kind:"null"},at={kind:"number"},qt={kind:"string"},jt={kind:"boolean"},Q2={kind:"color"},u3={kind:"object"},Zt={kind:"value"},Ae={kind:"collator"},ne={kind:"formatted"},U={kind:"padding"},J={kind:"resolvedImage"},oe={kind:"variableAnchorOffsetCollection"};function Qe(c,s){return{kind:"array",itemType:c,N:s}}function he(c){if(c.kind==="array"){const s=he(c.itemType);return typeof c.N=="number"?`array<${s}, ${c.N}>`:c.itemType.kind==="value"?"array":`array<${s}>`}return c.kind}const Le=[b3,at,qt,jt,Q2,ne,u3,Qe(Zt),U,J,oe];function _e(c,s){if(s.kind==="error")return null;if(c.kind==="array"){if(s.kind==="array"&&(s.N===0&&s.itemType.kind==="value"||!_e(c.itemType,s.itemType))&&(typeof c.N!="number"||c.N===s.N))return null}else{if(c.kind===s.kind)return null;if(c.kind==="value"){for(const Q of Le)if(!_e(Q,s))return null}}return`Expected ${he(c)} but found ${he(s)} instead.`}function me(c,s){return s.some(Q=>Q.kind===c.kind)}function be(c,s){return s.some(Q=>Q==="null"?c===null:Q==="array"?Array.isArray(c):Q==="object"?c&&!Array.isArray(c)&&typeof c=="object":Q===typeof c)}function Be(c,s){return c.kind==="array"&&s.kind==="array"?c.itemType.kind===s.itemType.kind&&typeof c.N=="number":c.kind===s.kind}const Fe=.96422,qe=.82521,Dt=4/29,$t=6/29,Lt=3*$t*$t,kt=$t*$t*$t,Gt=Math.PI/180,x1=180/Math.PI;function C1(c){return(c%=360)<0&&(c+=360),c}function h1([c,s,Q,y]){let x,C;const S=j2((.2225045*(c=T1(c))+.7168786*(s=T1(s))+.0606169*(Q=T1(Q)))/1);c===s&&s===Q?x=C=S:(x=j2((.4360747*c+.3850649*s+.1430804*Q)/Fe),C=j2((.0139322*c+.0971045*s+.7141733*Q)/qe));const O=116*S-16;return[O<0?0:O,500*(x-S),200*(S-C),y]}function T1(c){return c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function j2(c){return c>kt?Math.pow(c,1/3):c/Lt+Dt}function D1([c,s,Q,y]){let x=(c+16)/116,C=isNaN(s)?x:x+s/500,S=isNaN(Q)?x:x-Q/200;return x=1*V2(x),C=Fe*V2(C),S=qe*V2(S),[T2(3.1338561*C-1.6168667*x-.4906146*S),T2(-.9787684*C+1.9161415*x+.033454*S),T2(.0719453*C-.2289914*x+1.4052427*S),y]}function T2(c){return(c=c<=.00304?12.92*c:1.055*Math.pow(c,1/2.4)-.055)<0?0:c>1?1:c}function V2(c){return c>$t?c*c*c:Lt*(c-Dt)}function j3(c){return parseInt(c.padEnd(2,c),16)/255}function Zl(c,s){return En(s?c/100:c,0,1)}function En(c,s,Q){return Math.min(Math.max(s,c),Q)}function Vn(c){return!c.some(Number.isNaN)}const YT={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 H1{constructor(s,Q,y,x=1,C=!0){this.r=s,this.g=Q,this.b=y,this.a=x,C||(this.r*=x,this.g*=x,this.b*=x,x||this.overwriteGetter("rgb",[s,Q,y,x]))}static parse(s){if(s instanceof H1)return s;if(typeof s!="string")return;const Q=function(y){if((y=y.toLowerCase().trim())==="transparent")return[0,0,0,0];const x=YT[y];if(x){const[S,O,B]=x;return[S/255,O/255,B/255,1]}if(y.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(y)){const S=y.length<6?1:2;let O=1;return[j3(y.slice(O,O+=S)),j3(y.slice(O,O+=S)),j3(y.slice(O,O+=S)),j3(y.slice(O,O+S)||"ff")]}if(y.startsWith("rgb")){const S=y.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(S){const[O,B,j,q,X,Y,re,ae,le,fe,ye,He]=S,ve=[q||" ",re||" ",fe].join("");if(ve===" "||ve===" /"||ve===",,"||ve===",,,"){const Me=[j,Y,le].join(""),De=Me==="%%%"?100:Me===""?255:0;if(De){const $e=[En(+B/De,0,1),En(+X/De,0,1),En(+ae/De,0,1),ye?Zl(+ye,He):1];if(Vn($e))return $e}}return}}const C=y.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(C){const[S,O,B,j,q,X,Y,re,ae]=C,le=[B||" ",q||" ",Y].join("");if(le===" "||le===" /"||le===",,"||le===",,,"){const fe=[+O,En(+j,0,100),En(+X,0,100),re?Zl(+re,ae):1];if(Vn(fe))return function([ye,He,ve,Me]){function De($e){const dt=($e+ye/30)%12,wt=He*Math.min(ve,1-ve);return ve-wt*Math.max(-1,Math.min(dt-3,9-dt,1))}return ye=C1(ye),He/=100,ve/=100,[De(0),De(8),De(4),Me]}(fe)}}}(s);return Q?new H1(...Q,!1):void 0}get rgb(){const{r:s,g:Q,b:y,a:x}=this,C=x||1/0;return this.overwriteGetter("rgb",[s/C,Q/C,y/C,x])}get hcl(){return this.overwriteGetter("hcl",function(s){const[Q,y,x,C]=h1(s),S=Math.sqrt(y*y+x*x);return[Math.round(1e4*S)?C1(Math.atan2(x,y)*x1):NaN,S,Q,C]}(this.rgb))}get lab(){return this.overwriteGetter("lab",h1(this.rgb))}overwriteGetter(s,Q){return Object.defineProperty(this,s,{value:Q}),Q}toString(){const[s,Q,y,x]=this.rgb;return`rgba(${[s,Q,y].map(C=>Math.round(255*C)).join(",")},${x})`}}H1.black=new H1(0,0,0,1),H1.white=new H1(1,1,1,1),H1.transparent=new H1(0,0,0,0),H1.red=new H1(1,0,0,1);class Po{constructor(s,Q,y){this.sensitivity=s?Q?"variant":"case":Q?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,Q){return this.collator.compare(s,Q)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Yi{constructor(s,Q,y,x,C){this.text=s,this.image=Q,this.scale=y,this.fontStack=x,this.textColor=C}}class z2{constructor(s){this.sections=s}static fromString(s){return new z2([new Yi(s,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(s=>s.text.length!==0||s.image&&s.image.name.length!==0)}static factory(s){return s instanceof z2?s:z2.fromString(s)}toString(){return this.sections.length===0?"":this.sections.map(s=>s.text).join("")}}class w3{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof w3)return s;if(typeof s=="number")return new w3([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const Q of s)if(typeof Q!="number")return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new w3(s)}}toString(){return JSON.stringify(this.values)}}const eh=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class z3{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof z3)return s;if(Array.isArray(s)&&!(s.length<1)&&s.length%2==0){for(let Q=0;Q<s.length;Q+=2){const y=s[Q],x=s[Q+1];if(typeof y!="string"||!eh.has(y)||!Array.isArray(x)||x.length!==2||typeof x[0]!="number"||typeof x[1]!="number")return}return new z3(s)}}toString(){return JSON.stringify(this.values)}}class D2{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new D2({name:s,available:!1}):null}}function e5(c,s,Q,y){return typeof c=="number"&&c>=0&&c<=255&&typeof s=="number"&&s>=0&&s<=255&&typeof Q=="number"&&Q>=0&&Q<=255?y===void 0||typeof y=="number"&&y>=0&&y<=1?null:`Invalid rgba value [${[c,s,Q,y].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof y=="number"?[c,s,Q,y]:[c,s,Q]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Dn(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof H1||c instanceof Po||c instanceof z2||c instanceof w3||c instanceof z3||c instanceof D2)return!0;if(Array.isArray(c)){for(const s of c)if(!Dn(s))return!1;return!0}if(typeof c=="object"){for(const s in c)if(!Dn(c[s]))return!1;return!0}return!1}function Z1(c){if(c===null)return b3;if(typeof c=="string")return qt;if(typeof c=="boolean")return jt;if(typeof c=="number")return at;if(c instanceof H1)return Q2;if(c instanceof Po)return Ae;if(c instanceof z2)return ne;if(c instanceof w3)return U;if(c instanceof z3)return oe;if(c instanceof D2)return J;if(Array.isArray(c)){const s=c.length;let Q;for(const y of c){const x=Z1(y);if(Q){if(Q===x)continue;Q=Zt;break}Q=x}return Qe(Q||Zt,s)}return u3}function p1(c){const s=typeof c;return c===null?"":s==="string"||s==="number"||s==="boolean"?String(c):c instanceof H1||c instanceof z2||c instanceof w3||c instanceof z3||c instanceof D2?c.toString():JSON.stringify(c)}class Nr{constructor(s,Q){this.type=s,this.value=Q}static parse(s,Q){if(s.length!==2)return Q.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!Dn(s[1]))return Q.error("invalid value");const y=s[1];let x=Z1(y);const C=Q.expectedType;return x.kind!=="array"||x.N!==0||!C||C.kind!=="array"||typeof C.N=="number"&&C.N!==0||(x=C),new Nr(x,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class J1{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const t5={string:qt,number:at,boolean:jt,object:u3};class $3{constructor(s,Q){this.type=s,this.args=Q}static parse(s,Q){if(s.length<2)return Q.error("Expected at least one argument.");let y,x=1;const C=s[0];if(C==="array"){let O,B;if(s.length>2){const j=s[1];if(typeof j!="string"||!(j in t5)||j==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);O=t5[j],x++}else O=Zt;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return Q.error('The length argument to "array" must be a positive integer literal',2);B=s[2],x++}y=Qe(O,B)}else{if(!t5[C])throw new Error(`Types doesn't contain name = ${C}`);y=t5[C]}const S=[];for(;x<s.length;x++){const O=Q.parse(s[x],x,Zt);if(!O)return null;S.push(O)}return new $3(y,S)}evaluate(s){for(let Q=0;Q<this.args.length;Q++){const y=this.args[Q].evaluate(s);if(!_e(this.type,Z1(y)))return y;if(Q===this.args.length-1)throw new J1(`Expected value to be of type ${he(this.type)}, but found ${he(Z1(y))} instead.`)}throw new Error}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const Io={"to-boolean":jt,"to-color":Q2,"to-number":at,"to-string":qt};class lr{constructor(s,Q){this.type=s,this.args=Q}static parse(s,Q){if(s.length<2)return Q.error("Expected at least one argument.");const y=s[0];if(!Io[y])throw new Error(`Can't parse ${y} as it is not part of the known types`);if((y==="to-boolean"||y==="to-string")&&s.length!==2)return Q.error("Expected one argument.");const x=Io[y],C=[];for(let S=1;S<s.length;S++){const O=Q.parse(s[S],S,Zt);if(!O)return null;C.push(O)}return new lr(x,C)}evaluate(s){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(s);case"color":{let Q,y;for(const x of this.args){if(Q=x.evaluate(s),y=null,Q instanceof H1)return Q;if(typeof Q=="string"){const C=s.parseColor(Q);if(C)return C}else if(Array.isArray(Q)&&(y=Q.length<3||Q.length>4?`Invalid rbga value ${JSON.stringify(Q)}: expected an array containing either three or four numeric values.`:e5(Q[0],Q[1],Q[2],Q[3]),!y))return new H1(Q[0]/255,Q[1]/255,Q[2]/255,Q[3])}throw new J1(y||`Could not parse color from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"padding":{let Q;for(const y of this.args){Q=y.evaluate(s);const x=w3.parse(Q);if(x)return x}throw new J1(`Could not parse padding from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"variableAnchorOffsetCollection":{let Q;for(const y of this.args){Q=y.evaluate(s);const x=z3.parse(Q);if(x)return x}throw new J1(`Could not parse variableAnchorOffsetCollection from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"number":{let Q=null;for(const y of this.args){if(Q=y.evaluate(s),Q===null)return 0;const x=Number(Q);if(!isNaN(x))return x}throw new J1(`Could not convert ${JSON.stringify(Q)} to number.`)}case"formatted":return z2.fromString(p1(this.args[0].evaluate(s)));case"resolvedImage":return D2.fromString(p1(this.args[0].evaluate(s)));default:return p1(this.args[0].evaluate(s))}}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const ql=["Unknown","Point","LineString","Polygon"];class Bo{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"?ql[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(s){let Q=this._parseColorCache[s];return Q||(Q=this._parseColorCache[s]=H1.parse(s)),Q}}class r5{constructor(s,Q,y=[],x,C=new R3,S=[]){this.registry=s,this.path=y,this.key=y.map(O=>`[${O}]`).join(""),this.scope=C,this.errors=S,this.expectedType=x,this._isConstant=Q}parse(s,Q,y,x,C={}){return Q?this.concat(Q,y,x)._parse(s,C):this._parse(s,C)}_parse(s,Q){function y(x,C,S){return S==="assert"?new $3(C,[x]):S==="coerce"?new lr(C,[x]):x}if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const x=s[0];if(typeof x!="string")return this.error(`Expression name must be a string, but found ${typeof x} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const C=this.registry[x];if(C){let S=C.parse(s,this);if(!S)return null;if(this.expectedType){const O=this.expectedType,B=S.type;if(O.kind!=="string"&&O.kind!=="number"&&O.kind!=="boolean"&&O.kind!=="object"&&O.kind!=="array"||B.kind!=="value")if(O.kind!=="color"&&O.kind!=="formatted"&&O.kind!=="resolvedImage"||B.kind!=="value"&&B.kind!=="string")if(O.kind!=="padding"||B.kind!=="value"&&B.kind!=="number"&&B.kind!=="array")if(O.kind!=="variableAnchorOffsetCollection"||B.kind!=="value"&&B.kind!=="array"){if(this.checkSubtype(O,B))return null}else S=y(S,O,Q.typeAnnotation||"coerce");else S=y(S,O,Q.typeAnnotation||"coerce");else S=y(S,O,Q.typeAnnotation||"coerce");else S=y(S,O,Q.typeAnnotation||"assert")}if(!(S instanceof Nr)&&S.type.kind!=="resolvedImage"&&this._isConstant(S)){const O=new Bo;try{S=new Nr(S.type,S.evaluate(O))}catch(B){return this.error(B.message),null}}return S}return this.error(`Unknown expression "${x}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,Q,y){const x=typeof s=="number"?this.path.concat(s):this.path,C=y?this.scope.concat(y):this.scope;return new r5(this.registry,this._isConstant,x,Q||null,C,this.errors)}error(s,...Q){const y=`${this.key}${Q.map(x=>`[${x}]`).join("")}`;this.errors.push(new w1(y,s))}checkSubtype(s,Q){const y=_e(s,Q);return y&&this.error(y),y}}class n5{constructor(s,Q,y){this.type=Ae,this.locale=y,this.caseSensitive=s,this.diacriticSensitive=Q}static parse(s,Q){if(s.length!==2)return Q.error("Expected one argument.");const y=s[1];if(typeof y!="object"||Array.isArray(y))return Q.error("Collator options argument must be an object.");const x=Q.parse(y["case-sensitive"]!==void 0&&y["case-sensitive"],1,jt);if(!x)return null;const C=Q.parse(y["diacritic-sensitive"]!==void 0&&y["diacritic-sensitive"],1,jt);if(!C)return null;let S=null;return y.locale&&(S=Q.parse(y.locale,1,qt),!S)?null:new n5(x,C,S)}evaluate(s){return new Po(this.caseSensitive.evaluate(s),this.diacriticSensitive.evaluate(s),this.locale?this.locale.evaluate(s):null)}eachChild(s){s(this.caseSensitive),s(this.diacriticSensitive),this.locale&&s(this.locale)}outputDefined(){return!1}}const cr=8192;function No(c,s){c[0]=Math.min(c[0],s[0]),c[1]=Math.min(c[1],s[1]),c[2]=Math.max(c[2],s[0]),c[3]=Math.max(c[3],s[1])}function S6(c,s){return!(c[0]<=s[0]||c[2]>=s[2]||c[1]<=s[1]||c[3]>=s[3])}function Gl(c,s){const Q=(180+c[0])/360,y=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,x=Math.pow(2,s.z);return[Math.round(Q*x*cr),Math.round(y*x*cr)]}function th(c,s,Q){const y=c[0]-s[0],x=c[1]-s[1],C=c[0]-Q[0],S=c[1]-Q[1];return y*S-C*x==0&&y*C<=0&&x*S<=0}function Fo(c,s){let Q=!1;for(let S=0,O=s.length;S<O;S++){const B=s[S];for(let j=0,q=B.length;j<q-1;j++){if(th(c,B[j],B[j+1]))return!1;(x=B[j])[1]>(y=c)[1]!=(C=B[j+1])[1]>y[1]&&y[0]<(C[0]-x[0])*(y[1]-x[1])/(C[1]-x[1])+x[0]&&(Q=!Q)}}var y,x,C;return Q}function Ro(c,s){for(let Q=0;Q<s.length;Q++)if(Fo(c,s[Q]))return!0;return!1}function Ul(c,s,Q,y){const x=y[0]-Q[0],C=y[1]-Q[1],S=(c[0]-Q[0])*C-x*(c[1]-Q[1]),O=(s[0]-Q[0])*C-x*(s[1]-Q[1]);return S>0&&O<0||S<0&&O>0}function rh(c,s,Q){for(const j of Q)for(let q=0;q<j.length-1;++q)if((O=[(S=j[q+1])[0]-(C=j[q])[0],S[1]-C[1]])[0]*(B=[(x=s)[0]-(y=c)[0],x[1]-y[1]])[1]-O[1]*B[0]!=0&&Ul(y,x,C,S)&&Ul(C,S,y,x))return!0;var y,x,C,S,O,B;return!1}function Wl(c,s){for(let Q=0;Q<c.length;++Q)if(!Fo(c[Q],s))return!1;for(let Q=0;Q<c.length-1;++Q)if(rh(c[Q],c[Q+1],s))return!1;return!0}function Xl(c,s){for(let Q=0;Q<s.length;Q++)if(Wl(c,s[Q]))return!0;return!1}function i5(c,s,Q){const y=[];for(let x=0;x<c.length;x++){const C=[];for(let S=0;S<c[x].length;S++){const O=Gl(c[x][S],Q);No(s,O),C.push(O)}y.push(C)}return y}function Kl(c,s,Q){const y=[];for(let x=0;x<c.length;x++){const C=i5(c[x],s,Q);y.push(C)}return y}function Jl(c,s,Q,y){if(c[0]<Q[0]||c[0]>Q[2]){const x=.5*y;let C=c[0]-Q[0]>x?-y:Q[0]-c[0]>x?y:0;C===0&&(C=c[0]-Q[2]>x?-y:Q[2]-c[0]>x?y:0),c[0]+=C}No(s,c)}function jo(c,s,Q,y){const x=Math.pow(2,y.z)*cr,C=[y.x*cr,y.y*cr],S=[];for(const O of c)for(const B of O){const j=[B.x+C[0],B.y+C[1]];Jl(j,s,Q,x),S.push(j)}return S}function zo(c,s,Q,y){const x=Math.pow(2,y.z)*cr,C=[y.x*cr,y.y*cr],S=[];for(const B of c){const j=[];for(const q of B){const X=[q.x+C[0],q.y+C[1]];No(s,X),j.push(X)}S.push(j)}if(s[2]-s[0]<=x/2){(O=s)[0]=O[1]=1/0,O[2]=O[3]=-1/0;for(const B of S)for(const j of B)Jl(j,s,Q,x)}var O;return S}class Fr{constructor(s,Q){this.type=jt,this.geojson=s,this.geometries=Q}static parse(s,Q){if(s.length!==2)return Q.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(Dn(s[1])){const y=s[1];if(y.type==="FeatureCollection")for(let x=0;x<y.features.length;++x){const C=y.features[x].geometry.type;if(C==="Polygon"||C==="MultiPolygon")return new Fr(y,y.features[x].geometry)}else if(y.type==="Feature"){const x=y.geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new Fr(y,y.geometry)}else if(y.type==="Polygon"||y.type==="MultiPolygon")return new Fr(y,y)}return Q.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(s){if(s.geometry()!=null&&s.canonicalID()!=null){if(s.geometryType()==="Point")return function(Q,y){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],S=Q.canonicalID();if(y.type==="Polygon"){const O=i5(y.coordinates,C,S),B=jo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Fo(j,O))return!1}if(y.type==="MultiPolygon"){const O=Kl(y.coordinates,C,S),B=jo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Ro(j,O))return!1}return!0}(s,this.geometries);if(s.geometryType()==="LineString")return function(Q,y){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],S=Q.canonicalID();if(y.type==="Polygon"){const O=i5(y.coordinates,C,S),B=zo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Wl(j,O))return!1}if(y.type==="MultiPolygon"){const O=Kl(y.coordinates,C,S),B=zo(Q.geometry(),x,C,S);if(!S6(x,C))return!1;for(const j of B)if(!Xl(j,O))return!1}return!0}(s,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class a5{constructor(s,Q){this.type=Q.type,this.name=s,this.boundExpression=Q}static parse(s,Q){if(s.length!==2||typeof s[1]!="string")return Q.error("'var' expression requires exactly one string literal argument.");const y=s[1];return Q.scope.has(y)?new a5(y,Q.scope.get(y)):Q.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Z3{constructor(s,Q,y,x){this.name=s,this.type=Q,this._evaluate=y,this.args=x}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,Q){const y=s[0],x=Z3.definitions[y];if(!x)return Q.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);const C=Array.isArray(x)?x[0]:x.type,S=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,O=S.filter(([j])=>!Array.isArray(j)||j.length===s.length-1);let B=null;for(const[j,q]of O){B=new r5(Q.registry,o5,Q.path,null,Q.scope);const X=[];let Y=!1;for(let re=1;re<s.length;re++){const ae=s[re],le=Array.isArray(j)?j[re-1]:j.type,fe=B.parse(ae,1+X.length,le);if(!fe){Y=!0;break}X.push(fe)}if(!Y)if(Array.isArray(j)&&j.length!==X.length)B.error(`Expected ${j.length} arguments, but found ${X.length} instead.`);else{for(let re=0;re<X.length;re++){const ae=Array.isArray(j)?j[re]:j.type,le=X[re];B.concat(re+1).checkSubtype(ae,le.type)}if(B.errors.length===0)return new Z3(y,C,q,X)}}if(O.length===1)Q.errors.push(...B.errors);else{const j=(O.length?O:S).map(([X])=>{return Y=X,Array.isArray(Y)?`(${Y.map(he).join(", ")})`:`(${he(Y.type)}...)`;var Y}).join(" | "),q=[];for(let X=1;X<s.length;X++){const Y=Q.parse(s[X],1+q.length);if(!Y)return null;q.push(he(Y.type))}Q.error(`Expected arguments of type ${j}, but found (${q.join(", ")}) instead.`)}return null}static register(s,Q){Z3.definitions=Q;for(const y in Q)s[y]=Z3}}function o5(c){if(c instanceof a5)return o5(c.boundExpression);if(c instanceof Z3&&c.name==="error"||c instanceof n5||c instanceof Fr)return!1;const s=c instanceof lr||c instanceof $3;let Q=!0;return c.eachChild(y=>{Q=s?Q&&o5(y):Q&&y instanceof Nr}),!!Q&&s5(c)&&l5(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function s5(c){if(c instanceof Z3&&(c.name==="get"&&c.args.length===1||c.name==="feature-state"||c.name==="has"&&c.args.length===1||c.name==="properties"||c.name==="geometry-type"||c.name==="id"||/^filter-/.test(c.name))||c instanceof Fr)return!1;let s=!0;return c.eachChild(Q=>{s&&!s5(Q)&&(s=!1)}),s}function E6(c){if(c instanceof Z3&&c.name==="feature-state")return!1;let s=!0;return c.eachChild(Q=>{s&&!E6(Q)&&(s=!1)}),s}function l5(c,s){if(c instanceof Z3&&s.indexOf(c.name)>=0)return!1;let Q=!0;return c.eachChild(y=>{Q&&!l5(y,s)&&(Q=!1)}),Q}function On(c,s){const Q=c.length-1;let y,x,C=0,S=Q,O=0;for(;C<=S;)if(O=Math.floor((C+S)/2),y=c[O],x=c[O+1],y<=s){if(O===Q||s<x)return O;C=O+1}else{if(!(y>s))throw new J1("Input is not a number.");S=O-1}return 0}class ur{constructor(s,Q,y){this.type=s,this.input=Q,this.labels=[],this.outputs=[];for(const[x,C]of y)this.labels.push(x),this.outputs.push(C)}static parse(s,Q){if(s.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return Q.error("Expected an even number of arguments.");const y=Q.parse(s[1],1,at);if(!y)return null;const x=[];let C=null;Q.expectedType&&Q.expectedType.kind!=="value"&&(C=Q.expectedType);for(let S=1;S<s.length;S+=2){const O=S===1?-1/0:s[S],B=s[S+1],j=S,q=S+1;if(typeof O!="number")return Q.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',j);if(x.length&&x[x.length-1][0]>=O)return Q.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',j);const X=Q.parse(B,q,C);if(!X)return null;C=C||X.type,x.push([O,X])}return new ur(C,y,x)}evaluate(s){const Q=this.labels,y=this.outputs;if(Q.length===1)return y[0].evaluate(s);const x=this.input.evaluate(s);if(x<=Q[0])return y[0].evaluate(s);const C=Q.length;return x>=Q[C-1]?y[C-1].evaluate(s):y[On(Q,x)].evaluate(s)}eachChild(s){s(this.input);for(const Q of this.outputs)s(Q)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function c1(c,s,Q){return c+Q*(s-c)}function c5(c,s,Q){return c.map((y,x)=>c1(y,s[x],Q))}const H3={number:c1,color:function(c,s,Q,y="rgb"){switch(y){case"rgb":{const[x,C,S,O]=c5(c.rgb,s.rgb,Q);return new H1(x,C,S,O,!1)}case"hcl":{const[x,C,S,O]=c.hcl,[B,j,q,X]=s.hcl;let Y,re;if(isNaN(x)||isNaN(B))isNaN(x)?isNaN(B)?Y=NaN:(Y=B,S!==1&&S!==0||(re=j)):(Y=x,q!==1&&q!==0||(re=C));else{let He=B-x;B>x&&He>180?He-=360:B<x&&x-B>180&&(He+=360),Y=x+Q*He}const[ae,le,fe,ye]=function([He,ve,Me,De]){return He=isNaN(He)?0:He*Gt,D1([Me,Math.cos(He)*ve,Math.sin(He)*ve,De])}([Y,re??c1(C,j,Q),c1(S,q,Q),c1(O,X,Q)]);return new H1(ae,le,fe,ye,!1)}case"lab":{const[x,C,S,O]=D1(c5(c.lab,s.lab,Q));return new H1(x,C,S,O,!1)}}},array:c5,padding:function(c,s,Q){return new w3(c5(c.values,s.values,Q))},variableAnchorOffsetCollection:function(c,s,Q){const y=c.values,x=s.values;if(y.length!==x.length)throw new J1(`Cannot interpolate values of different length. from: ${c.toString()}, to: ${s.toString()}`);const C=[];for(let S=0;S<y.length;S+=2){if(y[S]!==x[S])throw new J1(`Cannot interpolate values containing mismatched anchors. from[${S}]: ${y[S]}, to[${S}]: ${x[S]}`);C.push(y[S]);const[O,B]=y[S+1],[j,q]=x[S+1];C.push([c1(O,j,Q),c1(B,q,Q)])}return new z3(C)}};class M3{constructor(s,Q,y,x,C){this.type=s,this.operator=Q,this.interpolation=y,this.input=x,this.labels=[],this.outputs=[];for(const[S,O]of C)this.labels.push(S),this.outputs.push(O)}static interpolationFactor(s,Q,y,x){let C=0;if(s.name==="exponential")C=$o(Q,s.base,y,x);else if(s.name==="linear")C=$o(Q,1,y,x);else if(s.name==="cubic-bezier"){const S=s.controlPoints;C=new w(S[0],S[1],S[2],S[3]).solve($o(Q,1,y,x))}return C}static parse(s,Q){let[y,x,C,...S]=s;if(!Array.isArray(x)||x.length===0)return Q.error("Expected an interpolation type expression.",1);if(x[0]==="linear")x={name:"linear"};else if(x[0]==="exponential"){const j=x[1];if(typeof j!="number")return Q.error("Exponential interpolation requires a numeric base.",1,1);x={name:"exponential",base:j}}else{if(x[0]!=="cubic-bezier")return Q.error(`Unknown interpolation type ${String(x[0])}`,1,0);{const j=x.slice(1);if(j.length!==4||j.some(q=>typeof q!="number"||q<0||q>1))return Q.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);x={name:"cubic-bezier",controlPoints:j}}}if(s.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return Q.error("Expected an even number of arguments.");if(C=Q.parse(C,2,at),!C)return null;const O=[];let B=null;y==="interpolate-hcl"||y==="interpolate-lab"?B=Q2:Q.expectedType&&Q.expectedType.kind!=="value"&&(B=Q.expectedType);for(let j=0;j<S.length;j+=2){const q=S[j],X=S[j+1],Y=j+3,re=j+4;if(typeof q!="number")return Q.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Y);if(O.length&&O[O.length-1][0]>=q)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Y);const ae=Q.parse(X,re,B);if(!ae)return null;B=B||ae.type,O.push([q,ae])}return Be(B,at)||Be(B,Q2)||Be(B,U)||Be(B,oe)||Be(B,Qe(at))?new M3(B,y,x,C,O):Q.error(`Type ${he(B)} is not interpolatable.`)}evaluate(s){const Q=this.labels,y=this.outputs;if(Q.length===1)return y[0].evaluate(s);const x=this.input.evaluate(s);if(x<=Q[0])return y[0].evaluate(s);const C=Q.length;if(x>=Q[C-1])return y[C-1].evaluate(s);const S=On(Q,x),O=M3.interpolationFactor(this.interpolation,x,Q[S],Q[S+1]),B=y[S].evaluate(s),j=y[S+1].evaluate(s);switch(this.operator){case"interpolate":return H3[this.type.kind](B,j,O);case"interpolate-hcl":return H3.color(B,j,O,"hcl");case"interpolate-lab":return H3.color(B,j,O,"lab")}}eachChild(s){s(this.input);for(const Q of this.outputs)s(Q)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function $o(c,s,Q,y){const x=y-Q,C=c-Q;return x===0?0:s===1?C/x:(Math.pow(s,C)-1)/(Math.pow(s,x)-1)}class u5{constructor(s,Q){this.type=s,this.args=Q}static parse(s,Q){if(s.length<2)return Q.error("Expectected at least one argument.");let y=null;const x=Q.expectedType;x&&x.kind!=="value"&&(y=x);const C=[];for(const O of s.slice(1)){const B=Q.parse(O,1+C.length,y,void 0,{typeAnnotation:"omit"});if(!B)return null;y=y||B.type,C.push(B)}if(!y)throw new Error("No output type");const S=x&&C.some(O=>_e(x,O.type));return new u5(S?Zt:y,C)}evaluate(s){let Q,y=null,x=0;for(const C of this.args)if(x++,y=C.evaluate(s),y&&y instanceof D2&&!y.available&&(Q||(Q=y.name),y=null,x===this.args.length&&(y=Q)),y!==null)break;return y}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class Q5{constructor(s,Q){this.type=Q.type,this.bindings=[].concat(s),this.result=Q}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const Q of this.bindings)s(Q[1]);s(this.result)}static parse(s,Q){if(s.length<4)return Q.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const y=[];for(let C=1;C<s.length-1;C+=2){const S=s[C];if(typeof S!="string")return Q.error(`Expected string, but found ${typeof S} instead.`,C);if(/[^a-zA-Z0-9_]/.test(S))return Q.error("Variable names must contain only alphanumeric characters or '_'.",C);const O=Q.parse(s[C+1],C+1);if(!O)return null;y.push([S,O])}const x=Q.parse(s[s.length-1],s.length-1,Q.expectedType,y);return x?new Q5(y,x):null}outputDefined(){return this.result.outputDefined()}}class Zo{constructor(s,Q,y){this.type=s,this.index=Q,this.input=y}static parse(s,Q){if(s.length!==3)return Q.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,at),x=Q.parse(s[2],2,Qe(Q.expectedType||Zt));return y&&x?new Zo(x.type.itemType,y,x):null}evaluate(s){const Q=this.index.evaluate(s),y=this.input.evaluate(s);if(Q<0)throw new J1(`Array index out of bounds: ${Q} < 0.`);if(Q>=y.length)throw new J1(`Array index out of bounds: ${Q} > ${y.length-1}.`);if(Q!==Math.floor(Q))throw new J1(`Array index must be an integer, but found ${Q} instead.`);return y[Q]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class qo{constructor(s,Q){this.type=jt,this.needle=s,this.haystack=Q}static parse(s,Q){if(s.length!==3)return Q.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,Zt),x=Q.parse(s[2],2,Zt);return y&&x?me(y.type,[jt,qt,at,b3,Zt])?new qo(y,x):Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${he(y.type)} instead`):null}evaluate(s){const Q=this.needle.evaluate(s),y=this.haystack.evaluate(s);if(!y)return!1;if(!be(Q,["boolean","string","number","null"]))throw new J1(`Expected first argument to be of type boolean, string, number or null, but found ${he(Z1(Q))} instead.`);if(!be(y,["string","array"]))throw new J1(`Expected second argument to be of type array or string, but found ${he(Z1(y))} instead.`);return y.indexOf(Q)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class T5{constructor(s,Q,y){this.type=at,this.needle=s,this.haystack=Q,this.fromIndex=y}static parse(s,Q){if(s.length<=2||s.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,Zt),x=Q.parse(s[2],2,Zt);if(!y||!x)return null;if(!me(y.type,[jt,qt,at,b3,Zt]))return Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${he(y.type)} instead`);if(s.length===4){const C=Q.parse(s[3],3,at);return C?new T5(y,x,C):null}return new T5(y,x)}evaluate(s){const Q=this.needle.evaluate(s),y=this.haystack.evaluate(s);if(!be(Q,["boolean","string","number","null"]))throw new J1(`Expected first argument to be of type boolean, string, number or null, but found ${he(Z1(Q))} instead.`);if(!be(y,["string","array"]))throw new J1(`Expected second argument to be of type array or string, but found ${he(Z1(y))} instead.`);if(this.fromIndex){const x=this.fromIndex.evaluate(s);return y.indexOf(Q,x)}return y.indexOf(Q)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Go{constructor(s,Q,y,x,C,S){this.inputType=s,this.type=Q,this.input=y,this.cases=x,this.outputs=C,this.otherwise=S}static parse(s,Q){if(s.length<5)return Q.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return Q.error("Expected an even number of arguments.");let y,x;Q.expectedType&&Q.expectedType.kind!=="value"&&(x=Q.expectedType);const C={},S=[];for(let j=2;j<s.length-1;j+=2){let q=s[j];const X=s[j+1];Array.isArray(q)||(q=[q]);const Y=Q.concat(j);if(q.length===0)return Y.error("Expected at least one branch label.");for(const ae of q){if(typeof ae!="number"&&typeof ae!="string")return Y.error("Branch labels must be numbers or strings.");if(typeof ae=="number"&&Math.abs(ae)>Number.MAX_SAFE_INTEGER)return Y.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ae=="number"&&Math.floor(ae)!==ae)return Y.error("Numeric branch labels must be integer values.");if(y){if(Y.checkSubtype(y,Z1(ae)))return null}else y=Z1(ae);if(C[String(ae)]!==void 0)return Y.error("Branch labels must be unique.");C[String(ae)]=S.length}const re=Q.parse(X,j,x);if(!re)return null;x=x||re.type,S.push(re)}const O=Q.parse(s[1],1,Zt);if(!O)return null;const B=Q.parse(s[s.length-1],s.length-1,x);return B?O.type.kind!=="value"&&Q.concat(1).checkSubtype(y,O.type)?null:new Go(y,x,O,C,S,B):null}evaluate(s){const Q=this.input.evaluate(s);return(Z1(Q)===this.inputType&&this.outputs[this.cases[Q]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Uo{constructor(s,Q,y){this.type=s,this.branches=Q,this.otherwise=y}static parse(s,Q){if(s.length<4)return Q.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return Q.error("Expected an odd number of arguments.");let y;Q.expectedType&&Q.expectedType.kind!=="value"&&(y=Q.expectedType);const x=[];for(let S=1;S<s.length-1;S+=2){const O=Q.parse(s[S],S,jt);if(!O)return null;const B=Q.parse(s[S+1],S+1,y);if(!B)return null;x.push([O,B]),y=y||B.type}const C=Q.parse(s[s.length-1],s.length-1,y);if(!C)return null;if(!y)throw new Error("Can't infer output type");return new Uo(y,x,C)}evaluate(s){for(const[Q,y]of this.branches)if(Q.evaluate(s))return y.evaluate(s);return this.otherwise.evaluate(s)}eachChild(s){for(const[Q,y]of this.branches)s(Q),s(y);s(this.otherwise)}outputDefined(){return this.branches.every(([s,Q])=>Q.outputDefined())&&this.otherwise.outputDefined()}}class h5{constructor(s,Q,y,x){this.type=s,this.input=Q,this.beginIndex=y,this.endIndex=x}static parse(s,Q){if(s.length<=2||s.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1,Zt),x=Q.parse(s[2],2,at);if(!y||!x)return null;if(!me(y.type,[Qe(Zt),qt,Zt]))return Q.error(`Expected first argument to be of type array or string, but found ${he(y.type)} instead`);if(s.length===4){const C=Q.parse(s[3],3,at);return C?new h5(y.type,y,x,C):null}return new h5(y.type,y,x)}evaluate(s){const Q=this.input.evaluate(s),y=this.beginIndex.evaluate(s);if(!be(Q,["string","array"]))throw new J1(`Expected first argument to be of type array or string, but found ${he(Z1(Q))} instead.`);if(this.endIndex){const x=this.endIndex.evaluate(s);return Q.slice(y,x)}return Q.slice(y)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function Yl(c,s){return c==="=="||c==="!="?s.kind==="boolean"||s.kind==="string"||s.kind==="number"||s.kind==="null"||s.kind==="value":s.kind==="string"||s.kind==="number"||s.kind==="value"}function e9(c,s,Q,y){return y.compare(s,Q)===0}function kn(c,s,Q){const y=c!=="=="&&c!=="!=";return class ob{constructor(C,S,O){this.type=jt,this.lhs=C,this.rhs=S,this.collator=O,this.hasUntypedArgument=C.type.kind==="value"||S.type.kind==="value"}static parse(C,S){if(C.length!==3&&C.length!==4)return S.error("Expected two or three arguments.");const O=C[0];let B=S.parse(C[1],1,Zt);if(!B)return null;if(!Yl(O,B.type))return S.concat(1).error(`"${O}" comparisons are not supported for type '${he(B.type)}'.`);let j=S.parse(C[2],2,Zt);if(!j)return null;if(!Yl(O,j.type))return S.concat(2).error(`"${O}" comparisons are not supported for type '${he(j.type)}'.`);if(B.type.kind!==j.type.kind&&B.type.kind!=="value"&&j.type.kind!=="value")return S.error(`Cannot compare types '${he(B.type)}' and '${he(j.type)}'.`);y&&(B.type.kind==="value"&&j.type.kind!=="value"?B=new $3(j.type,[B]):B.type.kind!=="value"&&j.type.kind==="value"&&(j=new $3(B.type,[j])));let q=null;if(C.length===4){if(B.type.kind!=="string"&&j.type.kind!=="string"&&B.type.kind!=="value"&&j.type.kind!=="value")return S.error("Cannot use collator to compare non-string types.");if(q=S.parse(C[3],3,Ae),!q)return null}return new ob(B,j,q)}evaluate(C){const S=this.lhs.evaluate(C),O=this.rhs.evaluate(C);if(y&&this.hasUntypedArgument){const B=Z1(S),j=Z1(O);if(B.kind!==j.kind||B.kind!=="string"&&B.kind!=="number")throw new J1(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${B.kind}, ${j.kind}) instead.`)}if(this.collator&&!y&&this.hasUntypedArgument){const B=Z1(S),j=Z1(O);if(B.kind!=="string"||j.kind!=="string")return s(C,S,O)}return this.collator?Q(C,S,O,this.collator.evaluate(C)):s(C,S,O)}eachChild(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)}outputDefined(){return!0}}}const nh=kn("==",function(c,s,Q){return s===Q},e9),ih=kn("!=",function(c,s,Q){return s!==Q},function(c,s,Q,y){return!e9(0,s,Q,y)}),ah=kn("<",function(c,s,Q){return s<Q},function(c,s,Q,y){return y.compare(s,Q)<0}),oh=kn(">",function(c,s,Q){return s>Q},function(c,s,Q,y){return y.compare(s,Q)>0}),sh=kn("<=",function(c,s,Q){return s<=Q},function(c,s,Q,y){return y.compare(s,Q)<=0}),lh=kn(">=",function(c,s,Q){return s>=Q},function(c,s,Q,y){return y.compare(s,Q)>=0});class Wo{constructor(s,Q,y,x,C){this.type=qt,this.number=s,this.locale=Q,this.currency=y,this.minFractionDigits=x,this.maxFractionDigits=C}static parse(s,Q){if(s.length!==3)return Q.error("Expected two arguments.");const y=Q.parse(s[1],1,at);if(!y)return null;const x=s[2];if(typeof x!="object"||Array.isArray(x))return Q.error("NumberFormat options argument must be an object.");let C=null;if(x.locale&&(C=Q.parse(x.locale,1,qt),!C))return null;let S=null;if(x.currency&&(S=Q.parse(x.currency,1,qt),!S))return null;let O=null;if(x["min-fraction-digits"]&&(O=Q.parse(x["min-fraction-digits"],1,at),!O))return null;let B=null;return x["max-fraction-digits"]&&(B=Q.parse(x["max-fraction-digits"],1,at),!B)?null:new Wo(y,C,S,O,B)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class d5{constructor(s){this.type=ne,this.sections=s}static parse(s,Q){if(s.length<2)return Q.error("Expected at least one argument.");const y=s[1];if(!Array.isArray(y)&&typeof y=="object")return Q.error("First argument must be an image or text section.");const x=[];let C=!1;for(let S=1;S<=s.length-1;++S){const O=s[S];if(C&&typeof O=="object"&&!Array.isArray(O)){C=!1;let B=null;if(O["font-scale"]&&(B=Q.parse(O["font-scale"],1,at),!B))return null;let j=null;if(O["text-font"]&&(j=Q.parse(O["text-font"],1,Qe(qt)),!j))return null;let q=null;if(O["text-color"]&&(q=Q.parse(O["text-color"],1,Q2),!q))return null;const X=x[x.length-1];X.scale=B,X.font=j,X.textColor=q}else{const B=Q.parse(s[S],1,Zt);if(!B)return null;const j=B.type.kind;if(j!=="string"&&j!=="value"&&j!=="null"&&j!=="resolvedImage")return Q.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");C=!0,x.push({content:B,scale:null,font:null,textColor:null})}}return new d5(x)}evaluate(s){return new z2(this.sections.map(Q=>{const y=Q.content.evaluate(s);return Z1(y)===J?new Yi("",y,null,null,null):new Yi(p1(y),null,Q.scale?Q.scale.evaluate(s):null,Q.font?Q.font.evaluate(s).join(","):null,Q.textColor?Q.textColor.evaluate(s):null)}))}eachChild(s){for(const Q of this.sections)s(Q.content),Q.scale&&s(Q.scale),Q.font&&s(Q.font),Q.textColor&&s(Q.textColor)}outputDefined(){return!1}}class Xo{constructor(s){this.type=J,this.input=s}static parse(s,Q){if(s.length!==2)return Q.error("Expected two arguments.");const y=Q.parse(s[1],1,qt);return y?new Xo(y):Q.error("No image name provided.")}evaluate(s){const Q=this.input.evaluate(s),y=D2.fromString(Q);return y&&s.availableImages&&(y.available=s.availableImages.indexOf(Q)>-1),y}eachChild(s){s(this.input)}outputDefined(){return!1}}class Ko{constructor(s){this.type=at,this.input=s}static parse(s,Q){if(s.length!==2)return Q.error(`Expected 1 argument, but found ${s.length-1} instead.`);const y=Q.parse(s[1],1);return y?y.type.kind!=="array"&&y.type.kind!=="string"&&y.type.kind!=="value"?Q.error(`Expected argument of type string or array, but found ${he(y.type)} instead.`):new Ko(y):null}evaluate(s){const Q=this.input.evaluate(s);if(typeof Q=="string"||Array.isArray(Q))return Q.length;throw new J1(`Expected value to be of type string or array, but found ${he(Z1(Q))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Pn={"==":nh,"!=":ih,">":oh,"<":ah,">=":lh,"<=":sh,array:$3,at:Zo,boolean:$3,case:Uo,coalesce:u5,collator:n5,format:d5,image:Xo,in:qo,"index-of":T5,interpolate:M3,"interpolate-hcl":M3,"interpolate-lab":M3,length:Ko,let:Q5,literal:Nr,match:Go,number:$3,"number-format":Wo,object:$3,slice:h5,step:ur,string:$3,"to-boolean":lr,"to-color":lr,"to-number":lr,"to-string":lr,var:a5,within:Fr};function t9(c,[s,Q,y,x]){s=s.evaluate(c),Q=Q.evaluate(c),y=y.evaluate(c);const C=x?x.evaluate(c):1,S=e5(s,Q,y,C);if(S)throw new J1(S);return new H1(s/255,Q/255,y/255,C,!1)}function r9(c,s){return c in s}function Jo(c,s){const Q=s[c];return Q===void 0?null:Q}function Rr(c){return{type:c}}function n9(c){return{result:"success",value:c}}function Qr(c){return{result:"error",value:c}}function In(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function i9(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function Yo(c){return!!c.expression&&c.expression.interpolated}function m1(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function q1(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function ch(c){return c}function u1(c,s){const Q=s.type==="color",y=c.stops&&typeof c.stops[0][0]=="object",x=y||!(y||c.property!==void 0),C=c.type||(Yo(s)?"exponential":"interval");if(Q||s.type==="padding"){const q=Q?H1.parse:w3.parse;(c=c3({},c)).stops&&(c.stops=c.stops.map(X=>[X[0],q(X[1])])),c.default=q(c.default?c.default:s.default)}if(c.colorSpace&&(S=c.colorSpace)!=="rgb"&&S!=="hcl"&&S!=="lab")throw new Error(`Unknown color space: "${c.colorSpace}"`);var S;let O,B,j;if(C==="exponential")O=V6;else if(C==="interval")O=z1;else if(C==="categorical"){O=G1,B=Object.create(null);for(const q of c.stops)B[q[0]]=q[1];j=typeof c.stops[0][0]}else{if(C!=="identity")throw new Error(`Unknown function type "${C}"`);O=a9}if(y){const q={},X=[];for(let ae=0;ae<c.stops.length;ae++){const le=c.stops[ae],fe=le[0].zoom;q[fe]===void 0&&(q[fe]={zoom:fe,type:c.type,property:c.property,default:c.default,stops:[]},X.push(fe)),q[fe].stops.push([le[0].value,le[1]])}const Y=[];for(const ae of X)Y.push([q[ae].zoom,u1(q[ae],s)]);const re={name:"linear"};return{kind:"composite",interpolationType:re,interpolationFactor:M3.interpolationFactor.bind(void 0,re),zoomStops:Y.map(ae=>ae[0]),evaluate:({zoom:ae},le)=>V6({stops:Y,base:c.base},s,ae).evaluate(ae,le)}}if(x){const q=C==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:q,interpolationFactor:M3.interpolationFactor.bind(void 0,q),zoomStops:c.stops.map(X=>X[0]),evaluate:({zoom:X})=>O(c,s,X,B,j)}}return{kind:"source",evaluate(q,X){const Y=X&&X.properties?X.properties[c.property]:void 0;return Y===void 0?jr(c.default,s.default):O(c,s,Y,B,j)}}}function jr(c,s,Q){return c!==void 0?c:s!==void 0?s:Q!==void 0?Q:void 0}function G1(c,s,Q,y,x){return jr(typeof Q===x?y[Q]:void 0,c.default,s.default)}function z1(c,s,Q){if(m1(Q)!=="number")return jr(c.default,s.default);const y=c.stops.length;if(y===1||Q<=c.stops[0][0])return c.stops[0][1];if(Q>=c.stops[y-1][0])return c.stops[y-1][1];const x=On(c.stops.map(C=>C[0]),Q);return c.stops[x][1]}function V6(c,s,Q){const y=c.base!==void 0?c.base:1;if(m1(Q)!=="number")return jr(c.default,s.default);const x=c.stops.length;if(x===1||Q<=c.stops[0][0])return c.stops[0][1];if(Q>=c.stops[x-1][0])return c.stops[x-1][1];const C=On(c.stops.map(q=>q[0]),Q),S=function(q,X,Y,re){const ae=re-Y,le=q-Y;return ae===0?0:X===1?le/ae:(Math.pow(X,le)-1)/(Math.pow(X,ae)-1)}(Q,y,c.stops[C][0],c.stops[C+1][0]),O=c.stops[C][1],B=c.stops[C+1][1],j=H3[s.type]||ch;return typeof O.evaluate=="function"?{evaluate(...q){const X=O.evaluate.apply(void 0,q),Y=B.evaluate.apply(void 0,q);if(X!==void 0&&Y!==void 0)return j(X,Y,S,c.colorSpace)}}:j(O,B,S,c.colorSpace)}function a9(c,s,Q){switch(s.type){case"color":Q=H1.parse(Q);break;case"formatted":Q=z2.fromString(Q.toString());break;case"resolvedImage":Q=D2.fromString(Q.toString());break;case"padding":Q=w3.parse(Q);break;default:m1(Q)===s.type||s.type==="enum"&&s.values[Q]||(Q=void 0)}return jr(Q,c.default,s.default)}Z3.register(Pn,{error:[{kind:"error"},[qt],(c,[s])=>{throw new J1(s.evaluate(c))}],typeof:[qt,[Zt],(c,[s])=>he(Z1(s.evaluate(c)))],"to-rgba":[Qe(at,4),[Q2],(c,[s])=>{const[Q,y,x,C]=s.evaluate(c).rgb;return[255*Q,255*y,255*x,C]}],rgb:[Q2,[at,at,at],t9],rgba:[Q2,[at,at,at,at],t9],has:{type:jt,overloads:[[[qt],(c,[s])=>r9(s.evaluate(c),c.properties())],[[qt,u3],(c,[s,Q])=>r9(s.evaluate(c),Q.evaluate(c))]]},get:{type:Zt,overloads:[[[qt],(c,[s])=>Jo(s.evaluate(c),c.properties())],[[qt,u3],(c,[s,Q])=>Jo(s.evaluate(c),Q.evaluate(c))]]},"feature-state":[Zt,[qt],(c,[s])=>Jo(s.evaluate(c),c.featureState||{})],properties:[u3,[],c=>c.properties()],"geometry-type":[qt,[],c=>c.geometryType()],id:[Zt,[],c=>c.id()],zoom:[at,[],c=>c.globals.zoom],"heatmap-density":[at,[],c=>c.globals.heatmapDensity||0],"line-progress":[at,[],c=>c.globals.lineProgress||0],accumulated:[Zt,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[at,Rr(at),(c,s)=>{let Q=0;for(const y of s)Q+=y.evaluate(c);return Q}],"*":[at,Rr(at),(c,s)=>{let Q=1;for(const y of s)Q*=y.evaluate(c);return Q}],"-":{type:at,overloads:[[[at,at],(c,[s,Q])=>s.evaluate(c)-Q.evaluate(c)],[[at],(c,[s])=>-s.evaluate(c)]]},"/":[at,[at,at],(c,[s,Q])=>s.evaluate(c)/Q.evaluate(c)],"%":[at,[at,at],(c,[s,Q])=>s.evaluate(c)%Q.evaluate(c)],ln2:[at,[],()=>Math.LN2],pi:[at,[],()=>Math.PI],e:[at,[],()=>Math.E],"^":[at,[at,at],(c,[s,Q])=>Math.pow(s.evaluate(c),Q.evaluate(c))],sqrt:[at,[at],(c,[s])=>Math.sqrt(s.evaluate(c))],log10:[at,[at],(c,[s])=>Math.log(s.evaluate(c))/Math.LN10],ln:[at,[at],(c,[s])=>Math.log(s.evaluate(c))],log2:[at,[at],(c,[s])=>Math.log(s.evaluate(c))/Math.LN2],sin:[at,[at],(c,[s])=>Math.sin(s.evaluate(c))],cos:[at,[at],(c,[s])=>Math.cos(s.evaluate(c))],tan:[at,[at],(c,[s])=>Math.tan(s.evaluate(c))],asin:[at,[at],(c,[s])=>Math.asin(s.evaluate(c))],acos:[at,[at],(c,[s])=>Math.acos(s.evaluate(c))],atan:[at,[at],(c,[s])=>Math.atan(s.evaluate(c))],min:[at,Rr(at),(c,s)=>Math.min(...s.map(Q=>Q.evaluate(c)))],max:[at,Rr(at),(c,s)=>Math.max(...s.map(Q=>Q.evaluate(c)))],abs:[at,[at],(c,[s])=>Math.abs(s.evaluate(c))],round:[at,[at],(c,[s])=>{const Q=s.evaluate(c);return Q<0?-Math.round(-Q):Math.round(Q)}],floor:[at,[at],(c,[s])=>Math.floor(s.evaluate(c))],ceil:[at,[at],(c,[s])=>Math.ceil(s.evaluate(c))],"filter-==":[jt,[qt,Zt],(c,[s,Q])=>c.properties()[s.value]===Q.value],"filter-id-==":[jt,[Zt],(c,[s])=>c.id()===s.value],"filter-type-==":[jt,[qt],(c,[s])=>c.geometryType()===s.value],"filter-<":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y<x}],"filter-id-<":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q<y}],"filter->":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y>x}],"filter-id->":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q>y}],"filter-<=":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y<=x}],"filter-id-<=":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q<=y}],"filter->=":[jt,[qt,Zt],(c,[s,Q])=>{const y=c.properties()[s.value],x=Q.value;return typeof y==typeof x&&y>=x}],"filter-id->=":[jt,[Zt],(c,[s])=>{const Q=c.id(),y=s.value;return typeof Q==typeof y&&Q>=y}],"filter-has":[jt,[Zt],(c,[s])=>s.value in c.properties()],"filter-has-id":[jt,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[jt,[Qe(qt)],(c,[s])=>s.value.indexOf(c.geometryType())>=0],"filter-id-in":[jt,[Qe(Zt)],(c,[s])=>s.value.indexOf(c.id())>=0],"filter-in-small":[jt,[qt,Qe(Zt)],(c,[s,Q])=>Q.value.indexOf(c.properties()[s.value])>=0],"filter-in-large":[jt,[qt,Qe(Zt)],(c,[s,Q])=>function(y,x,C,S){for(;C<=S;){const O=C+S>>1;if(x[O]===y)return!0;x[O]>y?S=O-1:C=O+1}return!1}(c.properties()[s.value],Q.value,0,Q.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(c,[s,Q])=>s.evaluate(c)&&Q.evaluate(c)],[Rr(jt),(c,s)=>{for(const Q of s)if(!Q.evaluate(c))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(c,[s,Q])=>s.evaluate(c)||Q.evaluate(c)],[Rr(jt),(c,s)=>{for(const Q of s)if(Q.evaluate(c))return!0;return!1}]]},"!":[jt,[jt],(c,[s])=>!s.evaluate(c)],"is-supported-script":[jt,[qt],(c,[s])=>{const Q=c.globals&&c.globals.isSupportedScript;return!Q||Q(s.evaluate(c))}],upcase:[qt,[qt],(c,[s])=>s.evaluate(c).toUpperCase()],downcase:[qt,[qt],(c,[s])=>s.evaluate(c).toLowerCase()],concat:[qt,Rr(Zt),(c,s)=>s.map(Q=>p1(Q.evaluate(c))).join("")],"resolved-locale":[qt,[Ae],(c,[s])=>s.evaluate(c).resolvedLocale()]});class e0{constructor(s,Q){var y;this.expression=s,this._warningHistory={},this._evaluator=new Bo,this._defaultValue=Q?(y=Q).type==="color"&&q1(y.default)?new H1(0,0,0,0):y.type==="color"?H1.parse(y.default)||null:y.type==="padding"?w3.parse(y.default)||null:y.type==="variableAnchorOffsetCollection"?z3.parse(y.default)||null:y.default===void 0?null:y.default:null,this._enumValues=Q&&Q.type==="enum"?Q.values:null}evaluateWithoutErrorHandling(s,Q,y,x,C,S){return this._evaluator.globals=s,this._evaluator.feature=Q,this._evaluator.featureState=y,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=S,this.expression.evaluate(this._evaluator)}evaluate(s,Q,y,x,C,S){this._evaluator.globals=s,this._evaluator.feature=Q||null,this._evaluator.featureState=y||null,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=S||null;try{const O=this.expression.evaluate(this._evaluator);if(O==null||typeof O=="number"&&O!=O)return this._defaultValue;if(this._enumValues&&!(O in this._enumValues))throw new J1(`Expected value to be one of ${Object.keys(this._enumValues).map(B=>JSON.stringify(B)).join(", ")}, but found ${JSON.stringify(O)} instead.`);return O}catch(O){return this._warningHistory[O.message]||(this._warningHistory[O.message]=!0,typeof console<"u"&&console.warn(O.message)),this._defaultValue}}}function f5(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in Pn}function p5(c,s){const Q=new r5(Pn,o5,[],s?function(x){const C={color:Q2,string:qt,number:at,enum:qt,boolean:jt,formatted:ne,padding:U,resolvedImage:J,variableAnchorOffsetCollection:oe};return x.type==="array"?Qe(C[x.value]||Zt,x.length):C[x.type]}(s):void 0),y=Q.parse(c,void 0,void 0,void 0,s&&s.type==="string"?{typeAnnotation:"coerce"}:void 0);return y?n9(new e0(y,s)):Qr(Q.errors)}class t0{constructor(s,Q){this.kind=s,this._styleExpression=Q,this.isStateDependent=s!=="constant"&&!E6(Q.expression)}evaluateWithoutErrorHandling(s,Q,y,x,C,S){return this._styleExpression.evaluateWithoutErrorHandling(s,Q,y,x,C,S)}evaluate(s,Q,y,x,C,S){return this._styleExpression.evaluate(s,Q,y,x,C,S)}}class m5{constructor(s,Q,y,x){this.kind=s,this.zoomStops=y,this._styleExpression=Q,this.isStateDependent=s!=="camera"&&!E6(Q.expression),this.interpolationType=x}evaluateWithoutErrorHandling(s,Q,y,x,C,S){return this._styleExpression.evaluateWithoutErrorHandling(s,Q,y,x,C,S)}evaluate(s,Q,y,x,C,S){return this._styleExpression.evaluate(s,Q,y,x,C,S)}interpolationFactor(s,Q,y){return this.interpolationType?M3.interpolationFactor(this.interpolationType,s,Q,y):0}}function r0(c,s){const Q=p5(c,s);if(Q.result==="error")return Q;const y=Q.value.expression,x=s5(y);if(!x&&!In(s))return Qr([new w1("","data expressions not supported")]);const C=l5(y,["zoom"]);if(!C&&!i9(s))return Qr([new w1("","zoom expressions not supported")]);const S=O6(y);return S||C?S instanceof w1?Qr([S]):S instanceof M3&&!Yo(s)?Qr([new w1("",'"interpolate" expressions cannot be used with this property')]):n9(S?new m5(x?"camera":"composite",Q.value,S.labels,S instanceof M3?S.interpolation:void 0):new t0(x?"constant":"source",Q.value)):Qr([new w1("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class D6{constructor(s,Q){this._parameters=s,this._specification=Q,c3(this,u1(this._parameters,this._specification))}static deserialize(s){return new D6(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function O6(c){let s=null;if(c instanceof Q5)s=O6(c.result);else if(c instanceof u5){for(const Q of c.args)if(s=O6(Q),s)break}else(c instanceof ur||c instanceof M3)&&c.input instanceof Z3&&c.input.name==="zoom"&&(s=c);return s instanceof w1||c.eachChild(Q=>{const y=O6(Q);y instanceof w1?s=y:!s&&y?s=new w1("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&y&&s!==y&&(s=new w1("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function k6(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(const s of c.slice(1))if(!k6(s)&&typeof s!="boolean")return!1;return!0;default:return!0}}const uh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function n0(c){if(c==null)return{filter:()=>!0,needGeometry:!1};k6(c)||(c=y5(c));const s=p5(c,uh);if(s.result==="error")throw new Error(s.value.map(Q=>`${Q.key}: ${Q.message}`).join(", "));return{filter:(Q,y,x)=>s.value.evaluate(Q,y,{},x),needGeometry:o9(c)}}function Qh(c,s){return c<s?-1:c>s?1:0}function o9(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let s=1;s<c.length;s++)if(o9(c[s]))return!0;return!1}function y5(c){if(!c)return!0;const s=c[0];return c.length<=1?s!=="any":s==="=="?i0(c[1],c[2],"=="):s==="!="?P6(i0(c[1],c[2],"==")):s==="<"||s===">"||s==="<="||s===">="?i0(c[1],c[2],s):s==="any"?(Q=c.slice(1),["any"].concat(Q.map(y5))):s==="all"?["all"].concat(c.slice(1).map(y5)):s==="none"?["all"].concat(c.slice(1).map(y5).map(P6)):s==="in"?s9(c[1],c.slice(2)):s==="!in"?P6(s9(c[1],c.slice(2))):s==="has"?l9(c[1]):s==="!has"?P6(l9(c[1])):s!=="within"||c;var Q}function i0(c,s,Q){switch(c){case"$type":return[`filter-type-${Q}`,s];case"$id":return[`filter-id-${Q}`,s];default:return[`filter-${Q}`,c,s]}}function s9(c,s){if(s.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(Q=>typeof Q!=typeof s[0])?["filter-in-large",c,["literal",s.sort(Qh)]]:["filter-in-small",c,["literal",s]]}}function l9(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function P6(c){return["!",c]}function g5(c){const s=typeof c;if(s==="number"||s==="boolean"||s==="string"||c==null)return JSON.stringify(c);if(Array.isArray(c)){let x="[";for(const C of c)x+=`${g5(C)},`;return`${x}]`}const Q=Object.keys(c).sort();let y="{";for(let x=0;x<Q.length;x++)y+=`${JSON.stringify(Q[x])}:${g5(c[Q[x]])},`;return`${y}}`}function _5(c){let s="";for(const Q of v1)s+=`/${g5(c[Q])}`;return s}function c9(c){const s=c.value;return s?[new it(c.key,s,"constants have been deprecated as of v8")]:[]}function Y1(c){return c instanceof Number||c instanceof String||c instanceof Boolean?c.valueOf():c}function zr(c){if(Array.isArray(c))return c.map(zr);if(c instanceof Object&&!(c instanceof Number||c instanceof String||c instanceof Boolean)){const s={};for(const Q in c)s[Q]=zr(c[Q]);return s}return Y1(c)}function Q3(c){const s=c.key,Q=c.value,y=c.valueSpec||{},x=c.objectElementValidators||{},C=c.style,S=c.styleSpec,O=c.validateSpec;let B=[];const j=m1(Q);if(j!=="object")return[new it(s,Q,`object expected, ${j} found`)];for(const q in Q){const X=q.split(".")[0],Y=y[X]||y["*"];let re;if(x[X])re=x[X];else if(y[X])re=O;else if(x["*"])re=x["*"];else{if(!y["*"]){B.push(new it(s,Q[q],`unknown property "${q}"`));continue}re=O}B=B.concat(re({key:(s&&`${s}.`)+q,value:Q[q],valueSpec:Y,style:C,styleSpec:S,object:Q,objectKey:q,validateSpec:O},Q))}for(const q in y)x[q]||y[q].required&&y[q].default===void 0&&Q[q]===void 0&&B.push(new it(s,Q,`missing required property "${q}"`));return B}function Bn(c){const s=c.value,Q=c.valueSpec,y=c.style,x=c.styleSpec,C=c.key,S=c.arrayElementValidator||c.validateSpec;if(m1(s)!=="array")return[new it(C,s,`array expected, ${m1(s)} found`)];if(Q.length&&s.length!==Q.length)return[new it(C,s,`array length ${Q.length} expected, length ${s.length} found`)];if(Q["min-length"]&&s.length<Q["min-length"])return[new it(C,s,`array length at least ${Q["min-length"]} expected, length ${s.length} found`)];let O={type:Q.value,values:Q.values};x.$version<7&&(O.function=Q.function),m1(Q.value)==="object"&&(O=Q.value);let B=[];for(let j=0;j<s.length;j++)B=B.concat(S({array:s,arrayIndex:j,value:s[j],valueSpec:O,validateSpec:c.validateSpec,style:y,styleSpec:x,key:`${C}[${j}]`}));return B}function I6(c){const s=c.key,Q=c.value,y=c.valueSpec;let x=m1(Q);return x==="number"&&Q!=Q&&(x="NaN"),x!=="number"?[new it(s,Q,`number expected, ${x} found`)]:"minimum"in y&&Q<y.minimum?[new it(s,Q,`${Q} is less than the minimum value ${y.minimum}`)]:"maximum"in y&&Q>y.maximum?[new it(s,Q,`${Q} is greater than the maximum value ${y.maximum}`)]:[]}function v5(c){const s=c.valueSpec,Q=Y1(c.value.type);let y,x,C,S={};const O=Q!=="categorical"&&c.value.property===void 0,B=!O,j=m1(c.value.stops)==="array"&&m1(c.value.stops[0])==="array"&&m1(c.value.stops[0][0])==="object",q=Q3({key:c.key,value:c.value,valueSpec:c.styleSpec.function,validateSpec:c.validateSpec,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(re){if(Q==="identity")return[new it(re.key,re.value,'identity function may not have a "stops" property')];let ae=[];const le=re.value;return ae=ae.concat(Bn({key:re.key,value:le,valueSpec:re.valueSpec,validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec,arrayElementValidator:X})),m1(le)==="array"&&le.length===0&&ae.push(new it(re.key,le,"array must have at least one stop")),ae},default:function(re){return re.validateSpec({key:re.key,value:re.value,valueSpec:s,validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec})}}});return Q==="identity"&&O&&q.push(new it(c.key,c.value,'missing required property "property"')),Q==="identity"||c.value.stops||q.push(new it(c.key,c.value,'missing required property "stops"')),Q==="exponential"&&c.valueSpec.expression&&!Yo(c.valueSpec)&&q.push(new it(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(B&&!In(c.valueSpec)?q.push(new it(c.key,c.value,"property functions not supported")):O&&!i9(c.valueSpec)&&q.push(new it(c.key,c.value,"zoom functions not supported"))),Q!=="categorical"&&!j||c.value.property!==void 0||q.push(new it(c.key,c.value,'"property" property is required')),q;function X(re){let ae=[];const le=re.value,fe=re.key;if(m1(le)!=="array")return[new it(fe,le,`array expected, ${m1(le)} found`)];if(le.length!==2)return[new it(fe,le,`array length 2 expected, length ${le.length} found`)];if(j){if(m1(le[0])!=="object")return[new it(fe,le,`object expected, ${m1(le[0])} found`)];if(le[0].zoom===void 0)return[new it(fe,le,"object stop key must have zoom")];if(le[0].value===void 0)return[new it(fe,le,"object stop key must have value")];if(C&&C>Y1(le[0].zoom))return[new it(fe,le[0].zoom,"stop zoom values must appear in ascending order")];Y1(le[0].zoom)!==C&&(C=Y1(le[0].zoom),x=void 0,S={}),ae=ae.concat(Q3({key:`${fe}[0]`,value:le[0],valueSpec:{zoom:{}},validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec,objectElementValidators:{zoom:I6,value:Y}}))}else ae=ae.concat(Y({key:`${fe}[0]`,value:le[0],valueSpec:{},validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec},le));return f5(zr(le[1]))?ae.concat([new it(`${fe}[1]`,le[1],"expressions are not allowed in function stops.")]):ae.concat(re.validateSpec({key:`${fe}[1]`,value:le[1],valueSpec:s,validateSpec:re.validateSpec,style:re.style,styleSpec:re.styleSpec}))}function Y(re,ae){const le=m1(re.value),fe=Y1(re.value),ye=re.value!==null?re.value:ae;if(y){if(le!==y)return[new it(re.key,ye,`${le} stop domain type must match previous stop domain type ${y}`)]}else y=le;if(le!=="number"&&le!=="string"&&le!=="boolean")return[new it(re.key,ye,"stop domain value must be a number, string, or boolean")];if(le!=="number"&&Q!=="categorical"){let He=`number expected, ${le} found`;return In(s)&&Q===void 0&&(He+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new it(re.key,ye,He)]}return Q!=="categorical"||le!=="number"||isFinite(fe)&&Math.floor(fe)===fe?Q!=="categorical"&&le==="number"&&x!==void 0&&fe<x?[new it(re.key,ye,"stop domain values must appear in ascending order")]:(x=fe,Q==="categorical"&&fe in S?[new it(re.key,ye,"stop domain values must be unique")]:(S[fe]=!0,[])):[new it(re.key,ye,`integer expected, found ${fe}`)]}}function $r(c){const s=(c.expressionContext==="property"?r0:p5)(zr(c.value),c.valueSpec);if(s.result==="error")return s.value.map(y=>new it(`${c.key}${y.key}`,c.value,y.message));const Q=s.value.expression||s.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!Q.outputDefined())return[new it(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!E6(Q))return[new it(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!E6(Q))return[new it(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!l5(Q,["zoom","feature-state"]))return[new it(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!s5(Q))return[new it(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function B6(c){const s=c.key,Q=c.value,y=c.valueSpec,x=[];return Array.isArray(y.values)?y.values.indexOf(Y1(Q))===-1&&x.push(new it(s,Q,`expected one of [${y.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(y.values).indexOf(Y1(Q))===-1&&x.push(new it(s,Q,`expected one of [${Object.keys(y.values).join(", ")}], ${JSON.stringify(Q)} found`)),x}function Nn(c){return k6(zr(c.value))?$r(c3({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):u9(c)}function u9(c){const s=c.value,Q=c.key;if(m1(s)!=="array")return[new it(Q,s,`array expected, ${m1(s)} found`)];const y=c.styleSpec;let x,C=[];if(s.length<1)return[new it(Q,s,"filter array must have at least 1 element")];switch(C=C.concat(B6({key:`${Q}[0]`,value:s[0],valueSpec:y.filter_operator,style:c.style,styleSpec:c.styleSpec})),Y1(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&Y1(s[1])==="$type"&&C.push(new it(Q,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":s.length!==3&&C.push(new it(Q,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(x=m1(s[1]),x!=="string"&&C.push(new it(`${Q}[1]`,s[1],`string expected, ${x} found`)));for(let S=2;S<s.length;S++)x=m1(s[S]),Y1(s[1])==="$type"?C=C.concat(B6({key:`${Q}[${S}]`,value:s[S],valueSpec:y.geometry_type,style:c.style,styleSpec:c.styleSpec})):x!=="string"&&x!=="number"&&x!=="boolean"&&C.push(new it(`${Q}[${S}]`,s[S],`string, number, or boolean expected, ${x} found`));break;case"any":case"all":case"none":for(let S=1;S<s.length;S++)C=C.concat(u9({key:`${Q}[${S}]`,value:s[S],style:c.style,styleSpec:c.styleSpec}));break;case"has":case"!has":x=m1(s[1]),s.length!==2?C.push(new it(Q,s,`filter array for "${s[0]}" operator must have 2 elements`)):x!=="string"&&C.push(new it(`${Q}[1]`,s[1],`string expected, ${x} found`));break;case"within":x=m1(s[1]),s.length!==2?C.push(new it(Q,s,`filter array for "${s[0]}" operator must have 2 elements`)):x!=="object"&&C.push(new it(`${Q}[1]`,s[1],`object expected, ${x} found`))}return C}function Q9(c,s){const Q=c.key,y=c.validateSpec,x=c.style,C=c.styleSpec,S=c.value,O=c.objectKey,B=C[`${s}_${c.layerType}`];if(!B)return[];const j=O.match(/^(.*)-transition$/);if(s==="paint"&&j&&B[j[1]]&&B[j[1]].transition)return y({key:Q,value:S,valueSpec:C.transition,style:x,styleSpec:C});const q=c.valueSpec||B[O];if(!q)return[new it(Q,S,`unknown property "${O}"`)];let X;if(m1(S)==="string"&&In(q)&&!q.tokens&&(X=/^{([^}]+)}$/.exec(S)))return[new it(Q,S,`"${O}" does not support interpolation syntax
16
16
  Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(X[1])} }\`.`)];const Y=[];return c.layerType==="symbol"&&(O==="text-field"&&x&&!x.glyphs&&Y.push(new it(Q,S,'use of "text-field" requires a style "glyphs" property')),O==="text-font"&&q1(zr(S))&&Y1(S.type)==="identity"&&Y.push(new it(Q,S,'"text-font" does not support identity functions'))),Y.concat(y({key:c.key,value:S,valueSpec:q,style:x,styleSpec:C,expressionContext:"property",propertyType:s,propertyKey:O}))}function T9(c){return Q9(c,"paint")}function h9(c){return Q9(c,"layout")}function d9(c){let s=[];const Q=c.value,y=c.key,x=c.style,C=c.styleSpec;Q.type||Q.ref||s.push(new it(y,Q,'either "type" or "ref" is required'));let S=Y1(Q.type);const O=Y1(Q.ref);if(Q.id){const B=Y1(Q.id);for(let j=0;j<c.arrayIndex;j++){const q=x.layers[j];Y1(q.id)===B&&s.push(new it(y,Q.id,`duplicate layer id "${Q.id}", previously used at line ${q.id.__line__}`))}}if("ref"in Q){let B;["type","source","source-layer","filter","layout"].forEach(j=>{j in Q&&s.push(new it(y,Q[j],`"${j}" is prohibited for ref layers`))}),x.layers.forEach(j=>{Y1(j.id)===O&&(B=j)}),B?B.ref?s.push(new it(y,Q.ref,"ref cannot reference another ref layer")):S=Y1(B.type):s.push(new it(y,Q.ref,`ref layer "${O}" not found`))}else if(S!=="background")if(Q.source){const B=x.sources&&x.sources[Q.source],j=B&&Y1(B.type);B?j==="vector"&&S==="raster"?s.push(new it(y,Q.source,`layer "${Q.id}" requires a raster source`)):j!=="raster-dem"&&S==="hillshade"?s.push(new it(y,Q.source,`layer "${Q.id}" requires a raster-dem source`)):j==="raster"&&S!=="raster"?s.push(new it(y,Q.source,`layer "${Q.id}" requires a vector source`)):j!=="vector"||Q["source-layer"]?j==="raster-dem"&&S!=="hillshade"?s.push(new it(y,Q.source,"raster-dem source can only be used with layer type 'hillshade'.")):S!=="line"||!Q.paint||!Q.paint["line-gradient"]||j==="geojson"&&B.lineMetrics||s.push(new it(y,Q,`layer "${Q.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new it(y,Q,`layer "${Q.id}" must specify a "source-layer"`)):s.push(new it(y,Q.source,`source "${Q.source}" not found`))}else s.push(new it(y,Q,'missing required property "source"'));return s=s.concat(Q3({key:y,value:Q,valueSpec:C.layer,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*":()=>[],type:()=>c.validateSpec({key:`${y}.type`,value:Q.type,valueSpec:C.layer.type,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,object:Q,objectKey:"type"}),filter:Nn,layout:B=>Q3({layer:Q,key:B.key,value:B.value,style:B.style,styleSpec:B.styleSpec,validateSpec:B.validateSpec,objectElementValidators:{"*":j=>h9(c3({layerType:S},j))}}),paint:B=>Q3({layer:Q,key:B.key,value:B.value,style:B.style,styleSpec:B.styleSpec,validateSpec:B.validateSpec,objectElementValidators:{"*":j=>T9(c3({layerType:S},j))}})}})),s}function h4(c){const s=c.value,Q=c.key,y=m1(s);return y!=="string"?[new it(Q,s,`string expected, ${y} found`)]:[]}const N6={promoteId:function({key:c,value:s}){if(m1(s)==="string")return h4({key:c,value:s});{const Q=[];for(const y in s)Q.push(...h4({key:`${c}.${y}`,value:s[y]}));return Q}}};function C3(c){const s=c.value,Q=c.key,y=c.styleSpec,x=c.style,C=c.validateSpec;if(!s.type)return[new it(Q,s,'"type" is required')];const S=Y1(s.type);let O;switch(S){case"vector":case"raster":return O=Q3({key:Q,value:s,valueSpec:y[`source_${S.replace("-","_")}`],style:c.style,styleSpec:y,objectElementValidators:N6,validateSpec:C}),O;case"raster-dem":return O=function(B){var j;const q=(j=B.sourceName)!==null&&j!==void 0?j:"",X=B.value,Y=B.styleSpec,re=Y.source_raster_dem,ae=B.style;let le=[];const fe=m1(X);if(X===void 0)return le;if(fe!=="object")return le.push(new it("source_raster_dem",X,`object expected, ${fe} found`)),le;const ye=Y1(X.encoding)==="custom",He=["redFactor","greenFactor","blueFactor","baseShift"],ve=B.value.encoding?`"${B.value.encoding}"`:"Default";for(const Me in X)!ye&&He.includes(Me)?le.push(new it(Me,X[Me],`In "${q}": "${Me}" is only valid when "encoding" is set to "custom". ${ve} encoding found`)):re[Me]?le=le.concat(B.validateSpec({key:Me,value:X[Me],valueSpec:re[Me],validateSpec:B.validateSpec,style:ae,styleSpec:Y})):le.push(new it(Me,X[Me],`unknown property "${Me}"`));return le}({sourceName:Q,value:s,style:c.style,styleSpec:y,validateSpec:C}),O;case"geojson":if(O=Q3({key:Q,value:s,valueSpec:y.source_geojson,style:x,styleSpec:y,validateSpec:C,objectElementValidators:N6}),s.cluster)for(const B in s.clusterProperties){const[j,q]=s.clusterProperties[B],X=typeof j=="string"?[j,["accumulated"],["get",B]]:j;O.push(...$r({key:`${Q}.${B}.map`,value:q,validateSpec:C,expressionContext:"cluster-map"})),O.push(...$r({key:`${Q}.${B}.reduce`,value:X,validateSpec:C,expressionContext:"cluster-reduce"}))}return O;case"video":return Q3({key:Q,value:s,valueSpec:y.source_video,style:x,validateSpec:C,styleSpec:y});case"image":return Q3({key:Q,value:s,valueSpec:y.source_image,style:x,validateSpec:C,styleSpec:y});case"canvas":return[new it(Q,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return B6({key:`${Q}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:x,validateSpec:C,styleSpec:y})}}function F6(c){const s=c.value,Q=c.styleSpec,y=Q.light,x=c.style;let C=[];const S=m1(s);if(s===void 0)return C;if(S!=="object")return C=C.concat([new it("light",s,`object expected, ${S} found`)]),C;for(const O in s){const B=O.match(/^(.*)-transition$/);C=C.concat(B&&y[B[1]]&&y[B[1]].transition?c.validateSpec({key:O,value:s[O],valueSpec:Q.transition,validateSpec:c.validateSpec,style:x,styleSpec:Q}):y[O]?c.validateSpec({key:O,value:s[O],valueSpec:y[O],validateSpec:c.validateSpec,style:x,styleSpec:Q}):[new it(O,s[O],`unknown property "${O}"`)])}return C}function f9(c){const s=c.value,Q=c.styleSpec,y=Q.terrain,x=c.style;let C=[];const S=m1(s);if(s===void 0)return C;if(S!=="object")return C=C.concat([new it("terrain",s,`object expected, ${S} found`)]),C;for(const O in s)C=C.concat(y[O]?c.validateSpec({key:O,value:s[O],valueSpec:y[O],validateSpec:c.validateSpec,style:x,styleSpec:Q}):[new it(O,s[O],`unknown property "${O}"`)]);return C}function p9(c){let s=[];const Q=c.value,y=c.key;if(Array.isArray(Q)){const x=[],C=[];for(const S in Q)Q[S].id&&x.includes(Q[S].id)&&s.push(new it(y,Q,`all the sprites' ids must be unique, but ${Q[S].id} is duplicated`)),x.push(Q[S].id),Q[S].url&&C.includes(Q[S].url)&&s.push(new it(y,Q,`all the sprites' URLs must be unique, but ${Q[S].url} is duplicated`)),C.push(Q[S].url),s=s.concat(Q3({key:`${y}[${S}]`,value:Q[S],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:c.validateSpec}));return s}return h4({key:y,value:Q})}const m9={"*":()=>[],array:Bn,boolean:function(c){const s=c.value,Q=c.key,y=m1(s);return y!=="boolean"?[new it(Q,s,`boolean expected, ${y} found`)]:[]},number:I6,color:function(c){const s=c.key,Q=c.value,y=m1(Q);return y!=="string"?[new it(s,Q,`color expected, ${y} found`)]:H1.parse(String(Q))?[]:[new it(s,Q,`color expected, "${Q}" found`)]},constants:c9,enum:B6,filter:Nn,function:v5,layer:d9,object:Q3,source:C3,light:F6,terrain:f9,string:h4,formatted:function(c){return h4(c).length===0?[]:$r(c)},resolvedImage:function(c){return h4(c).length===0?[]:$r(c)},padding:function(c){const s=c.key,Q=c.value;if(m1(Q)==="array"){if(Q.length<1||Q.length>4)return[new it(s,Q,`padding requires 1 to 4 values; ${Q.length} values found`)];const y={type:"number"};let x=[];for(let C=0;C<Q.length;C++)x=x.concat(c.validateSpec({key:`${s}[${C}]`,value:Q[C],validateSpec:c.validateSpec,valueSpec:y}));return x}return I6({key:s,value:Q,valueSpec:{}})},variableAnchorOffsetCollection:function(c){const s=c.key,Q=c.value,y=m1(Q),x=c.styleSpec;if(y!=="array"||Q.length<1||Q.length%2!=0)return[new it(s,Q,"variableAnchorOffsetCollection requires a non-empty array of even length")];let C=[];for(let S=0;S<Q.length;S+=2)C=C.concat(B6({key:`${s}[${S}]`,value:Q[S],valueSpec:x.layout_symbol["text-anchor"]})),C=C.concat(Bn({key:`${s}[${S+1}]`,value:Q[S+1],valueSpec:{length:2,value:"number"},validateSpec:c.validateSpec,style:c.style,styleSpec:x}));return C},sprite:p9};function O4(c){const s=c.value,Q=c.valueSpec,y=c.styleSpec;return c.validateSpec=O4,Q.expression&&q1(Y1(s))?v5(c):Q.expression&&f5(zr(s))?$r(c):Q.type&&m9[Q.type]?m9[Q.type](c):Q3(c3({},c,{valueSpec:Q.type?y[Q.type]:Q}))}function y9(c){const s=c.value,Q=c.key,y=h4(c);return y.length||(s.indexOf("{fontstack}")===-1&&y.push(new it(Q,s,'"glyphs" url must include a "{fontstack}" token')),s.indexOf("{range}")===-1&&y.push(new it(Q,s,'"glyphs" url must include a "{range}" token'))),y}function q3(c,s=Pe){let Q=[];return Q=Q.concat(O4({key:"",value:c,valueSpec:s.$root,styleSpec:s,style:c,validateSpec:O4,objectElementValidators:{glyphs:y9,"*":()=>[]}})),c.constants&&(Q=Q.concat(c9({key:"constants",value:c.constants,style:c,styleSpec:s,validateSpec:O4}))),x5(Q)}function k4(c){return function(s){return c({...s,validateSpec:O4})}}function x5(c){return[].concat(c).sort((s,Q)=>s.line-Q.line)}function P4(c){return function(...s){return x5(c.apply(this,s))}}q3.source=P4(k4(C3)),q3.sprite=P4(k4(p9)),q3.glyphs=P4(k4(y9)),q3.light=P4(k4(F6)),q3.terrain=P4(k4(f9)),q3.layer=P4(k4(d9)),q3.filter=P4(k4(Nn)),q3.paintProperty=P4(k4(T9)),q3.layoutProperty=P4(k4(h9));const I4=q3,Th=I4.light,a0=I4.paintProperty,g9=I4.layoutProperty;function L5(c,s){let Q=!1;if(s&&s.length)for(const y of s)c.fire(new t1(new Error(y.message))),Q=!0;return Q}class Fn{constructor(s,Q,y){const x=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const S=new Int32Array(this.arrayBuffer);s=S[0],this.d=(Q=S[1])+2*(y=S[2]);for(let B=0;B<this.d*this.d;B++){const j=S[3+B],q=S[3+B+1];x.push(j===q?null:S.subarray(j,q))}const O=S[3+x.length+1];this.keys=S.subarray(S[3+x.length],O),this.bboxes=S.subarray(O),this.insert=this._insertReadonly}else{this.d=Q+2*y;for(let S=0;S<this.d*this.d;S++)x.push([]);this.keys=[],this.bboxes=[]}this.n=Q,this.extent=s,this.padding=y,this.scale=Q/s,this.uid=0;const C=y/Q*s;this.min=-C,this.max=s+C}insert(s,Q,y,x,C){this._forEachCell(Q,y,x,C,this._insertCell,this.uid++,void 0,void 0),this.keys.push(s),this.bboxes.push(Q),this.bboxes.push(y),this.bboxes.push(x),this.bboxes.push(C)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(s,Q,y,x,C,S){this.cells[C].push(S)}query(s,Q,y,x,C){const S=this.min,O=this.max;if(s<=S&&Q<=S&&O<=y&&O<=x&&!C)return Array.prototype.slice.call(this.keys);{const B=[];return this._forEachCell(s,Q,y,x,this._queryCell,B,{},C),B}}_queryCell(s,Q,y,x,C,S,O,B){const j=this.cells[C];if(j!==null){const q=this.keys,X=this.bboxes;for(let Y=0;Y<j.length;Y++){const re=j[Y];if(O[re]===void 0){const ae=4*re;(B?B(X[ae+0],X[ae+1],X[ae+2],X[ae+3]):s<=X[ae+2]&&Q<=X[ae+3]&&y>=X[ae+0]&&x>=X[ae+1])?(O[re]=!0,S.push(q[re])):O[re]=!1}}}}_forEachCell(s,Q,y,x,C,S,O,B){const j=this._convertToCellCoord(s),q=this._convertToCellCoord(Q),X=this._convertToCellCoord(y),Y=this._convertToCellCoord(x);for(let re=j;re<=X;re++)for(let ae=q;ae<=Y;ae++){const le=this.d*ae+re;if((!B||B(this._convertFromCellCoord(re),this._convertFromCellCoord(ae),this._convertFromCellCoord(re+1),this._convertFromCellCoord(ae+1)))&&C.call(this,s,Q,y,x,le,S,O,B))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,Q=3+this.cells.length+1+1;let y=0;for(let S=0;S<this.cells.length;S++)y+=this.cells[S].length;const x=new Int32Array(Q+y+this.keys.length+this.bboxes.length);x[0]=this.extent,x[1]=this.n,x[2]=this.padding;let C=Q;for(let S=0;S<s.length;S++){const O=s[S];x[3+S]=C,x.set(O,C),C+=O.length}return x[3+s.length]=C,x.set(this.keys,C),C+=this.keys.length,x[3+s.length+1]=C,x.set(this.bboxes,C),C+=this.bboxes.length,x.buffer}static serialize(s,Q){const y=s.toArrayBuffer();return Q&&Q.push(y),{buffer:y}}static deserialize(s){return new Fn(s.buffer)}}const B4={};function _t(c,s,Q={}){if(B4[c])throw new Error(`${c} is already registered.`);Object.defineProperty(s,"_classRegistryKey",{value:c,writeable:!1}),B4[c]={klass:s,omit:Q.omit||[],shallow:Q.shallow||[]}}_t("Object",Object),_t("TransferableGridIndex",Fn),_t("Color",H1),_t("Error",Error),_t("AJAXError",Ne),_t("ResolvedImage",D2),_t("StylePropertyFunction",D6),_t("StyleExpression",e0,{omit:["_evaluator"]}),_t("ZoomDependentExpression",m5),_t("ZoomConstantExpression",t0),_t("CompoundExpression",Z3,{omit:["_evaluate"]});for(const c in Pn)Pn[c]._classRegistryKey||_t(`Expression_${c}`,Pn[c]);function b5(c){return c&&typeof ArrayBuffer<"u"&&(c instanceof ArrayBuffer||c.constructor&&c.constructor.name==="ArrayBuffer")}function Tr(c,s){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob)return c;if(b5(c)||Pt(c))return s&&s.push(c),c;if(ArrayBuffer.isView(c)){const Q=c;return s&&s.push(Q.buffer),Q}if(c instanceof ImageData)return s&&s.push(c.data.buffer),c;if(Array.isArray(c)){const Q=[];for(const y of c)Q.push(Tr(y,s));return Q}if(typeof c=="object"){const Q=c.constructor,y=Q._classRegistryKey;if(!y)throw new Error("can't serialize object of unregistered class");if(!B4[y])throw new Error(`${y} is not registered.`);const x=Q.serialize?Q.serialize(c,s):{};if(Q.serialize){if(s&&x===s[s.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const C in c){if(!c.hasOwnProperty(C)||B4[y].omit.indexOf(C)>=0)continue;const S=c[C];x[C]=B4[y].shallow.indexOf(C)>=0?S:Tr(S,s)}c instanceof Error&&(x.message=c.message)}if(x.$name)throw new Error("$name property is reserved for worker serialization logic.");return y!=="Object"&&(x.$name=y),x}throw new Error("can't serialize object of type "+typeof c)}function Rn(c){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob||b5(c)||Pt(c)||ArrayBuffer.isView(c)||c instanceof ImageData)return c;if(Array.isArray(c))return c.map(Rn);if(typeof c=="object"){const s=c.$name||"Object";if(!B4[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:Q}=B4[s];if(!Q)throw new Error(`can't deserialize unregistered class ${s}`);if(Q.deserialize)return Q.deserialize(c);const y=Object.create(Q.prototype);for(const x of Object.keys(c)){if(x==="$name")continue;const C=c[x];y[x]=B4[s].shallow.indexOf(x)>=0?C:Rn(C)}return y}throw new Error("can't deserialize object of type "+typeof c)}class _9{constructor(){this.first=!0}update(s,Q){const y=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=y,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=y,!0):(this.lastFloorZoom>y?(this.lastIntegerZoom=y+1,this.lastIntegerZoomTime=Q):this.lastFloorZoom<y&&(this.lastIntegerZoom=y,this.lastIntegerZoomTime=Q),s!==this.lastZoom&&(this.lastZoom=s,this.lastFloorZoom=y,!0))}}const ht={"Latin-1 Supplement":c=>c>=128&&c<=255,Arabic:c=>c>=1536&&c<=1791,"Arabic Supplement":c=>c>=1872&&c<=1919,"Arabic Extended-A":c=>c>=2208&&c<=2303,"Hangul Jamo":c=>c>=4352&&c<=4607,"Unified Canadian Aboriginal Syllabics":c=>c>=5120&&c<=5759,Khmer:c=>c>=6016&&c<=6143,"Unified Canadian Aboriginal Syllabics Extended":c=>c>=6320&&c<=6399,"General Punctuation":c=>c>=8192&&c<=8303,"Letterlike Symbols":c=>c>=8448&&c<=8527,"Number Forms":c=>c>=8528&&c<=8591,"Miscellaneous Technical":c=>c>=8960&&c<=9215,"Control Pictures":c=>c>=9216&&c<=9279,"Optical Character Recognition":c=>c>=9280&&c<=9311,"Enclosed Alphanumerics":c=>c>=9312&&c<=9471,"Geometric Shapes":c=>c>=9632&&c<=9727,"Miscellaneous Symbols":c=>c>=9728&&c<=9983,"Miscellaneous Symbols and Arrows":c=>c>=11008&&c<=11263,"CJK Radicals Supplement":c=>c>=11904&&c<=12031,"Kangxi Radicals":c=>c>=12032&&c<=12255,"Ideographic Description Characters":c=>c>=12272&&c<=12287,"CJK Symbols and Punctuation":c=>c>=12288&&c<=12351,Hiragana:c=>c>=12352&&c<=12447,Katakana:c=>c>=12448&&c<=12543,Bopomofo:c=>c>=12544&&c<=12591,"Hangul Compatibility Jamo":c=>c>=12592&&c<=12687,Kanbun:c=>c>=12688&&c<=12703,"Bopomofo Extended":c=>c>=12704&&c<=12735,"CJK Strokes":c=>c>=12736&&c<=12783,"Katakana Phonetic Extensions":c=>c>=12784&&c<=12799,"Enclosed CJK Letters and Months":c=>c>=12800&&c<=13055,"CJK Compatibility":c=>c>=13056&&c<=13311,"CJK Unified Ideographs Extension A":c=>c>=13312&&c<=19903,"Yijing Hexagram Symbols":c=>c>=19904&&c<=19967,"CJK Unified Ideographs":c=>c>=19968&&c<=40959,"Yi Syllables":c=>c>=40960&&c<=42127,"Yi Radicals":c=>c>=42128&&c<=42191,"Hangul Jamo Extended-A":c=>c>=43360&&c<=43391,"Hangul Syllables":c=>c>=44032&&c<=55215,"Hangul Jamo Extended-B":c=>c>=55216&&c<=55295,"Private Use Area":c=>c>=57344&&c<=63743,"CJK Compatibility Ideographs":c=>c>=63744&&c<=64255,"Arabic Presentation Forms-A":c=>c>=64336&&c<=65023,"Vertical Forms":c=>c>=65040&&c<=65055,"CJK Compatibility Forms":c=>c>=65072&&c<=65103,"Small Form Variants":c=>c>=65104&&c<=65135,"Arabic Presentation Forms-B":c=>c>=65136&&c<=65279,"Halfwidth and Fullwidth Forms":c=>c>=65280&&c<=65519};function o0(c){for(const s of c)if(l0(s.charCodeAt(0)))return!0;return!1}function s0(c){for(const s of c)if(!hh(s.charCodeAt(0)))return!1;return!0}function hh(c){return!(ht.Arabic(c)||ht["Arabic Supplement"](c)||ht["Arabic Extended-A"](c)||ht["Arabic Presentation Forms-A"](c)||ht["Arabic Presentation Forms-B"](c))}function l0(c){return!(c!==746&&c!==747&&(c<4352||!(ht["Bopomofo Extended"](c)||ht.Bopomofo(c)||ht["CJK Compatibility Forms"](c)&&!(c>=65097&&c<=65103)||ht["CJK Compatibility Ideographs"](c)||ht["CJK Compatibility"](c)||ht["CJK Radicals Supplement"](c)||ht["CJK Strokes"](c)||!(!ht["CJK Symbols and Punctuation"](c)||c>=12296&&c<=12305||c>=12308&&c<=12319||c===12336)||ht["CJK Unified Ideographs Extension A"](c)||ht["CJK Unified Ideographs"](c)||ht["Enclosed CJK Letters and Months"](c)||ht["Hangul Compatibility Jamo"](c)||ht["Hangul Jamo Extended-A"](c)||ht["Hangul Jamo Extended-B"](c)||ht["Hangul Jamo"](c)||ht["Hangul Syllables"](c)||ht.Hiragana(c)||ht["Ideographic Description Characters"](c)||ht.Kanbun(c)||ht["Kangxi Radicals"](c)||ht["Katakana Phonetic Extensions"](c)||ht.Katakana(c)&&c!==12540||!(!ht["Halfwidth and Fullwidth Forms"](c)||c===65288||c===65289||c===65293||c>=65306&&c<=65310||c===65339||c===65341||c===65343||c>=65371&&c<=65503||c===65507||c>=65512&&c<=65519)||!(!ht["Small Form Variants"](c)||c>=65112&&c<=65118||c>=65123&&c<=65126)||ht["Unified Canadian Aboriginal Syllabics"](c)||ht["Unified Canadian Aboriginal Syllabics Extended"](c)||ht["Vertical Forms"](c)||ht["Yijing Hexagram Symbols"](c)||ht["Yi Syllables"](c)||ht["Yi Radicals"](c))))}function v9(c){return!(l0(c)||function(s){return!!(ht["Latin-1 Supplement"](s)&&(s===167||s===169||s===174||s===177||s===188||s===189||s===190||s===215||s===247)||ht["General Punctuation"](s)&&(s===8214||s===8224||s===8225||s===8240||s===8241||s===8251||s===8252||s===8258||s===8263||s===8264||s===8265||s===8273)||ht["Letterlike Symbols"](s)||ht["Number Forms"](s)||ht["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||s===9003||s>=9085&&s<=9114||s>=9150&&s<=9165||s===9167||s>=9169&&s<=9179||s>=9186&&s<=9215)||ht["Control Pictures"](s)&&s!==9251||ht["Optical Character Recognition"](s)||ht["Enclosed Alphanumerics"](s)||ht["Geometric Shapes"](s)||ht["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||ht["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||ht["CJK Symbols and Punctuation"](s)||ht.Katakana(s)||ht["Private Use Area"](s)||ht["CJK Compatibility Forms"](s)||ht["Small Form Variants"](s)||ht["Halfwidth and Fullwidth Forms"](s)||s===8734||s===8756||s===8757||s>=9984&&s<=10087||s>=10102&&s<=10131||s===65532||s===65533)}(c))}function x9(c){return c>=1424&&c<=2303||ht["Arabic Presentation Forms-A"](c)||ht["Arabic Presentation Forms-B"](c)}function L9(c,s){return!(!s&&x9(c)||c>=2304&&c<=3583||c>=3840&&c<=4255||ht.Khmer(c))}function dh(c){for(const s of c)if(x9(s.charCodeAt(0)))return!0;return!1}const c0="deferred",u0="loading",Q0="loaded";let T0=null,T3="unavailable",hr=null;const R6=function(c){c&&typeof c=="string"&&c.indexOf("NetworkError")>-1&&(T3="error"),T0&&T0(c)};function h0(){j6.fire(new _1("pluginStateChange",{pluginStatus:T3,pluginURL:hr}))}const j6=new V1,d0=function(){return T3},b9=function(){if(T3!==c0||!hr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");T3=u0,h0(),hr&&pt({url:hr},c=>{c?R6(c):(T3=Q0,h0())})},A3={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>T3===Q0||A3.applyArabicShaping!=null,isLoading:()=>T3===u0,setState(c){if(!Ee())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");T3=c.pluginStatus,hr=c.pluginURL},isParsed(){if(!Ee())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return A3.applyArabicShaping!=null&&A3.processBidirectionalText!=null&&A3.processStyledBidirectionalText!=null},getPluginURL(){if(!Ee())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return hr}};class I1{constructor(s,Q){this.zoom=s,Q?(this.now=Q.now,this.fadeDuration=Q.fadeDuration,this.zoomHistory=Q.zoomHistory,this.transition=Q.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _9,this.transition={})}isSupportedScript(s){return function(Q,y){for(const x of Q)if(!L9(x.charCodeAt(0),y))return!1;return!0}(s,A3.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,Q=s-Math.floor(s),y=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:Q+(1-Q)*y}:{fromScale:.5,toScale:1,t:1-(1-y)*Q}}}class w5{constructor(s,Q){this.property=s,this.value=Q,this.expression=function(y,x){if(q1(y))return new D6(y,x);if(f5(y)){const C=r0(y,x);if(C.result==="error")throw new Error(C.value.map(S=>`${S.key}: ${S.message}`).join(", "));return C.value}{let C=y;return x.type==="color"&&typeof y=="string"?C=H1.parse(y):x.type!=="padding"||typeof y!="number"&&!Array.isArray(y)?x.type==="variableAnchorOffsetCollection"&&Array.isArray(y)&&(C=z3.parse(y)):C=w3.parse(y),{kind:"constant",evaluate:()=>C}}}(Q===void 0?s.specification.default:Q,s.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(s,Q,y){return this.property.possiblyEvaluate(this,s,Q,y)}}class f0{constructor(s){this.property=s,this.value=new w5(s,void 0)}transitioned(s,Q){return new H9(this.property,this.value,Q,K({},s.transition,this.transition),s.now)}untransitioned(){return new H9(this.property,this.value,null,{},0)}}class w9{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return ge(this._values[s].value.value)}setValue(s,Q){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new f0(this._values[s].property)),this._values[s].value=new w5(this._values[s].property,Q===null?void 0:ge(Q))}getTransition(s){return ge(this._values[s].transition)}setTransition(s,Q){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new f0(this._values[s].property)),this._values[s].transition=ge(Q)||void 0}serialize(){const s={};for(const Q of Object.keys(this._values)){const y=this.getValue(Q);y!==void 0&&(s[Q]=y);const x=this.getTransition(Q);x!==void 0&&(s[`${Q}-transition`]=x)}return s}transitioned(s,Q){const y=new M9(this._properties);for(const x of Object.keys(this._values))y._values[x]=this._values[x].transitioned(s,Q._values[x]);return y}untransitioned(){const s=new M9(this._properties);for(const Q of Object.keys(this._values))s._values[Q]=this._values[Q].untransitioned();return s}}class H9{constructor(s,Q,y,x,C){this.property=s,this.value=Q,this.begin=C+x.delay||0,this.end=this.begin+x.duration||0,s.specification.transition&&(x.delay||x.duration)&&(this.prior=y)}possiblyEvaluate(s,Q,y){const x=s.now||0,C=this.value.possiblyEvaluate(s,Q,y),S=this.prior;if(S){if(x>this.end)return this.prior=null,C;if(this.value.isDataDriven())return this.prior=null,C;if(x<this.begin)return S.possiblyEvaluate(s,Q,y);{const O=(x-this.begin)/(this.end-this.begin);return this.property.interpolate(S.possiblyEvaluate(s,Q,y),C,function(B){if(B<=0)return 0;if(B>=1)return 1;const j=B*B,q=j*B;return 4*(B<.5?q:3*(B-j)+q-.75)}(O))}}return C}}class M9{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,Q,y){const x=new H5(this._properties);for(const C of Object.keys(this._values))x._values[C]=this._values[C].possiblyEvaluate(s,Q,y);return x}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class fh{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}hasValue(s){return this._values[s].value!==void 0}getValue(s){return ge(this._values[s].value)}setValue(s,Q){this._values[s]=new w5(this._values[s].property,Q===null?void 0:ge(Q))}serialize(){const s={};for(const Q of Object.keys(this._values)){const y=this.getValue(Q);y!==void 0&&(s[Q]=y)}return s}possiblyEvaluate(s,Q,y){const x=new H5(this._properties);for(const C of Object.keys(this._values))x._values[C]=this._values[C].possiblyEvaluate(s,Q,y);return x}}class J2{constructor(s,Q,y){this.property=s,this.value=Q,this.parameters=y}isConstant(){return this.value.kind==="constant"}constantOr(s){return this.value.kind==="constant"?this.value.value:s}evaluate(s,Q,y,x){return this.property.evaluate(this.value,this.parameters,s,Q,y,x)}}class H5{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class St{constructor(s){this.specification=s}possiblyEvaluate(s,Q){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(Q)}interpolate(s,Q,y){const x=H3[this.specification.type];return x?x(s,Q,y):s}}class It{constructor(s,Q){this.specification=s,this.overrides=Q}possiblyEvaluate(s,Q,y,x){return new J2(this,s.expression.kind==="constant"||s.expression.kind==="camera"?{kind:"constant",value:s.expression.evaluate(Q,null,{},y,x)}:s.expression,Q)}interpolate(s,Q,y){if(s.value.kind!=="constant"||Q.value.kind!=="constant")return s;if(s.value.value===void 0||Q.value.value===void 0)return new J2(this,{kind:"constant",value:void 0},s.parameters);const x=H3[this.specification.type];if(x){const C=x(s.value.value,Q.value.value,y);return new J2(this,{kind:"constant",value:C},s.parameters)}return s}evaluate(s,Q,y,x,C,S){return s.kind==="constant"?s.value:s.evaluate(Q,y,x,C,S)}}class z6 extends It{possiblyEvaluate(s,Q,y,x){if(s.value===void 0)return new J2(this,{kind:"constant",value:void 0},Q);if(s.expression.kind==="constant"){const C=s.expression.evaluate(Q,null,{},y,x),S=s.property.specification.type==="resolvedImage"&&typeof C!="string"?C.name:C,O=this._calculate(S,S,S,Q);return new J2(this,{kind:"constant",value:O},Q)}if(s.expression.kind==="camera"){const C=this._calculate(s.expression.evaluate({zoom:Q.zoom-1}),s.expression.evaluate({zoom:Q.zoom}),s.expression.evaluate({zoom:Q.zoom+1}),Q);return new J2(this,{kind:"constant",value:C},Q)}return new J2(this,s.expression,Q)}evaluate(s,Q,y,x,C,S){if(s.kind==="source"){const O=s.evaluate(Q,y,x,C,S);return this._calculate(O,O,O,Q)}return s.kind==="composite"?this._calculate(s.evaluate({zoom:Math.floor(Q.zoom)-1},y,x),s.evaluate({zoom:Math.floor(Q.zoom)},y,x),s.evaluate({zoom:Math.floor(Q.zoom)+1},y,x),Q):s.value}_calculate(s,Q,y,x){return x.zoom>x.zoomHistory.lastIntegerZoom?{from:s,to:Q}:{from:y,to:Q}}interpolate(s){return s}}class p0{constructor(s){this.specification=s}possiblyEvaluate(s,Q,y,x){if(s.value!==void 0){if(s.expression.kind==="constant"){const C=s.expression.evaluate(Q,null,{},y,x);return this._calculate(C,C,C,Q)}return this._calculate(s.expression.evaluate(new I1(Math.floor(Q.zoom-1),Q)),s.expression.evaluate(new I1(Math.floor(Q.zoom),Q)),s.expression.evaluate(new I1(Math.floor(Q.zoom+1),Q)),Q)}}_calculate(s,Q,y,x){return x.zoom>x.zoomHistory.lastIntegerZoom?{from:s,to:Q}:{from:y,to:Q}}interpolate(s){return s}}class m0{constructor(s){this.specification=s}possiblyEvaluate(s,Q,y,x){return!!s.expression.evaluate(Q,null,{},y,x)}interpolate(){return!1}}class l2{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const Q in s){const y=s[Q];y.specification.overridable&&this.overridableProperties.push(Q);const x=this.defaultPropertyValues[Q]=new w5(y,void 0),C=this.defaultTransitionablePropertyValues[Q]=new f0(y);this.defaultTransitioningPropertyValues[Q]=C.untransitioned(),this.defaultPossiblyEvaluatedValues[Q]=x.possiblyEvaluate({})}}}_t("DataDrivenProperty",It),_t("DataConstantProperty",St),_t("CrossFadedDataDrivenProperty",z6),_t("CrossFadedProperty",p0),_t("ColorRampProperty",m0);const y0="-transition";class G3 extends V1{constructor(s,Q){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},s.type!=="custom"&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,s.type!=="background"&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),Q.layout&&(this._unevaluatedLayout=new fh(Q.layout)),Q.paint)){this._transitionablePaint=new w9(Q.paint);for(const y in s.paint)this.setPaintProperty(y,s.paint[y],{validate:!1});for(const y in s.layout)this.setLayoutProperty(y,s.layout[y],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new H5(Q.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return s==="visibility"?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,Q,y={}){Q!=null&&this._validate(g9,`layers.${this.id}.layout.${s}`,s,Q,y)||(s!=="visibility"?this._unevaluatedLayout.setValue(s,Q):this.visibility=Q)}getPaintProperty(s){return s.endsWith(y0)?this._transitionablePaint.getTransition(s.slice(0,-11)):this._transitionablePaint.getValue(s)}setPaintProperty(s,Q,y={}){if(Q!=null&&this._validate(a0,`layers.${this.id}.paint.${s}`,s,Q,y))return!1;if(s.endsWith(y0))return this._transitionablePaint.setTransition(s.slice(0,-11),Q||void 0),!1;{const x=this._transitionablePaint._values[s],C=x.property.specification["property-type"]==="cross-faded-data-driven",S=x.value.isDataDriven(),O=x.value;this._transitionablePaint.setValue(s,Q),this._handleSpecialPaintPropertyUpdate(s);const B=this._transitionablePaint._values[s].value;return B.isDataDriven()||S||C||this._handleOverridablePaintPropertyUpdate(s,O,B)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,Q,y){return!1}isHidden(s){return!!(this.minzoom&&s<this.minzoom)||!!(this.maxzoom&&s>=this.maxzoom)||this.visibility==="none"}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,Q){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,Q)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,Q)}serialize(){const s={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&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),de(s,(Q,y)=>!(Q===void 0||y==="layout"&&!Object.keys(Q).length||y==="paint"&&!Object.keys(Q).length))}_validate(s,Q,y,x,C={}){return(!C||C.validate!==!1)&&L5(this,s.call(I4,{key:Q,layerType:this.type,objectKey:y,value:x,styleSpec:Pe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const Q=this.paint.get(s);if(Q instanceof J2&&In(Q.property.specification)&&(Q.value.kind==="source"||Q.value.kind==="composite")&&Q.value.isStateDependent)return!0}return!1}}const C9={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Zr{constructor(s,Q){this._structArray=s,this._pos1=Q*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class e2{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,Q){return s._trim(),Q&&(s.isTransferred=!0,Q.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const Q=Object.create(this.prototype);return Q.arrayBuffer=s.arrayBuffer,Q.length=s.length,Q.capacity=s.arrayBuffer.byteLength/Q.bytesPerElement,Q._refreshViews(),Q}_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(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const Q=this.uint8;this._refreshViews(),Q&&this.uint8.set(Q)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function U1(c,s=1){let Q=0,y=0;return{members:c.map(x=>{const C=C9[x.type].BYTES_PER_ELEMENT,S=Q=jn(Q,Math.max(s,C)),O=x.components||1;return y=Math.max(y,C),Q+=C*O,{name:x.name,type:x.type,components:O,offset:S}}),size:jn(Q,Math.max(y,s)),alignment:s}}function jn(c,s){return Math.ceil(c/s)*s}class $6 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q){const y=this.length;return this.resize(y+1),this.emplace(y,s,Q)}emplace(s,Q,y){const x=2*s;return this.int16[x+0]=Q,this.int16[x+1]=y,s}}$6.prototype.bytesPerElement=4,_t("StructArrayLayout2i4",$6);class Z6 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q,y){const x=this.length;return this.resize(x+1),this.emplace(x,s,Q,y)}emplace(s,Q,y,x){const C=3*s;return this.int16[C+0]=Q,this.int16[C+1]=y,this.int16[C+2]=x,s}}Z6.prototype.bytesPerElement=6,_t("StructArrayLayout3i6",Z6);class qr extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x){const C=this.length;return this.resize(C+1),this.emplace(C,s,Q,y,x)}emplace(s,Q,y,x,C){const S=4*s;return this.int16[S+0]=Q,this.int16[S+1]=y,this.int16[S+2]=x,this.int16[S+3]=C,s}}qr.prototype.bytesPerElement=8,_t("StructArrayLayout4i8",qr);class g0 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x,C,S){const O=this.length;return this.resize(O+1),this.emplace(O,s,Q,y,x,C,S)}emplace(s,Q,y,x,C,S,O){const B=6*s;return this.int16[B+0]=Q,this.int16[B+1]=y,this.int16[B+2]=x,this.int16[B+3]=C,this.int16[B+4]=S,this.int16[B+5]=O,s}}g0.prototype.bytesPerElement=12,_t("StructArrayLayout2i4i12",g0);class _0 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x,C,S){const O=this.length;return this.resize(O+1),this.emplace(O,s,Q,y,x,C,S)}emplace(s,Q,y,x,C,S,O){const B=4*s,j=8*s;return this.int16[B+0]=Q,this.int16[B+1]=y,this.uint8[j+4]=x,this.uint8[j+5]=C,this.uint8[j+6]=S,this.uint8[j+7]=O,s}}_0.prototype.bytesPerElement=8,_t("StructArrayLayout2i4ub8",_0);class zn extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,Q){const y=this.length;return this.resize(y+1),this.emplace(y,s,Q)}emplace(s,Q,y){const x=2*s;return this.float32[x+0]=Q,this.float32[x+1]=y,s}}zn.prototype.bytesPerElement=8,_t("StructArrayLayout2f8",zn);class v0 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x,C,S,O,B,j,q){const X=this.length;return this.resize(X+1),this.emplace(X,s,Q,y,x,C,S,O,B,j,q)}emplace(s,Q,y,x,C,S,O,B,j,q,X){const Y=10*s;return this.uint16[Y+0]=Q,this.uint16[Y+1]=y,this.uint16[Y+2]=x,this.uint16[Y+3]=C,this.uint16[Y+4]=S,this.uint16[Y+5]=O,this.uint16[Y+6]=B,this.uint16[Y+7]=j,this.uint16[Y+8]=q,this.uint16[Y+9]=X,s}}v0.prototype.bytesPerElement=20,_t("StructArrayLayout10ui20",v0);class x0 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x,C,S,O,B,j,q,X,Y){const re=this.length;return this.resize(re+1),this.emplace(re,s,Q,y,x,C,S,O,B,j,q,X,Y)}emplace(s,Q,y,x,C,S,O,B,j,q,X,Y,re){const ae=12*s;return this.int16[ae+0]=Q,this.int16[ae+1]=y,this.int16[ae+2]=x,this.int16[ae+3]=C,this.uint16[ae+4]=S,this.uint16[ae+5]=O,this.uint16[ae+6]=B,this.uint16[ae+7]=j,this.int16[ae+8]=q,this.int16[ae+9]=X,this.int16[ae+10]=Y,this.int16[ae+11]=re,s}}x0.prototype.bytesPerElement=24,_t("StructArrayLayout4i4ui4i24",x0);class y1 extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,Q,y){const x=this.length;return this.resize(x+1),this.emplace(x,s,Q,y)}emplace(s,Q,y,x){const C=3*s;return this.float32[C+0]=Q,this.float32[C+1]=y,this.float32[C+2]=x,s}}y1.prototype.bytesPerElement=12,_t("StructArrayLayout3f12",y1);class M extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const Q=this.length;return this.resize(Q+1),this.emplace(Q,s)}emplace(s,Q){return this.uint32[1*s+0]=Q,s}}M.prototype.bytesPerElement=4,_t("StructArrayLayout1ul4",M);class l extends e2{_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(s,Q,y,x,C,S,O,B,j){const q=this.length;return this.resize(q+1),this.emplace(q,s,Q,y,x,C,S,O,B,j)}emplace(s,Q,y,x,C,S,O,B,j,q){const X=10*s,Y=5*s;return this.int16[X+0]=Q,this.int16[X+1]=y,this.int16[X+2]=x,this.int16[X+3]=C,this.int16[X+4]=S,this.int16[X+5]=O,this.uint32[Y+3]=B,this.uint16[X+8]=j,this.uint16[X+9]=q,s}}l.prototype.bytesPerElement=20,_t("StructArrayLayout6i1ul2ui20",l);class d extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x,C,S){const O=this.length;return this.resize(O+1),this.emplace(O,s,Q,y,x,C,S)}emplace(s,Q,y,x,C,S,O){const B=6*s;return this.int16[B+0]=Q,this.int16[B+1]=y,this.int16[B+2]=x,this.int16[B+3]=C,this.int16[B+4]=S,this.int16[B+5]=O,s}}d.prototype.bytesPerElement=12,_t("StructArrayLayout2i2i2i12",d);class _ extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,Q,y,x,C){const S=this.length;return this.resize(S+1),this.emplace(S,s,Q,y,x,C)}emplace(s,Q,y,x,C,S){const O=4*s,B=8*s;return this.float32[O+0]=Q,this.float32[O+1]=y,this.float32[O+2]=x,this.int16[B+6]=C,this.int16[B+7]=S,s}}_.prototype.bytesPerElement=16,_t("StructArrayLayout2f1f2i16",_);class L extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,Q,y,x){const C=this.length;return this.resize(C+1),this.emplace(C,s,Q,y,x)}emplace(s,Q,y,x,C){const S=12*s,O=3*s;return this.uint8[S+0]=Q,this.uint8[S+1]=y,this.float32[O+1]=x,this.float32[O+2]=C,s}}L.prototype.bytesPerElement=12,_t("StructArrayLayout2ub2f12",L);class A extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,Q,y){const x=this.length;return this.resize(x+1),this.emplace(x,s,Q,y)}emplace(s,Q,y,x){const C=3*s;return this.uint16[C+0]=Q,this.uint16[C+1]=y,this.uint16[C+2]=x,s}}A.prototype.bytesPerElement=6,_t("StructArrayLayout3ui6",A);class k extends e2{_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(s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le,fe,ye){const He=this.length;return this.resize(He+1),this.emplace(He,s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le,fe,ye)}emplace(s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le,fe,ye,He){const ve=24*s,Me=12*s,De=48*s;return this.int16[ve+0]=Q,this.int16[ve+1]=y,this.uint16[ve+2]=x,this.uint16[ve+3]=C,this.uint32[Me+2]=S,this.uint32[Me+3]=O,this.uint32[Me+4]=B,this.uint16[ve+10]=j,this.uint16[ve+11]=q,this.uint16[ve+12]=X,this.float32[Me+7]=Y,this.float32[Me+8]=re,this.uint8[De+36]=ae,this.uint8[De+37]=le,this.uint8[De+38]=fe,this.uint32[Me+10]=ye,this.int16[ve+22]=He,s}}k.prototype.bytesPerElement=48,_t("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",k);class P extends e2{_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(s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le,fe,ye,He,ve,Me,De,$e,dt,wt,Qt,ct,ot,xt){const st=this.length;return this.resize(st+1),this.emplace(st,s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le,fe,ye,He,ve,Me,De,$e,dt,wt,Qt,ct,ot,xt)}emplace(s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le,fe,ye,He,ve,Me,De,$e,dt,wt,Qt,ct,ot,xt,st){const We=32*s,Ot=16*s;return this.int16[We+0]=Q,this.int16[We+1]=y,this.int16[We+2]=x,this.int16[We+3]=C,this.int16[We+4]=S,this.int16[We+5]=O,this.int16[We+6]=B,this.int16[We+7]=j,this.uint16[We+8]=q,this.uint16[We+9]=X,this.uint16[We+10]=Y,this.uint16[We+11]=re,this.uint16[We+12]=ae,this.uint16[We+13]=le,this.uint16[We+14]=fe,this.uint16[We+15]=ye,this.uint16[We+16]=He,this.uint16[We+17]=ve,this.uint16[We+18]=Me,this.uint16[We+19]=De,this.uint16[We+20]=$e,this.uint16[We+21]=dt,this.uint16[We+22]=wt,this.uint32[Ot+12]=Qt,this.float32[Ot+13]=ct,this.float32[Ot+14]=ot,this.uint16[We+30]=xt,this.uint16[We+31]=st,s}}P.prototype.bytesPerElement=64,_t("StructArrayLayout8i15ui1ul2f2ui64",P);class F extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const Q=this.length;return this.resize(Q+1),this.emplace(Q,s)}emplace(s,Q){return this.float32[1*s+0]=Q,s}}F.prototype.bytesPerElement=4,_t("StructArrayLayout1f4",F);class $ extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,Q,y){const x=this.length;return this.resize(x+1),this.emplace(x,s,Q,y)}emplace(s,Q,y,x){const C=3*s;return this.uint16[6*s+0]=Q,this.float32[C+1]=y,this.float32[C+2]=x,s}}$.prototype.bytesPerElement=12,_t("StructArrayLayout1ui2f12",$);class G extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,Q,y){const x=this.length;return this.resize(x+1),this.emplace(x,s,Q,y)}emplace(s,Q,y,x){const C=4*s;return this.uint32[2*s+0]=Q,this.uint16[C+2]=y,this.uint16[C+3]=x,s}}G.prototype.bytesPerElement=8,_t("StructArrayLayout1ul2ui8",G);class W extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,Q){const y=this.length;return this.resize(y+1),this.emplace(y,s,Q)}emplace(s,Q,y){const x=2*s;return this.uint16[x+0]=Q,this.uint16[x+1]=y,s}}W.prototype.bytesPerElement=4,_t("StructArrayLayout2ui4",W);class te extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const Q=this.length;return this.resize(Q+1),this.emplace(Q,s)}emplace(s,Q){return this.uint16[1*s+0]=Q,s}}te.prototype.bytesPerElement=2,_t("StructArrayLayout1ui2",te);class ue extends e2{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,Q,y,x){const C=this.length;return this.resize(C+1),this.emplace(C,s,Q,y,x)}emplace(s,Q,y,x,C){const S=4*s;return this.float32[S+0]=Q,this.float32[S+1]=y,this.float32[S+2]=x,this.float32[S+3]=C,s}}ue.prototype.bytesPerElement=16,_t("StructArrayLayout4f16",ue);class ce extends Zr{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 g(this.anchorPointX,this.anchorPointY)}}ce.prototype.size=20;class Te extends l{get(s){return new ce(this,s)}}_t("CollisionBoxArray",Te);class se extends Zr{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(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}se.prototype.size=48;class xe extends k{get(s){return new se(this,s)}}_t("PlacedSymbolArray",xe);class Se extends Zr{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(s){this._structArray.uint32[this._pos4+12]=s}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]}}Se.prototype.size=64;class pe extends P{get(s){return new Se(this,s)}}_t("SymbolInstanceArray",pe);class we extends F{getoffsetX(s){return this.float32[1*s+0]}}_t("GlyphOffsetArray",we);class Oe extends Z6{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}_t("SymbolLineVertexArray",Oe);class ke extends Zr{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]}}ke.prototype.size=12;class je extends ${get(s){return new ke(this,s)}}_t("TextAnchorOffsetArray",je);class Ue extends Zr{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]}}Ue.prototype.size=8;class Ge extends G{get(s){return new Ue(this,s)}}_t("FeatureIndexArray",Ge);class rt extends $6{}class bt extends $6{}class o1 extends $6{}class lt extends g0{}class Bt extends _0{}class Mt extends zn{}class M1 extends v0{}class a1 extends x0{}class Kt extends y1{}class s1 extends M{}class n2 extends d{}class O1 extends L{}class O2 extends A{}class m2 extends W{}const c2=U1([{name:"a_pos",components:2,type:"Int16"}],4),{members:S3}=c2;class B1{constructor(s=[]){this.segments=s}prepareSegment(s,Q,y,x){let C=this.segments[this.segments.length-1];return s>B1.MAX_VERTEX_ARRAY_LENGTH&&Re(`Max vertices per segment is ${B1.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!C||C.vertexLength+s>B1.MAX_VERTEX_ARRAY_LENGTH||C.sortKey!==x)&&(C={vertexOffset:Q.length,primitiveOffset:y.length,vertexLength:0,primitiveLength:0},x!==void 0&&(C.sortKey=x),this.segments.push(C)),C}get(){return this.segments}destroy(){for(const s of this.segments)for(const Q in s.vaos)s.vaos[Q].destroy()}static simpleSegment(s,Q,y,x){return new B1([{vertexOffset:s,primitiveOffset:Q,vertexLength:y,primitiveLength:x,vaos:{},sortKey:0}])}}function d4(c,s){return 256*(c=z(Math.floor(c),0,255))+z(Math.floor(s),0,255)}B1.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,_t("SegmentVector",B1);const f4=U1([{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 dr={exports:{}},Gr={exports:{}};Gr.exports=function(c,s){var Q,y,x,C,S,O,B,j;for(y=c.length-(Q=3&c.length),x=s,S=3432918353,O=461845907,j=0;j<y;)B=255&c.charCodeAt(j)|(255&c.charCodeAt(++j))<<8|(255&c.charCodeAt(++j))<<16|(255&c.charCodeAt(++j))<<24,++j,x=27492+(65535&(C=5*(65535&(x=(x^=B=(65535&(B=(B=(65535&B)*S+(((B>>>16)*S&65535)<<16)&4294967295)<<15|B>>>17))*O+(((B>>>16)*O&65535)<<16)&4294967295)<<13|x>>>19))+((5*(x>>>16)&65535)<<16)&4294967295))+((58964+(C>>>16)&65535)<<16);switch(B=0,Q){case 3:B^=(255&c.charCodeAt(j+2))<<16;case 2:B^=(255&c.charCodeAt(j+1))<<8;case 1:x^=B=(65535&(B=(B=(65535&(B^=255&c.charCodeAt(j)))*S+(((B>>>16)*S&65535)<<16)&4294967295)<<15|B>>>17))*O+(((B>>>16)*O&65535)<<16)&4294967295}return x^=c.length,x=2246822507*(65535&(x^=x>>>16))+((2246822507*(x>>>16)&65535)<<16)&4294967295,x=3266489909*(65535&(x^=x>>>13))+((3266489909*(x>>>16)&65535)<<16)&4294967295,(x^=x>>>16)>>>0};var $n=Gr.exports,$2={exports:{}};$2.exports=function(c,s){for(var Q,y=c.length,x=s^y,C=0;y>=4;)Q=1540483477*(65535&(Q=255&c.charCodeAt(C)|(255&c.charCodeAt(++C))<<8|(255&c.charCodeAt(++C))<<16|(255&c.charCodeAt(++C))<<24))+((1540483477*(Q>>>16)&65535)<<16),x=1540483477*(65535&x)+((1540483477*(x>>>16)&65535)<<16)^(Q=1540483477*(65535&(Q^=Q>>>24))+((1540483477*(Q>>>16)&65535)<<16)),y-=4,++C;switch(y){case 3:x^=(255&c.charCodeAt(C+2))<<16;case 2:x^=(255&c.charCodeAt(C+1))<<8;case 1:x=1540483477*(65535&(x^=255&c.charCodeAt(C)))+((1540483477*(x>>>16)&65535)<<16)}return x=1540483477*(65535&(x^=x>>>13))+((1540483477*(x>>>16)&65535)<<16),(x^=x>>>15)>>>0};var k2=$n,Y2=$2.exports;dr.exports=k2,dr.exports.murmur3=k2,dr.exports.murmur2=Y2;var Ur=h(dr.exports);class i2{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,Q,y,x){this.ids.push(y2(s)),this.positions.push(Q,y,x)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const Q=y2(s);let y=0,x=this.ids.length-1;for(;y<x;){const S=y+x>>1;this.ids[S]>=Q?x=S:y=S+1}const C=[];for(;this.ids[y]===Q;)C.push({index:this.positions[3*y],start:this.positions[3*y+1],end:this.positions[3*y+2]}),y++;return C}static serialize(s,Q){const y=new Float64Array(s.ids),x=new Uint32Array(s.positions);return h3(y,x,0,y.length-1),Q&&Q.push(y.buffer,x.buffer),{ids:y,positions:x}}static deserialize(s){const Q=new i2;return Q.ids=s.ids,Q.positions=s.positions,Q.indexed=!0,Q}}function y2(c){const s=+c;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:Ur(String(c))}function h3(c,s,Q,y){for(;Q<y;){const x=c[Q+y>>1];let C=Q-1,S=y+1;for(;;){do C++;while(c[C]<x);do S--;while(c[S]>x);if(C>=S)break;a2(c,C,S),a2(s,3*C,3*S),a2(s,3*C+1,3*S+1),a2(s,3*C+2,3*S+2)}S-Q<y-S?(h3(c,s,Q,S),Q=S+1):(h3(c,s,S+1,y),y=S)}}function a2(c,s,Q){const y=c[s];c[s]=c[Q],c[Q]=y}_t("FeaturePositionMap",i2);class Wr{constructor(s,Q){this.gl=s.gl,this.location=Q}}class M5 extends Wr{constructor(s,Q){super(s,Q),this.current=0}set(s){this.current!==s&&(this.current=s,this.gl.uniform1f(this.location,s))}}class A9 extends Wr{constructor(s,Q){super(s,Q),this.current=[0,0,0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]&&s[2]===this.current[2]&&s[3]===this.current[3]||(this.current=s,this.gl.uniform4f(this.location,s[0],s[1],s[2],s[3]))}}class S9 extends Wr{constructor(s,Q){super(s,Q),this.current=H1.transparent}set(s){s.r===this.current.r&&s.g===this.current.g&&s.b===this.current.b&&s.a===this.current.a||(this.current=s,this.gl.uniform4f(this.location,s.r,s.g,s.b,s.a))}}const ph=new Float32Array(16);function L0(c){return[d4(255*c.r,255*c.g),d4(255*c.b,255*c.a)]}class p4{constructor(s,Q,y){this.value=s,this.uniformNames=Q.map(x=>`u_${x}`),this.type=y}setUniform(s,Q,y){s.set(y.constantOr(this.value))}getBinding(s,Q,y){return this.type==="color"?new S9(s,Q):new M5(s,Q)}}class Xr{constructor(s,Q){this.uniformNames=Q.map(y=>`u_${y}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,Q){this.pixelRatioFrom=Q.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=Q.tlbr,this.patternTo=s.tlbr}setUniform(s,Q,y,x){const C=x==="u_pattern_to"?this.patternTo:x==="u_pattern_from"?this.patternFrom:x==="u_pixel_ratio_to"?this.pixelRatioTo:x==="u_pixel_ratio_from"?this.pixelRatioFrom:null;C&&s.set(C)}getBinding(s,Q,y){return y.substr(0,9)==="u_pattern"?new A9(s,Q):new M5(s,Q)}}class m4{constructor(s,Q,y,x){this.expression=s,this.type=y,this.maxValue=0,this.paintVertexAttributes=Q.map(C=>({name:`a_${C}`,type:"Float32",components:y==="color"?2:1,offset:0})),this.paintVertexArray=new x}populatePaintArray(s,Q,y,x,C){const S=this.paintVertexArray.length,O=this.expression.evaluate(new I1(0),Q,{},x,[],C);this.paintVertexArray.resize(s),this._setPaintValue(S,s,O)}updatePaintArray(s,Q,y,x){const C=this.expression.evaluate({zoom:0},y,x);this._setPaintValue(s,Q,C)}_setPaintValue(s,Q,y){if(this.type==="color"){const x=L0(y);for(let C=s;C<Q;C++)this.paintVertexArray.emplace(C,x[0],x[1])}else{for(let x=s;x<Q;x++)this.paintVertexArray.emplace(x,y);this.maxValue=Math.max(this.maxValue,Math.abs(y))}}upload(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class U3{constructor(s,Q,y,x,C,S){this.expression=s,this.uniformNames=Q.map(O=>`u_${O}_t`),this.type=y,this.useIntegerZoom=x,this.zoom=C,this.maxValue=0,this.paintVertexAttributes=Q.map(O=>({name:`a_${O}`,type:"Float32",components:y==="color"?4:2,offset:0})),this.paintVertexArray=new S}populatePaintArray(s,Q,y,x,C){const S=this.expression.evaluate(new I1(this.zoom),Q,{},x,[],C),O=this.expression.evaluate(new I1(this.zoom+1),Q,{},x,[],C),B=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(B,s,S,O)}updatePaintArray(s,Q,y,x){const C=this.expression.evaluate({zoom:this.zoom},y,x),S=this.expression.evaluate({zoom:this.zoom+1},y,x);this._setPaintValue(s,Q,C,S)}_setPaintValue(s,Q,y,x){if(this.type==="color"){const C=L0(y),S=L0(x);for(let O=s;O<Q;O++)this.paintVertexArray.emplace(O,C[0],C[1],S[0],S[1])}else{for(let C=s;C<Q;C++)this.paintVertexArray.emplace(C,y,x);this.maxValue=Math.max(this.maxValue,Math.abs(y),Math.abs(x))}}upload(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(s,Q){const y=this.useIntegerZoom?Math.floor(Q.zoom):Q.zoom,x=z(this.expression.interpolationFactor(y,this.zoom,this.zoom+1),0,1);s.set(x)}getBinding(s,Q,y){return new M5(s,Q)}}class y4{constructor(s,Q,y,x,C,S){this.expression=s,this.type=Q,this.useIntegerZoom=y,this.zoom=x,this.layerId=S,this.zoomInPaintVertexArray=new C,this.zoomOutPaintVertexArray=new C}populatePaintArray(s,Q,y){const x=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(s),this.zoomOutPaintVertexArray.resize(s),this._setPaintValues(x,s,Q.patterns&&Q.patterns[this.layerId],y)}updatePaintArray(s,Q,y,x,C){this._setPaintValues(s,Q,y.patterns&&y.patterns[this.layerId],C)}_setPaintValues(s,Q,y,x){if(!x||!y)return;const{min:C,mid:S,max:O}=y,B=x[C],j=x[S],q=x[O];if(B&&j&&q)for(let X=s;X<Q;X++)this.zoomInPaintVertexArray.emplace(X,j.tl[0],j.tl[1],j.br[0],j.br[1],B.tl[0],B.tl[1],B.br[0],B.br[1],j.pixelRatio,B.pixelRatio),this.zoomOutPaintVertexArray.emplace(X,j.tl[0],j.tl[1],j.br[0],j.br[1],q.tl[0],q.tl[1],q.br[0],q.br[1],j.pixelRatio,q.pixelRatio)}upload(s){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=s.createVertexBuffer(this.zoomInPaintVertexArray,f4.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=s.createVertexBuffer(this.zoomOutPaintVertexArray,f4.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class b0{constructor(s,Q,y){this.binders={},this._buffers=[];const x=[];for(const C in s.paint._values){if(!y(C))continue;const S=s.paint.get(C);if(!(S instanceof J2&&In(S.property.specification)))continue;const O=sX(C,s.type),B=S.value,j=S.property.specification.type,q=S.property.useIntegerZoom,X=S.property.specification["property-type"],Y=X==="cross-faded"||X==="cross-faded-data-driven";if(B.kind==="constant")this.binders[C]=Y?new Xr(B.value,O):new p4(B.value,O,j),x.push(`/u_${C}`);else if(B.kind==="source"||Y){const re=Hx(C,j,"source");this.binders[C]=Y?new y4(B,j,q,Q,re,s.id):new m4(B,O,j,re),x.push(`/a_${C}`)}else{const re=Hx(C,j,"composite");this.binders[C]=new U3(B,O,j,q,Q,re),x.push(`/z_${C}`)}}this.cacheKey=x.sort().join("")}getMaxValue(s){const Q=this.binders[s];return Q instanceof m4||Q instanceof U3?Q.maxValue:0}populatePaintArrays(s,Q,y,x,C){for(const S in this.binders){const O=this.binders[S];(O instanceof m4||O instanceof U3||O instanceof y4)&&O.populatePaintArray(s,Q,y,x,C)}}setConstantPatternPositions(s,Q){for(const y in this.binders){const x=this.binders[y];x instanceof Xr&&x.setConstantPatternPositions(s,Q)}}updatePaintArrays(s,Q,y,x,C){let S=!1;for(const O in s){const B=Q.getPositions(O);for(const j of B){const q=y.feature(j.index);for(const X in this.binders){const Y=this.binders[X];if((Y instanceof m4||Y instanceof U3||Y instanceof y4)&&Y.expression.isStateDependent===!0){const re=x.paint.get(X);Y.expression=re.value,Y.updatePaintArray(j.start,j.end,q,s[O],C),S=!0}}}}return S}defines(){const s=[];for(const Q in this.binders){const y=this.binders[Q];(y instanceof p4||y instanceof Xr)&&s.push(...y.uniformNames.map(x=>`#define HAS_UNIFORM_${x}`))}return s}getBinderAttributes(){const s=[];for(const Q in this.binders){const y=this.binders[Q];if(y instanceof m4||y instanceof U3)for(let x=0;x<y.paintVertexAttributes.length;x++)s.push(y.paintVertexAttributes[x].name);else if(y instanceof y4)for(let x=0;x<f4.members.length;x++)s.push(f4.members[x].name)}return s}getBinderUniforms(){const s=[];for(const Q in this.binders){const y=this.binders[Q];if(y instanceof p4||y instanceof Xr||y instanceof U3)for(const x of y.uniformNames)s.push(x)}return s}getPaintVertexBuffers(){return this._buffers}getUniforms(s,Q){const y=[];for(const x in this.binders){const C=this.binders[x];if(C instanceof p4||C instanceof Xr||C instanceof U3){for(const S of C.uniformNames)if(Q[S]){const O=C.getBinding(s,Q[S],S);y.push({name:S,property:x,binding:O})}}}return y}setUniforms(s,Q,y,x){for(const{name:C,property:S,binding:O}of Q)this.binders[S].setUniform(O,x,y.get(S),C)}updatePaintBuffers(s){this._buffers=[];for(const Q in this.binders){const y=this.binders[Q];if(s&&y instanceof y4){const x=s.fromScale===2?y.zoomInPaintVertexBuffer:y.zoomOutPaintVertexBuffer;x&&this._buffers.push(x)}else(y instanceof m4||y instanceof U3)&&y.paintVertexBuffer&&this._buffers.push(y.paintVertexBuffer)}}upload(s){for(const Q in this.binders){const y=this.binders[Q];(y instanceof m4||y instanceof U3||y instanceof y4)&&y.upload(s)}this.updatePaintBuffers()}destroy(){for(const s in this.binders){const Q=this.binders[s];(Q instanceof m4||Q instanceof U3||Q instanceof y4)&&Q.destroy()}}}class N4{constructor(s,Q,y=()=>!0){this.programConfigurations={};for(const x of s)this.programConfigurations[x.id]=new b0(x,Q,y);this.needsUpload=!1,this._featureMap=new i2,this._bufferOffset=0}populatePaintArrays(s,Q,y,x,C,S){for(const O in this.programConfigurations)this.programConfigurations[O].populatePaintArrays(s,Q,x,C,S);Q.id!==void 0&&this._featureMap.add(Q.id,y,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,Q,y,x){for(const C of y)this.needsUpload=this.programConfigurations[C.id].updatePaintArrays(s,this._featureMap,Q,C,x)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const Q in this.programConfigurations)this.programConfigurations[Q].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function sX(c,s){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"]}[c]||[c.replace(`${s}-`,"").replace(/-/g,"_")]}function Hx(c,s,Q){const y={color:{source:zn,composite:ue},number:{source:F,composite:zn}},x=function(C){return{"line-pattern":{source:M1,composite:M1},"fill-pattern":{source:M1,composite:M1},"fill-extrusion-pattern":{source:M1,composite:M1}}[C]}(c);return x&&x[Q]||y[s][Q]}_t("ConstantBinder",p4),_t("CrossFadedConstantBinder",Xr),_t("SourceExpressionBinder",m4),_t("CrossFadedCompositeBinder",y4),_t("CompositeExpressionBinder",U3),_t("ProgramConfiguration",b0,{omit:["_buffers"]}),_t("ProgramConfigurationSet",N4);const h2=8192,mh=Math.pow(2,14)-1,Mx=-mh-1;function q6(c){const s=h2/c.extent,Q=c.loadGeometry();for(let y=0;y<Q.length;y++){const x=Q[y];for(let C=0;C<x.length;C++){const S=x[C],O=Math.round(S.x*s),B=Math.round(S.y*s);S.x=z(O,Mx,mh),S.y=z(B,Mx,mh),(O<S.x||O>S.x+1||B<S.y||B>S.y+1)&&Re("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return Q}function G6(c,s){return{type:c.type,id:c.id,properties:c.properties,geometry:s?q6(c):[]}}function E9(c,s,Q,y,x){c.emplaceBack(2*s+(y+1)/2,2*Q+(x+1)/2)}class yh{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new bt,this.indexArray=new O2,this.segments=new B1,this.programConfigurations=new N4(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(s,Q,y){const x=this.layers[0],C=[];let S=null,O=!1;x.type==="circle"&&(S=x.layout.get("circle-sort-key"),O=!S.isConstant());for(const{feature:B,id:j,index:q,sourceLayerIndex:X}of s){const Y=this.layers[0]._featureFilter.needGeometry,re=G6(B,Y);if(!this.layers[0]._featureFilter.filter(new I1(this.zoom),re,y))continue;const ae=O?S.evaluate(re,{},y):void 0,le={id:j,properties:B.properties,type:B.type,sourceLayerIndex:X,index:q,geometry:Y?re.geometry:q6(B),patterns:{},sortKey:ae};C.push(le)}O&&C.sort((B,j)=>B.sortKey-j.sortKey);for(const B of C){const{geometry:j,index:q,sourceLayerIndex:X}=B,Y=s[q].feature;this.addFeature(B,j,q,y),Q.featureIndex.insert(Y,j,q,X,this.index)}}update(s,Q,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,Q,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,S3),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,Q,y,x){for(const C of Q)for(const S of C){const O=S.x,B=S.y;if(O<0||O>=h2||B<0||B>=h2)continue;const j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),q=j.vertexLength;E9(this.layoutVertexArray,O,B,-1,-1),E9(this.layoutVertexArray,O,B,1,-1),E9(this.layoutVertexArray,O,B,1,1),E9(this.layoutVertexArray,O,B,-1,1),this.indexArray.emplaceBack(q,q+1,q+2),this.indexArray.emplaceBack(q,q+3,q+2),j.vertexLength+=4,j.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,y,{},x)}}function Cx(c,s){for(let Q=0;Q<c.length;Q++)if(C5(s,c[Q]))return!0;for(let Q=0;Q<s.length;Q++)if(C5(c,s[Q]))return!0;return!!gh(c,s)}function lX(c,s,Q){return!!C5(c,s)||!!_h(s,c,Q)}function Ax(c,s){if(c.length===1)return Ex(s,c[0]);for(let Q=0;Q<s.length;Q++){const y=s[Q];for(let x=0;x<y.length;x++)if(C5(c,y[x]))return!0}for(let Q=0;Q<c.length;Q++)if(Ex(s,c[Q]))return!0;for(let Q=0;Q<s.length;Q++)if(gh(c,s[Q]))return!0;return!1}function cX(c,s,Q){if(c.length>1){if(gh(c,s))return!0;for(let y=0;y<s.length;y++)if(_h(s[y],c,Q))return!0}for(let y=0;y<c.length;y++)if(_h(c[y],s,Q))return!0;return!1}function gh(c,s){if(c.length===0||s.length===0)return!1;for(let Q=0;Q<c.length-1;Q++){const y=c[Q],x=c[Q+1];for(let C=0;C<s.length-1;C++)if(uX(y,x,s[C],s[C+1]))return!0}return!1}function uX(c,s,Q,y){return Ze(c,Q,y)!==Ze(s,Q,y)&&Ze(c,s,Q)!==Ze(c,s,y)}function _h(c,s,Q){const y=Q*Q;if(s.length===1)return c.distSqr(s[0])<y;for(let x=1;x<s.length;x++)if(Sx(c,s[x-1],s[x])<y)return!0;return!1}function Sx(c,s,Q){const y=s.distSqr(Q);if(y===0)return c.distSqr(s);const x=((c.x-s.x)*(Q.x-s.x)+(c.y-s.y)*(Q.y-s.y))/y;return c.distSqr(x<0?s:x>1?Q:Q.sub(s)._mult(x)._add(s))}function Ex(c,s){let Q,y,x,C=!1;for(let S=0;S<c.length;S++){Q=c[S];for(let O=0,B=Q.length-1;O<Q.length;B=O++)y=Q[O],x=Q[B],y.y>s.y!=x.y>s.y&&s.x<(x.x-y.x)*(s.y-y.y)/(x.y-y.y)+y.x&&(C=!C)}return C}function C5(c,s){let Q=!1;for(let y=0,x=c.length-1;y<c.length;x=y++){const C=c[y],S=c[x];C.y>s.y!=S.y>s.y&&s.x<(S.x-C.x)*(s.y-C.y)/(S.y-C.y)+C.x&&(Q=!Q)}return Q}function QX(c,s,Q){const y=Q[0],x=Q[2];if(c.x<y.x&&s.x<y.x||c.x>x.x&&s.x>x.x||c.y<y.y&&s.y<y.y||c.y>x.y&&s.y>x.y)return!1;const C=Ze(c,s,Q[0]);return C!==Ze(c,s,Q[1])||C!==Ze(c,s,Q[2])||C!==Ze(c,s,Q[3])}function w0(c,s,Q){const y=s.paint.get(c).value;return y.kind==="constant"?y.value:Q.programConfigurations.get(s.id).getMaxValue(c)}function V9(c){return Math.sqrt(c[0]*c[0]+c[1]*c[1])}function D9(c,s,Q,y,x){if(!s[0]&&!s[1])return c;const C=g.convert(s)._mult(x);Q==="viewport"&&C._rotate(-y);const S=[];for(let O=0;O<c.length;O++)S.push(c[O].sub(C));return S}let Vx,Dx;_t("CircleBucket",yh,{omit:["layers"]});var TX={get paint(){return Dx=Dx||new l2({"circle-radius":new It(Pe.paint_circle["circle-radius"]),"circle-color":new It(Pe.paint_circle["circle-color"]),"circle-blur":new It(Pe.paint_circle["circle-blur"]),"circle-opacity":new It(Pe.paint_circle["circle-opacity"]),"circle-translate":new St(Pe.paint_circle["circle-translate"]),"circle-translate-anchor":new St(Pe.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new St(Pe.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new St(Pe.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new It(Pe.paint_circle["circle-stroke-width"]),"circle-stroke-color":new It(Pe.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new It(Pe.paint_circle["circle-stroke-opacity"])})},get layout(){return Vx=Vx||new l2({"circle-sort-key":new It(Pe.layout_circle["circle-sort-key"])})}},d3=1e-6,A5=typeof Float32Array<"u"?Float32Array:Array;function vh(c){return c[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=1,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=1,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c}function Ox(c,s,Q){var y=s[0],x=s[1],C=s[2],S=s[3],O=s[4],B=s[5],j=s[6],q=s[7],X=s[8],Y=s[9],re=s[10],ae=s[11],le=s[12],fe=s[13],ye=s[14],He=s[15],ve=Q[0],Me=Q[1],De=Q[2],$e=Q[3];return c[0]=ve*y+Me*O+De*X+$e*le,c[1]=ve*x+Me*B+De*Y+$e*fe,c[2]=ve*C+Me*j+De*re+$e*ye,c[3]=ve*S+Me*q+De*ae+$e*He,c[4]=(ve=Q[4])*y+(Me=Q[5])*O+(De=Q[6])*X+($e=Q[7])*le,c[5]=ve*x+Me*B+De*Y+$e*fe,c[6]=ve*C+Me*j+De*re+$e*ye,c[7]=ve*S+Me*q+De*ae+$e*He,c[8]=(ve=Q[8])*y+(Me=Q[9])*O+(De=Q[10])*X+($e=Q[11])*le,c[9]=ve*x+Me*B+De*Y+$e*fe,c[10]=ve*C+Me*j+De*re+$e*ye,c[11]=ve*S+Me*q+De*ae+$e*He,c[12]=(ve=Q[12])*y+(Me=Q[13])*O+(De=Q[14])*X+($e=Q[15])*le,c[13]=ve*x+Me*B+De*Y+$e*fe,c[14]=ve*C+Me*j+De*re+$e*ye,c[15]=ve*S+Me*q+De*ae+$e*He,c}Math.hypot||(Math.hypot=function(){for(var c=0,s=arguments.length;s--;)c+=arguments[s]*arguments[s];return Math.sqrt(c)});var H0,hX=Ox;function O9(c,s,Q){var y=s[0],x=s[1],C=s[2],S=s[3];return c[0]=Q[0]*y+Q[4]*x+Q[8]*C+Q[12]*S,c[1]=Q[1]*y+Q[5]*x+Q[9]*C+Q[13]*S,c[2]=Q[2]*y+Q[6]*x+Q[10]*C+Q[14]*S,c[3]=Q[3]*y+Q[7]*x+Q[11]*C+Q[15]*S,c}H0=new A5(4),A5!=Float32Array&&(H0[0]=0,H0[1]=0,H0[2]=0,H0[3]=0);class dX extends G3{constructor(s){super(s,TX)}createBucket(s){return new yh(s)}queryRadius(s){const Q=s;return w0("circle-radius",this,Q)+w0("circle-stroke-width",this,Q)+V9(this.paint.get("circle-translate"))}queryIntersectsFeature(s,Q,y,x,C,S,O,B){const j=D9(s,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),S.angle,O),q=this.paint.get("circle-radius").evaluate(Q,y)+this.paint.get("circle-stroke-width").evaluate(Q,y),X=this.paint.get("circle-pitch-alignment")==="map",Y=X?j:function(ae,le){return ae.map(fe=>kx(fe,le))}(j,B),re=X?q*O:q;for(const ae of x)for(const le of ae){const fe=X?le:kx(le,B);let ye=re;const He=O9([],[le.x,le.y,0,1],B);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ye*=He[3]/S.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ye*=S.cameraToCenterDistance/He[3]),lX(Y,fe,ye))return!0}return!1}}function kx(c,s){const Q=O9([],[c.x,c.y,0,1],s);return new g(Q[0]/Q[3],Q[1]/Q[3])}class Px extends yh{}let Ix;_t("HeatmapBucket",Px,{omit:["layers"]});var fX={get paint(){return Ix=Ix||new l2({"heatmap-radius":new It(Pe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new It(Pe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new St(Pe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new m0(Pe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new St(Pe.paint_heatmap["heatmap-opacity"])})}};function xh(c,{width:s,height:Q},y,x){if(x){if(x instanceof Uint8ClampedArray)x=new Uint8Array(x.buffer);else if(x.length!==s*Q*y)throw new RangeError(`mismatched image size. expected: ${x.length} but got: ${s*Q*y}`)}else x=new Uint8Array(s*Q*y);return c.width=s,c.height=Q,c.data=x,c}function Bx(c,{width:s,height:Q},y){if(s===c.width&&Q===c.height)return;const x=xh({},{width:s,height:Q},y);Lh(c,x,{x:0,y:0},{x:0,y:0},{width:Math.min(c.width,s),height:Math.min(c.height,Q)},y),c.width=s,c.height=Q,c.data=x.data}function Lh(c,s,Q,y,x,C){if(x.width===0||x.height===0)return s;if(x.width>c.width||x.height>c.height||Q.x>c.width-x.width||Q.y>c.height-x.height)throw new RangeError("out of range source coordinates for image copy");if(x.width>s.width||x.height>s.height||y.x>s.width-x.width||y.y>s.height-x.height)throw new RangeError("out of range destination coordinates for image copy");const S=c.data,O=s.data;if(S===O)throw new Error("srcData equals dstData, so image is already copied");for(let B=0;B<x.height;B++){const j=((Q.y+B)*c.width+Q.x)*C,q=((y.y+B)*s.width+y.x)*C;for(let X=0;X<x.width*C;X++)O[q+X]=S[j+X]}return s}class M0{constructor(s,Q){xh(this,s,1,Q)}resize(s){Bx(this,s,1)}clone(){return new M0({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,Q,y,x,C){Lh(s,Q,y,x,C,1)}}class r4{constructor(s,Q){xh(this,s,4,Q)}resize(s){Bx(this,s,4)}replace(s,Q){Q?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new r4({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,Q,y,x,C){Lh(s,Q,y,x,C,4)}}function Nx(c){const s={},Q=c.resolution||256,y=c.clips?c.clips.length:1,x=c.image||new r4({width:Q,height:y});if(Math.log(Q)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${Q}`);const C=(S,O,B)=>{s[c.evaluationKey]=B;const j=c.expression.evaluate(s);x.data[S+O+0]=Math.floor(255*j.r/j.a),x.data[S+O+1]=Math.floor(255*j.g/j.a),x.data[S+O+2]=Math.floor(255*j.b/j.a),x.data[S+O+3]=Math.floor(255*j.a)};if(c.clips)for(let S=0,O=0;S<y;++S,O+=4*Q)for(let B=0,j=0;B<Q;B++,j+=4){const q=B/(Q-1),{start:X,end:Y}=c.clips[S];C(O,j,X*(1-q)+Y*q)}else for(let S=0,O=0;S<Q;S++,O+=4)C(0,O,S/(Q-1));return x}_t("AlphaImage",M0),_t("RGBAImage",r4);class pX extends G3{createBucket(s){return new Px(s)}constructor(s){super(s,fX),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(s){s==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Nx({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Fx;var mX={get paint(){return Fx=Fx||new l2({"hillshade-illumination-direction":new St(Pe.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new St(Pe.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new St(Pe.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new St(Pe.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new St(Pe.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new St(Pe.paint_hillshade["hillshade-accent-color"])})}};class yX extends G3{constructor(s){super(s,mX)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const gX=U1([{name:"a_pos",components:2,type:"Int16"}],4),{members:_X}=gX;var bh={exports:{}};function k9(c,s,Q){Q=Q||2;var y,x,C,S,O,B,j,q=s&&s.length,X=q?s[0]*Q:c.length,Y=Rx(c,0,X,Q,!0),re=[];if(!Y||Y.next===Y.prev)return re;if(q&&(Y=function(le,fe,ye,He){var ve,Me,De,$e=[];for(ve=0,Me=fe.length;ve<Me;ve++)(De=Rx(le,fe[ve]*He,ve<Me-1?fe[ve+1]*He:le.length,He,!1))===De.next&&(De.steiner=!0),$e.push(CX(De));for($e.sort(wX),ve=0;ve<$e.length;ve++)ye=HX($e[ve],ye);return ye}(c,s,Y,Q)),c.length>80*Q){y=C=c[0],x=S=c[1];for(var ae=Q;ae<X;ae+=Q)(O=c[ae])<y&&(y=O),(B=c[ae+1])<x&&(x=B),O>C&&(C=O),B>S&&(S=B);j=(j=Math.max(C-y,S-x))!==0?32767/j:0}return C0(Y,re,Q,y,x,j,0),re}function Rx(c,s,Q,y,x){var C,S;if(x===Mh(c,s,Q,y)>0)for(C=s;C<Q;C+=y)S=$x(C,c[C],c[C+1],S);else for(C=Q-y;C>=s;C-=y)S=$x(C,c[C],c[C+1],S);return S&&P9(S,S.next)&&(S0(S),S=S.next),S}function U6(c,s){if(!c)return c;s||(s=c);var Q,y=c;do if(Q=!1,y.steiner||!P9(y,y.next)&&u2(y.prev,y,y.next)!==0)y=y.next;else{if(S0(y),(y=s=y.prev)===y.next)break;Q=!0}while(Q||y!==s);return s}function C0(c,s,Q,y,x,C,S){if(c){!S&&C&&function(q,X,Y,re){var ae=q;do ae.z===0&&(ae.z=wh(ae.x,ae.y,X,Y,re)),ae.prevZ=ae.prev,ae.nextZ=ae.next,ae=ae.next;while(ae!==q);ae.prevZ.nextZ=null,ae.prevZ=null,function(le){var fe,ye,He,ve,Me,De,$e,dt,wt=1;do{for(ye=le,le=null,Me=null,De=0;ye;){for(De++,He=ye,$e=0,fe=0;fe<wt&&($e++,He=He.nextZ);fe++);for(dt=wt;$e>0||dt>0&&He;)$e!==0&&(dt===0||!He||ye.z<=He.z)?(ve=ye,ye=ye.nextZ,$e--):(ve=He,He=He.nextZ,dt--),Me?Me.nextZ=ve:le=ve,ve.prevZ=Me,Me=ve;ye=He}Me.nextZ=null,wt*=2}while(De>1)}(ae)}(c,y,x,C);for(var O,B,j=c;c.prev!==c.next;)if(O=c.prev,B=c.next,C?xX(c,y,x,C):vX(c))s.push(O.i/Q|0),s.push(c.i/Q|0),s.push(B.i/Q|0),S0(c),c=B.next,j=B.next;else if((c=B)===j){S?S===1?C0(c=LX(U6(c),s,Q),s,Q,y,x,C,2):S===2&&bX(c,s,Q,y,x,C):C0(U6(c),s,Q,y,x,C,1);break}}}function vX(c){var s=c.prev,Q=c,y=c.next;if(u2(s,Q,y)>=0)return!1;for(var x=s.x,C=Q.x,S=y.x,O=s.y,B=Q.y,j=y.y,q=x<C?x<S?x:S:C<S?C:S,X=O<B?O<j?O:j:B<j?B:j,Y=x>C?x>S?x:S:C>S?C:S,re=O>B?O>j?O:j:B>j?B:j,ae=y.next;ae!==s;){if(ae.x>=q&&ae.x<=Y&&ae.y>=X&&ae.y<=re&&S5(x,O,C,B,S,j,ae.x,ae.y)&&u2(ae.prev,ae,ae.next)>=0)return!1;ae=ae.next}return!0}function xX(c,s,Q,y){var x=c.prev,C=c,S=c.next;if(u2(x,C,S)>=0)return!1;for(var O=x.x,B=C.x,j=S.x,q=x.y,X=C.y,Y=S.y,re=O<B?O<j?O:j:B<j?B:j,ae=q<X?q<Y?q:Y:X<Y?X:Y,le=O>B?O>j?O:j:B>j?B:j,fe=q>X?q>Y?q:Y:X>Y?X:Y,ye=wh(re,ae,s,Q,y),He=wh(le,fe,s,Q,y),ve=c.prevZ,Me=c.nextZ;ve&&ve.z>=ye&&Me&&Me.z<=He;){if(ve.x>=re&&ve.x<=le&&ve.y>=ae&&ve.y<=fe&&ve!==x&&ve!==S&&S5(O,q,B,X,j,Y,ve.x,ve.y)&&u2(ve.prev,ve,ve.next)>=0||(ve=ve.prevZ,Me.x>=re&&Me.x<=le&&Me.y>=ae&&Me.y<=fe&&Me!==x&&Me!==S&&S5(O,q,B,X,j,Y,Me.x,Me.y)&&u2(Me.prev,Me,Me.next)>=0))return!1;Me=Me.nextZ}for(;ve&&ve.z>=ye;){if(ve.x>=re&&ve.x<=le&&ve.y>=ae&&ve.y<=fe&&ve!==x&&ve!==S&&S5(O,q,B,X,j,Y,ve.x,ve.y)&&u2(ve.prev,ve,ve.next)>=0)return!1;ve=ve.prevZ}for(;Me&&Me.z<=He;){if(Me.x>=re&&Me.x<=le&&Me.y>=ae&&Me.y<=fe&&Me!==x&&Me!==S&&S5(O,q,B,X,j,Y,Me.x,Me.y)&&u2(Me.prev,Me,Me.next)>=0)return!1;Me=Me.nextZ}return!0}function LX(c,s,Q){var y=c;do{var x=y.prev,C=y.next.next;!P9(x,C)&&jx(x,y,y.next,C)&&A0(x,C)&&A0(C,x)&&(s.push(x.i/Q|0),s.push(y.i/Q|0),s.push(C.i/Q|0),S0(y),S0(y.next),y=c=C),y=y.next}while(y!==c);return U6(y)}function bX(c,s,Q,y,x,C){var S=c;do{for(var O=S.next.next;O!==S.prev;){if(S.i!==O.i&&AX(S,O)){var B=zx(S,O);return S=U6(S,S.next),B=U6(B,B.next),C0(S,s,Q,y,x,C,0),void C0(B,s,Q,y,x,C,0)}O=O.next}S=S.next}while(S!==c)}function wX(c,s){return c.x-s.x}function HX(c,s){var Q=function(x,C){var S,O=C,B=x.x,j=x.y,q=-1/0;do{if(j<=O.y&&j>=O.next.y&&O.next.y!==O.y){var X=O.x+(j-O.y)*(O.next.x-O.x)/(O.next.y-O.y);if(X<=B&&X>q&&(q=X,S=O.x<O.next.x?O:O.next,X===B))return S}O=O.next}while(O!==C);if(!S)return null;var Y,re=S,ae=S.x,le=S.y,fe=1/0;O=S;do B>=O.x&&O.x>=ae&&B!==O.x&&S5(j<le?B:q,j,ae,le,j<le?q:B,j,O.x,O.y)&&(Y=Math.abs(j-O.y)/(B-O.x),A0(O,x)&&(Y<fe||Y===fe&&(O.x>S.x||O.x===S.x&&MX(S,O)))&&(S=O,fe=Y)),O=O.next;while(O!==re);return S}(c,s);if(!Q)return s;var y=zx(Q,c);return U6(y,y.next),U6(Q,Q.next)}function MX(c,s){return u2(c.prev,c,s.prev)<0&&u2(s.next,c,c.next)<0}function wh(c,s,Q,y,x){return(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-Q)*x|0)|c<<8))|c<<4))|c<<2))|c<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-y)*x|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function CX(c){var s=c,Q=c;do(s.x<Q.x||s.x===Q.x&&s.y<Q.y)&&(Q=s),s=s.next;while(s!==c);return Q}function S5(c,s,Q,y,x,C,S,O){return(x-S)*(s-O)>=(c-S)*(C-O)&&(c-S)*(y-O)>=(Q-S)*(s-O)&&(Q-S)*(C-O)>=(x-S)*(y-O)}function AX(c,s){return c.next.i!==s.i&&c.prev.i!==s.i&&!function(Q,y){var x=Q;do{if(x.i!==Q.i&&x.next.i!==Q.i&&x.i!==y.i&&x.next.i!==y.i&&jx(x,x.next,Q,y))return!0;x=x.next}while(x!==Q);return!1}(c,s)&&(A0(c,s)&&A0(s,c)&&function(Q,y){var x=Q,C=!1,S=(Q.x+y.x)/2,O=(Q.y+y.y)/2;do x.y>O!=x.next.y>O&&x.next.y!==x.y&&S<(x.next.x-x.x)*(O-x.y)/(x.next.y-x.y)+x.x&&(C=!C),x=x.next;while(x!==Q);return C}(c,s)&&(u2(c.prev,c,s.prev)||u2(c,s.prev,s))||P9(c,s)&&u2(c.prev,c,c.next)>0&&u2(s.prev,s,s.next)>0)}function u2(c,s,Q){return(s.y-c.y)*(Q.x-s.x)-(s.x-c.x)*(Q.y-s.y)}function P9(c,s){return c.x===s.x&&c.y===s.y}function jx(c,s,Q,y){var x=B9(u2(c,s,Q)),C=B9(u2(c,s,y)),S=B9(u2(Q,y,c)),O=B9(u2(Q,y,s));return x!==C&&S!==O||!(x!==0||!I9(c,Q,s))||!(C!==0||!I9(c,y,s))||!(S!==0||!I9(Q,c,y))||!(O!==0||!I9(Q,s,y))}function I9(c,s,Q){return s.x<=Math.max(c.x,Q.x)&&s.x>=Math.min(c.x,Q.x)&&s.y<=Math.max(c.y,Q.y)&&s.y>=Math.min(c.y,Q.y)}function B9(c){return c>0?1:c<0?-1:0}function A0(c,s){return u2(c.prev,c,c.next)<0?u2(c,s,c.next)>=0&&u2(c,c.prev,s)>=0:u2(c,s,c.prev)<0||u2(c,c.next,s)<0}function zx(c,s){var Q=new Hh(c.i,c.x,c.y),y=new Hh(s.i,s.x,s.y),x=c.next,C=s.prev;return c.next=s,s.prev=c,Q.next=x,x.prev=Q,y.next=Q,Q.prev=y,C.next=y,y.prev=C,y}function $x(c,s,Q,y){var x=new Hh(c,s,Q);return y?(x.next=y.next,x.prev=y,y.next.prev=x,y.next=x):(x.prev=x,x.next=x),x}function S0(c){c.next.prev=c.prev,c.prev.next=c.next,c.prevZ&&(c.prevZ.nextZ=c.nextZ),c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function Hh(c,s,Q){this.i=c,this.x=s,this.y=Q,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Mh(c,s,Q,y){for(var x=0,C=s,S=Q-y;C<Q;C+=y)x+=(c[S]-c[C])*(c[C+1]+c[S+1]),S=C;return x}bh.exports=k9,bh.exports.default=k9,k9.deviation=function(c,s,Q,y){var x=s&&s.length,C=Math.abs(Mh(c,0,x?s[0]*Q:c.length,Q));if(x)for(var S=0,O=s.length;S<O;S++)C-=Math.abs(Mh(c,s[S]*Q,S<O-1?s[S+1]*Q:c.length,Q));var B=0;for(S=0;S<y.length;S+=3){var j=y[S]*Q,q=y[S+1]*Q,X=y[S+2]*Q;B+=Math.abs((c[j]-c[X])*(c[q+1]-c[j+1])-(c[j]-c[q])*(c[X+1]-c[j+1]))}return C===0&&B===0?0:Math.abs((B-C)/C)},k9.flatten=function(c){for(var s=c[0][0].length,Q={vertices:[],holes:[],dimensions:s},y=0,x=0;x<c.length;x++){for(var C=0;C<c[x].length;C++)for(var S=0;S<s;S++)Q.vertices.push(c[x][C][S]);x>0&&Q.holes.push(y+=c[x-1].length)}return Q};var Zx=h(bh.exports);function SX(c,s,Q,y,x){qx(c,s,Q||0,y||c.length-1,x||EX)}function qx(c,s,Q,y,x){for(;y>Q;){if(y-Q>600){var C=y-Q+1,S=s-Q+1,O=Math.log(C),B=.5*Math.exp(2*O/3),j=.5*Math.sqrt(O*B*(C-B)/C)*(S-C/2<0?-1:1);qx(c,s,Math.max(Q,Math.floor(s-S*B/C+j)),Math.min(y,Math.floor(s+(C-S)*B/C+j)),x)}var q=c[s],X=Q,Y=y;for(E0(c,Q,s),x(c[y],q)>0&&E0(c,Q,y);X<Y;){for(E0(c,X,Y),X++,Y--;x(c[X],q)<0;)X++;for(;x(c[Y],q)>0;)Y--}x(c[Q],q)===0?E0(c,Q,Y):E0(c,++Y,y),Y<=s&&(Q=Y+1),s<=Y&&(y=Y-1)}}function E0(c,s,Q){var y=c[s];c[s]=c[Q],c[Q]=y}function EX(c,s){return c<s?-1:c>s?1:0}function Ch(c,s){const Q=c.length;if(Q<=1)return[c];const y=[];let x,C;for(let S=0;S<Q;S++){const O=tt(c[S]);O!==0&&(c[S].area=Math.abs(O),C===void 0&&(C=O<0),C===O<0?(x&&y.push(x),x=[c[S]]):x.push(c[S]))}if(x&&y.push(x),s>1)for(let S=0;S<y.length;S++)y[S].length<=s||(SX(y[S],s,1,y[S].length-1,VX),y[S]=y[S].slice(0,s));return y}function VX(c,s){return s.area-c.area}function Ah(c,s,Q){const y=Q.patternDependencies;let x=!1;for(const C of s){const S=C.paint.get(`${c}-pattern`);S.isConstant()||(x=!0);const O=S.constantOr(null);O&&(x=!0,y[O.to]=!0,y[O.from]=!0)}return x}function Sh(c,s,Q,y,x){const C=x.patternDependencies;for(const S of s){const O=S.paint.get(`${c}-pattern`).value;if(O.kind!=="constant"){let B=O.evaluate({zoom:y-1},Q,{},x.availableImages),j=O.evaluate({zoom:y},Q,{},x.availableImages),q=O.evaluate({zoom:y+1},Q,{},x.availableImages);B=B&&B.name?B.name:B,j=j&&j.name?j.name:j,q=q&&q.name?q.name:q,C[B]=!0,C[j]=!0,C[q]=!0,Q.patterns[S.id]={min:B,mid:j,max:q}}}return Q}class Eh{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new o1,this.indexArray=new O2,this.indexArray2=new m2,this.programConfigurations=new N4(s.layers,s.zoom),this.segments=new B1,this.segments2=new B1,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(s,Q,y){this.hasPattern=Ah("fill",this.layers,Q);const x=this.layers[0].layout.get("fill-sort-key"),C=!x.isConstant(),S=[];for(const{feature:O,id:B,index:j,sourceLayerIndex:q}of s){const X=this.layers[0]._featureFilter.needGeometry,Y=G6(O,X);if(!this.layers[0]._featureFilter.filter(new I1(this.zoom),Y,y))continue;const re=C?x.evaluate(Y,{},y,Q.availableImages):void 0,ae={id:B,properties:O.properties,type:O.type,sourceLayerIndex:q,index:j,geometry:X?Y.geometry:q6(O),patterns:{},sortKey:re};S.push(ae)}C&&S.sort((O,B)=>O.sortKey-B.sortKey);for(const O of S){const{geometry:B,index:j,sourceLayerIndex:q}=O;if(this.hasPattern){const X=Sh("fill",this.layers,O,this.zoom,Q);this.patternFeatures.push(X)}else this.addFeature(O,B,j,y,{});Q.featureIndex.insert(s[j].feature,B,j,q,this.index)}}update(s,Q,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,Q,this.stateDependentLayers,y)}addFeatures(s,Q,y){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,Q,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,_X),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),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(s,Q,y,x,C){for(const S of Ch(Q,500)){let O=0;for(const re of S)O+=re.length;const B=this.segments.prepareSegment(O,this.layoutVertexArray,this.indexArray),j=B.vertexLength,q=[],X=[];for(const re of S){if(re.length===0)continue;re!==S[0]&&X.push(q.length/2);const ae=this.segments2.prepareSegment(re.length,this.layoutVertexArray,this.indexArray2),le=ae.vertexLength;this.layoutVertexArray.emplaceBack(re[0].x,re[0].y),this.indexArray2.emplaceBack(le+re.length-1,le),q.push(re[0].x),q.push(re[0].y);for(let fe=1;fe<re.length;fe++)this.layoutVertexArray.emplaceBack(re[fe].x,re[fe].y),this.indexArray2.emplaceBack(le+fe-1,le+fe),q.push(re[fe].x),q.push(re[fe].y);ae.vertexLength+=re.length,ae.primitiveLength+=re.length}const Y=Zx(q,X);for(let re=0;re<Y.length;re+=3)this.indexArray.emplaceBack(j+Y[re],j+Y[re+1],j+Y[re+2]);B.vertexLength+=O,B.primitiveLength+=Y.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,y,C,x)}}let Gx,Ux;_t("FillBucket",Eh,{omit:["layers","patternFeatures"]});var DX={get paint(){return Ux=Ux||new l2({"fill-antialias":new St(Pe.paint_fill["fill-antialias"]),"fill-opacity":new It(Pe.paint_fill["fill-opacity"]),"fill-color":new It(Pe.paint_fill["fill-color"]),"fill-outline-color":new It(Pe.paint_fill["fill-outline-color"]),"fill-translate":new St(Pe.paint_fill["fill-translate"]),"fill-translate-anchor":new St(Pe.paint_fill["fill-translate-anchor"]),"fill-pattern":new z6(Pe.paint_fill["fill-pattern"])})},get layout(){return Gx=Gx||new l2({"fill-sort-key":new It(Pe.layout_fill["fill-sort-key"])})}};class OX extends G3{constructor(s){super(s,DX)}recalculate(s,Q){super.recalculate(s,Q);const y=this.paint._values["fill-outline-color"];y.value.kind==="constant"&&y.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(s){return new Eh(s)}queryRadius(){return V9(this.paint.get("fill-translate"))}queryIntersectsFeature(s,Q,y,x,C,S,O){return Ax(D9(s,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),S.angle,O),x)}isTileClipped(){return!0}}const kX=U1([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),PX=U1([{name:"a_centroid",components:2,type:"Int16"}],4),{members:IX}=kX;var Zn={},BX=p,Wx=E5;function E5(c,s,Q,y,x){this.properties={},this.extent=Q,this.type=0,this._pbf=c,this._geometry=-1,this._keys=y,this._values=x,c.readFields(NX,this,s)}function NX(c,s,Q){c==1?s.id=Q.readVarint():c==2?function(y,x){for(var C=y.readVarint()+y.pos;y.pos<C;){var S=x._keys[y.readVarint()],O=x._values[y.readVarint()];x.properties[S]=O}}(Q,s):c==3?s.type=Q.readVarint():c==4&&(s._geometry=Q.pos)}function FX(c){for(var s,Q,y=0,x=0,C=c.length,S=C-1;x<C;S=x++)y+=((Q=c[S]).x-(s=c[x]).x)*(s.y+Q.y);return y}E5.types=["Unknown","Point","LineString","Polygon"],E5.prototype.loadGeometry=function(){var c=this._pbf;c.pos=this._geometry;for(var s,Q=c.readVarint()+c.pos,y=1,x=0,C=0,S=0,O=[];c.pos<Q;){if(x<=0){var B=c.readVarint();y=7&B,x=B>>3}if(x--,y===1||y===2)C+=c.readSVarint(),S+=c.readSVarint(),y===1&&(s&&O.push(s),s=[]),s.push(new BX(C,S));else{if(y!==7)throw new Error("unknown command "+y);s&&s.push(s[0].clone())}}return s&&O.push(s),O},E5.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var s=c.readVarint()+c.pos,Q=1,y=0,x=0,C=0,S=1/0,O=-1/0,B=1/0,j=-1/0;c.pos<s;){if(y<=0){var q=c.readVarint();Q=7&q,y=q>>3}if(y--,Q===1||Q===2)(x+=c.readSVarint())<S&&(S=x),x>O&&(O=x),(C+=c.readSVarint())<B&&(B=C),C>j&&(j=C);else if(Q!==7)throw new Error("unknown command "+Q)}return[S,B,O,j]},E5.prototype.toGeoJSON=function(c,s,Q){var y,x,C=this.extent*Math.pow(2,Q),S=this.extent*c,O=this.extent*s,B=this.loadGeometry(),j=E5.types[this.type];function q(re){for(var ae=0;ae<re.length;ae++){var le=re[ae];re[ae]=[360*(le.x+S)/C-180,360/Math.PI*Math.atan(Math.exp((180-360*(le.y+O)/C)*Math.PI/180))-90]}}switch(this.type){case 1:var X=[];for(y=0;y<B.length;y++)X[y]=B[y][0];q(B=X);break;case 2:for(y=0;y<B.length;y++)q(B[y]);break;case 3:for(B=function(re){var ae=re.length;if(ae<=1)return[re];for(var le,fe,ye=[],He=0;He<ae;He++){var ve=FX(re[He]);ve!==0&&(fe===void 0&&(fe=ve<0),fe===ve<0?(le&&ye.push(le),le=[re[He]]):le.push(re[He]))}return le&&ye.push(le),ye}(B),y=0;y<B.length;y++)for(x=0;x<B[y].length;x++)q(B[y][x])}B.length===1?B=B[0]:j="Multi"+j;var Y={type:"Feature",geometry:{type:j,coordinates:B},properties:this.properties};return"id"in this&&(Y.id=this.id),Y};var RX=Wx,Xx=Kx;function Kx(c,s){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=c,this._keys=[],this._values=[],this._features=[],c.readFields(jX,this,s),this.length=this._features.length}function jX(c,s,Q){c===15?s.version=Q.readVarint():c===1?s.name=Q.readString():c===5?s.extent=Q.readVarint():c===2?s._features.push(Q.pos):c===3?s._keys.push(Q.readString()):c===4&&s._values.push(function(y){for(var x=null,C=y.readVarint()+y.pos;y.pos<C;){var S=y.readVarint()>>3;x=S===1?y.readString():S===2?y.readFloat():S===3?y.readDouble():S===4?y.readVarint64():S===5?y.readVarint():S===6?y.readSVarint():S===7?y.readBoolean():null}return x}(Q))}Kx.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var s=this._pbf.readVarint()+this._pbf.pos;return new RX(this._pbf,s,this.extent,this._keys,this._values)};var zX=Xx;function $X(c,s,Q){if(c===3){var y=new zX(Q,Q.readVarint()+Q.pos);y.length&&(s[y.name]=y)}}Zn.VectorTile=function(c,s){this.layers=c.readFields($X,{},s)},Zn.VectorTileFeature=Wx,Zn.VectorTileLayer=Xx;const ZX=Zn.VectorTileFeature.types,Vh=Math.pow(2,13);function V0(c,s,Q,y,x,C,S,O){c.emplaceBack(s,Q,2*Math.floor(y*Vh)+S,x*Vh*2,C*Vh*2,Math.round(O))}class Dh{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new lt,this.centroidVertexArray=new rt,this.indexArray=new O2,this.programConfigurations=new N4(s.layers,s.zoom),this.segments=new B1,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(s,Q,y){this.features=[],this.hasPattern=Ah("fill-extrusion",this.layers,Q);for(const{feature:x,id:C,index:S,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,j=G6(x,B);if(!this.layers[0]._featureFilter.filter(new I1(this.zoom),j,y))continue;const q={id:C,sourceLayerIndex:O,index:S,geometry:B?j.geometry:q6(x),properties:x.properties,type:x.type,patterns:{}};this.hasPattern?this.features.push(Sh("fill-extrusion",this.layers,q,this.zoom,Q)):this.addFeature(q,q.geometry,S,y,{}),Q.featureIndex.insert(x,q.geometry,S,O,this.index,!0)}}addFeatures(s,Q,y){for(const x of this.features){const{geometry:C}=x;this.addFeature(x,C,x.index,Q,y)}}update(s,Q,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,Q,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,IX),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,PX.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,Q,y,x,C){const S={x:0,y:0,vertexCount:0};for(const O of Ch(Q,500)){let B=0;for(const ae of O)B+=ae.length;let j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const ae of O){if(ae.length===0||GX(ae))continue;let le=0;for(let fe=0;fe<ae.length;fe++){const ye=ae[fe];if(fe>=1){const He=ae[fe-1];if(!qX(ye,He)){j.vertexLength+4>B1.MAX_VERTEX_ARRAY_LENGTH&&(j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ve=ye.sub(He)._perp()._unit(),Me=He.dist(ye);le+Me>32768&&(le=0),V0(this.layoutVertexArray,ye.x,ye.y,ve.x,ve.y,0,0,le),V0(this.layoutVertexArray,ye.x,ye.y,ve.x,ve.y,0,1,le),S.x+=2*ye.x,S.y+=2*ye.y,S.vertexCount+=2,le+=Me,V0(this.layoutVertexArray,He.x,He.y,ve.x,ve.y,0,0,le),V0(this.layoutVertexArray,He.x,He.y,ve.x,ve.y,0,1,le),S.x+=2*He.x,S.y+=2*He.y,S.vertexCount+=2;const De=j.vertexLength;this.indexArray.emplaceBack(De,De+2,De+1),this.indexArray.emplaceBack(De+1,De+2,De+3),j.vertexLength+=4,j.primitiveLength+=2}}}}if(j.vertexLength+B>B1.MAX_VERTEX_ARRAY_LENGTH&&(j=this.segments.prepareSegment(B,this.layoutVertexArray,this.indexArray)),ZX[s.type]!=="Polygon")continue;const q=[],X=[],Y=j.vertexLength;for(const ae of O)if(ae.length!==0){ae!==O[0]&&X.push(q.length/2);for(let le=0;le<ae.length;le++){const fe=ae[le];V0(this.layoutVertexArray,fe.x,fe.y,0,0,1,1,0),S.x+=fe.x,S.y+=fe.y,S.vertexCount+=1,q.push(fe.x),q.push(fe.y)}}const re=Zx(q,X);for(let ae=0;ae<re.length;ae+=3)this.indexArray.emplaceBack(Y+re[ae],Y+re[ae+2],Y+re[ae+1]);j.primitiveLength+=re.length/3,j.vertexLength+=B}for(let O=0;O<S.vertexCount;O++)this.centroidVertexArray.emplaceBack(Math.floor(S.x/S.vertexCount),Math.floor(S.y/S.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,y,C,x)}}function qX(c,s){return c.x===s.x&&(c.x<0||c.x>h2)||c.y===s.y&&(c.y<0||c.y>h2)}function GX(c){return c.every(s=>s.x<0)||c.every(s=>s.x>h2)||c.every(s=>s.y<0)||c.every(s=>s.y>h2)}let Jx;_t("FillExtrusionBucket",Dh,{omit:["layers","features"]});var UX={get paint(){return Jx=Jx||new l2({"fill-extrusion-opacity":new St(Pe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new It(Pe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new St(Pe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new St(Pe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new z6(Pe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new It(Pe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new It(Pe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new St(Pe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class WX extends G3{constructor(s){super(s,UX)}createBucket(s){return new Dh(s)}queryRadius(){return V9(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(s,Q,y,x,C,S,O,B){const j=D9(s,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),S.angle,O),q=this.paint.get("fill-extrusion-height").evaluate(Q,y),X=this.paint.get("fill-extrusion-base").evaluate(Q,y),Y=function(ae,le,fe,ye){const He=[];for(const ve of ae){const Me=[ve.x,ve.y,0,1];O9(Me,Me,le),He.push(new g(Me[0]/Me[3],Me[1]/Me[3]))}return He}(j,B),re=function(ae,le,fe,ye){const He=[],ve=[],Me=ye[8]*le,De=ye[9]*le,$e=ye[10]*le,dt=ye[11]*le,wt=ye[8]*fe,Qt=ye[9]*fe,ct=ye[10]*fe,ot=ye[11]*fe;for(const xt of ae){const st=[],We=[];for(const Ot of xt){const Ct=Ot.x,i1=Ot.y,N1=ye[0]*Ct+ye[4]*i1+ye[12],$1=ye[1]*Ct+ye[5]*i1+ye[13],_2=ye[2]*Ct+ye[6]*i1+ye[14],W3=ye[3]*Ct+ye[7]*i1+ye[15],f3=_2+$e,d2=W3+dt,P2=N1+wt,q2=$1+Qt,p3=_2+ct,m3=W3+ot,v2=new g((N1+Me)/d2,($1+De)/d2);v2.z=f3/d2,st.push(v2);const x2=new g(P2/m3,q2/m3);x2.z=p3/m3,We.push(x2)}He.push(st),ve.push(We)}return[He,ve]}(x,X,q,B);return function(ae,le,fe){let ye=1/0;Ax(fe,le)&&(ye=Yx(fe,le[0]));for(let He=0;He<le.length;He++){const ve=le[He],Me=ae[He];for(let De=0;De<ve.length-1;De++){const $e=ve[De],dt=[$e,ve[De+1],Me[De+1],Me[De],$e];Cx(fe,dt)&&(ye=Math.min(ye,Yx(fe,dt)))}}return ye!==1/0&&ye}(re[0],re[1],Y)}}function D0(c,s){return c.x*s.x+c.y*s.y}function Yx(c,s){if(c.length===1){let Q=0;const y=s[Q++];let x;for(;!x||y.equals(x);)if(x=s[Q++],!x)return 1/0;for(;Q<s.length;Q++){const C=s[Q],S=c[0],O=x.sub(y),B=C.sub(y),j=S.sub(y),q=D0(O,O),X=D0(O,B),Y=D0(B,B),re=D0(j,O),ae=D0(j,B),le=q*Y-X*X,fe=(Y*re-X*ae)/le,ye=(q*ae-X*re)/le,He=y.z*(1-fe-ye)+x.z*fe+C.z*ye;if(isFinite(He))return He}return 1/0}{let Q=1/0;for(const y of s)Q=Math.min(Q,y.z);return Q}}const XX=U1([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:KX}=XX,JX=U1([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:YX}=JX,eK=Zn.VectorTileFeature.types,tK=Math.cos(Math.PI/180*37.5),eL=Math.pow(2,14)/.5;class Oh{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(Q=>{this.gradients[Q.id]={}}),this.layoutVertexArray=new Bt,this.layoutVertexArray2=new Mt,this.indexArray=new O2,this.programConfigurations=new N4(s.layers,s.zoom),this.segments=new B1,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(s,Q,y){this.hasPattern=Ah("line",this.layers,Q);const x=this.layers[0].layout.get("line-sort-key"),C=!x.isConstant(),S=[];for(const{feature:O,id:B,index:j,sourceLayerIndex:q}of s){const X=this.layers[0]._featureFilter.needGeometry,Y=G6(O,X);if(!this.layers[0]._featureFilter.filter(new I1(this.zoom),Y,y))continue;const re=C?x.evaluate(Y,{},y):void 0,ae={id:B,properties:O.properties,type:O.type,sourceLayerIndex:q,index:j,geometry:X?Y.geometry:q6(O),patterns:{},sortKey:re};S.push(ae)}C&&S.sort((O,B)=>O.sortKey-B.sortKey);for(const O of S){const{geometry:B,index:j,sourceLayerIndex:q}=O;if(this.hasPattern){const X=Sh("line",this.layers,O,this.zoom,Q);this.patternFeatures.push(X)}else this.addFeature(O,B,j,y,{});Q.featureIndex.insert(s[j].feature,B,j,q,this.index)}}update(s,Q,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,Q,this.stateDependentLayers,y)}addFeatures(s,Q,y){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,Q,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,YX)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,KX),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,Q,y,x,C){const S=this.layers[0].layout,O=S.get("line-join").evaluate(s,{}),B=S.get("line-cap"),j=S.get("line-miter-limit"),q=S.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const X of Q)this.addLine(X,s,O,B,j,q);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,y,C,x)}addLine(s,Q,y,x,C,S){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ye=0;ye<s.length-1;ye++)this.totalDistance+=s[ye].dist(s[ye+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const O=eK[Q.type]==="Polygon";let B=s.length;for(;B>=2&&s[B-1].equals(s[B-2]);)B--;let j=0;for(;j<B-1&&s[j].equals(s[j+1]);)j++;if(B<(O?3:2))return;y==="bevel"&&(C=1.05);const q=this.overscaling<=16?15*h2/(512*this.overscaling):0,X=this.segments.prepareSegment(10*B,this.layoutVertexArray,this.indexArray);let Y,re,ae,le,fe;this.e1=this.e2=-1,O&&(Y=s[B-2],fe=s[j].sub(Y)._unit()._perp());for(let ye=j;ye<B;ye++){if(ae=ye===B-1?O?s[j+1]:void 0:s[ye+1],ae&&s[ye].equals(ae))continue;fe&&(le=fe),Y&&(re=Y),Y=s[ye],fe=ae?ae.sub(Y)._unit()._perp():le,le=le||fe;let He=le.add(fe);He.x===0&&He.y===0||He._unit();const ve=le.x*fe.x+le.y*fe.y,Me=He.x*fe.x+He.y*fe.y,De=Me!==0?1/Me:1/0,$e=2*Math.sqrt(2-2*Me),dt=Me<tK&&re&&ae,wt=le.x*fe.y-le.y*fe.x>0;if(dt&&ye>j){const ot=Y.dist(re);if(ot>2*q){const xt=Y.sub(Y.sub(re)._mult(q/ot)._round());this.updateDistance(re,xt),this.addCurrentVertex(xt,le,0,0,X),re=xt}}const Qt=re&&ae;let ct=Qt?y:O?"butt":x;if(Qt&&ct==="round"&&(De<S?ct="miter":De<=2&&(ct="fakeround")),ct==="miter"&&De>C&&(ct="bevel"),ct==="bevel"&&(De>2&&(ct="flipbevel"),De<C&&(ct="miter")),re&&this.updateDistance(re,Y),ct==="miter")He._mult(De),this.addCurrentVertex(Y,He,0,0,X);else if(ct==="flipbevel"){if(De>100)He=fe.mult(-1);else{const ot=De*le.add(fe).mag()/le.sub(fe).mag();He._perp()._mult(ot*(wt?-1:1))}this.addCurrentVertex(Y,He,0,0,X),this.addCurrentVertex(Y,He.mult(-1),0,0,X)}else if(ct==="bevel"||ct==="fakeround"){const ot=-Math.sqrt(De*De-1),xt=wt?ot:0,st=wt?0:ot;if(re&&this.addCurrentVertex(Y,le,xt,st,X),ct==="fakeround"){const We=Math.round(180*$e/Math.PI/20);for(let Ot=1;Ot<We;Ot++){let Ct=Ot/We;if(Ct!==.5){const N1=Ct-.5;Ct+=Ct*N1*(Ct-1)*((1.0904+ve*(ve*(3.55645-1.43519*ve)-3.2452))*N1*N1+(.848013+ve*(.215638*ve-1.06021)))}const i1=fe.sub(le)._mult(Ct)._add(le)._unit()._mult(wt?-1:1);this.addHalfVertex(Y,i1.x,i1.y,!1,wt,0,X)}}ae&&this.addCurrentVertex(Y,fe,-xt,-st,X)}else if(ct==="butt")this.addCurrentVertex(Y,He,0,0,X);else if(ct==="square"){const ot=re?1:-1;this.addCurrentVertex(Y,He,ot,ot,X)}else ct==="round"&&(re&&(this.addCurrentVertex(Y,le,0,0,X),this.addCurrentVertex(Y,le,1,1,X,!0)),ae&&(this.addCurrentVertex(Y,fe,-1,-1,X,!0),this.addCurrentVertex(Y,fe,0,0,X)));if(dt&&ye<B-1){const ot=Y.dist(ae);if(ot>2*q){const xt=Y.add(ae.sub(Y)._mult(q/ot)._round());this.updateDistance(Y,xt),this.addCurrentVertex(xt,fe,0,0,X),Y=xt}}}}addCurrentVertex(s,Q,y,x,C,S=!1){const O=Q.y*x-Q.x,B=-Q.y-Q.x*x;this.addHalfVertex(s,Q.x+Q.y*y,Q.y-Q.x*y,S,!1,y,C),this.addHalfVertex(s,O,B,S,!0,-x,C),this.distance>eL/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(s,Q,y,x,C,S))}addHalfVertex({x:s,y:Q},y,x,C,S,O,B){const j=.5*(this.lineClips?this.scaledDistance*(eL-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(C?1:0),(Q<<1)+(S?1:0),Math.round(63*y)+128,Math.round(63*x)+128,1+(O===0?0:O<0?-1:1)|(63&j)<<2,j>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const q=B.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,q),B.primitiveLength++),S?this.e2=q:this.e1=q}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,Q){this.distance+=s.dist(Q),this.updateScaledDistance()}}let tL,rL;_t("LineBucket",Oh,{omit:["layers","patternFeatures"]});var nL={get paint(){return rL=rL||new l2({"line-opacity":new It(Pe.paint_line["line-opacity"]),"line-color":new It(Pe.paint_line["line-color"]),"line-translate":new St(Pe.paint_line["line-translate"]),"line-translate-anchor":new St(Pe.paint_line["line-translate-anchor"]),"line-width":new It(Pe.paint_line["line-width"]),"line-gap-width":new It(Pe.paint_line["line-gap-width"]),"line-offset":new It(Pe.paint_line["line-offset"]),"line-blur":new It(Pe.paint_line["line-blur"]),"line-dasharray":new p0(Pe.paint_line["line-dasharray"]),"line-pattern":new z6(Pe.paint_line["line-pattern"]),"line-gradient":new m0(Pe.paint_line["line-gradient"])})},get layout(){return tL=tL||new l2({"line-cap":new St(Pe.layout_line["line-cap"]),"line-join":new It(Pe.layout_line["line-join"]),"line-miter-limit":new St(Pe.layout_line["line-miter-limit"]),"line-round-limit":new St(Pe.layout_line["line-round-limit"]),"line-sort-key":new It(Pe.layout_line["line-sort-key"])})}};class rK extends It{possiblyEvaluate(s,Q){return Q=new I1(Math.floor(Q.zoom),{now:Q.now,fadeDuration:Q.fadeDuration,zoomHistory:Q.zoomHistory,transition:Q.transition}),super.possiblyEvaluate(s,Q)}evaluate(s,Q,y,x){return Q=K({},Q,{zoom:Math.floor(Q.zoom)}),super.evaluate(s,Q,y,x)}}let N9;class nK extends G3{constructor(s){super(s,nL),this.gradientVersion=0,N9||(N9=new rK(nL.paint.properties["line-width"].specification),N9.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(s){if(s==="line-gradient"){const Q=this.gradientExpression();this.stepInterpolant=!!function(y){return y._styleExpression!==void 0}(Q)&&Q._styleExpression.expression instanceof ur,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(s,Q){super.recalculate(s,Q),this.paint._values["line-floorwidth"]=N9.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,s)}createBucket(s){return new Oh(s)}queryRadius(s){const Q=s,y=iL(w0("line-width",this,Q),w0("line-gap-width",this,Q)),x=w0("line-offset",this,Q);return y/2+Math.abs(x)+V9(this.paint.get("line-translate"))}queryIntersectsFeature(s,Q,y,x,C,S,O){const B=D9(s,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),S.angle,O),j=O/2*iL(this.paint.get("line-width").evaluate(Q,y),this.paint.get("line-gap-width").evaluate(Q,y)),q=this.paint.get("line-offset").evaluate(Q,y);return q&&(x=function(X,Y){const re=[];for(let ae=0;ae<X.length;ae++){const le=X[ae],fe=[];for(let ye=0;ye<le.length;ye++){const He=le[ye-1],ve=le[ye],Me=le[ye+1],De=ye===0?new g(0,0):ve.sub(He)._unit()._perp(),$e=ye===le.length-1?new g(0,0):Me.sub(ve)._unit()._perp(),dt=De._add($e)._unit(),wt=dt.x*$e.x+dt.y*$e.y;wt!==0&&dt._mult(1/wt),fe.push(dt._mult(Y)._add(ve))}re.push(fe)}return re}(x,q*O)),function(X,Y,re){for(let ae=0;ae<Y.length;ae++){const le=Y[ae];if(X.length>=3){for(let fe=0;fe<le.length;fe++)if(C5(X,le[fe]))return!0}if(cX(X,le,re))return!0}return!1}(B,x,j)}isTileClipped(){return!0}}function iL(c,s){return s>0?s+2*c:c}const iK=U1([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),aK=U1([{name:"a_projected_pos",components:3,type:"Float32"}],4);U1([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const oK=U1([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);U1([{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 aL=U1([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),sK=U1([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function lK(c,s,Q){return c.sections.forEach(y=>{y.text=function(x,C,S){const O=C.layout.get("text-transform").evaluate(S,{});return O==="uppercase"?x=x.toLocaleUpperCase():O==="lowercase"&&(x=x.toLocaleLowerCase()),A3.applyArabicShaping&&(x=A3.applyArabicShaping(x)),x}(y.text,s,Q)}),c}U1([{name:"triangle",components:3,type:"Uint16"}]),U1([{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"}]),U1([{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"}]),U1([{type:"Float32",name:"offsetX"}]),U1([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),U1([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const O0={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var g2=24,oL=A1,sL=function(c,s,Q,y,x){var C,S,O=8*x-y-1,B=(1<<O)-1,j=B>>1,q=-7,X=Q?x-1:0,Y=Q?-1:1,re=c[s+X];for(X+=Y,C=re&(1<<-q)-1,re>>=-q,q+=O;q>0;C=256*C+c[s+X],X+=Y,q-=8);for(S=C&(1<<-q)-1,C>>=-q,q+=y;q>0;S=256*S+c[s+X],X+=Y,q-=8);if(C===0)C=1-j;else{if(C===B)return S?NaN:1/0*(re?-1:1);S+=Math.pow(2,y),C-=j}return(re?-1:1)*S*Math.pow(2,C-y)},lL=function(c,s,Q,y,x,C){var S,O,B,j=8*C-x-1,q=(1<<j)-1,X=q>>1,Y=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=y?0:C-1,ae=y?1:-1,le=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(O=isNaN(s)?1:0,S=q):(S=Math.floor(Math.log(s)/Math.LN2),s*(B=Math.pow(2,-S))<1&&(S--,B*=2),(s+=S+X>=1?Y/B:Y*Math.pow(2,1-X))*B>=2&&(S++,B/=2),S+X>=q?(O=0,S=q):S+X>=1?(O=(s*B-1)*Math.pow(2,x),S+=X):(O=s*Math.pow(2,X-1)*Math.pow(2,x),S=0));x>=8;c[Q+re]=255&O,re+=ae,O/=256,x-=8);for(S=S<<x|O,j+=x;j>0;c[Q+re]=255&S,re+=ae,S/=256,j-=8);c[Q+re-ae]|=128*le};function A1(c){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(c)?c:new Uint8Array(c||0),this.pos=0,this.type=0,this.length=this.buf.length}A1.Varint=0,A1.Fixed64=1,A1.Bytes=2,A1.Fixed32=5;var kh=4294967296,cL=1/kh,uL=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Kr(c){return c.type===A1.Bytes?c.readVarint()+c.pos:c.pos+1}function V5(c,s,Q){return Q?4294967296*s+(c>>>0):4294967296*(s>>>0)+(c>>>0)}function QL(c,s,Q){var y=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));Q.realloc(y);for(var x=Q.pos-1;x>=c;x--)Q.buf[x+y]=Q.buf[x]}function cK(c,s){for(var Q=0;Q<c.length;Q++)s.writeVarint(c[Q])}function uK(c,s){for(var Q=0;Q<c.length;Q++)s.writeSVarint(c[Q])}function QK(c,s){for(var Q=0;Q<c.length;Q++)s.writeFloat(c[Q])}function TK(c,s){for(var Q=0;Q<c.length;Q++)s.writeDouble(c[Q])}function hK(c,s){for(var Q=0;Q<c.length;Q++)s.writeBoolean(c[Q])}function dK(c,s){for(var Q=0;Q<c.length;Q++)s.writeFixed32(c[Q])}function fK(c,s){for(var Q=0;Q<c.length;Q++)s.writeSFixed32(c[Q])}function pK(c,s){for(var Q=0;Q<c.length;Q++)s.writeFixed64(c[Q])}function mK(c,s){for(var Q=0;Q<c.length;Q++)s.writeSFixed64(c[Q])}function F9(c,s){return(c[s]|c[s+1]<<8|c[s+2]<<16)+16777216*c[s+3]}function D5(c,s,Q){c[Q]=s,c[Q+1]=s>>>8,c[Q+2]=s>>>16,c[Q+3]=s>>>24}function TL(c,s){return(c[s]|c[s+1]<<8|c[s+2]<<16)+(c[s+3]<<24)}A1.prototype={destroy:function(){this.buf=null},readFields:function(c,s,Q){for(Q=Q||this.length;this.pos<Q;){var y=this.readVarint(),x=y>>3,C=this.pos;this.type=7&y,c(x,s,this),this.pos===C&&this.skip(y)}return s},readMessage:function(c,s){return this.readFields(c,s,this.readVarint()+this.pos)},readFixed32:function(){var c=F9(this.buf,this.pos);return this.pos+=4,c},readSFixed32:function(){var c=TL(this.buf,this.pos);return this.pos+=4,c},readFixed64:function(){var c=F9(this.buf,this.pos)+F9(this.buf,this.pos+4)*kh;return this.pos+=8,c},readSFixed64:function(){var c=F9(this.buf,this.pos)+TL(this.buf,this.pos+4)*kh;return this.pos+=8,c},readFloat:function(){var c=sL(this.buf,this.pos,!0,23,4);return this.pos+=4,c},readDouble:function(){var c=sL(this.buf,this.pos,!0,52,8);return this.pos+=8,c},readVarint:function(c){var s,Q,y=this.buf;return s=127&(Q=y[this.pos++]),Q<128?s:(s|=(127&(Q=y[this.pos++]))<<7,Q<128?s:(s|=(127&(Q=y[this.pos++]))<<14,Q<128?s:(s|=(127&(Q=y[this.pos++]))<<21,Q<128?s:function(x,C,S){var O,B,j=S.buf;if(O=(112&(B=j[S.pos++]))>>4,B<128||(O|=(127&(B=j[S.pos++]))<<3,B<128)||(O|=(127&(B=j[S.pos++]))<<10,B<128)||(O|=(127&(B=j[S.pos++]))<<17,B<128)||(O|=(127&(B=j[S.pos++]))<<24,B<128)||(O|=(1&(B=j[S.pos++]))<<31,B<128))return V5(x,O,C);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(Q=y[this.pos]))<<28,c,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var c=this.readVarint();return c%2==1?(c+1)/-2:c/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var c=this.readVarint()+this.pos,s=this.pos;return this.pos=c,c-s>=12&&uL?function(Q,y,x){return uL.decode(Q.subarray(y,x))}(this.buf,s,c):function(Q,y,x){for(var C="",S=y;S<x;){var O,B,j,q=Q[S],X=null,Y=q>239?4:q>223?3:q>191?2:1;if(S+Y>x)break;Y===1?q<128&&(X=q):Y===2?(192&(O=Q[S+1]))==128&&(X=(31&q)<<6|63&O)<=127&&(X=null):Y===3?(B=Q[S+2],(192&(O=Q[S+1]))==128&&(192&B)==128&&((X=(15&q)<<12|(63&O)<<6|63&B)<=2047||X>=55296&&X<=57343)&&(X=null)):Y===4&&(B=Q[S+2],j=Q[S+3],(192&(O=Q[S+1]))==128&&(192&B)==128&&(192&j)==128&&((X=(15&q)<<18|(63&O)<<12|(63&B)<<6|63&j)<=65535||X>=1114112)&&(X=null)),X===null?(X=65533,Y=1):X>65535&&(X-=65536,C+=String.fromCharCode(X>>>10&1023|55296),X=56320|1023&X),C+=String.fromCharCode(X),S+=Y}return C}(this.buf,s,c)},readBytes:function(){var c=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,c);return this.pos=c,s},readPackedVarint:function(c,s){if(this.type!==A1.Bytes)return c.push(this.readVarint(s));var Q=Kr(this);for(c=c||[];this.pos<Q;)c.push(this.readVarint(s));return c},readPackedSVarint:function(c){if(this.type!==A1.Bytes)return c.push(this.readSVarint());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readSVarint());return c},readPackedBoolean:function(c){if(this.type!==A1.Bytes)return c.push(this.readBoolean());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readBoolean());return c},readPackedFloat:function(c){if(this.type!==A1.Bytes)return c.push(this.readFloat());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readFloat());return c},readPackedDouble:function(c){if(this.type!==A1.Bytes)return c.push(this.readDouble());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readDouble());return c},readPackedFixed32:function(c){if(this.type!==A1.Bytes)return c.push(this.readFixed32());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readFixed32());return c},readPackedSFixed32:function(c){if(this.type!==A1.Bytes)return c.push(this.readSFixed32());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readSFixed32());return c},readPackedFixed64:function(c){if(this.type!==A1.Bytes)return c.push(this.readFixed64());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readFixed64());return c},readPackedSFixed64:function(c){if(this.type!==A1.Bytes)return c.push(this.readSFixed64());var s=Kr(this);for(c=c||[];this.pos<s;)c.push(this.readSFixed64());return c},skip:function(c){var s=7&c;if(s===A1.Varint)for(;this.buf[this.pos++]>127;);else if(s===A1.Bytes)this.pos=this.readVarint()+this.pos;else if(s===A1.Fixed32)this.pos+=4;else{if(s!==A1.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(c,s){this.writeVarint(c<<3|s)},realloc:function(c){for(var s=this.length||16;s<this.pos+c;)s*=2;if(s!==this.length){var Q=new Uint8Array(s);Q.set(this.buf),this.buf=Q,this.length=s}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(c){this.realloc(4),D5(this.buf,c,this.pos),this.pos+=4},writeSFixed32:function(c){this.realloc(4),D5(this.buf,c,this.pos),this.pos+=4},writeFixed64:function(c){this.realloc(8),D5(this.buf,-1&c,this.pos),D5(this.buf,Math.floor(c*cL),this.pos+4),this.pos+=8},writeSFixed64:function(c){this.realloc(8),D5(this.buf,-1&c,this.pos),D5(this.buf,Math.floor(c*cL),this.pos+4),this.pos+=8},writeVarint:function(c){(c=+c||0)>268435455||c<0?function(s,Q){var y,x;if(s>=0?(y=s%4294967296|0,x=s/4294967296|0):(x=~(-s/4294967296),4294967295^(y=~(-s%4294967296))?y=y+1|0:(y=0,x=x+1|0)),s>=18446744073709552e3||s<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Q.realloc(10),function(C,S,O){O.buf[O.pos++]=127&C|128,C>>>=7,O.buf[O.pos++]=127&C|128,C>>>=7,O.buf[O.pos++]=127&C|128,C>>>=7,O.buf[O.pos++]=127&C|128,O.buf[O.pos]=127&(C>>>=7)}(y,0,Q),function(C,S){var O=(7&C)<<4;S.buf[S.pos++]|=O|((C>>>=3)?128:0),C&&(S.buf[S.pos++]=127&C|((C>>>=7)?128:0),C&&(S.buf[S.pos++]=127&C|((C>>>=7)?128:0),C&&(S.buf[S.pos++]=127&C|((C>>>=7)?128:0),C&&(S.buf[S.pos++]=127&C|((C>>>=7)?128:0),C&&(S.buf[S.pos++]=127&C)))))}(x,Q)}(c,this):(this.realloc(4),this.buf[this.pos++]=127&c|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=c>>>7&127))))},writeSVarint:function(c){this.writeVarint(c<0?2*-c-1:2*c)},writeBoolean:function(c){this.writeVarint(!!c)},writeString:function(c){c=String(c),this.realloc(4*c.length),this.pos++;var s=this.pos;this.pos=function(y,x,C){for(var S,O,B=0;B<x.length;B++){if((S=x.charCodeAt(B))>55295&&S<57344){if(!O){S>56319||B+1===x.length?(y[C++]=239,y[C++]=191,y[C++]=189):O=S;continue}if(S<56320){y[C++]=239,y[C++]=191,y[C++]=189,O=S;continue}S=O-55296<<10|S-56320|65536,O=null}else O&&(y[C++]=239,y[C++]=191,y[C++]=189,O=null);S<128?y[C++]=S:(S<2048?y[C++]=S>>6|192:(S<65536?y[C++]=S>>12|224:(y[C++]=S>>18|240,y[C++]=S>>12&63|128),y[C++]=S>>6&63|128),y[C++]=63&S|128)}return C}(this.buf,c,this.pos);var Q=this.pos-s;Q>=128&&QL(s,Q,this),this.pos=s-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(c){this.realloc(4),lL(this.buf,c,this.pos,!0,23,4),this.pos+=4},writeDouble:function(c){this.realloc(8),lL(this.buf,c,this.pos,!0,52,8),this.pos+=8},writeBytes:function(c){var s=c.length;this.writeVarint(s),this.realloc(s);for(var Q=0;Q<s;Q++)this.buf[this.pos++]=c[Q]},writeRawMessage:function(c,s){this.pos++;var Q=this.pos;c(s,this);var y=this.pos-Q;y>=128&&QL(Q,y,this),this.pos=Q-1,this.writeVarint(y),this.pos+=y},writeMessage:function(c,s,Q){this.writeTag(c,A1.Bytes),this.writeRawMessage(s,Q)},writePackedVarint:function(c,s){s.length&&this.writeMessage(c,cK,s)},writePackedSVarint:function(c,s){s.length&&this.writeMessage(c,uK,s)},writePackedBoolean:function(c,s){s.length&&this.writeMessage(c,hK,s)},writePackedFloat:function(c,s){s.length&&this.writeMessage(c,QK,s)},writePackedDouble:function(c,s){s.length&&this.writeMessage(c,TK,s)},writePackedFixed32:function(c,s){s.length&&this.writeMessage(c,dK,s)},writePackedSFixed32:function(c,s){s.length&&this.writeMessage(c,fK,s)},writePackedFixed64:function(c,s){s.length&&this.writeMessage(c,pK,s)},writePackedSFixed64:function(c,s){s.length&&this.writeMessage(c,mK,s)},writeBytesField:function(c,s){this.writeTag(c,A1.Bytes),this.writeBytes(s)},writeFixed32Field:function(c,s){this.writeTag(c,A1.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(c,s){this.writeTag(c,A1.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(c,s){this.writeTag(c,A1.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(c,s){this.writeTag(c,A1.Fixed64),this.writeSFixed64(s)},writeVarintField:function(c,s){this.writeTag(c,A1.Varint),this.writeVarint(s)},writeSVarintField:function(c,s){this.writeTag(c,A1.Varint),this.writeSVarint(s)},writeStringField:function(c,s){this.writeTag(c,A1.Bytes),this.writeString(s)},writeFloatField:function(c,s){this.writeTag(c,A1.Fixed32),this.writeFloat(s)},writeDoubleField:function(c,s){this.writeTag(c,A1.Fixed64),this.writeDouble(s)},writeBooleanField:function(c,s){this.writeVarintField(c,!!s)}};var Ph=h(oL);const Ih=3;function yK(c,s,Q){c===1&&Q.readMessage(gK,s)}function gK(c,s,Q){if(c===3){const{id:y,bitmap:x,width:C,height:S,left:O,top:B,advance:j}=Q.readMessage(_K,{});s.push({id:y,bitmap:new M0({width:C+2*Ih,height:S+2*Ih},x),metrics:{width:C,height:S,left:O,top:B,advance:j}})}}function _K(c,s,Q){c===1?s.id=Q.readVarint():c===2?s.bitmap=Q.readBytes():c===3?s.width=Q.readVarint():c===4?s.height=Q.readVarint():c===5?s.left=Q.readSVarint():c===6?s.top=Q.readSVarint():c===7&&(s.advance=Q.readVarint())}const hL=Ih;function dL(c){let s=0,Q=0;for(const S of c)s+=S.w*S.h,Q=Math.max(Q,S.w);c.sort((S,O)=>O.h-S.h);const y=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),Q),h:1/0}];let x=0,C=0;for(const S of c)for(let O=y.length-1;O>=0;O--){const B=y[O];if(!(S.w>B.w||S.h>B.h)){if(S.x=B.x,S.y=B.y,C=Math.max(C,S.y+S.h),x=Math.max(x,S.x+S.w),S.w===B.w&&S.h===B.h){const j=y.pop();O<y.length&&(y[O]=j)}else S.h===B.h?(B.x+=S.w,B.w-=S.w):S.w===B.w?(B.y+=S.h,B.h-=S.h):(y.push({x:B.x+S.w,y:B.y,w:B.w-S.w,h:S.h}),B.y+=S.h,B.h-=S.h);break}}return{w:x,h:C,fill:s/(x*C)||0}}const E3=1;class Bh{constructor(s,{pixelRatio:Q,version:y,stretchX:x,stretchY:C,content:S}){this.paddedRect=s,this.pixelRatio=Q,this.stretchX=x,this.stretchY=C,this.content=S,this.version=y}get tl(){return[this.paddedRect.x+E3,this.paddedRect.y+E3]}get br(){return[this.paddedRect.x+this.paddedRect.w-E3,this.paddedRect.y+this.paddedRect.h-E3]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*E3)/this.pixelRatio,(this.paddedRect.h-2*E3)/this.pixelRatio]}}class fL{constructor(s,Q){const y={},x={};this.haveRenderCallbacks=[];const C=[];this.addImages(s,y,C),this.addImages(Q,x,C);const{w:S,h:O}=dL(C),B=new r4({width:S||1,height:O||1});for(const j in s){const q=s[j],X=y[j].paddedRect;r4.copy(q.data,B,{x:0,y:0},{x:X.x+E3,y:X.y+E3},q.data)}for(const j in Q){const q=Q[j],X=x[j].paddedRect,Y=X.x+E3,re=X.y+E3,ae=q.data.width,le=q.data.height;r4.copy(q.data,B,{x:0,y:0},{x:Y,y:re},q.data),r4.copy(q.data,B,{x:0,y:le-1},{x:Y,y:re-1},{width:ae,height:1}),r4.copy(q.data,B,{x:0,y:0},{x:Y,y:re+le},{width:ae,height:1}),r4.copy(q.data,B,{x:ae-1,y:0},{x:Y-1,y:re},{width:1,height:le}),r4.copy(q.data,B,{x:0,y:0},{x:Y+ae,y:re},{width:1,height:le})}this.image=B,this.iconPositions=y,this.patternPositions=x}addImages(s,Q,y){for(const x in s){const C=s[x],S={x:0,y:0,w:C.data.width+2*E3,h:C.data.height+2*E3};y.push(S),Q[x]=new Bh(S,C),C.hasRenderCallback&&this.haveRenderCallbacks.push(x)}}patchUpdatedImages(s,Q){s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const y in s.updatedImages)this.patchUpdatedImage(this.iconPositions[y],s.getImage(y),Q),this.patchUpdatedImage(this.patternPositions[y],s.getImage(y),Q)}patchUpdatedImage(s,Q,y){if(!s||!Q||s.version===Q.version)return;s.version=Q.version;const[x,C]=s.tl;y.update(Q.data,void 0,{x,y:C})}}var qn;_t("ImagePosition",Bh),_t("ImageAtlas",fL),o.ai=void 0,(qn=o.ai||(o.ai={}))[qn.none=0]="none",qn[qn.horizontal=1]="horizontal",qn[qn.vertical=2]="vertical",qn[qn.horizontalOnly=3]="horizontalOnly";const k0=-17;class P0{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,Q){const y=new P0;return y.scale=s||1,y.fontStack=Q,y}static forImage(s){const Q=new P0;return Q.imageName=s,Q}}class O5{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,Q){const y=new O5;for(let x=0;x<s.sections.length;x++){const C=s.sections[x];C.image?y.addImageSection(C):y.addTextSection(C,Q)}return y}length(){return this.text.length}getSection(s){return this.sections[this.sectionIndex[s]]}getSectionIndex(s){return this.sectionIndex[s]}getCharCode(s){return this.text.charCodeAt(s)}verticalizePunctuation(){this.text=function(s){let Q="";for(let y=0;y<s.length;y++){const x=s.charCodeAt(y+1)||null,C=s.charCodeAt(y-1)||null;Q+=x&&v9(x)&&!O0[s[y+1]]||C&&v9(C)&&!O0[s[y-1]]||!O0[s[y]]?s[y]:O0[s[y]]}return Q}(this.text)}trim(){let s=0;for(let y=0;y<this.text.length&&j9[this.text.charCodeAt(y)];y++)s++;let Q=this.text.length;for(let y=this.text.length-1;y>=0&&y>=s&&j9[this.text.charCodeAt(y)];y--)Q--;this.text=this.text.substring(s,Q),this.sectionIndex=this.sectionIndex.slice(s,Q)}substring(s,Q){const y=new O5;return y.text=this.text.substring(s,Q),y.sectionIndex=this.sectionIndex.slice(s,Q),y.sections=this.sections,y}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,Q)=>Math.max(s,this.sections[Q].scale),0)}addTextSection(s,Q){this.text+=s.text,this.sections.push(P0.forText(s.scale,s.fontStack||Q));const y=this.sections.length-1;for(let x=0;x<s.text.length;++x)this.sectionIndex.push(y)}addImageSection(s){const Q=s.image?s.image.name:"";if(Q.length===0)return void Re("Can't add FormattedSection with an empty image.");const y=this.getNextImageSectionCharCode();y?(this.text+=String.fromCharCode(y),this.sections.push(P0.forImage(Q)),this.sectionIndex.push(this.sections.length-1)):Re("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function R9(c,s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae,le){const fe=O5.fromFeature(c,x);let ye;X===o.ai.vertical&&fe.verticalizePunctuation();const{processBidirectionalText:He,processStyledBidirectionalText:ve}=A3;if(He&&fe.sections.length===1){ye=[];const $e=He(fe.toString(),Nh(fe,j,C,s,y,re,ae));for(const dt of $e){const wt=new O5;wt.text=dt,wt.sections=fe.sections;for(let Qt=0;Qt<dt.length;Qt++)wt.sectionIndex.push(0);ye.push(wt)}}else if(ve){ye=[];const $e=ve(fe.text,fe.sectionIndex,Nh(fe,j,C,s,y,re,ae));for(const dt of $e){const wt=new O5;wt.text=dt[0],wt.sectionIndex=dt[1],wt.sections=fe.sections,ye.push(wt)}}else ye=function($e,dt){const wt=[],Qt=$e.text;let ct=0;for(const ot of dt)wt.push($e.substring(ct,ot)),ct=ot;return ct<Qt.length&&wt.push($e.substring(ct,Qt.length)),wt}(fe,Nh(fe,j,C,s,y,re,ae));const Me=[],De={positionedLines:Me,text:fe.toString(),top:q[1],bottom:q[1],left:q[0],right:q[0],writingMode:X,iconsInText:!1,verticalizable:!1};return function($e,dt,wt,Qt,ct,ot,xt,st,We,Ot,Ct,i1){let N1=0,$1=k0,_2=0,W3=0;const f3=st==="right"?1:st==="left"?0:.5;let d2=0;for(const v2 of ct){v2.trim();const x2=v2.getMaxScale(),e3=(x2-1)*g2,y3={positionedGlyphs:[],lineOffset:0};$e.positionedLines[d2]=y3;const t3=y3.positionedGlyphs;let V3=0;if(!v2.length()){$1+=ot,++d2;continue}for(let L2=0;L2<v2.length();L2++){const l1=v2.getSection(L2),r3=v2.getSectionIndex(L2),G2=v2.getCharCode(L2);let b2=0,g4=null,F4=null,R4=null,Jr=g2;const _4=!(We===o.ai.horizontal||!Ct&&!l0(G2)||Ct&&(j9[G2]||(P2=G2,ht.Arabic(P2)||ht["Arabic Supplement"](P2)||ht["Arabic Extended-A"](P2)||ht["Arabic Presentation Forms-A"](P2)||ht["Arabic Presentation Forms-B"](P2))));if(l1.imageName){const i4=Qt[l1.imageName];if(!i4)continue;R4=l1.imageName,$e.iconsInText=$e.iconsInText||!0,F4=i4.paddedRect;const O3=i4.displaySize;l1.scale=l1.scale*g2/i1,g4={width:O3[0],height:O3[1],left:E3,top:-hL,advance:_4?O3[1]:O3[0]},b2=e3+(g2-O3[1]*l1.scale),Jr=g4.advance;const Yr=_4?O3[0]*l1.scale-g2*x2:O3[1]*l1.scale-g2*x2;Yr>0&&Yr>V3&&(V3=Yr)}else{const i4=wt[l1.fontStack],O3=i4&&i4[G2];if(O3&&O3.rect)F4=O3.rect,g4=O3.metrics;else{const Yr=dt[l1.fontStack],R0=Yr&&Yr[G2];if(!R0)continue;g4=R0.metrics}b2=(x2-l1.scale)*g2}_4?($e.verticalizable=!0,t3.push({glyph:G2,imageName:R4,x:N1,y:$1+b2,vertical:_4,scale:l1.scale,fontStack:l1.fontStack,sectionIndex:r3,metrics:g4,rect:F4}),N1+=Jr*l1.scale+Ot):(t3.push({glyph:G2,imageName:R4,x:N1,y:$1+b2,vertical:_4,scale:l1.scale,fontStack:l1.fontStack,sectionIndex:r3,metrics:g4,rect:F4}),N1+=g4.advance*l1.scale+Ot)}t3.length!==0&&(_2=Math.max(N1-Ot,_2),LK(t3,0,t3.length-1,f3,V3)),N1=0;const D3=ot*x2+V3;y3.lineOffset=Math.max(V3,e3),$1+=D3,W3=Math.max(D3,W3),++d2}var P2;const q2=$1-k0,{horizontalAlign:p3,verticalAlign:m3}=Fh(xt);(function(v2,x2,e3,y3,t3,V3,D3,L2,l1){const r3=(x2-e3)*t3;let G2=0;G2=V3!==D3?-L2*y3-k0:(-y3*l1+.5)*D3;for(const b2 of v2)for(const g4 of b2.positionedGlyphs)g4.x+=r3,g4.y+=G2})($e.positionedLines,f3,p3,m3,_2,W3,ot,q2,ct.length),$e.top+=-m3*q2,$e.bottom=$e.top+q2,$e.left+=-p3*_2,$e.right=$e.left+_2}(De,s,Q,y,ye,S,O,B,X,j,Y,le),!function($e){for(const dt of $e)if(dt.positionedGlyphs.length!==0)return!1;return!0}(Me)&&De}const j9={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},vK={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function pL(c,s,Q,y,x,C){if(s.imageName){const S=y[s.imageName];return S?S.displaySize[0]*s.scale*g2/C+x:0}{const S=Q[s.fontStack],O=S&&S[c];return O?O.metrics.advance*s.scale+x:0}}function mL(c,s,Q,y){const x=Math.pow(c-s,2);return y?c<s?x/2:2*x:x+Math.abs(Q)*Q}function xK(c,s,Q){let y=0;return c===10&&(y-=1e4),Q&&(y+=150),c!==40&&c!==65288||(y+=50),s!==41&&s!==65289||(y+=50),y}function yL(c,s,Q,y,x,C){let S=null,O=mL(s,Q,x,C);for(const B of y){const j=mL(s-B.x,Q,x,C)+B.badness;j<=O&&(S=B,O=j)}return{index:c,x:s,priorBreak:S,badness:O}}function gL(c){return c?gL(c.priorBreak).concat(c.index):[]}function Nh(c,s,Q,y,x,C,S){if(C!=="point")return[];if(!c)return[];const O=[],B=function(Y,re,ae,le,fe,ye){let He=0;for(let ve=0;ve<Y.length();ve++){const Me=Y.getSection(ve);He+=pL(Y.getCharCode(ve),Me,le,fe,re,ye)}return He/Math.max(1,Math.ceil(He/ae))}(c,s,Q,y,x,S),j=c.text.indexOf("​")>=0;let q=0;for(let Y=0;Y<c.length();Y++){const re=c.getSection(Y),ae=c.getCharCode(Y);if(j9[ae]||(q+=pL(ae,re,y,x,s,S)),Y<c.length()-1){const le=!((X=ae)<11904||!(ht["Bopomofo Extended"](X)||ht.Bopomofo(X)||ht["CJK Compatibility Forms"](X)||ht["CJK Compatibility Ideographs"](X)||ht["CJK Compatibility"](X)||ht["CJK Radicals Supplement"](X)||ht["CJK Strokes"](X)||ht["CJK Symbols and Punctuation"](X)||ht["CJK Unified Ideographs Extension A"](X)||ht["CJK Unified Ideographs"](X)||ht["Enclosed CJK Letters and Months"](X)||ht["Halfwidth and Fullwidth Forms"](X)||ht.Hiragana(X)||ht["Ideographic Description Characters"](X)||ht["Kangxi Radicals"](X)||ht["Katakana Phonetic Extensions"](X)||ht.Katakana(X)||ht["Vertical Forms"](X)||ht["Yi Radicals"](X)||ht["Yi Syllables"](X)));(vK[ae]||le||re.imageName)&&O.push(yL(Y+1,q,B,O,xK(ae,c.getCharCode(Y+1),le&&j),!1))}}var X;return gL(yL(c.length(),q,B,O,0,!0))}function Fh(c){let s=.5,Q=.5;switch(c){case"right":case"top-right":case"bottom-right":s=1;break;case"left":case"top-left":case"bottom-left":s=0}switch(c){case"bottom":case"bottom-right":case"bottom-left":Q=1;break;case"top":case"top-right":case"top-left":Q=0}return{horizontalAlign:s,verticalAlign:Q}}function LK(c,s,Q,y,x){if(!y&&!x)return;const C=c[Q],S=(c[Q].x+C.metrics.advance*C.scale)*y;for(let O=s;O<=Q;O++)c[O].x-=S,c[O].y+=x}function bK(c,s,Q){const{horizontalAlign:y,verticalAlign:x}=Fh(Q),C=s[0]-c.displaySize[0]*y,S=s[1]-c.displaySize[1]*x;return{image:c,top:S,bottom:S+c.displaySize[1],left:C,right:C+c.displaySize[0]}}function _L(c,s,Q,y,x,C){const S=c.image;let O;if(S.content){const fe=S.content,ye=S.pixelRatio||1;O=[fe[0]/ye,fe[1]/ye,S.displaySize[0]-fe[2]/ye,S.displaySize[1]-fe[3]/ye]}const B=s.left*C,j=s.right*C;let q,X,Y,re;Q==="width"||Q==="both"?(re=x[0]+B-y[3],X=x[0]+j+y[1]):(re=x[0]+(B+j-S.displaySize[0])/2,X=re+S.displaySize[0]);const ae=s.top*C,le=s.bottom*C;return Q==="height"||Q==="both"?(q=x[1]+ae-y[0],Y=x[1]+le+y[2]):(q=x[1]+(ae+le-S.displaySize[1])/2,Y=q+S.displaySize[1]),{image:S,top:q,right:X,bottom:Y,left:re,collisionPadding:O}}const I0=255,fr=128,Gn=I0*fr;function vL(c,s){const{expression:Q}=s;if(Q.kind==="constant")return{kind:"constant",layoutSize:Q.evaluate(new I1(c+1))};if(Q.kind==="source")return{kind:"source"};{const{zoomStops:y,interpolationType:x}=Q;let C=0;for(;C<y.length&&y[C]<=c;)C++;C=Math.max(0,C-1);let S=C;for(;S<y.length&&y[S]<c+1;)S++;S=Math.min(y.length-1,S);const O=y[C],B=y[S];return Q.kind==="composite"?{kind:"composite",minZoom:O,maxZoom:B,interpolationType:x}:{kind:"camera",minZoom:O,maxZoom:B,minSize:Q.evaluate(new I1(O)),maxSize:Q.evaluate(new I1(B)),interpolationType:x}}}function Rh(c,s,Q){let y="never";const x=c.get(s);return x?y=x:c.get(Q)&&(y="always"),y}const wK=Zn.VectorTileFeature.types,HK=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function z9(c,s,Q,y,x,C,S,O,B,j,q,X,Y){const re=O?Math.min(Gn,Math.round(O[0])):0,ae=O?Math.min(Gn,Math.round(O[1])):0;c.emplaceBack(s,Q,Math.round(32*y),Math.round(32*x),C,S,(re<<1)+(B?1:0),ae,16*j,16*q,256*X,256*Y)}function jh(c,s,Q){c.emplaceBack(s.x,s.y,Q),c.emplaceBack(s.x,s.y,Q),c.emplaceBack(s.x,s.y,Q),c.emplaceBack(s.x,s.y,Q)}function MK(c){for(const s of c.sections)if(dh(s.text))return!0;return!1}class zh{constructor(s){this.layoutVertexArray=new a1,this.indexArray=new O2,this.programConfigurations=s,this.segments=new B1,this.dynamicLayoutVertexArray=new Kt,this.opacityVertexArray=new s1,this.hasVisibleVertices=!1,this.placedSymbolArray=new xe}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(s,Q,y,x){this.isEmpty()||(y&&(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,iK.members),this.indexBuffer=s.createIndexBuffer(this.indexArray,Q),this.dynamicLayoutVertexBuffer=s.createVertexBuffer(this.dynamicLayoutVertexArray,aK.members,!0),this.opacityVertexBuffer=s.createVertexBuffer(this.opacityVertexArray,HK,!0),this.opacityVertexBuffer.itemSize=1),(y||x)&&this.programConfigurations.upload(s))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}_t("SymbolBuffers",zh);class $h{constructor(s,Q,y){this.layoutVertexArray=new s,this.layoutAttributes=Q,this.indexArray=new y,this.segments=new B1,this.collisionVertexArray=new O1}upload(s){this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=s.createVertexBuffer(this.collisionVertexArray,oK.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}_t("CollisionBuffers",$h);class k5{constructor(s){this.collisionBoxArray=s.collisionBoxArray,this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(S=>S.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=vh([]),this.placementViewportMatrix=vh([]);const Q=this.layers[0]._unevaluatedLayout._values;this.textSizeData=vL(this.zoom,Q["text-size"]),this.iconSizeData=vL(this.zoom,Q["icon-size"]);const y=this.layers[0].layout,x=y.get("symbol-sort-key"),C=y.get("symbol-z-order");this.canOverlap=Rh(y,"text-overlap","text-allow-overlap")!=="never"||Rh(y,"icon-overlap","icon-allow-overlap")!=="never"||y.get("text-ignore-placement")||y.get("icon-ignore-placement"),this.sortFeaturesByKey=C!=="viewport-y"&&!x.isConstant(),this.sortFeaturesByY=(C==="viewport-y"||C==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,y.get("symbol-placement")==="point"&&(this.writingModes=y.get("text-writing-mode").map(S=>o.ai[S])),this.stateDependentLayerIds=this.layers.filter(S=>S.isStateDependent()).map(S=>S.id),this.sourceID=s.sourceID}createArrays(){this.text=new zh(new N4(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new zh(new N4(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new we,this.lineVertexArray=new Oe,this.symbolInstances=new pe,this.textAnchorOffsets=new je}calculateGlyphDependencies(s,Q,y,x,C){for(let S=0;S<s.length;S++)if(Q[s.charCodeAt(S)]=!0,(y||x)&&C){const O=O0[s.charAt(S)];O&&(Q[O.charCodeAt(0)]=!0)}}populate(s,Q,y){const x=this.layers[0],C=x.layout,S=C.get("text-font"),O=C.get("text-field"),B=C.get("icon-image"),j=(O.value.kind!=="constant"||O.value.value instanceof z2&&!O.value.value.isEmpty()||O.value.value.toString().length>0)&&(S.value.kind!=="constant"||S.value.value.length>0),q=B.value.kind!=="constant"||!!B.value.value||Object.keys(B.parameters).length>0,X=C.get("symbol-sort-key");if(this.features=[],!j&&!q)return;const Y=Q.iconDependencies,re=Q.glyphDependencies,ae=Q.availableImages,le=new I1(this.zoom);for(const{feature:fe,id:ye,index:He,sourceLayerIndex:ve}of s){const Me=x._featureFilter.needGeometry,De=G6(fe,Me);if(!x._featureFilter.filter(le,De,y))continue;let $e,dt;if(Me||(De.geometry=q6(fe)),j){const Qt=x.getValueAndResolveTokens("text-field",De,y,ae),ct=z2.factory(Qt);MK(ct)&&(this.hasRTLText=!0),(!this.hasRTLText||d0()==="unavailable"||this.hasRTLText&&A3.isParsed())&&($e=lK(ct,x,De))}if(q){const Qt=x.getValueAndResolveTokens("icon-image",De,y,ae);dt=Qt instanceof D2?Qt:D2.fromString(Qt)}if(!$e&&!dt)continue;const wt=this.sortFeaturesByKey?X.evaluate(De,{},y):void 0;if(this.features.push({id:ye,text:$e,icon:dt,index:He,sourceLayerIndex:ve,geometry:De.geometry,properties:fe.properties,type:wK[fe.type],sortKey:wt}),dt&&(Y[dt.name]=!0),$e){const Qt=S.evaluate(De,{},y).join(","),ct=C.get("text-rotation-alignment")!=="viewport"&&C.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.ai.vertical)>=0;for(const ot of $e.sections)if(ot.image)Y[ot.image.name]=!0;else{const xt=o0($e.toString()),st=ot.fontStack||Qt,We=re[st]=re[st]||{};this.calculateGlyphDependencies(ot.text,We,ct,this.allowVerticalPlacement,xt)}}}C.get("symbol-placement")==="line"&&(this.features=function(fe){const ye={},He={},ve=[];let Me=0;function De(Qt){ve.push(fe[Qt]),Me++}function $e(Qt,ct,ot){const xt=He[Qt];return delete He[Qt],He[ct]=xt,ve[xt].geometry[0].pop(),ve[xt].geometry[0]=ve[xt].geometry[0].concat(ot[0]),xt}function dt(Qt,ct,ot){const xt=ye[ct];return delete ye[ct],ye[Qt]=xt,ve[xt].geometry[0].shift(),ve[xt].geometry[0]=ot[0].concat(ve[xt].geometry[0]),xt}function wt(Qt,ct,ot){const xt=ot?ct[0][ct[0].length-1]:ct[0][0];return`${Qt}:${xt.x}:${xt.y}`}for(let Qt=0;Qt<fe.length;Qt++){const ct=fe[Qt],ot=ct.geometry,xt=ct.text?ct.text.toString():null;if(!xt){De(Qt);continue}const st=wt(xt,ot),We=wt(xt,ot,!0);if(st in He&&We in ye&&He[st]!==ye[We]){const Ot=dt(st,We,ot),Ct=$e(st,We,ve[Ot].geometry);delete ye[st],delete He[We],He[wt(xt,ve[Ct].geometry,!0)]=Ct,ve[Ot].geometry=null}else st in He?$e(st,We,ot):We in ye?dt(st,We,ot):(De(Qt),ye[st]=Me-1,He[We]=Me-1)}return ve.filter(Qt=>Qt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((fe,ye)=>fe.sortKey-ye.sortKey)}update(s,Q,y){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,Q,this.layers,y),this.icon.programConfigurations.updatePaintArrays(s,Q,this.layers,y))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,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(s,Q){const y=this.lineVertexArray.length;if(s.segment!==void 0){let x=s.dist(Q[s.segment+1]),C=s.dist(Q[s.segment]);const S={};for(let O=s.segment+1;O<Q.length;O++)S[O]={x:Q[O].x,y:Q[O].y,tileUnitDistanceFromAnchor:x},O<Q.length-1&&(x+=Q[O+1].dist(Q[O]));for(let O=s.segment||0;O>=0;O--)S[O]={x:Q[O].x,y:Q[O].y,tileUnitDistanceFromAnchor:C},O>0&&(C+=Q[O-1].dist(Q[O]));for(let O=0;O<Q.length;O++){const B=S[O];this.lineVertexArray.emplaceBack(B.x,B.y,B.tileUnitDistanceFromAnchor)}}return{lineStartIndex:y,lineLength:this.lineVertexArray.length-y}}addSymbols(s,Q,y,x,C,S,O,B,j,q,X,Y){const re=s.indexArray,ae=s.layoutVertexArray,le=s.segments.prepareSegment(4*Q.length,ae,re,this.canOverlap?S.sortKey:void 0),fe=this.glyphOffsetArray.length,ye=le.vertexLength,He=this.allowVerticalPlacement&&O===o.ai.vertical?Math.PI/2:0,ve=S.text&&S.text.sections;for(let Me=0;Me<Q.length;Me++){const{tl:De,tr:$e,bl:dt,br:wt,tex:Qt,pixelOffsetTL:ct,pixelOffsetBR:ot,minFontScaleX:xt,minFontScaleY:st,glyphOffset:We,isSDF:Ot,sectionIndex:Ct}=Q[Me],i1=le.vertexLength,N1=We[1];z9(ae,B.x,B.y,De.x,N1+De.y,Qt.x,Qt.y,y,Ot,ct.x,ct.y,xt,st),z9(ae,B.x,B.y,$e.x,N1+$e.y,Qt.x+Qt.w,Qt.y,y,Ot,ot.x,ct.y,xt,st),z9(ae,B.x,B.y,dt.x,N1+dt.y,Qt.x,Qt.y+Qt.h,y,Ot,ct.x,ot.y,xt,st),z9(ae,B.x,B.y,wt.x,N1+wt.y,Qt.x+Qt.w,Qt.y+Qt.h,y,Ot,ot.x,ot.y,xt,st),jh(s.dynamicLayoutVertexArray,B,He),re.emplaceBack(i1,i1+1,i1+2),re.emplaceBack(i1+1,i1+2,i1+3),le.vertexLength+=4,le.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(We[0]),Me!==Q.length-1&&Ct===Q[Me+1].sectionIndex||s.programConfigurations.populatePaintArrays(ae.length,S,S.index,{},Y,ve&&ve[Ct])}s.placedSymbolArray.emplaceBack(B.x,B.y,fe,this.glyphOffsetArray.length-fe,ye,j,q,B.segment,y?y[0]:0,y?y[1]:0,x[0],x[1],O,0,!1,0,X)}_addCollisionDebugVertex(s,Q,y,x,C,S){return Q.emplaceBack(0,0),s.emplaceBack(y.x,y.y,x,C,Math.round(S.x),Math.round(S.y))}addCollisionDebugVertices(s,Q,y,x,C,S,O){const B=C.segments.prepareSegment(4,C.layoutVertexArray,C.indexArray),j=B.vertexLength,q=C.layoutVertexArray,X=C.collisionVertexArray,Y=O.anchorX,re=O.anchorY;this._addCollisionDebugVertex(q,X,S,Y,re,new g(s,Q)),this._addCollisionDebugVertex(q,X,S,Y,re,new g(y,Q)),this._addCollisionDebugVertex(q,X,S,Y,re,new g(y,x)),this._addCollisionDebugVertex(q,X,S,Y,re,new g(s,x)),B.vertexLength+=4;const ae=C.indexArray;ae.emplaceBack(j,j+1),ae.emplaceBack(j+1,j+2),ae.emplaceBack(j+2,j+3),ae.emplaceBack(j+3,j),B.primitiveLength+=4}addDebugCollisionBoxes(s,Q,y,x){for(let C=s;C<Q;C++){const S=this.collisionBoxArray.get(C);this.addCollisionDebugVertices(S.x1,S.y1,S.x2,S.y2,x?this.textCollisionBox:this.iconCollisionBox,S.anchorPoint,y)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new $h(n2,aL.members,m2),this.iconCollisionBox=new $h(n2,aL.members,m2);for(let s=0;s<this.symbolInstances.length;s++){const Q=this.symbolInstances.get(s);this.addDebugCollisionBoxes(Q.textBoxStartIndex,Q.textBoxEndIndex,Q,!0),this.addDebugCollisionBoxes(Q.verticalTextBoxStartIndex,Q.verticalTextBoxEndIndex,Q,!0),this.addDebugCollisionBoxes(Q.iconBoxStartIndex,Q.iconBoxEndIndex,Q,!1),this.addDebugCollisionBoxes(Q.verticalIconBoxStartIndex,Q.verticalIconBoxEndIndex,Q,!1)}}_deserializeCollisionBoxesForSymbol(s,Q,y,x,C,S,O,B,j){const q={};for(let X=Q;X<y;X++){const Y=s.get(X);q.textBox={x1:Y.x1,y1:Y.y1,x2:Y.x2,y2:Y.y2,anchorPointX:Y.anchorPointX,anchorPointY:Y.anchorPointY},q.textFeatureIndex=Y.featureIndex;break}for(let X=x;X<C;X++){const Y=s.get(X);q.verticalTextBox={x1:Y.x1,y1:Y.y1,x2:Y.x2,y2:Y.y2,anchorPointX:Y.anchorPointX,anchorPointY:Y.anchorPointY},q.verticalTextFeatureIndex=Y.featureIndex;break}for(let X=S;X<O;X++){const Y=s.get(X);q.iconBox={x1:Y.x1,y1:Y.y1,x2:Y.x2,y2:Y.y2,anchorPointX:Y.anchorPointX,anchorPointY:Y.anchorPointY},q.iconFeatureIndex=Y.featureIndex;break}for(let X=B;X<j;X++){const Y=s.get(X);q.verticalIconBox={x1:Y.x1,y1:Y.y1,x2:Y.x2,y2:Y.y2,anchorPointX:Y.anchorPointX,anchorPointY:Y.anchorPointY},q.verticalIconFeatureIndex=Y.featureIndex;break}return q}deserializeCollisionBoxes(s){this.collisionArrays=[];for(let Q=0;Q<this.symbolInstances.length;Q++){const y=this.symbolInstances.get(Q);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(s,y.textBoxStartIndex,y.textBoxEndIndex,y.verticalTextBoxStartIndex,y.verticalTextBoxEndIndex,y.iconBoxStartIndex,y.iconBoxEndIndex,y.verticalIconBoxStartIndex,y.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}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(s,Q){const y=s.placedSymbolArray.get(Q),x=y.vertexStartIndex+4*y.numGlyphs;for(let C=y.vertexStartIndex;C<x;C+=4)s.indexArray.emplaceBack(C,C+1,C+2),s.indexArray.emplaceBack(C+1,C+2,C+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const Q=Math.sin(s),y=Math.cos(s),x=[],C=[],S=[];for(let O=0;O<this.symbolInstances.length;++O){S.push(O);const B=this.symbolInstances.get(O);x.push(0|Math.round(Q*B.anchorX+y*B.anchorY)),C.push(B.featureIndex)}return S.sort((O,B)=>x[O]-x[B]||C[B]-C[O]),S}addToSortKeyRanges(s,Q){const y=this.sortKeyRanges[this.sortKeyRanges.length-1];y&&y.sortKey===Q?y.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:Q,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const Q of this.symbolInstanceIndexes){const y=this.symbolInstances.get(Q);this.featureSortOrder.push(y.featureIndex),[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex].forEach((x,C,S)=>{x>=0&&S.indexOf(x)===C&&this.addIndicesForPlacedSymbol(this.text,x)}),y.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,y.verticalPlacedTextSymbolIndex),y.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.placedIconSymbolIndex),y.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let xL,LL;_t("SymbolBucket",k5,{omit:["layers","collisionBoxArray","features","compareText"]}),k5.MAX_GLYPHS=65535,k5.addDynamicAttributes=jh;var Zh={get paint(){return LL=LL||new l2({"icon-opacity":new It(Pe.paint_symbol["icon-opacity"]),"icon-color":new It(Pe.paint_symbol["icon-color"]),"icon-halo-color":new It(Pe.paint_symbol["icon-halo-color"]),"icon-halo-width":new It(Pe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new It(Pe.paint_symbol["icon-halo-blur"]),"icon-translate":new St(Pe.paint_symbol["icon-translate"]),"icon-translate-anchor":new St(Pe.paint_symbol["icon-translate-anchor"]),"text-opacity":new It(Pe.paint_symbol["text-opacity"]),"text-color":new It(Pe.paint_symbol["text-color"],{runtimeType:Q2,getOverride:c=>c.textColor,hasOverride:c=>!!c.textColor}),"text-halo-color":new It(Pe.paint_symbol["text-halo-color"]),"text-halo-width":new It(Pe.paint_symbol["text-halo-width"]),"text-halo-blur":new It(Pe.paint_symbol["text-halo-blur"]),"text-translate":new St(Pe.paint_symbol["text-translate"]),"text-translate-anchor":new St(Pe.paint_symbol["text-translate-anchor"])})},get layout(){return xL=xL||new l2({"symbol-placement":new St(Pe.layout_symbol["symbol-placement"]),"symbol-spacing":new St(Pe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new St(Pe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new It(Pe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new St(Pe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new St(Pe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new St(Pe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new St(Pe.layout_symbol["icon-ignore-placement"]),"icon-optional":new St(Pe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new St(Pe.layout_symbol["icon-rotation-alignment"]),"icon-size":new It(Pe.layout_symbol["icon-size"]),"icon-text-fit":new St(Pe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new St(Pe.layout_symbol["icon-text-fit-padding"]),"icon-image":new It(Pe.layout_symbol["icon-image"]),"icon-rotate":new It(Pe.layout_symbol["icon-rotate"]),"icon-padding":new It(Pe.layout_symbol["icon-padding"]),"icon-keep-upright":new St(Pe.layout_symbol["icon-keep-upright"]),"icon-offset":new It(Pe.layout_symbol["icon-offset"]),"icon-anchor":new It(Pe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new St(Pe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new St(Pe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new St(Pe.layout_symbol["text-rotation-alignment"]),"text-field":new It(Pe.layout_symbol["text-field"]),"text-font":new It(Pe.layout_symbol["text-font"]),"text-size":new It(Pe.layout_symbol["text-size"]),"text-max-width":new It(Pe.layout_symbol["text-max-width"]),"text-line-height":new St(Pe.layout_symbol["text-line-height"]),"text-letter-spacing":new It(Pe.layout_symbol["text-letter-spacing"]),"text-justify":new It(Pe.layout_symbol["text-justify"]),"text-radial-offset":new It(Pe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new St(Pe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new It(Pe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new It(Pe.layout_symbol["text-anchor"]),"text-max-angle":new St(Pe.layout_symbol["text-max-angle"]),"text-writing-mode":new St(Pe.layout_symbol["text-writing-mode"]),"text-rotate":new It(Pe.layout_symbol["text-rotate"]),"text-padding":new St(Pe.layout_symbol["text-padding"]),"text-keep-upright":new St(Pe.layout_symbol["text-keep-upright"]),"text-transform":new It(Pe.layout_symbol["text-transform"]),"text-offset":new It(Pe.layout_symbol["text-offset"]),"text-allow-overlap":new St(Pe.layout_symbol["text-allow-overlap"]),"text-overlap":new St(Pe.layout_symbol["text-overlap"]),"text-ignore-placement":new St(Pe.layout_symbol["text-ignore-placement"]),"text-optional":new St(Pe.layout_symbol["text-optional"])})}};class bL{constructor(s){if(s.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:b3,this.defaultValue=s}evaluate(s){if(s.formattedSection){const Q=this.defaultValue.property.overrides;if(Q&&Q.hasOverride(s.formattedSection))return Q.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}_t("FormatSectionOverride",bL,{omit:["defaultValue"]});class $9 extends G3{constructor(s){super(s,Zh)}recalculate(s,Q){if(super.recalculate(s,Q),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 y=this.layout.get("text-writing-mode");if(y){const x=[];for(const C of y)x.indexOf(C)<0&&x.push(C);this.layout._values["text-writing-mode"]=x}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,Q,y,x){const C=this.layout.get(s).evaluate(Q,{},y,x),S=this._unevaluatedLayout._values[s];return S.isDataDriven()||f5(S.value)||!C?C:function(O,B){return B.replace(/{([^{}]+)}/g,(j,q)=>O&&q in O?String(O[q]):"")}(Q.properties,C)}createBucket(s){return new k5(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of Zh.paint.overridableProperties){if(!$9.hasPaintOverride(this.layout,s))continue;const Q=this.paint.get(s),y=new bL(Q),x=new e0(y,Q.property.specification);let C=null;C=Q.value.kind==="constant"||Q.value.kind==="source"?new t0("source",x):new m5("composite",x,Q.value.zoomStops),this.paint._values[s]=new J2(Q.property,C,Q.parameters)}}_handleOverridablePaintPropertyUpdate(s,Q,y){return!(!this.layout||Q.isDataDriven()||y.isDataDriven())&&$9.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,Q){const y=s.get("text-field"),x=Zh.paint.properties[Q];let C=!1;const S=O=>{for(const B of O)if(x.overrides&&x.overrides.hasOverride(B))return void(C=!0)};if(y.value.kind==="constant"&&y.value.value instanceof z2)S(y.value.value.sections);else if(y.value.kind==="source"){const O=j=>{C||(j instanceof Nr&&Z1(j.value)===ne?S(j.value.sections):j instanceof d5?S(j.sections):j.eachChild(O))},B=y.value;B._styleExpression&&O(B._styleExpression.expression)}return C}}let wL;var CK={get paint(){return wL=wL||new l2({"background-color":new St(Pe.paint_background["background-color"]),"background-pattern":new p0(Pe.paint_background["background-pattern"]),"background-opacity":new St(Pe.paint_background["background-opacity"])})}};class AK extends G3{constructor(s){super(s,CK)}}let HL;var SK={get paint(){return HL=HL||new l2({"raster-opacity":new St(Pe.paint_raster["raster-opacity"]),"raster-hue-rotate":new St(Pe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new St(Pe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new St(Pe.paint_raster["raster-brightness-max"]),"raster-saturation":new St(Pe.paint_raster["raster-saturation"]),"raster-contrast":new St(Pe.paint_raster["raster-contrast"]),"raster-resampling":new St(Pe.paint_raster["raster-resampling"]),"raster-fade-duration":new St(Pe.paint_raster["raster-fade-duration"])})}};class EK extends G3{constructor(s){super(s,SK)}}class VK extends G3{constructor(s){super(s,{}),this.onAdd=Q=>{this.implementation.onAdd&&this.implementation.onAdd(Q,Q.painter.context.gl)},this.onRemove=Q=>{this.implementation.onRemove&&this.implementation.onRemove(Q,Q.painter.context.gl)},this.implementation=s}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 DK{constructor(s){this._callback=s,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const qh=63710088e-1;class Un{constructor(s,Q){if(isNaN(s)||isNaN(Q))throw new Error(`Invalid LngLat object: (${s}, ${Q})`);if(this.lng=+s,this.lat=+Q,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Un(Z(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const Q=Math.PI/180,y=this.lat*Q,x=s.lat*Q,C=Math.sin(y)*Math.sin(x)+Math.cos(y)*Math.cos(x)*Math.cos((s.lng-this.lng)*Q);return qh*Math.acos(Math.min(C,1))}static convert(s){if(s instanceof Un)return s;if(Array.isArray(s)&&(s.length===2||s.length===3))return new Un(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&typeof s=="object"&&s!==null)return new Un(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const ML=2*Math.PI*qh;function CL(c){return ML*Math.cos(c*Math.PI/180)}function AL(c){return(180+c)/360}function SL(c){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360}function EL(c,s){return c/CL(s)}function VL(c){return 360*c-180}function Gh(c){return 360/Math.PI*Math.atan(Math.exp((180-360*c)*Math.PI/180))-90}class Z9{constructor(s,Q,y=0){this.x=+s,this.y=+Q,this.z=+y}static fromLngLat(s,Q=0){const y=Un.convert(s);return new Z9(AL(y.lng),SL(y.lat),EL(Q,y.lat))}toLngLat(){return new Un(VL(this.x),Gh(this.y))}toAltitude(){return this.z*CL(Gh(this.y))}meterInMercatorCoordinateUnits(){return 1/ML*(s=Gh(this.y),1/Math.cos(s*Math.PI/180));var s}}function DL(c,s,Q){var y=2*Math.PI*6378137/256/Math.pow(2,Q);return[c*y-2*Math.PI*6378137/2,s*y-2*Math.PI*6378137/2]}class Uh{constructor(s,Q,y){if(s<0||s>25||y<0||y>=Math.pow(2,s)||Q<0||Q>=Math.pow(2,s))throw new Error(`x=${Q}, y=${y}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=Q,this.y=y,this.key=B0(0,s,s,Q,y)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,Q,y){const x=(S=this.y,O=this.z,B=DL(256*(C=this.x),256*(S=Math.pow(2,O)-S-1),O),j=DL(256*(C+1),256*(S+1),O),B[0]+","+B[1]+","+j[0]+","+j[1]);var C,S,O,B,j;const q=function(X,Y,re){let ae,le="";for(let fe=X;fe>0;fe--)ae=1<<fe-1,le+=(Y&ae?1:0)+(re&ae?2:0);return le}(this.z,this.x,this.y);return s[(this.x+this.y)%s.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(y==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,Q>1?"@2x":"").replace(/{quadkey}/g,q).replace(/{bbox-epsg-3857}/g,x)}isChildOf(s){const Q=this.z-s.z;return Q>0&&s.x===this.x>>Q&&s.y===this.y>>Q}getTilePoint(s){const Q=Math.pow(2,this.z);return new g((s.x*Q-this.x)*h2,(s.y*Q-this.y)*h2)}toString(){return`${this.z}/${this.x}/${this.y}`}}class OL{constructor(s,Q){this.wrap=s,this.canonical=Q,this.key=B0(s,Q.z,Q.z,Q.x,Q.y)}}class n4{constructor(s,Q,y,x,C){if(s<y)throw new Error(`overscaledZ should be >= z; overscaledZ = ${s}; z = ${y}`);this.overscaledZ=s,this.wrap=Q,this.canonical=new Uh(y,+x,+C),this.key=B0(Q,s,y,x,C)}clone(){return new n4(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const Q=this.canonical.z-s;return s>this.canonical.z?new n4(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new n4(s,this.wrap,s,this.canonical.x>>Q,this.canonical.y>>Q)}calculateScaledKey(s,Q){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const y=this.canonical.z-s;return s>this.canonical.z?B0(this.wrap*+Q,s,this.canonical.z,this.canonical.x,this.canonical.y):B0(this.wrap*+Q,s,s,this.canonical.x>>y,this.canonical.y>>y)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const Q=this.canonical.z-s.canonical.z;return s.overscaledZ===0||s.overscaledZ<this.overscaledZ&&s.canonical.x===this.canonical.x>>Q&&s.canonical.y===this.canonical.y>>Q}children(s){if(this.overscaledZ>=s)return[new n4(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const Q=this.canonical.z+1,y=2*this.canonical.x,x=2*this.canonical.y;return[new n4(Q,this.wrap,Q,y,x),new n4(Q,this.wrap,Q,y+1,x),new n4(Q,this.wrap,Q,y,x+1),new n4(Q,this.wrap,Q,y+1,x+1)]}isLessThan(s){return this.wrap<s.wrap||!(this.wrap>s.wrap)&&(this.overscaledZ<s.overscaledZ||!(this.overscaledZ>s.overscaledZ)&&(this.canonical.x<s.canonical.x||!(this.canonical.x>s.canonical.x)&&this.canonical.y<s.canonical.y))}wrapped(){return new n4(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(s){return new n4(this.overscaledZ,s,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new OL(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(s){return this.canonical.getTilePoint(new Z9(s.x-this.wrap,s.y))}}function B0(c,s,Q,y,x){(c*=2)<0&&(c=-1*c-1);const C=1<<Q;return(C*C*c+C*x+y).toString(36)+Q.toString(36)+s.toString(36)}_t("CanonicalTileID",Uh),_t("OverscaledTileID",n4,{omit:["posMatrix"]});class kL{constructor(s,Q,y,x=1,C=1,S=1,O=0){if(this.uid=s,Q.height!==Q.width)throw new RangeError("DEM tiles must be square");if(y&&!["mapbox","terrarium","custom"].includes(y))return void Re(`"${y}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=Q.height;const B=this.dim=Q.height-2;switch(this.data=new Uint32Array(Q.data.buffer),y){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=x,this.greenFactor=C,this.blueFactor=S,this.baseShift=O;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let j=0;j<B;j++)this.data[this._idx(-1,j)]=this.data[this._idx(0,j)],this.data[this._idx(B,j)]=this.data[this._idx(B-1,j)],this.data[this._idx(j,-1)]=this.data[this._idx(j,0)],this.data[this._idx(j,B)]=this.data[this._idx(j,B-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(B,-1)]=this.data[this._idx(B-1,0)],this.data[this._idx(-1,B)]=this.data[this._idx(0,B-1)],this.data[this._idx(B,B)]=this.data[this._idx(B-1,B-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let j=0;j<B;j++)for(let q=0;q<B;q++){const X=this.get(j,q);X>this.max&&(this.max=X),X<this.min&&(this.min=X)}}get(s,Q){const y=new Uint8Array(this.data.buffer),x=4*this._idx(s,Q);return this.unpack(y[x],y[x+1],y[x+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(s,Q){if(s<-1||s>=this.dim+1||Q<-1||Q>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(Q+1)*this.stride+(s+1)}unpack(s,Q,y){return s*this.redFactor+Q*this.greenFactor+y*this.blueFactor-this.baseShift}getPixels(){return new r4({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,Q,y){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let x=Q*this.dim,C=Q*this.dim+this.dim,S=y*this.dim,O=y*this.dim+this.dim;switch(Q){case-1:x=C-1;break;case 1:C=x+1}switch(y){case-1:S=O-1;break;case 1:O=S+1}const B=-Q*this.dim,j=-y*this.dim;for(let q=S;q<O;q++)for(let X=x;X<C;X++)this.data[this._idx(X,q)]=s.data[this._idx(X+B,q+j)]}}_t("DEMData",kL);class PL{constructor(s){this._stringToNumber={},this._numberToString=[];for(let Q=0;Q<s.length;Q++){const y=s[Q];this._stringToNumber[y]=Q,this._numberToString[Q]=y}}encode(s){return this._stringToNumber[s]}decode(s){if(s>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class IL{constructor(s,Q,y,x,C){this.type="Feature",this._vectorTileFeature=s,s._z=Q,s._x=y,s._y=x,this.properties=s.properties,this.id=C}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(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const Q in this)Q!=="_geometry"&&Q!=="_vectorTileFeature"&&(s[Q]=this[Q]);return s}}class BL{constructor(s,Q){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new Fn(h2,16,0),this.grid3D=new Fn(h2,16,0),this.featureIndexArray=new Ge,this.promoteId=Q}insert(s,Q,y,x,C,S){const O=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(y,x,C);const B=S?this.grid3D:this.grid;for(let j=0;j<Q.length;j++){const q=Q[j],X=[1/0,1/0,-1/0,-1/0];for(let Y=0;Y<q.length;Y++){const re=q[Y];X[0]=Math.min(X[0],re.x),X[1]=Math.min(X[1],re.y),X[2]=Math.max(X[2],re.x),X[3]=Math.max(X[3],re.y)}X[0]<h2&&X[1]<h2&&X[2]>=0&&X[3]>=0&&B.insert(O,X[0],X[1],X[2],X[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Zn.VectorTile(new Ph(this.rawTileData)).layers,this.sourceLayerCoder=new PL(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,Q,y,x){this.loadVTLayers();const C=s.params||{},S=h2/s.tileSize/s.scale,O=n0(C.filter),B=s.queryGeometry,j=s.queryPadding*S,q=FL(B),X=this.grid.query(q.minX-j,q.minY-j,q.maxX+j,q.maxY+j),Y=FL(s.cameraQueryGeometry),re=this.grid3D.query(Y.minX-j,Y.minY-j,Y.maxX+j,Y.maxY+j,(fe,ye,He,ve)=>function(Me,De,$e,dt,wt){for(const ct of Me)if(De<=ct.x&&$e<=ct.y&&dt>=ct.x&&wt>=ct.y)return!0;const Qt=[new g(De,$e),new g(De,wt),new g(dt,wt),new g(dt,$e)];if(Me.length>2){for(const ct of Qt)if(C5(Me,ct))return!0}for(let ct=0;ct<Me.length-1;ct++)if(QX(Me[ct],Me[ct+1],Qt))return!0;return!1}(s.cameraQueryGeometry,fe-j,ye-j,He+j,ve+j));for(const fe of re)X.push(fe);X.sort(OK);const ae={};let le;for(let fe=0;fe<X.length;fe++){const ye=X[fe];if(ye===le)continue;le=ye;const He=this.featureIndexArray.get(ye);let ve=null;this.loadMatchingFeature(ae,He.bucketIndex,He.sourceLayerIndex,He.featureIndex,O,C.layers,C.availableImages,Q,y,x,(Me,De,$e)=>(ve||(ve=q6(Me)),De.queryIntersectsFeature(B,Me,$e,ve,this.z,s.transform,S,s.pixelPosMatrix)))}return ae}loadMatchingFeature(s,Q,y,x,C,S,O,B,j,q,X){const Y=this.bucketLayerIDs[Q];if(S&&!function(fe,ye){for(let He=0;He<fe.length;He++)if(ye.indexOf(fe[He])>=0)return!0;return!1}(S,Y))return;const re=this.sourceLayerCoder.decode(y),ae=this.vtLayers[re].feature(x);if(C.needGeometry){const fe=G6(ae,!0);if(!C.filter(new I1(this.tileID.overscaledZ),fe,this.tileID.canonical))return}else if(!C.filter(new I1(this.tileID.overscaledZ),ae))return;const le=this.getId(ae,re);for(let fe=0;fe<Y.length;fe++){const ye=Y[fe];if(S&&S.indexOf(ye)<0)continue;const He=B[ye];if(!He)continue;let ve={};le&&q&&(ve=q.getState(He.sourceLayer||"_geojsonTileLayer",le));const Me=K({},j[ye]);Me.paint=NL(Me.paint,He.paint,ae,ve,O),Me.layout=NL(Me.layout,He.layout,ae,ve,O);const De=!X||X(ae,He,ve);if(!De)continue;const $e=new IL(ae,this.z,this.x,this.y,le);$e.layer=Me;let dt=s[ye];dt===void 0&&(dt=s[ye]=[]),dt.push({featureIndex:x,feature:$e,intersectionZ:De})}}lookupSymbolFeatures(s,Q,y,x,C,S,O,B){const j={};this.loadVTLayers();const q=n0(C);for(const X of s)this.loadMatchingFeature(j,y,x,X,q,S,O,B,Q);return j}hasLayer(s){for(const Q of this.bucketLayerIDs)for(const y of Q)if(s===y)return!0;return!1}getId(s,Q){let y=s.id;return this.promoteId&&(y=s.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[Q]],typeof y=="boolean"&&(y=Number(y))),y}}function NL(c,s,Q,y,x){return ie(c,(C,S)=>{const O=s instanceof H5?s.get(S):null;return O&&O.evaluate?O.evaluate(Q,y,x):O})}function FL(c){let s=1/0,Q=1/0,y=-1/0,x=-1/0;for(const C of c)s=Math.min(s,C.x),Q=Math.min(Q,C.y),y=Math.max(y,C.x),x=Math.max(x,C.y);return{minX:s,minY:Q,maxX:y,maxY:x}}function OK(c,s){return s-c}function RL(c,s,Q,y,x){const C=[];for(let S=0;S<c.length;S++){const O=c[S];let B;for(let j=0;j<O.length-1;j++){let q=O[j],X=O[j+1];q.x<s&&X.x<s||(q.x<s?q=new g(s,q.y+(s-q.x)/(X.x-q.x)*(X.y-q.y))._round():X.x<s&&(X=new g(s,q.y+(s-q.x)/(X.x-q.x)*(X.y-q.y))._round()),q.y<Q&&X.y<Q||(q.y<Q?q=new g(q.x+(Q-q.y)/(X.y-q.y)*(X.x-q.x),Q)._round():X.y<Q&&(X=new g(q.x+(Q-q.y)/(X.y-q.y)*(X.x-q.x),Q)._round()),q.x>=y&&X.x>=y||(q.x>=y?q=new g(y,q.y+(y-q.x)/(X.x-q.x)*(X.y-q.y))._round():X.x>=y&&(X=new g(y,q.y+(y-q.x)/(X.x-q.x)*(X.y-q.y))._round()),q.y>=x&&X.y>=x||(q.y>=x?q=new g(q.x+(x-q.y)/(X.y-q.y)*(X.x-q.x),x)._round():X.y>=x&&(X=new g(q.x+(x-q.y)/(X.y-q.y)*(X.x-q.x),x)._round()),B&&q.equals(B[B.length-1])||(B=[q],C.push(B)),B.push(X)))))}}return C}_t("FeatureIndex",BL,{omit:["rawTileData","sourceLayerCoder"]});class Wn extends g{constructor(s,Q,y,x){super(s,Q),this.angle=y,x!==void 0&&(this.segment=x)}clone(){return new Wn(this.x,this.y,this.angle,this.segment)}}function jL(c,s,Q,y,x){if(s.segment===void 0||Q===0)return!0;let C=s,S=s.segment+1,O=0;for(;O>-Q/2;){if(S--,S<0)return!1;O-=c[S].dist(C),C=c[S]}O+=c[S].dist(c[S+1]),S++;const B=[];let j=0;for(;O<Q/2;){const q=c[S],X=c[S+1];if(!X)return!1;let Y=c[S-1].angleTo(q)-q.angleTo(X);for(Y=Math.abs((Y+3*Math.PI)%(2*Math.PI)-Math.PI),B.push({distance:O,angleDelta:Y}),j+=Y;O-B[0].distance>y;)j-=B.shift().angleDelta;if(j>x)return!1;S++,O+=q.dist(X)}return!0}function zL(c){let s=0;for(let Q=0;Q<c.length-1;Q++)s+=c[Q].dist(c[Q+1]);return s}function $L(c,s,Q){return c?.6*s*Q:0}function ZL(c,s){return Math.max(c?c.right-c.left:0,s?s.right-s.left:0)}function kK(c,s,Q,y,x,C){const S=$L(Q,x,C),O=ZL(Q,y)*C;let B=0;const j=zL(c)/2;for(let q=0;q<c.length-1;q++){const X=c[q],Y=c[q+1],re=X.dist(Y);if(B+re>j){const ae=(j-B)/re,le=H3.number(X.x,Y.x,ae),fe=H3.number(X.y,Y.y,ae),ye=new Wn(le,fe,Y.angleTo(X),q);return ye._round(),!S||jL(c,ye,O,S,s)?ye:void 0}B+=re}}function PK(c,s,Q,y,x,C,S,O,B){const j=$L(y,C,S),q=ZL(y,x),X=q*S,Y=c[0].x===0||c[0].x===B||c[0].y===0||c[0].y===B;return s-X<s/4&&(s=X+s/4),qL(c,Y?s/2*O%s:(q/2+2*C)*S*O%s,s,j,Q,X,Y,!1,B)}function qL(c,s,Q,y,x,C,S,O,B){const j=C/2,q=zL(c);let X=0,Y=s-Q,re=[];for(let ae=0;ae<c.length-1;ae++){const le=c[ae],fe=c[ae+1],ye=le.dist(fe),He=fe.angleTo(le);for(;Y+Q<X+ye;){Y+=Q;const ve=(Y-X)/ye,Me=H3.number(le.x,fe.x,ve),De=H3.number(le.y,fe.y,ve);if(Me>=0&&Me<B&&De>=0&&De<B&&Y-j>=0&&Y+j<=q){const $e=new Wn(Me,De,He,ae);$e._round(),y&&!jL(c,$e,C,y,x)||re.push($e)}}X+=ye}return O||re.length||S||(re=qL(c,X/2,Q,y,x,C,S,!0,B)),re}_t("Anchor",Wn);const P5=E3;function GL(c,s,Q,y){const x=[],C=c.image,S=C.pixelRatio,O=C.paddedRect.w-2*P5,B=C.paddedRect.h-2*P5,j=c.right-c.left,q=c.bottom-c.top,X=C.stretchX||[[0,O]],Y=C.stretchY||[[0,B]],re=(ot,xt)=>ot+xt[1]-xt[0],ae=X.reduce(re,0),le=Y.reduce(re,0),fe=O-ae,ye=B-le;let He=0,ve=ae,Me=0,De=le,$e=0,dt=fe,wt=0,Qt=ye;if(C.content&&y){const ot=C.content;He=q9(X,0,ot[0]),Me=q9(Y,0,ot[1]),ve=q9(X,ot[0],ot[2]),De=q9(Y,ot[1],ot[3]),$e=ot[0]-He,wt=ot[1]-Me,dt=ot[2]-ot[0]-ve,Qt=ot[3]-ot[1]-De}const ct=(ot,xt,st,We)=>{const Ot=G9(ot.stretch-He,ve,j,c.left),Ct=U9(ot.fixed-$e,dt,ot.stretch,ae),i1=G9(xt.stretch-Me,De,q,c.top),N1=U9(xt.fixed-wt,Qt,xt.stretch,le),$1=G9(st.stretch-He,ve,j,c.left),_2=U9(st.fixed-$e,dt,st.stretch,ae),W3=G9(We.stretch-Me,De,q,c.top),f3=U9(We.fixed-wt,Qt,We.stretch,le),d2=new g(Ot,i1),P2=new g($1,i1),q2=new g($1,W3),p3=new g(Ot,W3),m3=new g(Ct/S,N1/S),v2=new g(_2/S,f3/S),x2=s*Math.PI/180;if(x2){const t3=Math.sin(x2),V3=Math.cos(x2),D3=[V3,-t3,t3,V3];d2._matMult(D3),P2._matMult(D3),p3._matMult(D3),q2._matMult(D3)}const e3=ot.stretch+ot.fixed,y3=xt.stretch+xt.fixed;return{tl:d2,tr:P2,bl:p3,br:q2,tex:{x:C.paddedRect.x+P5+e3,y:C.paddedRect.y+P5+y3,w:st.stretch+st.fixed-e3,h:We.stretch+We.fixed-y3},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:m3,pixelOffsetBR:v2,minFontScaleX:dt/S/j,minFontScaleY:Qt/S/q,isSDF:Q}};if(y&&(C.stretchX||C.stretchY)){const ot=UL(X,fe,ae),xt=UL(Y,ye,le);for(let st=0;st<ot.length-1;st++){const We=ot[st],Ot=ot[st+1];for(let Ct=0;Ct<xt.length-1;Ct++)x.push(ct(We,xt[Ct],Ot,xt[Ct+1]))}}else x.push(ct({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:O+1},{fixed:0,stretch:B+1}));return x}function q9(c,s,Q){let y=0;for(const x of c)y+=Math.max(s,Math.min(Q,x[1]))-Math.max(s,Math.min(Q,x[0]));return y}function UL(c,s,Q){const y=[{fixed:-P5,stretch:0}];for(const[x,C]of c){const S=y[y.length-1];y.push({fixed:x-S.stretch,stretch:S.stretch}),y.push({fixed:x-S.stretch,stretch:S.stretch+(C-x)})}return y.push({fixed:s+P5,stretch:Q}),y}function G9(c,s,Q,y){return c/s*Q+y}function U9(c,s,Q,y){return c-s*Q/y}class W9{constructor(s,Q,y,x,C,S,O,B,j,q){if(this.boxStartIndex=s.length,j){let X=S.top,Y=S.bottom;const re=S.collisionPadding;re&&(X-=re[1],Y+=re[3]);let ae=Y-X;ae>0&&(ae=Math.max(10,ae),this.circleDiameter=ae)}else{let X=S.top*O-B[0],Y=S.bottom*O+B[2],re=S.left*O-B[3],ae=S.right*O+B[1];const le=S.collisionPadding;if(le&&(re-=le[0]*O,X-=le[1]*O,ae+=le[2]*O,Y+=le[3]*O),q){const fe=new g(re,X),ye=new g(ae,X),He=new g(re,Y),ve=new g(ae,Y),Me=q*Math.PI/180;fe._rotate(Me),ye._rotate(Me),He._rotate(Me),ve._rotate(Me),re=Math.min(fe.x,ye.x,He.x,ve.x),ae=Math.max(fe.x,ye.x,He.x,ve.x),X=Math.min(fe.y,ye.y,He.y,ve.y),Y=Math.max(fe.y,ye.y,He.y,ve.y)}s.emplaceBack(Q.x,Q.y,re,X,ae,Y,y,x,C)}this.boxEndIndex=s.length}}class IK{constructor(s=[],Q=BK){if(this.data=s,this.length=this.data.length,this.compare=Q,this.length>0)for(let y=(this.length>>1)-1;y>=0;y--)this._down(y)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const s=this.data[0],Q=this.data.pop();return this.length--,this.length>0&&(this.data[0]=Q,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:Q,compare:y}=this,x=Q[s];for(;s>0;){const C=s-1>>1,S=Q[C];if(y(x,S)>=0)break;Q[s]=S,s=C}Q[s]=x}_down(s){const{data:Q,compare:y}=this,x=this.length>>1,C=Q[s];for(;s<x;){let S=1+(s<<1),O=Q[S];const B=S+1;if(B<this.length&&y(Q[B],O)<0&&(S=B,O=Q[B]),y(O,C)>=0)break;Q[s]=O,s=S}Q[s]=C}}function BK(c,s){return c<s?-1:c>s?1:0}function NK(c,s=1,Q=!1){let y=1/0,x=1/0,C=-1/0,S=-1/0;const O=c[0];for(let re=0;re<O.length;re++){const ae=O[re];(!re||ae.x<y)&&(y=ae.x),(!re||ae.y<x)&&(x=ae.y),(!re||ae.x>C)&&(C=ae.x),(!re||ae.y>S)&&(S=ae.y)}const B=Math.min(C-y,S-x);let j=B/2;const q=new IK([],FK);if(B===0)return new g(y,x);for(let re=y;re<C;re+=B)for(let ae=x;ae<S;ae+=B)q.push(new I5(re+j,ae+j,j,c));let X=function(re){let ae=0,le=0,fe=0;const ye=re[0];for(let He=0,ve=ye.length,Me=ve-1;He<ve;Me=He++){const De=ye[He],$e=ye[Me],dt=De.x*$e.y-$e.x*De.y;le+=(De.x+$e.x)*dt,fe+=(De.y+$e.y)*dt,ae+=3*dt}return new I5(le/ae,fe/ae,0,re)}(c),Y=q.length;for(;q.length;){const re=q.pop();(re.d>X.d||!X.d)&&(X=re,Q&&console.log("found best %d after %d probes",Math.round(1e4*re.d)/1e4,Y)),re.max-X.d<=s||(j=re.h/2,q.push(new I5(re.p.x-j,re.p.y-j,j,c)),q.push(new I5(re.p.x+j,re.p.y-j,j,c)),q.push(new I5(re.p.x-j,re.p.y+j,j,c)),q.push(new I5(re.p.x+j,re.p.y+j,j,c)),Y+=4)}return Q&&(console.log(`num probes: ${Y}`),console.log(`best distance: ${X.d}`)),X.p}function FK(c,s){return s.max-c.max}function I5(c,s,Q,y){this.p=new g(c,s),this.h=Q,this.d=function(x,C){let S=!1,O=1/0;for(let B=0;B<C.length;B++){const j=C[B];for(let q=0,X=j.length,Y=X-1;q<X;Y=q++){const re=j[q],ae=j[Y];re.y>x.y!=ae.y>x.y&&x.x<(ae.x-re.x)*(x.y-re.y)/(ae.y-re.y)+re.x&&(S=!S),O=Math.min(O,Sx(x,re,ae))}}return(S?1:-1)*Math.sqrt(O)}(this.p,y),this.max=this.d+this.h*Math.SQRT2}var Z2;o.aq=void 0,(Z2=o.aq||(o.aq={}))[Z2.center=1]="center",Z2[Z2.left=2]="left",Z2[Z2.right=3]="right",Z2[Z2.top=4]="top",Z2[Z2.bottom=5]="bottom",Z2[Z2["top-left"]=6]="top-left",Z2[Z2["top-right"]=7]="top-right",Z2[Z2["bottom-left"]=8]="bottom-left",Z2[Z2["bottom-right"]=9]="bottom-right";const Xn=7,Wh=Number.POSITIVE_INFINITY;function WL(c,s){return s[1]!==Wh?function(Q,y,x){let C=0,S=0;switch(y=Math.abs(y),x=Math.abs(x),Q){case"top-right":case"top-left":case"top":S=x-Xn;break;case"bottom-right":case"bottom-left":case"bottom":S=-x+Xn}switch(Q){case"top-right":case"bottom-right":case"right":C=-y;break;case"top-left":case"bottom-left":case"left":C=y}return[C,S]}(c,s[0],s[1]):function(Q,y){let x=0,C=0;y<0&&(y=0);const S=y/Math.SQRT2;switch(Q){case"top-right":case"top-left":C=S-Xn;break;case"bottom-right":case"bottom-left":C=-S+Xn;break;case"bottom":C=-y+Xn;break;case"top":C=y-Xn}switch(Q){case"top-right":case"bottom-right":x=-S;break;case"top-left":case"bottom-left":x=S;break;case"left":x=y;break;case"right":x=-y}return[x,C]}(c,s[0])}function XL(c,s,Q){var y;const x=c.layout,C=(y=x.get("text-variable-anchor-offset"))===null||y===void 0?void 0:y.evaluate(s,{},Q);if(C){const O=C.values,B=[];for(let j=0;j<O.length;j+=2){const q=B[j]=O[j],X=O[j+1].map(Y=>Y*g2);q.startsWith("top")?X[1]-=Xn:q.startsWith("bottom")&&(X[1]+=Xn),B[j+1]=X}return new z3(B)}const S=x.get("text-variable-anchor");if(S){let O;O=c._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[x.get("text-radial-offset").evaluate(s,{},Q)*g2,Wh]:x.get("text-offset").evaluate(s,{},Q).map(j=>j*g2);const B=[];for(const j of S)B.push(j,WL(j,O));return new z3(B)}return null}function Xh(c){switch(c){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function RK(c,s,Q,y,x,C,S,O,B,j,q){let X=C.textMaxSize.evaluate(s,{});X===void 0&&(X=S);const Y=c.layers[0].layout,re=Y.get("icon-offset").evaluate(s,{},q),ae=JL(Q.horizontal),le=S/24,fe=c.tilePixelRatio*le,ye=c.tilePixelRatio*X/24,He=c.tilePixelRatio*O,ve=c.tilePixelRatio*Y.get("symbol-spacing"),Me=Y.get("text-padding")*c.tilePixelRatio,De=function(We,Ot,Ct,i1=1){const N1=We.get("icon-padding").evaluate(Ot,{},Ct),$1=N1&&N1.values;return[$1[0]*i1,$1[1]*i1,$1[2]*i1,$1[3]*i1]}(Y,s,q,c.tilePixelRatio),$e=Y.get("text-max-angle")/180*Math.PI,dt=Y.get("text-rotation-alignment")!=="viewport"&&Y.get("symbol-placement")!=="point",wt=Y.get("icon-rotation-alignment")==="map"&&Y.get("symbol-placement")!=="point",Qt=Y.get("symbol-placement"),ct=ve/2,ot=Y.get("icon-text-fit");let xt;y&&ot!=="none"&&(c.allowVerticalPlacement&&Q.vertical&&(xt=_L(y,Q.vertical,ot,Y.get("icon-text-fit-padding"),re,le)),ae&&(y=_L(y,ae,ot,Y.get("icon-text-fit-padding"),re,le)));const st=(We,Ot)=>{Ot.x<0||Ot.x>=h2||Ot.y<0||Ot.y>=h2||function(Ct,i1,N1,$1,_2,W3,f3,d2,P2,q2,p3,m3,v2,x2,e3,y3,t3,V3,D3,L2,l1,r3,G2,b2,g4){const F4=Ct.addToLineVertexArray(i1,N1);let R4,Jr,_4,i4,O3=0,Yr=0,R0=0,rb=0,id=-1,ad=-1;const en={};let nb=Ur("");if(Ct.allowVerticalPlacement&&$1.vertical){const n3=d2.layout.get("text-rotate").evaluate(l1,{},b2)+90;_4=new W9(P2,i1,q2,p3,m3,$1.vertical,v2,x2,e3,n3),f3&&(i4=new W9(P2,i1,q2,p3,m3,f3,t3,V3,e3,n3))}if(_2){const n3=d2.layout.get("icon-rotate").evaluate(l1,{}),a4=d2.layout.get("icon-text-fit")!=="none",W6=GL(_2,n3,G2,a4),z4=f3?GL(f3,n3,G2,a4):void 0;Jr=new W9(P2,i1,q2,p3,m3,_2,t3,V3,!1,n3),O3=4*W6.length;const X6=Ct.iconSizeData;let pr=null;X6.kind==="source"?(pr=[fr*d2.layout.get("icon-size").evaluate(l1,{})],pr[0]>Gn&&Re(`${Ct.layerIds[0]}: Value for "icon-size" is >= ${I0}. Reduce your "icon-size".`)):X6.kind==="composite"&&(pr=[fr*r3.compositeIconSizes[0].evaluate(l1,{},b2),fr*r3.compositeIconSizes[1].evaluate(l1,{},b2)],(pr[0]>Gn||pr[1]>Gn)&&Re(`${Ct.layerIds[0]}: Value for "icon-size" is >= ${I0}. Reduce your "icon-size".`)),Ct.addSymbols(Ct.icon,W6,pr,L2,D3,l1,o.ai.none,i1,F4.lineStartIndex,F4.lineLength,-1,b2),id=Ct.icon.placedSymbolArray.length-1,z4&&(Yr=4*z4.length,Ct.addSymbols(Ct.icon,z4,pr,L2,D3,l1,o.ai.vertical,i1,F4.lineStartIndex,F4.lineLength,-1,b2),ad=Ct.icon.placedSymbolArray.length-1)}const ib=Object.keys($1.horizontal);for(const n3 of ib){const a4=$1.horizontal[n3];if(!R4){nb=Ur(a4.text);const z4=d2.layout.get("text-rotate").evaluate(l1,{},b2);R4=new W9(P2,i1,q2,p3,m3,a4,v2,x2,e3,z4)}const W6=a4.positionedLines.length===1;if(R0+=KL(Ct,i1,a4,W3,d2,e3,l1,y3,F4,$1.vertical?o.ai.horizontal:o.ai.horizontalOnly,W6?ib:[n3],en,id,r3,b2),W6)break}$1.vertical&&(rb+=KL(Ct,i1,$1.vertical,W3,d2,e3,l1,y3,F4,o.ai.vertical,["vertical"],en,ad,r3,b2));const $K=R4?R4.boxStartIndex:Ct.collisionBoxArray.length,ZK=R4?R4.boxEndIndex:Ct.collisionBoxArray.length,qK=_4?_4.boxStartIndex:Ct.collisionBoxArray.length,GK=_4?_4.boxEndIndex:Ct.collisionBoxArray.length,UK=Jr?Jr.boxStartIndex:Ct.collisionBoxArray.length,WK=Jr?Jr.boxEndIndex:Ct.collisionBoxArray.length,XK=i4?i4.boxStartIndex:Ct.collisionBoxArray.length,KK=i4?i4.boxEndIndex:Ct.collisionBoxArray.length;let j4=-1;const K9=(n3,a4)=>n3&&n3.circleDiameter?Math.max(n3.circleDiameter,a4):a4;j4=K9(R4,j4),j4=K9(_4,j4),j4=K9(Jr,j4),j4=K9(i4,j4);const ab=j4>-1?1:0;ab&&(j4*=g4/g2),Ct.glyphOffsetArray.length>=k5.MAX_GLYPHS&&Re("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),l1.sortKey!==void 0&&Ct.addToSortKeyRanges(Ct.symbolInstances.length,l1.sortKey);const JK=XL(d2,l1,b2),[YK,eJ]=function(n3,a4){const W6=n3.length,z4=a4==null?void 0:a4.values;if((z4==null?void 0:z4.length)>0)for(let X6=0;X6<z4.length;X6+=2){const pr=z4[X6+1];n3.emplaceBack(o.aq[z4[X6]],pr[0],pr[1])}return[W6,n3.length]}(Ct.textAnchorOffsets,JK);Ct.symbolInstances.emplaceBack(i1.x,i1.y,en.right>=0?en.right:-1,en.center>=0?en.center:-1,en.left>=0?en.left:-1,en.vertical||-1,id,ad,nb,$K,ZK,qK,GK,UK,WK,XK,KK,q2,R0,rb,O3,Yr,ab,0,v2,j4,YK,eJ)}(c,Ot,We,Q,y,x,xt,c.layers[0],c.collisionBoxArray,s.index,s.sourceLayerIndex,c.index,fe,[Me,Me,Me,Me],dt,B,He,De,wt,re,s,C,j,q,S)};if(Qt==="line")for(const We of RL(s.geometry,0,0,h2,h2)){const Ot=PK(We,ve,$e,Q.vertical||ae,y,24,ye,c.overscaling,h2);for(const Ct of Ot)ae&&jK(c,ae.text,ct,Ct)||st(We,Ct)}else if(Qt==="line-center"){for(const We of s.geometry)if(We.length>1){const Ot=kK(We,$e,Q.vertical||ae,y,24,ye);Ot&&st(We,Ot)}}else if(s.type==="Polygon")for(const We of Ch(s.geometry,0)){const Ot=NK(We,16);st(We[0],new Wn(Ot.x,Ot.y,0))}else if(s.type==="LineString")for(const We of s.geometry)st(We,new Wn(We[0].x,We[0].y,0));else if(s.type==="Point")for(const We of s.geometry)for(const Ot of We)st([Ot],new Wn(Ot.x,Ot.y,0))}function KL(c,s,Q,y,x,C,S,O,B,j,q,X,Y,re,ae){const le=function(He,ve,Me,De,$e,dt,wt,Qt){const ct=De.layout.get("text-rotate").evaluate(dt,{})*Math.PI/180,ot=[];for(const xt of ve.positionedLines)for(const st of xt.positionedGlyphs){if(!st.rect)continue;const We=st.rect||{};let Ot=hL+1,Ct=!0,i1=1,N1=0;const $1=($e||Qt)&&st.vertical,_2=st.metrics.advance*st.scale/2;if(Qt&&ve.verticalizable&&(N1=xt.lineOffset/2-(st.imageName?-(g2-st.metrics.width*st.scale)/2:(st.scale-1)*g2)),st.imageName){const L2=wt[st.imageName];Ct=L2.sdf,i1=L2.pixelRatio,Ot=E3/i1}const W3=$e?[st.x+_2,st.y]:[0,0];let f3=$e?[0,0]:[st.x+_2+Me[0],st.y+Me[1]-N1],d2=[0,0];$1&&(d2=f3,f3=[0,0]);const P2=st.metrics.isDoubleResolution?2:1,q2=(st.metrics.left-Ot)*st.scale-_2+f3[0],p3=(-st.metrics.top-Ot)*st.scale+f3[1],m3=q2+We.w/P2*st.scale/i1,v2=p3+We.h/P2*st.scale/i1,x2=new g(q2,p3),e3=new g(m3,p3),y3=new g(q2,v2),t3=new g(m3,v2);if($1){const L2=new g(-_2,_2-k0),l1=-Math.PI/2,r3=g2/2-_2,G2=new g(5-k0-r3,-(st.imageName?r3:0)),b2=new g(...d2);x2._rotateAround(l1,L2)._add(G2)._add(b2),e3._rotateAround(l1,L2)._add(G2)._add(b2),y3._rotateAround(l1,L2)._add(G2)._add(b2),t3._rotateAround(l1,L2)._add(G2)._add(b2)}if(ct){const L2=Math.sin(ct),l1=Math.cos(ct),r3=[l1,-L2,L2,l1];x2._matMult(r3),e3._matMult(r3),y3._matMult(r3),t3._matMult(r3)}const V3=new g(0,0),D3=new g(0,0);ot.push({tl:x2,tr:e3,bl:y3,br:t3,tex:We,writingMode:ve.writingMode,glyphOffset:W3,sectionIndex:st.sectionIndex,isSDF:Ct,pixelOffsetTL:V3,pixelOffsetBR:D3,minFontScaleX:0,minFontScaleY:0})}return ot}(0,Q,O,x,C,S,y,c.allowVerticalPlacement),fe=c.textSizeData;let ye=null;fe.kind==="source"?(ye=[fr*x.layout.get("text-size").evaluate(S,{})],ye[0]>Gn&&Re(`${c.layerIds[0]}: Value for "text-size" is >= ${I0}. Reduce your "text-size".`)):fe.kind==="composite"&&(ye=[fr*re.compositeTextSizes[0].evaluate(S,{},ae),fr*re.compositeTextSizes[1].evaluate(S,{},ae)],(ye[0]>Gn||ye[1]>Gn)&&Re(`${c.layerIds[0]}: Value for "text-size" is >= ${I0}. Reduce your "text-size".`)),c.addSymbols(c.text,le,ye,O,C,S,j,s,B.lineStartIndex,B.lineLength,Y,ae);for(const He of q)X[He]=c.text.placedSymbolArray.length-1;return 4*le.length}function JL(c){for(const s in c)return c[s];return null}function jK(c,s,Q,y){const x=c.compareText;if(s in x){const C=x[s];for(let S=C.length-1;S>=0;S--)if(y.dist(C[S])<Q)return!0}else x[s]=[];return x[s].push(y),!1}const YL=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Kh{static from(s){if(!(s instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[Q,y]=new Uint8Array(s,0,2);if(Q!==219)throw new Error("Data does not appear to be in a KDBush format.");const x=y>>4;if(x!==1)throw new Error(`Got v${x} data when expected v1.`);const C=YL[15&y];if(!C)throw new Error("Unrecognized array type.");const[S]=new Uint16Array(s,2,1),[O]=new Uint32Array(s,4,1);return new Kh(O,S,C,s)}constructor(s,Q=64,y=Float64Array,x){if(isNaN(s)||s<0)throw new Error(`Unpexpected numItems value: ${s}.`);this.numItems=+s,this.nodeSize=Math.min(Math.max(+Q,2),65535),this.ArrayType=y,this.IndexArrayType=s<65536?Uint16Array:Uint32Array;const C=YL.indexOf(this.ArrayType),S=2*s*this.ArrayType.BYTES_PER_ELEMENT,O=s*this.IndexArrayType.BYTES_PER_ELEMENT,B=(8-O%8)%8;if(C<0)throw new Error(`Unexpected typed array class: ${y}.`);x&&x instanceof ArrayBuffer?(this.data=x,this.ids=new this.IndexArrayType(this.data,8,s),this.coords=new this.ArrayType(this.data,8+O+B,2*s),this._pos=2*s,this._finished=!0):(this.data=new ArrayBuffer(8+S+O+B),this.ids=new this.IndexArrayType(this.data,8,s),this.coords=new this.ArrayType(this.data,8+O+B,2*s),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+C]),new Uint16Array(this.data,2,1)[0]=Q,new Uint32Array(this.data,4,1)[0]=s)}add(s,Q){const y=this._pos>>1;return this.ids[y]=y,this.coords[this._pos++]=s,this.coords[this._pos++]=Q,y}finish(){const s=this._pos>>1;if(s!==this.numItems)throw new Error(`Added ${s} items when expected ${this.numItems}.`);return Jh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(s,Q,y,x){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:C,coords:S,nodeSize:O}=this,B=[0,C.length-1,0],j=[];for(;B.length;){const q=B.pop()||0,X=B.pop()||0,Y=B.pop()||0;if(X-Y<=O){for(let fe=Y;fe<=X;fe++){const ye=S[2*fe],He=S[2*fe+1];ye>=s&&ye<=y&&He>=Q&&He<=x&&j.push(C[fe])}continue}const re=Y+X>>1,ae=S[2*re],le=S[2*re+1];ae>=s&&ae<=y&&le>=Q&&le<=x&&j.push(C[re]),(q===0?s<=ae:Q<=le)&&(B.push(Y),B.push(re-1),B.push(1-q)),(q===0?y>=ae:x>=le)&&(B.push(re+1),B.push(X),B.push(1-q))}return j}within(s,Q,y){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:x,coords:C,nodeSize:S}=this,O=[0,x.length-1,0],B=[],j=y*y;for(;O.length;){const q=O.pop()||0,X=O.pop()||0,Y=O.pop()||0;if(X-Y<=S){for(let fe=Y;fe<=X;fe++)tb(C[2*fe],C[2*fe+1],s,Q)<=j&&B.push(x[fe]);continue}const re=Y+X>>1,ae=C[2*re],le=C[2*re+1];tb(ae,le,s,Q)<=j&&B.push(x[re]),(q===0?s-y<=ae:Q-y<=le)&&(O.push(Y),O.push(re-1),O.push(1-q)),(q===0?s+y>=ae:Q+y>=le)&&(O.push(re+1),O.push(X),O.push(1-q))}return B}}function Jh(c,s,Q,y,x,C){if(x-y<=Q)return;const S=y+x>>1;eb(c,s,S,y,x,C),Jh(c,s,Q,y,S-1,1-C),Jh(c,s,Q,S+1,x,1-C)}function eb(c,s,Q,y,x,C){for(;x>y;){if(x-y>600){const j=x-y+1,q=Q-y+1,X=Math.log(j),Y=.5*Math.exp(2*X/3),re=.5*Math.sqrt(X*Y*(j-Y)/j)*(q-j/2<0?-1:1);eb(c,s,Q,Math.max(y,Math.floor(Q-q*Y/j+re)),Math.min(x,Math.floor(Q+(j-q)*Y/j+re)),C)}const S=s[2*Q+C];let O=y,B=x;for(N0(c,s,y,Q),s[2*x+C]>S&&N0(c,s,y,x);O<B;){for(N0(c,s,O,B),O++,B--;s[2*O+C]<S;)O++;for(;s[2*B+C]>S;)B--}s[2*y+C]===S?N0(c,s,y,B):(B++,N0(c,s,B,x)),B<=Q&&(y=B+1),Q<=B&&(x=B-1)}}function N0(c,s,Q,y){Yh(c,Q,y),Yh(s,2*Q,2*y),Yh(s,2*Q+1,2*y+1)}function Yh(c,s,Q){const y=c[s];c[s]=c[Q],c[Q]=y}function tb(c,s,Q,y){const x=c-Q,C=s-y;return x*x+C*C}var ed;o.bh=void 0,(ed=o.bh||(o.bh={})).create="create",ed.load="load",ed.fullLoad="fullLoad";let X9=null,F0=[];const td=1e3/60,rd="loadTime",nd="fullLoadTime",zK={mark(c){performance.mark(c)},frame(c){const s=c;X9!=null&&F0.push(s-X9),X9=s},clearMetrics(){X9=null,F0=[],performance.clearMeasures(rd),performance.clearMeasures(nd);for(const c in o.bh)performance.clearMarks(o.bh[c])},getPerformanceMetrics(){performance.measure(rd,o.bh.create,o.bh.load),performance.measure(nd,o.bh.create,o.bh.fullLoad);const c=performance.getEntriesByName(rd)[0].duration,s=performance.getEntriesByName(nd)[0].duration,Q=F0.length,y=1/(F0.reduce((C,S)=>C+S,0)/Q/1e3),x=F0.filter(C=>C>td).reduce((C,S)=>C+(S-td)/td,0);return{loadTime:c,fullLoadTime:s,fps:y,percentDroppedFrames:x/(Q+x)*100,totalFrames:Q}}};o.$=function(c,s,Q){var y,x,C,S,O,B,j,q,X,Y,re,ae,le=Q[0],fe=Q[1],ye=Q[2];return s===c?(c[12]=s[0]*le+s[4]*fe+s[8]*ye+s[12],c[13]=s[1]*le+s[5]*fe+s[9]*ye+s[13],c[14]=s[2]*le+s[6]*fe+s[10]*ye+s[14],c[15]=s[3]*le+s[7]*fe+s[11]*ye+s[15]):(x=s[1],C=s[2],S=s[3],O=s[4],B=s[5],j=s[6],q=s[7],X=s[8],Y=s[9],re=s[10],ae=s[11],c[0]=y=s[0],c[1]=x,c[2]=C,c[3]=S,c[4]=O,c[5]=B,c[6]=j,c[7]=q,c[8]=X,c[9]=Y,c[10]=re,c[11]=ae,c[12]=y*le+O*fe+X*ye+s[12],c[13]=x*le+B*fe+Y*ye+s[13],c[14]=C*le+j*fe+re*ye+s[14],c[15]=S*le+q*fe+ae*ye+s[15]),c},o.A=A5,o.B=H3,o.C=class{constructor(c,s,Q){this.receive=y=>{const x=y.data,C=x.id;if(C&&(!x.targetMapId||this.mapId===x.targetMapId))if(x.type==="<cancel>"){delete this.tasks[C];const S=this.cancelCallbacks[C];delete this.cancelCallbacks[C],S&&S()}else Ee()||x.mustQueue?(this.tasks[C]=x,this.taskQueue.push(C),this.invoker.trigger()):this.processTask(C,x)},this.process=()=>{if(!this.taskQueue.length)return;const y=this.taskQueue.shift(),x=this.tasks[y];delete this.tasks[y],this.taskQueue.length&&this.invoker.trigger(),x&&this.processTask(y,x)},this.target=c,this.parent=s,this.mapId=Q,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new DK(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ee()?c:window}send(c,s,Q,y,x=!1){const C=Math.round(1e18*Math.random()).toString(36).substring(0,10);Q&&(this.callbacks[C]=Q);const S=[],O={id:C,type:c,hasCallback:!!Q,targetMapId:y,mustQueue:x,sourceMapId:this.mapId,data:Tr(s,S)};return this.target.postMessage(O,{transfer:S}),{cancel:()=>{Q&&delete this.callbacks[C],this.target.postMessage({id:C,type:"<cancel>",targetMapId:y,sourceMapId:this.mapId})}}}processTask(c,s){if(s.type==="<response>"){const Q=this.callbacks[c];delete this.callbacks[c],Q&&(s.error?Q(Rn(s.error)):Q(null,Rn(s.data)))}else{let Q=!1;const y=[],x=s.hasCallback?(O,B)=>{Q=!0,delete this.cancelCallbacks[c];const j={id:c,type:"<response>",sourceMapId:this.mapId,error:O?Tr(O):null,data:Tr(B,y)};this.target.postMessage(j,{transfer:y})}:O=>{Q=!0};let C=null;const S=Rn(s.data);if(this.parent[s.type])C=this.parent[s.type](s.sourceMapId,S,x);else if("getWorkerSource"in this.parent){const O=s.type.split(".");C=this.parent.getWorkerSource(s.sourceMapId,O[0],S.source)[O[1]](S,x)}else x(new Error(`Could not find function ${s.type}`));!Q&&C&&C.cancel&&(this.cancelCallbacks[c]=C.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.D=St,o.E=V1,o.F=function(c,s){const Q={};for(let y=0;y<s.length;y++){const x=s[y];x in c&&(Q[x]=c[x])}return Q},o.G=AL,o.H=SL,o.I=Bh,o.J=V,o.K=I,o.L=Un,o.M=Xe,o.N=h2,o.O=n4,o.P=g,o.Q=U1,o.R=r4,o.S=B1,o.T=w9,o.U=Z9,o.V=class extends qr{},o.W=Uh,o.X=function(c,s){const Q=window.document.createElement("video");Q.muted=!0,Q.onloadstart=function(){s(null,Q)};for(let y=0;y<c.length;y++){const x=window.document.createElement("source");mt(c[y])||(Q.crossOrigin="Anonymous"),x.src=c[y],Q.appendChild(x)}return{cancel:()=>{}}},o.Y=it,o.Z=function(){var c=new A5(16);return A5!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c},o._=f,o.a=Pt,o.a$=class extends te{},o.a0=function(c,s,Q){var y=Q[0],x=Q[1],C=Q[2];return c[0]=s[0]*y,c[1]=s[1]*y,c[2]=s[2]*y,c[3]=s[3]*y,c[4]=s[4]*x,c[5]=s[5]*x,c[6]=s[6]*x,c[7]=s[7]*x,c[8]=s[8]*C,c[9]=s[9]*C,c[10]=s[10]*C,c[11]=s[11]*C,c[12]=s[12],c[13]=s[13],c[14]=s[14],c[15]=s[15],c},o.a1=Ox,o.a2=function(){return ee++},o.a3=Te,o.a4=k5,o.a5=function(){A3.isLoading()||A3.isLoaded()||d0()!=="deferred"||b9()},o.a6=n0,o.a7=G6,o.a8=I1,o.a9=IL,o.aA=R6,o.aB=function(c){c=c.slice();const s=Object.create(null);for(let Q=0;Q<c.length;Q++)s[c[Q].id]=c[Q];for(let Q=0;Q<c.length;Q++)"ref"in c[Q]&&(c[Q]=P1(c[Q],s[c[Q].ref]));return c},o.aC=function(c){if(c.type==="custom")return new VK(c);switch(c.type){case"background":return new AK(c);case"circle":return new dX(c);case"fill":return new OX(c);case"fill-extrusion":return new WX(c);case"heatmap":return new pX(c);case"hillshade":return new yX(c);case"line":return new nK(c);case"raster":return new EK(c);case"symbol":return new $9(c)}},o.aD=ge,o.aE=function(c,s){if(!c)return[{command:Xt.setStyle,args:[s]}];let Q=[];try{if(!Q1(c.version,s.version))return[{command:Xt.setStyle,args:[s]}];Q1(c.center,s.center)||Q.push({command:Xt.setCenter,args:[s.center]}),Q1(c.zoom,s.zoom)||Q.push({command:Xt.setZoom,args:[s.zoom]}),Q1(c.bearing,s.bearing)||Q.push({command:Xt.setBearing,args:[s.bearing]}),Q1(c.pitch,s.pitch)||Q.push({command:Xt.setPitch,args:[s.pitch]}),Q1(c.sprite,s.sprite)||Q.push({command:Xt.setSprite,args:[s.sprite]}),Q1(c.glyphs,s.glyphs)||Q.push({command:Xt.setGlyphs,args:[s.glyphs]}),Q1(c.transition,s.transition)||Q.push({command:Xt.setTransition,args:[s.transition]}),Q1(c.light,s.light)||Q.push({command:Xt.setLight,args:[s.light]});const y={},x=[];(function(S,O,B,j){let q;for(q in O=O||{},S=S||{})Object.prototype.hasOwnProperty.call(S,q)&&(Object.prototype.hasOwnProperty.call(O,q)||Rt(q,B,j));for(q in O)Object.prototype.hasOwnProperty.call(O,q)&&(Object.prototype.hasOwnProperty.call(S,q)?Q1(S[q],O[q])||(S[q].type==="geojson"&&O[q].type==="geojson"&&r2(S,O,q)?B.push({command:Xt.setGeoJSONSourceData,args:[q,O[q].data]}):d1(q,O,B,j)):et(q,O,B))})(c.sources,s.sources,x,y);const C=[];c.layers&&c.layers.forEach(S=>{y[S.source]?Q.push({command:Xt.removeLayer,args:[S.id]}):C.push(S)}),Q=Q.concat(x),function(S,O,B){O=O||[];const j=(S=S||[]).map(l3),q=O.map(l3),X=S.reduce(L3,{}),Y=O.reduce(L3,{}),re=j.slice(),ae=Object.create(null);let le,fe,ye,He,ve,Me,De;for(le=0,fe=0;le<j.length;le++)ye=j[le],Object.prototype.hasOwnProperty.call(Y,ye)?fe++:(B.push({command:Xt.removeLayer,args:[ye]}),re.splice(re.indexOf(ye,fe),1));for(le=0,fe=0;le<q.length;le++)ye=q[q.length-1-le],re[re.length-1-le]!==ye&&(Object.prototype.hasOwnProperty.call(X,ye)?(B.push({command:Xt.removeLayer,args:[ye]}),re.splice(re.lastIndexOf(ye,re.length-fe),1)):fe++,Me=re[re.length-le],B.push({command:Xt.addLayer,args:[Y[ye],Me]}),re.splice(re.length-le,0,ye),ae[ye]=!0);for(le=0;le<q.length;le++)if(ye=q[le],He=X[ye],ve=Y[ye],!ae[ye]&&!Q1(He,ve))if(Q1(He.source,ve.source)&&Q1(He["source-layer"],ve["source-layer"])&&Q1(He.type,ve.type)){for(De in R2(He.layout,ve.layout,B,ye,null,Xt.setLayoutProperty),R2(He.paint,ve.paint,B,ye,null,Xt.setPaintProperty),Q1(He.filter,ve.filter)||B.push({command:Xt.setFilter,args:[ye,ve.filter]}),Q1(He.minzoom,ve.minzoom)&&Q1(He.maxzoom,ve.maxzoom)||B.push({command:Xt.setLayerZoomRange,args:[ye,ve.minzoom,ve.maxzoom]}),He)Object.prototype.hasOwnProperty.call(He,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&(De.indexOf("paint.")===0?R2(He[De],ve[De],B,ye,De.slice(6),Xt.setPaintProperty):Q1(He[De],ve[De])||B.push({command:Xt.setLayerProperty,args:[ye,De,ve[De]]}));for(De in ve)Object.prototype.hasOwnProperty.call(ve,De)&&!Object.prototype.hasOwnProperty.call(He,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&(De.indexOf("paint.")===0?R2(He[De],ve[De],B,ye,De.slice(6),Xt.setPaintProperty):Q1(He[De],ve[De])||B.push({command:Xt.setLayerProperty,args:[ye,De,ve[De]]}))}else B.push({command:Xt.removeLayer,args:[ye]}),Me=re[re.lastIndexOf(ye)+1],B.push({command:Xt.addLayer,args:[ve,Me]})}(C,s.layers,Q)}catch(y){console.warn("Unable to compute style diff:",y),Q=[{command:Xt.setStyle,args:[s]}]}return Q},o.aF=function(c){const s=[],Q=c.id;return Q===void 0&&s.push({message:`layers.${Q}: missing required property "id"`}),c.render===void 0&&s.push({message:`layers.${Q}: missing required method "render"`}),c.renderingMode&&c.renderingMode!=="2d"&&c.renderingMode!=="3d"&&s.push({message:`layers.${Q}: property "renderingMode" must be either "2d" or "3d"`}),s},o.aG=function c(s,Q){if(Array.isArray(s)){if(!Array.isArray(Q)||s.length!==Q.length)return!1;for(let y=0;y<s.length;y++)if(!c(s[y],Q[y]))return!1;return!0}if(typeof s=="object"&&s!==null&&Q!==null){if(typeof Q!="object"||Object.keys(s).length!==Object.keys(Q).length)return!1;for(const y in s)if(!c(s[y],Q[y]))return!1;return!0}return s===Q},o.aH=ie,o.aI=de,o.aJ=j6,o.aK=function(c){return c({pluginStatus:T3,pluginURL:hr}),j6.on("pluginStateChange",c),c},o.aL=class extends Wr{constructor(c,s){super(c,s),this.current=0}set(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))}},o.aM=M5,o.aN=class extends Wr{constructor(c,s){super(c,s),this.current=ph}set(c){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(let s=1;s<16;s++)if(c[s]!==this.current[s]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}}},o.aO=A9,o.aP=class extends Wr{constructor(c,s){super(c,s),this.current=[0,0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2]))}},o.aQ=class extends Wr{constructor(c,s){super(c,s),this.current=[0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1]))}},o.aR=S9,o.aS=function(c,s,Q,y,x,C,S){var O=1/(s-Q),B=1/(y-x),j=1/(C-S);return c[0]=-2*O,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=-2*B,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=2*j,c[11]=0,c[12]=(s+Q)*O,c[13]=(x+y)*B,c[14]=(S+C)*j,c[15]=1,c},o.aT=H1,o.aU=hX,o.aV=class extends _{},o.aW=sK,o.aX=class extends A{},o.aY=function(c){return c<=1?1:Math.pow(2,Math.ceil(Math.log(c)/Math.LN2))},o.aZ=Nx,o.a_=rt,o.aa=function(c){const s={};if(c.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(Q,y,x,C)=>{const S=x||C;return s[y]=!S||S.toLowerCase(),""}),s["max-age"]){const Q=parseInt(s["max-age"],10);isNaN(Q)?delete s["max-age"]:s["max-age"]=Q}return s},o.ab=function(c,s){const Q=[];for(const y in c)y in s||Q.push(y);return Q},o.ac=function(c){if(Ye==null){const s=c.navigator?c.navigator.userAgent:null;Ye=!!c.safari||!(!s||!(/\b(iPad|iPhone|iPod)\b/.test(s)||s.match("Safari")&&!s.match("Chrome")))}return Ye},o.ad=z,o.ae=function(c,s,Q){var y=Math.sin(Q),x=Math.cos(Q),C=s[0],S=s[1],O=s[2],B=s[3],j=s[4],q=s[5],X=s[6],Y=s[7];return s!==c&&(c[8]=s[8],c[9]=s[9],c[10]=s[10],c[11]=s[11],c[12]=s[12],c[13]=s[13],c[14]=s[14],c[15]=s[15]),c[0]=C*x+j*y,c[1]=S*x+q*y,c[2]=O*x+X*y,c[3]=B*x+Y*y,c[4]=j*x-C*y,c[5]=q*x-S*y,c[6]=X*x-O*y,c[7]=Y*x-B*y,c},o.af=function(c){var s=new A5(16);return s[0]=c[0],s[1]=c[1],s[2]=c[2],s[3]=c[3],s[4]=c[4],s[5]=c[5],s[6]=c[6],s[7]=c[7],s[8]=c[8],s[9]=c[9],s[10]=c[10],s[11]=c[11],s[12]=c[12],s[13]=c[13],s[14]=c[14],s[15]=c[15],s},o.ag=O9,o.ah=function(c,s){let Q=0,y=0;if(c.kind==="constant")y=c.layoutSize;else if(c.kind!=="source"){const{interpolationType:x,minZoom:C,maxZoom:S}=c,O=x?z(M3.interpolationFactor(x,s,C,S),0,1):0;c.kind==="camera"?y=H3.number(c.minSize,c.maxSize,O):Q=O}return{uSizeT:Q,uSize:y}},o.aj=function(c,{uSize:s,uSizeT:Q},{lowerSize:y,upperSize:x}){return c.kind==="source"?y/fr:c.kind==="composite"?H3.number(y/fr,x/fr,Q):s},o.ak=jh,o.al=function(c,s,Q,y){const x=s.y-c.y,C=s.x-c.x,S=y.y-Q.y,O=y.x-Q.x,B=S*C-O*x;if(B===0)return null;const j=(O*(c.y-Q.y)-S*(c.x-Q.x))/B;return new g(c.x+j*C,c.y+j*x)},o.am=RL,o.an=Cx,o.ao=vh,o.ap=g2,o.ar=Rh,o.as=function(c,s){var Q=s[0],y=s[1],x=s[2],C=s[3],S=s[4],O=s[5],B=s[6],j=s[7],q=s[8],X=s[9],Y=s[10],re=s[11],ae=s[12],le=s[13],fe=s[14],ye=s[15],He=Q*O-y*S,ve=Q*B-x*S,Me=Q*j-C*S,De=y*B-x*O,$e=y*j-C*O,dt=x*j-C*B,wt=q*le-X*ae,Qt=q*fe-Y*ae,ct=q*ye-re*ae,ot=X*fe-Y*le,xt=X*ye-re*le,st=Y*ye-re*fe,We=He*st-ve*xt+Me*ot+De*ct-$e*Qt+dt*wt;return We?(c[0]=(O*st-B*xt+j*ot)*(We=1/We),c[1]=(x*xt-y*st-C*ot)*We,c[2]=(le*dt-fe*$e+ye*De)*We,c[3]=(Y*$e-X*dt-re*De)*We,c[4]=(B*ct-S*st-j*Qt)*We,c[5]=(Q*st-x*ct+C*Qt)*We,c[6]=(fe*Me-ae*dt-ye*ve)*We,c[7]=(q*dt-Y*Me+re*ve)*We,c[8]=(S*xt-O*ct+j*wt)*We,c[9]=(y*ct-Q*xt-C*wt)*We,c[10]=(ae*$e-le*Me+ye*He)*We,c[11]=(X*Me-q*$e-re*He)*We,c[12]=(O*Qt-S*ot-B*wt)*We,c[13]=(Q*ot-y*Qt+x*wt)*We,c[14]=(le*ve-ae*De-fe*He)*We,c[15]=(q*De-X*ve+Y*He)*We,c):null},o.at=Xh,o.au=Fh,o.av=Kh,o.aw=function(){const c={},s=Pe.$version;for(const Q in Pe.$root){const y=Pe.$root[Q];if(y.required){let x=null;x=Q==="version"?s:y.type==="array"?[]:{},x!=null&&(c[Q]=x)}}return c},o.ax=Xt,o.ay=_9,o.az=ut,o.b=function(c,s){const Q=new Blob([new Uint8Array(c)],{type:"image/png"});createImageBitmap(Q).then(y=>{s(null,y)}).catch(y=>{s(new Error(`Could not load image because of ${y.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},o.b0=O2,o.b1=function(c,s){var Q=c[0],y=c[1],x=c[2],C=c[3],S=c[4],O=c[5],B=c[6],j=c[7],q=c[8],X=c[9],Y=c[10],re=c[11],ae=c[12],le=c[13],fe=c[14],ye=c[15],He=s[0],ve=s[1],Me=s[2],De=s[3],$e=s[4],dt=s[5],wt=s[6],Qt=s[7],ct=s[8],ot=s[9],xt=s[10],st=s[11],We=s[12],Ot=s[13],Ct=s[14],i1=s[15];return Math.abs(Q-He)<=d3*Math.max(1,Math.abs(Q),Math.abs(He))&&Math.abs(y-ve)<=d3*Math.max(1,Math.abs(y),Math.abs(ve))&&Math.abs(x-Me)<=d3*Math.max(1,Math.abs(x),Math.abs(Me))&&Math.abs(C-De)<=d3*Math.max(1,Math.abs(C),Math.abs(De))&&Math.abs(S-$e)<=d3*Math.max(1,Math.abs(S),Math.abs($e))&&Math.abs(O-dt)<=d3*Math.max(1,Math.abs(O),Math.abs(dt))&&Math.abs(B-wt)<=d3*Math.max(1,Math.abs(B),Math.abs(wt))&&Math.abs(j-Qt)<=d3*Math.max(1,Math.abs(j),Math.abs(Qt))&&Math.abs(q-ct)<=d3*Math.max(1,Math.abs(q),Math.abs(ct))&&Math.abs(X-ot)<=d3*Math.max(1,Math.abs(X),Math.abs(ot))&&Math.abs(Y-xt)<=d3*Math.max(1,Math.abs(Y),Math.abs(xt))&&Math.abs(re-st)<=d3*Math.max(1,Math.abs(re),Math.abs(st))&&Math.abs(ae-We)<=d3*Math.max(1,Math.abs(ae),Math.abs(We))&&Math.abs(le-Ot)<=d3*Math.max(1,Math.abs(le),Math.abs(Ot))&&Math.abs(fe-Ct)<=d3*Math.max(1,Math.abs(fe),Math.abs(Ct))&&Math.abs(ye-i1)<=d3*Math.max(1,Math.abs(ye),Math.abs(i1))},o.b2=function(c,s){return c[0]=s[0],c[1]=s[1],c[2]=s[2],c[3]=s[3],c[4]=s[4],c[5]=s[5],c[6]=s[6],c[7]=s[7],c[8]=s[8],c[9]=s[9],c[10]=s[10],c[11]=s[11],c[12]=s[12],c[13]=s[13],c[14]=s[14],c[15]=s[15],c},o.b3=function(c,s,Q){return c[0]=s[0]*Q[0],c[1]=s[1]*Q[1],c[2]=s[2]*Q[2],c[3]=s[3]*Q[3],c},o.b4=function(c,s){return c[0]*s[0]+c[1]*s[1]+c[2]*s[2]+c[3]*s[3]},o.b5=Z,o.b6=OL,o.b7=EL,o.b8=function(c,s,Q,y,x){var C,S=1/Math.tan(s/2);return c[0]=S/Q,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=S,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=-1,c[12]=0,c[13]=0,c[15]=0,x!=null&&x!==1/0?(c[10]=(x+y)*(C=1/(y-x)),c[14]=2*x*y*C):(c[10]=-1,c[14]=-2*y),c},o.b9=function(c,s,Q){var y=Math.sin(Q),x=Math.cos(Q),C=s[4],S=s[5],O=s[6],B=s[7],j=s[8],q=s[9],X=s[10],Y=s[11];return s!==c&&(c[0]=s[0],c[1]=s[1],c[2]=s[2],c[3]=s[3],c[12]=s[12],c[13]=s[13],c[14]=s[14],c[15]=s[15]),c[4]=C*x+j*y,c[5]=S*x+q*y,c[6]=O*x+X*y,c[7]=B*x+Y*y,c[8]=j*x-C*y,c[9]=q*x-S*y,c[10]=X*x-O*y,c[11]=Y*x-B*y,c},o.bA=p,o.bB=oL,o.bC=p5,o.bD=A3,o.ba=N,o.bb=R,o.bc=function(c,s){return c[0]=s[0],c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=s[1],c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=s[2],c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c},o.bd=class extends Z6{},o.be=qh,o.bf=VL,o.bg=zK,o.bi=Ne,o.bj=function(c,s,Q=!1){if(T3===c0||T3===u0||T3===Q0)throw new Error("setRTLTextPlugin cannot be called multiple times.");hr=Et.resolveURL(c),T3=c0,T0=s,h0(),Q||b9()},o.bk=d0,o.bl=function(c,s){const Q={};for(let x=0;x<c.length;x++){const C=s&&s[c[x].id]||_5(c[x]);s&&(s[c[x].id]=C);let S=Q[C];S||(S=Q[C]=[]),S.push(c[x])}const y=[];for(const x in Q)y.push(Q[x]);return y},o.bm=_t,o.bn=PL,o.bo=BL,o.bp=fL,o.bq=function(c){c.bucket.createArrays(),c.bucket.tilePixelRatio=h2/(512*c.bucket.overscaling),c.bucket.compareText={},c.bucket.iconsNeedLinear=!1;const s=c.bucket.layers[0],Q=s.layout,y=s._unevaluatedLayout._values,x={layoutIconSize:y["icon-size"].possiblyEvaluate(new I1(c.bucket.zoom+1),c.canonical),layoutTextSize:y["text-size"].possiblyEvaluate(new I1(c.bucket.zoom+1),c.canonical),textMaxSize:y["text-size"].possiblyEvaluate(new I1(18))};if(c.bucket.textSizeData.kind==="composite"){const{minZoom:j,maxZoom:q}=c.bucket.textSizeData;x.compositeTextSizes=[y["text-size"].possiblyEvaluate(new I1(j),c.canonical),y["text-size"].possiblyEvaluate(new I1(q),c.canonical)]}if(c.bucket.iconSizeData.kind==="composite"){const{minZoom:j,maxZoom:q}=c.bucket.iconSizeData;x.compositeIconSizes=[y["icon-size"].possiblyEvaluate(new I1(j),c.canonical),y["icon-size"].possiblyEvaluate(new I1(q),c.canonical)]}const C=Q.get("text-line-height")*g2,S=Q.get("text-rotation-alignment")!=="viewport"&&Q.get("symbol-placement")!=="point",O=Q.get("text-keep-upright"),B=Q.get("text-size");for(const j of c.bucket.features){const q=Q.get("text-font").evaluate(j,{},c.canonical).join(","),X=B.evaluate(j,{},c.canonical),Y=x.layoutTextSize.evaluate(j,{},c.canonical),re=x.layoutIconSize.evaluate(j,{},c.canonical),ae={horizontal:{},vertical:void 0},le=j.text;let fe,ye=[0,0];if(le){const Me=le.toString(),De=Q.get("text-letter-spacing").evaluate(j,{},c.canonical)*g2,$e=s0(Me)?De:0,dt=Q.get("text-anchor").evaluate(j,{},c.canonical),wt=XL(s,j,c.canonical);if(!wt){const st=Q.get("text-radial-offset").evaluate(j,{},c.canonical);ye=st?WL(dt,[st*g2,Wh]):Q.get("text-offset").evaluate(j,{},c.canonical).map(We=>We*g2)}let Qt=S?"center":Q.get("text-justify").evaluate(j,{},c.canonical);const ct=Q.get("symbol-placement"),ot=ct==="point"?Q.get("text-max-width").evaluate(j,{},c.canonical)*g2:0,xt=()=>{c.bucket.allowVerticalPlacement&&o0(Me)&&(ae.vertical=R9(le,c.glyphMap,c.glyphPositions,c.imagePositions,q,ot,C,dt,"left",$e,ye,o.ai.vertical,!0,ct,Y,X))};if(!S&&wt){const st=new Set;if(Qt==="auto")for(let Ot=0;Ot<wt.values.length;Ot+=2)st.add(Xh(wt.values[Ot]));else st.add(Qt);let We=!1;for(const Ot of st)if(!ae.horizontal[Ot])if(We)ae.horizontal[Ot]=ae.horizontal[0];else{const Ct=R9(le,c.glyphMap,c.glyphPositions,c.imagePositions,q,ot,C,"center",Ot,$e,ye,o.ai.horizontal,!1,ct,Y,X);Ct&&(ae.horizontal[Ot]=Ct,We=Ct.positionedLines.length===1)}xt()}else{Qt==="auto"&&(Qt=Xh(dt));const st=R9(le,c.glyphMap,c.glyphPositions,c.imagePositions,q,ot,C,dt,Qt,$e,ye,o.ai.horizontal,!1,ct,Y,X);st&&(ae.horizontal[Qt]=st),xt(),o0(Me)&&S&&O&&(ae.vertical=R9(le,c.glyphMap,c.glyphPositions,c.imagePositions,q,ot,C,dt,Qt,$e,ye,o.ai.vertical,!1,ct,Y,X))}}let He=!1;if(j.icon&&j.icon.name){const Me=c.imageMap[j.icon.name];Me&&(fe=bK(c.imagePositions[j.icon.name],Q.get("icon-offset").evaluate(j,{},c.canonical),Q.get("icon-anchor").evaluate(j,{},c.canonical)),He=!!Me.sdf,c.bucket.sdfIcons===void 0?c.bucket.sdfIcons=He:c.bucket.sdfIcons!==He&&Re("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Me.pixelRatio!==c.bucket.pixelRatio||Q.get("icon-rotate").constantOr(1)!==0)&&(c.bucket.iconsNeedLinear=!0))}const ve=JL(ae.horizontal)||ae.vertical;c.bucket.iconsInText=!!ve&&ve.iconsInText,(ve||fe)&&RK(c.bucket,j,ae,fe,c.imageMap,x,Y,re,ye,He,c.canonical)}c.showCollisionBoxes&&c.bucket.generateCollisionDebugBuffers()},o.br=Oh,o.bs=Eh,o.bt=Dh,o.bu=class{constructor(c){this._marks={start:[c.url,"start"].join("#"),end:[c.url,"end"].join("#"),measure:c.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let c=performance.getEntriesByName(this._marks.measure);return c.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),c=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),c}},o.bv=Ph,o.bw=Zn,o.bx=function(c,s,Q,y,x){return f(this,void 0,void 0,function*(){if(I())try{return yield Xe(c,s,Q,y,x)}catch{}return function(C,S,O,B,j){const q=C.width,X=C.height;Tt&&Je||(Tt=new OffscreenCanvas(q,X),Je=Tt.getContext("2d",{willReadFrequently:!0})),Tt.width=q,Tt.height=X,Je.drawImage(C,0,0,q,X);const Y=Je.getImageData(S,O,B,j);return Je.clearRect(0,0,q,X),Y.data}(c,s,Q,y,x)})},o.by=kL,o.bz=h,o.c=Ve,o.d=function(c,s){const Q=new Image;Q.onload=()=>{s(null,Q),URL.revokeObjectURL(Q.src),Q.onload=null,window.requestAnimationFrame(()=>{Q.src=Ie})},Q.onerror=()=>s(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 y=new Blob([new Uint8Array(c)],{type:"image/png"});Q.src=c.byteLength?URL.createObjectURL(y):Ie},o.e=K,o.f=function(c,s){return gt(K(c,{type:"json"}),s)},o.g=ze,o.h=Et,o.i=Ee,o.j=t1,o.k=_1,o.l=pt,o.m=gt,o.n=function(c){return new Ph(c).readFields(yK,[])},o.o=function(c,s,Q){if(!c.length)return Q(null,[]);let y=c.length;const x=new Array(c.length);let C=null;c.forEach((S,O)=>{s(S,(B,j)=>{B&&(C=B),x[O]=j,--y==0&&Q(C,x)})})},o.p=dL,o.q=M0,o.r=l2,o.s=mt,o.t=Th,o.u=ht,o.v=Pe,o.w=Re,o.x=L5,o.y=I4,o.z=function([c,s,Q]){return s+=90,s*=Math.PI/180,Q*=Math.PI/180,{x:c*Math.cos(s)*Math.sin(Q),y:c*Math.sin(s)*Math.sin(Q),z:c*Math.cos(Q)}}}),a(["./shared"],function(o){class f{constructor(U){this.keyCache={},U&&this.replace(U)}replace(U){this._layerConfigs={},this._layers={},this.update(U,[])}update(U,J){for(const Qe of U){this._layerConfigs[Qe.id]=Qe;const he=this._layers[Qe.id]=o.aC(Qe);he._featureFilter=o.a6(he.filter),this.keyCache[Qe.id]&&delete this.keyCache[Qe.id]}for(const Qe of J)delete this.keyCache[Qe],delete this._layerConfigs[Qe],delete this._layers[Qe];this.familiesBySource={};const oe=o.bl(Object.values(this._layerConfigs),this.keyCache);for(const Qe of oe){const he=Qe.map(Fe=>this._layers[Fe.id]),Le=he[0];if(Le.visibility==="none")continue;const _e=Le.source||"";let me=this.familiesBySource[_e];me||(me=this.familiesBySource[_e]={});const be=Le.sourceLayer||"_geojsonTileLayer";let Be=me[be];Be||(Be=me[be]=[]),Be.push(he)}}}class h{constructor(U){const J={},oe=[];for(const _e in U){const me=U[_e],be=J[_e]={};for(const Be in me){const Fe=me[+Be];if(!Fe||Fe.bitmap.width===0||Fe.bitmap.height===0)continue;const qe={x:0,y:0,w:Fe.bitmap.width+2,h:Fe.bitmap.height+2};oe.push(qe),be[Be]={rect:qe,metrics:Fe.metrics}}}const{w:Qe,h:he}=o.p(oe),Le=new o.q({width:Qe||1,height:he||1});for(const _e in U){const me=U[_e];for(const be in me){const Be=me[+be];if(!Be||Be.bitmap.width===0||Be.bitmap.height===0)continue;const Fe=J[_e][be].rect;o.q.copy(Be.bitmap,Le,{x:0,y:0},{x:Fe.x+1,y:Fe.y+1},Be.bitmap)}}this.image=Le,this.positions=J}}o.bm("GlyphAtlas",h);class p{constructor(U){this.tileID=new o.O(U.tileID.overscaledZ,U.tileID.wrap,U.tileID.canonical.z,U.tileID.canonical.x,U.tileID.canonical.y),this.uid=U.uid,this.zoom=U.zoom,this.pixelRatio=U.pixelRatio,this.tileSize=U.tileSize,this.source=U.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=U.showCollisionBoxes,this.collectResourceTiming=!!U.collectResourceTiming,this.returnDependencies=!!U.returnDependencies,this.promoteId=U.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(U,J,oe,Qe,he){this.status="parsing",this.data=U,this.collisionBoxArray=new o.a3;const Le=new o.bn(Object.keys(U.layers).sort()),_e=new o.bo(this.tileID,this.promoteId);_e.bucketLayerIDs=[];const me={},be={featureIndex:_e,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:oe},Be=J.familiesBySource[this.source];for(const h1 in Be){const T1=U.layers[h1];if(!T1)continue;T1.version===1&&o.w(`Vector tile source "${this.source}" layer "${h1}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const j2=Le.encode(h1),D1=[];for(let T2=0;T2<T1.length;T2++){const V2=T1.feature(T2),j3=_e.getId(V2,h1);D1.push({feature:V2,id:j3,index:T2,sourceLayerIndex:j2})}for(const T2 of Be[h1]){const V2=T2[0];V2.source!==this.source&&o.w(`layer.source = ${V2.source} does not equal this.source = ${this.source}`),V2.minzoom&&this.zoom<Math.floor(V2.minzoom)||V2.maxzoom&&this.zoom>=V2.maxzoom||V2.visibility!=="none"&&(m(T2,this.zoom,oe),(me[V2.id]=V2.createBucket({index:_e.bucketLayerIDs.length,layers:T2,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:j2,sourceID:this.source})).populate(D1,be,this.tileID.canonical),_e.bucketLayerIDs.push(T2.map(j3=>j3.id)))}}let Fe,qe,Dt,$t;const Lt=o.aH(be.glyphDependencies,h1=>Object.keys(h1).map(Number));this.inFlightDependencies.forEach(h1=>h1==null?void 0:h1.cancel()),this.inFlightDependencies=[];const kt=++this.dependencySentinel;Object.keys(Lt).length?this.inFlightDependencies.push(Qe.send("getGlyphs",{uid:this.uid,stacks:Lt,source:this.source,tileID:this.tileID,type:"glyphs"},(h1,T1)=>{kt===this.dependencySentinel&&(Fe||(Fe=h1,qe=T1,C1.call(this)))})):qe={};const Gt=Object.keys(be.iconDependencies);Gt.length?this.inFlightDependencies.push(Qe.send("getImages",{icons:Gt,source:this.source,tileID:this.tileID,type:"icons"},(h1,T1)=>{kt===this.dependencySentinel&&(Fe||(Fe=h1,Dt=T1,C1.call(this)))})):Dt={};const x1=Object.keys(be.patternDependencies);function C1(){if(Fe)return he(Fe);if(qe&&Dt&&$t){const h1=new h(qe),T1=new o.bp(Dt,$t);for(const j2 in me){const D1=me[j2];D1 instanceof o.a4?(m(D1.layers,this.zoom,oe),o.bq({bucket:D1,glyphMap:qe,glyphPositions:h1.positions,imageMap:Dt,imagePositions:T1.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):D1.hasPattern&&(D1 instanceof o.br||D1 instanceof o.bs||D1 instanceof o.bt)&&(m(D1.layers,this.zoom,oe),D1.addFeatures(be,this.tileID.canonical,T1.patternPositions))}this.status="done",he(null,{buckets:Object.values(me).filter(j2=>!j2.isEmpty()),featureIndex:_e,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:h1.image,imageAtlas:T1,glyphMap:this.returnDependencies?qe:null,iconMap:this.returnDependencies?Dt:null,glyphPositions:this.returnDependencies?h1.positions:null})}}x1.length?this.inFlightDependencies.push(Qe.send("getImages",{icons:x1,source:this.source,tileID:this.tileID,type:"patterns"},(h1,T1)=>{kt===this.dependencySentinel&&(Fe||(Fe=h1,$t=T1,C1.call(this)))})):$t={},C1.call(this)}}function m(ne,U,J){const oe=new o.a8(U);for(const Qe of ne)Qe.recalculate(oe,J)}function g(ne,U){const J=o.l(ne.request,(oe,Qe,he,Le)=>{if(oe)U(oe);else if(Qe)try{const _e=new o.bw.VectorTile(new o.bv(Qe));U(null,{vectorTile:_e,rawData:Qe,cacheControl:he,expires:Le})}catch(_e){const me=new Uint8Array(Qe);let be=`Unable to parse the tile at ${ne.request.url}, `;be+=me[0]===31&&me[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${_e.messge}`,U(new Error(be))}});return()=>{J.cancel(),U()}}class v{constructor(U,J,oe,Qe){this.actor=U,this.layerIndex=J,this.availableImages=oe,this.loadVectorData=Qe||g,this.fetching={},this.loading={},this.loaded={}}loadTile(U,J){const oe=U.uid;this.loading||(this.loading={});const Qe=!!(U&&U.request&&U.request.collectResourceTiming)&&new o.bu(U.request),he=this.loading[oe]=new p(U);he.abort=this.loadVectorData(U,(Le,_e)=>{if(delete this.loading[oe],Le||!_e)return he.status="done",this.loaded[oe]=he,J(Le);const me=_e.rawData,be={};_e.expires&&(be.expires=_e.expires),_e.cacheControl&&(be.cacheControl=_e.cacheControl);const Be={};if(Qe){const Fe=Qe.finish();Fe&&(Be.resourceTiming=JSON.parse(JSON.stringify(Fe)))}he.vectorTile=_e.vectorTile,he.parse(_e.vectorTile,this.layerIndex,this.availableImages,this.actor,(Fe,qe)=>{if(delete this.fetching[oe],Fe||!qe)return J(Fe);J(null,o.e({rawTileData:me.slice(0)},qe,be,Be))}),this.loaded=this.loaded||{},this.loaded[oe]=he,this.fetching[oe]={rawTileData:me,cacheControl:be,resourceTiming:Be}})}reloadTile(U,J){const oe=this.loaded,Qe=U.uid;if(oe&&oe[Qe]){const he=oe[Qe];he.showCollisionBoxes=U.showCollisionBoxes,he.status==="parsing"?he.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor,(Le,_e)=>{if(Le||!_e)return J(Le,_e);let me;if(this.fetching[Qe]){const{rawTileData:be,cacheControl:Be,resourceTiming:Fe}=this.fetching[Qe];delete this.fetching[Qe],me=o.e({rawTileData:be.slice(0)},_e,Be,Fe)}else me=_e;J(null,me)}):he.status==="done"&&(he.vectorTile?he.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor,J):J())}}abortTile(U,J){const oe=this.loading,Qe=U.uid;oe&&oe[Qe]&&oe[Qe].abort&&(oe[Qe].abort(),delete oe[Qe]),J()}removeTile(U,J){const oe=this.loaded,Qe=U.uid;oe&&oe[Qe]&&delete oe[Qe],J()}}class b{constructor(){this.loaded={}}loadTile(U,J){return o._(this,void 0,void 0,function*(){const{uid:oe,encoding:Qe,rawImageData:he,redFactor:Le,greenFactor:_e,blueFactor:me,baseShift:be}=U,Be=he.width+2,Fe=he.height+2,qe=o.a(he)?new o.R({width:Be,height:Fe},yield o.bx(he,-1,-1,Be,Fe)):he,Dt=new o.by(oe,qe,Qe,Le,_e,me,be);this.loaded=this.loaded||{},this.loaded[oe]=Dt,J(null,Dt)})}removeTile(U){const J=this.loaded,oe=U.uid;J&&J[oe]&&delete J[oe]}}function w(ne,U){if(ne.length!==0){E(ne[0],U);for(var J=1;J<ne.length;J++)E(ne[J],!U)}}function E(ne,U){for(var J=0,oe=0,Qe=0,he=ne.length,Le=he-1;Qe<he;Le=Qe++){var _e=(ne[Qe][0]-ne[Le][0])*(ne[Le][1]+ne[Qe][1]),me=J+_e;oe+=Math.abs(J)>=Math.abs(_e)?J-me+_e:_e-me+J,J=me}J+oe>=0!=!!U&&ne.reverse()}var H=o.bz(function ne(U,J){var oe,Qe=U&&U.type;if(Qe==="FeatureCollection")for(oe=0;oe<U.features.length;oe++)ne(U.features[oe],J);else if(Qe==="GeometryCollection")for(oe=0;oe<U.geometries.length;oe++)ne(U.geometries[oe],J);else if(Qe==="Feature")ne(U.geometry,J);else if(Qe==="Polygon")w(U.coordinates,J);else if(Qe==="MultiPolygon")for(oe=0;oe<U.coordinates.length;oe++)w(U.coordinates[oe],J);return U});const V=o.bw.VectorTileFeature.prototype.toGeoJSON;var I={exports:{}},N=o.bA,R=o.bw.VectorTileFeature,z=Z;function Z(ne,U){this.options=U||{},this.features=ne,this.length=ne.length}function K(ne,U){this.id=typeof ne.id=="number"?ne.id:void 0,this.type=ne.type,this.rawGeometry=ne.type===1?[ne.geometry]:ne.geometry,this.properties=ne.tags,this.extent=U||4096}Z.prototype.feature=function(ne){return new K(this.features[ne],this.options.extent)},K.prototype.loadGeometry=function(){var ne=this.rawGeometry;this.geometry=[];for(var U=0;U<ne.length;U++){for(var J=ne[U],oe=[],Qe=0;Qe<J.length;Qe++)oe.push(new N(J[Qe][0],J[Qe][1]));this.geometry.push(oe)}return this.geometry},K.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var ne=this.geometry,U=1/0,J=-1/0,oe=1/0,Qe=-1/0,he=0;he<ne.length;he++)for(var Le=ne[he],_e=0;_e<Le.length;_e++){var me=Le[_e];U=Math.min(U,me.x),J=Math.max(J,me.x),oe=Math.min(oe,me.y),Qe=Math.max(Qe,me.y)}return[U,oe,J,Qe]},K.prototype.toGeoJSON=R.prototype.toGeoJSON;var ee=o.bB,ie=z;function de(ne){var U=new ee;return function(J,oe){for(var Qe in J.layers)oe.writeMessage(3,ge,J.layers[Qe])}(ne,U),U.finish()}function ge(ne,U){var J;U.writeVarintField(15,ne.version||1),U.writeStringField(1,ne.name||""),U.writeVarintField(5,ne.extent||4096);var oe={keys:[],values:[],keycache:{},valuecache:{}};for(J=0;J<ne.length;J++)oe.feature=ne.feature(J),U.writeMessage(2,Ce,oe);var Qe=oe.keys;for(J=0;J<Qe.length;J++)U.writeStringField(3,Qe[J]);var he=oe.values;for(J=0;J<he.length;J++)U.writeMessage(4,Ye,he[J])}function Ce(ne,U){var J=ne.feature;J.id!==void 0&&U.writeVarintField(1,J.id),U.writeMessage(2,Re,ne),U.writeVarintField(3,J.type),U.writeMessage(4,Ee,J)}function Re(ne,U){var J=ne.feature,oe=ne.keys,Qe=ne.values,he=ne.keycache,Le=ne.valuecache;for(var _e in J.properties){var me=J.properties[_e],be=he[_e];if(me!==null){be===void 0&&(oe.push(_e),he[_e]=be=oe.length-1),U.writeVarint(be);var Be=typeof me;Be!=="string"&&Be!=="boolean"&&Be!=="number"&&(me=JSON.stringify(me));var Fe=Be+":"+me,qe=Le[Fe];qe===void 0&&(Qe.push(me),Le[Fe]=qe=Qe.length-1),U.writeVarint(qe)}}}function Ze(ne,U){return(U<<3)+(7&ne)}function tt(ne){return ne<<1^ne>>31}function Ee(ne,U){for(var J=ne.loadGeometry(),oe=ne.type,Qe=0,he=0,Le=J.length,_e=0;_e<Le;_e++){var me=J[_e],be=1;oe===1&&(be=me.length),U.writeVarint(Ze(1,be));for(var Be=oe===3?me.length-1:me.length,Fe=0;Fe<Be;Fe++){Fe===1&&oe!==1&&U.writeVarint(Ze(2,Be-1));var qe=me[Fe].x-Qe,Dt=me[Fe].y-he;U.writeVarint(tt(qe)),U.writeVarint(tt(Dt)),Qe+=qe,he+=Dt}oe===3&&U.writeVarint(Ze(7,1))}}function Ye(ne,U){var J=typeof ne;J==="string"?U.writeStringField(1,ne):J==="boolean"?U.writeBooleanField(7,ne):J==="number"&&(ne%1!=0?U.writeDoubleField(3,ne):ne<0?U.writeSVarintField(6,ne):U.writeVarintField(5,ne))}I.exports=de,I.exports.fromVectorTileJs=de,I.exports.fromGeojsonVt=function(ne,U){U=U||{};var J={};for(var oe in ne)J[oe]=new ie(ne[oe].features,U),J[oe].name=oe,J[oe].version=U.version,J[oe].extent=U.extent;return de({layers:J})},I.exports.GeoJSONWrapper=ie;var Pt=o.bz(I.exports);const Ie={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:ne=>ne},Xe=Math.fround||(Tt=new Float32Array(1),ne=>(Tt[0]=+ne,Tt[0]));var Tt;const Je=3,yt=5,At=6;class Et{constructor(U){this.options=Object.assign(Object.create(Ie),U),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(U){const{log:J,minZoom:oe,maxZoom:Qe}=this.options;J&&console.time("total time");const he=`prepare ${U.length} points`;J&&console.time(he),this.points=U;const Le=[];for(let me=0;me<U.length;me++){const be=U[me];if(!be.geometry)continue;const[Be,Fe]=be.geometry.coordinates,qe=Xe(ut(Be)),Dt=Xe(ze(Fe));Le.push(qe,Dt,1/0,me,-1,1),this.options.reduce&&Le.push(0)}let _e=this.trees[Qe+1]=this._createTree(Le);J&&console.timeEnd(he);for(let me=Qe;me>=oe;me--){const be=+Date.now();_e=this.trees[me]=this._createTree(this._cluster(_e,me)),J&&console.log("z%d: %d clusters in %dms",me,_e.numItems,+Date.now()-be)}return J&&console.timeEnd("total time"),this}getClusters(U,J){let oe=((U[0]+180)%360+360)%360-180;const Qe=Math.max(-90,Math.min(90,U[1]));let he=U[2]===180?180:((U[2]+180)%360+360)%360-180;const Le=Math.max(-90,Math.min(90,U[3]));if(U[2]-U[0]>=360)oe=-180,he=180;else if(oe>he){const Fe=this.getClusters([oe,Qe,180,Le],J),qe=this.getClusters([-180,Qe,he,Le],J);return Fe.concat(qe)}const _e=this.trees[this._limitZoom(J)],me=_e.range(ut(oe),ze(Le),ut(he),ze(Qe)),be=_e.data,Be=[];for(const Fe of me){const qe=this.stride*Fe;Be.push(be[qe+yt]>1?Ve(be,qe,this.clusterProps):this.points[be[qe+Je]])}return Be}getChildren(U){const J=this._getOriginId(U),oe=this._getOriginZoom(U),Qe="No cluster with the specified id.",he=this.trees[oe];if(!he)throw new Error(Qe);const Le=he.data;if(J*this.stride>=Le.length)throw new Error(Qe);const _e=this.options.radius/(this.options.extent*Math.pow(2,oe-1)),me=he.within(Le[J*this.stride],Le[J*this.stride+1],_e),be=[];for(const Be of me){const Fe=Be*this.stride;Le[Fe+4]===U&&be.push(Le[Fe+yt]>1?Ve(Le,Fe,this.clusterProps):this.points[Le[Fe+Je]])}if(be.length===0)throw new Error(Qe);return be}getLeaves(U,J,oe){const Qe=[];return this._appendLeaves(Qe,U,J=J||10,oe=oe||0,0),Qe}getTile(U,J,oe){const Qe=this.trees[this._limitZoom(U)],he=Math.pow(2,U),{extent:Le,radius:_e}=this.options,me=_e/Le,be=(oe-me)/he,Be=(oe+1+me)/he,Fe={features:[]};return this._addTileFeatures(Qe.range((J-me)/he,be,(J+1+me)/he,Be),Qe.data,J,oe,he,Fe),J===0&&this._addTileFeatures(Qe.range(1-me/he,be,1,Be),Qe.data,he,oe,he,Fe),J===he-1&&this._addTileFeatures(Qe.range(0,be,me/he,Be),Qe.data,-1,oe,he,Fe),Fe.features.length?Fe:null}getClusterExpansionZoom(U){let J=this._getOriginZoom(U)-1;for(;J<=this.options.maxZoom;){const oe=this.getChildren(U);if(J++,oe.length!==1)break;U=oe[0].properties.cluster_id}return J}_appendLeaves(U,J,oe,Qe,he){const Le=this.getChildren(J);for(const _e of Le){const me=_e.properties;if(me&&me.cluster?he+me.point_count<=Qe?he+=me.point_count:he=this._appendLeaves(U,me.cluster_id,oe,Qe,he):he<Qe?he++:U.push(_e),U.length===oe)break}return he}_createTree(U){const J=new o.av(U.length/this.stride|0,this.options.nodeSize,Float32Array);for(let oe=0;oe<U.length;oe+=this.stride)J.add(U[oe],U[oe+1]);return J.finish(),J.data=U,J}_addTileFeatures(U,J,oe,Qe,he,Le){for(const _e of U){const me=_e*this.stride,be=J[me+yt]>1;let Be,Fe,qe;if(be)Be=Ne(J,me,this.clusterProps),Fe=J[me],qe=J[me+1];else{const Lt=this.points[J[me+Je]];Be=Lt.properties;const[kt,Gt]=Lt.geometry.coordinates;Fe=ut(kt),qe=ze(Gt)}const Dt={type:1,geometry:[[Math.round(this.options.extent*(Fe*he-oe)),Math.round(this.options.extent*(qe*he-Qe))]],tags:Be};let $t;$t=be||this.options.generateId?J[me+Je]:this.points[J[me+Je]].id,$t!==void 0&&(Dt.id=$t),Le.features.push(Dt)}}_limitZoom(U){return Math.max(this.options.minZoom,Math.min(Math.floor(+U),this.options.maxZoom+1))}_cluster(U,J){const{radius:oe,extent:Qe,reduce:he,minPoints:Le}=this.options,_e=oe/(Qe*Math.pow(2,J)),me=U.data,be=[],Be=this.stride;for(let Fe=0;Fe<me.length;Fe+=Be){if(me[Fe+2]<=J)continue;me[Fe+2]=J;const qe=me[Fe],Dt=me[Fe+1],$t=U.within(me[Fe],me[Fe+1],_e),Lt=me[Fe+yt];let kt=Lt;for(const Gt of $t){const x1=Gt*Be;me[x1+2]>J&&(kt+=me[x1+yt])}if(kt>Lt&&kt>=Le){let Gt,x1=qe*Lt,C1=Dt*Lt,h1=-1;const T1=((Fe/Be|0)<<5)+(J+1)+this.points.length;for(const j2 of $t){const D1=j2*Be;if(me[D1+2]<=J)continue;me[D1+2]=J;const T2=me[D1+yt];x1+=me[D1]*T2,C1+=me[D1+1]*T2,me[D1+4]=T1,he&&(Gt||(Gt=this._map(me,Fe,!0),h1=this.clusterProps.length,this.clusterProps.push(Gt)),he(Gt,this._map(me,D1)))}me[Fe+4]=T1,be.push(x1/kt,C1/kt,1/0,T1,-1,kt),he&&be.push(h1)}else{for(let Gt=0;Gt<Be;Gt++)be.push(me[Fe+Gt]);if(kt>1)for(const Gt of $t){const x1=Gt*Be;if(!(me[x1+2]<=J)){me[x1+2]=J;for(let C1=0;C1<Be;C1++)be.push(me[x1+C1])}}}}return be}_getOriginId(U){return U-this.points.length>>5}_getOriginZoom(U){return(U-this.points.length)%32}_map(U,J,oe){if(U[J+yt]>1){const Le=this.clusterProps[U[J+At]];return oe?Object.assign({},Le):Le}const Qe=this.points[U[J+Je]].properties,he=this.options.map(Qe);return oe&&he===Qe?Object.assign({},he):he}}function Ve(ne,U,J){return{type:"Feature",id:ne[U+Je],properties:Ne(ne,U,J),geometry:{type:"Point",coordinates:[(oe=ne[U],360*(oe-.5)),Ke(ne[U+1])]}};var oe}function Ne(ne,U,J){const oe=ne[U+yt],Qe=oe>=1e4?`${Math.round(oe/1e3)}k`:oe>=1e3?Math.round(oe/100)/10+"k":oe,he=ne[U+At],Le=he===-1?{}:Object.assign({},J[he]);return Object.assign(Le,{cluster:!0,cluster_id:ne[U+Je],point_count:oe,point_count_abbreviated:Qe})}function ut(ne){return ne/360+.5}function ze(ne){const U=Math.sin(ne*Math.PI/180),J=.5-.25*Math.log((1+U)/(1-U))/Math.PI;return J<0?0:J>1?1:J}function Ke(ne){const U=(180-360*ne)*Math.PI/180;return 360*Math.atan(Math.exp(U))/Math.PI-90}function gt(ne,U,J,oe){for(var Qe,he=oe,Le=J-U>>1,_e=J-U,me=ne[U],be=ne[U+1],Be=ne[J],Fe=ne[J+1],qe=U+3;qe<J;qe+=3){var Dt=pt(ne[qe],ne[qe+1],me,be,Be,Fe);if(Dt>he)Qe=qe,he=Dt;else if(Dt===he){var $t=Math.abs(qe-Le);$t<_e&&(Qe=qe,_e=$t)}}he>oe&&(Qe-U>3&&gt(ne,U,Qe,oe),ne[Qe+2]=he,J-Qe>3&&gt(ne,Qe,J,oe))}function pt(ne,U,J,oe,Qe,he){var Le=Qe-J,_e=he-oe;if(Le!==0||_e!==0){var me=((ne-J)*Le+(U-oe)*_e)/(Le*Le+_e*_e);me>1?(J=Qe,oe=he):me>0&&(J+=Le*me,oe+=_e*me)}return(Le=ne-J)*Le+(_e=U-oe)*_e}function mt(ne,U,J,oe){var Qe={id:ne===void 0?null:ne,type:U,geometry:J,tags:oe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(he){var Le=he.geometry,_e=he.type;if(_e==="Point"||_e==="MultiPoint"||_e==="LineString")Ht(he,Le);else if(_e==="Polygon"||_e==="MultiLineString")for(var me=0;me<Le.length;me++)Ht(he,Le[me]);else if(_e==="MultiPolygon")for(me=0;me<Le.length;me++)for(var be=0;be<Le[me].length;be++)Ht(he,Le[me][be])}(Qe),Qe}function Ht(ne,U){for(var J=0;J<U.length;J+=3)ne.minX=Math.min(ne.minX,U[J]),ne.minY=Math.min(ne.minY,U[J+1]),ne.maxX=Math.max(ne.maxX,U[J]),ne.maxY=Math.max(ne.maxY,U[J+1])}function Wt(ne,U,J,oe){if(U.geometry){var Qe=U.geometry.coordinates,he=U.geometry.type,Le=Math.pow(J.tolerance/((1<<J.maxZoom)*J.extent),2),_e=[],me=U.id;if(J.promoteId?me=U.properties[J.promoteId]:J.generateId&&(me=oe||0),he==="Point")_1(Qe,_e);else if(he==="MultiPoint")for(var be=0;be<Qe.length;be++)_1(Qe[be],_e);else if(he==="LineString")t1(Qe,_e,Le,!1);else if(he==="MultiLineString"){if(J.lineMetrics){for(be=0;be<Qe.length;be++)t1(Qe[be],_e=[],Le,!1),ne.push(mt(me,"LineString",_e,U.properties));return}V1(Qe,_e,Le,!1)}else if(he==="Polygon")V1(Qe,_e,Le,!0);else{if(he!=="MultiPolygon"){if(he==="GeometryCollection"){for(be=0;be<U.geometry.geometries.length;be++)Wt(ne,{id:me,geometry:U.geometry.geometries[be],properties:U.properties},J,oe);return}throw new Error("Input data is not a valid GeoJSON object.")}for(be=0;be<Qe.length;be++){var Be=[];V1(Qe[be],Be,Le,!0),_e.push(Be)}}ne.push(mt(me,he,_e,U.properties))}}function _1(ne,U){U.push(Pe(ne[0])),U.push(v1(ne[1])),U.push(0)}function t1(ne,U,J,oe){for(var Qe,he,Le=0,_e=0;_e<ne.length;_e++){var me=Pe(ne[_e][0]),be=v1(ne[_e][1]);U.push(me),U.push(be),U.push(0),_e>0&&(Le+=oe?(Qe*be-me*he)/2:Math.sqrt(Math.pow(me-Qe,2)+Math.pow(be-he,2))),Qe=me,he=be}var Be=U.length-3;U[2]=1,gt(U,0,Be,J),U[Be+2]=1,U.size=Math.abs(Le),U.start=0,U.end=U.size}function V1(ne,U,J,oe){for(var Qe=0;Qe<ne.length;Qe++){var he=[];t1(ne[Qe],he,J,oe),U.push(he)}}function Pe(ne){return ne/360+.5}function v1(ne){var U=Math.sin(ne*Math.PI/180),J=.5-.25*Math.log((1+U)/(1-U))/Math.PI;return J<0?0:J>1?1:J}function P1(ne,U,J,oe,Qe,he,Le,_e){if(oe/=U,he>=(J/=U)&&Le<oe)return ne;if(Le<J||he>=oe)return null;for(var me=[],be=0;be<ne.length;be++){var Be=ne[be],Fe=Be.geometry,qe=Be.type,Dt=Qe===0?Be.minX:Be.minY,$t=Qe===0?Be.maxX:Be.maxY;if(Dt>=J&&$t<oe)me.push(Be);else if(!($t<J||Dt>=oe)){var Lt=[];if(qe==="Point"||qe==="MultiPoint")Q1(Fe,Lt,J,oe,Qe);else if(qe==="LineString")Xt(Fe,Lt,J,oe,Qe,!1,_e.lineMetrics);else if(qe==="MultiLineString")Rt(Fe,Lt,J,oe,Qe,!1);else if(qe==="Polygon")Rt(Fe,Lt,J,oe,Qe,!0);else if(qe==="MultiPolygon")for(var kt=0;kt<Fe.length;kt++){var Gt=[];Rt(Fe[kt],Gt,J,oe,Qe,!0),Gt.length&&Lt.push(Gt)}if(Lt.length){if(_e.lineMetrics&&qe==="LineString"){for(kt=0;kt<Lt.length;kt++)me.push(mt(Be.id,qe,Lt[kt],Be.tags));continue}qe!=="LineString"&&qe!=="MultiLineString"||(Lt.length===1?(qe="LineString",Lt=Lt[0]):qe="MultiLineString"),qe!=="Point"&&qe!=="MultiPoint"||(qe=Lt.length===3?"Point":"MultiPoint"),me.push(mt(Be.id,qe,Lt,Be.tags))}}}return me.length?me:null}function Q1(ne,U,J,oe,Qe){for(var he=0;he<ne.length;he+=3){var Le=ne[he+Qe];Le>=J&&Le<=oe&&(U.push(ne[he]),U.push(ne[he+1]),U.push(ne[he+2]))}}function Xt(ne,U,J,oe,Qe,he,Le){for(var _e,me,be=et(ne),Be=Qe===0?r2:R2,Fe=ne.start,qe=0;qe<ne.length-3;qe+=3){var Dt=ne[qe],$t=ne[qe+1],Lt=ne[qe+2],kt=ne[qe+3],Gt=ne[qe+4],x1=Qe===0?Dt:$t,C1=Qe===0?kt:Gt,h1=!1;Le&&(_e=Math.sqrt(Math.pow(Dt-kt,2)+Math.pow($t-Gt,2))),x1<J?C1>J&&(me=Be(be,Dt,$t,kt,Gt,J),Le&&(be.start=Fe+_e*me)):x1>oe?C1<oe&&(me=Be(be,Dt,$t,kt,Gt,oe),Le&&(be.start=Fe+_e*me)):d1(be,Dt,$t,Lt),C1<J&&x1>=J&&(me=Be(be,Dt,$t,kt,Gt,J),h1=!0),C1>oe&&x1<=oe&&(me=Be(be,Dt,$t,kt,Gt,oe),h1=!0),!he&&h1&&(Le&&(be.end=Fe+_e*me),U.push(be),be=et(ne)),Le&&(Fe+=_e)}var T1=ne.length-3;Dt=ne[T1],$t=ne[T1+1],Lt=ne[T1+2],(x1=Qe===0?Dt:$t)>=J&&x1<=oe&&d1(be,Dt,$t,Lt),T1=be.length-3,he&&T1>=3&&(be[T1]!==be[0]||be[T1+1]!==be[1])&&d1(be,be[0],be[1],be[2]),be.length&&U.push(be)}function et(ne){var U=[];return U.size=ne.size,U.start=ne.start,U.end=ne.end,U}function Rt(ne,U,J,oe,Qe,he){for(var Le=0;Le<ne.length;Le++)Xt(ne[Le],U,J,oe,Qe,he,!1)}function d1(ne,U,J,oe){ne.push(U),ne.push(J),ne.push(oe)}function r2(ne,U,J,oe,Qe,he){var Le=(he-U)/(oe-U);return ne.push(he),ne.push(J+(Qe-J)*Le),ne.push(1),Le}function R2(ne,U,J,oe,Qe,he){var Le=(he-J)/(Qe-J);return ne.push(U+(oe-U)*Le),ne.push(he),ne.push(1),Le}function l3(ne,U){for(var J=[],oe=0;oe<ne.length;oe++){var Qe,he=ne[oe],Le=he.type;if(Le==="Point"||Le==="MultiPoint"||Le==="LineString")Qe=L3(he.geometry,U);else if(Le==="MultiLineString"||Le==="Polygon"){Qe=[];for(var _e=0;_e<he.geometry.length;_e++)Qe.push(L3(he.geometry[_e],U))}else if(Le==="MultiPolygon")for(Qe=[],_e=0;_e<he.geometry.length;_e++){for(var me=[],be=0;be<he.geometry[_e].length;be++)me.push(L3(he.geometry[_e][be],U));Qe.push(me)}J.push(mt(he.id,Le,Qe,he.tags))}return J}function L3(ne,U){var J=[];J.size=ne.size,ne.start!==void 0&&(J.start=ne.start,J.end=ne.end);for(var oe=0;oe<ne.length;oe+=3)J.push(ne[oe]+U,ne[oe+1],ne[oe+2]);return J}function it(ne,U){if(ne.transformed)return ne;var J,oe,Qe,he=1<<ne.z,Le=ne.x,_e=ne.y;for(J=0;J<ne.features.length;J++){var me=ne.features[J],be=me.geometry,Be=me.type;if(me.geometry=[],Be===1)for(oe=0;oe<be.length;oe+=2)me.geometry.push(c3(be[oe],be[oe+1],U,he,Le,_e));else for(oe=0;oe<be.length;oe++){var Fe=[];for(Qe=0;Qe<be[oe].length;Qe+=2)Fe.push(c3(be[oe][Qe],be[oe][Qe+1],U,he,Le,_e));me.geometry.push(Fe)}}return ne.transformed=!0,ne}function c3(ne,U,J,oe,Qe,he){return[Math.round(J*(ne*oe-Qe)),Math.round(J*(U*oe-he))]}function w1(ne,U,J,oe,Qe){for(var he=U===Qe.maxZoom?0:Qe.tolerance/((1<<U)*Qe.extent),Le={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:J,y:oe,z:U,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},_e=0;_e<ne.length;_e++){Le.numFeatures++,R3(Le,ne[_e],he,Qe);var me=ne[_e].minX,be=ne[_e].minY,Be=ne[_e].maxX,Fe=ne[_e].maxY;me<Le.minX&&(Le.minX=me),be<Le.minY&&(Le.minY=be),Be>Le.maxX&&(Le.maxX=Be),Fe>Le.maxY&&(Le.maxY=Fe)}return Le}function R3(ne,U,J,oe){var Qe=U.geometry,he=U.type,Le=[];if(he==="Point"||he==="MultiPoint")for(var _e=0;_e<Qe.length;_e+=3)Le.push(Qe[_e]),Le.push(Qe[_e+1]),ne.numPoints++,ne.numSimplified++;else if(he==="LineString")b3(Le,Qe,ne,J,!1,!1);else if(he==="MultiLineString"||he==="Polygon")for(_e=0;_e<Qe.length;_e++)b3(Le,Qe[_e],ne,J,he==="Polygon",_e===0);else if(he==="MultiPolygon")for(var me=0;me<Qe.length;me++){var be=Qe[me];for(_e=0;_e<be.length;_e++)b3(Le,be[_e],ne,J,!0,_e===0)}if(Le.length){var Be=U.tags||null;if(he==="LineString"&&oe.lineMetrics){for(var Fe in Be={},U.tags)Be[Fe]=U.tags[Fe];Be.mapbox_clip_start=Qe.start/Qe.size,Be.mapbox_clip_end=Qe.end/Qe.size}var qe={geometry:Le,type:he==="Polygon"||he==="MultiPolygon"?3:he==="LineString"||he==="MultiLineString"?2:1,tags:Be};U.id!==null&&(qe.id=U.id),ne.features.push(qe)}}function b3(ne,U,J,oe,Qe,he){var Le=oe*oe;if(oe>0&&U.size<(Qe?Le:oe))J.numPoints+=U.length/3;else{for(var _e=[],me=0;me<U.length;me+=3)(oe===0||U[me+2]>Le)&&(J.numSimplified++,_e.push(U[me]),_e.push(U[me+1])),J.numPoints++;Qe&&function(be,Be){for(var Fe=0,qe=0,Dt=be.length,$t=Dt-2;qe<Dt;$t=qe,qe+=2)Fe+=(be[qe]-be[$t])*(be[qe+1]+be[$t+1]);if(Fe>0===Be)for(qe=0,Dt=be.length;qe<Dt/2;qe+=2){var Lt=be[qe],kt=be[qe+1];be[qe]=be[Dt-2-qe],be[qe+1]=be[Dt-1-qe],be[Dt-2-qe]=Lt,be[Dt-1-qe]=kt}}(_e,he),ne.push(_e)}}function at(ne,U){var J=(U=this.options=function(Qe,he){for(var Le in he)Qe[Le]=he[Le];return Qe}(Object.create(this.options),U)).debug;if(J&&console.time("preprocess data"),U.maxZoom<0||U.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(U.promoteId&&U.generateId)throw new Error("promoteId and generateId cannot be used together.");var oe=function(Qe,he){var Le=[];if(Qe.type==="FeatureCollection")for(var _e=0;_e<Qe.features.length;_e++)Wt(Le,Qe.features[_e],he,_e);else Wt(Le,Qe.type==="Feature"?Qe:{geometry:Qe},he);return Le}(ne,U);this.tiles={},this.tileCoords=[],J&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",U.indexMaxZoom,U.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),oe=function(Qe,he){var Le=he.buffer/he.extent,_e=Qe,me=P1(Qe,1,-1-Le,Le,0,-1,2,he),be=P1(Qe,1,1-Le,2+Le,0,-1,2,he);return(me||be)&&(_e=P1(Qe,1,-Le,1+Le,0,-1,2,he)||[],me&&(_e=l3(me,1).concat(_e)),be&&(_e=_e.concat(l3(be,-1)))),_e}(oe,U),oe.length&&this.splitTile(oe,0,0,0),J&&(oe.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function qt(ne,U,J){return 32*((1<<ne)*J+U)+ne}function jt(ne,U){return U?ne.properties[U]:ne.id}function Q2(ne,U){if(ne==null)return!0;if(ne.type==="Feature")return jt(ne,U)!=null;if(ne.type==="FeatureCollection"){const J=new Set;for(const oe of ne.features){const Qe=jt(oe,U);if(Qe==null||J.has(Qe))return!1;J.add(Qe)}return!0}return!1}function u3(ne,U){const J=new Map;if(ne!=null)if(ne.type==="Feature")J.set(jt(ne,U),ne);else for(const oe of ne.features)J.set(jt(oe,U),oe);return J}at.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},at.prototype.splitTile=function(ne,U,J,oe,Qe,he,Le){for(var _e=[ne,U,J,oe],me=this.options,be=me.debug;_e.length;){oe=_e.pop(),J=_e.pop(),U=_e.pop(),ne=_e.pop();var Be=1<<U,Fe=qt(U,J,oe),qe=this.tiles[Fe];if(!qe&&(be>1&&console.time("creation"),qe=this.tiles[Fe]=w1(ne,U,J,oe,me),this.tileCoords.push({z:U,x:J,y:oe}),be)){be>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",U,J,oe,qe.numFeatures,qe.numPoints,qe.numSimplified),console.timeEnd("creation"));var Dt="z"+U;this.stats[Dt]=(this.stats[Dt]||0)+1,this.total++}if(qe.source=ne,Qe){if(U===me.maxZoom||U===Qe)continue;var $t=1<<Qe-U;if(J!==Math.floor(he/$t)||oe!==Math.floor(Le/$t))continue}else if(U===me.indexMaxZoom||qe.numPoints<=me.indexMaxPoints)continue;if(qe.source=null,ne.length!==0){be>1&&console.time("clipping");var Lt,kt,Gt,x1,C1,h1,T1=.5*me.buffer/me.extent,j2=.5-T1,D1=.5+T1,T2=1+T1;Lt=kt=Gt=x1=null,C1=P1(ne,Be,J-T1,J+D1,0,qe.minX,qe.maxX,me),h1=P1(ne,Be,J+j2,J+T2,0,qe.minX,qe.maxX,me),ne=null,C1&&(Lt=P1(C1,Be,oe-T1,oe+D1,1,qe.minY,qe.maxY,me),kt=P1(C1,Be,oe+j2,oe+T2,1,qe.minY,qe.maxY,me),C1=null),h1&&(Gt=P1(h1,Be,oe-T1,oe+D1,1,qe.minY,qe.maxY,me),x1=P1(h1,Be,oe+j2,oe+T2,1,qe.minY,qe.maxY,me),h1=null),be>1&&console.timeEnd("clipping"),_e.push(Lt||[],U+1,2*J,2*oe),_e.push(kt||[],U+1,2*J,2*oe+1),_e.push(Gt||[],U+1,2*J+1,2*oe),_e.push(x1||[],U+1,2*J+1,2*oe+1)}}},at.prototype.getTile=function(ne,U,J){var oe=this.options,Qe=oe.extent,he=oe.debug;if(ne<0||ne>24)return null;var Le=1<<ne,_e=qt(ne,U=(U%Le+Le)%Le,J);if(this.tiles[_e])return it(this.tiles[_e],Qe);he>1&&console.log("drilling down to z%d-%d-%d",ne,U,J);for(var me,be=ne,Be=U,Fe=J;!me&&be>0;)be--,Be=Math.floor(Be/2),Fe=Math.floor(Fe/2),me=this.tiles[qt(be,Be,Fe)];return me&&me.source?(he>1&&console.log("found parent tile z%d-%d-%d",be,Be,Fe),he>1&&console.time("drilling down"),this.splitTile(me.source,be,Be,Fe,ne,U,J),he>1&&console.timeEnd("drilling down"),this.tiles[_e]?it(this.tiles[_e],Qe):null):null};class Zt extends v{constructor(U,J,oe,Qe){super(U,J,oe),this._dataUpdateable=new Map,this.loadGeoJSON=(he,Le)=>{const{promoteId:_e}=he;if(he.request)return o.f(he.request,(me,be,Be,Fe)=>{this._dataUpdateable=Q2(be,_e)?u3(be,_e):void 0,Le(me,be,Be,Fe)});if(typeof he.data=="string")try{const me=JSON.parse(he.data);this._dataUpdateable=Q2(me,_e)?u3(me,_e):void 0,Le(null,me)}catch{Le(new Error(`Input data given to '${he.source}' is not a valid GeoJSON object.`))}else he.dataDiff?this._dataUpdateable?(function(me,be,Be){var Fe,qe,Dt,$t;if(be.removeAll&&me.clear(),be.remove)for(const Lt of be.remove)me.delete(Lt);if(be.add)for(const Lt of be.add){const kt=jt(Lt,Be);kt!=null&&me.set(kt,Lt)}if(be.update)for(const Lt of be.update){let kt=me.get(Lt.id);if(kt==null)continue;const Gt=!Lt.removeAllProperties&&(((Fe=Lt.removeProperties)===null||Fe===void 0?void 0:Fe.length)>0||((qe=Lt.addOrUpdateProperties)===null||qe===void 0?void 0:qe.length)>0);if((Lt.newGeometry||Lt.removeAllProperties||Gt)&&(kt=Object.assign({},kt),me.set(Lt.id,kt),Gt&&(kt.properties=Object.assign({},kt.properties))),Lt.newGeometry&&(kt.geometry=Lt.newGeometry),Lt.removeAllProperties)kt.properties={};else if(((Dt=Lt.removeProperties)===null||Dt===void 0?void 0:Dt.length)>0)for(const x1 of Lt.removeProperties)Object.prototype.hasOwnProperty.call(kt.properties,x1)&&delete kt.properties[x1];if((($t=Lt.addOrUpdateProperties)===null||$t===void 0?void 0:$t.length)>0)for(const{key:x1,value:C1}of Lt.addOrUpdateProperties)kt.properties[x1]=C1}}(this._dataUpdateable,he.dataDiff,_e),Le(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):Le(new Error(`Cannot update existing geojson data in ${he.source}`)):Le(new Error(`Input data given to '${he.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,Qe&&(this.loadGeoJSON=Qe)}loadGeoJSONTile(U,J){const oe=U.tileID.canonical;if(!this._geoJSONIndex)return J(null,null);const Qe=this._geoJSONIndex.getTile(oe.z,oe.x,oe.y);if(!Qe)return J(null,null);const he=new class{constructor(_e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.N,this.length=_e.length,this._features=_e}feature(_e){return new class{constructor(me){this._feature=me,this.extent=o.N,this.type=me.type,this.properties=me.tags,"id"in me&&!isNaN(me.id)&&(this.id=parseInt(me.id,10))}loadGeometry(){if(this._feature.type===1){const me=[];for(const be of this._feature.geometry)me.push([new o.P(be[0],be[1])]);return me}{const me=[];for(const be of this._feature.geometry){const Be=[];for(const Fe of be)Be.push(new o.P(Fe[0],Fe[1]));me.push(Be)}return me}}toGeoJSON(me,be,Be){return V.call(this,me,be,Be)}}(this._features[_e])}}(Qe.features);let Le=Pt(he);Le.byteOffset===0&&Le.byteLength===Le.buffer.byteLength||(Le=new Uint8Array(Le)),J(null,{vectorTile:he,rawData:Le.buffer})}loadData(U,J){var oe;(oe=this._pendingRequest)===null||oe===void 0||oe.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const Qe=!!(U&&U.request&&U.request.collectResourceTiming)&&new o.bu(U.request);this._pendingCallback=J,this._pendingRequest=this.loadGeoJSON(U,(he,Le)=>{if(delete this._pendingCallback,delete this._pendingRequest,he||!Le)return J(he);if(typeof Le!="object")return J(new Error(`Input data given to '${U.source}' is not a valid GeoJSON object.`));{H(Le,!0);try{if(U.filter){const me=o.bC(U.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(me.result==="error")throw new Error(me.value.map(Be=>`${Be.key}: ${Be.message}`).join(", "));Le={type:"FeatureCollection",features:Le.features.filter(Be=>me.value.evaluate({zoom:0},Be))}}this._geoJSONIndex=U.cluster?new Et(function({superclusterOptions:me,clusterProperties:be}){if(!be||!me)return me;const Be={},Fe={},qe={accumulated:null,zoom:0},Dt={properties:null},$t=Object.keys(be);for(const Lt of $t){const[kt,Gt]=be[Lt],x1=o.bC(Gt),C1=o.bC(typeof kt=="string"?[kt,["accumulated"],["get",Lt]]:kt);Be[Lt]=x1.value,Fe[Lt]=C1.value}return me.map=Lt=>{Dt.properties=Lt;const kt={};for(const Gt of $t)kt[Gt]=Be[Gt].evaluate(qe,Dt);return kt},me.reduce=(Lt,kt)=>{Dt.properties=kt;for(const Gt of $t)qe.accumulated=Lt[Gt],Lt[Gt]=Fe[Gt].evaluate(qe,Dt)},me}(U)).load(Le.features):function(me,be){return new at(me,be)}(Le,U.geojsonVtOptions)}catch(me){return J(me)}this.loaded={};const _e={};if(Qe){const me=Qe.finish();me&&(_e.resourceTiming={},_e.resourceTiming[U.source]=JSON.parse(JSON.stringify(me)))}J(null,_e)}})}reloadTile(U,J){const oe=this.loaded;return oe&&oe[U.uid]?super.reloadTile(U,J):this.loadTile(U,J)}removeSource(U,J){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),J()}getClusterExpansionZoom(U,J){try{J(null,this._geoJSONIndex.getClusterExpansionZoom(U.clusterId))}catch(oe){J(oe)}}getClusterChildren(U,J){try{J(null,this._geoJSONIndex.getChildren(U.clusterId))}catch(oe){J(oe)}}getClusterLeaves(U,J){try{J(null,this._geoJSONIndex.getLeaves(U.clusterId,U.limit,U.offset))}catch(oe){J(oe)}}}class Ae{constructor(U){this.self=U,this.actor=new o.C(U,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:v,geojson:Zt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(J,oe)=>{if(this.workerSourceTypes[J])throw new Error(`Worker source with name "${J}" already registered.`);this.workerSourceTypes[J]=oe},this.self.registerRTLTextPlugin=J=>{if(o.bD.isParsed())throw new Error("RTL text plugin already registered.");o.bD.applyArabicShaping=J.applyArabicShaping,o.bD.processBidirectionalText=J.processBidirectionalText,o.bD.processStyledBidirectionalText=J.processStyledBidirectionalText}}setReferrer(U,J){this.referrer=J}setImages(U,J,oe){this.availableImages[U]=J;for(const Qe in this.workerSources[U]){const he=this.workerSources[U][Qe];for(const Le in he)he[Le].availableImages=J}oe()}setLayers(U,J,oe){this.getLayerIndex(U).replace(J),oe()}updateLayers(U,J,oe){this.getLayerIndex(U).update(J.layers,J.removedIds),oe()}loadTile(U,J,oe){this.getWorkerSource(U,J.type,J.source).loadTile(J,oe)}loadDEMTile(U,J,oe){this.getDEMWorkerSource(U,J.source).loadTile(J,oe)}reloadTile(U,J,oe){this.getWorkerSource(U,J.type,J.source).reloadTile(J,oe)}abortTile(U,J,oe){this.getWorkerSource(U,J.type,J.source).abortTile(J,oe)}removeTile(U,J,oe){this.getWorkerSource(U,J.type,J.source).removeTile(J,oe)}removeDEMTile(U,J){this.getDEMWorkerSource(U,J.source).removeTile(J)}removeSource(U,J,oe){if(!this.workerSources[U]||!this.workerSources[U][J.type]||!this.workerSources[U][J.type][J.source])return;const Qe=this.workerSources[U][J.type][J.source];delete this.workerSources[U][J.type][J.source],Qe.removeSource!==void 0?Qe.removeSource(J,oe):oe()}loadWorkerSource(U,J,oe){try{this.self.importScripts(J.url),oe()}catch(Qe){oe(Qe.toString())}}syncRTLPluginState(U,J,oe){try{o.bD.setState(J);const Qe=o.bD.getPluginURL();if(o.bD.isLoaded()&&!o.bD.isParsed()&&Qe!=null){this.self.importScripts(Qe);const he=o.bD.isParsed();oe(he?void 0:new Error(`RTL Text Plugin failed to import scripts from ${Qe}`),he)}}catch(Qe){oe(Qe.toString())}}getAvailableImages(U){let J=this.availableImages[U];return J||(J=[]),J}getLayerIndex(U){let J=this.layerIndexes[U];return J||(J=this.layerIndexes[U]=new f),J}getWorkerSource(U,J,oe){return this.workerSources[U]||(this.workerSources[U]={}),this.workerSources[U][J]||(this.workerSources[U][J]={}),this.workerSources[U][J][oe]||(this.workerSources[U][J][oe]=new this.workerSourceTypes[J]({send:(Qe,he,Le)=>{this.actor.send(Qe,he,Le,U)}},this.getLayerIndex(U),this.getAvailableImages(U))),this.workerSources[U][J][oe]}getDEMWorkerSource(U,J){return this.demWorkerSources[U]||(this.demWorkerSources[U]={}),this.demWorkerSources[U][J]||(this.demWorkerSources[U][J]=new b),this.demWorkerSources[U][J]}}return o.i()&&(self.worker=new Ae(self)),Ae}),a(["./shared"],function(o){var f="3.6.2";class h{static testProp(l){if(!h.docStyle)return l[0];for(let d=0;d<l.length;d++)if(l[d]in h.docStyle)return l[d];return l[0]}static create(l,d,_){const L=window.document.createElement(l);return d!==void 0&&(L.className=d),_&&_.appendChild(L),L}static createNS(l,d){return window.document.createElementNS(l,d)}static disableDrag(){h.docStyle&&h.selectProp&&(h.userSelect=h.docStyle[h.selectProp],h.docStyle[h.selectProp]="none")}static enableDrag(){h.docStyle&&h.selectProp&&(h.docStyle[h.selectProp]=h.userSelect)}static setTransform(l,d){l.style[h.transformProp]=d}static addEventListener(l,d,_,L={}){l.addEventListener(d,_,"passive"in L?L:L.capture)}static removeEventListener(l,d,_,L={}){l.removeEventListener(d,_,"passive"in L?L:L.capture)}static suppressClickInternal(l){l.preventDefault(),l.stopPropagation(),window.removeEventListener("click",h.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",h.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",h.suppressClickInternal,!0)},0)}static mousePos(l,d){const _=l.getBoundingClientRect();return new o.P(d.clientX-_.left-l.clientLeft,d.clientY-_.top-l.clientTop)}static touchPos(l,d){const _=l.getBoundingClientRect(),L=[];for(let A=0;A<d.length;A++)L.push(new o.P(d[A].clientX-_.left-l.clientLeft,d[A].clientY-_.top-l.clientTop));return L}static mouseButton(l){return l.button}static remove(l){l.parentNode&&l.parentNode.removeChild(l)}}h.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,h.selectProp=h.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),h.transformProp=h.testProp(["transform","WebkitTransform"]);const p={supported:!1,testSupport:function(M){!v&&g&&(b?w(M):m=M)}};let m,g,v=!1,b=!1;function w(M){const l=M.createTexture();M.bindTexture(M.TEXTURE_2D,l);try{if(M.texImage2D(M.TEXTURE_2D,0,M.RGBA,M.RGBA,M.UNSIGNED_BYTE,g),M.isContextLost())return;p.supported=!0}catch{}M.deleteTexture(l),v=!0}var E,H;typeof document<"u"&&(g=document.createElement("img"),g.onload=function(){m&&w(m),m=null,b=!0},g.onerror=function(){v=!0,m=null},g.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(M){let l,d,_,L;M.resetRequestQueue=()=>{l=[],d=0,_=0,L={}},M.addThrottleControl=$=>{const G=_++;return L[G]=$,G},M.removeThrottleControl=$=>{delete L[$],P()},M.getImage=($,G,W=!0)=>{p.supported&&($.headers||($.headers={}),$.headers.accept="image/webp,*/*");const te={requestParameters:$,supportImageRefresh:W,callback:G,cancelled:!1,completed:!1,cancel:()=>{te.completed||te.cancelled||(te.cancelled=!0,te.innerRequest&&(te.innerRequest.cancel(),d--),P())}};return l.push(te),P(),te};const A=$=>{const{requestParameters:G,supportImageRefresh:W,callback:te}=$;return o.e(G,{type:"image"}),(W!==!1||o.i()||o.g(G.url)||G.headers&&!Object.keys(G.headers).reduce((ue,ce)=>ue&&ce==="accept",!0)?o.m:F)(G,(ue,ce,Te,se)=>{k($,te,ue,ce,Te,se)})},k=($,G,W,te,ue,ce)=>{W?G(W):te instanceof HTMLImageElement||o.a(te)?G(null,te):te&&((Te,se)=>{typeof createImageBitmap=="function"?o.b(Te,se):o.d(Te,se)})(te,(Te,se)=>{Te!=null?G(Te):se!=null&&G(null,se,{cacheControl:ue,expires:ce})}),$.cancelled||($.completed=!0,d--,P())},P=()=>{const $=(()=>{const G=Object.keys(L);let W=!1;if(G.length>0){for(const te of G)if(W=L[te](),W)break}return W})()?o.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:o.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let G=d;G<$&&l.length>0;G++){const W=l.shift();if(W.cancelled){G--;continue}const te=A(W);d++,W.innerRequest=te}},F=($,G)=>{const W=new Image,te=$.url;let ue=!1;const ce=$.credentials;return ce&&ce==="include"?W.crossOrigin="use-credentials":(ce&&ce==="same-origin"||!o.s(te))&&(W.crossOrigin="anonymous"),W.fetchPriority="high",W.onload=()=>{G(null,W),W.onerror=W.onload=null},W.onerror=()=>{ue||G(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.")),W.onerror=W.onload=null},W.src=te,{cancel:()=>{ue=!0,W.src=""}}}}(E||(E={})),E.resetRequestQueue(),function(M){M.Glyphs="Glyphs",M.Image="Image",M.Source="Source",M.SpriteImage="SpriteImage",M.SpriteJSON="SpriteJSON",M.Style="Style",M.Tile="Tile",M.Unknown="Unknown"}(H||(H={}));class V{constructor(l){this._transformRequestFn=l}transformRequest(l,d){return this._transformRequestFn&&this._transformRequestFn(l,d)||{url:l}}normalizeSpriteURL(l,d,_){const L=function(A){const k=A.match(I);if(!k)throw new Error(`Unable to parse URL "${A}"`);return{protocol:k[1],authority:k[2],path:k[3]||"/",params:k[4]?k[4].split("&"):[]}}(l);return L.path+=`${d}${_}`,function(A){const k=A.params.length?`?${A.params.join("&")}`:"";return`${A.protocol}://${A.authority}${A.path}${k}`}(L)}setTransformRequest(l){this._transformRequestFn=l}}const I=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function N(M){var l=new o.A(3);return l[0]=M[0],l[1]=M[1],l[2]=M[2],l}var R,z=function(M,l,d){return M[0]=l[0]-d[0],M[1]=l[1]-d[1],M[2]=l[2]-d[2],M};R=new o.A(3),o.A!=Float32Array&&(R[0]=0,R[1]=0,R[2]=0);var Z=function(M){var l=M[0],d=M[1];return l*l+d*d};function K(M){const l=[];if(typeof M=="string")l.push({id:"default",url:M});else if(M&&M.length>0){const d=[];for(const{id:_,url:L}of M){const A=`${_}${L}`;d.indexOf(A)===-1&&(d.push(A),l.push({id:_,url:L}))}}return l}function ee(M,l,d,_,L){if(_)return void M(_);if(L!==Object.values(l).length||L!==Object.values(d).length)return;const A={};for(const k in l){A[k]={};const P=o.h.getImageCanvasContext(d[k]),F=l[k];for(const $ in F){const{width:G,height:W,x:te,y:ue,sdf:ce,pixelRatio:Te,stretchX:se,stretchY:xe,content:Se}=F[$];A[k][$]={data:null,pixelRatio:Te,sdf:ce,stretchX:se,stretchY:xe,content:Se,spriteData:{width:G,height:W,x:te,y:ue,context:P}}}}M(null,A)}(function(){var M=new o.A(2);o.A!=Float32Array&&(M[0]=0,M[1]=0)})();class ie{constructor(l,d,_,L){this.context=l,this.format=_,this.texture=l.gl.createTexture(),this.update(d,L)}update(l,d,_){const{width:L,height:A}=l,k=!(this.size&&this.size[0]===L&&this.size[1]===A||_),{context:P}=this,{gl:F}=P;if(this.useMipmap=!!(d&&d.useMipmap),F.bindTexture(F.TEXTURE_2D,this.texture),P.pixelStoreUnpackFlipY.set(!1),P.pixelStoreUnpack.set(1),P.pixelStoreUnpackPremultiplyAlpha.set(this.format===F.RGBA&&(!d||d.premultiply!==!1)),k)this.size=[L,A],l instanceof HTMLImageElement||l instanceof HTMLCanvasElement||l instanceof HTMLVideoElement||l instanceof ImageData||o.a(l)?F.texImage2D(F.TEXTURE_2D,0,this.format,this.format,F.UNSIGNED_BYTE,l):F.texImage2D(F.TEXTURE_2D,0,this.format,L,A,0,this.format,F.UNSIGNED_BYTE,l.data);else{const{x:$,y:G}=_||{x:0,y:0};l instanceof HTMLImageElement||l instanceof HTMLCanvasElement||l instanceof HTMLVideoElement||l instanceof ImageData||o.a(l)?F.texSubImage2D(F.TEXTURE_2D,0,$,G,F.RGBA,F.UNSIGNED_BYTE,l):F.texSubImage2D(F.TEXTURE_2D,0,$,G,L,A,F.RGBA,F.UNSIGNED_BYTE,l.data)}this.useMipmap&&this.isSizePowerOfTwo()&&F.generateMipmap(F.TEXTURE_2D)}bind(l,d,_){const{context:L}=this,{gl:A}=L;A.bindTexture(A.TEXTURE_2D,this.texture),_!==A.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(_=A.LINEAR),l!==this.filter&&(A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,l),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,_||l),this.filter=l),d!==this.wrap&&(A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,d),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,d),this.wrap=d)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:l}=this.context;l.deleteTexture(this.texture),this.texture=null}}function de(M){const{userImage:l}=M;return!!(l&&l.render&&l.render())&&(M.data.replace(new Uint8Array(l.data.buffer)),!0)}class ge extends o.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(l){if(this.loaded!==l&&(this.loaded=l,l)){for(const{ids:d,callback:_}of this.requestors)this._notify(d,_);this.requestors=[]}}getImage(l){const d=this.images[l];if(d&&!d.data&&d.spriteData){const _=d.spriteData;d.data=new o.R({width:_.width,height:_.height},_.context.getImageData(_.x,_.y,_.width,_.height).data),d.spriteData=null}return d}addImage(l,d){if(this.images[l])throw new Error(`Image id ${l} already exist, use updateImage instead`);this._validate(l,d)&&(this.images[l]=d)}_validate(l,d){let _=!0;const L=d.data||d.spriteData;return this._validateStretch(d.stretchX,L&&L.width)||(this.fire(new o.j(new Error(`Image "${l}" has invalid "stretchX" value`))),_=!1),this._validateStretch(d.stretchY,L&&L.height)||(this.fire(new o.j(new Error(`Image "${l}" has invalid "stretchY" value`))),_=!1),this._validateContent(d.content,d)||(this.fire(new o.j(new Error(`Image "${l}" has invalid "content" value`))),_=!1),_}_validateStretch(l,d){if(!l)return!0;let _=0;for(const L of l){if(L[0]<_||L[1]<L[0]||d<L[1])return!1;_=L[1]}return!0}_validateContent(l,d){if(!l)return!0;if(l.length!==4)return!1;const _=d.spriteData,L=_&&_.width||d.data.width,A=_&&_.height||d.data.height;return!(l[0]<0||L<l[0]||l[1]<0||A<l[1]||l[2]<0||L<l[2]||l[3]<0||A<l[3]||l[2]<l[0]||l[3]<l[1])}updateImage(l,d,_=!0){const L=this.getImage(l);if(_&&(L.data.width!==d.data.width||L.data.height!==d.data.height))throw new Error(`size mismatch between old image (${L.data.width}x${L.data.height}) and new image (${d.data.width}x${d.data.height}).`);d.version=L.version+1,this.images[l]=d,this.updatedImages[l]=!0}removeImage(l){const d=this.images[l];delete this.images[l],delete this.patterns[l],d.userImage&&d.userImage.onRemove&&d.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(l,d){let _=!0;if(!this.isLoaded())for(const L of l)this.images[L]||(_=!1);this.isLoaded()||_?this._notify(l,d):this.requestors.push({ids:l,callback:d})}_notify(l,d){const _={};for(const L of l){let A=this.getImage(L);A||(this.fire(new o.k("styleimagemissing",{id:L})),A=this.getImage(L)),A?_[L]={data:A.data.clone(),pixelRatio:A.pixelRatio,sdf:A.sdf,version:A.version,stretchX:A.stretchX,stretchY:A.stretchY,content:A.content,hasRenderCallback:!!(A.userImage&&A.userImage.render)}:o.w(`Image "${L}" 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.`)}d(null,_)}getPixelSize(){const{width:l,height:d}=this.atlasImage;return{width:l,height:d}}getPattern(l){const d=this.patterns[l],_=this.getImage(l);if(!_)return null;if(d&&d.position.version===_.version)return d.position;if(d)d.position.version=_.version;else{const L={w:_.data.width+2,h:_.data.height+2,x:0,y:0},A=new o.I(L,_);this.patterns[l]={bin:L,position:A}}return this._updatePatternAtlas(),this.patterns[l].position}bind(l){const d=l.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ie(l,this.atlasImage,d.RGBA),this.atlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE)}_updatePatternAtlas(){const l=[];for(const A in this.patterns)l.push(this.patterns[A].bin);const{w:d,h:_}=o.p(l),L=this.atlasImage;L.resize({width:d||1,height:_||1});for(const A in this.patterns){const{bin:k}=this.patterns[A],P=k.x+1,F=k.y+1,$=this.getImage(A).data,G=$.width,W=$.height;o.R.copy($,L,{x:0,y:0},{x:P,y:F},{width:G,height:W}),o.R.copy($,L,{x:0,y:W-1},{x:P,y:F-1},{width:G,height:1}),o.R.copy($,L,{x:0,y:0},{x:P,y:F+W},{width:G,height:1}),o.R.copy($,L,{x:G-1,y:0},{x:P-1,y:F},{width:1,height:W}),o.R.copy($,L,{x:0,y:0},{x:P+G,y:F},{width:1,height:W})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(l){for(const d of l){if(this.callbackDispatchedThisFrame[d])continue;this.callbackDispatchedThisFrame[d]=!0;const _=this.getImage(d);_||o.w(`Image with ID: "${d}" was not found`),de(_)&&this.updateImage(d,_)}}}const Ce=1e20;function Re(M,l,d,_,L,A,k,P,F){for(let $=l;$<l+_;$++)Ze(M,d*A+$,A,L,k,P,F);for(let $=d;$<d+L;$++)Ze(M,$*A+l,1,_,k,P,F)}function Ze(M,l,d,_,L,A,k){A[0]=0,k[0]=-Ce,k[1]=Ce,L[0]=M[l];for(let P=1,F=0,$=0;P<_;P++){L[P]=M[l+P*d];const G=P*P;do{const W=A[F];$=(L[P]-L[W]+G-W*W)/(P-W)/2}while($<=k[F]&&--F>-1);F++,A[F]=P,k[F]=$,k[F+1]=Ce}for(let P=0,F=0;P<_;P++){for(;k[F+1]<P;)F++;const $=A[F],G=P-$;M[l+P*d]=L[$]+G*G}}class tt{constructor(l,d){this.requestManager=l,this.localIdeographFontFamily=d,this.entries={}}setURL(l){this.url=l}getGlyphs(l,d){const _=[];for(const L in l)for(const A of l[L])_.push({stack:L,id:A});o.o(_,({stack:L,id:A},k)=>{let P=this.entries[L];P||(P=this.entries[L]={glyphs:{},requests:{},ranges:{}});let F=P.glyphs[A];if(F!==void 0)return void k(null,{stack:L,id:A,glyph:F});if(F=this._tinySDF(P,L,A),F)return P.glyphs[A]=F,void k(null,{stack:L,id:A,glyph:F});const $=Math.floor(A/256);if(256*$>65535)return void k(new Error("glyphs > 65535 not supported"));if(P.ranges[$])return void k(null,{stack:L,id:A,glyph:F});if(!this.url)return void k(new Error("glyphsUrl is not set"));let G=P.requests[$];G||(G=P.requests[$]=[],tt.loadGlyphRange(L,$,this.url,this.requestManager,(W,te)=>{if(te){for(const ue in te)this._doesCharSupportLocalGlyph(+ue)||(P.glyphs[+ue]=te[+ue]);P.ranges[$]=!0}for(const ue of G)ue(W,te);delete P.requests[$]})),G.push((W,te)=>{W?k(W):te&&k(null,{stack:L,id:A,glyph:te[A]||null})})},(L,A)=>{if(L)d(L);else if(A){const k={};for(const{stack:P,id:F,glyph:$}of A)(k[P]||(k[P]={}))[F]=$&&{id:$.id,bitmap:$.bitmap.clone(),metrics:$.metrics};d(null,k)}})}_doesCharSupportLocalGlyph(l){return!!this.localIdeographFontFamily&&(o.u["CJK Unified Ideographs"](l)||o.u["Hangul Syllables"](l)||o.u.Hiragana(l)||o.u.Katakana(l))}_tinySDF(l,d,_){const L=this.localIdeographFontFamily;if(!L||!this._doesCharSupportLocalGlyph(_))return;let A=l.tinySDF;if(!A){let P="400";/bold/i.test(d)?P="900":/medium/i.test(d)?P="500":/light/i.test(d)&&(P="200"),A=l.tinySDF=new tt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:L,fontWeight:P})}const k=A.draw(String.fromCharCode(_));return{id:_,bitmap:new o.q({width:k.width||60,height:k.height||60},k.data),metrics:{width:k.glyphWidth/2||24,height:k.glyphHeight/2||24,left:k.glyphLeft/2+.5||0,top:k.glyphTop/2-27.5||-8,advance:k.glyphAdvance/2||24,isDoubleResolution:!0}}}}tt.loadGlyphRange=function(M,l,d,_,L){const A=256*l,k=A+255,P=_.transformRequest(d.replace("{fontstack}",M).replace("{range}",`${A}-${k}`),H.Glyphs);o.l(P,(F,$)=>{if(F)L(F);else if($){const G={};for(const W of o.n($))G[W.id]=W;L(null,G)}})},tt.TinySDF=class{constructor({fontSize:M=24,buffer:l=3,radius:d=8,cutoff:_=.25,fontFamily:L="sans-serif",fontWeight:A="normal",fontStyle:k="normal"}={}){this.buffer=l,this.cutoff=_,this.radius=d;const P=this.size=M+4*l,F=this._createCanvas(P),$=this.ctx=F.getContext("2d",{willReadFrequently:!0});$.font=`${k} ${A} ${M}px ${L}`,$.textBaseline="alphabetic",$.textAlign="left",$.fillStyle="black",this.gridOuter=new Float64Array(P*P),this.gridInner=new Float64Array(P*P),this.f=new Float64Array(P),this.z=new Float64Array(P+1),this.v=new Uint16Array(P)}_createCanvas(M){const l=document.createElement("canvas");return l.width=l.height=M,l}draw(M){const{width:l,actualBoundingBoxAscent:d,actualBoundingBoxDescent:_,actualBoundingBoxLeft:L,actualBoundingBoxRight:A}=this.ctx.measureText(M),k=Math.ceil(d),P=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(A-L))),F=Math.min(this.size-this.buffer,k+Math.ceil(_)),$=P+2*this.buffer,G=F+2*this.buffer,W=Math.max($*G,0),te=new Uint8ClampedArray(W),ue={data:te,width:$,height:G,glyphWidth:P,glyphHeight:F,glyphTop:k,glyphLeft:0,glyphAdvance:l};if(P===0||F===0)return ue;const{ctx:ce,buffer:Te,gridInner:se,gridOuter:xe}=this;ce.clearRect(Te,Te,P,F),ce.fillText(M,Te,Te+k);const Se=ce.getImageData(Te,Te,P,F);xe.fill(Ce,0,W),se.fill(0,0,W);for(let pe=0;pe<F;pe++)for(let we=0;we<P;we++){const Oe=Se.data[4*(pe*P+we)+3]/255;if(Oe===0)continue;const ke=(pe+Te)*$+we+Te;if(Oe===1)xe[ke]=0,se[ke]=Ce;else{const je=.5-Oe;xe[ke]=je>0?je*je:0,se[ke]=je<0?je*je:0}}Re(xe,0,0,$,G,$,this.f,this.v,this.z),Re(se,Te,Te,P,F,$,this.f,this.v,this.z);for(let pe=0;pe<W;pe++){const we=Math.sqrt(xe[pe])-Math.sqrt(se[pe]);te[pe]=Math.round(255-255*(we/this.radius+this.cutoff))}return ue}};class Ee{constructor(){this.specification=o.v.light.position}possiblyEvaluate(l,d){return o.z(l.expression.evaluate(d))}interpolate(l,d,_){return{x:o.B.number(l.x,d.x,_),y:o.B.number(l.y,d.y,_),z:o.B.number(l.z,d.z,_)}}}let Ye;class Pt extends o.E{constructor(l){super(),Ye=Ye||new o.r({anchor:new o.D(o.v.light.anchor),position:new Ee,color:new o.D(o.v.light.color),intensity:new o.D(o.v.light.intensity)}),this._transitionable=new o.T(Ye),this.setLight(l),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(l,d={}){if(!this._validate(o.t,l,d))for(const _ in l){const L=l[_];_.endsWith("-transition")?this._transitionable.setTransition(_.slice(0,-11),L):this._transitionable.setValue(_,L)}}updateTransitions(l){this._transitioning=this._transitionable.transitioned(l,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(l){this.properties=this._transitioning.possiblyEvaluate(l)}_validate(l,d,_){return(!_||_.validate!==!1)&&o.x(this,l.call(o.y,o.e({value:d,style:{glyphs:!0,sprite:!0},styleSpec:o.v})))}}class Ie{constructor(l,d){this.width=l,this.height=d,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(l,d){const _=l.join(",")+String(d);return this.dashEntry[_]||(this.dashEntry[_]=this.addDash(l,d)),this.dashEntry[_]}getDashRanges(l,d,_){const L=[];let A=l.length%2==1?-l[l.length-1]*_:0,k=l[0]*_,P=!0;L.push({left:A,right:k,isDash:P,zeroLength:l[0]===0});let F=l[0];for(let $=1;$<l.length;$++){P=!P;const G=l[$];A=F*_,F+=G,k=F*_,L.push({left:A,right:k,isDash:P,zeroLength:G===0})}return L}addRoundDash(l,d,_){const L=d/2;for(let A=-_;A<=_;A++){const k=this.width*(this.nextRow+_+A);let P=0,F=l[P];for(let $=0;$<this.width;$++){$/F.right>1&&(F=l[++P]);const G=Math.abs($-F.left),W=Math.abs($-F.right),te=Math.min(G,W);let ue;const ce=A/_*(L+1);if(F.isDash){const Te=L-Math.abs(ce);ue=Math.sqrt(te*te+Te*Te)}else ue=L-Math.sqrt(te*te+ce*ce);this.data[k+$]=Math.max(0,Math.min(255,ue+128))}}}addRegularDash(l){for(let P=l.length-1;P>=0;--P){const F=l[P],$=l[P+1];F.zeroLength?l.splice(P,1):$&&$.isDash===F.isDash&&($.left=F.left,l.splice(P,1))}const d=l[0],_=l[l.length-1];d.isDash===_.isDash&&(d.left=_.left-this.width,_.right=d.right+this.width);const L=this.width*this.nextRow;let A=0,k=l[A];for(let P=0;P<this.width;P++){P/k.right>1&&(k=l[++A]);const F=Math.abs(P-k.left),$=Math.abs(P-k.right),G=Math.min(F,$);this.data[L+P]=Math.max(0,Math.min(255,(k.isDash?G:-G)+128))}}addDash(l,d){const _=d?7:0,L=2*_+1;if(this.nextRow+L>this.height)return o.w("LineAtlas out of space"),null;let A=0;for(let P=0;P<l.length;P++)A+=l[P];if(A!==0){const P=this.width/A,F=this.getDashRanges(l,this.width,P);d?this.addRoundDash(F,P,_):this.addRegularDash(F)}const k={y:(this.nextRow+_+.5)/this.height,height:2*_/this.height,width:A};return this.nextRow+=L,this.dirty=!0,k}bind(l){const d=l.gl;this.texture?(d.bindTexture(d.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,d.texSubImage2D(d.TEXTURE_2D,0,0,0,this.width,this.height,d.ALPHA,d.UNSIGNED_BYTE,this.data))):(this.texture=d.createTexture(),d.bindTexture(d.TEXTURE_2D,this.texture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.REPEAT),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.REPEAT),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texImage2D(d.TEXTURE_2D,0,d.ALPHA,this.width,this.height,0,d.ALPHA,d.UNSIGNED_BYTE,this.data))}}class Xe{constructor(l,d,_){this.workerPool=l,this.actors=[],this.currentActor=0,this.id=_;const L=this.workerPool.acquire(_);for(let A=0;A<L.length;A++){const k=new o.C(L[A],d,_);k.name=`Worker ${A}`,this.actors.push(k)}if(!this.actors.length)throw new Error("No actors found")}broadcast(l,d,_){o.o(this.actors,(L,A)=>{L.send(l,d,A)},_=_||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(l=!0){this.actors.forEach(d=>{d.remove()}),this.actors=[],l&&this.workerPool.release(this.id)}}function Tt(M,l,d){const _=function(L,A){if(L)return d(L);if(A){const k=o.F(o.e(A,M),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);A.vector_layers&&(k.vectorLayers=A.vector_layers,k.vectorLayerIds=k.vectorLayers.map(P=>P.id)),d(null,k)}};return M.url?o.f(l.transformRequest(M.url,H.Source),_):o.h.frame(()=>_(null,M))}class Je{constructor(l,d){l&&(d?this.setSouthWest(l).setNorthEast(d):Array.isArray(l)&&(l.length===4?this.setSouthWest([l[0],l[1]]).setNorthEast([l[2],l[3]]):this.setSouthWest(l[0]).setNorthEast(l[1])))}setNorthEast(l){return this._ne=l instanceof o.L?new o.L(l.lng,l.lat):o.L.convert(l),this}setSouthWest(l){return this._sw=l instanceof o.L?new o.L(l.lng,l.lat):o.L.convert(l),this}extend(l){const d=this._sw,_=this._ne;let L,A;if(l instanceof o.L)L=l,A=l;else{if(!(l instanceof Je))return Array.isArray(l)?l.length===4||l.every(Array.isArray)?this.extend(Je.convert(l)):this.extend(o.L.convert(l)):l&&("lng"in l||"lon"in l)&&"lat"in l?this.extend(o.L.convert(l)):this;if(L=l._sw,A=l._ne,!L||!A)return this}return d||_?(d.lng=Math.min(L.lng,d.lng),d.lat=Math.min(L.lat,d.lat),_.lng=Math.max(A.lng,_.lng),_.lat=Math.max(A.lat,_.lat)):(this._sw=new o.L(L.lng,L.lat),this._ne=new o.L(A.lng,A.lat)),this}getCenter(){return new o.L((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 o.L(this.getWest(),this.getNorth())}getSouthEast(){return new o.L(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(l){const{lng:d,lat:_}=o.L.convert(l);let L=this._sw.lng<=d&&d<=this._ne.lng;return this._sw.lng>this._ne.lng&&(L=this._sw.lng>=d&&d>=this._ne.lng),this._sw.lat<=_&&_<=this._ne.lat&&L}static convert(l){return l instanceof Je?l:l&&new Je(l)}static fromLngLat(l,d=0){const _=360*d/40075017,L=_/Math.cos(Math.PI/180*l.lat);return new Je(new o.L(l.lng-L,l.lat-_),new o.L(l.lng+L,l.lat+_))}}class yt{constructor(l,d,_){this.bounds=Je.convert(this.validateBounds(l)),this.minzoom=d||0,this.maxzoom=_||24}validateBounds(l){return Array.isArray(l)&&l.length===4?[Math.max(-180,l[0]),Math.max(-90,l[1]),Math.min(180,l[2]),Math.min(90,l[3])]:[-180,-90,180,90]}contains(l){const d=Math.pow(2,l.z),_=Math.floor(o.G(this.bounds.getWest())*d),L=Math.floor(o.H(this.bounds.getNorth())*d),A=Math.ceil(o.G(this.bounds.getEast())*d),k=Math.ceil(o.H(this.bounds.getSouth())*d);return l.x>=_&&l.x<A&&l.y>=L&&l.y<k}}class At extends o.E{constructor(l,d,_,L){if(super(),this.load=()=>{this._loaded=!1,this.fire(new o.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Tt(this._options,this.map._requestManager,(A,k)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),A?this.fire(new o.j(A)):k&&(o.e(this,k),k.bounds&&(this.tileBounds=new yt(k.bounds,this.minzoom,this.maxzoom)),this.fire(new o.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>o.e({},this._options),this.id=l,this.dispatcher=_,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.e(this,o.F(d,["url","scheme","tileSize","promoteId"])),this._options=o.e({type:"vector"},d),this._collectResourceTiming=d.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(L)}loaded(){return this._loaded}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}onAdd(l){this.map=l,this.load()}setSourceProperty(l){this._tileJSONRequest&&this._tileJSONRequest.cancel(),l(),this.load()}setTiles(l){return this.setSourceProperty(()=>{this._options.tiles=l}),this}setUrl(l){return this.setSourceProperty(()=>{this.url=l,this._options.url=l}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(l,d){const _=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),L={request:this.map._requestManager.transformRequest(_,H.Tile),uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,tileSize:this.tileSize*l.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function A(k,P){return delete l.request,l.aborted?d(null):k&&k.status!==404?d(k):(P&&P.resourceTiming&&(l.resourceTiming=P.resourceTiming),this.map._refreshExpiredTiles&&P&&l.setExpiryData(P),l.loadVectorData(P,this.map.painter),d(null),void(l.reloadCallback&&(this.loadTile(l,l.reloadCallback),l.reloadCallback=null)))}L.request.collectResourceTiming=this._collectResourceTiming,l.actor&&l.state!=="expired"?l.state==="loading"?l.reloadCallback=d:l.request=l.actor.send("reloadTile",L,A.bind(this)):(l.actor=this.dispatcher.getActor(),l.request=l.actor.send("loadTile",L,A.bind(this)))}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.actor&&l.actor.send("abortTile",{uid:l.uid,type:this.type,source:this.id},void 0)}unloadTile(l){l.unloadVectorData(),l.actor&&l.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Et extends o.E{constructor(l,d,_,L){super(),this.id=l,this.dispatcher=_,this.setEventedParent(L),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.e({type:"raster"},d),o.e(this,o.F(d,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Tt(this._options,this.map._requestManager,(l,d)=>{this._tileJSONRequest=null,this._loaded=!0,l?this.fire(new o.j(l)):d&&(o.e(this,d),d.bounds&&(this.tileBounds=new yt(d.bounds,this.minzoom,this.maxzoom)),this.fire(new o.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(l){this.map=l,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(l){this._tileJSONRequest&&this._tileJSONRequest.cancel(),l(),this.load()}setTiles(l){return this.setSourceProperty(()=>{this._options.tiles=l}),this}serialize(){return o.e({},this._options)}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,d){const _=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);l.request=E.getImage(this.map._requestManager.transformRequest(_,H.Tile),(L,A,k)=>{if(delete l.request,l.aborted)l.state="unloaded",d(null);else if(L)l.state="errored",d(L);else if(A){this.map._refreshExpiredTiles&&k&&l.setExpiryData(k);const P=this.map.painter.context,F=P.gl;l.texture=this.map.painter.getTileTexture(A.width),l.texture?l.texture.update(A,{useMipmap:!0}):(l.texture=new ie(P,A,F.RGBA,{useMipmap:!0}),l.texture.bind(F.LINEAR,F.CLAMP_TO_EDGE,F.LINEAR_MIPMAP_NEAREST),P.extTextureFilterAnisotropic&&F.texParameterf(F.TEXTURE_2D,P.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,P.extTextureFilterAnisotropicMax)),l.state="loaded",d(null)}},this.map._refreshExpiredTiles)}abortTile(l,d){l.request&&(l.request.cancel(),delete l.request),d()}unloadTile(l,d){l.texture&&this.map.painter.saveTileTexture(l.texture),d()}hasTransition(){return!1}}class Ve extends Et{constructor(l,d,_,L){super(l,d,_,L),this.type="raster-dem",this.maxzoom=22,this._options=o.e({type:"raster-dem"},d),this.encoding=d.encoding||"mapbox",this.redFactor=d.redFactor,this.greenFactor=d.greenFactor,this.blueFactor=d.blueFactor,this.baseShift=d.baseShift}loadTile(l,d){const _=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),L=this.map._requestManager.transformRequest(_,H.Tile);function A(k,P){k&&(l.state="errored",d(k)),P&&(l.dem=P,l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0,l.state="loaded",d(null))}l.neighboringTiles=this._getNeighboringTiles(l.tileID),l.request=E.getImage(L,(k,P,F)=>o._(this,void 0,void 0,function*(){if(delete l.request,l.aborted)l.state="unloaded",d(null);else if(k)l.state="errored",d(k);else if(P){this.map._refreshExpiredTiles&&l.setExpiryData(F);const $=o.a(P)&&o.J()?P:yield function(W){return o._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&o.K()){const te=W.width+2,ue=W.height+2;try{return new o.R({width:te,height:ue},yield o.M(W,-1,-1,te,ue))}catch{}}return o.h.getImageData(W,1)})}(P),G={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:$,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",G,A))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(l){const d=l.canonical,_=Math.pow(2,d.z),L=(d.x-1+_)%_,A=d.x===0?l.wrap-1:l.wrap,k=(d.x+1+_)%_,P=d.x+1===_?l.wrap+1:l.wrap,F={};return F[new o.O(l.overscaledZ,A,d.z,L,d.y).key]={backfilled:!1},F[new o.O(l.overscaledZ,P,d.z,k,d.y).key]={backfilled:!1},d.y>0&&(F[new o.O(l.overscaledZ,A,d.z,L,d.y-1).key]={backfilled:!1},F[new o.O(l.overscaledZ,l.wrap,d.z,d.x,d.y-1).key]={backfilled:!1},F[new o.O(l.overscaledZ,P,d.z,k,d.y-1).key]={backfilled:!1}),d.y+1<_&&(F[new o.O(l.overscaledZ,A,d.z,L,d.y+1).key]={backfilled:!1},F[new o.O(l.overscaledZ,l.wrap,d.z,d.x,d.y+1).key]={backfilled:!1},F[new o.O(l.overscaledZ,P,d.z,k,d.y+1).key]={backfilled:!1}),F}unloadTile(l){l.demTexture&&this.map.painter.saveTileTexture(l.demTexture),l.fbo&&(l.fbo.destroy(),delete l.fbo),l.dem&&delete l.dem,delete l.neighboringTiles,l.state="unloaded",l.actor&&l.actor.send("removeDEMTile",{uid:l.uid,source:this.id})}}class Ne extends o.E{constructor(l,d,_,L){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>o.e({},this._options,{type:this.type,data:this._data}),this.id=l,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=_.getActor(),this.setEventedParent(L),this._data=d.data,this._options=o.e({},d),this._collectResourceTiming=d.collectResourceTiming,d.maxzoom!==void 0&&(this.maxzoom=d.maxzoom),d.type&&(this.type=d.type),d.attribution&&(this.attribution=d.attribution),this.promoteId=d.promoteId;const A=o.N/this.tileSize;this.workerOptions=o.e({source:this.id,cluster:d.cluster||!1,geojsonVtOptions:{buffer:(d.buffer!==void 0?d.buffer:128)*A,tolerance:(d.tolerance!==void 0?d.tolerance:.375)*A,extent:o.N,maxZoom:this.maxzoom,lineMetrics:d.lineMetrics||!1,generateId:d.generateId||!1},superclusterOptions:{maxZoom:d.clusterMaxZoom!==void 0?d.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,d.clusterMinPoints||2),extent:o.N,radius:(d.clusterRadius||50)*A,log:!1,generateId:d.generateId||!1},clusterProperties:d.clusterProperties,filter:d.filter},d.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(l){this.map=l,this.load()}setData(l){return this._data=l,this._updateWorkerData(),this}updateData(l){return this._updateWorkerData(l),this}setClusterOptions(l){return this.workerOptions.cluster=l.cluster,l&&(l.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=l.clusterRadius),l.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=l.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(l,d){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:l,source:this.id},d),this}getClusterChildren(l,d){return this.actor.send("geojson.getClusterChildren",{clusterId:l,source:this.id},d),this}getClusterLeaves(l,d,_,L){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:l,limit:d,offset:_},L),this}_updateWorkerData(l){const d=o.e({},this.workerOptions);l?d.dataDiff=l:typeof this._data=="string"?(d.request=this.map._requestManager.transformRequest(o.h.resolveURL(this._data),H.Source),d.request.collectResourceTiming=this._collectResourceTiming):d.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new o.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,d,(_,L)=>{if(this._pendingLoads--,this._removed||L&&L.abandoned)return void this.fire(new o.k("dataabort",{dataType:"source"}));let A=null;if(L&&L.resourceTiming&&L.resourceTiming[this.id]&&(A=L.resourceTiming[this.id].slice(0)),_)return void this.fire(new o.j(_));const k={dataType:"source"};this._collectResourceTiming&&A&&A.length>0&&o.e(k,{resourceTiming:A}),this.fire(new o.k("data",Object.assign(Object.assign({},k),{sourceDataType:"metadata"}))),this.fire(new o.k("data",Object.assign(Object.assign({},k),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(l,d){const _=l.actor?"reloadTile":"loadTile";l.actor=this.actor;const L={type:this.type,uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};l.request=this.actor.send(_,L,(A,k)=>(delete l.request,l.unloadVectorData(),l.aborted?d(null):A?d(A):(l.loadVectorData(k,this.map.painter,_==="reloadTile"),d(null))))}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var ut=o.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class ze extends o.E{constructor(l,d,_,L){super(),this.load=(A,k)=>{this._loaded=!1,this.fire(new o.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=E.getImage(this.map._requestManager.transformRequest(this.url,H.Image),(P,F)=>{this._request=null,this._loaded=!0,P?this.fire(new o.j(P)):F&&(this.image=F,A&&(this.coordinates=A),k&&k(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const A=this.map.painter.context,k=A.gl;this.boundsBuffer||(this.boundsBuffer=A.createVertexBuffer(this._boundsArray,ut.members)),this.boundsSegments||(this.boundsSegments=o.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ie(A,this.image,k.RGBA),this.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE));let P=!1;for(const F in this.tiles){const $=this.tiles[F];$.state!=="loaded"&&($.state="loaded",$.texture=this.texture,P=!0)}P&&this.fire(new o.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=l,this.dispatcher=_,this.coordinates=d.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(L),this.options=d}loaded(){return this._loaded}updateImage(l){return l.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=l.url,this.load(l.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(l){this.map=l,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(l){this.coordinates=l;const d=l.map(o.U.fromLngLat);this.tileID=function(L){let A=1/0,k=1/0,P=-1/0,F=-1/0;for(const te of L)A=Math.min(A,te.x),k=Math.min(k,te.y),P=Math.max(P,te.x),F=Math.max(F,te.y);const $=Math.max(P-A,F-k),G=Math.max(0,Math.floor(-Math.log($)/Math.LN2)),W=Math.pow(2,G);return new o.W(G,Math.floor((A+P)/2*W),Math.floor((k+F)/2*W))}(d),this.minzoom=this.maxzoom=this.tileID.z;const _=d.map(L=>this.tileID.getTilePoint(L)._round());return this._boundsArray=new o.V,this._boundsArray.emplaceBack(_[0].x,_[0].y,0,0),this._boundsArray.emplaceBack(_[1].x,_[1].y,o.N,0),this._boundsArray.emplaceBack(_[3].x,_[3].y,0,o.N),this._boundsArray.emplaceBack(_[2].x,_[2].y,o.N,o.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(l,d){this.tileID&&this.tileID.equals(l.tileID.canonical)?(this.tiles[String(l.tileID.wrap)]=l,l.buckets={},d(null)):(l.state="errored",d(null))}hasTransition(){return!1}}class Ke extends ze{constructor(l,d,_,L){super(l,d,_,L),this.load=()=>{this._loaded=!1;const A=this.options;this.urls=[];for(const k of A.urls)this.urls.push(this.map._requestManager.transformRequest(k,H.Source).url);o.X(this.urls,(k,P)=>{this._loaded=!0,k?this.fire(new o.j(k)):P&&(this.video=P,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const A=this.map.painter.context,k=A.gl;this.boundsBuffer||(this.boundsBuffer=A.createVertexBuffer(this._boundsArray,ut.members)),this.boundsSegments||(this.boundsSegments=o.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE),k.texSubImage2D(k.TEXTURE_2D,0,0,0,k.RGBA,k.UNSIGNED_BYTE,this.video)):(this.texture=new ie(A,this.video,k.RGBA),this.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE));let P=!1;for(const F in this.tiles){const $=this.tiles[F];$.state!=="loaded"&&($.state="loaded",$.texture=this.texture,P=!0)}P&&this.fire(new o.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=d}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const d=this.video.seekable;l<d.start(0)||l>d.end(0)?this.fire(new o.j(new o.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${d.start(0)} and ${d.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class gt extends ze{constructor(l,d,_,L){super(l,d,_,L),this.load=()=>{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 o.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())},this.prepare=()=>{let A=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,A=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,A=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const k=this.map.painter.context,P=k.gl;this.boundsBuffer||(this.boundsBuffer=k.createVertexBuffer(this._boundsArray,ut.members)),this.boundsSegments||(this.boundsSegments=o.S.simpleSegment(0,0,4,2)),this.texture?(A||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ie(k,this.canvas,P.RGBA,{premultiply:!0});let F=!1;for(const $ in this.tiles){const G=this.tiles[$];G.state!=="loaded"&&(G.state="loaded",G.texture=this.texture,F=!0)}F&&this.fire(new o.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),d.coordinates?Array.isArray(d.coordinates)&&d.coordinates.length===4&&!d.coordinates.some(A=>!Array.isArray(A)||A.length!==2||A.some(k=>typeof k!="number"))||this.fire(new o.j(new o.Y(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.j(new o.Y(`sources.${l}`,null,'missing required property "coordinates"'))),d.animate&&typeof d.animate!="boolean"&&this.fire(new o.j(new o.Y(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),d.canvas?typeof d.canvas=="string"||d.canvas instanceof HTMLCanvasElement||this.fire(new o.j(new o.Y(`sources.${l}`,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 o.j(new o.Y(`sources.${l}`,null,'missing required property "canvas"'))),this.options=d,this.animate=d.animate===void 0||d.animate}getCanvas(){return this.canvas}onAdd(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}}const pt={},mt=M=>{switch(M){case"geojson":return Ne;case"image":return ze;case"raster":return Et;case"raster-dem":return Ve;case"vector":return At;case"video":return Ke;case"canvas":return gt}return pt[M]};function Ht(M,l){const d=o.Z();return o.$(d,d,[1,1,0]),o.a0(d,d,[.5*M.width,.5*M.height,1]),o.a1(d,d,M.calculatePosMatrix(l.toUnwrapped()))}function Wt(M,l,d,_,L,A){const k=function(W,te,ue){if(W)for(const ce of W){const Te=te[ce];if(Te&&Te.source===ue&&Te.type==="fill-extrusion")return!0}else for(const ce in te){const Te=te[ce];if(Te.source===ue&&Te.type==="fill-extrusion")return!0}return!1}(L&&L.layers,l,M.id),P=A.maxPitchScaleFactor(),F=M.tilesIn(_,P,k);F.sort(_1);const $=[];for(const W of F)$.push({wrappedTileID:W.tileID.wrapped().key,queryResults:W.tile.queryRenderedFeatures(l,d,M._state,W.queryGeometry,W.cameraQueryGeometry,W.scale,L,A,P,Ht(M.transform,W.tileID))});const G=function(W){const te={},ue={};for(const ce of W){const Te=ce.queryResults,se=ce.wrappedTileID,xe=ue[se]=ue[se]||{};for(const Se in Te){const pe=Te[Se],we=xe[Se]=xe[Se]||{},Oe=te[Se]=te[Se]||[];for(const ke of pe)we[ke.featureIndex]||(we[ke.featureIndex]=!0,Oe.push(ke))}}return te}($);for(const W in G)G[W].forEach(te=>{const ue=te.feature,ce=M.getFeatureState(ue.layer["source-layer"],ue.id);ue.source=ue.layer.source,ue.layer["source-layer"]&&(ue.sourceLayer=ue.layer["source-layer"]),ue.state=ce});return G}function _1(M,l){const d=M.tileID,_=l.tileID;return d.overscaledZ-_.overscaledZ||d.canonical.y-_.canonical.y||d.wrap-_.wrap||d.canonical.x-_.canonical.x}class t1{constructor(l,d){this.timeAdded=0,this.fadeEndTime=0,this.tileID=l,this.uid=o.a2(),this.uses=0,this.tileSize=d,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(l){const d=l+this.timeAdded;d<this.fadeEndTime||(this.fadeEndTime=d)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(l){this.demTexture&&l.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(l,d,_){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",l){l.featureIndex&&(this.latestFeatureIndex=l.featureIndex,l.rawTileData?(this.latestRawTileData=l.rawTileData,this.latestFeatureIndex.rawTileData=l.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=l.collisionBoxArray,this.buckets=function(L,A){const k={};if(!A)return k;for(const P of L){const F=P.layerIds.map($=>A.getLayer($)).filter(Boolean);if(F.length!==0){P.layers=F,P.stateDependentLayerIds&&(P.stateDependentLayers=P.stateDependentLayerIds.map($=>F.filter(G=>G.id===$)[0]));for(const $ of F)k[$.id]=P}}return k}(l.buckets,d.style),this.hasSymbolBuckets=!1;for(const L in this.buckets){const A=this.buckets[L];if(A instanceof o.a4){if(this.hasSymbolBuckets=!0,!_)break;A.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const L in this.buckets){const A=this.buckets[L];if(A instanceof o.a4&&A.hasRTLText){this.hasRTLText=!0,o.a5();break}}this.queryPadding=0;for(const L in this.buckets){const A=this.buckets[L];this.queryPadding=Math.max(this.queryPadding,d.style.getLayer(L).queryRadius(A))}l.imageAtlas&&(this.imageAtlas=l.imageAtlas),l.glyphAtlasImage&&(this.glyphAtlasImage=l.glyphAtlasImage)}else this.collisionBoxArray=new o.a3}unloadVectorData(){for(const l in this.buckets)this.buckets[l].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(l){return this.buckets[l.id]}upload(l){for(const _ in this.buckets){const L=this.buckets[_];L.uploadPending()&&L.upload(l)}const d=l.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ie(l,this.imageAtlas.image,d.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ie(l,this.glyphAtlasImage,d.ALPHA),this.glyphAtlasImage=null)}prepare(l){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(l,this.imageAtlasTexture)}queryRenderedFeatures(l,d,_,L,A,k,P,F,$,G){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:L,cameraQueryGeometry:A,scale:k,tileSize:this.tileSize,pixelPosMatrix:G,transform:F,params:P,queryPadding:this.queryPadding*$},l,d,_):{}}querySourceFeatures(l,d){const _=this.latestFeatureIndex;if(!_||!_.rawTileData)return;const L=_.loadVTLayers(),A=d&&d.sourceLayer?d.sourceLayer:"",k=L._geojsonTileLayer||L[A];if(!k)return;const P=o.a6(d&&d.filter),{z:F,x:$,y:G}=this.tileID.canonical,W={z:F,x:$,y:G};for(let te=0;te<k.length;te++){const ue=k.feature(te);if(P.needGeometry){const se=o.a7(ue,!0);if(!P.filter(new o.a8(this.tileID.overscaledZ),se,this.tileID.canonical))continue}else if(!P.filter(new o.a8(this.tileID.overscaledZ),ue))continue;const ce=_.getId(ue,A),Te=new o.a9(ue,F,$,G,ce);Te.tile=W,l.push(Te)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(l){const d=this.expirationTime;if(l.cacheControl){const _=o.aa(l.cacheControl);_["max-age"]&&(this.expirationTime=Date.now()+1e3*_["max-age"])}else l.expires&&(this.expirationTime=new Date(l.expires).getTime());if(this.expirationTime){const _=Date.now();let L=!1;if(this.expirationTime>_)L=!1;else if(d)if(this.expirationTime<d)L=!0;else{const A=this.expirationTime-d;A?this.expirationTime=_+Math.max(A,3e4):L=!0}else L=!0;L?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(l,d){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(l).length===0)return;const _=this.latestFeatureIndex.loadVTLayers();for(const L in this.buckets){if(!d.style.hasLayer(L))continue;const A=this.buckets[L],k=A.layers[0].sourceLayer||"_geojsonTileLayer",P=_[k],F=l[k];if(!P||!F||Object.keys(F).length===0)continue;A.update(F,P,this.imageAtlas&&this.imageAtlas.patternPositions||{});const $=d&&d.style&&d.style.getLayer(L);$&&(this.queryPadding=Math.max(this.queryPadding,$.queryRadius(A)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(l){this.symbolFadeHoldUntil=o.h.now()+l}setDependencies(l,d){const _={};for(const L of d)_[L]=!0;this.dependencies[l]=_}hasDependency(l,d){for(const _ of l){const L=this.dependencies[_];if(L){for(const A of d)if(L[A])return!0}}return!1}}class V1{constructor(l,d){this.max=l,this.onRemove=d,this.reset()}reset(){for(const l in this.data)for(const d of this.data[l])d.timeout&&clearTimeout(d.timeout),this.onRemove(d.value);return this.data={},this.order=[],this}add(l,d,_){const L=l.wrapped().key;this.data[L]===void 0&&(this.data[L]=[]);const A={value:d,timeout:void 0};if(_!==void 0&&(A.timeout=setTimeout(()=>{this.remove(l,A)},_)),this.data[L].push(A),this.order.push(L),this.order.length>this.max){const k=this._getAndRemoveByKey(this.order[0]);k&&this.onRemove(k)}return this}has(l){return l.wrapped().key in this.data}getAndRemove(l){return this.has(l)?this._getAndRemoveByKey(l.wrapped().key):null}_getAndRemoveByKey(l){const d=this.data[l].shift();return d.timeout&&clearTimeout(d.timeout),this.data[l].length===0&&delete this.data[l],this.order.splice(this.order.indexOf(l),1),d.value}getByKey(l){const d=this.data[l];return d?d[0].value:null}get(l){return this.has(l)?this.data[l.wrapped().key][0].value:null}remove(l,d){if(!this.has(l))return this;const _=l.wrapped().key,L=d===void 0?0:this.data[_].indexOf(d),A=this.data[_][L];return this.data[_].splice(L,1),A.timeout&&clearTimeout(A.timeout),this.data[_].length===0&&delete this.data[_],this.onRemove(A.value),this.order.splice(this.order.indexOf(_),1),this}setMaxSize(l){for(this.max=l;this.order.length>this.max;){const d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this}filter(l){const d=[];for(const _ in this.data)for(const L of this.data[_])l(L.value)||d.push(L);for(const _ of d)this.remove(_.value.tileID,_)}}class Pe{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(l,d,_){const L=String(d);if(this.stateChanges[l]=this.stateChanges[l]||{},this.stateChanges[l][L]=this.stateChanges[l][L]||{},o.e(this.stateChanges[l][L],_),this.deletedStates[l]===null){this.deletedStates[l]={};for(const A in this.state[l])A!==L&&(this.deletedStates[l][A]=null)}else if(this.deletedStates[l]&&this.deletedStates[l][L]===null){this.deletedStates[l][L]={};for(const A in this.state[l][L])_[A]||(this.deletedStates[l][L][A]=null)}else for(const A in _)this.deletedStates[l]&&this.deletedStates[l][L]&&this.deletedStates[l][L][A]===null&&delete this.deletedStates[l][L][A]}removeFeatureState(l,d,_){if(this.deletedStates[l]===null)return;const L=String(d);if(this.deletedStates[l]=this.deletedStates[l]||{},_&&d!==void 0)this.deletedStates[l][L]!==null&&(this.deletedStates[l][L]=this.deletedStates[l][L]||{},this.deletedStates[l][L][_]=null);else if(d!==void 0)if(this.stateChanges[l]&&this.stateChanges[l][L])for(_ in this.deletedStates[l][L]={},this.stateChanges[l][L])this.deletedStates[l][L][_]=null;else this.deletedStates[l][L]=null;else this.deletedStates[l]=null}getState(l,d){const _=String(d),L=o.e({},(this.state[l]||{})[_],(this.stateChanges[l]||{})[_]);if(this.deletedStates[l]===null)return{};if(this.deletedStates[l]){const A=this.deletedStates[l][d];if(A===null)return{};for(const k in A)delete L[k]}return L}initializeTileState(l,d){l.setFeatureState(this.state,d)}coalesceChanges(l,d){const _={};for(const L in this.stateChanges){this.state[L]=this.state[L]||{};const A={};for(const k in this.stateChanges[L])this.state[L][k]||(this.state[L][k]={}),o.e(this.state[L][k],this.stateChanges[L][k]),A[k]=this.state[L][k];_[L]=A}for(const L in this.deletedStates){this.state[L]=this.state[L]||{};const A={};if(this.deletedStates[L]===null)for(const k in this.state[L])A[k]={},this.state[L][k]={};else for(const k in this.deletedStates[L]){if(this.deletedStates[L][k]===null)this.state[L][k]={};else for(const P of Object.keys(this.deletedStates[L][k]))delete this.state[L][k][P];A[k]=this.state[L][k]}_[L]=_[L]||{},o.e(_[L],A)}if(this.stateChanges={},this.deletedStates={},Object.keys(_).length!==0)for(const L in l)l[L].setFeatureState(_,d)}}class v1 extends o.E{constructor(l,d,_){super(),this.id=l,this.dispatcher=_,this.on("data",L=>{L.dataType==="source"&&L.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&L.dataType==="source"&&L.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((L,A,k,P)=>{const F=new(mt(A.type))(L,A,k,P);if(F.id!==L)throw new Error(`Expected Source id to be ${L} instead of ${F.id}`);return F})(l,d,_,this),this._tiles={},this._cache=new V1(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Pe,this._didEmitContent=!1,this._updated=!1}onAdd(l){this.map=l,this._maxTileCacheSize=l?l._maxTileCacheSize:null,this._maxTileCacheZoomLevels=l?l._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(l)}onRemove(l){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(l)}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 l in this._tiles){const d=this._tiles[l];if(d.state!=="loaded"&&d.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const l=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,l&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(l,d){return this._source.loadTile(l,d)}_unloadTile(l){if(this._source.unloadTile)return this._source.unloadTile(l,()=>{})}_abortTile(l){this._source.abortTile&&this._source.abortTile(l,()=>{}),this._source.fire(new o.k("dataabort",{tile:l,coord:l.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(l){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const d in this._tiles){const _=this._tiles[d];_.upload(l),_.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(l=>l.tileID).sort(P1).map(l=>l.key)}getRenderableIds(l){const d=[];for(const _ in this._tiles)this._isIdRenderable(_,l)&&d.push(this._tiles[_]);return l?d.sort((_,L)=>{const A=_.tileID,k=L.tileID,P=new o.P(A.canonical.x,A.canonical.y)._rotate(this.transform.angle),F=new o.P(k.canonical.x,k.canonical.y)._rotate(this.transform.angle);return A.overscaledZ-k.overscaledZ||F.y-P.y||F.x-P.x}).map(_=>_.tileID.key):d.map(_=>_.tileID).sort(P1).map(_=>_.key)}hasRenderableParent(l){const d=this.findLoadedParent(l,0);return!!d&&this._isIdRenderable(d.tileID.key)}_isIdRenderable(l,d){return this._tiles[l]&&this._tiles[l].hasData()&&!this._coveredTiles[l]&&(d||!this._tiles[l].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const l in this._tiles)this._tiles[l].state!=="errored"&&this._reloadTile(l,"reloading")}}_reloadTile(l,d){const _=this._tiles[l];_&&(_.state!=="loading"&&(_.state=d),this._loadTile(_,this._tileLoaded.bind(this,_,l,d)))}_tileLoaded(l,d,_,L){if(L)return l.state="errored",void(L.status!==404?this._source.fire(new o.j(L,{tile:l})):this.update(this.transform,this.terrain));l.timeAdded=o.h.now(),_==="expired"&&(l.refreshedUponExpiration=!0),this._setTileReloadTimer(d,l),this.getSource().type==="raster-dem"&&l.dem&&this._backfillDEM(l),this._state.initializeTileState(l,this.map?this.map.painter:null),l.aborted||this._source.fire(new o.k("data",{dataType:"source",tile:l,coord:l.tileID}))}_backfillDEM(l){const d=this.getRenderableIds();for(let L=0;L<d.length;L++){const A=d[L];if(l.neighboringTiles&&l.neighboringTiles[A]){const k=this.getTileByID(A);_(l,k),_(k,l)}}function _(L,A){L.needsHillshadePrepare=!0,L.needsTerrainPrepare=!0;let k=A.tileID.canonical.x-L.tileID.canonical.x;const P=A.tileID.canonical.y-L.tileID.canonical.y,F=Math.pow(2,L.tileID.canonical.z),$=A.tileID.key;k===0&&P===0||Math.abs(P)>1||(Math.abs(k)>1&&(Math.abs(k+F)===1?k+=F:Math.abs(k-F)===1&&(k-=F)),A.dem&&L.dem&&(L.dem.backfillBorder(A.dem,k,P),L.neighboringTiles&&L.neighboringTiles[$]&&(L.neighboringTiles[$].backfilled=!0)))}}getTile(l){return this.getTileByID(l.key)}getTileByID(l){return this._tiles[l]}_retainLoadedChildren(l,d,_,L){for(const A in this._tiles){let k=this._tiles[A];if(L[A]||!k.hasData()||k.tileID.overscaledZ<=d||k.tileID.overscaledZ>_)continue;let P=k.tileID;for(;k&&k.tileID.overscaledZ>d+1;){const $=k.tileID.scaledTo(k.tileID.overscaledZ-1);k=this._tiles[$.key],k&&k.hasData()&&(P=$)}let F=P;for(;F.overscaledZ>d;)if(F=F.scaledTo(F.overscaledZ-1),l[F.key]){L[P.key]=P;break}}}findLoadedParent(l,d){if(l.key in this._loadedParentTiles){const _=this._loadedParentTiles[l.key];return _&&_.tileID.overscaledZ>=d?_:null}for(let _=l.overscaledZ-1;_>=d;_--){const L=l.scaledTo(_),A=this._getLoadedTile(L);if(A)return A}}_getLoadedTile(l){const d=this._tiles[l.key];return d&&d.hasData()?d:this._cache.getByKey(l.wrapped().key)}updateCacheSize(l){const d=Math.ceil(l.width/this._source.tileSize)+1,_=Math.ceil(l.height/this._source.tileSize)+1,L=Math.floor(d*_*(this._maxTileCacheZoomLevels===null?o.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),A=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,L):L;this._cache.setMaxSize(A)}handleWrapJump(l){const d=Math.round((l-(this._prevLng===void 0?l:this._prevLng))/360);if(this._prevLng=l,d){const _={};for(const L in this._tiles){const A=this._tiles[L];A.tileID=A.tileID.unwrapTo(A.tileID.wrap+d),_[A.tileID.key]=A}this._tiles=_;for(const L in this._timers)clearTimeout(this._timers[L]),delete this._timers[L];for(const L in this._tiles)this._setTileReloadTimer(L,this._tiles[L])}}update(l,d){if(this.transform=l,this.terrain=d,!this._sourceLoaded||this._paused)return;let _;this.updateCacheSize(l),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?_=l.getVisibleUnwrappedCoordinates(this._source.tileID).map(G=>new o.O(G.canonical.z,G.wrap,G.canonical.z,G.canonical.x,G.canonical.y)):(_=l.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:d}),this._source.hasTile&&(_=_.filter(G=>this._source.hasTile(G)))):_=[];const L=l.coveringZoomLevel(this._source),A=Math.max(L-v1.maxOverzooming,this._source.minzoom),k=Math.max(L+v1.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const G={};for(const W of _)if(W.canonical.z>this._source.minzoom){const te=W.scaledTo(W.canonical.z-1);G[te.key]=te;const ue=W.scaledTo(Math.max(this._source.minzoom,Math.min(W.canonical.z,5)));G[ue.key]=ue}_=_.concat(Object.values(G))}const P=_.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,P&&this.fire(new o.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const F=this._updateRetainedTiles(_,L);if(Q1(this._source.type)){const G={},W={},te=Object.keys(F),ue=o.h.now();for(const ce of te){const Te=F[ce],se=this._tiles[ce];if(!se||se.fadeEndTime!==0&&se.fadeEndTime<=ue)continue;const xe=this.findLoadedParent(Te,A);xe&&(this._addTile(xe.tileID),G[xe.tileID.key]=xe.tileID),W[ce]=Te}this._retainLoadedChildren(W,L,k,F);for(const ce in G)F[ce]||(this._coveredTiles[ce]=!0,F[ce]=G[ce]);if(d){const ce={},Te={};for(const se of _)this._tiles[se.key].hasData()?ce[se.key]=se:Te[se.key]=se;for(const se in Te){const xe=Te[se].children(this._source.maxzoom);this._tiles[xe[0].key]&&this._tiles[xe[1].key]&&this._tiles[xe[2].key]&&this._tiles[xe[3].key]&&(ce[xe[0].key]=F[xe[0].key]=xe[0],ce[xe[1].key]=F[xe[1].key]=xe[1],ce[xe[2].key]=F[xe[2].key]=xe[2],ce[xe[3].key]=F[xe[3].key]=xe[3],delete Te[se])}for(const se in Te){const xe=this.findLoadedParent(Te[se],this._source.minzoom);if(xe){ce[xe.tileID.key]=F[xe.tileID.key]=xe.tileID;for(const Se in ce)ce[Se].isChildOf(xe.tileID)&&delete ce[Se]}}for(const se in this._tiles)ce[se]||(this._coveredTiles[se]=!0)}}for(const G in F)this._tiles[G].clearFadeHold();const $=o.ab(this._tiles,F);for(const G of $){const W=this._tiles[G];W.hasSymbolBuckets&&!W.holdingForFade()?W.setHoldDuration(this.map._fadeDuration):W.hasSymbolBuckets&&!W.symbolFadeFinished()||this._removeTile(G)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const l in this._tiles)this._tiles[l].holdingForFade()&&this._removeTile(l)}_updateRetainedTiles(l,d){const _={},L={},A=Math.max(d-v1.maxOverzooming,this._source.minzoom),k=Math.max(d+v1.maxUnderzooming,this._source.minzoom),P={};for(const F of l){const $=this._addTile(F);_[F.key]=F,$.hasData()||d<this._source.maxzoom&&(P[F.key]=F)}this._retainLoadedChildren(P,d,k,_);for(const F of l){let $=this._tiles[F.key];if($.hasData())continue;if(d+1>this._source.maxzoom){const W=F.children(this._source.maxzoom)[0],te=this.getTile(W);if(te&&te.hasData()){_[W.key]=W;continue}}else{const W=F.children(this._source.maxzoom);if(_[W[0].key]&&_[W[1].key]&&_[W[2].key]&&_[W[3].key])continue}let G=$.wasRequested();for(let W=F.overscaledZ-1;W>=A;--W){const te=F.scaledTo(W);if(L[te.key])break;if(L[te.key]=!0,$=this.getTile(te),!$&&G&&($=this._addTile(te)),$){const ue=$.hasData();if((G||ue)&&(_[te.key]=te),G=$.wasRequested(),ue)break}}}return _}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const l in this._tiles){const d=[];let _,L=this._tiles[l].tileID;for(;L.overscaledZ>0;){if(L.key in this._loadedParentTiles){_=this._loadedParentTiles[L.key];break}d.push(L.key);const A=L.scaledTo(L.overscaledZ-1);if(_=this._getLoadedTile(A),_)break;L=A}for(const A of d)this._loadedParentTiles[A]=_}}_addTile(l){let d=this._tiles[l.key];if(d)return d;d=this._cache.getAndRemove(l),d&&(this._setTileReloadTimer(l.key,d),d.tileID=l,this._state.initializeTileState(d,this.map?this.map.painter:null),this._cacheTimers[l.key]&&(clearTimeout(this._cacheTimers[l.key]),delete this._cacheTimers[l.key],this._setTileReloadTimer(l.key,d)));const _=d;return d||(d=new t1(l,this._source.tileSize*l.overscaleFactor()),this._loadTile(d,this._tileLoaded.bind(this,d,l.key,d.state))),d.uses++,this._tiles[l.key]=d,_||this._source.fire(new o.k("dataloading",{tile:d,coord:d.tileID,dataType:"source"})),d}_setTileReloadTimer(l,d){l in this._timers&&(clearTimeout(this._timers[l]),delete this._timers[l]);const _=d.getExpiryTimeout();_&&(this._timers[l]=setTimeout(()=>{this._reloadTile(l,"expired"),delete this._timers[l]},_))}_removeTile(l){const d=this._tiles[l];d&&(d.uses--,delete this._tiles[l],this._timers[l]&&(clearTimeout(this._timers[l]),delete this._timers[l]),d.uses>0||(d.hasData()&&d.state!=="reloading"?this._cache.add(d.tileID,d,d.getExpiryTimeout()):(d.aborted=!0,this._abortTile(d),this._unloadTile(d))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const l in this._tiles)this._removeTile(l);this._cache.reset()}tilesIn(l,d,_){const L=[],A=this.transform;if(!A)return L;const k=_?A.getCameraQueryGeometry(l):l,P=l.map(ce=>A.pointCoordinate(ce,this.terrain)),F=k.map(ce=>A.pointCoordinate(ce,this.terrain)),$=this.getIds();let G=1/0,W=1/0,te=-1/0,ue=-1/0;for(const ce of F)G=Math.min(G,ce.x),W=Math.min(W,ce.y),te=Math.max(te,ce.x),ue=Math.max(ue,ce.y);for(let ce=0;ce<$.length;ce++){const Te=this._tiles[$[ce]];if(Te.holdingForFade())continue;const se=Te.tileID,xe=Math.pow(2,A.zoom-Te.tileID.overscaledZ),Se=d*Te.queryPadding*o.N/Te.tileSize/xe,pe=[se.getTilePoint(new o.U(G,W)),se.getTilePoint(new o.U(te,ue))];if(pe[0].x-Se<o.N&&pe[0].y-Se<o.N&&pe[1].x+Se>=0&&pe[1].y+Se>=0){const we=P.map(ke=>se.getTilePoint(ke)),Oe=F.map(ke=>se.getTilePoint(ke));L.push({tile:Te,tileID:se,queryGeometry:we,cameraQueryGeometry:Oe,scale:xe})}}return L}getVisibleCoordinates(l){const d=this.getRenderableIds(l).map(_=>this._tiles[_].tileID);for(const _ of d)_.posMatrix=this.transform.calculatePosMatrix(_.toUnwrapped());return d}hasTransition(){if(this._source.hasTransition())return!0;if(Q1(this._source.type)){const l=o.h.now();for(const d in this._tiles)if(this._tiles[d].fadeEndTime>=l)return!0}return!1}setFeatureState(l,d,_){this._state.updateState(l=l||"_geojsonTileLayer",d,_)}removeFeatureState(l,d,_){this._state.removeFeatureState(l=l||"_geojsonTileLayer",d,_)}getFeatureState(l,d){return this._state.getState(l=l||"_geojsonTileLayer",d)}setDependencies(l,d,_){const L=this._tiles[l];L&&L.setDependencies(d,_)}reloadTilesForDependencies(l,d){for(const _ in this._tiles)this._tiles[_].hasDependency(l,d)&&this._reloadTile(_,"reloading");this._cache.filter(_=>!_.hasDependency(l,d))}}function P1(M,l){const d=Math.abs(2*M.wrap)-+(M.wrap<0),_=Math.abs(2*l.wrap)-+(l.wrap<0);return M.overscaledZ-l.overscaledZ||_-d||l.canonical.y-M.canonical.y||l.canonical.x-M.canonical.x}function Q1(M){return M==="raster"||M==="image"||M==="video"}v1.maxOverzooming=10,v1.maxUnderzooming=3;const Xt="mapboxgl_preloaded_worker_pool";class et{constructor(){this.active={}}acquire(l){if(!this.workers)for(this.workers=[];this.workers.length<et.workerCount;)this.workers.push(new Worker(o.c.WORKER_URL));return this.active[l]=!0,this.workers.slice()}release(l){delete this.active[l],this.numActive()===0&&(this.workers.forEach(d=>{d.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Xt]}numActive(){return Object.keys(this.active).length}}const Rt=Math.floor(o.h.hardwareConcurrency/2);let d1;function r2(){return d1||(d1=new et),d1}et.workerCount=o.ac(globalThis)?Math.max(Math.min(Rt,3),1):1;class R2{constructor(l,d){this.reset(l,d)}reset(l,d){this.points=l||[],this._distances=[0];for(let _=1;_<this.points.length;_++)this._distances[_]=this._distances[_-1]+this.points[_].dist(this.points[_-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(d||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(l){if(this.points.length===1)return this.points[0];l=o.ad(l,0,1);let d=1,_=this._distances[d];const L=l*this.paddedLength+this.padding;for(;_<L&&d<this._distances.length;)_=this._distances[++d];const A=d-1,k=this._distances[A],P=_-k,F=P>0?(L-k)/P:0;return this.points[A].mult(1-F).add(this.points[d].mult(F))}}function l3(M,l){let d=!0;return M==="always"||M!=="never"&&l!=="never"||(d=!1),d}class L3{constructor(l,d,_){const L=this.boxCells=[],A=this.circleCells=[];this.xCellCount=Math.ceil(l/_),this.yCellCount=Math.ceil(d/_);for(let k=0;k<this.xCellCount*this.yCellCount;k++)L.push([]),A.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=l,this.height=d,this.xScale=this.xCellCount/l,this.yScale=this.yCellCount/d,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(l,d,_,L,A){this._forEachCell(d,_,L,A,this._insertBoxCell,this.boxUid++),this.boxKeys.push(l),this.bboxes.push(d),this.bboxes.push(_),this.bboxes.push(L),this.bboxes.push(A)}insertCircle(l,d,_,L){this._forEachCell(d-L,_-L,d+L,_+L,this._insertCircleCell,this.circleUid++),this.circleKeys.push(l),this.circles.push(d),this.circles.push(_),this.circles.push(L)}_insertBoxCell(l,d,_,L,A,k){this.boxCells[A].push(k)}_insertCircleCell(l,d,_,L,A,k){this.circleCells[A].push(k)}_query(l,d,_,L,A,k,P){if(_<0||l>this.width||L<0||d>this.height)return[];const F=[];if(l<=0&&d<=0&&this.width<=_&&this.height<=L){if(A)return[{key:null,x1:l,y1:d,x2:_,y2:L}];for(let $=0;$<this.boxKeys.length;$++)F.push({key:this.boxKeys[$],x1:this.bboxes[4*$],y1:this.bboxes[4*$+1],x2:this.bboxes[4*$+2],y2:this.bboxes[4*$+3]});for(let $=0;$<this.circleKeys.length;$++){const G=this.circles[3*$],W=this.circles[3*$+1],te=this.circles[3*$+2];F.push({key:this.circleKeys[$],x1:G-te,y1:W-te,x2:G+te,y2:W+te})}}else this._forEachCell(l,d,_,L,this._queryCell,F,{hitTest:A,overlapMode:k,seenUids:{box:{},circle:{}}},P);return F}query(l,d,_,L){return this._query(l,d,_,L,!1,null)}hitTest(l,d,_,L,A,k){return this._query(l,d,_,L,!0,A,k).length>0}hitTestCircle(l,d,_,L,A){const k=l-_,P=l+_,F=d-_,$=d+_;if(P<0||k>this.width||$<0||F>this.height)return!1;const G=[];return this._forEachCell(k,F,P,$,this._queryCellCircle,G,{hitTest:!0,overlapMode:L,circle:{x:l,y:d,radius:_},seenUids:{box:{},circle:{}}},A),G.length>0}_queryCell(l,d,_,L,A,k,P,F){const{seenUids:$,hitTest:G,overlapMode:W}=P,te=this.boxCells[A];if(te!==null){const ce=this.bboxes;for(const Te of te)if(!$.box[Te]){$.box[Te]=!0;const se=4*Te,xe=this.boxKeys[Te];if(l<=ce[se+2]&&d<=ce[se+3]&&_>=ce[se+0]&&L>=ce[se+1]&&(!F||F(xe))&&(!G||!l3(W,xe.overlapMode))&&(k.push({key:xe,x1:ce[se],y1:ce[se+1],x2:ce[se+2],y2:ce[se+3]}),G))return!0}}const ue=this.circleCells[A];if(ue!==null){const ce=this.circles;for(const Te of ue)if(!$.circle[Te]){$.circle[Te]=!0;const se=3*Te,xe=this.circleKeys[Te];if(this._circleAndRectCollide(ce[se],ce[se+1],ce[se+2],l,d,_,L)&&(!F||F(xe))&&(!G||!l3(W,xe.overlapMode))){const Se=ce[se],pe=ce[se+1],we=ce[se+2];if(k.push({key:xe,x1:Se-we,y1:pe-we,x2:Se+we,y2:pe+we}),G)return!0}}}return!1}_queryCellCircle(l,d,_,L,A,k,P,F){const{circle:$,seenUids:G,overlapMode:W}=P,te=this.boxCells[A];if(te!==null){const ce=this.bboxes;for(const Te of te)if(!G.box[Te]){G.box[Te]=!0;const se=4*Te,xe=this.boxKeys[Te];if(this._circleAndRectCollide($.x,$.y,$.radius,ce[se+0],ce[se+1],ce[se+2],ce[se+3])&&(!F||F(xe))&&!l3(W,xe.overlapMode))return k.push(!0),!0}}const ue=this.circleCells[A];if(ue!==null){const ce=this.circles;for(const Te of ue)if(!G.circle[Te]){G.circle[Te]=!0;const se=3*Te,xe=this.circleKeys[Te];if(this._circlesCollide(ce[se],ce[se+1],ce[se+2],$.x,$.y,$.radius)&&(!F||F(xe))&&!l3(W,xe.overlapMode))return k.push(!0),!0}}}_forEachCell(l,d,_,L,A,k,P,F){const $=this._convertToXCellCoord(l),G=this._convertToYCellCoord(d),W=this._convertToXCellCoord(_),te=this._convertToYCellCoord(L);for(let ue=$;ue<=W;ue++)for(let ce=G;ce<=te;ce++)if(A.call(this,l,d,_,L,this.xCellCount*ce+ue,k,P,F))return}_convertToXCellCoord(l){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(l*this.xScale)))}_convertToYCellCoord(l){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(l*this.yScale)))}_circlesCollide(l,d,_,L,A,k){const P=L-l,F=A-d,$=_+k;return $*$>P*P+F*F}_circleAndRectCollide(l,d,_,L,A,k,P){const F=(k-L)/2,$=Math.abs(l-(L+F));if($>F+_)return!1;const G=(P-A)/2,W=Math.abs(d-(A+G));if(W>G+_)return!1;if($<=F||W<=G)return!0;const te=$-F,ue=W-G;return te*te+ue*ue<=_*_}}function it(M,l,d,_,L){const A=o.Z();return l?(o.a0(A,A,[1/L,1/L,1]),d||o.ae(A,A,_.angle)):o.a1(A,_.labelPlaneMatrix,M),A}function c3(M,l,d,_,L){if(l){const A=o.af(M);return o.a0(A,A,[L,L,1]),d||o.ae(A,A,-_.angle),A}return _.glCoordMatrix}function w1(M,l,d){let _;d?(_=[M.x,M.y,d(M.x,M.y),1],o.ag(_,_,l)):(_=[M.x,M.y,0,1],Qe(_,_,l));const L=_[3];return{point:new o.P(_[0]/L,_[1]/L),signedDistanceFromCamera:L}}function R3(M,l){return .5+M/l*.5}function b3(M,l){const d=M[0]/M[3],_=M[1]/M[3];return d>=-l[0]&&d<=l[0]&&_>=-l[1]&&_<=l[1]}function at(M,l,d,_,L,A,k,P,F,$){const G=_?M.textSizeData:M.iconSizeData,W=o.ah(G,d.transform.zoom),te=[256/d.width*2+1,256/d.height*2+1],ue=_?M.text.dynamicLayoutVertexArray:M.icon.dynamicLayoutVertexArray;ue.clear();const ce=M.lineVertexArray,Te=_?M.text.placedSymbolArray:M.icon.placedSymbolArray,se=d.transform.width/d.transform.height;let xe=!1;for(let Se=0;Se<Te.length;Se++){const pe=Te.get(Se);if(pe.hidden||pe.writingMode===o.ai.vertical&&!xe){oe(pe.numGlyphs,ue);continue}let we;if(xe=!1,$?(we=[pe.anchorX,pe.anchorY,$(pe.anchorX,pe.anchorY),1],o.ag(we,we,l)):(we=[pe.anchorX,pe.anchorY,0,1],Qe(we,we,l)),!b3(we,te)){oe(pe.numGlyphs,ue);continue}const Oe=R3(d.transform.cameraToCenterDistance,we[3]),ke=o.aj(G,W,pe),je=k?ke/Oe:ke*Oe,Ue=new o.P(pe.anchorX,pe.anchorY),Ge=w1(Ue,L,$).point,rt={projections:{},offsets:{}},bt=Q2(pe,je,!1,P,l,L,A,M.glyphOffsetArray,ce,ue,Ge,Ue,rt,se,F,$);xe=bt.useVertical,(bt.notEnoughRoom||xe||bt.needsFlipping&&Q2(pe,je,!0,P,l,L,A,M.glyphOffsetArray,ce,ue,Ge,Ue,rt,se,F,$).notEnoughRoom)&&oe(pe.numGlyphs,ue)}_?M.text.dynamicLayoutVertexBuffer.updateData(ue):M.icon.dynamicLayoutVertexBuffer.updateData(ue)}function qt(M,l,d,_,L,A,k,P,F,$,G,W,te){const ue=P.glyphStartIndex+P.numGlyphs,ce=P.lineStartIndex,Te=P.lineStartIndex+P.lineLength,se=l.getoffsetX(P.glyphStartIndex),xe=l.getoffsetX(ue-1),Se=U(M*se,d,_,L,A,k,P.segment,ce,Te,F,$,G,W,te);if(!Se)return null;const pe=U(M*xe,d,_,L,A,k,P.segment,ce,Te,F,$,G,W,te);return pe?{first:Se,last:pe}:null}function jt(M,l,d,_){return M===o.ai.horizontal&&Math.abs(d.y-l.y)>Math.abs(d.x-l.x)*_?{useVertical:!0}:(M===o.ai.vertical?l.y<d.y:l.x>d.x)?{needsFlipping:!0}:null}function Q2(M,l,d,_,L,A,k,P,F,$,G,W,te,ue,ce,Te){const se=l/24,xe=M.lineOffsetX*se,Se=M.lineOffsetY*se;let pe;if(M.numGlyphs>1){const we=M.glyphStartIndex+M.numGlyphs,Oe=M.lineStartIndex,ke=M.lineStartIndex+M.lineLength,je=qt(se,P,xe,Se,d,G,W,M,F,A,te,ce,Te);if(!je)return{notEnoughRoom:!0};const Ue=w1(je.first.point,k,Te).point,Ge=w1(je.last.point,k,Te).point;if(_&&!d){const rt=jt(M.writingMode,Ue,Ge,ue);if(rt)return rt}pe=[je.first];for(let rt=M.glyphStartIndex+1;rt<we-1;rt++)pe.push(U(se*P.getoffsetX(rt),xe,Se,d,G,W,M.segment,Oe,ke,F,A,te,ce,Te));pe.push(je.last)}else{if(_&&!d){const Oe=w1(W,L,Te).point,ke=M.lineStartIndex+M.segment+1,je=new o.P(F.getx(ke),F.gety(ke)),Ue=w1(je,L,Te),Ge=Ue.signedDistanceFromCamera>0?Ue.point:u3(W,je,Oe,1,L,Te),rt=jt(M.writingMode,Oe,Ge,ue);if(rt)return rt}const we=U(se*P.getoffsetX(M.glyphStartIndex),xe,Se,d,G,W,M.segment,M.lineStartIndex,M.lineStartIndex+M.lineLength,F,A,te,ce,Te);if(!we)return{notEnoughRoom:!0};pe=[we]}for(const we of pe)o.ak($,we.point,we.angle);return{}}function u3(M,l,d,_,L,A){const k=w1(M.add(M.sub(l)._unit()),L,A).point,P=d.sub(k);return d.add(P._mult(_/P.mag()))}function Zt(M,l){const{projectionCache:d,lineVertexArray:_,labelPlaneMatrix:L,tileAnchorPoint:A,distanceFromAnchor:k,getElevation:P,previousVertex:F,direction:$,absOffsetX:G}=l;if(d.projections[M])return d.projections[M];const W=new o.P(_.getx(M),_.gety(M)),te=w1(W,L,P);if(te.signedDistanceFromCamera>0)return d.projections[M]=te.point,te.point;const ue=M-$;return u3(k===0?A:new o.P(_.getx(ue),_.gety(ue)),W,F,G-k+1,L,P)}function Ae(M,l,d){return M._unit()._perp()._mult(l*d)}function ne(M,l,d,_,L,A,k,P){const{projectionCache:F,direction:$}=P;if(F.offsets[M])return F.offsets[M];const G=d.add(l);if(M+$<_||M+$>=L)return F.offsets[M]=G,G;const W=Zt(M+$,P),te=Ae(W.sub(d),k,$),ue=d.add(te),ce=W.add(te);return F.offsets[M]=o.al(A,G,ue,ce)||G,F.offsets[M]}function U(M,l,d,_,L,A,k,P,F,$,G,W,te,ue){const ce=_?M-l:M+l;let Te=ce>0?1:-1,se=0;_&&(Te*=-1,se=Math.PI),Te<0&&(se+=Math.PI);let xe,Se,pe=Te>0?P+k:P+k+1,we=L,Oe=L,ke=0,je=0;const Ue=Math.abs(ce),Ge=[];let rt;for(;ke+je<=Ue;){if(pe+=Te,pe<P||pe>=F)return null;ke+=je,Oe=we,Se=xe;const lt={projectionCache:W,lineVertexArray:$,labelPlaneMatrix:G,tileAnchorPoint:A,distanceFromAnchor:ke,getElevation:ue,previousVertex:Oe,direction:Te,absOffsetX:Ue};if(we=Zt(pe,lt),d===0)Ge.push(Oe),rt=we.sub(Oe);else{let Bt;const Mt=we.sub(Oe);Bt=Mt.mag()===0?Ae(Zt(pe+Te,lt).sub(we),d,Te):Ae(Mt,d,Te),Se||(Se=Oe.add(Bt)),xe=ne(pe,Bt,we,P,F,Se,d,lt),Ge.push(Se),rt=xe.sub(Se)}je=rt.mag()}const bt=rt._mult((Ue-ke)/je)._add(Se||Oe),o1=se+Math.atan2(we.y-Oe.y,we.x-Oe.x);return Ge.push(bt),{point:bt,angle:te?o1:0,path:Ge}}const J=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function oe(M,l){for(let d=0;d<M;d++){const _=l.length;l.resize(_+4),l.float32.set(J,3*_)}}function Qe(M,l,d){const _=l[0],L=l[1];return M[0]=d[0]*_+d[4]*L+d[12],M[1]=d[1]*_+d[5]*L+d[13],M[3]=d[3]*_+d[7]*L+d[15],M}const he=100;class Le{constructor(l,d=new L3(l.width+200,l.height+200,25),_=new L3(l.width+200,l.height+200,25)){this.transform=l,this.grid=d,this.ignoredGrid=_,this.pitchfactor=Math.cos(l._pitch)*l.cameraToCenterDistance,this.screenRightBoundary=l.width+he,this.screenBottomBoundary=l.height+he,this.gridRightBoundary=l.width+200,this.gridBottomBoundary=l.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(l,d,_,L,A,k){const P=this.projectAndGetPerspectiveRatio(L,l.anchorPointX,l.anchorPointY,k),F=_*P.perspectiveRatio,$=l.x1*F+P.point.x,G=l.y1*F+P.point.y,W=l.x2*F+P.point.x,te=l.y2*F+P.point.y;return!this.isInsideGrid($,G,W,te)||d!=="always"&&this.grid.hitTest($,G,W,te,d,A)||P.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[$,G,W,te],offscreen:this.isOffscreen($,G,W,te)}}placeCollisionCircles(l,d,_,L,A,k,P,F,$,G,W,te,ue,ce){const Te=[],se=new o.P(d.anchorX,d.anchorY),xe=w1(se,k,ce),Se=R3(this.transform.cameraToCenterDistance,xe.signedDistanceFromCamera),pe=(G?A/Se:A*Se)/o.ap,we=w1(se,P,ce).point,Oe=qt(pe,L,d.lineOffsetX*pe,d.lineOffsetY*pe,!1,we,se,d,_,P,{projections:{},offsets:{}},!1,ce);let ke=!1,je=!1,Ue=!0;if(Oe){const Ge=.5*te*Se+ue,rt=new o.P(-100,-100),bt=new o.P(this.screenRightBoundary,this.screenBottomBoundary),o1=new R2,lt=Oe.first,Bt=Oe.last;let Mt=[];for(let Kt=lt.path.length-1;Kt>=1;Kt--)Mt.push(lt.path[Kt]);for(let Kt=1;Kt<Bt.path.length;Kt++)Mt.push(Bt.path[Kt]);const M1=2.5*Ge;if(F){const Kt=Mt.map(s1=>w1(s1,F,ce));Mt=Kt.some(s1=>s1.signedDistanceFromCamera<=0)?[]:Kt.map(s1=>s1.point)}let a1=[];if(Mt.length>0){const Kt=Mt[0].clone(),s1=Mt[0].clone();for(let n2=1;n2<Mt.length;n2++)Kt.x=Math.min(Kt.x,Mt[n2].x),Kt.y=Math.min(Kt.y,Mt[n2].y),s1.x=Math.max(s1.x,Mt[n2].x),s1.y=Math.max(s1.y,Mt[n2].y);a1=Kt.x>=rt.x&&s1.x<=bt.x&&Kt.y>=rt.y&&s1.y<=bt.y?[Mt]:s1.x<rt.x||Kt.x>bt.x||s1.y<rt.y||Kt.y>bt.y?[]:o.am([Mt],rt.x,rt.y,bt.x,bt.y)}for(const Kt of a1){o1.reset(Kt,.25*Ge);let s1=0;s1=o1.length<=.5*Ge?1:Math.ceil(o1.paddedLength/M1)+1;for(let n2=0;n2<s1;n2++){const O1=n2/Math.max(s1-1,1),O2=o1.lerp(O1),m2=O2.x+he,c2=O2.y+he;Te.push(m2,c2,Ge,0);const S3=m2-Ge,B1=c2-Ge,d4=m2+Ge,f4=c2+Ge;if(Ue=Ue&&this.isOffscreen(S3,B1,d4,f4),je=je||this.isInsideGrid(S3,B1,d4,f4),l!=="always"&&this.grid.hitTestCircle(m2,c2,Ge,l,W)&&(ke=!0,!$))return{circles:[],offscreen:!1,collisionDetected:ke}}}}return{circles:!$&&ke||!je||Se<this.perspectiveRatioCutoff?[]:Te,offscreen:Ue,collisionDetected:ke}}queryRenderedSymbols(l){if(l.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const d=[];let _=1/0,L=1/0,A=-1/0,k=-1/0;for(const G of l){const W=new o.P(G.x+he,G.y+he);_=Math.min(_,W.x),L=Math.min(L,W.y),A=Math.max(A,W.x),k=Math.max(k,W.y),d.push(W)}const P=this.grid.query(_,L,A,k).concat(this.ignoredGrid.query(_,L,A,k)),F={},$={};for(const G of P){const W=G.key;if(F[W.bucketInstanceId]===void 0&&(F[W.bucketInstanceId]={}),F[W.bucketInstanceId][W.featureIndex])continue;const te=[new o.P(G.x1,G.y1),new o.P(G.x2,G.y1),new o.P(G.x2,G.y2),new o.P(G.x1,G.y2)];o.an(d,te)&&(F[W.bucketInstanceId][W.featureIndex]=!0,$[W.bucketInstanceId]===void 0&&($[W.bucketInstanceId]=[]),$[W.bucketInstanceId].push(W.featureIndex))}return $}insertCollisionBox(l,d,_,L,A,k){(_?this.ignoredGrid:this.grid).insert({bucketInstanceId:L,featureIndex:A,collisionGroupID:k,overlapMode:d},l[0],l[1],l[2],l[3])}insertCollisionCircles(l,d,_,L,A,k){const P=_?this.ignoredGrid:this.grid,F={bucketInstanceId:L,featureIndex:A,collisionGroupID:k,overlapMode:d};for(let $=0;$<l.length;$+=4)P.insertCircle(F,l[$],l[$+1],l[$+2])}projectAndGetPerspectiveRatio(l,d,_,L){let A;return L?(A=[d,_,L(d,_),1],o.ag(A,A,l)):(A=[d,_,0,1],Qe(A,A,l)),{point:new o.P((A[0]/A[3]+1)/2*this.transform.width+he,(-A[1]/A[3]+1)/2*this.transform.height+he),perspectiveRatio:.5+this.transform.cameraToCenterDistance/A[3]*.5}}isOffscreen(l,d,_,L){return _<he||l>=this.screenRightBoundary||L<he||d>this.screenBottomBoundary}isInsideGrid(l,d,_,L){return _>=0&&l<this.gridRightBoundary&&L>=0&&d<this.gridBottomBoundary}getViewportMatrix(){const l=o.ao([]);return o.$(l,l,[-100,-100,0]),l}}function _e(M,l,d){return l*(o.N/(M.tileSize*Math.pow(2,d-M.tileID.overscaledZ)))}class me{constructor(l,d,_,L){this.opacity=l?Math.max(0,Math.min(1,l.opacity+(l.placed?d:-d))):L&&_?1:0,this.placed=_}isHidden(){return this.opacity===0&&!this.placed}}class be{constructor(l,d,_,L,A){this.text=new me(l?l.text:null,d,_,A),this.icon=new me(l?l.icon:null,d,L,A)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Be{constructor(l,d,_){this.text=l,this.icon=d,this.skipFade=_}}class Fe{constructor(){this.invProjMatrix=o.Z(),this.viewportMatrix=o.Z(),this.circles=[]}}class qe{constructor(l,d,_,L,A){this.bucketInstanceId=l,this.featureIndex=d,this.sourceLayerIndex=_,this.bucketIndex=L,this.tileID=A}}class Dt{constructor(l){this.crossSourceCollisions=l,this.maxGroupID=0,this.collisionGroups={}}get(l){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[l]){const d=++this.maxGroupID;this.collisionGroups[l]={ID:d,predicate:_=>_.collisionGroupID===d}}return this.collisionGroups[l]}}function $t(M,l,d,_,L){const{horizontalAlign:A,verticalAlign:k}=o.au(M);return new o.P(-(A-.5)*l+_[0]*L,-(k-.5)*d+_[1]*L)}function Lt(M,l,d,_,L,A){const{x1:k,x2:P,y1:F,y2:$,anchorPointX:G,anchorPointY:W}=M,te=new o.P(l,d);return _&&te._rotate(L?A:-A),{x1:k+te.x,y1:F+te.y,x2:P+te.x,y2:$+te.y,anchorPointX:G,anchorPointY:W}}class kt{constructor(l,d,_,L,A){this.transform=l.clone(),this.terrain=d,this.collisionIndex=new Le(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=_,this.retainedQueryData={},this.collisionGroups=new Dt(L),this.collisionCircleArrays={},this.prevPlacement=A,A&&(A.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(l,d,_,L){const A=_.getBucket(d),k=_.latestFeatureIndex;if(!A||!k||d.id!==A.layerIds[0])return;const P=_.collisionBoxArray,F=A.layers[0].layout,$=Math.pow(2,this.transform.zoom-_.tileID.overscaledZ),G=_.tileSize/o.N,W=this.transform.calculatePosMatrix(_.tileID.toUnwrapped()),te=F.get("text-pitch-alignment")==="map",ue=F.get("text-rotation-alignment")==="map",ce=_e(_,1,this.transform.zoom),Te=it(W,te,ue,this.transform,ce);let se=null;if(te){const Se=c3(W,te,ue,this.transform,ce);se=o.a1([],this.transform.labelPlaneMatrix,Se)}this.retainedQueryData[A.bucketInstanceId]=new qe(A.bucketInstanceId,k,A.sourceLayerIndex,A.index,_.tileID);const xe={bucket:A,layout:F,posMatrix:W,textLabelPlaneMatrix:Te,labelToScreenMatrix:se,scale:$,textPixelRatio:G,holdingForFade:_.holdingForFade(),collisionBoxArray:P,partiallyEvaluatedTextSize:o.ah(A.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(A.sourceID)};if(L)for(const Se of A.sortKeyRanges){const{sortKey:pe,symbolInstanceStart:we,symbolInstanceEnd:Oe}=Se;l.push({sortKey:pe,symbolInstanceStart:we,symbolInstanceEnd:Oe,parameters:xe})}else l.push({symbolInstanceStart:0,symbolInstanceEnd:A.symbolInstances.length,parameters:xe})}attemptAnchorPlacement(l,d,_,L,A,k,P,F,$,G,W,te,ue,ce,Te,se){const xe=o.aq[l.textAnchor],Se=[l.textOffset0,l.textOffset1],pe=$t(xe,_,L,Se,A),we=this.collisionIndex.placeCollisionBox(Lt(d,pe.x,pe.y,k,P,this.transform.angle),W,F,$,G.predicate,se);if((!Te||this.collisionIndex.placeCollisionBox(Lt(Te,pe.x,pe.y,k,P,this.transform.angle),W,F,$,G.predicate,se).box.length!==0)&&we.box.length>0){let Oe;if(this.prevPlacement&&this.prevPlacement.variableOffsets[te.crossTileID]&&this.prevPlacement.placements[te.crossTileID]&&this.prevPlacement.placements[te.crossTileID].text&&(Oe=this.prevPlacement.variableOffsets[te.crossTileID].anchor),te.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[te.crossTileID]={textOffset:Se,width:_,height:L,anchor:xe,textBoxScale:A,prevAnchor:Oe},this.markUsedJustification(ue,xe,te,ce),ue.allowVerticalPlacement&&(this.markUsedOrientation(ue,ce,te),this.placedOrientations[te.crossTileID]=ce),{shift:pe,placedGlyphBoxes:we}}}placeLayerBucketPart(l,d,_){const{bucket:L,layout:A,posMatrix:k,textLabelPlaneMatrix:P,labelToScreenMatrix:F,textPixelRatio:$,holdingForFade:G,collisionBoxArray:W,partiallyEvaluatedTextSize:te,collisionGroup:ue}=l.parameters,ce=A.get("text-optional"),Te=A.get("icon-optional"),se=o.ar(A,"text-overlap","text-allow-overlap"),xe=se==="always",Se=o.ar(A,"icon-overlap","icon-allow-overlap"),pe=Se==="always",we=A.get("text-rotation-alignment")==="map",Oe=A.get("text-pitch-alignment")==="map",ke=A.get("icon-text-fit")!=="none",je=A.get("symbol-z-order")==="viewport-y",Ue=xe&&(pe||!L.hasIconData()||Te),Ge=pe&&(xe||!L.hasTextData()||ce);!L.collisionArrays&&W&&L.deserializeCollisionBoxes(W);const rt=this.retainedQueryData[L.bucketInstanceId].tileID,bt=this.terrain?(lt,Bt)=>this.terrain.getElevation(rt,lt,Bt):null,o1=(lt,Bt)=>{var Mt,M1;if(d[lt.crossTileID])return;if(G)return void(this.placements[lt.crossTileID]=new Be(!1,!1,!1));let a1=!1,Kt=!1,s1=!0,n2=null,O1={box:null,offscreen:null},O2={box:null,offscreen:null},m2=null,c2=null,S3=null,B1=0,d4=0,f4=0;Bt.textFeatureIndex?B1=Bt.textFeatureIndex:lt.useRuntimeCollisionCircles&&(B1=lt.featureIndex),Bt.verticalTextFeatureIndex&&(d4=Bt.verticalTextFeatureIndex);const dr=Bt.textBox;if(dr){const $2=i2=>{let y2=o.ai.horizontal;if(L.allowVerticalPlacement&&!i2&&this.prevPlacement){const h3=this.prevPlacement.placedOrientations[lt.crossTileID];h3&&(this.placedOrientations[lt.crossTileID]=h3,y2=h3,this.markUsedOrientation(L,y2,lt))}return y2},k2=(i2,y2)=>{if(L.allowVerticalPlacement&&lt.numVerticalGlyphVertices>0&&Bt.verticalTextBox){for(const h3 of L.writingModes)if(h3===o.ai.vertical?(O1=y2(),O2=O1):O1=i2(),O1&&O1.box&&O1.box.length)break}else O1=i2()},Y2=lt.textAnchorOffsetStartIndex,Ur=lt.textAnchorOffsetEndIndex;if(Ur===Y2){const i2=(y2,h3)=>{const a2=this.collisionIndex.placeCollisionBox(y2,se,$,k,ue.predicate,bt);return a2&&a2.box&&a2.box.length&&(this.markUsedOrientation(L,h3,lt),this.placedOrientations[lt.crossTileID]=h3),a2};k2(()=>i2(dr,o.ai.horizontal),()=>{const y2=Bt.verticalTextBox;return L.allowVerticalPlacement&&lt.numVerticalGlyphVertices>0&&y2?i2(y2,o.ai.vertical):{box:null,offscreen:null}}),$2(O1&&O1.box&&O1.box.length)}else{let i2=o.aq[(M1=(Mt=this.prevPlacement)===null||Mt===void 0?void 0:Mt.variableOffsets[lt.crossTileID])===null||M1===void 0?void 0:M1.anchor];const y2=(a2,Wr,M5)=>{const A9=a2.x2-a2.x1,S9=a2.y2-a2.y1,ph=lt.textBoxScale,L0=ke&&Se==="never"?Wr:null;let p4={box:[],offscreen:!1},Xr=se==="never"?1:2,m4="never";i2&&Xr++;for(let U3=0;U3<Xr;U3++){for(let y4=Y2;y4<Ur;y4++){const b0=L.textAnchorOffsets.get(y4);if(i2&&b0.textAnchor!==i2)continue;const N4=this.attemptAnchorPlacement(b0,a2,A9,S9,ph,we,Oe,$,k,ue,m4,lt,L,M5,L0,bt);if(N4&&(p4=N4.placedGlyphBoxes,p4&&p4.box&&p4.box.length))return a1=!0,n2=N4.shift,p4}i2?i2=null:m4=se}return p4};k2(()=>y2(dr,Bt.iconBox,o.ai.horizontal),()=>{const a2=Bt.verticalTextBox;return L.allowVerticalPlacement&&!(O1&&O1.box&&O1.box.length)&&lt.numVerticalGlyphVertices>0&&a2?y2(a2,Bt.verticalIconBox,o.ai.vertical):{box:null,offscreen:null}}),O1&&(a1=O1.box,s1=O1.offscreen);const h3=$2(O1&&O1.box);if(!a1&&this.prevPlacement){const a2=this.prevPlacement.variableOffsets[lt.crossTileID];a2&&(this.variableOffsets[lt.crossTileID]=a2,this.markUsedJustification(L,a2.anchor,lt,h3))}}}if(m2=O1,a1=m2&&m2.box&&m2.box.length>0,s1=m2&&m2.offscreen,lt.useRuntimeCollisionCircles){const $2=L.text.placedSymbolArray.get(lt.centerJustifiedTextSymbolIndex),k2=o.aj(L.textSizeData,te,$2),Y2=A.get("text-padding");c2=this.collisionIndex.placeCollisionCircles(se,$2,L.lineVertexArray,L.glyphOffsetArray,k2,k,P,F,_,Oe,ue.predicate,lt.collisionCircleDiameter,Y2,bt),c2.circles.length&&c2.collisionDetected&&!_&&o.w("Collisions detected, but collision boxes are not shown"),a1=xe||c2.circles.length>0&&!c2.collisionDetected,s1=s1&&c2.offscreen}if(Bt.iconFeatureIndex&&(f4=Bt.iconFeatureIndex),Bt.iconBox){const $2=k2=>{const Y2=ke&&n2?Lt(k2,n2.x,n2.y,we,Oe,this.transform.angle):k2;return this.collisionIndex.placeCollisionBox(Y2,Se,$,k,ue.predicate,bt)};O2&&O2.box&&O2.box.length&&Bt.verticalIconBox?(S3=$2(Bt.verticalIconBox),Kt=S3.box.length>0):(S3=$2(Bt.iconBox),Kt=S3.box.length>0),s1=s1&&S3.offscreen}const Gr=ce||lt.numHorizontalGlyphVertices===0&&lt.numVerticalGlyphVertices===0,$n=Te||lt.numIconVertices===0;if(Gr||$n?$n?Gr||(Kt=Kt&&a1):a1=Kt&&a1:Kt=a1=Kt&&a1,a1&&m2&&m2.box&&this.collisionIndex.insertCollisionBox(m2.box,se,A.get("text-ignore-placement"),L.bucketInstanceId,O2&&O2.box&&d4?d4:B1,ue.ID),Kt&&S3&&this.collisionIndex.insertCollisionBox(S3.box,Se,A.get("icon-ignore-placement"),L.bucketInstanceId,f4,ue.ID),c2&&(a1&&this.collisionIndex.insertCollisionCircles(c2.circles,se,A.get("text-ignore-placement"),L.bucketInstanceId,B1,ue.ID),_)){const $2=L.bucketInstanceId;let k2=this.collisionCircleArrays[$2];k2===void 0&&(k2=this.collisionCircleArrays[$2]=new Fe);for(let Y2=0;Y2<c2.circles.length;Y2+=4)k2.circles.push(c2.circles[Y2+0]),k2.circles.push(c2.circles[Y2+1]),k2.circles.push(c2.circles[Y2+2]),k2.circles.push(c2.collisionDetected?1:0)}if(lt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(L.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[lt.crossTileID]=new Be(a1||Ue,Kt||Ge,s1||L.justReloaded),d[lt.crossTileID]=!0};if(je){if(l.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const lt=L.getSortedSymbolIndexes(this.transform.angle);for(let Bt=lt.length-1;Bt>=0;--Bt){const Mt=lt[Bt];o1(L.symbolInstances.get(Mt),L.collisionArrays[Mt])}}else for(let lt=l.symbolInstanceStart;lt<l.symbolInstanceEnd;lt++)o1(L.symbolInstances.get(lt),L.collisionArrays[lt]);if(_&&L.bucketInstanceId in this.collisionCircleArrays){const lt=this.collisionCircleArrays[L.bucketInstanceId];o.as(lt.invProjMatrix,k),lt.viewportMatrix=this.collisionIndex.getViewportMatrix()}L.justReloaded=!1}markUsedJustification(l,d,_,L){let A;A=L===o.ai.vertical?_.verticalPlacedTextSymbolIndex:{left:_.leftJustifiedTextSymbolIndex,center:_.centerJustifiedTextSymbolIndex,right:_.rightJustifiedTextSymbolIndex}[o.at(d)];const k=[_.leftJustifiedTextSymbolIndex,_.centerJustifiedTextSymbolIndex,_.rightJustifiedTextSymbolIndex,_.verticalPlacedTextSymbolIndex];for(const P of k)P>=0&&(l.text.placedSymbolArray.get(P).crossTileID=A>=0&&P!==A?0:_.crossTileID)}markUsedOrientation(l,d,_){const L=d===o.ai.horizontal||d===o.ai.horizontalOnly?d:0,A=d===o.ai.vertical?d:0,k=[_.leftJustifiedTextSymbolIndex,_.centerJustifiedTextSymbolIndex,_.rightJustifiedTextSymbolIndex];for(const P of k)l.text.placedSymbolArray.get(P).placedOrientation=L;_.verticalPlacedTextSymbolIndex&&(l.text.placedSymbolArray.get(_.verticalPlacedTextSymbolIndex).placedOrientation=A)}commit(l){this.commitTime=l,this.zoomAtLastRecencyCheck=this.transform.zoom;const d=this.prevPlacement;let _=!1;this.prevZoomAdjustment=d?d.zoomAdjustment(this.transform.zoom):0;const L=d?d.symbolFadeChange(l):1,A=d?d.opacities:{},k=d?d.variableOffsets:{},P=d?d.placedOrientations:{};for(const F in this.placements){const $=this.placements[F],G=A[F];G?(this.opacities[F]=new be(G,L,$.text,$.icon),_=_||$.text!==G.text.placed||$.icon!==G.icon.placed):(this.opacities[F]=new be(null,L,$.text,$.icon,$.skipFade),_=_||$.text||$.icon)}for(const F in A){const $=A[F];if(!this.opacities[F]){const G=new be($,L,!1,!1);G.isHidden()||(this.opacities[F]=G,_=_||$.text.placed||$.icon.placed)}}for(const F in k)this.variableOffsets[F]||!this.opacities[F]||this.opacities[F].isHidden()||(this.variableOffsets[F]=k[F]);for(const F in P)this.placedOrientations[F]||!this.opacities[F]||this.opacities[F].isHidden()||(this.placedOrientations[F]=P[F]);if(d&&d.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");_?this.lastPlacementChangeTime=l:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=d?d.lastPlacementChangeTime:l)}updateLayerOpacities(l,d){const _={};for(const L of d){const A=L.getBucket(l);A&&L.latestFeatureIndex&&l.id===A.layerIds[0]&&this.updateBucketOpacities(A,_,L.collisionBoxArray)}}updateBucketOpacities(l,d,_){l.hasTextData()&&(l.text.opacityVertexArray.clear(),l.text.hasVisibleVertices=!1),l.hasIconData()&&(l.icon.opacityVertexArray.clear(),l.icon.hasVisibleVertices=!1),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexArray.clear(),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexArray.clear();const L=l.layers[0],A=L.layout,k=new be(null,0,!1,!1,!0),P=A.get("text-allow-overlap"),F=A.get("icon-allow-overlap"),$=L._unevaluatedLayout.hasValue("text-variable-anchor")||L._unevaluatedLayout.hasValue("text-variable-anchor-offset"),G=A.get("text-rotation-alignment")==="map",W=A.get("text-pitch-alignment")==="map",te=A.get("icon-text-fit")!=="none",ue=new be(null,0,P&&(F||!l.hasIconData()||A.get("icon-optional")),F&&(P||!l.hasTextData()||A.get("text-optional")),!0);!l.collisionArrays&&_&&(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData())&&l.deserializeCollisionBoxes(_);const ce=(Te,se,xe)=>{for(let Se=0;Se<se/4;Se++)Te.opacityVertexArray.emplaceBack(xe);Te.hasVisibleVertices=Te.hasVisibleVertices||xe!==j3};for(let Te=0;Te<l.symbolInstances.length;Te++){const se=l.symbolInstances.get(Te),{numHorizontalGlyphVertices:xe,numVerticalGlyphVertices:Se,crossTileID:pe}=se;let we=this.opacities[pe];d[pe]?we=k:we||(we=ue,this.opacities[pe]=we),d[pe]=!0;const Oe=se.numIconVertices>0,ke=this.placedOrientations[se.crossTileID],je=ke===o.ai.vertical,Ue=ke===o.ai.horizontal||ke===o.ai.horizontalOnly;if(xe>0||Se>0){const Ge=V2(we.text);ce(l.text,xe,je?j3:Ge),ce(l.text,Se,Ue?j3:Ge);const rt=we.text.isHidden();[se.rightJustifiedTextSymbolIndex,se.centerJustifiedTextSymbolIndex,se.leftJustifiedTextSymbolIndex].forEach(lt=>{lt>=0&&(l.text.placedSymbolArray.get(lt).hidden=rt||je?1:0)}),se.verticalPlacedTextSymbolIndex>=0&&(l.text.placedSymbolArray.get(se.verticalPlacedTextSymbolIndex).hidden=rt||Ue?1:0);const bt=this.variableOffsets[se.crossTileID];bt&&this.markUsedJustification(l,bt.anchor,se,ke);const o1=this.placedOrientations[se.crossTileID];o1&&(this.markUsedJustification(l,"left",se,o1),this.markUsedOrientation(l,o1,se))}if(Oe){const Ge=V2(we.icon),rt=!(te&&se.verticalPlacedIconSymbolIndex&&je);se.placedIconSymbolIndex>=0&&(ce(l.icon,se.numIconVertices,rt?Ge:j3),l.icon.placedSymbolArray.get(se.placedIconSymbolIndex).hidden=we.icon.isHidden()),se.verticalPlacedIconSymbolIndex>=0&&(ce(l.icon,se.numVerticalIconVertices,rt?j3:Ge),l.icon.placedSymbolArray.get(se.verticalPlacedIconSymbolIndex).hidden=we.icon.isHidden())}if(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData()){const Ge=l.collisionArrays[Te];if(Ge){let rt=new o.P(0,0);if(Ge.textBox||Ge.verticalTextBox){let o1=!0;if($){const lt=this.variableOffsets[pe];lt?(rt=$t(lt.anchor,lt.width,lt.height,lt.textOffset,lt.textBoxScale),G&&rt._rotate(W?this.transform.angle:-this.transform.angle)):o1=!1}Ge.textBox&&Gt(l.textCollisionBox.collisionVertexArray,we.text.placed,!o1||je,rt.x,rt.y),Ge.verticalTextBox&&Gt(l.textCollisionBox.collisionVertexArray,we.text.placed,!o1||Ue,rt.x,rt.y)}const bt=!!(!Ue&&Ge.verticalIconBox);Ge.iconBox&&Gt(l.iconCollisionBox.collisionVertexArray,we.icon.placed,bt,te?rt.x:0,te?rt.y:0),Ge.verticalIconBox&&Gt(l.iconCollisionBox.collisionVertexArray,we.icon.placed,!bt,te?rt.x:0,te?rt.y:0)}}}if(l.sortFeatures(this.transform.angle),this.retainedQueryData[l.bucketInstanceId]&&(this.retainedQueryData[l.bucketInstanceId].featureSortOrder=l.featureSortOrder),l.hasTextData()&&l.text.opacityVertexBuffer&&l.text.opacityVertexBuffer.updateData(l.text.opacityVertexArray),l.hasIconData()&&l.icon.opacityVertexBuffer&&l.icon.opacityVertexBuffer.updateData(l.icon.opacityVertexArray),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexBuffer&&l.iconCollisionBox.collisionVertexBuffer.updateData(l.iconCollisionBox.collisionVertexArray),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexBuffer&&l.textCollisionBox.collisionVertexBuffer.updateData(l.textCollisionBox.collisionVertexArray),l.text.opacityVertexArray.length!==l.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${l.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${l.text.layoutVertexArray.length}) / 4`);if(l.icon.opacityVertexArray.length!==l.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${l.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${l.icon.layoutVertexArray.length}) / 4`);if(l.bucketInstanceId in this.collisionCircleArrays){const Te=this.collisionCircleArrays[l.bucketInstanceId];l.placementInvProjMatrix=Te.invProjMatrix,l.placementViewportMatrix=Te.viewportMatrix,l.collisionCircleArray=Te.circles,delete this.collisionCircleArrays[l.bucketInstanceId]}}symbolFadeChange(l){return this.fadeDuration===0?1:(l-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(l){return Math.max(0,(this.transform.zoom-l)/1.5)}hasTransitions(l){return this.stale||l-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(l,d){const _=this.zoomAtLastRecencyCheck===d?1-this.zoomAdjustment(d):1;return this.zoomAtLastRecencyCheck=d,this.commitTime+this.fadeDuration*_>l}setStale(){this.stale=!0}}function Gt(M,l,d,_,L){M.emplaceBack(l?1:0,d?1:0,_||0,L||0),M.emplaceBack(l?1:0,d?1:0,_||0,L||0),M.emplaceBack(l?1:0,d?1:0,_||0,L||0),M.emplaceBack(l?1:0,d?1:0,_||0,L||0)}const x1=Math.pow(2,25),C1=Math.pow(2,24),h1=Math.pow(2,17),T1=Math.pow(2,16),j2=Math.pow(2,9),D1=Math.pow(2,8),T2=Math.pow(2,1);function V2(M){if(M.opacity===0&&!M.placed)return 0;if(M.opacity===1&&M.placed)return 4294967295;const l=M.placed?1:0,d=Math.floor(127*M.opacity);return d*x1+l*C1+d*h1+l*T1+d*j2+l*D1+d*T2+l}const j3=0;class Zl{constructor(l){this._sortAcrossTiles=l.layout.get("symbol-z-order")!=="viewport-y"&&!l.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(l,d,_,L,A){const k=this._bucketParts;for(;this._currentTileIndex<l.length;)if(d.getBucketParts(k,L,l[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,A())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,k.sort((P,F)=>P.sortKey-F.sortKey));this._currentPartIndex<k.length;)if(d.placeLayerBucketPart(k[this._currentPartIndex],this._seenCrossTileIDs,_),this._currentPartIndex++,A())return!0;return!1}}class En{constructor(l,d,_,L,A,k,P,F){this.placement=new kt(l,d,k,P,F),this._currentPlacementIndex=_.length-1,this._forceFullPlacement=L,this._showCollisionBoxes=A,this._done=!1}isDone(){return this._done}continuePlacement(l,d,_){const L=o.h.now(),A=()=>!this._forceFullPlacement&&o.h.now()-L>2;for(;this._currentPlacementIndex>=0;){const k=d[l[this._currentPlacementIndex]],P=this.placement.collisionIndex.transform.zoom;if(k.type==="symbol"&&(!k.minzoom||k.minzoom<=P)&&(!k.maxzoom||k.maxzoom>P)){if(this._inProgressLayer||(this._inProgressLayer=new Zl(k)),this._inProgressLayer.continuePlacement(_[k.source],this.placement,this._showCollisionBoxes,k,A))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(l){return this.placement.commit(l),this.placement}}const Vn=512/o.N/2;class YT{constructor(l,d,_){this.tileID=l,this.bucketInstanceId=_,this._symbolsByKey={};const L=new Map;for(let A=0;A<d.length;A++){const k=d.get(A),P=k.key,F=L.get(P);F?F.push(k):L.set(P,[k])}for(const[A,k]of L){const P={positions:k.map(F=>({x:Math.floor(F.anchorX*Vn),y:Math.floor(F.anchorY*Vn)})),crossTileIDs:k.map(F=>F.crossTileID)};if(P.positions.length>128){const F=new o.av(P.positions.length,16,Uint16Array);for(const{x:$,y:G}of P.positions)F.add($,G);F.finish(),delete P.positions,P.index=F}this._symbolsByKey[A]=P}}getScaledCoordinates(l,d){const{x:_,y:L,z:A}=this.tileID.canonical,{x:k,y:P,z:F}=d.canonical,$=Vn/Math.pow(2,F-A),G=(P*o.N+l.anchorY)*$,W=L*o.N*Vn;return{x:Math.floor((k*o.N+l.anchorX)*$-_*o.N*Vn),y:Math.floor(G-W)}}findMatches(l,d,_){const L=this.tileID.canonical.z<d.canonical.z?1:Math.pow(2,this.tileID.canonical.z-d.canonical.z);for(let A=0;A<l.length;A++){const k=l.get(A);if(k.crossTileID)continue;const P=this._symbolsByKey[k.key];if(!P)continue;const F=this.getScaledCoordinates(k,d);if(P.index){const $=P.index.range(F.x-L,F.y-L,F.x+L,F.y+L).sort();for(const G of $){const W=P.crossTileIDs[G];if(!_[W]){_[W]=!0,k.crossTileID=W;break}}}else if(P.positions)for(let $=0;$<P.positions.length;$++){const G=P.positions[$],W=P.crossTileIDs[$];if(Math.abs(G.x-F.x)<=L&&Math.abs(G.y-F.y)<=L&&!_[W]){_[W]=!0,k.crossTileID=W;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:l})=>l)}}class H1{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Po{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(l){const d=Math.round((l-this.lng)/360);if(d!==0)for(const _ in this.indexes){const L=this.indexes[_],A={};for(const k in L){const P=L[k];P.tileID=P.tileID.unwrapTo(P.tileID.wrap+d),A[P.tileID.key]=P}this.indexes[_]=A}this.lng=l}addBucket(l,d,_){if(this.indexes[l.overscaledZ]&&this.indexes[l.overscaledZ][l.key]){if(this.indexes[l.overscaledZ][l.key].bucketInstanceId===d.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(l.overscaledZ,this.indexes[l.overscaledZ][l.key])}for(let A=0;A<d.symbolInstances.length;A++)d.symbolInstances.get(A).crossTileID=0;this.usedCrossTileIDs[l.overscaledZ]||(this.usedCrossTileIDs[l.overscaledZ]={});const L=this.usedCrossTileIDs[l.overscaledZ];for(const A in this.indexes){const k=this.indexes[A];if(Number(A)>l.overscaledZ)for(const P in k){const F=k[P];F.tileID.isChildOf(l)&&F.findMatches(d.symbolInstances,l,L)}else{const P=k[l.scaledTo(Number(A)).key];P&&P.findMatches(d.symbolInstances,l,L)}}for(let A=0;A<d.symbolInstances.length;A++){const k=d.symbolInstances.get(A);k.crossTileID||(k.crossTileID=_.generate(),L[k.crossTileID]=!0)}return this.indexes[l.overscaledZ]===void 0&&(this.indexes[l.overscaledZ]={}),this.indexes[l.overscaledZ][l.key]=new YT(l,d.symbolInstances,d.bucketInstanceId),!0}removeBucketCrossTileIDs(l,d){for(const _ of d.getCrossTileIDsLists())for(const L of _)delete this.usedCrossTileIDs[l][L]}removeStaleBuckets(l){let d=!1;for(const _ in this.indexes){const L=this.indexes[_];for(const A in L)l[L[A].bucketInstanceId]||(this.removeBucketCrossTileIDs(_,L[A]),delete L[A],d=!0)}return d}}class Yi{constructor(){this.layerIndexes={},this.crossTileIDs=new H1,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(l,d,_){let L=this.layerIndexes[l.id];L===void 0&&(L=this.layerIndexes[l.id]=new Po);let A=!1;const k={};L.handleWrapJump(_);for(const P of d){const F=P.getBucket(l);F&&l.id===F.layerIds[0]&&(F.bucketInstanceId||(F.bucketInstanceId=++this.maxBucketInstanceId),L.addBucket(P.tileID,F,this.crossTileIDs)&&(A=!0),k[F.bucketInstanceId]=!0)}return L.removeStaleBuckets(k)&&(A=!0),A}pruneUnusedLayers(l){const d={};l.forEach(_=>{d[_]=!0});for(const _ in this.layerIndexes)d[_]||delete this.layerIndexes[_]}}const z2=(M,l)=>o.x(M,l&&l.filter(d=>d.identifier!=="source.canvas")),w3=o.F(o.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),eh=o.F(o.ax,["setCenter","setZoom","setBearing","setPitch"]),z3=o.aw();class D2 extends o.E{constructor(l,d={}){super(),this.map=l,this.dispatcher=new Xe(r2(),this,l._getMapId()),this.imageManager=new ge,this.imageManager.setEventedParent(this),this.glyphManager=new tt(l._requestManager,d.localIdeographFontFamily),this.lineAtlas=new Ie(256,512),this.crossTileSymbolIndex=new Yi,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.az());const _=this;this._rtlTextPluginCallback=D2.registerForPluginStateChange(L=>{_.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:L.pluginStatus,pluginURL:L.pluginURL},(A,k)=>{if(o.aA(A),k&&k.every(P=>P))for(const P in _.sourceCaches){const F=_.sourceCaches[P].getSource().type;F!=="vector"&&F!=="geojson"||_.sourceCaches[P].reload()}})}),this.on("data",L=>{if(L.dataType!=="source"||L.sourceDataType!=="metadata")return;const A=this.sourceCaches[L.sourceId];if(!A)return;const k=A.getSource();if(k&&k.vectorLayerIds)for(const P in this._layers){const F=this._layers[P];F.source===k.id&&this._validateLayer(F)}})}loadURL(l,d={},_){this.fire(new o.k("dataloading",{dataType:"style"})),d.validate=typeof d.validate!="boolean"||d.validate;const L=this.map._requestManager.transformRequest(l,H.Style);this._request=o.f(L,(A,k)=>{this._request=null,A?this.fire(new o.j(A)):k&&this._load(k,d,_)})}loadJSON(l,d={},_){this.fire(new o.k("dataloading",{dataType:"style"})),this._request=o.h.frame(()=>{this._request=null,d.validate=d.validate!==!1,this._load(l,d,_)})}loadEmpty(){this.fire(new o.k("dataloading",{dataType:"style"})),this._load(z3,{validate:!1})}_load(l,d,_){var L;const A=d.transformStyle?d.transformStyle(_,l):l;if(!d.validate||!z2(this,o.y(A))){this._loaded=!0,this.stylesheet=A;for(const k in A.sources)this.addSource(k,A.sources[k],{validate:!1});A.sprite?this._loadSprite(A.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(A.glyphs),this._createLayers(),this.light=new Pt(this.stylesheet.light),this.map.setTerrain((L=this.stylesheet.terrain)!==null&&L!==void 0?L:null),this.fire(new o.k("data",{dataType:"style"})),this.fire(new o.k("style.load"))}}_createLayers(){const l=o.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",l),this._order=l.map(d=>d.id),this._layers={},this._serializedLayers=null;for(const d of l){const _=o.aC(d);_.setEventedParent(this,{layer:{id:d.id}}),this._layers[d.id]=_}}_loadSprite(l,d=!1,_=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(L,A,k,P){const F=K(L),$=F.length,G=k>1?"@2x":"",W={},te={},ue={};for(const{id:ce,url:Te}of F){const se=A.transformRequest(A.normalizeSpriteURL(Te,G,".json"),H.SpriteJSON),xe=`${ce}_${se.url}`;W[xe]=o.f(se,(we,Oe)=>{delete W[xe],te[ce]=Oe,ee(P,te,ue,we,$)});const Se=A.transformRequest(A.normalizeSpriteURL(Te,G,".png"),H.SpriteImage),pe=`${ce}_${Se.url}`;W[pe]=E.getImage(Se,(we,Oe)=>{delete W[pe],ue[ce]=Oe,ee(P,te,ue,we,$)})}return{cancel(){for(const ce of Object.values(W))ce.cancel()}}}(l,this.map._requestManager,this.map.getPixelRatio(),(L,A)=>{if(this._spriteRequest=null,L)this.fire(new o.j(L));else if(A)for(const k in A){this._spritesImagesIds[k]=[];const P=this._spritesImagesIds[k]?this._spritesImagesIds[k].filter(F=>!(F in A)):[];for(const F of P)this.imageManager.removeImage(F),this._changedImages[F]=!0;for(const F in A[k]){const $=k==="default"?F:`${k}:${F}`;this._spritesImagesIds[k].push($),$ in this.imageManager.images?this.imageManager.updateImage($,A[k][F],!1):this.imageManager.addImage($,A[k][F]),d&&(this._changedImages[$]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),d&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"})),_&&_(L)})}_unloadSprite(){for(const l of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(l),this._changedImages[l]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"}))}_validateLayer(l){const d=this.sourceCaches[l.source];if(!d)return;const _=l.sourceLayer;if(!_)return;const L=d.getSource();(L.type==="geojson"||L.vectorLayerIds&&L.vectorLayerIds.indexOf(_)===-1)&&this.fire(new o.j(new Error(`Source layer "${_}" does not exist on source "${L.id}" as specified by style layer "${l.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const l in this.sourceCaches)if(!this.sourceCaches[l].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(l){const d=this._serializedAllLayers();if(!l||l.length===0)return Object.values(d);const _=[];for(const L of l)d[L]&&_.push(d[L]);return _}_serializedAllLayers(){let l=this._serializedLayers;if(l)return l;l=this._serializedLayers={};const d=Object.keys(this._layers);for(const _ of d){const L=this._layers[_];L.type!=="custom"&&(l[_]=L.serialize())}return l}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const l in this.sourceCaches)if(this.sourceCaches[l].hasTransition())return!0;for(const l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(l){if(!this._loaded)return;const d=this._changed;if(this._changed){const L=Object.keys(this._updatedLayers),A=Object.keys(this._removedLayers);(L.length||A.length)&&this._updateWorkerLayers(L,A);for(const k in this._updatedSources){const P=this._updatedSources[k];if(P==="reload")this._reloadSource(k);else{if(P!=="clear")throw new Error(`Invalid action ${P}`);this._clearSource(k)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const k in this._updatedPaintProps)this._layers[k].updateTransitions(l);this.light.updateTransitions(l),this._resetUpdates()}const _={};for(const L in this.sourceCaches){const A=this.sourceCaches[L];_[L]=A.used,A.used=!1}for(const L of this._order){const A=this._layers[L];A.recalculate(l,this._availableImages),!A.isHidden(l.zoom)&&A.source&&(this.sourceCaches[A.source].used=!0)}for(const L in _){const A=this.sourceCaches[L];_[L]!==A.used&&A.fire(new o.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:L}))}this.light.recalculate(l),this.z=l.zoom,d&&this.fire(new o.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const l=Object.keys(this._changedImages);if(l.length){for(const d in this.sourceCaches)this.sourceCaches[d].reloadTilesForDependencies(["icons","patterns"],l);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const l in this.sourceCaches)this.sourceCaches[l].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(l,d){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(l),removedIds:d})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(l,d={}){this._checkLoaded();const _=this.serialize();if(l=d.transformStyle?d.transformStyle(_,l):l,z2(this,o.y(l)))return!1;(l=o.aD(l)).layers=o.aB(l.layers);const L=o.aE(_,l).filter(k=>!(k.command in eh));if(L.length===0)return!1;const A=L.filter(k=>!(k.command in w3));if(A.length>0)throw new Error(`Unimplemented: ${A.map(k=>k.command).join(", ")}.`);for(const k of L)k.command!=="setTransition"&&this[k.command].apply(this,k.args);return this.stylesheet=l,this._serializedLayers=null,!0}addImage(l,d){if(this.getImage(l))return this.fire(new o.j(new Error(`An image named "${l}" already exists.`)));this.imageManager.addImage(l,d),this._afterImageUpdated(l)}updateImage(l,d){this.imageManager.updateImage(l,d)}getImage(l){return this.imageManager.getImage(l)}removeImage(l){if(!this.getImage(l))return this.fire(new o.j(new Error(`An image named "${l}" does not exist.`)));this.imageManager.removeImage(l),this._afterImageUpdated(l)}_afterImageUpdated(l){this._availableImages=this.imageManager.listImages(),this._changedImages[l]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(l,d,_={}){if(this._checkLoaded(),this.sourceCaches[l]!==void 0)throw new Error(`Source "${l}" already exists.`);if(!d.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(d).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(d.type)>=0&&this._validate(o.y.source,`sources.${l}`,d,null,_))return;this.map&&this.map._collectResourceTiming&&(d.collectResourceTiming=!0);const L=this.sourceCaches[l]=new v1(l,d,this.dispatcher);L.style=this,L.setEventedParent(this,()=>({isSourceLoaded:L.loaded(),source:L.serialize(),sourceId:l})),L.onAdd(this.map),this._changed=!0}removeSource(l){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error("There is no source with this ID");for(const _ in this._layers)if(this._layers[_].source===l)return this.fire(new o.j(new Error(`Source "${l}" cannot be removed while layer "${_}" is using it.`)));const d=this.sourceCaches[l];delete this.sourceCaches[l],delete this._updatedSources[l],d.fire(new o.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:l})),d.setEventedParent(null),d.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(l,d){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error(`There is no source with this ID=${l}`);const _=this.sourceCaches[l].getSource();if(_.type!=="geojson")throw new Error(`geojsonSource.type is ${_.type}, which is !== 'geojson`);_.setData(d),this._changed=!0}getSource(l){return this.sourceCaches[l]&&this.sourceCaches[l].getSource()}addLayer(l,d,_={}){this._checkLoaded();const L=l.id;if(this.getLayer(L))return void this.fire(new o.j(new Error(`Layer "${L}" already exists on this map.`)));let A;if(l.type==="custom"){if(z2(this,o.aF(l)))return;A=o.aC(l)}else{if("source"in l&&typeof l.source=="object"&&(this.addSource(L,l.source),l=o.aD(l),l=o.e(l,{source:L})),this._validate(o.y.layer,`layers.${L}`,l,{arrayIndex:-1},_))return;A=o.aC(l),this._validateLayer(A),A.setEventedParent(this,{layer:{id:L}})}const k=d?this._order.indexOf(d):this._order.length;if(d&&k===-1)this.fire(new o.j(new Error(`Cannot add layer "${L}" before non-existing layer "${d}".`)));else{if(this._order.splice(k,0,L),this._layerOrderChanged=!0,this._layers[L]=A,this._removedLayers[L]&&A.source&&A.type!=="custom"){const P=this._removedLayers[L];delete this._removedLayers[L],P.type!==A.type?this._updatedSources[A.source]="clear":(this._updatedSources[A.source]="reload",this.sourceCaches[A.source].pause())}this._updateLayer(A),A.onAdd&&A.onAdd(this.map)}}moveLayer(l,d){if(this._checkLoaded(),this._changed=!0,!this._layers[l])return void this.fire(new o.j(new Error(`The layer '${l}' does not exist in the map's style and cannot be moved.`)));if(l===d)return;const _=this._order.indexOf(l);this._order.splice(_,1);const L=d?this._order.indexOf(d):this._order.length;d&&L===-1?this.fire(new o.j(new Error(`Cannot move layer "${l}" before non-existing layer "${d}".`))):(this._order.splice(L,0,l),this._layerOrderChanged=!0)}removeLayer(l){this._checkLoaded();const d=this._layers[l];if(!d)return void this.fire(new o.j(new Error(`Cannot remove non-existing layer "${l}".`)));d.setEventedParent(null);const _=this._order.indexOf(l);this._order.splice(_,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[l]=d,delete this._layers[l],this._serializedLayers&&delete this._serializedLayers[l],delete this._updatedLayers[l],delete this._updatedPaintProps[l],d.onRemove&&d.onRemove(this.map)}getLayer(l){return this._layers[l]}getLayersOrder(){return[...this._order]}hasLayer(l){return l in this._layers}setLayerZoomRange(l,d,_){this._checkLoaded();const L=this.getLayer(l);L?L.minzoom===d&&L.maxzoom===_||(d!=null&&(L.minzoom=d),_!=null&&(L.maxzoom=_),this._updateLayer(L)):this.fire(new o.j(new Error(`Cannot set the zoom range of non-existing layer "${l}".`)))}setFilter(l,d,_={}){this._checkLoaded();const L=this.getLayer(l);if(L){if(!o.aG(L.filter,d))return d==null?(L.filter=void 0,void this._updateLayer(L)):void(this._validate(o.y.filter,`layers.${L.id}.filter`,d,null,_)||(L.filter=o.aD(d),this._updateLayer(L)))}else this.fire(new o.j(new Error(`Cannot filter non-existing layer "${l}".`)))}getFilter(l){return o.aD(this.getLayer(l).filter)}setLayoutProperty(l,d,_,L={}){this._checkLoaded();const A=this.getLayer(l);A?o.aG(A.getLayoutProperty(d),_)||(A.setLayoutProperty(d,_,L),this._updateLayer(A)):this.fire(new o.j(new Error(`Cannot style non-existing layer "${l}".`)))}getLayoutProperty(l,d){const _=this.getLayer(l);if(_)return _.getLayoutProperty(d);this.fire(new o.j(new Error(`Cannot get style of non-existing layer "${l}".`)))}setPaintProperty(l,d,_,L={}){this._checkLoaded();const A=this.getLayer(l);A?o.aG(A.getPaintProperty(d),_)||(A.setPaintProperty(d,_,L)&&this._updateLayer(A),this._changed=!0,this._updatedPaintProps[l]=!0):this.fire(new o.j(new Error(`Cannot style non-existing layer "${l}".`)))}getPaintProperty(l,d){return this.getLayer(l).getPaintProperty(d)}setFeatureState(l,d){this._checkLoaded();const _=l.source,L=l.sourceLayer,A=this.sourceCaches[_];if(A===void 0)return void this.fire(new o.j(new Error(`The source '${_}' does not exist in the map's style.`)));const k=A.getSource().type;k==="geojson"&&L?this.fire(new o.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):k!=="vector"||L?(l.id===void 0&&this.fire(new o.j(new Error("The feature id parameter must be provided."))),A.setFeatureState(L,l.id,d)):this.fire(new o.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(l,d){this._checkLoaded();const _=l.source,L=this.sourceCaches[_];if(L===void 0)return void this.fire(new o.j(new Error(`The source '${_}' does not exist in the map's style.`)));const A=L.getSource().type,k=A==="vector"?l.sourceLayer:void 0;A!=="vector"||k?d&&typeof l.id!="string"&&typeof l.id!="number"?this.fire(new o.j(new Error("A feature id is required to remove its specific state property."))):L.removeFeatureState(k,l.id,d):this.fire(new o.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(l){this._checkLoaded();const d=l.source,_=l.sourceLayer,L=this.sourceCaches[d];if(L!==void 0)return L.getSource().type!=="vector"||_?(l.id===void 0&&this.fire(new o.j(new Error("The feature id parameter must be provided."))),L.getFeatureState(_,l.id)):void this.fire(new o.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.j(new Error(`The source '${d}' does not exist in the map's style.`)))}getTransition(){return o.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const l=o.aH(this.sourceCaches,A=>A.serialize()),d=this._serializeByIds(this._order),_=this.map.getTerrain()||void 0,L=this.stylesheet;return o.aI({version:L.version,name:L.name,metadata:L.metadata,light:L.light,center:L.center,zoom:L.zoom,bearing:L.bearing,pitch:L.pitch,sprite:L.sprite,glyphs:L.glyphs,transition:L.transition,sources:l,layers:d,terrain:_},A=>A!==void 0)}_updateLayer(l){this._updatedLayers[l.id]=!0,l.source&&!this._updatedSources[l.source]&&this.sourceCaches[l.source].getSource().type!=="raster"&&(this._updatedSources[l.source]="reload",this.sourceCaches[l.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(l){const d=k=>this._layers[k].type==="fill-extrusion",_={},L=[];for(let k=this._order.length-1;k>=0;k--){const P=this._order[k];if(d(P)){_[P]=k;for(const F of l){const $=F[P];if($)for(const G of $)L.push(G)}}}L.sort((k,P)=>P.intersectionZ-k.intersectionZ);const A=[];for(let k=this._order.length-1;k>=0;k--){const P=this._order[k];if(d(P))for(let F=L.length-1;F>=0;F--){const $=L[F].feature;if(_[$.layer.id]<k)break;A.push($),L.pop()}else for(const F of l){const $=F[P];if($)for(const G of $)A.push(G.feature)}}return A}queryRenderedFeatures(l,d,_){d&&d.filter&&this._validate(o.y.filter,"queryRenderedFeatures.filter",d.filter,null,d);const L={};if(d&&d.layers){if(!Array.isArray(d.layers))return this.fire(new o.j(new Error("parameters.layers must be an Array."))),[];for(const P of d.layers){const F=this._layers[P];if(!F)return this.fire(new o.j(new Error(`The layer '${P}' does not exist in the map's style and cannot be queried for features.`))),[];L[F.source]=!0}}const A=[];d.availableImages=this._availableImages;const k=this._serializedAllLayers();for(const P in this.sourceCaches)d.layers&&!L[P]||A.push(Wt(this.sourceCaches[P],this._layers,k,l,d,_));return this.placement&&A.push(function(P,F,$,G,W,te,ue){const ce={},Te=te.queryRenderedSymbols(G),se=[];for(const xe of Object.keys(Te).map(Number))se.push(ue[xe]);se.sort(_1);for(const xe of se){const Se=xe.featureIndex.lookupSymbolFeatures(Te[xe.bucketInstanceId],F,xe.bucketIndex,xe.sourceLayerIndex,W.filter,W.layers,W.availableImages,P);for(const pe in Se){const we=ce[pe]=ce[pe]||[],Oe=Se[pe];Oe.sort((ke,je)=>{const Ue=xe.featureSortOrder;if(Ue){const Ge=Ue.indexOf(ke.featureIndex);return Ue.indexOf(je.featureIndex)-Ge}return je.featureIndex-ke.featureIndex});for(const ke of Oe)we.push(ke)}}for(const xe in ce)ce[xe].forEach(Se=>{const pe=Se.feature,we=$[P[xe].source].getFeatureState(pe.layer["source-layer"],pe.id);pe.source=pe.layer.source,pe.layer["source-layer"]&&(pe.sourceLayer=pe.layer["source-layer"]),pe.state=we});return ce}(this._layers,k,this.sourceCaches,l,d,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(A)}querySourceFeatures(l,d){d&&d.filter&&this._validate(o.y.filter,"querySourceFeatures.filter",d.filter,null,d);const _=this.sourceCaches[l];return _?function(L,A){const k=L.getRenderableIds().map($=>L.getTileByID($)),P=[],F={};for(let $=0;$<k.length;$++){const G=k[$],W=G.tileID.canonical.key;F[W]||(F[W]=!0,G.querySourceFeatures(P,A))}return P}(_,d):[]}addSourceType(l,d,_){return mt(l)?_(new Error(`A source type called "${l}" already exists.`)):(((L,A)=>{pt[L]=A})(l,d),d.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:l,url:d.workerSourceURL},_):_(null,null))}getLight(){return this.light.getLight()}setLight(l,d={}){this._checkLoaded();const _=this.light.getLight();let L=!1;for(const k in l)if(!o.aG(l[k],_[k])){L=!0;break}if(!L)return;const A={now:o.h.now(),transition:o.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(l,d),this.light.updateTransitions(A)}_validate(l,d,_,L,A={}){return(!A||A.validate!==!1)&&z2(this,l.call(o.y,o.e({key:d,style:this.serialize(),value:_,styleSpec:o.v},L)))}_remove(l=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const d in this._layers)this._layers[d].setEventedParent(null);for(const d in this.sourceCaches){const _=this.sourceCaches[d];_.setEventedParent(null),_.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(l)}_clearSource(l){this.sourceCaches[l].clearTiles()}_reloadSource(l){this.sourceCaches[l].resume(),this.sourceCaches[l].reload()}_updateSources(l){for(const d in this.sourceCaches)this.sourceCaches[d].update(l,this.map.terrain)}_generateCollisionBoxes(){for(const l in this.sourceCaches)this._reloadSource(l)}_updatePlacement(l,d,_,L,A=!1){let k=!1,P=!1;const F={};for(const $ of this._order){const G=this._layers[$];if(G.type!=="symbol")continue;if(!F[G.source]){const te=this.sourceCaches[G.source];F[G.source]=te.getRenderableIds(!0).map(ue=>te.getTileByID(ue)).sort((ue,ce)=>ce.tileID.overscaledZ-ue.tileID.overscaledZ||(ue.tileID.isLessThan(ce.tileID)?-1:1))}const W=this.crossTileSymbolIndex.addLayer(G,F[G.source],l.center.lng);k=k||W}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((A=A||this._layerOrderChanged||_===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.h.now(),l.zoom))&&(this.pauseablePlacement=new En(l,this.map.terrain,this._order,A,d,_,L,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,F),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.h.now()),P=!0),k&&this.pauseablePlacement.placement.setStale()),P||k)for(const $ of this._order){const G=this._layers[$];G.type==="symbol"&&this.placement.updateLayerOpacities(G,F[G.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.h.now())}_releaseSymbolFadeTiles(){for(const l in this.sourceCaches)this.sourceCaches[l].releaseSymbolFadeTiles()}getImages(l,d,_){this.imageManager.getImages(d.icons,_),this._updateTilesForChangedImages();const L=this.sourceCaches[d.source];L&&L.setDependencies(d.tileID.key,d.type,d.icons)}getGlyphs(l,d,_){this.glyphManager.getGlyphs(d.stacks,_);const L=this.sourceCaches[d.source];L&&L.setDependencies(d.tileID.key,d.type,[""])}getResource(l,d,_){return o.m(d,_)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(l,d={}){this._checkLoaded(),l&&this._validate(o.y.glyphs,"glyphs",l,null,d)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=l,this.glyphManager.entries={},this.glyphManager.setURL(l))}addSprite(l,d,_={},L){this._checkLoaded();const A=[{id:l,url:d}],k=[...K(this.stylesheet.sprite),...A];this._validate(o.y.sprite,"sprite",k,null,_)||(this.stylesheet.sprite=k,this._loadSprite(A,!0,L))}removeSprite(l){this._checkLoaded();const d=K(this.stylesheet.sprite);if(d.find(_=>_.id===l)){if(this._spritesImagesIds[l])for(const _ of this._spritesImagesIds[l])this.imageManager.removeImage(_),this._changedImages[_]=!0;d.splice(d.findIndex(_=>_.id===l),1),this.stylesheet.sprite=d.length>0?d:void 0,delete this._spritesImagesIds[l],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.k("data",{dataType:"style"}))}else this.fire(new o.j(new Error(`Sprite "${l}" doesn't exists on this map.`)))}getSprite(){return K(this.stylesheet.sprite)}setSprite(l,d={},_){this._checkLoaded(),l&&this._validate(o.y.sprite,"sprite",l,null,d)||(this.stylesheet.sprite=l,l?this._loadSprite(l,!0,_):(this._unloadSprite(),_&&_(null)))}}D2.registerForPluginStateChange=o.aK;var e5=o.Q([{name:"a_pos",type:"Int16",components:2}]),Dn="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Z1={prelude:p1(`#ifdef GL_ES
17
17
  precision mediump float;
18
18
  #else
@@ -655,4 +655,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
655
655
  `;)e.i++;e.i++},Math:function(e,t){e.saveText();for(var r=e.i,n,i,a=0;i=e.GetNext();)switch(n=e.i++,i){case"\\":var u=e.GetCS();u===")"&&(i="\\(");case"$":if(a===0&&t===i){var o=e.texParser.configuration,f=new ZU.default(e.string.substr(r,n-r),e.stack.env,o).mml();e.PushMath(f);return}break;case"{":a++;break;case"}":a===0&&e.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace"),a--;break}e.Error("MathNotTerminated","Math-mode is not properly terminated")},MathModeOnly:function(e,t){e.Error("MathModeOnly","'%1' allowed only in math mode",t)},Misplaced:function(e,t){e.Error("Misplaced","'%1' can not be used here",t)},OpenBrace:function(e,t){var r=e.stack.env;e.envStack.push(r),e.stack.env=Object.assign({},r)},CloseBrace:function(e,t){e.envStack.length?(e.saveText(),e.stack.env=e.envStack.pop()):e.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace")},OpenQuote:function(e,t){e.string.charAt(e.i)===t?(e.text+="“",e.i++):e.text+="‘"},CloseQuote:function(e,t){e.string.charAt(e.i)===t?(e.text+="”",e.i++):e.text+="’"},Tilde:function(e,t){e.text+=" "},Space:function(e,t){for(e.text+=" ";e.GetNext().match(/\s/);)e.i++},SelfQuote:function(e,t){e.text+=t.substr(1)},Insert:function(e,t,r){e.text+=r},Accent:function(e,t,r){var n=e.ParseArg(t),i=e.create("token","mo",{},r);e.addAttributes(i),e.Push(e.create("node","mover",[n,i]))},Emph:function(e,t){var r=e.stack.env.mathvariant==="-tex-mathit"?"normal":"-tex-mathit";e.Push(e.ParseTextArg(t,{mathvariant:r}))},SetFont:function(e,t,r){e.saveText(),e.stack.env.mathvariant=r},SetSize:function(e,t,r){e.saveText(),e.stack.env.mathsize=r},CheckAutoload:function(e,t){var r=e.configuration.packageData.get("autoload"),n=e.texParser;t=t.slice(1);var i=n.lookup("macro",t);if(!i||r&&i._func===r.Autoload){if(n.parse("macro",[n,t]),!i)return;(0,qU.retryAfter)(Promise.resolve())}n.parse("macro",[e,t])},Macro:Ki.default.Macro,Spacer:Ki.default.Spacer,Hskip:Ki.default.Hskip,rule:Ki.default.rule,Rule:Ki.default.Rule,HandleRef:Ki.default.HandleRef};var Oo={},GU=D&&D.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ux=D&&D.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},UU=D&&D.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return a},WU=D&&D.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))},$l=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.TextParser=void 0;var XU=$l(o3()),Qx=$l(L1),KU=$l(R1()),JU=Ft,Tx=$l(F1),hx=Nt,YU=function(e){GU(t,e);function t(r,n,i,a){var u=e.call(this,r,n,i)||this;return u.level=a,u}return Object.defineProperty(t.prototype,"texParser",{get:function(){return this.configuration.packageData.get("textmacros").texParser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this.texParser.tags},enumerable:!1,configurable:!0}),t.prototype.mml=function(){return this.level!=null?this.create("node","mstyle",this.nodes,{displaystyle:!1,scriptlevel:this.level}):this.nodes.length===1?this.nodes[0]:this.create("node","mrow",this.nodes)},t.prototype.Parse=function(){this.text="",this.nodes=[],this.envStack=[],e.prototype.Parse.call(this)},t.prototype.saveText=function(){if(this.text){var r=this.stack.env.mathvariant,n=KU.default.internalText(this,this.text,r?{mathvariant:r}:{});this.text="",this.Push(n)}},t.prototype.Push=function(r){if(this.text&&this.saveText(),r instanceof hx.StopItem)return e.prototype.Push.call(this,r);if(r instanceof hx.StyleItem){this.stack.env.mathcolor=this.stack.env.color;return}r instanceof JU.AbstractMmlNode&&(this.addAttributes(r),this.nodes.push(r))},t.prototype.PushMath=function(r){var n,i,a=this.stack.env;r.isKind("TeXAtom")||(r=this.create("node","TeXAtom",[r]));try{for(var u=ux(["mathsize","mathcolor"]),o=u.next();!o.done;o=u.next()){var f=o.value;a[f]&&!r.attributes.getExplicit(f)&&(!r.isToken&&!r.isKind("mstyle")&&(r=this.create("node","mstyle",[r])),Tx.default.setAttribute(r,f,a[f]))}}catch(h){n={error:h}}finally{try{o&&!o.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}r.isInferred&&(r=this.create("node","mrow",r.childNodes)),this.nodes.push(r)},t.prototype.addAttributes=function(r){var n,i,a=this.stack.env;if(r.isToken)try{for(var u=ux(["mathsize","mathcolor","mathvariant"]),o=u.next();!o.done;o=u.next()){var f=o.value;a[f]&&!r.attributes.getExplicit(f)&&Tx.default.setAttribute(r,f,a[f])}}catch(h){n={error:h}}finally{try{o&&!o.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}},t.prototype.ParseTextArg=function(r,n){var i=this.GetArgument(r);return n=Object.assign(Object.assign({},this.stack.env),n),new t(i,n,this.configuration).mml()},t.prototype.ParseArg=function(r){return new t(this.GetArgument(r),this.stack.env,this.configuration).mml()},t.prototype.Error=function(r,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];throw new(Qx.default.bind.apply(Qx.default,WU([void 0,r,n],UU(i),!1)))},t}(XU.default);Oo.TextParser=YU;var eW=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tW=zt,T4=K2,rW=Xi,nW=eW(R1()),iW=Oo;new tW.CommandMap("textcomp-macros",{textasciicircum:["Insert","^"],textasciitilde:["Insert","~"],textasteriskcentered:["Insert","*"],textbackslash:["Insert","\\"],textbar:["Insert","|"],textbraceleft:["Insert","{"],textbraceright:["Insert","}"],textbullet:["Insert","•"],textdagger:["Insert","†"],textdaggerdbl:["Insert","‡"],textellipsis:["Insert","…"],textemdash:["Insert","—"],textendash:["Insert","–"],textexclamdown:["Insert","¡"],textgreater:["Insert",">"],textless:["Insert","<"],textordfeminine:["Insert","ª"],textordmasculine:["Insert","º"],textparagraph:["Insert","¶"],textperiodcentered:["Insert","·"],textquestiondown:["Insert","¿"],textquotedblleft:["Insert","“"],textquotedblright:["Insert","”"],textquoteleft:["Insert","‘"],textquoteright:["Insert","’"],textsection:["Insert","§"],textunderscore:["Insert","_"],textvisiblespace:["Insert","␣"],textacutedbl:["Insert","˝"],textasciiacute:["Insert","´"],textasciibreve:["Insert","˘"],textasciicaron:["Insert","ˇ"],textasciidieresis:["Insert","¨"],textasciimacron:["Insert","¯"],textgravedbl:["Insert","˵"],texttildelow:["Insert","˷"],textbaht:["Insert","฿"],textcent:["Insert","¢"],textcolonmonetary:["Insert","₡"],textcurrency:["Insert","¤"],textdollar:["Insert","$"],textdong:["Insert","₫"],texteuro:["Insert","€"],textflorin:["Insert","ƒ"],textguarani:["Insert","₲"],textlira:["Insert","₤"],textnaira:["Insert","₦"],textpeso:["Insert","₱"],textsterling:["Insert","£"],textwon:["Insert","₩"],textyen:["Insert","¥"],textcircledP:["Insert","℗"],textcompwordmark:["Insert","‌"],textcopyleft:["Insert","🄯"],textcopyright:["Insert","©"],textregistered:["Insert","®"],textservicemark:["Insert","℠"],texttrademark:["Insert","™"],textbardbl:["Insert","‖"],textbigcircle:["Insert","◯"],textblank:["Insert","␢"],textbrokenbar:["Insert","¦"],textdiscount:["Insert","⁒"],textestimated:["Insert","℮"],textinterrobang:["Insert","‽"],textinterrobangdown:["Insert","⸘"],textmusicalnote:["Insert","♪"],textnumero:["Insert","№"],textopenbullet:["Insert","◦"],textpertenthousand:["Insert","‱"],textperthousand:["Insert","‰"],textrecipe:["Insert","℞"],textreferencemark:["Insert","※"],textlangle:["Insert","〈"],textrangle:["Insert","〉"],textlbrackdbl:["Insert","⟦"],textrbrackdbl:["Insert","⟧"],textlquill:["Insert","⁅"],textrquill:["Insert","⁆"],textcelsius:["Insert","℃"],textdegree:["Insert","°"],textdiv:["Insert","÷"],textdownarrow:["Insert","↓"],textfractionsolidus:["Insert","⁄"],textleftarrow:["Insert","←"],textlnot:["Insert","¬"],textmho:["Insert","℧"],textminus:["Insert","−"],textmu:["Insert","µ"],textohm:["Insert","Ω"],textonehalf:["Insert","½"],textonequarter:["Insert","¼"],textonesuperior:["Insert","¹"],textpm:["Insert","±"],textrightarrow:["Insert","→"],textsurd:["Insert","√"],textthreequarters:["Insert","¾"],textthreesuperior:["Insert","³"],texttimes:["Insert","×"],texttwosuperior:["Insert","²"],textuparrow:["Insert","↑"],textborn:["Insert","*"],textdied:["Insert","†"],textdivorced:["Insert","⚮"],textmarried:["Insert","⚭"],textcentoldstyle:["Insert","¢",T4.TexConstant.Variant.OLDSTYLE],textdollaroldstyle:["Insert","$",T4.TexConstant.Variant.OLDSTYLE],textzerooldstyle:["Insert","0",T4.TexConstant.Variant.OLDSTYLE],textoneoldstyle:["Insert","1",T4.TexConstant.Variant.OLDSTYLE],texttwooldstyle:["Insert","2",T4.TexConstant.Variant.OLDSTYLE],textthreeoldstyle:["Insert","3",T4.TexConstant.Variant.OLDSTYLE],textfouroldstyle:["Insert","4",T4.TexConstant.Variant.OLDSTYLE],textfiveoldstyle:["Insert","5",T4.TexConstant.Variant.OLDSTYLE],textsixoldstyle:["Insert","6",T4.TexConstant.Variant.OLDSTYLE],textsevenoldstyle:["Insert","7",T4.TexConstant.Variant.OLDSTYLE],texteightoldstyle:["Insert","8",T4.TexConstant.Variant.OLDSTYLE],textnineoldstyle:["Insert","9",T4.TexConstant.Variant.OLDSTYLE]},{Insert:function(e,t,r,n){if(e instanceof iW.TextParser){if(!n){rW.TextMacrosMethods.Insert(e,t,r);return}e.saveText()}e.Push(nW.default.internalText(e,r,n?{mathvariant:n}:{}))}}),Object.defineProperty(WT,"__esModule",{value:!0}),WT.TextcompConfiguration=void 0;var aW=f1;WT.TextcompConfiguration=aW.Configuration.create("textcomp",{handler:{macro:["textcomp-macros"]}});var ko={},dx=zt,sr=K2,fx=Xi,A6=Y4;new dx.MacroMap("text-special",{$:"Math","%":"Comment","^":"MathModeOnly",_:"MathModeOnly","&":"Misplaced","#":"Misplaced","~":"Tilde"," ":"Space"," ":"Space","\r":"Space","\n":"Space"," ":"Tilde","{":"OpenBrace","}":"CloseBrace","`":"OpenQuote","'":"CloseQuote"},fx.TextMacrosMethods),new dx.CommandMap("text-macros",{"(":"Math",$:"SelfQuote",_:"SelfQuote","%":"SelfQuote","{":"SelfQuote","}":"SelfQuote"," ":"SelfQuote","&":"SelfQuote","#":"SelfQuote","\\":"SelfQuote","'":["Accent","´"],"’":["Accent","´"],"`":["Accent","`"],"‘":["Accent","`"],"^":["Accent","^"],'"':["Accent","¨"],"~":["Accent","~"],"=":["Accent","¯"],".":["Accent","˙"],u:["Accent","˘"],v:["Accent","ˇ"],emph:"Emph",rm:["SetFont",sr.TexConstant.Variant.NORMAL],mit:["SetFont",sr.TexConstant.Variant.ITALIC],oldstyle:["SetFont",sr.TexConstant.Variant.OLDSTYLE],cal:["SetFont",sr.TexConstant.Variant.CALLIGRAPHIC],it:["SetFont","-tex-mathit"],bf:["SetFont",sr.TexConstant.Variant.BOLD],bbFont:["SetFont",sr.TexConstant.Variant.DOUBLESTRUCK],scr:["SetFont",sr.TexConstant.Variant.SCRIPT],frak:["SetFont",sr.TexConstant.Variant.FRAKTUR],sf:["SetFont",sr.TexConstant.Variant.SANSSERIF],tt:["SetFont",sr.TexConstant.Variant.MONOSPACE],tiny:["SetSize",.5],Tiny:["SetSize",.6],scriptsize:["SetSize",.7],small:["SetSize",.85],normalsize:["SetSize",1],large:["SetSize",1.2],Large:["SetSize",1.44],LARGE:["SetSize",1.73],huge:["SetSize",2.07],Huge:["SetSize",2.49],Bbb:["Macro","{\\bbFont #1}",1],textnormal:["Macro","{\\rm #1}",1],textup:["Macro","{\\rm #1}",1],textrm:["Macro","{\\rm #1}",1],textit:["Macro","{\\it #1}",1],textbf:["Macro","{\\bf #1}",1],textsf:["Macro","{\\sf #1}",1],texttt:["Macro","{\\tt #1}",1],dagger:["Insert","†"],ddagger:["Insert","‡"],S:["Insert","§"],",":["Spacer",A6.MATHSPACE.thinmathspace],":":["Spacer",A6.MATHSPACE.mediummathspace],">":["Spacer",A6.MATHSPACE.mediummathspace],";":["Spacer",A6.MATHSPACE.thickmathspace],"!":["Spacer",A6.MATHSPACE.negativethinmathspace],enspace:["Spacer",.5],quad:["Spacer",1],qquad:["Spacer",2],thinspace:["Spacer",A6.MATHSPACE.thinmathspace],negthinspace:["Spacer",A6.MATHSPACE.negativethinmathspace],hskip:"Hskip",hspace:"Hskip",kern:"Hskip",mskip:"Hskip",mspace:"Hskip",mkern:"Hskip",rule:"rule",Rule:["Rule"],Space:["Rule","blank"],color:"CheckAutoload",textcolor:"CheckAutoload",colorbox:"CheckAutoload",fcolorbox:"CheckAutoload",href:"CheckAutoload",style:"CheckAutoload",class:"CheckAutoload",cssId:"CheckAutoload",unicode:"CheckAutoload",ref:["HandleRef",!1],eqref:["HandleRef",!0]},fx.TextMacrosMethods);var oW=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ji;Object.defineProperty(ko,"__esModule",{value:!0}),ko.TextMacrosConfiguration=ko.TextBaseConfiguration=void 0;var XT=f1,sW=oW(Ks),px=wr,Sn=Nt,mx=Oo,lW=Xi;ko.TextBaseConfiguration=XT.Configuration.create("text-base",{parser:"text",handler:{character:["command","text-special"],macro:["text-macros"]},fallback:{character:function(e,t){e.text+=t},macro:function(e,t){var r=e.texParser,n=r.lookup("macro",t);n&&n._func!==lW.TextMacrosMethods.Macro&&e.Error("MathMacro","%1 is only supported in math mode","\\"+t),r.parse("macro",[e,t])}},items:(Ji={},Ji[Sn.StartItem.prototype.kind]=Sn.StartItem,Ji[Sn.StopItem.prototype.kind]=Sn.StopItem,Ji[Sn.MmlItem.prototype.kind]=Sn.MmlItem,Ji[Sn.StyleItem.prototype.kind]=Sn.StyleItem,Ji)});function cW(e,t,r,n){var i=e.configuration.packageData.get("textmacros");return e instanceof mx.TextParser||(i.texParser=e),[new mx.TextParser(t,n?{mathvariant:n}:{},i.parseOptions,r).mml()]}ko.TextMacrosConfiguration=XT.Configuration.create("textmacros",{config:function(e,t){var r=new XT.ParserConfiguration(t.parseOptions.options.textmacros.packages,["tex","text"]);r.init();var n=new sW.default(r,[]);n.options=t.parseOptions.options,r.config(t),px.TagsFactory.addTags(r.tags),n.tags=px.TagsFactory.getDefault(),n.tags.configuration=n,n.packageData=t.parseOptions.packageData,n.packageData.set("textmacros",{parseOptions:n,jax:t,texParser:null}),n.options.internalMath=cW},preprocessors:[function(e){var t=e.data.packageData.get("textmacros");t.parseOptions.nodeFactory.setMmlFactory(t.jax.mmlFactory)}],options:{textmacros:{packages:["text-base"]}}});var KT={};Object.defineProperty(KT,"__esModule",{value:!0}),KT.UpgreekConfiguration=void 0;var uW=f1,QW=zt,TW=K2;function hW(e,t){var r=t.attributes||{};r.mathvariant=TW.TexConstant.Variant.NORMAL;var n=e.create("token","mi",r,t.char);e.Push(n)}new QW.CharacterMap("upgreek",hW,{upalpha:"α",upbeta:"β",upgamma:"γ",updelta:"δ",upepsilon:"ϵ",upzeta:"ζ",upeta:"η",uptheta:"θ",upiota:"ι",upkappa:"κ",uplambda:"λ",upmu:"μ",upnu:"ν",upxi:"ξ",upomicron:"ο",uppi:"π",uprho:"ρ",upsigma:"σ",uptau:"τ",upupsilon:"υ",upphi:"ϕ",upchi:"χ",uppsi:"ψ",upomega:"ω",upvarepsilon:"ε",upvartheta:"ϑ",upvarpi:"ϖ",upvarrho:"ϱ",upvarsigma:"ς",upvarphi:"φ",Upgamma:"Γ",Updelta:"Δ",Uptheta:"Θ",Uplambda:"Λ",Upxi:"Ξ",Uppi:"Π",Upsigma:"Σ",Upupsilon:"Υ",Upphi:"Φ",Uppsi:"Ψ",Upomega:"Ω"}),KT.UpgreekConfiguration=uW.Configuration.create("upgreek",{handler:{macro:["upgreek"]}});var dW={};(function(e){var t=D&&D.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeConfiguration=e.UnicodeMethods=void 0;var r=f1,n=t(L1),i=zt,a=t(R1()),u=t(F1),o=fa;e.UnicodeMethods={};var f={};e.UnicodeMethods.Unicode=function(h,p){var m=h.GetBrackets(p),g=null,v=null;m&&(m.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)?(g=m.replace(/ /g,"").split(/,/),v=h.GetBrackets(p)):v=m);var b=a.default.trimSpaces(h.GetArgument(p)).replace(/^0x/,"x");if(!b.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/))throw new n.default("BadUnicode","Argument to \\unicode must be a number");var w=parseInt(b.match(/^x/)?"0"+b:b);f[w]?v||(v=f[w][2]):f[w]=[800,200,v,w],g&&(f[w][0]=Math.floor(parseFloat(g[0])*1e3),f[w][1]=Math.floor(parseFloat(g[1])*1e3));var E=h.stack.env.font,H={};v?(f[w][2]=H.fontfamily=v.replace(/'/g,"'"),E&&(E.match(/bold/)&&(H.fontweight="bold"),E.match(/italic|-mathit/)&&(H.fontstyle="italic"))):E&&(H.mathvariant=E);var V=h.create("token","mtext",H,(0,o.numeric)(b));u.default.setProperty(V,"unicode",!0),h.Push(V)},new i.CommandMap("unicode",{unicode:"Unicode"},e.UnicodeMethods),e.UnicodeConfiguration=r.Configuration.create("unicode",{handler:{macro:["unicode"]}})})(dW);var fW={};(function(e){var t=D&&D.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.VerbConfiguration=e.VerbMethods=void 0;var r=f1,n=K2,i=zt,a=t(L1);e.VerbMethods={},e.VerbMethods.Verb=function(u,o){var f=u.GetNext(),h=++u.i;if(f==="")throw new a.default("MissingArgFor","Missing argument for %1",o);for(;u.i<u.string.length&&u.string.charAt(u.i)!==f;)u.i++;if(u.i===u.string.length)throw new a.default("NoClosingDelim","Can't find closing delimiter for %1",u.currentCS);var p=u.string.slice(h,u.i).replace(/ /g," ");u.i++,u.Push(u.create("token","mtext",{mathvariant:n.TexConstant.Variant.MONOSPACE},p))},new i.CommandMap("verb",{verb:"Verb"},e.VerbMethods),e.VerbConfiguration=r.Configuration.create("verb",{handler:{macro:["verb"]}})})(fW),Object.defineProperty(WQ,"__esModule",{value:!0});var yx=WQ.AllPackages=void 0;Jv(),typeof MathJax<"u"&&MathJax.loader&&MathJax.loader.preLoad("[tex]/action","[tex]/ams","[tex]/amscd","[tex]/bbox","[tex]/boldsymbol","[tex]/braket","[tex]/bussproofs","[tex]/cancel","[tex]/cases","[tex]/centernot","[tex]/color","[tex]/colorv2","[tex]/colortbl","[tex]/empheq","[tex]/enclose","[tex]/extpfeil","[tex]/gensymb","[tex]/html","[tex]/mathtools","[tex]/mhchem","[tex]/newcommand","[tex]/noerrors","[tex]/noundefined","[tex]/physics","[tex]/upgreek","[tex]/unicode","[tex]/verb","[tex]/configmacros","[tex]/tagformat","[tex]/textcomp","[tex]/textmacros","[tex]/setoptions"),yx=WQ.AllPackages=["base","action","ams","amscd","bbox","boldsymbol","braket","bussproofs","cancel","cases","centernot","color","colortbl","empheq","enclose","extpfeil","gensymb","html","mathtools","mhchem","newcommand","noerrors","noundefined","upgreek","unicode","verb","configmacros","tagformat","textcomp","textmacros"];const pW=16,mW=8,yW=["svg a{fill:blue;stroke:blue}",'[data-mml-node="mstyle"]>rect[data-bgcolor="true"]{rx: 8%; ry: 12%}','[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join(""),gx=g_();J_(gx);const gW=new Gy({packages:yx}),_W=new _Z.SVG({fontCache:"local"}),vW=Fs.mathjax.document("",{InputJax:gW,OutputJax:_W});function xW(e){const t=vW.convert(e,{display:!1,em:2*pW,ex:2*mW});return gx.innerHTML(t).replace(/<defs>/,`<defs><style>${yW}</style>`)}function _x(e,t,r){return e===null?[t[0]-r.lng,t[1]-r.lat,t[2]+r.lng,t[3]+r.lat]:[Math.min(e[0],t[0]-r.lng),Math.min(e[1],t[1]-r.lat),Math.max(e[2],t[2]+r.lng),Math.max(e[3],t[3]+r.lat)]}function LW(e){const t=e.geometry.coordinates,r="area"in e.properties?Math.sqrt(e.properties.area)/5e5:.1;return fI(t,r)}function bW(e){if(!("renderedLabel"in e)){const t="label"in e?(e.label.substr(0,1).toUpperCase()+e.label.substr(1)).replaceAll(`
656
656
  `,"<br/>"):"";e.renderedLabel=t.replaceAll(/`\$([^\$]*)\$`/g,r=>xW(r.slice(2,-2)))}return e.renderedLabel}class wW{constructor(t){this._flatmap=t,this._map=t.map,this._activeFeatures=[],this._selectedFeatureIds=new Map,this._currentPopup=null,this._infoControl=null,this._tooltip=null,this._inQuery=!1,this._modal=!1,this.__colourOptions={colour:!0,outline:!0},this.__activeMarker=null,this.__lastMarkerId=9e5,this.__markerIdByMarker=new Map,this.__markerIdByFeatureId=new Map,this.__annotationByMarkerId=new Map,this.__markerPositions=new Map,t.setInitialPosition(),this._layerManager=new zI(t),this.__featureEnabledCount=new Map(Array.from(this._flatmap.annotations.keys()).map(i=>[+i,0]));const r=t.options.style!=="functional";this.__pathManager=new yI(t,this,r);const n=this.__pathManager.pathTypes();for(const i of n)this.__pathManager.enablePathsByType(i.type,i.enabled,!0);this.__pathManager.haveCentrelines&&this.enableCentrelines(this.__pathManager.enabledCentrelines,!0),this.__systemsManager=new $I(this._flatmap,this,r),this.__enabledConnectivityTaxons=new Set(this._flatmap.taxonIdentifiers),t.options.standalone&&(this._map.addControl(new eB(t)),this._infoControl=new qI(t),this._map.addControl(this._infoControl),this._map.addControl(new JI(t)),this._map.addControl(new YI(t,n)),this._map.addControl(new WI(t,this._layerManager)),this.__pathManager.haveCentrelines&&this._map.addControl(new KI(t,this._layerManager,{showCentrelines:!1})),t.options.style==="functional"?(this._map.addControl(new tB(t,this.__systemsManager.systems)),this._map.addControl(new XI(t,t.options.layerOptions))):this._map.addControl(new rB(t))),this._map.on("click",this.clickEvent_.bind(this)),this._map.on("mousemove",this.mouseMoveEvent_.bind(this)),this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null,this.__lastClickLngLat=null,this._map.on("move",this.panZoomEvent_.bind(this,"pan")),this._map.on("zoom",this.panZoomEvent_.bind(this,"zoom")),this.__pan_zoom_enabled=!1}get pathManager(){return this.__pathManager}getState(){return{center:this._map.getCenter().toArray(),zoom:this._map.getZoom(),layers:this.layers}}setState(t){const r={};"center"in t&&(r.center=t.center),"zoom"in t&&(r.zoom=t.zoom,"center"in t?r.around=t.center:r.around=[0,0]),Object.keys(r).length>0&&this._map.jumpTo(r)}setPaint(t){this.__colourOptions=t,this._layerManager.setPaint(t)}getLayers(){return this._layerManager.layers}enableLayer(t,r=!0){this._layerManager.activate(t,r)}getSystems(){return this.__systemsManager.systems}enableSystem(t,r=!0){this.__systemsManager.enable(t,r)}mapFeature(t){const r=this._flatmap.annotation(t);if(r!==void 0)return{id:t,source:wu,sourceLayer:(this._flatmap.options.separateLayers?`${r.layer}_${r["tile-layer"]}`:r["tile-layer"]).replaceAll("/","_"),children:r.children||[]}}enableMapFeature(t,r=!0){if(t!==void 0){const n=this._map.getFeatureState(t);"hidden"in n?r?this._map.removeFeatureState(t,"hidden"):n.hidden||this._map.setFeatureState(t,{hidden:!0}):r||this._map.setFeatureState(t,{hidden:!0}),this.__enableFeatureMarker(t.id,r)}}enableFeature(t,r=!0,n=!1){const i=this.__featureEnabledCount.get(+t);(n||r&&i===0||!r&&i==1)&&this.enableMapFeature(this.mapFeature(t),r),n?this.__featureEnabledCount.set(+t,r?1:0):this.__featureEnabledCount.set(+t,i+(r?1:-1))}enableFeatureWithChildren(t,r=!0,n=!1){const i=this.mapFeature(t);if(i!==void 0){this.enableFeature(t,r,n);for(const a of i.children)this.enableFeatureWithChildren(a,r,n)}}__enableFeatureMarker(t,r=!0){const n=this.__markerIdByFeatureId.get(+t);if(n!==void 0){const i=document.getElementById(`marker-${n}`);i&&(i.style.visibility=r?"visible":"hidden")}}__featureEnabled(t){if(t.id){const r=this._map.getFeatureState(t);return r!==void 0&&(!("hidden"in r)||!r.hidden)}return!1}featureSelected_(t){return this._selectedFeatureIds.has(+t)}selectFeature(t,r=!0){const n=this._flatmap.annotation(t);if("sckan"in n){const u=this._layerManager.sckanState;if(u==="none"||u==="valid"&&!n.sckan||u==="invalid"&&n.sckan)return!1}t=+t;let i=!1;const a=this._selectedFeatureIds.size===0;if(this._selectedFeatureIds.has(t))this._selectedFeatureIds.set(t,this._selectedFeatureIds.get(t)+1),i=!0;else{const u=this.mapFeature(t);if(u!==void 0){const o=this._map.getFeatureState(u);o!==void 0&&(!("hidden"in o)||!o.hidden)&&(this._map.setFeatureState(u,{selected:!0}),this._selectedFeatureIds.set(t,1),i=!0)}}return i&&a&&this._layerManager.setPaint({...this.__colourOptions,dimmed:r}),i}unselectFeature(t){if(t=+t,this._selectedFeatureIds.has(t)){const r=this._selectedFeatureIds.get(t);if(r>1)this._selectedFeatureIds.set(t,r-1);else{const n=this.mapFeature(t);n!==void 0&&(this._map.removeFeatureState(n,"selected"),this._selectedFeatureIds.delete(+t))}}this._selectedFeatureIds.size===0&&this._layerManager.setPaint({...this.__colourOptions,dimmed:!1})}unselectFeatures(){for(const t of this._selectedFeatureIds.keys()){const r=this.mapFeature(t);r!==void 0&&this._map.removeFeatureState(r,"selected")}this._selectedFeatureIds.clear(),this._layerManager.setPaint({...this.__colourOptions,dimmed:!1})}__activateFeature(t){t!==void 0&&(this._map.setFeatureState(t,{active:!0}),this._activeFeatures.push(t))}resetActiveFeatures_(){for(;this._activeFeatures.length>0;)this._map.removeFeatureState(this._activeFeatures.pop(),"active")}smallestAnnotatedPolygonFeature_(t){let r=0,n=null;for(const i of t)if(i.geometry.type.includes("Polygon")&&this._map.getFeatureState(i)["map-annotation"]){const a=GP(i.geometry.type,i.geometry.coordinates),u=tI(a);(n===null||r>u)&&(n=i,r=u)}return n}setModal_(t){this._modal=!0}__clearModal(t){this._modal=!1}reset(){this.__clearModal(),this.__clearActiveMarker(),this.unselectFeatures(),this.__enablePathFeatures(this.__pathManager.allFeatureIds(),!0)}clearSearchResults(t=!0){this.unselectFeatures()}selectFeatures(t){if(t.length){this.unselectFeatures();for(const r of t){const n=this._flatmap.annotation(r);if(n&&this.selectFeature(r)&&"type"in n&&n.type.startsWith("line"))for(const i of this.__pathManager.lineFeatureIds([r]))this.selectFeature(i)}}}showSearchResults(t){this.unselectFeatures(),this.zoomToFeatures(t,{noZoomIn:!0})}zoomToFeatures(t,r=null){if(r=mi(r,{noZoomIn:!1,padding:10}),t.length){this.unselectFeatures();let n=null;if(r.noZoomIn){const a=this._map.getBounds().toArray();n=[...a[0],...a[1]]}const i=this._map.unproject({x:r.padding,y:r.padding});i.lng-=n[0],i.lat=n[3]-i.lat;for(const a of t){const u=this._flatmap.annotation(a);if(u&&this.selectFeature(a)&&(n=_x(n,u.bounds,i),"type"in u&&u.type.startsWith("line"))){for(const o of this.__pathManager.lineFeatureIds([a]))if(this.selectFeature(o)){const f=this._flatmap.annotation(o);n=_x(n,f.bounds,i)}}}n!==null&&this._map.fitBounds(n,{padding:0,animate:!1})}}showPopup(t,r,n={}){const i=this._flatmap.annotation(t);if(i){this._currentPopup&&(n&&n.preserveSelection&&(this._currentPopup.options.preserveSelection=n.preserveSelection),this._currentPopup.remove()),n&&n.preserveSelection?delete n.preserveSelection:this.unselectFeatures(),this.selectFeature(t);let a=null;"positionAtLastClick"in n&&n.positionAtLastClick&&this.__lastClickLngLat!==null?a=this.__lastClickLngLat:a=this.__markerPosition(t,i),this._map.getBounds().contains(a)||this._map.panTo(a),this.setModal_(),this._currentPopup=new v3.Popup(n).addTo(this._map),this._currentPopup.on("close",this.__onCloseCurrentPopup.bind(this)),this._currentPopup.setLngLat(a),typeof r=="object"?this._currentPopup.setDOMContent(r):this._currentPopup.setText(r)}}__onCloseCurrentPopup(){this._currentPopup&&(this.__clearModal(),this._currentPopup.options&&this._currentPopup.options.preserveSelection||this.unselectFeatures(),this._currentPopup=null)}removeTooltip_(){this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}lineTooltip_(t){const r=[];for(const n of t){const i=n.properties;if("error"in i&&r.push(`<div class="feature-error">Error: ${i.error}</div>`),"warning"in i&&r.push(`<div class="feature-error">Warning: ${i.warning}</div>`),"label"in i&&(!("tooltip"in i)||i.tooltip)){const a=i.label,u=(a.substr(0,1).toUpperCase()+a.substr(1)).replaceAll(`
657
657
  `,"<br/>");r.includes(u)||r.push(u)}}return r.length===0?"":`<div class='flatmap-feature-label'>${r.join("<hr/>")}</div>`}tooltipHtml_(t,r=!1){const n=[];if("error"in t&&n.push(`<div class="feature-error">Error: ${t.error}</div>`),"warning"in t&&n.push(`<div class="feature-error">Warning: ${t.warning}</div>`),("label"in t||"hyperlink"in t)&&(r||!("tooltip"in t)||t.tooltip)){const i=bW(t);"hyperlink"in t?i===""?n.push(`<a href='${t.hyperlink}'>${t.hyperlink}</a>`):n.push(`<a href='${t.hyperlink}'>${i}</a></div>`):n.push(i)}return n.length===0?"":`<div class='flatmap-feature-label'>${n.join("<hr/>")}</div>`}__featureEvent(t,r){return r.sourceLayer===c4?this._flatmap.featureEvent(t,this.__pathManager.pathProperties(r)):"properties"in r?this._flatmap.featureEvent(t,r.properties):!1}__resetFeatureDisplay(){this.removeTooltip_(),this._map.getCanvas().style.cursor="default",this.resetActiveFeatures_()}mouseMoveEvent_(t){if(this._modal)return;this.__resetFeatureDisplay();const r=this._infoControl&&this._infoControl.active;r&&this._infoControl.reset();const n=this._map.queryRenderedFeatures(t.point).filter(p=>this.__featureEnabled(p));if(n.length===0){this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null;return}const i=n[0],a="properties"in i&&"models"in i.properties?i.properties.models:null;this._lastFeatureMouseEntered!==i.id&&(this._lastFeatureModelsMouse===null||this._lastFeatureModelsMouse!==a)&&(this.__featureEvent("mouseenter",i)?(this._lastFeatureMouseEntered=i.id,this._lastFeatureModelsMouse=a):(this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null));let u="",o="";r&&("tooltip"in n[0].properties||this.__activateFeature(n[0]),u=this._infoControl.featureInformation(n,t.lngLat));const f=n.filter(p=>"centreline"in p.properties||"type"in p.properties&&p.properties.type.startsWith("line"));let h=null;if(f.length>0){o=this.lineTooltip_(f),h=f[0];for(const p of f){const m=+p.properties.featureId;this.__activateFeature(p);const g=new Set(f.map(v=>v.properties.featureId));for(const v of this.__pathManager.lineFeatureIds(g))+v!==m&&this.__activateFeature(this.mapFeature(v))}}else{let p=n.filter(m=>("hyperlink"in m.properties||"label"in m.properties)&&(!("tooltip"in m.properties)||m.properties.tooltip)).sort((m,g)=>m.properties.area-g.properties.area);if(p.length>0){const m=this._map.getZoom(),g=p.filter(b=>b.properties.group&&m<b.properties.scale+1);g.length>0&&(p=g);const v=p[0];if(o=this.tooltipHtml_(v.properties),h=v,this._flatmap.options.debug){const b=["featureId","nerveId","tile-layer","type",...Hu],w=[],E=[];for(const H of p)if(!E.includes(H.id)){E.push(H.id);for(const V of b)V in H.properties&&(w.push(`<span class="info-name">${V}:</span>`),w.push(`<span class="info-value">${H.properties[V]}</span>`))}this._flatmap.options.debug||(u=`<div id="info-control-info">${w.join(`
658
- `)}</div>`)}this.__activateFeature(v),this.__activateRelatedFeatures(v),"hyperlink"in v.properties&&(this._map.getCanvas().style.cursor="pointer")}}u!==""&&this._infoControl.show(u),this.__showToolTip(o,t.lngLat,h)}__showToolTip(t,r,n=null){if(t!==""||this._flatmap.options.showId&&n!==null){let i="";if(this._flatmap.options.showPosition){const a=Bm(r.toArray()),o=aI(a).geometry.coordinates;i=n===null?JSON.stringify(o):`${JSON.stringify(o)} (${n.id})`}this._flatmap.options.showId&&n!==null&&"id"in n.properties&&(i=`${i} ${n.properties.id}`),i!==""&&(t=`<span>${i}</span><br/>${t}`),t!==""&&(this._tooltip=new v3.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-tooltip-popup"}),this._tooltip.setLngLat(r).setHTML(t).addTo(this._map))}}selectionEvent_(t,r){if(r!==void 0){const n=r.id,i=!("properties"in r&&"kind"in r.properties&&["cell-type","scaffold","tissue"].includes(r.properties.kind));if(t.ctrlKey||t.metaKey){const a=this.featureSelected_(n);for(const u of this._activeFeatures)a?this.unselectFeature(u.id):this.selectFeature(u.id,i)}else{let a=!0;for(const u of this._selectedFeatureIds.keys())if(u===n){a=!1;break}if(this.unselectFeatures(),a)for(const u of this._activeFeatures)this.selectFeature(u.id,i)}}}clickEvent_(t){if(this._modal)return;this.__clearActiveMarker();const r=this._map.queryRenderedFeatures(t.point).filter(i=>this.__featureEnabled(i));if(r.length==0){this.unselectFeatures();return}const n=r[0];this.selectionEvent_(t.originalEvent,n),this._modal?(this.__resetFeatureDisplay(),this.unselectFeatures(),this.__clearModal()):n!==void 0&&(this.__lastClickLngLat=t.lngLat,this.__featureEvent("click",n),"properties"in n&&"hyperlink"in n.properties&&window.open(n.properties.hyperlink,"_blank"))}__activateRelatedFeatures(t){if("nerveId"in t.properties){const r=t.properties.nerveId;r!==t.id&&this.__activateFeature(this.mapFeature(r));for(const n of this.__pathManager.nerveFeatureIds(r))this.__activateFeature(this.mapFeature(n))}if("nodeId"in t.properties)for(const r of this.__pathManager.pathFeatureIds(t.properties.nodeId))this.__activateFeature(this.mapFeature(r))}enablePath(t,r=!0){this.__pathManager.enablePath(t,r)}enablePathsBySystem(t,r=!0,n=!1){this.__pathManager.enablePathsBySystem(t,r,n)}enablePathsByType(t,r=!0){this.__pathManager.enablePathsByType(t,r)}pathFeatureIds(t){const r=new Os;return r.extend(this.__pathManager.connectivityModelFeatureIds(t)),r.extend(this.__pathManager.pathModelFeatureIds(t)),r}pathModelNodes(t){return this.__pathManager.pathModelNodes(t)}nodePathModels(t){return this.__pathManager.nodePathModels(t)}enableCentrelines(t=!0,r=!1){this.__pathManager.enablePathsByType("centreline",t,r),this._layerManager.setPaint({showCentrelines:t})}enableSckanPaths(t,r=!0){this._layerManager.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){if(r)for(const n of t)this.__enabledConnectivityTaxons.add(n);else for(const n of t)this.__enabledConnectivityTaxons.delete(n);this._layerManager.setFilter({taxons:[...this.__enabledConnectivityTaxons.values()]})}excludeAnnotated(t=!1){this._layerManager.setPaint({excludeAnnotated:t})}__markerPosition(t,r){if(this.__markerPositions.has(t))return this.__markerPositions.get(t);let n=r.markerPosition||r.centroid;if(n===null||n==null){const i=this._map.querySourceFeatures(wu,{sourceLayer:this._flatmap.options.separateLayers?`${r.layer}_${r["tile-layer"]}`:r["tile-layer"],filter:["all",["==",["id"],parseInt(t)],["==",["geometry-type"],"Polygon"]]});i.length>0&&(n=LW(i[0]))}return this.__markerPositions.set(t,n),n}addMarker(t,r={}){const n=this._flatmap.modelFeatureIds(t);let i=-1;for(const a of n){const u=this._flatmap.annotation(a);if(!(!("markerPosition"in u)&&!u.geometry.includes("Polygon"))&&!("marker"in u)){i===-1&&(this.__lastMarkerId+=1,i=this.__lastMarkerId);const o=r.colour||"#005974",f=r.element?new v3.Marker({element:r.element}):new v3.Marker({color:o,scale:.5}),h=document.createElement("div"),p=document.createElement("div");p.innerHTML=f.getElement().innerHTML,h.id=`marker-${i}`,h.appendChild(p);const m={element:h};"className"in r&&(m.className=r.className);const g=this.__markerPosition(a,u),v=new v3.Marker(m).setLngLat(g).addTo(this._map);h.addEventListener("mouseenter",this.markerMouseEvent_.bind(this,v,t)),h.addEventListener("mousemove",this.markerMouseEvent_.bind(this,v,t)),h.addEventListener("mouseleave",this.markerMouseEvent_.bind(this,v,t)),h.addEventListener("click",this.markerMouseEvent_.bind(this,v,t)),this.__markerIdByMarker.set(v,i),this.__markerIdByFeatureId.set(+a,i),this.__annotationByMarkerId.set(i,u),this.__featureEnabled(this.mapFeature(+a))||(h.style.visibility="hidden")}}return i===-1&&console.warn(`Unable to find feature '${t}' on which to place marker`),i}clearMarkers(){for(const t of this.__markerIdByMarker.keys())t.remove();this.__markerIdByMarker.clear(),this.__annotationByMarkerId.clear()}removeMarker(t){for(const[r,n]of this.__markerIdByMarker.entries())if(t===n){r.remove(),this.__markerIdByMarker.remove(r),this.__annotationByMarkerId.remove(n);break}}visibleMarkerAnatomicalIds(){const t=[],r=this._map.getBounds();for(const[n,i]of this.__markerIdByMarker.entries())if(r.contains(n.getLngLat())){const a=this.__annotationByMarkerId.get(i);t.includes(a.models)||t.push(a.models)}return t}markerMouseEvent_(t,r,n){if(!(this._modal||this.__activeMarker!==null&&n.type==="mouseleave")){if(["mouseenter","mouseleave","click"].includes(n.type)&&(this.__activeMarker=t,this.removeTooltip_(),t.setPopup(null),t.getElement().style.cursor="default",["mouseenter","click"].includes(n.type))){const i=this.__markerIdByMarker.get(t),a=this.__annotationByMarkerId.get(i),u=this.mapFeature(a.featureId);u!==void 0&&(n.type==="mouseenter"?(this.resetActiveFeatures_(),this.__activateFeature(u)):this.selectionEvent_(n,u));const o=this.tooltipHtml_(a,!0);this.__showToolTip(o,t.getLngLat()),this._flatmap.markerEvent(n.type,i,r)}n.stopPropagation()}}__clearActiveMarker(){this.__activeMarker!==null&&(this.__activeMarker.setPopup(null),this.__activeMarker=null)}showMarkerPopup(t,r,n){const i=this.__activeMarker;if(t!==this.__markerIdByMarker.get(i))return this.__clearActiveMarker(),!1;const a=i.getLngLat();this._map.getBounds().contains(a)||this._map.panTo(a);const u=document.createElement("div");return typeof r=="object"?u.appendChild(r):u.innerHTML=r,u.addEventListener("click",o=>this.__clearActiveMarker()),this._tooltip=new v3.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-marker-popup"}),this._tooltip.setLngLat(a).setDOMContent(u),i.setPopup(this._tooltip),i.togglePopup(),!0}enablePanZoomEvents(t=!0){this.__pan_zoom_enabled=t}panZoomEvent_(t){this.__pan_zoom_enabled&&this._flatmap.panZoomEvent(t)}}const vx={fillColor:"#DDD",fillOpacity:.3,lineColor:"#08F",lineOpacity:1,lineWidth:1,position:"bottom-left",width:320},HW=[[18,14,16],[16,12,14],[14,10,12],[12,8,10],[10,6,8]];class MW{constructor(t,r){this._flatmap=t,this._map=void 0,this._container=null,this._background=null,this._opacity=null,this._loaded=!1,this._options=Object.assign({},vx),typeof r=="object"&&("position"in r&&(this._options.position=r.position),"width"in r&&(this._options.width=r.width)),this._ticking=!1,this._lastMouseMoveEvent=null,this._isDragging=!1,this._isCursorOverFeature=!1,this._previousPoint=[0,0],this._currentPoint=[0,0],this._trackingRectCoordinates=[[[],[],[],[],[]]]}getDefaultPosition(){return this._options.position}onAdd(t){this._map=t;const r=document.createElement("div");r.className="maplibregl-ctrl-minimap maplibregl-ctrl",r.id="maplibre-minimap",this._container=r;const n=t.getCanvas();let i=vx.width;return typeof this._options.width=="string"?(i=parseInt(this._options.width),this._options.width.includes("%")&&(i=i*n.width/100)):typeof this._options.width=="number"&&(i=this._options.width),r.setAttribute("style",`width: ${i}px; height: ${i*n.height/n.width}px;`),r.addEventListener("contextmenu",this._preventDefault),this._miniMap=new v3.Map({attributionControl:!1,container:r,style:t.getStyle(),bounds:t.getBounds()}),this._miniMap.on("load",this.load_.bind(this)),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0,this._container=null}load_(){const t=this._options,r=this._map,n=this._miniMap;["dragPan","scrollZoom","boxZoom","dragRotate","keyboard","doubleClickZoom","touchZoomRotate"].forEach(u=>n[u].disable()),this._background!==null&&n.setPaintProperty("background","background-color",this._background),this._opacity!==null&&n.setPaintProperty("background","background-opacity",this._opacity),n.resize(),n.fitBounds(this._flatmap.bounds);const a=n.getBounds();this.convertBoundsToPoints_(a),n.addSource("trackingRect",{type:"geojson",data:{type:"Feature",properties:{name:"trackingRect"},geometry:{type:"Polygon",coordinates:this._trackingRectCoordinates}}}),n.addLayer({id:"trackingRectOutline",type:"line",source:"trackingRect",layout:{},paint:{"line-color":t.lineColor,"line-width":t.lineWidth,"line-opacity":t.lineOpacity}}),n.addLayer({id:"trackingRectFill",type:"fill",source:"trackingRect",layout:{},paint:{"fill-color":t.fillColor,"fill-opacity":t.fillOpacity}}),this._trackingRect=this._miniMap.getSource("trackingRect"),this.update_(),r.on("move",this.update_.bind(this)),n.on("mousemove",this.mouseMove_.bind(this)),n.on("mousedown",this.mouseDown_.bind(this)),n.on("mouseup",this.mouseUp_.bind(this)),n.on("touchmove",this.mouseMove_.bind(this)),n.on("touchstart",this.mouseDown_.bind(this)),n.on("touchend",this.mouseUp_.bind(this)),this._miniMapCanvas=n.getCanvasContainer(),this._miniMapCanvas.addEventListener("wheel",this.preventDefault_),this._miniMapCanvas.addEventListener("mousewheel",this.preventDefault_)}mouseDown_(t){this._isCursorOverFeature&&(this._isDragging=!0,this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat])}mouseMove_(t){this._ticking=!1;const n=this._miniMap.queryRenderedFeatures(t.point,{layers:["trackingRectFill"]});if(this._isCursorOverFeature&&n.length>0||(this._isCursorOverFeature=n.length>0,this._miniMapCanvas.style.cursor=this._isCursorOverFeature?"move":""),this._isDragging){this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat];const i=[this._previousPoint[0]-this._currentPoint[0],this._previousPoint[1]-this._currentPoint[1]],a=this.moveTrackingRect_(i);this._map.fitBounds(a,{duration:80,noMoveStart:!0})}}mouseUp_(){this._isDragging=!1,this._ticking=!1}moveTrackingRect_(t){const r=this._trackingRect,n=r._data,i=n.properties.bounds;return i._ne.lat-=t[1],i._ne.lng-=t[0],i._sw.lat-=t[1],i._sw.lng-=t[0],this.convertBoundsToPoints_(i),r.setData(n),i}setTrackingRectBounds_(t){const r=this._trackingRect,n=r._data;n.properties.bounds=t,this.convertBoundsToPoints_(t),r.setData(n)}convertBoundsToPoints_(t){const r=t._ne,n=t._sw,i=this._trackingRectCoordinates;i[0][0][0]=r.lng,i[0][0][1]=r.lat,i[0][1][0]=n.lng,i[0][1][1]=r.lat,i[0][2][0]=n.lng,i[0][2][1]=n.lat,i[0][3][0]=r.lng,i[0][3][1]=n.lat,i[0][4][0]=r.lng,i[0][4][1]=r.lat}update_(t){if(this._isDragging)return;const r=this._map.getBounds();this.setTrackingRectBounds_(r),this.zoomAdjust_()}zoomAdjust_(){const t=this._miniMap,r=this._map,n=parseInt(t.getZoom(),10),i=parseInt(r.getZoom(),10);let a=!1;HW.forEach(function(u){!a&&i>=u[0]&&(n>=u[1]&&t.setZoom(u[2]),t.setCenter(r.getCenter()),a=!0)})}preventDefault_(t){t.preventDefault()}setBackgroundColour(t){this._loaded?this._miniMap.setPaintProperty("background","background-color",t):this._background=t}setBackgroundOpacity(t){this._loaded?this._miniMap.setPaintProperty("background","background-opacity",t):this._opacity=t}show(t){this._container&&(t?(this._container.style.display="block",this.update_()):this._container.style.display="none")}}const CW=[{id:"label-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAmCAIAAADbSlUzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAACVSURBVFhH7dixDoJAEIThfXqMBcYKrTQ+jkYSStDYkVhZINxyEshJcZXJtC7FfNlmur9eyXb7Vqf6+bI9HUKyWkt5e4RlOF9ycerjsqbqpfefuKzNJawBWIOxBmMNxhqMNRhrMNZgrMFYg7EGYw3GGow1GGuw5dU07y4ua22nUlb3uKxd80IOx1Pjxp+f4P/P+ZButl+YrbXnPs+YmAAAAABJRU5ErkJggg==",options:{content:[21,4,28,33],stretchX:[[21,28]],stretchY:[[4,33]]}},{id:"xlabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJExO2pF7NAAAAqUlEQVQ4y+3OIQ6CYBiH8ef9MDhxc8yABjeP4LwAx3BWTwE3oHkMrBa7JJN3YBogfQkjr0HcDCg0C0/+7f2/AjghycLFj0ECYMarHPRcUoQx25uEJMsR/lUQj4YUtQ+K9aC+1IgABPFc/NjUcy1JYD5++tXM0LEe9rCHPfwXzDu43ChV2qaUKjWWLFLUfkdqLVnkXDiWK4LDkMlckCkwfs8p1cmSbfbs7k+jIi/gASaPYQAAAABJRU5ErkJggg==",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"ylabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJEyeXEKp4AAAAwklEQVQ4y+3ULU/DUBhA4XO/2rUgwV1ZBWLJBP9fI0gQuMktWcJSwUq79n68qAoSGnCYHv3oowBD09jz88t1CpGcBQCtFYWz3D3tNuz3EXgojqdWLt0gKWWZSynLpRvkeGqFpinVuf2QsnDc3mz4qe7zyjgF9BQidVWyVF2VTCGicxa0VotQa0XOguaPrXCFK1zhv8D5VkvNt9POGvphXIT9MOKsAbyvfl2z95UCCrw3769vfYjp2+ydNdxvH2sOh/QFh8F7PWWiL5EAAAAASUVORK5CYII=",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"rounded-rectangle",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGmSURBVDiNldPBitpAGAfwv5mMmy85JCistD5Ai/gCPYovYJENCPZQF8VD36HXUkrfQws9R8WLF58gh2h2W2PpoeTWxBgzMr1spd3uUvOHOQ2//3yHb4C/UyGi95Zl3XLOUwASgFRVNTVN8ysRfQTwFA+FMdYhoqjf7+9ns5kMgkCGYSjDMJTb7VbO53M5HA4PRBRzzl//g8vlcrxYLE7osbNcLmWlUok459cAULgb+2YymRi1Wu3B6e7H9300Go1dkiTPGRG97Xa7LzqdjnqWBlAqlRBFEVzXNZRisXhl2/bFufh3bNvmAF4WOOd73/cvDMPIVSCEQLVaFUqWZbkxAKiqCsaYVHLLe1E452kcx7mhEALH47Gg6Lr+3fO83AXr9Rq6rofK4XD4NB6P07wFo9Eok1J+LgC41DTt1nEco16vn4VXqxWazeYuSZJnCoAfWZZdt9vtneu6/8We56HVasVCiDcAvp0uGGM2Ef3s9Xp7x3HkZrM57X8QBHI6ncrBYJASUcQYe/XYA5eapr2zLOuGc77H3XfmnKemaX4hog8AnvwJfgHMKs1jQ++4tQAAAABJRU5ErkJggg==",options:{content:[3,3,13,13],stretchX:[[7,9]],stretchY:[[7,9]]}}],AW=1.4,xx="NCBITaxon:2787823";class SW{constructor(t,r,n,i){this._baseUrl=r,this.__id=n.id,this.__uuid=n.uuid,this.__details=n.details,this.__provenance=n.provenance,this.__created=n.created,this.__taxon=n.taxon,this.__biologicalSex=n.biologicalSex,this._mapNumber=n.number,this._callback=n.callback,this._layers=n.layers,this._markers=n.markers,this._options=n.options,this._pathways=n.pathways,this._resolve=i,this._map=null,this.__searchIndex=new ZP(this),this.__idToAnnotation=new Map,this.__datasetToFeatureIds=new Map,this.__modelToFeatureIds=new Map,this.__mapSourceToFeatureIds=new Map,this.__annIdToFeatureId=new Map,this.__taxonToFeatureIds=new Map;for(const[u,o]of Object.entries(n.annotations))this.__addAnnotation(u,o),this.__searchIndex.indexMetadata(u,o);for(const[u,o]of Object.entries(n.style.sources))if(o.url&&(o.url=this.makeServerUrl(o.url)),o.tiles){const f=[];for(const h of o.tiles)f.push(this.makeServerUrl(h));o.tiles=f}"images"in n.options||(n.options.images=[]);for(const u of CW){let o=!1;for(const f of n.options.images)if(u.id===f.id){o=!0;break}o||n.options.images.push(u)}const a={style:n.style,container:t,attributionControl:!1};if("maxZoom"in n.options&&(a.maxZoom=n.options.maxZoom),"minZoom"in n.options&&(a.minZoom=n.options.minZoom),a.hash=n.options.debug===!0,this._map=new v3.Map(a),n.options.debug===!0&&(this._map.showTileBoundaries=!0),this._map.setRenderWorldCopies(!1),n.options.fullscreenControl===!0&&this._map.addControl(new v3.FullscreenControl,"top-right"),this._map.dragRotate.disable(),this._map.touchZoomRotate.disableRotation(),n.options.navigationControl){const u=n.options.navigationControl,o=typeof u=="string"&&["top-left","top-right","bottom-right","bottom-left"].includes(u)?u:"bottom-right";this._map.addControl(new UI(this),o)}this._userInteractions=null,this._initialState=null,this._minimap=null,this._map.on("idle",()=>{if(this._userInteractions===null)this.setupUserInteractions_();else if(this._initialState===null){this._map.setMinZoom(3),this._map.setMaxBounds(null),this._map.setRenderWorldCopies(!0),this._bounds=this._map.getBounds();const u=this._bounds.toArray(),o=v3.MercatorCoordinate.fromLngLat(u[0]),f=v3.MercatorCoordinate.fromLngLat(u[1]);this.__normalised_origin=[o.x,f.y],this.__normalised_size=[f.x-o.x,o.y-f.y],"state"in this._options&&this._userInteractions.setState(this._options.state),this._initialState=this.getState(),this.options.minimap&&(this._minimap=new MW(this,this.options.minimap),this._map.addControl(this._minimap)),this._resolve(this)}})}async setupUserInteractions_(){for(const t of this._options.images)await this.addImage(t.id,t.url,"",t.options);this._userInteractions=new wW(this)}get bounds(){return this._bounds}resetMap(){this._initialState!==null&&this.setState(this._initialState),this._userInteractions!==null&&this._userInteractions.reset()}zoomIn(){this._map.zoomIn()}zoomOut(){this._map.zoomOut()}pathTypes(){if(this._userInteractions!==null)return this._userInteractions.pathManager.pathTypes()}enablePath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enablePathsByType(t,r)}enableSckanPath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){this._userInteractions!==null&&(Array.isArray(t)?this._userInteractions.enableConnectivityByTaxonIds(t,r):this._userInteractions.enableConnectivityByTaxonIds([t],r))}enableCentrelines(t=!0){this._userInteractions!==null&&this._userInteractions.enableCentrelines(t)}loadImage_(t){return new Promise((r,n)=>{this._map.loadImage(t,(i,a)=>{i?n(i):r(a)})})}loadEncodedImage_(t){return new Promise((r,n)=>{const i=new Image;i.src=t,i.onload=a=>r(a.target)})}async addImage(t,r,n,i={}){if(!this._map.hasImage(t)){const a=await(r.startsWith("data:image")?this.loadEncodedImage_(r):this.loadImage_(r.startsWith("/")?this.makeServerUrl(r):new URL(r,n)));this._map.addImage(t,a,i)}}makeServerUrl(t,r="flatmap/"){return t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("/")?`${this._baseUrl}${r}${this.__uuid}${t}`:`${this._baseUrl}${r}${this.__uuid}/${t}`}get taxon(){return this.__taxon}get biologicalSex(){return this.__biologicalSex}get created(){return this.__created}get id(){return this.__id}get uuid(){return this.__uuid}get details(){return this.__details}get provenance(){return this.__provenance}get uniqueId(){return`${this.__uuid}-${this._mapNumber}`}get annotations(){return this.__idToAnnotation}annotation(t){return this.__idToAnnotation.get(t.toString())}setFeatureAnnotated(t){this._userInteractions!==null&&this._userInteractions.setFeatureAnnotated(t)}__updateFeatureIdMapEntry(t,r,n){const i=Lu(t),a=r.get(i);a?a.push(n):r.set(i,[n])}__updateFeatureIdMap(t,r,n,i=null){if(t in n&&n[t].length){const a=n[t];if(Array.isArray(a))for(const u of a)this.__updateFeatureIdMapEntry(u,r,n.featureId);else this.__updateFeatureIdMapEntry(a,r,n.featureId)}else i!==null&&"models"in n&&n.models.startsWith(mI)&&this.__updateFeatureIdMapEntry(i,r,n.featureId)}__addAnnotation(t,r){r.featureId=t,this.__idToAnnotation.set(t,r),this.__updateFeatureIdMap("dataset",this.__datasetToFeatureIds,r),this.__updateFeatureIdMap("models",this.__modelToFeatureIds,r),this.__updateFeatureIdMap("source",this.__mapSourceToFeatureIds,r),this.__updateFeatureIdMap("taxons",this.__taxonToFeatureIds,r,xx),this.__annIdToFeatureId.set(r.id,t)}modelFeatureIds(t){const r=this.__modelToFeatureIds.get(Lu(t));return r||[]}modelFeatureIdList(t){const r=new Os;if(Array.isArray(t))for(const n of t)r.extend(this.modelFeatureIds(n));else r.extend(this.modelFeatureIds(t));return r.length==0&&(r.extend(this.__datasetToFeatureIds.get(t)),r.extend(this.__mapSourceToFeatureIds.get(t))),r.length==0&&this._userInteractions!==null&&r.extend(this._userInteractions.pathFeatureIds(t)),r}modelForFeature(t){const r=this.__idToAnnotation.get(t);return r&&"models"in r?Lu(r.models):null}nodePathModels(t){if(this._userInteractions!==null)return this._userInteractions.nodePathModels(t)}pathModelNodes(t){if(this._userInteractions!==null)return this._userInteractions.pathModelNodes(t)}get layers(){return this._layers}get map(){return this._map}get markers(){return this._markers}get anatomicalIdentifiers(){return[...this.__modelToFeatureIds.keys()]}get taxonIdentifiers(){return[...this.__taxonToFeatureIds.keys()]}get datasets(){return[...this.__datasetToFeatureIds.keys()]}get options(){return this._options}get pathways(){return this._pathways}getZoom(){return{mapUUID:this.__uuid,minZoom:this._map.getMinZoom(),zoom:this._map.getZoom(),maxZoom:this._map.getMaxZoom()}}callback(t,r,...n){if(this._callback)return r.mapUUID=this.__uuid,this._callback(t,r,...n)}setInitialPosition(){"bounds"in this._options&&this._map.fitBounds(this._options.bounds,{animate:!1}),"center"in this._options&&this._map.setCenter(this._options.center),"zoom"in this._options&&this._map.setZoom(this._options.zoom)}close(){this._map&&(this._map.remove(),this._map=null)}resize(){this._map.resize()}getIdentifier(){return{taxon:this.__taxon,biologicalSex:this.__biologicalSex,uuid:this.__uuid}}getState(){return this._userInteractions!==null?this._userInteractions.getState():{}}setState(t){this._userInteractions!==null&&this._userInteractions.setState(t)}showPopup(t,r,n){this._userInteractions!==null&&this._userInteractions.showPopup(t,r,n)}setPaint(t=null){t=mi(t,{colour:!0,outline:!0}),this._userInteractions!==null&&this._userInteractions.setPaint(t)}setColour(t=null){console.log("`setColour()` is deprecated; please use `setPaint()` instead."),this.setPaint(t)}getBackgroundColour(){return this._map.getPaintProperty("background","background-color")}getBackgroundOpacity(){return this._map.getPaintProperty("background","background-opacity")}setBackgroundColour(t){localStorage.setItem("flatmap-background-colour",t),this._map.setPaintProperty("background","background-color",t),this._minimap&&this._minimap.setBackgroundColour(t)}setBackgroundOpacity(t){this._map.setPaintProperty("background","background-opacity",t),this._minimap&&this._minimap.setBackgroundOpacity(t)}showMinimap(t){this._minimap&&this._minimap.show(t)}getLayers(){if(this._userInteractions!==null)return this._userInteractions.getLayers()}enableLayer(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableLayer(t,r)}getSystems(){if(this._userInteractions!==null)return this._userInteractions.getSystems()}enableSystem(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableSystem(t,r)}addMarker(t,r={}){return this._userInteractions!==null?this._userInteractions.addMarker(t,r):-1}removeMarker(t){this._userInteractions!==null&&this._userInteractions.removeMarker(t)}clearMarkers(){this._userInteractions!==null&&this._userInteractions.clearMarkers()}visibleMarkerAnatomicalIds(){if(this._userInteractions!==null)return this._userInteractions.visibleMarkerAnatomicalIds()}showMarkerPopup(t,r,n={}){return this._userInteractions!==null?this._userInteractions.showMarkerPopup(t,r,n):!1}__exportedProperties(t){const r={},n=["id","featureId","connectivity","dataset","kind","label","models","source","taxons","hyperlinks"],i=["hyperlinks"];for(const a of n)a in t&&t[a]!==void 0&&(i.includes(a)?r[a]=JSON.parse(t[a]):a==="featureId"?r[a]=+t[a]:r[a]=t[a]);return Object.keys(r).length>0&&(r.type="feature"),r}featureEvent(t,r){const n=this.__exportedProperties(r);return Object.keys(n).length>0?(this.callback(t,n),!0):!1}featureProperties(t){const r=this.annotation(t);return r?this.__exportedProperties(r):{}}markerEvent(t,r,n){this.callback(t,{type:"marker",id:r,models:n})}controlEvent(t,r,n){this.callback(t,{type:"control",control:r,value:n})}enablePanZoomEvents(t=!0){this._userInteractions!==null&&this._userInteractions.enablePanZoomEvents(t)}panZoomEvent(t){const r=this._map.getBounds();if(this.__normalised_origin!==void 0){const n=v3.MercatorCoordinate.fromLngLat(r.toArray()[0]),i=v3.MercatorCoordinate.fromLngLat(r.toArray()[1]),a=[(n.x-this.__normalised_origin[0])/this.__normalised_size[0],(i.y-this.__normalised_origin[1])/this.__normalised_size[1]],u=[(i.x-n.x)/this.__normalised_size[0],(n.y-i.y)/this.__normalised_size[1]];this.callback("pan-zoom",{type:t,origin:a,size:u})}}panZoomTo(t,r){if(this.__normalised_origin!==void 0){const n=t[0]*this.__normalised_size[0]+this.__normalised_origin[0],i=t[1]*this.__normalised_size[1]+this.__normalised_origin[1],a=n+r[0]*this.__normalised_size[0],u=i+r[1]*this.__normalised_size[1],o=new v3.MercatorCoordinate(n,u,0).toLngLat(),f=new v3.MercatorCoordinate(a,i,0).toLngLat();this._map.fitBounds([o,f],{animate:!1})}}search(t,r=!1){return r?this.__searchIndex.auto_suggest(t):this.__searchIndex.search(t)}clearSearchResults(){this._userInteractions!==null&&this._userInteractions.clearSearchResults()}showSearchResults(t){this._userInteractions!==null&&this._userInteractions.showSearchResults(t.featureIds)}selectFeatures(t){if(this._userInteractions!==null){const r=this.modelFeatureIdList(t);this._userInteractions.selectFeatures(r)}}zoomToFeatures(t,r=null){if(r=mi(r,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null){const n=this.modelFeatureIdList(t);this._userInteractions.zoomToFeatures(n,r)}}}class Lx{constructor(t,r={}){this._mapServer=new gP(t),this._options=r,this._mapList=[],this._mapNumber=0,this._initialisingMutex=new pI,this._initialised=!1}async ensureInitialised_(){return await this._initialisingMutex.dispatch(async()=>{if(!this._initialised){this._mapList=[];const t=await this._mapServer.loadJSON("");for(const r of t)r.separateLayers="version"in r&&r.version>=AW,this._mapList.push(r);this._initialised=!0}})}allMaps(){return new Promise(async(t,r)=>{await this.ensureInitialised_();const n={};for(const i of this._mapList){const a="uuid"in i?i.uuid:i.id;n[a]=i}t(n)})}findMap_(t){return new Promise(async(r,n)=>{await this.ensureInitialised_(),r(this.lookupMap_(t))})}latestMap_(t){const r=t.constructor.name==="String"?t:"uuid"in t?t.uuid:"taxon"in t?t.taxon:null;if(r===null)return null;let n=null,i="";for(const a of this._mapList)if(("uuid"in a&&r===a.uuid||r===a.id||"taxon"in a&&r===a.taxon||r===a.source)&&(!("biologicalSex"in t)||"biologicalSex"in a&&t.biologicalSex===a.biologicalSex))if("created"in a)i<a.created&&(i=a.created,n=a);else{n=a;break}return n}lookupMap_(t){return typeof t=="object"?this.latestMap_(t):this.latestMap_({uuid:t})}loadMap(t,r,n,i={}){return new Promise(async(a,u)=>{try{const o=await this.findMap_(t);o===null&&u(`Unknown map: ${JSON.stringify(t)}`);const f="uuid"in o?o.uuid:o.id,h=await this._mapServer.loadJSON(`flatmap/${f}/`),p="uuid"in h?h.uuid:h.id;if(f!==p)throw new Error(`Map '${f}' has wrong ID in index`);const m=Object.assign({},this._options,i);!("bounds"in i)&&"bounds"in h&&(m.bounds=h.bounds),"style"in h?m.style=h.style:m.style="flatmap",!("image-layers"in h)&&"image_layer"in h&&(h["image-layers"]=h.image_layer);let g=[];if(!("version"in h)||h.version<=1)for(const I of h.layers)typeof I=="string"?g.push({id:I,description:I.charAt(0).toUpperCase()+I.slice(1),selectable:!0}):g.push(I);else g=await this._mapServer.loadJSON(`flatmap/${f}/layers`);const v=await this._mapServer.loadJSON(`flatmap/${f}/style`);"glyphs"in v||(v.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf");const b=await this._mapServer.loadJSON(`flatmap/${f}/pathways`),w=await this._mapServer.loadJSON(`flatmap/${f}/annotations`),E=await this._mapServer.loadJSON(`flatmap/${f}/metadata`),H=await this._mapServer.loadJSON(`flatmap/${f}/markers`);return"vector-tiles"in v.sources&&("minZoom"in m||(m.minZoom=v.sources["vector-tiles"].minzoom),"maxZoom"in m||(m.maxZoom=v.sources["vector-tiles"].maxzoom)),"layerOptions"in m?("colour"in m.layerOptions||(m.layerOptions.colour=!0),"outline"in m.layerOptions||(m.layerOptions.outline=!0)):m.layerOptions={colour:!0,outline:!0},m.layerOptions.authoring="authoring"in h?h.authoring:!1,m.separateLayers=o.separateLayers,this._mapNumber+=1,new SW(r,this._mapServer.url(),{id:o,uuid:f,details:h,taxon:o.taxon,biologicalSex:o.biologicalSex,style:v,options:m,layers:g,markers:H,annotations:w,number:this._mapNumber,pathways:b,provenance:E,provenance:E,callback:n},a)}catch(o){u(o)}})}}const bx=(e,t)=>{const r=[];let n=e.organs?e.organs:e.ftus;const i=n?n.filter((a,u)=>n.findIndex(o=>o.label===a.label)===u):void 0;return i&&i.forEach(a=>{const u={label:a.label,models:a.models,key:`${t}.${a.label}`},o=bx(a,u.key);o.length>0&&(u.children=o),r.push(u)}),r},EW=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},VW={name:"FlatmapVuer",components:{Button:W4,Col:Lr,Loading:YO,Radio:Rp,RadioGroup:jp,Row:X4,Select:di,MapSvgIcon:od.MapSvgIcon,MapSvgSpriteColor:od.MapSvgSpriteColor,Tooltip:Qu,TreeControls:ym,SelectionsGroup:mm,SvgLegends:gm,ElIconWarningFilled:hf,ElIconArrowDown:sn,ElIconArrowLeft:Qf},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},methods:{viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=bx(r,n.key);i.length>0&&(n.children=i),t.children.push(n)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(r=>{_m(e,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset())},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},centreLinesSelected:function(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:function(e){if(this.mapImp){let r=[...this.mapImp.pathModelNodes(e)].map(i=>this.mapImp.featureProperties(i)),n=[];r.forEach(i=>{this.mapImp.nodePathModels(i.featureId).forEach(a=>{n.push(a)})}),this.mapImp.zoomToFeatures(n,{noZoomIn:!0})}},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},eventCallback:function(){return(e,t,...r)=>{if(e!=="pan-zoom"){const n=t.label,i=[t.models],a=this.entry,u=this.biologicalSex,o={dataset:t.dataset,biologicalSex:u,taxonomy:a,resource:i,label:n,feature:t,userData:r,eventType:e,provenanceTaxonomy:t.taxons?JSON.parse(t.taxons):void 0};e==="click"?this.viewingMode==="Network Discovery"?this.highlightConnectedPaths([t.models]):this.currentActive=t.models?t.models:"":e==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=t.models?t.models:""),t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Network Discovery"&&this.checkAndCreatePopups(o),this.$emit("resource-selected",o)}else this.$emit("pan-zoom-callback",t)}},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature&&e.feature.featureId&&e.feature.models?(this.annotationEntry={...e.feature,resourceId:this.serverUUID},this.displayTooltip(e.feature.models)):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){let e=document.querySelector(".flatmap-tooltip-popup");e&&(e.style.display="none"),document.querySelector(".maplibregl-popup-close-button").style.display="block",this.$refs.tooltip.$el.style.display="flex",document.querySelector(".maplibregl-popup-close-button").onclick=()=>{document.querySelector(".flatmap-tooltip-popup").style.display="block"}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,n))},showMarkerPopup:function(e,t,r){this.mapImp&&this.mapImp.showMarkerPopup(e,t,r)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},500))},displayTooltip:function(e){this.tooltipDisplay=!0,this.disableUI||this.displayPopup(e)},displayPopup:function(e){this.mapImp.showPopup(this.mapImp.modelFeatureIds(e)[0],this.$refs.tooltip.$el,{className:"flatmapvuer-popover",positionAtLastClick:!0}),this.popUpCssHacks()},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let r of t.values())r.label&&e.push(r.label);return Array.from(new Set(e))}},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),e?e.uuid?r={uuid:e.uuid}:e.entry&&(r.taxon=e.entry,e.biologicalSex?r.biologicalSex=e.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{featureInfo:this.featureInfo,"min-zoom":this.minZoom,layerControl:!0,pathControls:!0,searchable:this.searchable,tooltips:this.tooltips,minimap:t}).then(i=>{this.mapImp=i,this.serverUUID=this.mapImp.getIdentifier().uuid,this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),r=parseInt(t.paddingTop)+parseInt(t.paddingBottom),n=e.clientHeight-r;this.pathwaysMaxHeight=n-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(){this.sensor=new pP(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(e);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),t&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:String,uuid:String,biologicalSex:{type:String,default:""},featureInfo:{type:Boolean,default:!1},minZoom:{type:Number,default:4},pathControls:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverUUID:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],yellowstar:dP,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:TP,tooltipEntry:EW(),connectivityTooltipVisible:!1,drawerOpen:!1,annotationRadio:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",currentHover:"",viewingMode:"Exploration",viewingModes:["Annotation","Exploration","Network Discovery"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e){this.setHelpMode(e)},state:{handler:function(e){this.mapManager?this.setState(e):this.setStateRequired=!0},immediate:!0,deep:!0},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=T.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=T.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new Lx(this.flatmapAPI),this.flatmapQueries=new hP,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},D4=e=>(T.pushScopeId("data-v-2520abe9"),e=e(),T.popScopeId(),e),DW={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},OW={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},kW={style:{height:"100%",width:"100%"},ref:"display"},PW={class:"beta-popovers"},IW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),BW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),NW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),FW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),RW=D4(()=>T.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),jW={key:1,class:"warning-text"},zW=D4(()=>T.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),$W=D4(()=>T.createElementVNode("b",null,"Network discovery mode",-1)),ZW=D4(()=>T.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),qW=D4(()=>T.createElementVNode("b",null,"Now can display up to 6 panes",-1)),GW=D4(()=>T.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),UW={class:"bottom-right-control"},WW=D4(()=>T.createElementVNode("div",null,[T.createTextVNode(" Fit to "),T.createElementVNode("br"),T.createTextVNode(" window ")],-1)),XW=["innerHTML"],KW=["innerHTML"],JW=["onClick"];function YW(e,t,r,n,i,a){const u=T.resolveComponent("map-svg-sprite-color"),o=hf,f=U2,h=_s,p=sn,m=T.resolveComponent("map-svg-icon"),g=gm,v=ym,b=mm,w=Qf,E=W4,H=X4,V=Lr,I=gs,N=di,R=Rp,z=jp,Z=Qu,K=am,ee=ws;return T.withDirectives((T.openBlock(),T.createElementBlock("div",DW,[T.createVNode(u),T.createElementVNode("div",OW,[T.createElementVNode("div",kW,null,512),T.withDirectives(T.createElementVNode("div",PW,[T.createElementVNode("div",null,[T.createVNode(h,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:T.withCtx(()=>[r.displayWarning?(T.openBlock(),T.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=ie=>a.showToolitip(6)),onMouseout:t[8]||(t[8]=ie=>a.hideToolitip(6))},[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(o)]),_:1}),r.isLegacy?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[RW,T.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...ie)=>a.viewLatestMap&&a.viewLatestMap(...ie))}," Click here for the latest map ")],64)):(T.openBlock(),T.createElementBlock("span",jW,"Beta"))],32)):T.createCommentVNode("",!0)]),default:T.withCtx(()=>[r.isLegacy?(T.openBlock(),T.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=ie=>a.showToolitip(6)),onMouseout:t[1]||(t[1]=ie=>a.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(T.openBlock(),T.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=ie=>a.showToolitip(6)),onMouseout:t[3]||(t[3]=ie=>a.hideToolitip(6))},[T.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),IW,T.createTextVNode(" models available in "),BW,T.createTextVNode(". ")],32)):(T.openBlock(),T.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=ie=>a.showToolitip(6)),onMouseout:t[5]||(t[5]=ie=>a.hideToolitip(6))},[T.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),NW,T.createTextVNode(" models available in "),FW,T.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(T.openBlock(),T.createBlock(h,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value},{reference:T.withCtx(()=>[r.displayLatestChanges?(T.openBlock(),T.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=ie=>a.showToolitip(7)),onMouseout:t[10]||(t[10]=ie=>a.hideToolitip(7))},[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(o)]),_:1}),zW],32)):T.createCommentVNode("",!0)]),default:T.withCtx(()=>[$W,ZW,qW,GW]),_:1},8,["visible"])):T.createCommentVNode("",!0)],512),[[T.vShow,!r.disableUI]]),T.withDirectives(T.createVNode(f,{class:T.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:a.closeMinimap},{default:T.withCtx(()=>[T.createVNode(p)]),_:1},8,["class","onClick"]),[[T.vShow,e.minimapResizeShow]]),T.withDirectives(T.createElementVNode("div",UW,[T.createVNode(h,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value},{reference:T.withCtx(()=>[T.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=ie=>a.zoomIn()),onMouseover:t[12]||(t[12]=ie=>a.showToolitip(0)),onMouseout:t[13]||(t[13]=ie=>a.hideToolitip(0))})]),_:1},8,["visible"]),T.createVNode(h,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper popper-zoomout",visible:e.hoverVisibilities[1].value},{reference:T.withCtx(()=>[T.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=ie=>a.zoomOut()),onMouseover:t[15]||(t[15]=ie=>a.showToolitip(1)),onMouseout:t[16]||(t[16]=ie=>a.hideToolitip(1))})]),_:1},8,["visible"]),T.createVNode(h,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value},{reference:T.withCtx(()=>[T.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=ie=>a.resetView()),onMouseover:t[18]||(t[18]=ie=>a.showToolitip(2)),onMouseout:t[19]||(t[19]=ie=>a.hideToolitip(2))})]),default:T.withCtx(()=>[WW]),_:1},8,["visible"])],512),[[T.vShow,!r.disableUI]]),T.createVNode(h,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{class:T.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[r.pathControls?T.withDirectives((T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:T.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?T.createCommentVNode("",!0):(T.openBlock(),T.createBlock(g,{key:0,class:"svg-legends-container"})),T.createVNode(h,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar},null,8,XW),[[T.vShow,r.showStarInLegend],[K,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),T.createVNode(h,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[5].value,ref:"markerPopover"},{reference:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,KW),[[T.vShow,e.hoverVisibilities[5].value],[K,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(T.openBlock(),T.createBlock(v,{key:1,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:a.systemSelected,onCheckAll:a.checkAllSystems,onChangeActive:a.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):T.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(T.openBlock(),T.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:a.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):T.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(T.openBlock(),T.createBlock(b,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:e.taxonConnectivity,onChanged:a.taxonsSelected,onCheckAll:a.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckAll"])):T.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(T.openBlock(),T.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:a.pathwaysSelected,onCheckAll:a.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):T.createCommentVNode("",!0)],6)),[[K,void 0,"checkBoxPopover"]]):T.createCommentVNode("",!0),T.createElementVNode("div",{onClick:t[20]||(t[20]=(...ie)=>a.toggleDrawer&&a.toggleDrawer(...ie)),class:T.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(w)]),_:1})],2)],2),[[T.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(T.openBlock(),T.createBlock(h,{key:0,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.openMapOptions,ie=>(T.openBlock(),T.createBlock(H,{key:ie.key},{default:T.withCtx(()=>[T.createVNode(E,{type:"primary",plain:"",onClick:de=>e.$emit("open-map",ie.key)},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(ie.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):T.createCommentVNode("",!0),T.createVNode(h,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"200",teleported:!1,trigger:"click","popper-class":"background-popper","virtual-triggering":""},{default:T.withCtx(()=>[T.createElementVNode("div",null,[T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Viewing Mode")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[T.createVNode(N,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[21]||(t[21]=ie=>e.viewingMode=ie),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.viewingModes,ie=>(T.openBlock(),T.createBlock(I,{key:ie,label:ie,value:ie},{default:T.withCtx(()=>[T.createVNode(H,null,{default:T.withCtx(()=>[T.createVNode(V,{span:12},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(ie),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),T.createVNode(H,{class:"backgroundSpacer"}),T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Organs display")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[T.createVNode(z,{modelValue:e.colourRadio,"onUpdate:modelValue":t[22]||(t[22]=ie=>e.colourRadio=ie),class:"flatmap-radio",onChange:a.setColour},{default:T.withCtx(()=>[T.createVNode(R,{label:!0},{default:T.withCtx(()=>[T.createTextVNode("Colour")]),_:1}),T.createVNode(R,{label:!1},{default:T.withCtx(()=>[T.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),T.createVNode(H,{class:"backgroundSpacer"}),T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Outlines display")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[T.createVNode(z,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[23]||(t[23]=ie=>e.outlinesRadio=ie),class:"flatmap-radio",onChange:a.setOutlines},{default:T.withCtx(()=>[T.createVNode(R,{label:!0},{default:T.withCtx(()=>[T.createTextVNode("Show")]),_:1}),T.createVNode(R,{label:!1},{default:T.withCtx(()=>[T.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),T.createVNode(H,{class:"backgroundSpacer"}),T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Change background")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.availableBackground,ie=>(T.openBlock(),T.createElementBlock("div",{key:ie,class:T.normalizeClass(["backgroundChoice",ie,ie==e.currentBackground?"active":""]),onClick:de=>a.backgroundChangeCallback(ie)},null,10,JW))),128))]),_:1})])]),_:1},8,["virtual-ref"]),T.withDirectives(T.createElementVNode("div",{class:T.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[T.createVNode(H,null,{default:T.withCtx(()=>[T.createVNode(h,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:T.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(T.openBlock(),T.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[24]||(t[24]=ie=>a.showToolitip(8)),onMouseout:t[25]||(t[25]=ie=>a.hideToolitip(8))},null,512)):T.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),T.createVNode(H,null,{default:T.withCtx(()=>[T.createVNode(h,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:T.withCtx(()=>[T.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[26]||(t[26]=ie=>a.showToolitip(3)),onMouseout:t[27]||(t[27]=ie=>a.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[T.vShow,!r.disableUI]]),T.withDirectives(T.createVNode(Z,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation"},null,8,["annotationEntry","entry","annotationDisplay"]),[[T.vShow,e.tooltipDisplay]])])])),[[ee,e.loading]])}const JT=br(VW,[["render",YW],["__scopeId","data-v-2520abe9"]]),wx={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},eX={name:"MultiFlatmapVuer",components:{Col:Lr,Row:X4,Option:gs,Select:di,Popover:_s,FlatmapVuer:JT},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),Hs.on("onActionClick",e=>{this.FlatmapSelected(e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&t.map(a=>a.uuid).indexOf(i)>0)this.speciesList[n]=T.reactive(this.availableSpecies[n]);else for(let a=0;a<t.length;a++)if(this.availableSpecies[n].taxo===t[a].taxon)if(this.availableSpecies[n].biologicalSex){if(t[a].biologicalSex&&t[a].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=T.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=T.reactive(this.availableSpecies[n]);break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this._initialised=!0,e(),this._resolveList.forEach(n=>{n()})})):this._initialised?e():this._resolveList.push(e)})},FlatmapSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCoordinatesOfLastClick:function(){const e=this.$refs[this.activeSpecies];if(e&&e[0])return e[0].getCoordinatesOfLastClick()},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},showPopup:function(e,t,r){this.getCurrentFlatmap().showPopup(e,t,r)},showMarkerPopup:function(e,t,r){this.getCurrentFlatmap().showMarkerPopup(e,t,r)},setSpecies:function(e,t,r){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(e,t,n)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let r=0;r<t.length;r++){const n=this.speciesList[t[r]];if(!n.isLegacy&&n.taxo===e.entry&&n.biologicalSex===e.biologicalSex){this.setSpecies(t[r],e,0);return}}},createLegacyEntry:function(e,t,r){if(r&&t){let n="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?n=e.species:n=n+` ${e.species}`),this.speciesList[n]=T.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:t,uuid:r,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const r=e.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new Lx(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(a=>{if(a.uuid!==r.uuid)return this.createLegacyEntry(e,r.entry,r.uuid)}).then(a=>{t(a||e)}).catch(()=>{t(e)})})}else if(r.entry){const n=r.entry in wx?wx[r.entry]:void 0,i=this.createLegacyEntry(e,r.entry,n);t(i||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})})},resourceSelected:function(e){this.$emit("resource-selected",e)}},props:{showLayer:{type:Boolean,default:!1},featureInfo:{type:Boolean,default:!1},pathControls:{type:Boolean,default:!0},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},tX=e=>(T.pushScopeId("data-v-40c0dbdb"),e=e(),T.popScopeId(),e),rX={class:"multi-container",ref:"multiContainer"},nX={key:0,style:{position:"absolute","z-index":"10"}},iX=tX(()=>T.createElementVNode("div",{class:"species-display-text"},"Species",-1));function aX(e,t,r,n,i,a){const u=Lr,o=X4,f=gs,h=di,p=_s,m=JT;return T.openBlock(),T.createElementBlock("div",rX,[r.disableUI?T.createCommentVNode("",!0):(T.openBlock(),T.createElementBlock("div",nX,[iX,T.createVNode(p,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:r.helpMode,teleported:!1,ref:"selectPopover"},{reference:T.withCtx(()=>[T.createVNode(h,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=g=>e.activeSpecies=g),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:a.setSpecies},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.speciesList,(g,v)=>(T.openBlock(),T.createBlock(f,{key:v,label:v,value:v},{default:T.withCtx(()=>[T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(u,{span:8},{default:T.withCtx(()=>[T.createElementVNode("i",{class:T.normalizeClass(g.iconClass)},null,2)]),_:2},1024),T.createVNode(u,{span:12},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(v),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.speciesList,(g,v)=>T.withDirectives((T.openBlock(),T.createBlock(m,{key:v,showLayer:r.showLayer,entry:g.taxo,uuid:g.uuid,biologicalSex:g.biologicalSex,displayWarning:g.displayWarning,displayLatestChanges:g.displayLatestChanges,isLegacy:g.isLegacy,ref_for:!0,ref:v,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:a.viewLatestMap,onResourceSelected:a.FlatmapSelected,onReady:a.FlatmapReady,onPanZoomCallback:a.panZoomCallback,onOpenMap:t[1]||(t[1]=b=>e.$emit("open-map",b)),featureInfo:r.featureInfo,minZoom:r.minZoom,pathControls:r.pathControls,searchable:r.searchable,layerControl:r.layerControl,helpMode:r.helpMode,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["showLayer","entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","featureInfo","minZoom","pathControls","searchable","layerControl","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[T.vShow,e.activeSpecies==v]])),128))],512)}const oX=br(eX,[["render",aX],["__scopeId","data-v-40c0dbdb"]]);I2.FlatmapVuer=JT,I2.MultiFlatmapVuer=oX,I2.Tooltip=Qu,Object.defineProperty(I2,Symbol.toStringTag,{value:"Module"})});
658
+ `)}</div>`)}this.__activateFeature(v),this.__activateRelatedFeatures(v),"hyperlink"in v.properties&&(this._map.getCanvas().style.cursor="pointer")}}u!==""&&this._infoControl.show(u),this.__showToolTip(o,t.lngLat,h)}__showToolTip(t,r,n=null){if(t!==""||this._flatmap.options.showId&&n!==null){let i="";if(this._flatmap.options.showPosition){const a=Bm(r.toArray()),o=aI(a).geometry.coordinates;i=n===null?JSON.stringify(o):`${JSON.stringify(o)} (${n.id})`}this._flatmap.options.showId&&n!==null&&"id"in n.properties&&(i=`${i} ${n.properties.id}`),i!==""&&(t=`<span>${i}</span><br/>${t}`),t!==""&&(this._tooltip=new v3.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-tooltip-popup"}),this._tooltip.setLngLat(r).setHTML(t).addTo(this._map))}}selectionEvent_(t,r){if(r!==void 0){const n=r.id,i=!("properties"in r&&"kind"in r.properties&&["cell-type","scaffold","tissue"].includes(r.properties.kind));if(t.ctrlKey||t.metaKey){const a=this.featureSelected_(n);for(const u of this._activeFeatures)a?this.unselectFeature(u.id):this.selectFeature(u.id,i)}else{let a=!0;for(const u of this._selectedFeatureIds.keys())if(u===n){a=!1;break}if(this.unselectFeatures(),a)for(const u of this._activeFeatures)this.selectFeature(u.id,i)}}}clickEvent_(t){if(this._modal)return;this.__clearActiveMarker();const r=this._map.queryRenderedFeatures(t.point).filter(i=>this.__featureEnabled(i));if(r.length==0){this.unselectFeatures();return}const n=r[0];this.selectionEvent_(t.originalEvent,n),this._modal?(this.__resetFeatureDisplay(),this.unselectFeatures(),this.__clearModal()):n!==void 0&&(this.__lastClickLngLat=t.lngLat,this.__featureEvent("click",n),"properties"in n&&"hyperlink"in n.properties&&window.open(n.properties.hyperlink,"_blank"))}__activateRelatedFeatures(t){if("nerveId"in t.properties){const r=t.properties.nerveId;r!==t.id&&this.__activateFeature(this.mapFeature(r));for(const n of this.__pathManager.nerveFeatureIds(r))this.__activateFeature(this.mapFeature(n))}if("nodeId"in t.properties)for(const r of this.__pathManager.pathFeatureIds(t.properties.nodeId))this.__activateFeature(this.mapFeature(r))}enablePath(t,r=!0){this.__pathManager.enablePath(t,r)}enablePathsBySystem(t,r=!0,n=!1){this.__pathManager.enablePathsBySystem(t,r,n)}enablePathsByType(t,r=!0){this.__pathManager.enablePathsByType(t,r)}pathFeatureIds(t){const r=new Os;return r.extend(this.__pathManager.connectivityModelFeatureIds(t)),r.extend(this.__pathManager.pathModelFeatureIds(t)),r}pathModelNodes(t){return this.__pathManager.pathModelNodes(t)}nodePathModels(t){return this.__pathManager.nodePathModels(t)}enableCentrelines(t=!0,r=!1){this.__pathManager.enablePathsByType("centreline",t,r),this._layerManager.setPaint({showCentrelines:t})}enableSckanPaths(t,r=!0){this._layerManager.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){if(r)for(const n of t)this.__enabledConnectivityTaxons.add(n);else for(const n of t)this.__enabledConnectivityTaxons.delete(n);this._layerManager.setFilter({taxons:[...this.__enabledConnectivityTaxons.values()]})}excludeAnnotated(t=!1){this._layerManager.setPaint({excludeAnnotated:t})}__markerPosition(t,r){if(this.__markerPositions.has(t))return this.__markerPositions.get(t);let n=r.markerPosition||r.centroid;if(n===null||n==null){const i=this._map.querySourceFeatures(wu,{sourceLayer:this._flatmap.options.separateLayers?`${r.layer}_${r["tile-layer"]}`:r["tile-layer"],filter:["all",["==",["id"],parseInt(t)],["==",["geometry-type"],"Polygon"]]});i.length>0&&(n=LW(i[0]))}return this.__markerPositions.set(t,n),n}addMarker(t,r={}){const n=this._flatmap.modelFeatureIds(t);let i=-1;for(const a of n){const u=this._flatmap.annotation(a);if(!(!("markerPosition"in u)&&!u.geometry.includes("Polygon"))&&!("marker"in u)){i===-1&&(this.__lastMarkerId+=1,i=this.__lastMarkerId);const o=r.colour||"#005974",f=r.element?new v3.Marker({element:r.element}):new v3.Marker({color:o,scale:.5}),h=document.createElement("div"),p=document.createElement("div");p.innerHTML=f.getElement().innerHTML,h.id=`marker-${i}`,h.appendChild(p);const m={element:h};"className"in r&&(m.className=r.className);const g=this.__markerPosition(a,u),v=new v3.Marker(m).setLngLat(g).addTo(this._map);h.addEventListener("mouseenter",this.markerMouseEvent_.bind(this,v,t)),h.addEventListener("mousemove",this.markerMouseEvent_.bind(this,v,t)),h.addEventListener("mouseleave",this.markerMouseEvent_.bind(this,v,t)),h.addEventListener("click",this.markerMouseEvent_.bind(this,v,t)),this.__markerIdByMarker.set(v,i),this.__markerIdByFeatureId.set(+a,i),this.__annotationByMarkerId.set(i,u),this.__featureEnabled(this.mapFeature(+a))||(h.style.visibility="hidden")}}return i===-1&&console.warn(`Unable to find feature '${t}' on which to place marker`),i}clearMarkers(){for(const t of this.__markerIdByMarker.keys())t.remove();this.__markerIdByMarker.clear(),this.__annotationByMarkerId.clear()}removeMarker(t){for(const[r,n]of this.__markerIdByMarker.entries())if(t===n){r.remove(),this.__markerIdByMarker.remove(r),this.__annotationByMarkerId.remove(n);break}}visibleMarkerAnatomicalIds(){const t=[],r=this._map.getBounds();for(const[n,i]of this.__markerIdByMarker.entries())if(r.contains(n.getLngLat())){const a=this.__annotationByMarkerId.get(i);t.includes(a.models)||t.push(a.models)}return t}markerMouseEvent_(t,r,n){if(!(this._modal||this.__activeMarker!==null&&n.type==="mouseleave")){if(["mouseenter","mouseleave","click"].includes(n.type)&&(this.__activeMarker=t,this.removeTooltip_(),t.setPopup(null),t.getElement().style.cursor="default",["mouseenter","click"].includes(n.type))){const i=this.__markerIdByMarker.get(t),a=this.__annotationByMarkerId.get(i),u=this.mapFeature(a.featureId);u!==void 0&&(n.type==="mouseenter"?(this.resetActiveFeatures_(),this.__activateFeature(u)):this.selectionEvent_(n,u));const o=this.tooltipHtml_(a,!0);this.__showToolTip(o,t.getLngLat()),this._flatmap.markerEvent(n.type,i,r)}n.stopPropagation()}}__clearActiveMarker(){this.__activeMarker!==null&&(this.__activeMarker.setPopup(null),this.__activeMarker=null)}showMarkerPopup(t,r,n){const i=this.__activeMarker;if(t!==this.__markerIdByMarker.get(i))return this.__clearActiveMarker(),!1;const a=i.getLngLat();this._map.getBounds().contains(a)||this._map.panTo(a);const u=document.createElement("div");return typeof r=="object"?u.appendChild(r):u.innerHTML=r,u.addEventListener("click",o=>this.__clearActiveMarker()),this._tooltip=new v3.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-marker-popup"}),this._tooltip.setLngLat(a).setDOMContent(u),i.setPopup(this._tooltip),i.togglePopup(),!0}enablePanZoomEvents(t=!0){this.__pan_zoom_enabled=t}panZoomEvent_(t){this.__pan_zoom_enabled&&this._flatmap.panZoomEvent(t)}}const vx={fillColor:"#DDD",fillOpacity:.3,lineColor:"#08F",lineOpacity:1,lineWidth:1,position:"bottom-left",width:320},HW=[[18,14,16],[16,12,14],[14,10,12],[12,8,10],[10,6,8]];class MW{constructor(t,r){this._flatmap=t,this._map=void 0,this._container=null,this._background=null,this._opacity=null,this._loaded=!1,this._options=Object.assign({},vx),typeof r=="object"&&("position"in r&&(this._options.position=r.position),"width"in r&&(this._options.width=r.width)),this._ticking=!1,this._lastMouseMoveEvent=null,this._isDragging=!1,this._isCursorOverFeature=!1,this._previousPoint=[0,0],this._currentPoint=[0,0],this._trackingRectCoordinates=[[[],[],[],[],[]]]}getDefaultPosition(){return this._options.position}onAdd(t){this._map=t;const r=document.createElement("div");r.className="maplibregl-ctrl-minimap maplibregl-ctrl",r.id="maplibre-minimap",this._container=r;const n=t.getCanvas();let i=vx.width;return typeof this._options.width=="string"?(i=parseInt(this._options.width),this._options.width.includes("%")&&(i=i*n.width/100)):typeof this._options.width=="number"&&(i=this._options.width),r.setAttribute("style",`width: ${i}px; height: ${i*n.height/n.width}px;`),r.addEventListener("contextmenu",this._preventDefault),this._miniMap=new v3.Map({attributionControl:!1,container:r,style:t.getStyle(),bounds:t.getBounds()}),this._miniMap.on("load",this.load_.bind(this)),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0,this._container=null}load_(){const t=this._options,r=this._map,n=this._miniMap;["dragPan","scrollZoom","boxZoom","dragRotate","keyboard","doubleClickZoom","touchZoomRotate"].forEach(u=>n[u].disable()),this._background!==null&&n.setPaintProperty("background","background-color",this._background),this._opacity!==null&&n.setPaintProperty("background","background-opacity",this._opacity),n.resize(),n.fitBounds(this._flatmap.bounds);const a=n.getBounds();this.convertBoundsToPoints_(a),n.addSource("trackingRect",{type:"geojson",data:{type:"Feature",properties:{name:"trackingRect"},geometry:{type:"Polygon",coordinates:this._trackingRectCoordinates}}}),n.addLayer({id:"trackingRectOutline",type:"line",source:"trackingRect",layout:{},paint:{"line-color":t.lineColor,"line-width":t.lineWidth,"line-opacity":t.lineOpacity}}),n.addLayer({id:"trackingRectFill",type:"fill",source:"trackingRect",layout:{},paint:{"fill-color":t.fillColor,"fill-opacity":t.fillOpacity}}),this._trackingRect=this._miniMap.getSource("trackingRect"),this.update_(),r.on("move",this.update_.bind(this)),n.on("mousemove",this.mouseMove_.bind(this)),n.on("mousedown",this.mouseDown_.bind(this)),n.on("mouseup",this.mouseUp_.bind(this)),n.on("touchmove",this.mouseMove_.bind(this)),n.on("touchstart",this.mouseDown_.bind(this)),n.on("touchend",this.mouseUp_.bind(this)),this._miniMapCanvas=n.getCanvasContainer(),this._miniMapCanvas.addEventListener("wheel",this.preventDefault_),this._miniMapCanvas.addEventListener("mousewheel",this.preventDefault_)}mouseDown_(t){this._isCursorOverFeature&&(this._isDragging=!0,this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat])}mouseMove_(t){this._ticking=!1;const n=this._miniMap.queryRenderedFeatures(t.point,{layers:["trackingRectFill"]});if(this._isCursorOverFeature&&n.length>0||(this._isCursorOverFeature=n.length>0,this._miniMapCanvas.style.cursor=this._isCursorOverFeature?"move":""),this._isDragging){this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat];const i=[this._previousPoint[0]-this._currentPoint[0],this._previousPoint[1]-this._currentPoint[1]],a=this.moveTrackingRect_(i);this._map.fitBounds(a,{duration:80,noMoveStart:!0})}}mouseUp_(){this._isDragging=!1,this._ticking=!1}moveTrackingRect_(t){const r=this._trackingRect,n=r._data,i=n.properties.bounds;return i._ne.lat-=t[1],i._ne.lng-=t[0],i._sw.lat-=t[1],i._sw.lng-=t[0],this.convertBoundsToPoints_(i),r.setData(n),i}setTrackingRectBounds_(t){const r=this._trackingRect,n=r._data;n.properties.bounds=t,this.convertBoundsToPoints_(t),r.setData(n)}convertBoundsToPoints_(t){const r=t._ne,n=t._sw,i=this._trackingRectCoordinates;i[0][0][0]=r.lng,i[0][0][1]=r.lat,i[0][1][0]=n.lng,i[0][1][1]=r.lat,i[0][2][0]=n.lng,i[0][2][1]=n.lat,i[0][3][0]=r.lng,i[0][3][1]=n.lat,i[0][4][0]=r.lng,i[0][4][1]=r.lat}update_(t){if(this._isDragging)return;const r=this._map.getBounds();this.setTrackingRectBounds_(r),this.zoomAdjust_()}zoomAdjust_(){const t=this._miniMap,r=this._map,n=parseInt(t.getZoom(),10),i=parseInt(r.getZoom(),10);let a=!1;HW.forEach(function(u){!a&&i>=u[0]&&(n>=u[1]&&t.setZoom(u[2]),t.setCenter(r.getCenter()),a=!0)})}preventDefault_(t){t.preventDefault()}setBackgroundColour(t){this._loaded?this._miniMap.setPaintProperty("background","background-color",t):this._background=t}setBackgroundOpacity(t){this._loaded?this._miniMap.setPaintProperty("background","background-opacity",t):this._opacity=t}show(t){this._container&&(t?(this._container.style.display="block",this.update_()):this._container.style.display="none")}}const CW=[{id:"label-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAmCAIAAADbSlUzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAACVSURBVFhH7dixDoJAEIThfXqMBcYKrTQ+jkYSStDYkVhZINxyEshJcZXJtC7FfNlmur9eyXb7Vqf6+bI9HUKyWkt5e4RlOF9ycerjsqbqpfefuKzNJawBWIOxBmMNxhqMNRhrMNZgrMFYg7EGYw3GGow1GGuw5dU07y4ua22nUlb3uKxd80IOx1Pjxp+f4P/P+ZButl+YrbXnPs+YmAAAAABJRU5ErkJggg==",options:{content:[21,4,28,33],stretchX:[[21,28]],stretchY:[[4,33]]}},{id:"xlabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJExO2pF7NAAAAqUlEQVQ4y+3OIQ6CYBiH8ef9MDhxc8yABjeP4LwAx3BWTwE3oHkMrBa7JJN3YBogfQkjr0HcDCg0C0/+7f2/AjghycLFj0ECYMarHPRcUoQx25uEJMsR/lUQj4YUtQ+K9aC+1IgABPFc/NjUcy1JYD5++tXM0LEe9rCHPfwXzDu43ChV2qaUKjWWLFLUfkdqLVnkXDiWK4LDkMlckCkwfs8p1cmSbfbs7k+jIi/gASaPYQAAAABJRU5ErkJggg==",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"ylabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJEyeXEKp4AAAAwklEQVQ4y+3ULU/DUBhA4XO/2rUgwV1ZBWLJBP9fI0gQuMktWcJSwUq79n68qAoSGnCYHv3oowBD09jz88t1CpGcBQCtFYWz3D3tNuz3EXgojqdWLt0gKWWZSynLpRvkeGqFpinVuf2QsnDc3mz4qe7zyjgF9BQidVWyVF2VTCGicxa0VotQa0XOguaPrXCFK1zhv8D5VkvNt9POGvphXIT9MOKsAbyvfl2z95UCCrw3769vfYjp2+ydNdxvH2sOh/QFh8F7PWWiL5EAAAAASUVORK5CYII=",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"rounded-rectangle",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGmSURBVDiNldPBitpAGAfwv5mMmy85JCistD5Ai/gCPYovYJENCPZQF8VD36HXUkrfQws9R8WLF58gh2h2W2PpoeTWxBgzMr1spd3uUvOHOQ2//3yHb4C/UyGi95Zl3XLOUwASgFRVNTVN8ysRfQTwFA+FMdYhoqjf7+9ns5kMgkCGYSjDMJTb7VbO53M5HA4PRBRzzl//g8vlcrxYLE7osbNcLmWlUok459cAULgb+2YymRi1Wu3B6e7H9300Go1dkiTPGRG97Xa7LzqdjnqWBlAqlRBFEVzXNZRisXhl2/bFufh3bNvmAF4WOOd73/cvDMPIVSCEQLVaFUqWZbkxAKiqCsaYVHLLe1E452kcx7mhEALH47Gg6Lr+3fO83AXr9Rq6rofK4XD4NB6P07wFo9Eok1J+LgC41DTt1nEco16vn4VXqxWazeYuSZJnCoAfWZZdt9vtneu6/8We56HVasVCiDcAvp0uGGM2Ef3s9Xp7x3HkZrM57X8QBHI6ncrBYJASUcQYe/XYA5eapr2zLOuGc77H3XfmnKemaX4hog8AnvwJfgHMKs1jQ++4tQAAAABJRU5ErkJggg==",options:{content:[3,3,13,13],stretchX:[[7,9]],stretchY:[[7,9]]}}],AW=1.4,xx="NCBITaxon:2787823";class SW{constructor(t,r,n,i){this._baseUrl=r,this.__id=n.id,this.__uuid=n.uuid,this.__details=n.details,this.__provenance=n.provenance,this.__created=n.created,this.__taxon=n.taxon,this.__biologicalSex=n.biologicalSex,this._mapNumber=n.number,this._callback=n.callback,this._layers=n.layers,this._markers=n.markers,this._options=n.options,this._pathways=n.pathways,this._resolve=i,this._map=null,this.__searchIndex=new ZP(this),this.__idToAnnotation=new Map,this.__datasetToFeatureIds=new Map,this.__modelToFeatureIds=new Map,this.__mapSourceToFeatureIds=new Map,this.__annIdToFeatureId=new Map,this.__taxonToFeatureIds=new Map;for(const[u,o]of Object.entries(n.annotations))this.__addAnnotation(u,o),this.__searchIndex.indexMetadata(u,o);for(const[u,o]of Object.entries(n.style.sources))if(o.url&&(o.url=this.makeServerUrl(o.url)),o.tiles){const f=[];for(const h of o.tiles)f.push(this.makeServerUrl(h));o.tiles=f}"images"in n.options||(n.options.images=[]);for(const u of CW){let o=!1;for(const f of n.options.images)if(u.id===f.id){o=!0;break}o||n.options.images.push(u)}const a={style:n.style,container:t,attributionControl:!1};if("maxZoom"in n.options&&(a.maxZoom=n.options.maxZoom),"minZoom"in n.options&&(a.minZoom=n.options.minZoom),a.hash=n.options.debug===!0,this._map=new v3.Map(a),n.options.debug===!0&&(this._map.showTileBoundaries=!0),this._map.setRenderWorldCopies(!1),n.options.fullscreenControl===!0&&this._map.addControl(new v3.FullscreenControl,"top-right"),this._map.dragRotate.disable(),this._map.touchZoomRotate.disableRotation(),n.options.navigationControl){const u=n.options.navigationControl,o=typeof u=="string"&&["top-left","top-right","bottom-right","bottom-left"].includes(u)?u:"bottom-right";this._map.addControl(new UI(this),o)}this._userInteractions=null,this._initialState=null,this._minimap=null,this._map.on("idle",()=>{if(this._userInteractions===null)this.setupUserInteractions_();else if(this._initialState===null){this._map.setMinZoom(3),this._map.setMaxBounds(null),this._map.setRenderWorldCopies(!0),this._bounds=this._map.getBounds();const u=this._bounds.toArray(),o=v3.MercatorCoordinate.fromLngLat(u[0]),f=v3.MercatorCoordinate.fromLngLat(u[1]);this.__normalised_origin=[o.x,f.y],this.__normalised_size=[f.x-o.x,o.y-f.y],"state"in this._options&&this._userInteractions.setState(this._options.state),this._initialState=this.getState(),this.options.minimap&&(this._minimap=new MW(this,this.options.minimap),this._map.addControl(this._minimap)),this._resolve(this)}})}async setupUserInteractions_(){for(const t of this._options.images)await this.addImage(t.id,t.url,"",t.options);this._userInteractions=new wW(this)}get bounds(){return this._bounds}resetMap(){this._initialState!==null&&this.setState(this._initialState),this._userInteractions!==null&&this._userInteractions.reset()}zoomIn(){this._map.zoomIn()}zoomOut(){this._map.zoomOut()}pathTypes(){if(this._userInteractions!==null)return this._userInteractions.pathManager.pathTypes()}enablePath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enablePathsByType(t,r)}enableSckanPath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){this._userInteractions!==null&&(Array.isArray(t)?this._userInteractions.enableConnectivityByTaxonIds(t,r):this._userInteractions.enableConnectivityByTaxonIds([t],r))}enableCentrelines(t=!0){this._userInteractions!==null&&this._userInteractions.enableCentrelines(t)}loadImage_(t){return new Promise((r,n)=>{this._map.loadImage(t,(i,a)=>{i?n(i):r(a)})})}loadEncodedImage_(t){return new Promise((r,n)=>{const i=new Image;i.src=t,i.onload=a=>r(a.target)})}async addImage(t,r,n,i={}){if(!this._map.hasImage(t)){const a=await(r.startsWith("data:image")?this.loadEncodedImage_(r):this.loadImage_(r.startsWith("/")?this.makeServerUrl(r):new URL(r,n)));this._map.addImage(t,a,i)}}makeServerUrl(t,r="flatmap/"){return t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("/")?`${this._baseUrl}${r}${this.__uuid}${t}`:`${this._baseUrl}${r}${this.__uuid}/${t}`}get taxon(){return this.__taxon}get biologicalSex(){return this.__biologicalSex}get created(){return this.__created}get id(){return this.__id}get uuid(){return this.__uuid}get details(){return this.__details}get provenance(){return this.__provenance}get uniqueId(){return`${this.__uuid}-${this._mapNumber}`}get annotations(){return this.__idToAnnotation}annotation(t){return this.__idToAnnotation.get(t.toString())}setFeatureAnnotated(t){this._userInteractions!==null&&this._userInteractions.setFeatureAnnotated(t)}__updateFeatureIdMapEntry(t,r,n){const i=Lu(t),a=r.get(i);a?a.push(n):r.set(i,[n])}__updateFeatureIdMap(t,r,n,i=null){if(t in n&&n[t].length){const a=n[t];if(Array.isArray(a))for(const u of a)this.__updateFeatureIdMapEntry(u,r,n.featureId);else this.__updateFeatureIdMapEntry(a,r,n.featureId)}else i!==null&&"models"in n&&n.models.startsWith(mI)&&this.__updateFeatureIdMapEntry(i,r,n.featureId)}__addAnnotation(t,r){r.featureId=t,this.__idToAnnotation.set(t,r),this.__updateFeatureIdMap("dataset",this.__datasetToFeatureIds,r),this.__updateFeatureIdMap("models",this.__modelToFeatureIds,r),this.__updateFeatureIdMap("source",this.__mapSourceToFeatureIds,r),this.__updateFeatureIdMap("taxons",this.__taxonToFeatureIds,r,xx),this.__annIdToFeatureId.set(r.id,t)}modelFeatureIds(t){const r=this.__modelToFeatureIds.get(Lu(t));return r||[]}modelFeatureIdList(t){const r=new Os;if(Array.isArray(t))for(const n of t)r.extend(this.modelFeatureIds(n));else r.extend(this.modelFeatureIds(t));return r.length==0&&(r.extend(this.__datasetToFeatureIds.get(t)),r.extend(this.__mapSourceToFeatureIds.get(t))),r.length==0&&this._userInteractions!==null&&r.extend(this._userInteractions.pathFeatureIds(t)),r}modelForFeature(t){const r=this.__idToAnnotation.get(t);return r&&"models"in r?Lu(r.models):null}nodePathModels(t){if(this._userInteractions!==null)return this._userInteractions.nodePathModels(t)}pathModelNodes(t){if(this._userInteractions!==null)return this._userInteractions.pathModelNodes(t)}get layers(){return this._layers}get map(){return this._map}get markers(){return this._markers}get anatomicalIdentifiers(){return[...this.__modelToFeatureIds.keys()]}get taxonIdentifiers(){return[...this.__taxonToFeatureIds.keys()]}get datasets(){return[...this.__datasetToFeatureIds.keys()]}get options(){return this._options}get pathways(){return this._pathways}getZoom(){return{mapUUID:this.__uuid,minZoom:this._map.getMinZoom(),zoom:this._map.getZoom(),maxZoom:this._map.getMaxZoom()}}callback(t,r,...n){if(this._callback)return r.mapUUID=this.__uuid,this._callback(t,r,...n)}setInitialPosition(){"bounds"in this._options&&this._map.fitBounds(this._options.bounds,{animate:!1}),"center"in this._options&&this._map.setCenter(this._options.center),"zoom"in this._options&&this._map.setZoom(this._options.zoom)}close(){this._map&&(this._map.remove(),this._map=null)}resize(){this._map.resize()}getIdentifier(){return{taxon:this.__taxon,biologicalSex:this.__biologicalSex,uuid:this.__uuid}}getState(){return this._userInteractions!==null?this._userInteractions.getState():{}}setState(t){this._userInteractions!==null&&this._userInteractions.setState(t)}showPopup(t,r,n){this._userInteractions!==null&&this._userInteractions.showPopup(t,r,n)}setPaint(t=null){t=mi(t,{colour:!0,outline:!0}),this._userInteractions!==null&&this._userInteractions.setPaint(t)}setColour(t=null){console.log("`setColour()` is deprecated; please use `setPaint()` instead."),this.setPaint(t)}getBackgroundColour(){return this._map.getPaintProperty("background","background-color")}getBackgroundOpacity(){return this._map.getPaintProperty("background","background-opacity")}setBackgroundColour(t){localStorage.setItem("flatmap-background-colour",t),this._map.setPaintProperty("background","background-color",t),this._minimap&&this._minimap.setBackgroundColour(t)}setBackgroundOpacity(t){this._map.setPaintProperty("background","background-opacity",t),this._minimap&&this._minimap.setBackgroundOpacity(t)}showMinimap(t){this._minimap&&this._minimap.show(t)}getLayers(){if(this._userInteractions!==null)return this._userInteractions.getLayers()}enableLayer(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableLayer(t,r)}getSystems(){if(this._userInteractions!==null)return this._userInteractions.getSystems()}enableSystem(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableSystem(t,r)}addMarker(t,r={}){return this._userInteractions!==null?this._userInteractions.addMarker(t,r):-1}removeMarker(t){this._userInteractions!==null&&this._userInteractions.removeMarker(t)}clearMarkers(){this._userInteractions!==null&&this._userInteractions.clearMarkers()}visibleMarkerAnatomicalIds(){if(this._userInteractions!==null)return this._userInteractions.visibleMarkerAnatomicalIds()}showMarkerPopup(t,r,n={}){return this._userInteractions!==null?this._userInteractions.showMarkerPopup(t,r,n):!1}__exportedProperties(t){const r={},n=["id","featureId","connectivity","dataset","kind","label","models","source","taxons","hyperlinks"],i=["hyperlinks"];for(const a of n)a in t&&t[a]!==void 0&&(i.includes(a)?r[a]=JSON.parse(t[a]):a==="featureId"?r[a]=+t[a]:r[a]=t[a]);return Object.keys(r).length>0&&(r.type="feature"),r}featureEvent(t,r){const n=this.__exportedProperties(r);return Object.keys(n).length>0?(this.callback(t,n),!0):!1}featureProperties(t){const r=this.annotation(t);return r?this.__exportedProperties(r):{}}markerEvent(t,r,n){this.callback(t,{type:"marker",id:r,models:n})}controlEvent(t,r,n){this.callback(t,{type:"control",control:r,value:n})}enablePanZoomEvents(t=!0){this._userInteractions!==null&&this._userInteractions.enablePanZoomEvents(t)}panZoomEvent(t){const r=this._map.getBounds();if(this.__normalised_origin!==void 0){const n=v3.MercatorCoordinate.fromLngLat(r.toArray()[0]),i=v3.MercatorCoordinate.fromLngLat(r.toArray()[1]),a=[(n.x-this.__normalised_origin[0])/this.__normalised_size[0],(i.y-this.__normalised_origin[1])/this.__normalised_size[1]],u=[(i.x-n.x)/this.__normalised_size[0],(n.y-i.y)/this.__normalised_size[1]];this.callback("pan-zoom",{type:t,origin:a,size:u})}}panZoomTo(t,r){if(this.__normalised_origin!==void 0){const n=t[0]*this.__normalised_size[0]+this.__normalised_origin[0],i=t[1]*this.__normalised_size[1]+this.__normalised_origin[1],a=n+r[0]*this.__normalised_size[0],u=i+r[1]*this.__normalised_size[1],o=new v3.MercatorCoordinate(n,u,0).toLngLat(),f=new v3.MercatorCoordinate(a,i,0).toLngLat();this._map.fitBounds([o,f],{animate:!1})}}search(t,r=!1){return r?this.__searchIndex.auto_suggest(t):this.__searchIndex.search(t)}clearSearchResults(){this._userInteractions!==null&&this._userInteractions.clearSearchResults()}showSearchResults(t){this._userInteractions!==null&&this._userInteractions.showSearchResults(t.featureIds)}selectFeatures(t){if(this._userInteractions!==null){const r=this.modelFeatureIdList(t);this._userInteractions.selectFeatures(r)}}zoomToFeatures(t,r=null){if(r=mi(r,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null){const n=this.modelFeatureIdList(t);this._userInteractions.zoomToFeatures(n,r)}}}class Lx{constructor(t,r={}){this._mapServer=new gP(t),this._options=r,this._mapList=[],this._mapNumber=0,this._initialisingMutex=new pI,this._initialised=!1}async ensureInitialised_(){return await this._initialisingMutex.dispatch(async()=>{if(!this._initialised){this._mapList=[];const t=await this._mapServer.loadJSON("");for(const r of t)r.separateLayers="version"in r&&r.version>=AW,this._mapList.push(r);this._initialised=!0}})}allMaps(){return new Promise(async(t,r)=>{await this.ensureInitialised_();const n={};for(const i of this._mapList){const a="uuid"in i?i.uuid:i.id;n[a]=i}t(n)})}findMap_(t){return new Promise(async(r,n)=>{await this.ensureInitialised_(),r(this.lookupMap_(t))})}latestMap_(t){const r=t.constructor.name==="String"?t:"uuid"in t?t.uuid:"taxon"in t?t.taxon:null;if(r===null)return null;let n=null,i="";for(const a of this._mapList)if(("uuid"in a&&r===a.uuid||r===a.id||"taxon"in a&&r===a.taxon||r===a.source)&&(!("biologicalSex"in t)||"biologicalSex"in a&&t.biologicalSex===a.biologicalSex))if("created"in a)i<a.created&&(i=a.created,n=a);else{n=a;break}return n}lookupMap_(t){return typeof t=="object"?this.latestMap_(t):this.latestMap_({uuid:t})}loadMap(t,r,n,i={}){return new Promise(async(a,u)=>{try{const o=await this.findMap_(t);o===null&&u(`Unknown map: ${JSON.stringify(t)}`);const f="uuid"in o?o.uuid:o.id,h=await this._mapServer.loadJSON(`flatmap/${f}/`),p="uuid"in h?h.uuid:h.id;if(f!==p)throw new Error(`Map '${f}' has wrong ID in index`);const m=Object.assign({},this._options,i);!("bounds"in i)&&"bounds"in h&&(m.bounds=h.bounds),"style"in h?m.style=h.style:m.style="flatmap",!("image-layers"in h)&&"image_layer"in h&&(h["image-layers"]=h.image_layer);let g=[];if(!("version"in h)||h.version<=1)for(const I of h.layers)typeof I=="string"?g.push({id:I,description:I.charAt(0).toUpperCase()+I.slice(1),selectable:!0}):g.push(I);else g=await this._mapServer.loadJSON(`flatmap/${f}/layers`);const v=await this._mapServer.loadJSON(`flatmap/${f}/style`);"glyphs"in v||(v.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf");const b=await this._mapServer.loadJSON(`flatmap/${f}/pathways`),w=await this._mapServer.loadJSON(`flatmap/${f}/annotations`),E=await this._mapServer.loadJSON(`flatmap/${f}/metadata`),H=await this._mapServer.loadJSON(`flatmap/${f}/markers`);return"vector-tiles"in v.sources&&("minZoom"in m||(m.minZoom=v.sources["vector-tiles"].minzoom),"maxZoom"in m||(m.maxZoom=v.sources["vector-tiles"].maxzoom)),"layerOptions"in m?("colour"in m.layerOptions||(m.layerOptions.colour=!0),"outline"in m.layerOptions||(m.layerOptions.outline=!0)):m.layerOptions={colour:!0,outline:!0},m.layerOptions.authoring="authoring"in h?h.authoring:!1,m.separateLayers=o.separateLayers,this._mapNumber+=1,new SW(r,this._mapServer.url(),{id:o,uuid:f,details:h,taxon:o.taxon,biologicalSex:o.biologicalSex,style:v,options:m,layers:g,markers:H,annotations:w,number:this._mapNumber,pathways:b,provenance:E,provenance:E,callback:n},a)}catch(o){u(o)}})}}const bx=(e,t)=>{const r=[];let n=e.organs?e.organs:e.ftus;const i=n?n.filter((a,u)=>n.findIndex(o=>o.label===a.label)===u):void 0;return i&&i.forEach(a=>{const u={label:a.label,models:a.models,key:`${t}.${a.label}`},o=bx(a,u.key);o.length>0&&(u.children=o),r.push(u)}),r},EW=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},VW={name:"FlatmapVuer",components:{Button:W4,Col:Lr,Loading:YO,Radio:Rp,RadioGroup:jp,Row:X4,Select:di,MapSvgIcon:od.MapSvgIcon,MapSvgSpriteColor:od.MapSvgSpriteColor,Tooltip:Qu,TreeControls:ym,SelectionsGroup:mm,SvgLegends:gm,ElIconWarningFilled:hf,ElIconArrowDown:sn,ElIconArrowLeft:Qf},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},methods:{viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=bx(r,n.key);i.length>0&&(n.children=i),t.children.push(n)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(r=>{_m(e,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset())},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},centreLinesSelected:function(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:function(e){if(this.mapImp){let r=[...this.mapImp.pathModelNodes(e)].map(i=>this.mapImp.featureProperties(i)),n=[];r.forEach(i=>{this.mapImp.nodePathModels(i.featureId).forEach(a=>{n.push(a)})}),this.mapImp.zoomToFeatures(n,{noZoomIn:!0})}},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},eventCallback:function(){return(e,t,...r)=>{if(e!=="pan-zoom"){const n=t.label,i=[t.models],a=this.entry,u=this.biologicalSex,o={dataset:t.dataset,biologicalSex:u,taxonomy:a,resource:i,label:n,feature:t,userData:r,eventType:e,provenanceTaxonomy:t.taxons?JSON.parse(t.taxons):void 0};e==="click"?this.viewingMode==="Network Discovery"?this.highlightConnectedPaths([t.models]):this.currentActive=t.models?t.models:"":e==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=t.models?t.models:""),t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Network Discovery"&&this.checkAndCreatePopups(o),this.$emit("resource-selected",o)}else this.$emit("pan-zoom-callback",t)}},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature&&e.feature.featureId&&e.feature.models?(this.annotationEntry={...e.feature,resourceId:this.serverUUID},this.displayTooltip(e.feature.models)):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){let e=document.querySelector(".flatmap-tooltip-popup");e&&(e.style.display="none"),document.querySelector(".maplibregl-popup-close-button").style.display="block",this.$refs.tooltip.$el.style.display="flex",document.querySelector(".maplibregl-popup-close-button").onclick=()=>{document.querySelector(".flatmap-tooltip-popup").style.display="block"}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,n))},showMarkerPopup:function(e,t,r){this.mapImp&&this.mapImp.showMarkerPopup(e,t,r)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},500))},displayTooltip:function(e){this.tooltipDisplay=!0,this.disableUI||this.displayPopup(e)},displayPopup:function(e){this.mapImp.showPopup(this.mapImp.modelFeatureIds(e)[0],this.$refs.tooltip.$el,{className:"flatmapvuer-popover",positionAtLastClick:!0}),this.popUpCssHacks()},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let r of t.values())r.label&&e.push(r.label);return Array.from(new Set(e))}},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),e?e.uuid?r={uuid:e.uuid}:e.entry&&(r.taxon=e.entry,e.biologicalSex?r.biologicalSex=e.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{featureInfo:this.featureInfo,"min-zoom":this.minZoom,layerControl:!0,pathControls:!0,searchable:this.searchable,tooltips:this.tooltips,minimap:t}).then(i=>{this.mapImp=i,this.serverUUID=this.mapImp.getIdentifier().uuid,this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),r=parseInt(t.paddingTop)+parseInt(t.paddingBottom),n=e.clientHeight-r;this.pathwaysMaxHeight=n-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(){this.sensor=new pP(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(e);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),t&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:String,uuid:String,biologicalSex:{type:String,default:""},featureInfo:{type:Boolean,default:!1},minZoom:{type:Number,default:4},pathControls:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverUUID:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],yellowstar:dP,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:TP,tooltipEntry:EW(),connectivityTooltipVisible:!1,drawerOpen:!1,annotationRadio:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",currentHover:"",viewingMode:"Exploration",viewingModes:["Annotation","Exploration","Network Discovery"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e){this.setHelpMode(e)},state:{handler:function(e){this.mapManager?this.setState(e):this.setStateRequired=!0},immediate:!0,deep:!0},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=T.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=T.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new Lx(this.flatmapAPI),this.flatmapQueries=new hP,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},D4=e=>(T.pushScopeId("data-v-75254909"),e=e(),T.popScopeId(),e),DW={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},OW={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},kW={style:{height:"100%",width:"100%"},ref:"display"},PW={class:"beta-popovers"},IW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),BW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),NW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),FW=D4(()=>T.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),RW=D4(()=>T.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),jW={key:1,class:"warning-text"},zW=D4(()=>T.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),$W=D4(()=>T.createElementVNode("b",null,"Network discovery mode",-1)),ZW=D4(()=>T.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),qW=D4(()=>T.createElementVNode("b",null,"Now can display up to 6 panes",-1)),GW=D4(()=>T.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),UW={class:"bottom-right-control"},WW=D4(()=>T.createElementVNode("div",null,[T.createTextVNode(" Fit to "),T.createElementVNode("br"),T.createTextVNode(" window ")],-1)),XW=["innerHTML"],KW=["innerHTML"],JW=["onClick"];function YW(e,t,r,n,i,a){const u=T.resolveComponent("map-svg-sprite-color"),o=hf,f=U2,h=_s,p=sn,m=T.resolveComponent("map-svg-icon"),g=gm,v=ym,b=mm,w=Qf,E=W4,H=X4,V=Lr,I=gs,N=di,R=Rp,z=jp,Z=Qu,K=am,ee=ws;return T.withDirectives((T.openBlock(),T.createElementBlock("div",DW,[T.createVNode(u),T.createElementVNode("div",OW,[T.createElementVNode("div",kW,null,512),T.withDirectives(T.createElementVNode("div",PW,[T.createElementVNode("div",null,[T.createVNode(h,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:T.withCtx(()=>[r.displayWarning?(T.openBlock(),T.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=ie=>a.showToolitip(6)),onMouseout:t[8]||(t[8]=ie=>a.hideToolitip(6))},[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(o)]),_:1}),r.isLegacy?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[RW,T.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...ie)=>a.viewLatestMap&&a.viewLatestMap(...ie))}," Click here for the latest map ")],64)):(T.openBlock(),T.createElementBlock("span",jW,"Beta"))],32)):T.createCommentVNode("",!0)]),default:T.withCtx(()=>[r.isLegacy?(T.openBlock(),T.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=ie=>a.showToolitip(6)),onMouseout:t[1]||(t[1]=ie=>a.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(T.openBlock(),T.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=ie=>a.showToolitip(6)),onMouseout:t[3]||(t[3]=ie=>a.hideToolitip(6))},[T.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),IW,T.createTextVNode(" models available in "),BW,T.createTextVNode(". ")],32)):(T.openBlock(),T.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=ie=>a.showToolitip(6)),onMouseout:t[5]||(t[5]=ie=>a.hideToolitip(6))},[T.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),NW,T.createTextVNode(" models available in "),FW,T.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(T.openBlock(),T.createBlock(h,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value},{reference:T.withCtx(()=>[r.displayLatestChanges?(T.openBlock(),T.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=ie=>a.showToolitip(7)),onMouseout:t[10]||(t[10]=ie=>a.hideToolitip(7))},[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(o)]),_:1}),zW],32)):T.createCommentVNode("",!0)]),default:T.withCtx(()=>[$W,ZW,qW,GW]),_:1},8,["visible"])):T.createCommentVNode("",!0)],512),[[T.vShow,!r.disableUI]]),T.withDirectives(T.createVNode(f,{class:T.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:a.closeMinimap},{default:T.withCtx(()=>[T.createVNode(p)]),_:1},8,["class","onClick"]),[[T.vShow,e.minimapResizeShow]]),T.withDirectives(T.createElementVNode("div",UW,[T.createVNode(h,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value},{reference:T.withCtx(()=>[T.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=ie=>a.zoomIn()),onMouseover:t[12]||(t[12]=ie=>a.showToolitip(0)),onMouseout:t[13]||(t[13]=ie=>a.hideToolitip(0))})]),_:1},8,["visible"]),T.createVNode(h,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper popper-zoomout",visible:e.hoverVisibilities[1].value},{reference:T.withCtx(()=>[T.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=ie=>a.zoomOut()),onMouseover:t[15]||(t[15]=ie=>a.showToolitip(1)),onMouseout:t[16]||(t[16]=ie=>a.hideToolitip(1))})]),_:1},8,["visible"]),T.createVNode(h,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value},{reference:T.withCtx(()=>[T.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=ie=>a.resetView()),onMouseover:t[18]||(t[18]=ie=>a.showToolitip(2)),onMouseout:t[19]||(t[19]=ie=>a.hideToolitip(2))})]),default:T.withCtx(()=>[WW]),_:1},8,["visible"])],512),[[T.vShow,!r.disableUI]]),T.createVNode(h,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{class:T.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[r.pathControls?T.withDirectives((T.openBlock(),T.createElementBlock("div",{key:0,class:T.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:T.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?T.createCommentVNode("",!0):(T.openBlock(),T.createBlock(g,{key:0,class:"svg-legends-container"})),T.createVNode(h,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar},null,8,XW),[[T.vShow,r.showStarInLegend],[K,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),T.createVNode(h,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[5].value,ref:"markerPopover"},{reference:T.withCtx(()=>[T.withDirectives(T.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,KW),[[T.vShow,e.hoverVisibilities[5].value],[K,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(T.openBlock(),T.createBlock(v,{key:1,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:a.systemSelected,onCheckAll:a.checkAllSystems,onChangeActive:a.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):T.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(T.openBlock(),T.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:a.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):T.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(T.openBlock(),T.createBlock(b,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:e.taxonConnectivity,onChanged:a.taxonsSelected,onCheckAll:a.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckAll"])):T.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(T.openBlock(),T.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:a.pathwaysSelected,onCheckAll:a.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):T.createCommentVNode("",!0)],6)),[[K,void 0,"checkBoxPopover"]]):T.createCommentVNode("",!0),T.createElementVNode("div",{onClick:t[20]||(t[20]=(...ie)=>a.toggleDrawer&&a.toggleDrawer(...ie)),class:T.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[T.createVNode(f,null,{default:T.withCtx(()=>[T.createVNode(w)]),_:1})],2)],2),[[T.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(T.openBlock(),T.createBlock(h,{key:0,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(r.openMapOptions,ie=>(T.openBlock(),T.createBlock(H,{key:ie.key},{default:T.withCtx(()=>[T.createVNode(E,{type:"primary",plain:"",onClick:de=>e.$emit("open-map",ie.key)},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(ie.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):T.createCommentVNode("",!0),T.createVNode(h,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"200",teleported:!1,trigger:"click","popper-class":"background-popper","virtual-triggering":""},{default:T.withCtx(()=>[T.createElementVNode("div",null,[T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Viewing Mode")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[T.createVNode(N,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[21]||(t[21]=ie=>e.viewingMode=ie),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.viewingModes,ie=>(T.openBlock(),T.createBlock(I,{key:ie,label:ie,value:ie},{default:T.withCtx(()=>[T.createVNode(H,null,{default:T.withCtx(()=>[T.createVNode(V,{span:12},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(ie),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),T.createVNode(H,{class:"backgroundSpacer"}),T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Organs display")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[T.createVNode(z,{modelValue:e.colourRadio,"onUpdate:modelValue":t[22]||(t[22]=ie=>e.colourRadio=ie),class:"flatmap-radio",onChange:a.setColour},{default:T.withCtx(()=>[T.createVNode(R,{label:!0},{default:T.withCtx(()=>[T.createTextVNode("Colour")]),_:1}),T.createVNode(R,{label:!1},{default:T.withCtx(()=>[T.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),T.createVNode(H,{class:"backgroundSpacer"}),T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Outlines display")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[T.createVNode(z,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[23]||(t[23]=ie=>e.outlinesRadio=ie),class:"flatmap-radio",onChange:a.setOutlines},{default:T.withCtx(()=>[T.createVNode(R,{label:!0},{default:T.withCtx(()=>[T.createTextVNode("Show")]),_:1}),T.createVNode(R,{label:!1},{default:T.withCtx(()=>[T.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),T.createVNode(H,{class:"backgroundSpacer"}),T.createVNode(H,{class:"backgroundText"},{default:T.withCtx(()=>[T.createTextVNode("Change background")]),_:1}),T.createVNode(H,{class:"backgroundControl"},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.availableBackground,ie=>(T.openBlock(),T.createElementBlock("div",{key:ie,class:T.normalizeClass(["backgroundChoice",ie,ie==e.currentBackground?"active":""]),onClick:de=>a.backgroundChangeCallback(ie)},null,10,JW))),128))]),_:1})])]),_:1},8,["virtual-ref"]),T.withDirectives(T.createElementVNode("div",{class:T.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[T.createVNode(H,null,{default:T.withCtx(()=>[T.createVNode(h,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:T.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(T.openBlock(),T.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[24]||(t[24]=ie=>a.showToolitip(8)),onMouseout:t[25]||(t[25]=ie=>a.hideToolitip(8))},null,512)):T.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),T.createVNode(H,null,{default:T.withCtx(()=>[T.createVNode(h,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:T.withCtx(()=>[T.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[26]||(t[26]=ie=>a.showToolitip(3)),onMouseout:t[27]||(t[27]=ie=>a.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[T.vShow,!r.disableUI]]),T.withDirectives(T.createVNode(Z,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation"},null,8,["annotationEntry","entry","annotationDisplay"]),[[T.vShow,e.tooltipDisplay]])])])),[[ee,e.loading]])}const JT=br(VW,[["render",YW],["__scopeId","data-v-75254909"]]),wx={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},eX={name:"MultiFlatmapVuer",components:{Col:Lr,Row:X4,Option:gs,Select:di,Popover:_s,FlatmapVuer:JT},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),Hs.on("onActionClick",e=>{this.FlatmapSelected(e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&t.map(a=>a.uuid).indexOf(i)>0)this.speciesList[n]=T.reactive(this.availableSpecies[n]);else for(let a=0;a<t.length;a++)if(this.availableSpecies[n].taxo===t[a].taxon)if(this.availableSpecies[n].biologicalSex){if(t[a].biologicalSex&&t[a].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=T.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=T.reactive(this.availableSpecies[n]);break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this._initialised=!0,e(),this._resolveList.forEach(n=>{n()})})):this._initialised?e():this._resolveList.push(e)})},FlatmapSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCoordinatesOfLastClick:function(){const e=this.$refs[this.activeSpecies];if(e&&e[0])return e[0].getCoordinatesOfLastClick()},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},showPopup:function(e,t,r){this.getCurrentFlatmap().showPopup(e,t,r)},showMarkerPopup:function(e,t,r){this.getCurrentFlatmap().showMarkerPopup(e,t,r)},setSpecies:function(e,t,r){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(e,t,n)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let r=0;r<t.length;r++){const n=this.speciesList[t[r]];if(!n.isLegacy&&n.taxo===e.entry&&n.biologicalSex===e.biologicalSex){this.setSpecies(t[r],e,0);return}}},createLegacyEntry:function(e,t,r){if(r&&t){let n="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?n=e.species:n=n+` ${e.species}`),this.speciesList[n]=T.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:t,uuid:r,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const r=e.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new Lx(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(a=>{if(a.uuid!==r.uuid)return this.createLegacyEntry(e,r.entry,r.uuid)}).then(a=>{t(a||e)}).catch(()=>{t(e)})})}else if(r.entry){const n=r.entry in wx?wx[r.entry]:void 0,i=this.createLegacyEntry(e,r.entry,n);t(i||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})})},resourceSelected:function(e){this.$emit("resource-selected",e)}},props:{showLayer:{type:Boolean,default:!1},featureInfo:{type:Boolean,default:!1},pathControls:{type:Boolean,default:!0},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},tX=e=>(T.pushScopeId("data-v-4a803829"),e=e(),T.popScopeId(),e),rX={class:"multi-container",ref:"multiContainer"},nX={key:0,style:{position:"absolute","z-index":"10"}},iX=tX(()=>T.createElementVNode("div",{class:"species-display-text"},"Species",-1));function aX(e,t,r,n,i,a){const u=Lr,o=X4,f=gs,h=di,p=_s,m=JT;return T.openBlock(),T.createElementBlock("div",rX,[r.disableUI?T.createCommentVNode("",!0):(T.openBlock(),T.createElementBlock("div",nX,[iX,T.createVNode(p,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:r.helpMode,teleported:!1,ref:"selectPopover"},{reference:T.withCtx(()=>[T.createVNode(h,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=g=>e.activeSpecies=g),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:a.setSpecies},{default:T.withCtx(()=>[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.speciesList,(g,v)=>(T.openBlock(),T.createBlock(f,{key:v,label:v,value:v},{default:T.withCtx(()=>[T.createVNode(o,null,{default:T.withCtx(()=>[T.createVNode(u,{span:8},{default:T.withCtx(()=>[T.createElementVNode("i",{class:T.normalizeClass(g.iconClass)},null,2)]),_:2},1024),T.createVNode(u,{span:12},{default:T.withCtx(()=>[T.createTextVNode(T.toDisplayString(v),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.speciesList,(g,v)=>T.withDirectives((T.openBlock(),T.createBlock(m,{key:v,showLayer:r.showLayer,entry:g.taxo,uuid:g.uuid,biologicalSex:g.biologicalSex,displayWarning:g.displayWarning,displayLatestChanges:g.displayLatestChanges,isLegacy:g.isLegacy,ref_for:!0,ref:v,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:a.viewLatestMap,onResourceSelected:a.FlatmapSelected,onReady:a.FlatmapReady,onPanZoomCallback:a.panZoomCallback,onOpenMap:t[1]||(t[1]=b=>e.$emit("open-map",b)),featureInfo:r.featureInfo,minZoom:r.minZoom,pathControls:r.pathControls,searchable:r.searchable,layerControl:r.layerControl,helpMode:r.helpMode,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["showLayer","entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","featureInfo","minZoom","pathControls","searchable","layerControl","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[T.vShow,e.activeSpecies==v]])),128))],512)}const oX=br(eX,[["render",aX],["__scopeId","data-v-4a803829"]]);I2.FlatmapVuer=JT,I2.MultiFlatmapVuer=oX,I2.Tooltip=Qu,Object.defineProperty(I2,Symbol.toStringTag,{value:"Module"})});