@abi-software/flatmapvuer 1.4.1 → 1.4.2

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.
@@ -30,7 +30,7 @@ usage: app.provide(ID_INJECTION_KEY, {
30
30
  <circle cx="12.5" cy="12.5" r="9" fill="#fff"></circle>
31
31
  <text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">2</text>
32
32
  </svg>
33
- </div>`,E_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},wc={},NO=async function(t,e){return wc&&wc.hasOwnProperty(e)?wc[e]:new Promise(r=>{fetch(`${t}knowledge/label/${e}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),wc[e]=i,r(i)}).catch(n=>{console.error("Error:",n),wc[e]=e,r(e)})})},DO=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1};let Sst=function(){this.initialise=function(t){this.flatmapApi=t,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(t){let e=[];t.feature.hyperlinks&&t.feature.hyperlinks.length>0?e=t.feature.hyperlinks:e=this.urls.map(i=>({url:i,id:"pubmed"}));let r;if(t.provenanceTaxonomy){r=[];for(let i=0;t.provenanceTaxonomy.length>i;i++)r.push(await NO(this.flatmapAPI,t.provenanceTaxonomy[i]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:t.label,featureId:t.resource,hyperlinks:e,provenanceTaxonomy:t.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(t,e){let r=[];return t.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),e),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),e)}),r},this.createLabelLookup=function(t){return new Promise(e=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(t)};fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{const o=i.keys.indexOf("entity"),a=i.keys.indexOf("label");o>-1&&a>-1&&i.values.forEach(s=>{r[s[o]]=s[a],this.uberons.push({id:s[o],name:s[a]})}),e(r)})})},this.buildConnectivitySqlStatement=function(t){let e="select knowledge from knowledge where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildLabelSqlStatement=function(t){let e="select entity, label from labels where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.findAllIdsFromConnectivity=function(t){let e=t.connectivity.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(t){let e=t.connectivity.flat(),r=E_(e),n=[],i=!1;return r.forEach(o=>{i=!1,DO(t.axons,o)&&(i=!0),DO(t.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(t){this.controller&&this.controller.abort(),this.controller=new AbortController;const e=this.controller.signal,r=t.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;let n=this.queryForConnectivity(r,e),i=await this.pubmedQueryOnIds(t);return await Promise.all([n,i])},this.queryForConnectivity=function(t,e,r=!0){const n={sql:this.buildConnectivitySqlStatement(t)},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),...e?{signal:e}:{}};return new Promise(o=>{fetch(`${this.flatmapApi}knowledge/query/`,i).then(a=>a.json()).then(a=>{if(this.connectivityExists(a)){let s=JSON.parse(a.values[0][0]);r?this.processConnectivity(s).then(u=>{o(u)}):o(s)}else o(!1)}).catch(a=>{console.error("Error:",a),o(!1)})})},this.connectivityExists=function(t){return!!(t.values&&t.values.length>0&&JSON.parse(t.values[0][0]).connectivity&&JSON.parse(t.values[0][0]).connectivity.length>0)},this.findIfNodeIsSingle=function(t){return t.length===1?(console.error("Server returns a single node",t),t[0]):t.length===2&&t[1].length===0?t[0]:!1},this.createLabelFromNeuralNode=function(t,e){let r=this.findIfNodeIsSingle(t);if(r)return e[r];let n=e[t[0]];return t.length===2&&t[1].length>0&&t[1].forEach(i=>{e[i]==null?n+=`, ${i}`:n+=`, ${e[i]}`}),n},this.flattenAndFindDatasets=function(t,e,r){let n=this.flattenConntectivity(t),i=this.flattenConntectivity(e),o=this.flattenConntectivity(r);this.destinationsWithDatasets=this.uberons.filter(a=>i.indexOf(a.id)!==-1),this.originsWithDatasets=this.uberons.filter(a=>o.indexOf(a.id)!==-1),this.componentsWithDatasets=this.uberons.filter(a=>n.indexOf(a.id)!==-1)},this.processConnectivity=function(t){return new Promise(e=>{let r=this.findComponents(t),n=E_(t.axons),i=E_(t.dendrites),o=this.findAllIdsFromConnectivity(t);this.createLabelLookup(o).then(a=>{this.destinations=n.map(s=>this.createLabelFromNeuralNode(s,a)),this.origins=i.map(s=>this.createLabelFromNeuralNode(s,a)),this.components=r.map(s=>this.createLabelFromNeuralNode(s,a)),this.flattenAndFindDatasets(r,n,i),e({ids:{axons:n,dendrites:i,components:r},labels:{destinations:this.destinations,origins:this.origins,components:this.components}})})})},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.stripPMIDPrefix=function(t){return t.split(":")[1]},this.buildPubmedSqlStatement=function(t){let e="select distinct publication from publications where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildPubmedSqlStatementForModels=function(t){return`select distinct publication from publications where entity = '${t}'`},this.flatmapQuery=function(t){const e={sql:t};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(t){return new Promise(e=>{const r=t.resource,n=t.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(o=>{o.values.length>0?(this.urls=[this.pubmedSearchUrl(o.values.map(a=>this.stripPMIDPrefix(a[0])))],e(!0)):this.pubmedQueryOnModels(n).then(a=>{e(a)})})})},this.pubmedQueryOnModels=function(t){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(t)).then(e=>Array.isArray(e.values)&&e.values.length>0?(this.urls=[this.pubmedSearchUrl(e.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(t){let e="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;const n=t.map(i=>decodeURIComponent(i));return r.append("term",n),e+r.toString()}};const Hst='<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="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text></svg>';var BO={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof window<"u"?window:f1t,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(f){return r.setTimeout(f,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(f){r.clearTimeout(f)};function o(f,T){var Q=Object.prototype.toString.call(f),_=Q==="[object Array]"||Q==="[object NodeList]"||Q==="[object HTMLCollection]"||Q==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,L=0,b=f.length;if(_)for(;L<b;L++)T(f[L]);else T(f)}function a(f){if(!f.getBoundingClientRect)return{width:f.offsetWidth,height:f.offsetHeight};var T=f.getBoundingClientRect();return{width:Math.round(T.width),height:Math.round(T.height)}}function s(f,T){Object.keys(T).forEach(function(Q){f.style[Q]=T[Q]})}var u=function(f,T){var Q=0;function _(){var b=[];this.add=function(O){b.push(O)};var M,E;this.call=function(O){for(M=0,E=b.length;M<E;M++)b[M].call(this,O)},this.remove=function(O){var P=[];for(M=0,E=b.length;M<E;M++)b[M]!==O&&P.push(b[M]);b=P},this.length=function(){return b.length}}function L(b,M){if(b){if(b.resizedAttached){b.resizedAttached.add(M);return}b.resizedAttached=new _,b.resizedAttached.add(M),b.resizeSensor=document.createElement("div"),b.resizeSensor.dir="ltr",b.resizeSensor.className="resize-sensor";var E={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},O={position:"absolute",left:"0px",top:"0px",transition:"0s"};s(b.resizeSensor,E);var P=document.createElement("div");P.className="resize-sensor-expand",s(P,E);var D=document.createElement("div");s(D,O),P.appendChild(D);var j=document.createElement("div");j.className="resize-sensor-shrink",s(j,E);var $=document.createElement("div");s($,O),s($,{width:"200%",height:"200%"}),j.appendChild($),b.resizeSensor.appendChild(P),b.resizeSensor.appendChild(j),b.appendChild(b.resizeSensor);var U=window.getComputedStyle(b),tt=U?U.getPropertyValue("position"):null;tt!=="absolute"&&tt!=="relative"&&tt!=="fixed"&&tt!=="sticky"&&(b.style.position="relative");var it=!1,lt=0,rt=a(b),mt=0,Pt=0,Gt=!0;Q=0;var re=function(){var ee=b.offsetWidth,ce=b.offsetHeight;D.style.width=ee+10+"px",D.style.height=ce+10+"px",P.scrollLeft=ee+10,P.scrollTop=ce+10,j.scrollLeft=ee+10,j.scrollTop=ce+10},me=function(){if(Gt){var ee=b.offsetWidth===0&&b.offsetHeight===0;if(ee){Q||(Q=n(function(){Q=0,me()}));return}else Gt=!1}re()};b.resizeSensor.resetSensor=me;var ue=function(){lt=0,it&&(mt=rt.width,Pt=rt.height,b.resizedAttached&&b.resizedAttached.call(rt))},Ke=function(){rt=a(b),it=rt.width!==mt||rt.height!==Pt,it&&!lt&&(lt=n(ue)),me()},Sr=function(ee,ce,be){ee.attachEvent?ee.attachEvent("on"+ce,be):ee.addEventListener(ce,be)};Sr(P,"scroll",Ke),Sr(j,"scroll",Ke),Q=n(function(){Q=0,me()})}}o(f,function(b){L(b,T)}),this.detach=function(b){Q||(i(Q),Q=0),u.detach(f,b)},this.reset=function(){f.resizeSensor.resetSensor()}};if(u.reset=function(f){o(f,function(T){T.resizeSensor.resetSensor()})},u.detach=function(f,T){o(f,function(Q){Q&&(Q.resizedAttached&&typeof T=="function"&&(Q.resizedAttached.remove(T),Q.resizedAttached.length())||Q.resizeSensor&&(Q.contains(Q.resizeSensor)&&Q.removeChild(Q.resizeSensor),delete Q.resizeSensor,delete Q.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(f){for(var T in f)if(f.hasOwnProperty(T))for(var Q=f[T].addedNodes,_=0;_<Q.length;_++)Q[_].resizeSensor&&u.reset(Q[_])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return u})})(BO);var Cst=BO.exports;const Ast=T1t(Cst);var Ost=Object.defineProperty,kst=(t,e,r)=>e in t?Ost(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pt=(t,e,r)=>(kst(t,typeof e!="symbol"?e+"":e,r),r),M_=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},wt=(t,e,r)=>(M_(t,e,"read from private field"),r?r.call(t):e.get(t)),ge=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},nr=(t,e,r,n)=>(M_(t,e,"write to private field"),e.set(t,r),r),we=(t,e,r)=>(M_(t,e,"access private method"),r);function Pst(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function FO(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Q1=function(t){try{return!!t()}catch{return!0}},Ist=Q1,S_=!Ist(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),jO=S_,zO=Function.prototype,H_=zO.call,Vst=jO&&zO.bind.bind(H_,H_),Vo=jO?Vst:function(t){return function(){return H_.apply(t,arguments)}},UO=Vo,Rst=UO({}.toString),Nst=UO("".slice),xc=function(t){return Nst(Rst(t),8,-1)},Dst=Vo,Bst=Q1,Fst=xc,C_=Object,jst=Dst("".split),zst=Bst(function(){return!C_("z").propertyIsEnumerable(0)})?function(t){return Fst(t)==="String"?jst(t,""):C_(t)}:C_,Ec=function(t){return t==null},Ust=Ec,Gst=TypeError,Ld=function(t){if(Ust(t))throw new Gst("Can't call method on "+t);return t},$st=zst,Zst=Ld,V5=function(t){return $st(Zst(t))},Mc=function(t){return t&&t.Math===Math&&t},q1=Mc(typeof globalThis=="object"&&globalThis)||Mc(typeof window=="object"&&window)||Mc(typeof self=="object"&&self)||Mc(typeof I=="object"&&I)||Mc(typeof I=="object"&&I)||function(){return this}()||Function("return this")(),GO={exports:{}},$O=q1,Wst=Object.defineProperty,A_=function(t,e){try{Wst($O,t,{value:e,configurable:!0,writable:!0})}catch{$O[t]=e}return e},qst=q1,Xst=A_,ZO="__core-js_shared__",WO=GO.exports=qst[ZO]||Xst(ZO,{});(WO.versions||(WO.versions=[])).push({version:"3.37.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"});var O_=GO.exports,qO=O_,XO=function(t,e){return qO[t]||(qO[t]=e||{})},Kst=Ld,Yst=Object,KO=function(t){return Yst(Kst(t))},Jst=Vo,t2t=KO,e2t=Jst({}.hasOwnProperty),Rs=Object.hasOwn||function(t,e){return e2t(t2t(t),e)},r2t=Vo,n2t=0,i2t=Math.random(),o2t=r2t(1 .toString),k_=function(t){return"Symbol("+(t===void 0?"":t)+")_"+o2t(++n2t+i2t,36)},a2t=typeof navigator<"u"&&String(navigator.userAgent)||"",YO=q1,P_=a2t,JO=YO.process,tk=YO.Deno,ek=JO&&JO.versions||tk&&tk.version,rk=ek&&ek.v8,rs,wd;rk&&(rs=rk.split("."),wd=rs[0]>0&&rs[0]<4?1:+(rs[0]+rs[1])),!wd&&P_&&(rs=P_.match(/Edge\/(\d+)/),(!rs||rs[1]>=74)&&(rs=P_.match(/Chrome\/(\d+)/),rs&&(wd=+rs[1])));var s2t=wd,nk=s2t,l2t=Q1,c2t=q1,u2t=c2t.String,ik=!!Object.getOwnPropertySymbols&&!l2t(function(){var t=Symbol("symbol detection");return!u2t(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&nk&&nk<41}),h2t=ik,ok=h2t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",d2t=q1,p2t=XO,ak=Rs,f2t=k_,T2t=ik,Q2t=ok,R5=d2t.Symbol,I_=p2t("wks"),m2t=Q2t?R5.for||R5:R5&&R5.withoutSetter||f2t,wa=function(t){return ak(I_,t)||(I_[t]=T2t&&ak(R5,t)?R5[t]:m2t("Symbol."+t)),I_[t]},V_=typeof document=="object"&&document.all,Yo=typeof V_>"u"&&V_!==void 0?function(t){return typeof t=="function"||t===V_}:function(t){return typeof t=="function"},g2t=Yo,xa=function(t){return typeof t=="object"?t!==null:g2t(t)},y2t=xa,_2t=String,v2t=TypeError,s4=function(t){if(y2t(t))return t;throw new v2t(_2t(t)+" is not an object")},sk={},b2t=Q1,ns=!b2t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),L2t=ns,w2t=Q1,lk=L2t&&w2t(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ns={},x2t=q1,ck=xa,R_=x2t.document,E2t=ck(R_)&&ck(R_.createElement),N_=function(t){return E2t?R_.createElement(t):{}},M2t=ns,S2t=Q1,H2t=N_,uk=!M2t&&!S2t(function(){return Object.defineProperty(H2t("div"),"a",{get:function(){return 7}}).a!==7}),C2t=S_,xd=Function.prototype.call,r3=C2t?xd.bind(xd):function(){return xd.apply(xd,arguments)},D_=q1,A2t=Yo,O2t=function(t){return A2t(t)?t:void 0},Sc=function(t,e){return arguments.length<2?O2t(D_[t]):D_[t]&&D_[t][e]},k2t=Vo,B_=k2t({}.isPrototypeOf),P2t=Sc,I2t=Yo,V2t=B_,R2t=ok,N2t=Object,hk=R2t?function(t){return typeof t=="symbol"}:function(t){var e=P2t("Symbol");return I2t(e)&&V2t(e.prototype,N2t(t))},D2t=String,F_=function(t){try{return D2t(t)}catch{return"Object"}},B2t=Yo,F2t=F_,j2t=TypeError,Hc=function(t){if(B2t(t))return t;throw new j2t(F2t(t)+" is not a function")},z2t=Hc,U2t=Ec,j_=function(t,e){var r=t[e];return U2t(r)?void 0:z2t(r)},z_=r3,U_=Yo,G_=xa,G2t=TypeError,$2t=function(t,e){var r,n;if(e==="string"&&U_(r=t.toString)&&!G_(n=z_(r,t))||U_(r=t.valueOf)&&!G_(n=z_(r,t))||e!=="string"&&U_(r=t.toString)&&!G_(n=z_(r,t)))return n;throw new G2t("Can't convert object to primitive value")},Z2t=r3,dk=xa,pk=hk,W2t=j_,q2t=$2t,X2t=wa,K2t=TypeError,Y2t=X2t("toPrimitive"),J2t=function(t,e){if(!dk(t)||pk(t))return t;var r=W2t(t,Y2t),n;if(r){if(e===void 0&&(e="default"),n=Z2t(r,t,e),!dk(n)||pk(n))return n;throw new K2t("Can't convert object to primitive value")}return e===void 0&&(e="number"),q2t(t,e)},t3t=J2t,e3t=hk,fk=function(t){var e=t3t(t,"string");return e3t(e)?e:e+""},r3t=ns,n3t=uk,i3t=lk,Ed=s4,Tk=fk,o3t=TypeError,$_=Object.defineProperty,a3t=Object.getOwnPropertyDescriptor,Z_="enumerable",W_="configurable",q_="writable";Ns.f=r3t?i3t?function(t,e,r){if(Ed(t),e=Tk(e),Ed(r),typeof t=="function"&&e==="prototype"&&"value"in r&&q_ in r&&!r[q_]){var n=a3t(t,e);n&&n[q_]&&(t[e]=r.value,r={configurable:W_ in r?r[W_]:n[W_],enumerable:Z_ in r?r[Z_]:n[Z_],writable:!1})}return $_(t,e,r)}:$_:function(t,e,r){if(Ed(t),e=Tk(e),Ed(r),n3t)try{return $_(t,e,r)}catch{}if("get"in r||"set"in r)throw new o3t("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var s3t=Math.ceil,l3t=Math.floor,c3t=Math.trunc||function(t){var e=+t;return(e>0?l3t:s3t)(e)},u3t=c3t,Md=function(t){var e=+t;return e!==e||e===0?0:u3t(e)},h3t=Md,d3t=Math.max,p3t=Math.min,f3t=function(t,e){var r=h3t(t);return r<0?d3t(r+e,0):p3t(r,e)},T3t=Md,Q3t=Math.min,m3t=function(t){var e=T3t(t);return e>0?Q3t(e,9007199254740991):0},g3t=m3t,Qk=function(t){return g3t(t.length)},y3t=V5,_3t=f3t,v3t=Qk,mk=function(t){return function(e,r,n){var i=y3t(e),o=v3t(i);if(o===0)return!t&&-1;var a=_3t(n,o),s;if(t&&r!==r){for(;o>a;)if(s=i[a++],s!==s)return!0}else for(;o>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},b3t={includes:mk(!0),indexOf:mk(!1)},Sd={},L3t=Vo,X_=Rs,w3t=V5,x3t=b3t.indexOf,E3t=Sd,gk=L3t([].push),yk=function(t,e){var r=w3t(t),n=0,i=[],o;for(o in r)!X_(E3t,o)&&X_(r,o)&&gk(i,o);for(;e.length>n;)X_(r,o=e[n++])&&(~x3t(i,o)||gk(i,o));return i},K_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],M3t=yk,S3t=K_,H3t=Object.keys||function(t){return M3t(t,S3t)},C3t=ns,A3t=lk,O3t=Ns,k3t=s4,P3t=V5,I3t=H3t;sk.f=C3t&&!A3t?Object.defineProperties:function(t,e){k3t(t);for(var r=P3t(e),n=I3t(e),i=n.length,o=0,a;i>o;)O3t.f(t,a=n[o++],r[a]);return t};var V3t=Sc,R3t=V3t("document","documentElement"),N3t=XO,D3t=k_,_k=N3t("keys"),Y_=function(t){return _k[t]||(_k[t]=D3t(t))},B3t=s4,F3t=sk,vk=K_,j3t=Sd,z3t=R3t,U3t=N_,G3t=Y_,bk=">",Lk="<",J_="prototype",tv="script",wk=G3t("IE_PROTO"),ev=function(){},xk=function(t){return Lk+tv+bk+t+Lk+"/"+tv+bk},Ek=function(t){t.write(xk("")),t.close();var e=t.parentWindow.Object;return t=null,e},$3t=function(){var t=U3t("iframe"),e="java"+tv+":",r;return t.style.display="none",z3t.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(xk("document.F=Object")),r.close(),r.F},Hd,Cd=function(){try{Hd=new ActiveXObject("htmlfile")}catch{}Cd=typeof document<"u"?document.domain&&Hd?Ek(Hd):$3t():Ek(Hd);for(var t=vk.length;t--;)delete Cd[J_][vk[t]];return Cd()};j3t[wk]=!0;var rv=Object.create||function(t,e){var r;return t!==null?(ev[J_]=B3t(t),r=new ev,ev[J_]=null,r[wk]=t):r=Cd(),e===void 0?r:F3t.f(r,e)},Z3t=wa,W3t=rv,q3t=Ns.f,nv=Z3t("unscopables"),iv=Array.prototype;iv[nv]===void 0&&q3t(iv,nv,{configurable:!0,value:W3t(null)});var X3t=function(t){iv[nv][t]=!0},Cc={},K3t=q1,Y3t=Yo,Mk=K3t.WeakMap,J3t=Y3t(Mk)&&/native code/.test(String(Mk)),ov=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},t4t=ns,e4t=Ns,r4t=ov,Ad=t4t?function(t,e,r){return e4t.f(t,e,r4t(1,r))}:function(t,e,r){return t[e]=r,t},n4t=J3t,Sk=q1,i4t=xa,o4t=Ad,av=Rs,sv=O_,a4t=Y_,s4t=Sd,Hk="Object already initialized",lv=Sk.TypeError,l4t=Sk.WeakMap,Od,Ac,kd,c4t=function(t){return kd(t)?Ac(t):Od(t,{})},u4t=function(t){return function(e){var r;if(!i4t(e)||(r=Ac(e)).type!==t)throw new lv("Incompatible receiver, "+t+" required");return r}};if(n4t||sv.state){var Ds=sv.state||(sv.state=new l4t);Ds.get=Ds.get,Ds.has=Ds.has,Ds.set=Ds.set,Od=function(t,e){if(Ds.has(t))throw new lv(Hk);return e.facade=t,Ds.set(t,e),e},Ac=function(t){return Ds.get(t)||{}},kd=function(t){return Ds.has(t)}}else{var N5=a4t("state");s4t[N5]=!0,Od=function(t,e){if(av(t,N5))throw new lv(Hk);return e.facade=t,o4t(t,N5,e),e},Ac=function(t){return av(t,N5)?t[N5]:{}},kd=function(t){return av(t,N5)}}var Pd={set:Od,get:Ac,has:kd,enforce:c4t,getterFor:u4t},cv={},Ck={},Ak={}.propertyIsEnumerable,Ok=Object.getOwnPropertyDescriptor,h4t=Ok&&!Ak.call({1:2},1);Ck.f=h4t?function(t){var e=Ok(this,t);return!!e&&e.enumerable}:Ak;var d4t=ns,p4t=r3,f4t=Ck,T4t=ov,Q4t=V5,m4t=fk,g4t=Rs,y4t=uk,kk=Object.getOwnPropertyDescriptor;cv.f=d4t?kk:function(t,e){if(t=Q4t(t),e=m4t(e),y4t)try{return kk(t,e)}catch{}if(g4t(t,e))return T4t(!p4t(f4t.f,t,e),t[e])};var Pk={exports:{}},uv=ns,_4t=Rs,Ik=Function.prototype,v4t=uv&&Object.getOwnPropertyDescriptor,hv=_4t(Ik,"name"),b4t=hv&&(function(){}).name==="something",L4t=hv&&(!uv||uv&&v4t(Ik,"name").configurable),Vk={EXISTS:hv,PROPER:b4t,CONFIGURABLE:L4t},w4t=Vo,x4t=Yo,dv=O_,E4t=w4t(Function.toString);x4t(dv.inspectSource)||(dv.inspectSource=function(t){return E4t(t)});var M4t=dv.inspectSource,pv=Vo,S4t=Q1,H4t=Yo,Id=Rs,fv=ns,C4t=Vk.CONFIGURABLE,A4t=M4t,Rk=Pd,O4t=Rk.enforce,k4t=Rk.get,Nk=String,Vd=Object.defineProperty,P4t=pv("".slice),I4t=pv("".replace),V4t=pv([].join),R4t=fv&&!S4t(function(){return Vd(function(){},"length",{value:8}).length!==8}),N4t=String(String).split("String"),D4t=Pk.exports=function(t,e,r){P4t(Nk(e),0,7)==="Symbol("&&(e="["+I4t(Nk(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Id(t,"name")||C4t&&t.name!==e)&&(fv?Vd(t,"name",{value:e,configurable:!0}):t.name=e),R4t&&r&&Id(r,"arity")&&t.length!==r.arity&&Vd(t,"length",{value:r.arity});try{r&&Id(r,"constructor")&&r.constructor?fv&&Vd(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=O4t(t);return Id(n,"source")||(n.source=V4t(N4t,typeof e=="string"?e:"")),t};Function.prototype.toString=D4t(function(){return H4t(this)&&k4t(this).source||A4t(this)},"toString");var Dk=Pk.exports,B4t=Yo,F4t=Ns,j4t=Dk,z4t=A_,D5=function(t,e,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:e;if(B4t(r)&&j4t(r,o,n),n.global)i?t[e]=r:z4t(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:F4t.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Rd={},U4t=yk,G4t=K_,$4t=G4t.concat("length","prototype");Rd.f=Object.getOwnPropertyNames||function(t){return U4t(t,$4t)};var Bk={};Bk.f=Object.getOwnPropertySymbols;var Z4t=Sc,W4t=Vo,q4t=Rd,X4t=Bk,K4t=s4,Y4t=W4t([].concat),J4t=Z4t("Reflect","ownKeys")||function(t){var e=q4t.f(K4t(t)),r=X4t.f;return r?Y4t(e,r(t)):e},Fk=Rs,t6t=J4t,e6t=cv,r6t=Ns,n6t=function(t,e,r){for(var n=t6t(e),i=r6t.f,o=e6t.f,a=0;a<n.length;a++){var s=n[a];!Fk(t,s)&&!(r&&Fk(r,s))&&i(t,s,o(e,s))}},i6t=Q1,o6t=Yo,a6t=/#|\.prototype\./,Oc=function(t,e){var r=l6t[s6t(t)];return r===u6t?!0:r===c6t?!1:o6t(e)?i6t(e):!!e},s6t=Oc.normalize=function(t){return String(t).replace(a6t,".").toLowerCase()},l6t=Oc.data={},c6t=Oc.NATIVE="N",u6t=Oc.POLYFILL="P",jk=Oc,Nd=q1,h6t=cv.f,d6t=Ad,p6t=D5,f6t=A_,T6t=n6t,Q6t=jk,Bs=function(t,e){var r=t.target,n=t.global,i=t.stat,o,a,s,u,d,f;if(n?a=Nd:i?a=Nd[r]||f6t(r,{}):a=Nd[r]&&Nd[r].prototype,a)for(s in e){if(d=e[s],t.dontCallGetSet?(f=h6t(a,s),u=f&&f.value):u=a[s],o=Q6t(n?s:r+(i?".":"#")+s,t.forced),!o&&u!==void 0){if(typeof d==typeof u)continue;T6t(d,u)}(t.sham||u&&u.sham)&&d6t(d,"sham",!0),p6t(a,s,d,t)}},m6t=Q1,g6t=!m6t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),y6t=Rs,_6t=Yo,v6t=KO,b6t=Y_,L6t=g6t,zk=b6t("IE_PROTO"),Tv=Object,w6t=Tv.prototype,Uk=L6t?Tv.getPrototypeOf:function(t){var e=v6t(t);if(y6t(e,zk))return e[zk];var r=e.constructor;return _6t(r)&&e instanceof r?r.prototype:e instanceof Tv?w6t:null},x6t=Q1,E6t=Yo,M6t=xa,Gk=Uk,S6t=D5,H6t=wa,Qv=H6t("iterator"),$k=!1,z6,mv,gv;[].keys&&(gv=[].keys(),"next"in gv?(mv=Gk(Gk(gv)),mv!==Object.prototype&&(z6=mv)):$k=!0);var C6t=!M6t(z6)||x6t(function(){var t={};return z6[Qv].call(t)!==t});C6t&&(z6={}),E6t(z6[Qv])||S6t(z6,Qv,function(){return this});var Zk={IteratorPrototype:z6,BUGGY_SAFARI_ITERATORS:$k},A6t=Ns.f,O6t=Rs,k6t=wa,Wk=k6t("toStringTag"),Dd=function(t,e,r){t&&!r&&(t=t.prototype),t&&!O6t(t,Wk)&&A6t(t,Wk,{configurable:!0,value:e})},P6t=Zk.IteratorPrototype,I6t=rv,V6t=ov,R6t=Dd,N6t=Cc,D6t=function(){return this},B6t=function(t,e,r,n){var i=e+" Iterator";return t.prototype=I6t(P6t,{next:V6t(+!n,r)}),R6t(t,i,!1),N6t[i]=D6t,t},F6t=Vo,j6t=Hc,qk=function(t,e,r){try{return F6t(j6t(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},z6t=xa,U6t=function(t){return z6t(t)||t===null},G6t=U6t,$6t=String,Z6t=TypeError,W6t=function(t){if(G6t(t))return t;throw new Z6t("Can't set "+$6t(t)+" as a prototype")},q6t=qk,X6t=xa,K6t=Ld,Y6t=W6t,Xk=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=q6t(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(n,i){return K6t(n),Y6t(i),X6t(n)&&(t?r(n,i):n.__proto__=i),n}}():void 0),J6t=Bs,t0t=r3,Kk=Vk,e0t=Yo,r0t=B6t,Yk=Uk,Jk=Xk,n0t=Dd,i0t=Ad,yv=D5,o0t=wa,a0t=Cc,tP=Zk,s0t=Kk.PROPER,l0t=Kk.CONFIGURABLE,eP=tP.IteratorPrototype,Bd=tP.BUGGY_SAFARI_ITERATORS,kc=o0t("iterator"),rP="keys",Pc="values",nP="entries",c0t=function(){return this},_v=function(t,e,r,n,i,o,a){r0t(r,e,n);var s=function(E){if(E===i&&Q)return Q;if(!Bd&&E&&E in f)return f[E];switch(E){case rP:return function(){return new r(this,E)};case Pc:return function(){return new r(this,E)};case nP:return function(){return new r(this,E)}}return function(){return new r(this)}},u=e+" Iterator",d=!1,f=t.prototype,T=f[kc]||f["@@iterator"]||i&&f[i],Q=!Bd&&T||s(i),_=e==="Array"&&f.entries||T,L,b,M;if(_&&(L=Yk(_.call(new t)),L!==Object.prototype&&L.next&&(Yk(L)!==eP&&(Jk?Jk(L,eP):e0t(L[kc])||yv(L,kc,c0t)),n0t(L,u,!0))),s0t&&i===Pc&&T&&T.name!==Pc&&(l0t?i0t(f,"name",Pc):(d=!0,Q=function(){return t0t(T,this)})),i)if(b={values:s(Pc),keys:o?Q:s(rP),entries:s(nP)},a)for(M in b)(Bd||d||!(M in f))&&yv(f,M,b[M]);else J6t({target:e,proto:!0,forced:Bd||d},b);return f[kc]!==Q&&yv(f,kc,Q,{name:i}),a0t[e]=Q,b},vv=function(t,e){return{value:t,done:e}},u0t=V5,bv=X3t,iP=Cc,oP=Pd,h0t=Ns.f,d0t=_v,Fd=vv,p0t=ns,aP="Array Iterator",f0t=oP.set,T0t=oP.getterFor(aP),Q0t=d0t(Array,"Array",function(t,e){f0t(this,{type:aP,target:u0t(t),index:0,kind:e})},function(){var t=T0t(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,Fd(void 0,!0);switch(t.kind){case"keys":return Fd(r,!1);case"values":return Fd(e[r],!1)}return Fd([r,e[r]],!1)},"values"),sP=iP.Arguments=iP.Array;if(bv("keys"),bv("values"),bv("entries"),p0t&&sP.name!=="values")try{h0t(sP,"name",{value:"values"})}catch{}var m0t=wa,g0t=m0t("toStringTag"),lP={};lP[g0t]="z";var Lv=String(lP)==="[object z]",y0t=Lv,_0t=Yo,jd=xc,v0t=wa,b0t=v0t("toStringTag"),L0t=Object,w0t=jd(function(){return arguments}())==="Arguments",x0t=function(t,e){try{return t[e]}catch{}},wv=y0t?jd:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=x0t(e=L0t(t),b0t))=="string"?r:w0t?jd(e):(n=jd(e))==="Object"&&_0t(e.callee)?"Arguments":n},E0t=Lv,M0t=wv,S0t=E0t?{}.toString:function(){return"[object "+M0t(this)+"]"},H0t=Lv,C0t=D5,A0t=S0t;H0t||C0t(Object.prototype,"toString",A0t,{unsafe:!0});var cP={exports:{}},uP={},O0t=Vo,k0t=O0t([].slice),P0t=xc,I0t=V5,hP=Rd.f,V0t=k0t,dP=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],R0t=function(t){try{return hP(t)}catch{return V0t(dP)}};uP.f=function(t){return dP&&P0t(t)==="Window"?R0t(t):hP(I0t(t))};var N0t=Q1,D0t=N0t(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),B0t=Q1,F0t=xa,j0t=xc,pP=D0t,zd=Object.isExtensible,z0t=B0t(function(){zd(1)}),U0t=z0t||pP?function(t){return!F0t(t)||pP&&j0t(t)==="ArrayBuffer"?!1:zd?zd(t):!0}:zd,G0t=Q1,$0t=!G0t(function(){return Object.isExtensible(Object.preventExtensions({}))}),Z0t=Bs,W0t=Vo,q0t=Sd,X0t=xa,xv=Rs,K0t=Ns.f,fP=Rd,Y0t=uP,Ev=U0t,J0t=k_,t5t=$0t,TP=!1,n3=J0t("meta"),e5t=0,Mv=function(t){K0t(t,n3,{value:{objectID:"O"+e5t++,weakData:{}}})},r5t=function(t,e){if(!X0t(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!xv(t,n3)){if(!Ev(t))return"F";if(!e)return"E";Mv(t)}return t[n3].objectID},n5t=function(t,e){if(!xv(t,n3)){if(!Ev(t))return!0;if(!e)return!1;Mv(t)}return t[n3].weakData},i5t=function(t){return t5t&&TP&&Ev(t)&&!xv(t,n3)&&Mv(t),t},o5t=function(){a5t.enable=function(){},TP=!0;var t=fP.f,e=W0t([].splice),r={};r[n3]=1,t(r).length&&(fP.f=function(n){for(var i=t(n),o=0,a=i.length;o<a;o++)if(i[o]===n3){e(i,o,1);break}return i},Z0t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Y0t.f}))},a5t=cP.exports={enable:o5t,fastKey:r5t,getWeakData:n5t,onFreeze:i5t};q0t[n3]=!0;var QP=cP.exports,s5t=xc,l5t=Vo,c5t=function(t){if(s5t(t)==="Function")return l5t(t)},mP=c5t,u5t=Hc,h5t=S_,d5t=mP(mP.bind),gP=function(t,e){return u5t(t),e===void 0?t:h5t?d5t(t,e):function(){return t.apply(e,arguments)}},p5t=wa,f5t=Cc,T5t=p5t("iterator"),Q5t=Array.prototype,m5t=function(t){return t!==void 0&&(f5t.Array===t||Q5t[T5t]===t)},g5t=wv,yP=j_,y5t=Ec,_5t=Cc,v5t=wa,b5t=v5t("iterator"),_P=function(t){if(!y5t(t))return yP(t,b5t)||yP(t,"@@iterator")||_5t[g5t(t)]},L5t=r3,w5t=Hc,x5t=s4,E5t=F_,M5t=_P,S5t=TypeError,H5t=function(t,e){var r=arguments.length<2?M5t(t):e;if(w5t(r))return x5t(L5t(r,t));throw new S5t(E5t(t)+" is not iterable")},C5t=r3,vP=s4,A5t=j_,Sv=function(t,e,r){var n,i;vP(t);try{if(n=A5t(t,"return"),!n){if(e==="throw")throw r;return r}n=C5t(n,t)}catch(o){i=!0,n=o}if(e==="throw")throw r;if(i)throw n;return vP(n),r},O5t=gP,k5t=r3,P5t=s4,I5t=F_,V5t=m5t,R5t=Qk,bP=B_,N5t=H5t,D5t=_P,LP=Sv,B5t=TypeError,Ud=function(t,e){this.stopped=t,this.result=e},wP=Ud.prototype,xP=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),o=!!(r&&r.IS_RECORD),a=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=O5t(e,n),d,f,T,Q,_,L,b,M=function(O){return d&&LP(d,"normal",O),new Ud(!0,O)},E=function(O){return i?(P5t(O),s?u(O[0],O[1],M):u(O[0],O[1])):s?u(O,M):u(O)};if(o)d=t.iterator;else if(a)d=t;else{if(f=D5t(t),!f)throw new B5t(I5t(t)+" is not iterable");if(V5t(f)){for(T=0,Q=R5t(t);Q>T;T++)if(_=E(t[T]),_&&bP(wP,_))return _;return new Ud(!1)}d=N5t(t,f)}for(L=o?t.next:d.next;!(b=k5t(L,d)).done;){try{_=E(b.value)}catch(O){LP(d,"throw",O)}if(typeof _=="object"&&_&&bP(wP,_))return _}return new Ud(!1)},F5t=B_,j5t=TypeError,EP=function(t,e){if(F5t(e,t))return t;throw new j5t("Incorrect invocation")},z5t=wa,MP=z5t("iterator"),SP=!1;try{var U5t=0,HP={next:function(){return{done:!!U5t++}},return:function(){SP=!0}};HP[MP]=function(){return this},Array.from(HP,function(){throw 2})}catch{}var G5t=function(t,e){try{if(!e&&!SP)return!1}catch{return!1}var r=!1;try{var n={};n[MP]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},$5t=Yo,Z5t=xa,CP=Xk,W5t=function(t,e,r){var n,i;return CP&&$5t(n=e.constructor)&&n!==r&&Z5t(i=n.prototype)&&i!==r.prototype&&CP(t,i),t},q5t=Bs,X5t=q1,K5t=Vo,AP=jk,Y5t=D5,J5t=QP,tlt=xP,elt=EP,rlt=Yo,nlt=Ec,Hv=xa,Cv=Q1,ilt=G5t,olt=Dd,alt=W5t,slt=function(t,e,r){var n=t.indexOf("Map")!==-1,i=t.indexOf("Weak")!==-1,o=n?"set":"add",a=X5t[t],s=a&&a.prototype,u=a,d={},f=function(E){var O=K5t(s[E]);Y5t(s,E,E==="add"?function(P){return O(this,P===0?0:P),this}:E==="delete"?function(P){return i&&!Hv(P)?!1:O(this,P===0?0:P)}:E==="get"?function(P){return i&&!Hv(P)?void 0:O(this,P===0?0:P)}:E==="has"?function(P){return i&&!Hv(P)?!1:O(this,P===0?0:P)}:function(P,D){return O(this,P===0?0:P,D),this})},T=AP(t,!rlt(a)||!(i||s.forEach&&!Cv(function(){new a().entries().next()})));if(T)u=r.getConstructor(e,t,n,o),J5t.enable();else if(AP(t,!0)){var Q=new u,_=Q[o](i?{}:-0,1)!==Q,L=Cv(function(){Q.has(1)}),b=ilt(function(E){new a(E)}),M=!i&&Cv(function(){for(var E=new a,O=5;O--;)E[o](O,O);return!E.has(-0)});b||(u=e(function(E,O){elt(E,s);var P=alt(new a,E,u);return nlt(O)||tlt(O,P[o],{that:P,AS_ENTRIES:n}),P}),u.prototype=s,s.constructor=u),(L||M)&&(f("delete"),f("has"),n&&f("get")),(M||_)&&f(o),i&&s.clear&&delete s.clear}return d[t]=u,q5t({global:!0,constructor:!0,forced:u!==a},d),olt(u,t),i||r.setStrong(u,t,n),u},OP=Dk,llt=Ns,kP=function(t,e,r){return r.get&&OP(r.get,e,{getter:!0}),r.set&&OP(r.set,e,{setter:!0}),llt.f(t,e,r)},clt=D5,ult=function(t,e,r){for(var n in e)clt(t,n,e[n],r);return t},hlt=Sc,dlt=kP,plt=wa,flt=ns,PP=plt("species"),Tlt=function(t){var e=hlt(t);flt&&e&&!e[PP]&&dlt(e,PP,{configurable:!0,get:function(){return this}})},IP=rv,Qlt=kP,VP=ult,mlt=gP,glt=EP,ylt=Ec,_lt=xP,vlt=_v,RP=vv,blt=Tlt,Ic=ns,NP=QP.fastKey,DP=Pd,BP=DP.set,Av=DP.getterFor,Llt={getConstructor:function(t,e,r,n){var i=t(function(d,f){glt(d,o),BP(d,{type:e,index:IP(null),first:void 0,last:void 0,size:0}),Ic||(d.size=0),ylt(f)||_lt(f,d[n],{that:d,AS_ENTRIES:r})}),o=i.prototype,a=Av(e),s=function(d,f,T){var Q=a(d),_=u(d,f),L,b;return _?_.value=T:(Q.last=_={index:b=NP(f,!0),key:f,value:T,previous:L=Q.last,next:void 0,removed:!1},Q.first||(Q.first=_),L&&(L.next=_),Ic?Q.size++:d.size++,b!=="F"&&(Q.index[b]=_)),d},u=function(d,f){var T=a(d),Q=NP(f),_;if(Q!=="F")return T.index[Q];for(_=T.first;_;_=_.next)if(_.key===f)return _};return VP(o,{clear:function(){for(var d=this,f=a(d),T=f.first;T;)T.removed=!0,T.previous&&(T.previous=T.previous.next=void 0),T=T.next;f.first=f.last=void 0,f.index=IP(null),Ic?f.size=0:d.size=0},delete:function(d){var f=this,T=a(f),Q=u(f,d);if(Q){var _=Q.next,L=Q.previous;delete T.index[Q.index],Q.removed=!0,L&&(L.next=_),_&&(_.previous=L),T.first===Q&&(T.first=_),T.last===Q&&(T.last=L),Ic?T.size--:f.size--}return!!Q},forEach:function(d){for(var f=a(this),T=mlt(d,arguments.length>1?arguments[1]:void 0),Q;Q=Q?Q.next:f.first;)for(T(Q.value,Q.key,this);Q&&Q.removed;)Q=Q.previous},has:function(d){return!!u(this,d)}}),VP(o,r?{get:function(d){var f=u(this,d);return f&&f.value},set:function(d,f){return s(this,d===0?0:d,f)}}:{add:function(d){return s(this,d=d===0?0:d,d)}}),Ic&&Qlt(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Av(e),o=Av(n);vlt(t,e,function(a,s){BP(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,u=a.last;u&&u.removed;)u=u.previous;return!a.target||!(a.last=u=u?u.next:a.state.first)?(a.target=void 0,RP(void 0,!0)):RP(s==="keys"?u.key:s==="values"?u.value:[u.key,u.value],!1)},r?"entries":"values",!r,!0),blt(e)}},wlt=slt,xlt=Llt;wlt("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},xlt);var Ov=Vo,Gd=Set.prototype,Fs={Set,add:Ov(Gd.add),has:Ov(Gd.has),remove:Ov(Gd.delete),proto:Gd},Elt=Fs.has,U6=function(t){return Elt(t),t},Mlt=r3,G6=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,o,a;!(o=Mlt(i,n)).done;)if(a=e(o.value),a!==void 0)return a},FP=Vo,Slt=G6,jP=Fs,Hlt=jP.Set,zP=jP.proto,Clt=FP(zP.forEach),UP=FP(zP.keys),Alt=UP(new Hlt).next,Vc=function(t,e,r){return r?Slt({iterator:UP(t),next:Alt},e):Clt(t,e)},GP=Fs,Olt=Vc,klt=GP.Set,Plt=GP.add,kv=function(t){var e=new klt;return Olt(t,function(r){Plt(e,r)}),e},Ilt=qk,Vlt=Fs,Rc=Ilt(Vlt.proto,"size","get")||function(t){return t.size},Rlt=function(t){return{iterator:t,next:t.next,done:!1}},$P=Hc,ZP=s4,WP=r3,Nlt=Md,Dlt=Rlt,qP="Invalid size",Blt=RangeError,Flt=TypeError,jlt=Math.max,XP=function(t,e){this.set=t,this.size=jlt(e,0),this.has=$P(t.has),this.keys=$P(t.keys)};XP.prototype={getIterator:function(){return Dlt(ZP(WP(this.keys,this.set)))},includes:function(t){return WP(this.has,this.set,t)}};var $6=function(t){ZP(t);var e=+t.size;if(e!==e)throw new Flt(qP);var r=Nlt(e);if(r<0)throw new Blt(qP);return new XP(t,r)},zlt=U6,KP=Fs,Ult=kv,Glt=Rc,$lt=$6,Zlt=Vc,Wlt=G6,qlt=KP.has,YP=KP.remove,Xlt=function(t){var e=zlt(this),r=$lt(t),n=Ult(e);return Glt(e)<=r.size?Zlt(e,function(i){r.includes(i)&&YP(n,i)}):Wlt(r.getIterator(),function(i){qlt(e,i)&&YP(n,i)}),n},Klt=Sc,JP=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Z6=function(t){var e=Klt("Set");try{new e()[t](JP(0));try{return new e()[t](JP(-1)),!1}catch{return!0}}catch{return!1}},Ylt=Bs,Jlt=Xlt,t7t=Z6;Ylt({target:"Set",proto:!0,real:!0,forced:!t7t("difference")},{difference:Jlt});var e7t=U6,Pv=Fs,r7t=Rc,n7t=$6,i7t=Vc,o7t=G6,a7t=Pv.Set,tI=Pv.add,s7t=Pv.has,l7t=function(t){var e=e7t(this),r=n7t(t),n=new a7t;return r7t(e)>r.size?o7t(r.getIterator(),function(i){s7t(e,i)&&tI(n,i)}):i7t(e,function(i){r.includes(i)&&tI(n,i)}),n},c7t=Bs,u7t=Q1,h7t=l7t,d7t=Z6,p7t=!d7t("intersection")||u7t(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});c7t({target:"Set",proto:!0,real:!0,forced:p7t},{intersection:h7t});var f7t=U6,T7t=Fs.has,Q7t=Rc,m7t=$6,g7t=Vc,y7t=G6,_7t=Sv,v7t=function(t){var e=f7t(this),r=m7t(t);if(Q7t(e)<=r.size)return g7t(e,function(i){if(r.includes(i))return!1},!0)!==!1;var n=r.getIterator();return y7t(n,function(i){if(T7t(e,i))return _7t(n,"normal",!1)})!==!1},b7t=Bs,L7t=v7t,w7t=Z6;b7t({target:"Set",proto:!0,real:!0,forced:!w7t("isDisjointFrom")},{isDisjointFrom:L7t});var x7t=U6,E7t=Rc,M7t=Vc,S7t=$6,H7t=function(t){var e=x7t(this),r=S7t(t);return E7t(e)>r.size?!1:M7t(e,function(n){if(!r.includes(n))return!1},!0)!==!1},C7t=Bs,A7t=H7t,O7t=Z6;C7t({target:"Set",proto:!0,real:!0,forced:!O7t("isSubsetOf")},{isSubsetOf:A7t});var k7t=U6,P7t=Fs.has,I7t=Rc,V7t=$6,R7t=G6,N7t=Sv,D7t=function(t){var e=k7t(this),r=V7t(t);if(I7t(e)<r.size)return!1;var n=r.getIterator();return R7t(n,function(i){if(!P7t(e,i))return N7t(n,"normal",!1)})!==!1},B7t=Bs,F7t=D7t,j7t=Z6;B7t({target:"Set",proto:!0,real:!0,forced:!j7t("isSupersetOf")},{isSupersetOf:F7t});var z7t=U6,Iv=Fs,U7t=kv,G7t=$6,$7t=G6,Z7t=Iv.add,W7t=Iv.has,q7t=Iv.remove,X7t=function(t){var e=z7t(this),r=G7t(t).getIterator(),n=U7t(e);return $7t(r,function(i){W7t(e,i)?q7t(n,i):Z7t(n,i)}),n},K7t=Bs,Y7t=X7t,J7t=Z6;K7t({target:"Set",proto:!0,real:!0,forced:!J7t("symmetricDifference")},{symmetricDifference:Y7t});var tct=U6,ect=Fs.add,rct=kv,nct=$6,ict=G6,oct=function(t){var e=tct(this),r=nct(t).getIterator(),n=rct(e);return ict(r,function(i){ect(n,i)}),n},act=Bs,sct=oct,lct=Z6;act({target:"Set",proto:!0,real:!0,forced:!lct("union")},{union:sct});var cct=wv,uct=String,eI=function(t){if(cct(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return uct(t)},Vv=Vo,hct=Md,dct=eI,pct=Ld,fct=Vv("".charAt),rI=Vv("".charCodeAt),Tct=Vv("".slice),nI=function(t){return function(e,r){var n=dct(pct(e)),i=hct(r),o=n.length,a,s;return i<0||i>=o?t?"":void 0:(a=rI(n,i),a<55296||a>56319||i+1===o||(s=rI(n,i+1))<56320||s>57343?t?fct(n,i):a:t?Tct(n,i,i+2):(a-55296<<10)+(s-56320)+65536)}},Qct={codeAt:nI(!1),charAt:nI(!0)},mct=Qct.charAt,gct=eI,iI=Pd,yct=_v,oI=vv,aI="String Iterator",_ct=iI.set,vct=iI.getterFor(aI);yct(String,"String",function(t){_ct(this,{type:aI,string:gct(t),index:0})},function(){var t=vct(this),e=t.string,r=t.index,n;return r>=e.length?oI(void 0,!0):(n=mct(e,r),t.index+=n.length,oI(n,!1))});var bct=q1,Lct=bct,wct=Lct,xct=wct.Set,Ect={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Mct=N_,Rv=Mct("span").classList,sI=Rv&&Rv.constructor&&Rv.constructor.prototype,Sct=sI===Object.prototype?void 0:sI,lI=q1,cI=Ect,Hct=Sct,Nc=Q0t,uI=Ad,Cct=Dd,Act=wa,Nv=Act("iterator"),Dv=Nc.values,hI=function(t,e){if(t){if(t[Nv]!==Dv)try{uI(t,Nv,Dv)}catch{t[Nv]=Dv}if(Cct(t,e,!0),cI[e]){for(var r in Nc)if(t[r]!==Nc[r])try{uI(t,r,Nc[r])}catch{t[r]=Nc[r]}}}};for(var Bv in cI)hI(lI[Bv]&&lI[Bv].prototype,Bv);hI(Hct,"DOMTokenList");var Oct=xct,kct=Oct,Pct=kct,Ict=Pct;const Dc=e3(Ict);var dI={exports:{}};/**
33
+ </div>`,E_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},wc={},NO=async function(t,e){return wc&&wc.hasOwnProperty(e)?wc[e]:new Promise(r=>{fetch(`${t}knowledge/label/${e}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),wc[e]=i,r(i)}).catch(n=>{console.error("Error:",n),wc[e]=e,r(e)})})},DO=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1};let Sst=function(){this.initialise=function(t){this.flatmapApi=t,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(t){let e=[];t.feature.hyperlinks&&t.feature.hyperlinks.length>0?e=t.feature.hyperlinks:e=this.urls.map(i=>({url:i,id:"pubmed"}));let r;if(t.provenanceTaxonomy){r=[];for(let i=0;t.provenanceTaxonomy.length>i;i++)r.push(await NO(this.flatmapAPI,t.provenanceTaxonomy[i]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:t.label,featureId:t.resource,hyperlinks:e,provenanceTaxonomy:t.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(t,e){let r=[];return t.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),e),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),e)}),r},this.createLabelLookup=function(t){return new Promise(e=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(t)};fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{const o=i.keys.indexOf("entity"),a=i.keys.indexOf("label");o>-1&&a>-1&&i.values.forEach(s=>{r[s[o]]=s[a],this.uberons.push({id:s[o],name:s[a]})}),e(r)})})},this.buildConnectivitySqlStatement=function(t){let e="select knowledge from knowledge where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildLabelSqlStatement=function(t){let e="select entity, label from labels where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.findAllIdsFromConnectivity=function(t){let e=t.connectivity.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(t){let e=t.connectivity.flat(),r=E_(e),n=[],i=!1;return r.forEach(o=>{i=!1,DO(t.axons,o)&&(i=!0),DO(t.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(t){this.controller&&this.controller.abort(),this.controller=new AbortController;const e=this.controller.signal,r=t.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;let n=this.queryForConnectivity(r,e),i=await this.pubmedQueryOnIds(t);return await Promise.all([n,i])},this.queryForConnectivity=function(t,e,r=!0){const n={sql:this.buildConnectivitySqlStatement(t)},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),...e?{signal:e}:{}};return new Promise(o=>{fetch(`${this.flatmapApi}knowledge/query/`,i).then(a=>a.json()).then(a=>{if(this.connectivityExists(a)){let s=JSON.parse(a.values[0][0]);r?this.processConnectivity(s).then(u=>{o(u)}):o(s)}else o(!1)}).catch(a=>{a.name==="AbortError"||console.error("Error:",a),o(!1)})})},this.connectivityExists=function(t){return!!(t.values&&t.values.length>0&&JSON.parse(t.values[0][0]).connectivity&&JSON.parse(t.values[0][0]).connectivity.length>0)},this.findIfNodeIsSingle=function(t){return t.length===1?(console.error("Server returns a single node",t),t[0]):t.length===2&&t[1].length===0?t[0]:!1},this.createLabelFromNeuralNode=function(t,e){let r=this.findIfNodeIsSingle(t);if(r)return e[r];let n=e[t[0]];return t.length===2&&t[1].length>0&&t[1].forEach(i=>{e[i]==null?n+=`, ${i}`:n+=`, ${e[i]}`}),n},this.flattenAndFindDatasets=function(t,e,r){let n=this.flattenConntectivity(t),i=this.flattenConntectivity(e),o=this.flattenConntectivity(r);this.destinationsWithDatasets=this.uberons.filter(a=>i.indexOf(a.id)!==-1),this.originsWithDatasets=this.uberons.filter(a=>o.indexOf(a.id)!==-1),this.componentsWithDatasets=this.uberons.filter(a=>n.indexOf(a.id)!==-1)},this.processConnectivity=function(t){return new Promise(e=>{let r=this.findComponents(t),n=E_(t.axons),i=E_(t.dendrites),o=this.findAllIdsFromConnectivity(t);this.createLabelLookup(o).then(a=>{this.destinations=n.map(s=>this.createLabelFromNeuralNode(s,a)),this.origins=i.map(s=>this.createLabelFromNeuralNode(s,a)),this.components=r.map(s=>this.createLabelFromNeuralNode(s,a)),this.flattenAndFindDatasets(r,n,i),e({ids:{axons:n,dendrites:i,components:r},labels:{destinations:this.destinations,origins:this.origins,components:this.components}})})})},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.stripPMIDPrefix=function(t){return t.split(":")[1]},this.buildPubmedSqlStatement=function(t){let e="select distinct publication from publications where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildPubmedSqlStatementForModels=function(t){return`select distinct publication from publications where entity = '${t}'`},this.flatmapQuery=function(t){const e={sql:t};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(t){return new Promise(e=>{const r=t.resource,n=t.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(o=>{o.values.length>0?(this.urls=[this.pubmedSearchUrl(o.values.map(a=>this.stripPMIDPrefix(a[0])))],e(!0)):this.pubmedQueryOnModels(n).then(a=>{e(a)})})})},this.pubmedQueryOnModels=function(t){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(t)).then(e=>Array.isArray(e.values)&&e.values.length>0?(this.urls=[this.pubmedSearchUrl(e.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(t){let e="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;const n=t.map(i=>decodeURIComponent(i));return r.append("term",n),e+r.toString()}};const Hst='<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="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text></svg>';var BO={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof window<"u"?window:f1t,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(f){return r.setTimeout(f,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(f){r.clearTimeout(f)};function o(f,T){var Q=Object.prototype.toString.call(f),_=Q==="[object Array]"||Q==="[object NodeList]"||Q==="[object HTMLCollection]"||Q==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,L=0,b=f.length;if(_)for(;L<b;L++)T(f[L]);else T(f)}function a(f){if(!f.getBoundingClientRect)return{width:f.offsetWidth,height:f.offsetHeight};var T=f.getBoundingClientRect();return{width:Math.round(T.width),height:Math.round(T.height)}}function s(f,T){Object.keys(T).forEach(function(Q){f.style[Q]=T[Q]})}var u=function(f,T){var Q=0;function _(){var b=[];this.add=function(O){b.push(O)};var M,E;this.call=function(O){for(M=0,E=b.length;M<E;M++)b[M].call(this,O)},this.remove=function(O){var P=[];for(M=0,E=b.length;M<E;M++)b[M]!==O&&P.push(b[M]);b=P},this.length=function(){return b.length}}function L(b,M){if(b){if(b.resizedAttached){b.resizedAttached.add(M);return}b.resizedAttached=new _,b.resizedAttached.add(M),b.resizeSensor=document.createElement("div"),b.resizeSensor.dir="ltr",b.resizeSensor.className="resize-sensor";var E={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},O={position:"absolute",left:"0px",top:"0px",transition:"0s"};s(b.resizeSensor,E);var P=document.createElement("div");P.className="resize-sensor-expand",s(P,E);var D=document.createElement("div");s(D,O),P.appendChild(D);var j=document.createElement("div");j.className="resize-sensor-shrink",s(j,E);var $=document.createElement("div");s($,O),s($,{width:"200%",height:"200%"}),j.appendChild($),b.resizeSensor.appendChild(P),b.resizeSensor.appendChild(j),b.appendChild(b.resizeSensor);var U=window.getComputedStyle(b),tt=U?U.getPropertyValue("position"):null;tt!=="absolute"&&tt!=="relative"&&tt!=="fixed"&&tt!=="sticky"&&(b.style.position="relative");var it=!1,lt=0,rt=a(b),mt=0,Pt=0,Gt=!0;Q=0;var re=function(){var ee=b.offsetWidth,ce=b.offsetHeight;D.style.width=ee+10+"px",D.style.height=ce+10+"px",P.scrollLeft=ee+10,P.scrollTop=ce+10,j.scrollLeft=ee+10,j.scrollTop=ce+10},me=function(){if(Gt){var ee=b.offsetWidth===0&&b.offsetHeight===0;if(ee){Q||(Q=n(function(){Q=0,me()}));return}else Gt=!1}re()};b.resizeSensor.resetSensor=me;var ue=function(){lt=0,it&&(mt=rt.width,Pt=rt.height,b.resizedAttached&&b.resizedAttached.call(rt))},Ke=function(){rt=a(b),it=rt.width!==mt||rt.height!==Pt,it&&!lt&&(lt=n(ue)),me()},Sr=function(ee,ce,be){ee.attachEvent?ee.attachEvent("on"+ce,be):ee.addEventListener(ce,be)};Sr(P,"scroll",Ke),Sr(j,"scroll",Ke),Q=n(function(){Q=0,me()})}}o(f,function(b){L(b,T)}),this.detach=function(b){Q||(i(Q),Q=0),u.detach(f,b)},this.reset=function(){f.resizeSensor.resetSensor()}};if(u.reset=function(f){o(f,function(T){T.resizeSensor.resetSensor()})},u.detach=function(f,T){o(f,function(Q){Q&&(Q.resizedAttached&&typeof T=="function"&&(Q.resizedAttached.remove(T),Q.resizedAttached.length())||Q.resizeSensor&&(Q.contains(Q.resizeSensor)&&Q.removeChild(Q.resizeSensor),delete Q.resizeSensor,delete Q.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(f){for(var T in f)if(f.hasOwnProperty(T))for(var Q=f[T].addedNodes,_=0;_<Q.length;_++)Q[_].resizeSensor&&u.reset(Q[_])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return u})})(BO);var Cst=BO.exports;const Ast=T1t(Cst);var Ost=Object.defineProperty,kst=(t,e,r)=>e in t?Ost(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pt=(t,e,r)=>(kst(t,typeof e!="symbol"?e+"":e,r),r),M_=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},wt=(t,e,r)=>(M_(t,e,"read from private field"),r?r.call(t):e.get(t)),ge=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},nr=(t,e,r,n)=>(M_(t,e,"write to private field"),e.set(t,r),r),we=(t,e,r)=>(M_(t,e,"access private method"),r);function Pst(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function FO(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Q1=function(t){try{return!!t()}catch{return!0}},Ist=Q1,S_=!Ist(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),jO=S_,zO=Function.prototype,H_=zO.call,Vst=jO&&zO.bind.bind(H_,H_),Vo=jO?Vst:function(t){return function(){return H_.apply(t,arguments)}},UO=Vo,Rst=UO({}.toString),Nst=UO("".slice),xc=function(t){return Nst(Rst(t),8,-1)},Dst=Vo,Bst=Q1,Fst=xc,C_=Object,jst=Dst("".split),zst=Bst(function(){return!C_("z").propertyIsEnumerable(0)})?function(t){return Fst(t)==="String"?jst(t,""):C_(t)}:C_,Ec=function(t){return t==null},Ust=Ec,Gst=TypeError,Ld=function(t){if(Ust(t))throw new Gst("Can't call method on "+t);return t},$st=zst,Zst=Ld,V5=function(t){return $st(Zst(t))},Mc=function(t){return t&&t.Math===Math&&t},q1=Mc(typeof globalThis=="object"&&globalThis)||Mc(typeof window=="object"&&window)||Mc(typeof self=="object"&&self)||Mc(typeof I=="object"&&I)||Mc(typeof I=="object"&&I)||function(){return this}()||Function("return this")(),GO={exports:{}},$O=q1,Wst=Object.defineProperty,A_=function(t,e){try{Wst($O,t,{value:e,configurable:!0,writable:!0})}catch{$O[t]=e}return e},qst=q1,Xst=A_,ZO="__core-js_shared__",WO=GO.exports=qst[ZO]||Xst(ZO,{});(WO.versions||(WO.versions=[])).push({version:"3.37.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"});var O_=GO.exports,qO=O_,XO=function(t,e){return qO[t]||(qO[t]=e||{})},Kst=Ld,Yst=Object,KO=function(t){return Yst(Kst(t))},Jst=Vo,t2t=KO,e2t=Jst({}.hasOwnProperty),Rs=Object.hasOwn||function(t,e){return e2t(t2t(t),e)},r2t=Vo,n2t=0,i2t=Math.random(),o2t=r2t(1 .toString),k_=function(t){return"Symbol("+(t===void 0?"":t)+")_"+o2t(++n2t+i2t,36)},a2t=typeof navigator<"u"&&String(navigator.userAgent)||"",YO=q1,P_=a2t,JO=YO.process,tk=YO.Deno,ek=JO&&JO.versions||tk&&tk.version,rk=ek&&ek.v8,rs,wd;rk&&(rs=rk.split("."),wd=rs[0]>0&&rs[0]<4?1:+(rs[0]+rs[1])),!wd&&P_&&(rs=P_.match(/Edge\/(\d+)/),(!rs||rs[1]>=74)&&(rs=P_.match(/Chrome\/(\d+)/),rs&&(wd=+rs[1])));var s2t=wd,nk=s2t,l2t=Q1,c2t=q1,u2t=c2t.String,ik=!!Object.getOwnPropertySymbols&&!l2t(function(){var t=Symbol("symbol detection");return!u2t(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&nk&&nk<41}),h2t=ik,ok=h2t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",d2t=q1,p2t=XO,ak=Rs,f2t=k_,T2t=ik,Q2t=ok,R5=d2t.Symbol,I_=p2t("wks"),m2t=Q2t?R5.for||R5:R5&&R5.withoutSetter||f2t,wa=function(t){return ak(I_,t)||(I_[t]=T2t&&ak(R5,t)?R5[t]:m2t("Symbol."+t)),I_[t]},V_=typeof document=="object"&&document.all,Yo=typeof V_>"u"&&V_!==void 0?function(t){return typeof t=="function"||t===V_}:function(t){return typeof t=="function"},g2t=Yo,xa=function(t){return typeof t=="object"?t!==null:g2t(t)},y2t=xa,_2t=String,v2t=TypeError,s4=function(t){if(y2t(t))return t;throw new v2t(_2t(t)+" is not an object")},sk={},b2t=Q1,ns=!b2t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),L2t=ns,w2t=Q1,lk=L2t&&w2t(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ns={},x2t=q1,ck=xa,R_=x2t.document,E2t=ck(R_)&&ck(R_.createElement),N_=function(t){return E2t?R_.createElement(t):{}},M2t=ns,S2t=Q1,H2t=N_,uk=!M2t&&!S2t(function(){return Object.defineProperty(H2t("div"),"a",{get:function(){return 7}}).a!==7}),C2t=S_,xd=Function.prototype.call,r3=C2t?xd.bind(xd):function(){return xd.apply(xd,arguments)},D_=q1,A2t=Yo,O2t=function(t){return A2t(t)?t:void 0},Sc=function(t,e){return arguments.length<2?O2t(D_[t]):D_[t]&&D_[t][e]},k2t=Vo,B_=k2t({}.isPrototypeOf),P2t=Sc,I2t=Yo,V2t=B_,R2t=ok,N2t=Object,hk=R2t?function(t){return typeof t=="symbol"}:function(t){var e=P2t("Symbol");return I2t(e)&&V2t(e.prototype,N2t(t))},D2t=String,F_=function(t){try{return D2t(t)}catch{return"Object"}},B2t=Yo,F2t=F_,j2t=TypeError,Hc=function(t){if(B2t(t))return t;throw new j2t(F2t(t)+" is not a function")},z2t=Hc,U2t=Ec,j_=function(t,e){var r=t[e];return U2t(r)?void 0:z2t(r)},z_=r3,U_=Yo,G_=xa,G2t=TypeError,$2t=function(t,e){var r,n;if(e==="string"&&U_(r=t.toString)&&!G_(n=z_(r,t))||U_(r=t.valueOf)&&!G_(n=z_(r,t))||e!=="string"&&U_(r=t.toString)&&!G_(n=z_(r,t)))return n;throw new G2t("Can't convert object to primitive value")},Z2t=r3,dk=xa,pk=hk,W2t=j_,q2t=$2t,X2t=wa,K2t=TypeError,Y2t=X2t("toPrimitive"),J2t=function(t,e){if(!dk(t)||pk(t))return t;var r=W2t(t,Y2t),n;if(r){if(e===void 0&&(e="default"),n=Z2t(r,t,e),!dk(n)||pk(n))return n;throw new K2t("Can't convert object to primitive value")}return e===void 0&&(e="number"),q2t(t,e)},t3t=J2t,e3t=hk,fk=function(t){var e=t3t(t,"string");return e3t(e)?e:e+""},r3t=ns,n3t=uk,i3t=lk,Ed=s4,Tk=fk,o3t=TypeError,$_=Object.defineProperty,a3t=Object.getOwnPropertyDescriptor,Z_="enumerable",W_="configurable",q_="writable";Ns.f=r3t?i3t?function(t,e,r){if(Ed(t),e=Tk(e),Ed(r),typeof t=="function"&&e==="prototype"&&"value"in r&&q_ in r&&!r[q_]){var n=a3t(t,e);n&&n[q_]&&(t[e]=r.value,r={configurable:W_ in r?r[W_]:n[W_],enumerable:Z_ in r?r[Z_]:n[Z_],writable:!1})}return $_(t,e,r)}:$_:function(t,e,r){if(Ed(t),e=Tk(e),Ed(r),n3t)try{return $_(t,e,r)}catch{}if("get"in r||"set"in r)throw new o3t("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var s3t=Math.ceil,l3t=Math.floor,c3t=Math.trunc||function(t){var e=+t;return(e>0?l3t:s3t)(e)},u3t=c3t,Md=function(t){var e=+t;return e!==e||e===0?0:u3t(e)},h3t=Md,d3t=Math.max,p3t=Math.min,f3t=function(t,e){var r=h3t(t);return r<0?d3t(r+e,0):p3t(r,e)},T3t=Md,Q3t=Math.min,m3t=function(t){var e=T3t(t);return e>0?Q3t(e,9007199254740991):0},g3t=m3t,Qk=function(t){return g3t(t.length)},y3t=V5,_3t=f3t,v3t=Qk,mk=function(t){return function(e,r,n){var i=y3t(e),o=v3t(i);if(o===0)return!t&&-1;var a=_3t(n,o),s;if(t&&r!==r){for(;o>a;)if(s=i[a++],s!==s)return!0}else for(;o>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},b3t={includes:mk(!0),indexOf:mk(!1)},Sd={},L3t=Vo,X_=Rs,w3t=V5,x3t=b3t.indexOf,E3t=Sd,gk=L3t([].push),yk=function(t,e){var r=w3t(t),n=0,i=[],o;for(o in r)!X_(E3t,o)&&X_(r,o)&&gk(i,o);for(;e.length>n;)X_(r,o=e[n++])&&(~x3t(i,o)||gk(i,o));return i},K_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],M3t=yk,S3t=K_,H3t=Object.keys||function(t){return M3t(t,S3t)},C3t=ns,A3t=lk,O3t=Ns,k3t=s4,P3t=V5,I3t=H3t;sk.f=C3t&&!A3t?Object.defineProperties:function(t,e){k3t(t);for(var r=P3t(e),n=I3t(e),i=n.length,o=0,a;i>o;)O3t.f(t,a=n[o++],r[a]);return t};var V3t=Sc,R3t=V3t("document","documentElement"),N3t=XO,D3t=k_,_k=N3t("keys"),Y_=function(t){return _k[t]||(_k[t]=D3t(t))},B3t=s4,F3t=sk,vk=K_,j3t=Sd,z3t=R3t,U3t=N_,G3t=Y_,bk=">",Lk="<",J_="prototype",tv="script",wk=G3t("IE_PROTO"),ev=function(){},xk=function(t){return Lk+tv+bk+t+Lk+"/"+tv+bk},Ek=function(t){t.write(xk("")),t.close();var e=t.parentWindow.Object;return t=null,e},$3t=function(){var t=U3t("iframe"),e="java"+tv+":",r;return t.style.display="none",z3t.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(xk("document.F=Object")),r.close(),r.F},Hd,Cd=function(){try{Hd=new ActiveXObject("htmlfile")}catch{}Cd=typeof document<"u"?document.domain&&Hd?Ek(Hd):$3t():Ek(Hd);for(var t=vk.length;t--;)delete Cd[J_][vk[t]];return Cd()};j3t[wk]=!0;var rv=Object.create||function(t,e){var r;return t!==null?(ev[J_]=B3t(t),r=new ev,ev[J_]=null,r[wk]=t):r=Cd(),e===void 0?r:F3t.f(r,e)},Z3t=wa,W3t=rv,q3t=Ns.f,nv=Z3t("unscopables"),iv=Array.prototype;iv[nv]===void 0&&q3t(iv,nv,{configurable:!0,value:W3t(null)});var X3t=function(t){iv[nv][t]=!0},Cc={},K3t=q1,Y3t=Yo,Mk=K3t.WeakMap,J3t=Y3t(Mk)&&/native code/.test(String(Mk)),ov=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},t4t=ns,e4t=Ns,r4t=ov,Ad=t4t?function(t,e,r){return e4t.f(t,e,r4t(1,r))}:function(t,e,r){return t[e]=r,t},n4t=J3t,Sk=q1,i4t=xa,o4t=Ad,av=Rs,sv=O_,a4t=Y_,s4t=Sd,Hk="Object already initialized",lv=Sk.TypeError,l4t=Sk.WeakMap,Od,Ac,kd,c4t=function(t){return kd(t)?Ac(t):Od(t,{})},u4t=function(t){return function(e){var r;if(!i4t(e)||(r=Ac(e)).type!==t)throw new lv("Incompatible receiver, "+t+" required");return r}};if(n4t||sv.state){var Ds=sv.state||(sv.state=new l4t);Ds.get=Ds.get,Ds.has=Ds.has,Ds.set=Ds.set,Od=function(t,e){if(Ds.has(t))throw new lv(Hk);return e.facade=t,Ds.set(t,e),e},Ac=function(t){return Ds.get(t)||{}},kd=function(t){return Ds.has(t)}}else{var N5=a4t("state");s4t[N5]=!0,Od=function(t,e){if(av(t,N5))throw new lv(Hk);return e.facade=t,o4t(t,N5,e),e},Ac=function(t){return av(t,N5)?t[N5]:{}},kd=function(t){return av(t,N5)}}var Pd={set:Od,get:Ac,has:kd,enforce:c4t,getterFor:u4t},cv={},Ck={},Ak={}.propertyIsEnumerable,Ok=Object.getOwnPropertyDescriptor,h4t=Ok&&!Ak.call({1:2},1);Ck.f=h4t?function(t){var e=Ok(this,t);return!!e&&e.enumerable}:Ak;var d4t=ns,p4t=r3,f4t=Ck,T4t=ov,Q4t=V5,m4t=fk,g4t=Rs,y4t=uk,kk=Object.getOwnPropertyDescriptor;cv.f=d4t?kk:function(t,e){if(t=Q4t(t),e=m4t(e),y4t)try{return kk(t,e)}catch{}if(g4t(t,e))return T4t(!p4t(f4t.f,t,e),t[e])};var Pk={exports:{}},uv=ns,_4t=Rs,Ik=Function.prototype,v4t=uv&&Object.getOwnPropertyDescriptor,hv=_4t(Ik,"name"),b4t=hv&&(function(){}).name==="something",L4t=hv&&(!uv||uv&&v4t(Ik,"name").configurable),Vk={EXISTS:hv,PROPER:b4t,CONFIGURABLE:L4t},w4t=Vo,x4t=Yo,dv=O_,E4t=w4t(Function.toString);x4t(dv.inspectSource)||(dv.inspectSource=function(t){return E4t(t)});var M4t=dv.inspectSource,pv=Vo,S4t=Q1,H4t=Yo,Id=Rs,fv=ns,C4t=Vk.CONFIGURABLE,A4t=M4t,Rk=Pd,O4t=Rk.enforce,k4t=Rk.get,Nk=String,Vd=Object.defineProperty,P4t=pv("".slice),I4t=pv("".replace),V4t=pv([].join),R4t=fv&&!S4t(function(){return Vd(function(){},"length",{value:8}).length!==8}),N4t=String(String).split("String"),D4t=Pk.exports=function(t,e,r){P4t(Nk(e),0,7)==="Symbol("&&(e="["+I4t(Nk(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Id(t,"name")||C4t&&t.name!==e)&&(fv?Vd(t,"name",{value:e,configurable:!0}):t.name=e),R4t&&r&&Id(r,"arity")&&t.length!==r.arity&&Vd(t,"length",{value:r.arity});try{r&&Id(r,"constructor")&&r.constructor?fv&&Vd(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=O4t(t);return Id(n,"source")||(n.source=V4t(N4t,typeof e=="string"?e:"")),t};Function.prototype.toString=D4t(function(){return H4t(this)&&k4t(this).source||A4t(this)},"toString");var Dk=Pk.exports,B4t=Yo,F4t=Ns,j4t=Dk,z4t=A_,D5=function(t,e,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:e;if(B4t(r)&&j4t(r,o,n),n.global)i?t[e]=r:z4t(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:F4t.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Rd={},U4t=yk,G4t=K_,$4t=G4t.concat("length","prototype");Rd.f=Object.getOwnPropertyNames||function(t){return U4t(t,$4t)};var Bk={};Bk.f=Object.getOwnPropertySymbols;var Z4t=Sc,W4t=Vo,q4t=Rd,X4t=Bk,K4t=s4,Y4t=W4t([].concat),J4t=Z4t("Reflect","ownKeys")||function(t){var e=q4t.f(K4t(t)),r=X4t.f;return r?Y4t(e,r(t)):e},Fk=Rs,t6t=J4t,e6t=cv,r6t=Ns,n6t=function(t,e,r){for(var n=t6t(e),i=r6t.f,o=e6t.f,a=0;a<n.length;a++){var s=n[a];!Fk(t,s)&&!(r&&Fk(r,s))&&i(t,s,o(e,s))}},i6t=Q1,o6t=Yo,a6t=/#|\.prototype\./,Oc=function(t,e){var r=l6t[s6t(t)];return r===u6t?!0:r===c6t?!1:o6t(e)?i6t(e):!!e},s6t=Oc.normalize=function(t){return String(t).replace(a6t,".").toLowerCase()},l6t=Oc.data={},c6t=Oc.NATIVE="N",u6t=Oc.POLYFILL="P",jk=Oc,Nd=q1,h6t=cv.f,d6t=Ad,p6t=D5,f6t=A_,T6t=n6t,Q6t=jk,Bs=function(t,e){var r=t.target,n=t.global,i=t.stat,o,a,s,u,d,f;if(n?a=Nd:i?a=Nd[r]||f6t(r,{}):a=Nd[r]&&Nd[r].prototype,a)for(s in e){if(d=e[s],t.dontCallGetSet?(f=h6t(a,s),u=f&&f.value):u=a[s],o=Q6t(n?s:r+(i?".":"#")+s,t.forced),!o&&u!==void 0){if(typeof d==typeof u)continue;T6t(d,u)}(t.sham||u&&u.sham)&&d6t(d,"sham",!0),p6t(a,s,d,t)}},m6t=Q1,g6t=!m6t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),y6t=Rs,_6t=Yo,v6t=KO,b6t=Y_,L6t=g6t,zk=b6t("IE_PROTO"),Tv=Object,w6t=Tv.prototype,Uk=L6t?Tv.getPrototypeOf:function(t){var e=v6t(t);if(y6t(e,zk))return e[zk];var r=e.constructor;return _6t(r)&&e instanceof r?r.prototype:e instanceof Tv?w6t:null},x6t=Q1,E6t=Yo,M6t=xa,Gk=Uk,S6t=D5,H6t=wa,Qv=H6t("iterator"),$k=!1,z6,mv,gv;[].keys&&(gv=[].keys(),"next"in gv?(mv=Gk(Gk(gv)),mv!==Object.prototype&&(z6=mv)):$k=!0);var C6t=!M6t(z6)||x6t(function(){var t={};return z6[Qv].call(t)!==t});C6t&&(z6={}),E6t(z6[Qv])||S6t(z6,Qv,function(){return this});var Zk={IteratorPrototype:z6,BUGGY_SAFARI_ITERATORS:$k},A6t=Ns.f,O6t=Rs,k6t=wa,Wk=k6t("toStringTag"),Dd=function(t,e,r){t&&!r&&(t=t.prototype),t&&!O6t(t,Wk)&&A6t(t,Wk,{configurable:!0,value:e})},P6t=Zk.IteratorPrototype,I6t=rv,V6t=ov,R6t=Dd,N6t=Cc,D6t=function(){return this},B6t=function(t,e,r,n){var i=e+" Iterator";return t.prototype=I6t(P6t,{next:V6t(+!n,r)}),R6t(t,i,!1),N6t[i]=D6t,t},F6t=Vo,j6t=Hc,qk=function(t,e,r){try{return F6t(j6t(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},z6t=xa,U6t=function(t){return z6t(t)||t===null},G6t=U6t,$6t=String,Z6t=TypeError,W6t=function(t){if(G6t(t))return t;throw new Z6t("Can't set "+$6t(t)+" as a prototype")},q6t=qk,X6t=xa,K6t=Ld,Y6t=W6t,Xk=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=q6t(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(n,i){return K6t(n),Y6t(i),X6t(n)&&(t?r(n,i):n.__proto__=i),n}}():void 0),J6t=Bs,t0t=r3,Kk=Vk,e0t=Yo,r0t=B6t,Yk=Uk,Jk=Xk,n0t=Dd,i0t=Ad,yv=D5,o0t=wa,a0t=Cc,tP=Zk,s0t=Kk.PROPER,l0t=Kk.CONFIGURABLE,eP=tP.IteratorPrototype,Bd=tP.BUGGY_SAFARI_ITERATORS,kc=o0t("iterator"),rP="keys",Pc="values",nP="entries",c0t=function(){return this},_v=function(t,e,r,n,i,o,a){r0t(r,e,n);var s=function(E){if(E===i&&Q)return Q;if(!Bd&&E&&E in f)return f[E];switch(E){case rP:return function(){return new r(this,E)};case Pc:return function(){return new r(this,E)};case nP:return function(){return new r(this,E)}}return function(){return new r(this)}},u=e+" Iterator",d=!1,f=t.prototype,T=f[kc]||f["@@iterator"]||i&&f[i],Q=!Bd&&T||s(i),_=e==="Array"&&f.entries||T,L,b,M;if(_&&(L=Yk(_.call(new t)),L!==Object.prototype&&L.next&&(Yk(L)!==eP&&(Jk?Jk(L,eP):e0t(L[kc])||yv(L,kc,c0t)),n0t(L,u,!0))),s0t&&i===Pc&&T&&T.name!==Pc&&(l0t?i0t(f,"name",Pc):(d=!0,Q=function(){return t0t(T,this)})),i)if(b={values:s(Pc),keys:o?Q:s(rP),entries:s(nP)},a)for(M in b)(Bd||d||!(M in f))&&yv(f,M,b[M]);else J6t({target:e,proto:!0,forced:Bd||d},b);return f[kc]!==Q&&yv(f,kc,Q,{name:i}),a0t[e]=Q,b},vv=function(t,e){return{value:t,done:e}},u0t=V5,bv=X3t,iP=Cc,oP=Pd,h0t=Ns.f,d0t=_v,Fd=vv,p0t=ns,aP="Array Iterator",f0t=oP.set,T0t=oP.getterFor(aP),Q0t=d0t(Array,"Array",function(t,e){f0t(this,{type:aP,target:u0t(t),index:0,kind:e})},function(){var t=T0t(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,Fd(void 0,!0);switch(t.kind){case"keys":return Fd(r,!1);case"values":return Fd(e[r],!1)}return Fd([r,e[r]],!1)},"values"),sP=iP.Arguments=iP.Array;if(bv("keys"),bv("values"),bv("entries"),p0t&&sP.name!=="values")try{h0t(sP,"name",{value:"values"})}catch{}var m0t=wa,g0t=m0t("toStringTag"),lP={};lP[g0t]="z";var Lv=String(lP)==="[object z]",y0t=Lv,_0t=Yo,jd=xc,v0t=wa,b0t=v0t("toStringTag"),L0t=Object,w0t=jd(function(){return arguments}())==="Arguments",x0t=function(t,e){try{return t[e]}catch{}},wv=y0t?jd:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=x0t(e=L0t(t),b0t))=="string"?r:w0t?jd(e):(n=jd(e))==="Object"&&_0t(e.callee)?"Arguments":n},E0t=Lv,M0t=wv,S0t=E0t?{}.toString:function(){return"[object "+M0t(this)+"]"},H0t=Lv,C0t=D5,A0t=S0t;H0t||C0t(Object.prototype,"toString",A0t,{unsafe:!0});var cP={exports:{}},uP={},O0t=Vo,k0t=O0t([].slice),P0t=xc,I0t=V5,hP=Rd.f,V0t=k0t,dP=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],R0t=function(t){try{return hP(t)}catch{return V0t(dP)}};uP.f=function(t){return dP&&P0t(t)==="Window"?R0t(t):hP(I0t(t))};var N0t=Q1,D0t=N0t(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),B0t=Q1,F0t=xa,j0t=xc,pP=D0t,zd=Object.isExtensible,z0t=B0t(function(){zd(1)}),U0t=z0t||pP?function(t){return!F0t(t)||pP&&j0t(t)==="ArrayBuffer"?!1:zd?zd(t):!0}:zd,G0t=Q1,$0t=!G0t(function(){return Object.isExtensible(Object.preventExtensions({}))}),Z0t=Bs,W0t=Vo,q0t=Sd,X0t=xa,xv=Rs,K0t=Ns.f,fP=Rd,Y0t=uP,Ev=U0t,J0t=k_,t5t=$0t,TP=!1,n3=J0t("meta"),e5t=0,Mv=function(t){K0t(t,n3,{value:{objectID:"O"+e5t++,weakData:{}}})},r5t=function(t,e){if(!X0t(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!xv(t,n3)){if(!Ev(t))return"F";if(!e)return"E";Mv(t)}return t[n3].objectID},n5t=function(t,e){if(!xv(t,n3)){if(!Ev(t))return!0;if(!e)return!1;Mv(t)}return t[n3].weakData},i5t=function(t){return t5t&&TP&&Ev(t)&&!xv(t,n3)&&Mv(t),t},o5t=function(){a5t.enable=function(){},TP=!0;var t=fP.f,e=W0t([].splice),r={};r[n3]=1,t(r).length&&(fP.f=function(n){for(var i=t(n),o=0,a=i.length;o<a;o++)if(i[o]===n3){e(i,o,1);break}return i},Z0t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Y0t.f}))},a5t=cP.exports={enable:o5t,fastKey:r5t,getWeakData:n5t,onFreeze:i5t};q0t[n3]=!0;var QP=cP.exports,s5t=xc,l5t=Vo,c5t=function(t){if(s5t(t)==="Function")return l5t(t)},mP=c5t,u5t=Hc,h5t=S_,d5t=mP(mP.bind),gP=function(t,e){return u5t(t),e===void 0?t:h5t?d5t(t,e):function(){return t.apply(e,arguments)}},p5t=wa,f5t=Cc,T5t=p5t("iterator"),Q5t=Array.prototype,m5t=function(t){return t!==void 0&&(f5t.Array===t||Q5t[T5t]===t)},g5t=wv,yP=j_,y5t=Ec,_5t=Cc,v5t=wa,b5t=v5t("iterator"),_P=function(t){if(!y5t(t))return yP(t,b5t)||yP(t,"@@iterator")||_5t[g5t(t)]},L5t=r3,w5t=Hc,x5t=s4,E5t=F_,M5t=_P,S5t=TypeError,H5t=function(t,e){var r=arguments.length<2?M5t(t):e;if(w5t(r))return x5t(L5t(r,t));throw new S5t(E5t(t)+" is not iterable")},C5t=r3,vP=s4,A5t=j_,Sv=function(t,e,r){var n,i;vP(t);try{if(n=A5t(t,"return"),!n){if(e==="throw")throw r;return r}n=C5t(n,t)}catch(o){i=!0,n=o}if(e==="throw")throw r;if(i)throw n;return vP(n),r},O5t=gP,k5t=r3,P5t=s4,I5t=F_,V5t=m5t,R5t=Qk,bP=B_,N5t=H5t,D5t=_P,LP=Sv,B5t=TypeError,Ud=function(t,e){this.stopped=t,this.result=e},wP=Ud.prototype,xP=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),o=!!(r&&r.IS_RECORD),a=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=O5t(e,n),d,f,T,Q,_,L,b,M=function(O){return d&&LP(d,"normal",O),new Ud(!0,O)},E=function(O){return i?(P5t(O),s?u(O[0],O[1],M):u(O[0],O[1])):s?u(O,M):u(O)};if(o)d=t.iterator;else if(a)d=t;else{if(f=D5t(t),!f)throw new B5t(I5t(t)+" is not iterable");if(V5t(f)){for(T=0,Q=R5t(t);Q>T;T++)if(_=E(t[T]),_&&bP(wP,_))return _;return new Ud(!1)}d=N5t(t,f)}for(L=o?t.next:d.next;!(b=k5t(L,d)).done;){try{_=E(b.value)}catch(O){LP(d,"throw",O)}if(typeof _=="object"&&_&&bP(wP,_))return _}return new Ud(!1)},F5t=B_,j5t=TypeError,EP=function(t,e){if(F5t(e,t))return t;throw new j5t("Incorrect invocation")},z5t=wa,MP=z5t("iterator"),SP=!1;try{var U5t=0,HP={next:function(){return{done:!!U5t++}},return:function(){SP=!0}};HP[MP]=function(){return this},Array.from(HP,function(){throw 2})}catch{}var G5t=function(t,e){try{if(!e&&!SP)return!1}catch{return!1}var r=!1;try{var n={};n[MP]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},$5t=Yo,Z5t=xa,CP=Xk,W5t=function(t,e,r){var n,i;return CP&&$5t(n=e.constructor)&&n!==r&&Z5t(i=n.prototype)&&i!==r.prototype&&CP(t,i),t},q5t=Bs,X5t=q1,K5t=Vo,AP=jk,Y5t=D5,J5t=QP,tlt=xP,elt=EP,rlt=Yo,nlt=Ec,Hv=xa,Cv=Q1,ilt=G5t,olt=Dd,alt=W5t,slt=function(t,e,r){var n=t.indexOf("Map")!==-1,i=t.indexOf("Weak")!==-1,o=n?"set":"add",a=X5t[t],s=a&&a.prototype,u=a,d={},f=function(E){var O=K5t(s[E]);Y5t(s,E,E==="add"?function(P){return O(this,P===0?0:P),this}:E==="delete"?function(P){return i&&!Hv(P)?!1:O(this,P===0?0:P)}:E==="get"?function(P){return i&&!Hv(P)?void 0:O(this,P===0?0:P)}:E==="has"?function(P){return i&&!Hv(P)?!1:O(this,P===0?0:P)}:function(P,D){return O(this,P===0?0:P,D),this})},T=AP(t,!rlt(a)||!(i||s.forEach&&!Cv(function(){new a().entries().next()})));if(T)u=r.getConstructor(e,t,n,o),J5t.enable();else if(AP(t,!0)){var Q=new u,_=Q[o](i?{}:-0,1)!==Q,L=Cv(function(){Q.has(1)}),b=ilt(function(E){new a(E)}),M=!i&&Cv(function(){for(var E=new a,O=5;O--;)E[o](O,O);return!E.has(-0)});b||(u=e(function(E,O){elt(E,s);var P=alt(new a,E,u);return nlt(O)||tlt(O,P[o],{that:P,AS_ENTRIES:n}),P}),u.prototype=s,s.constructor=u),(L||M)&&(f("delete"),f("has"),n&&f("get")),(M||_)&&f(o),i&&s.clear&&delete s.clear}return d[t]=u,q5t({global:!0,constructor:!0,forced:u!==a},d),olt(u,t),i||r.setStrong(u,t,n),u},OP=Dk,llt=Ns,kP=function(t,e,r){return r.get&&OP(r.get,e,{getter:!0}),r.set&&OP(r.set,e,{setter:!0}),llt.f(t,e,r)},clt=D5,ult=function(t,e,r){for(var n in e)clt(t,n,e[n],r);return t},hlt=Sc,dlt=kP,plt=wa,flt=ns,PP=plt("species"),Tlt=function(t){var e=hlt(t);flt&&e&&!e[PP]&&dlt(e,PP,{configurable:!0,get:function(){return this}})},IP=rv,Qlt=kP,VP=ult,mlt=gP,glt=EP,ylt=Ec,_lt=xP,vlt=_v,RP=vv,blt=Tlt,Ic=ns,NP=QP.fastKey,DP=Pd,BP=DP.set,Av=DP.getterFor,Llt={getConstructor:function(t,e,r,n){var i=t(function(d,f){glt(d,o),BP(d,{type:e,index:IP(null),first:void 0,last:void 0,size:0}),Ic||(d.size=0),ylt(f)||_lt(f,d[n],{that:d,AS_ENTRIES:r})}),o=i.prototype,a=Av(e),s=function(d,f,T){var Q=a(d),_=u(d,f),L,b;return _?_.value=T:(Q.last=_={index:b=NP(f,!0),key:f,value:T,previous:L=Q.last,next:void 0,removed:!1},Q.first||(Q.first=_),L&&(L.next=_),Ic?Q.size++:d.size++,b!=="F"&&(Q.index[b]=_)),d},u=function(d,f){var T=a(d),Q=NP(f),_;if(Q!=="F")return T.index[Q];for(_=T.first;_;_=_.next)if(_.key===f)return _};return VP(o,{clear:function(){for(var d=this,f=a(d),T=f.first;T;)T.removed=!0,T.previous&&(T.previous=T.previous.next=void 0),T=T.next;f.first=f.last=void 0,f.index=IP(null),Ic?f.size=0:d.size=0},delete:function(d){var f=this,T=a(f),Q=u(f,d);if(Q){var _=Q.next,L=Q.previous;delete T.index[Q.index],Q.removed=!0,L&&(L.next=_),_&&(_.previous=L),T.first===Q&&(T.first=_),T.last===Q&&(T.last=L),Ic?T.size--:f.size--}return!!Q},forEach:function(d){for(var f=a(this),T=mlt(d,arguments.length>1?arguments[1]:void 0),Q;Q=Q?Q.next:f.first;)for(T(Q.value,Q.key,this);Q&&Q.removed;)Q=Q.previous},has:function(d){return!!u(this,d)}}),VP(o,r?{get:function(d){var f=u(this,d);return f&&f.value},set:function(d,f){return s(this,d===0?0:d,f)}}:{add:function(d){return s(this,d=d===0?0:d,d)}}),Ic&&Qlt(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Av(e),o=Av(n);vlt(t,e,function(a,s){BP(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,u=a.last;u&&u.removed;)u=u.previous;return!a.target||!(a.last=u=u?u.next:a.state.first)?(a.target=void 0,RP(void 0,!0)):RP(s==="keys"?u.key:s==="values"?u.value:[u.key,u.value],!1)},r?"entries":"values",!r,!0),blt(e)}},wlt=slt,xlt=Llt;wlt("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},xlt);var Ov=Vo,Gd=Set.prototype,Fs={Set,add:Ov(Gd.add),has:Ov(Gd.has),remove:Ov(Gd.delete),proto:Gd},Elt=Fs.has,U6=function(t){return Elt(t),t},Mlt=r3,G6=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,o,a;!(o=Mlt(i,n)).done;)if(a=e(o.value),a!==void 0)return a},FP=Vo,Slt=G6,jP=Fs,Hlt=jP.Set,zP=jP.proto,Clt=FP(zP.forEach),UP=FP(zP.keys),Alt=UP(new Hlt).next,Vc=function(t,e,r){return r?Slt({iterator:UP(t),next:Alt},e):Clt(t,e)},GP=Fs,Olt=Vc,klt=GP.Set,Plt=GP.add,kv=function(t){var e=new klt;return Olt(t,function(r){Plt(e,r)}),e},Ilt=qk,Vlt=Fs,Rc=Ilt(Vlt.proto,"size","get")||function(t){return t.size},Rlt=function(t){return{iterator:t,next:t.next,done:!1}},$P=Hc,ZP=s4,WP=r3,Nlt=Md,Dlt=Rlt,qP="Invalid size",Blt=RangeError,Flt=TypeError,jlt=Math.max,XP=function(t,e){this.set=t,this.size=jlt(e,0),this.has=$P(t.has),this.keys=$P(t.keys)};XP.prototype={getIterator:function(){return Dlt(ZP(WP(this.keys,this.set)))},includes:function(t){return WP(this.has,this.set,t)}};var $6=function(t){ZP(t);var e=+t.size;if(e!==e)throw new Flt(qP);var r=Nlt(e);if(r<0)throw new Blt(qP);return new XP(t,r)},zlt=U6,KP=Fs,Ult=kv,Glt=Rc,$lt=$6,Zlt=Vc,Wlt=G6,qlt=KP.has,YP=KP.remove,Xlt=function(t){var e=zlt(this),r=$lt(t),n=Ult(e);return Glt(e)<=r.size?Zlt(e,function(i){r.includes(i)&&YP(n,i)}):Wlt(r.getIterator(),function(i){qlt(e,i)&&YP(n,i)}),n},Klt=Sc,JP=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Z6=function(t){var e=Klt("Set");try{new e()[t](JP(0));try{return new e()[t](JP(-1)),!1}catch{return!0}}catch{return!1}},Ylt=Bs,Jlt=Xlt,t7t=Z6;Ylt({target:"Set",proto:!0,real:!0,forced:!t7t("difference")},{difference:Jlt});var e7t=U6,Pv=Fs,r7t=Rc,n7t=$6,i7t=Vc,o7t=G6,a7t=Pv.Set,tI=Pv.add,s7t=Pv.has,l7t=function(t){var e=e7t(this),r=n7t(t),n=new a7t;return r7t(e)>r.size?o7t(r.getIterator(),function(i){s7t(e,i)&&tI(n,i)}):i7t(e,function(i){r.includes(i)&&tI(n,i)}),n},c7t=Bs,u7t=Q1,h7t=l7t,d7t=Z6,p7t=!d7t("intersection")||u7t(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});c7t({target:"Set",proto:!0,real:!0,forced:p7t},{intersection:h7t});var f7t=U6,T7t=Fs.has,Q7t=Rc,m7t=$6,g7t=Vc,y7t=G6,_7t=Sv,v7t=function(t){var e=f7t(this),r=m7t(t);if(Q7t(e)<=r.size)return g7t(e,function(i){if(r.includes(i))return!1},!0)!==!1;var n=r.getIterator();return y7t(n,function(i){if(T7t(e,i))return _7t(n,"normal",!1)})!==!1},b7t=Bs,L7t=v7t,w7t=Z6;b7t({target:"Set",proto:!0,real:!0,forced:!w7t("isDisjointFrom")},{isDisjointFrom:L7t});var x7t=U6,E7t=Rc,M7t=Vc,S7t=$6,H7t=function(t){var e=x7t(this),r=S7t(t);return E7t(e)>r.size?!1:M7t(e,function(n){if(!r.includes(n))return!1},!0)!==!1},C7t=Bs,A7t=H7t,O7t=Z6;C7t({target:"Set",proto:!0,real:!0,forced:!O7t("isSubsetOf")},{isSubsetOf:A7t});var k7t=U6,P7t=Fs.has,I7t=Rc,V7t=$6,R7t=G6,N7t=Sv,D7t=function(t){var e=k7t(this),r=V7t(t);if(I7t(e)<r.size)return!1;var n=r.getIterator();return R7t(n,function(i){if(!P7t(e,i))return N7t(n,"normal",!1)})!==!1},B7t=Bs,F7t=D7t,j7t=Z6;B7t({target:"Set",proto:!0,real:!0,forced:!j7t("isSupersetOf")},{isSupersetOf:F7t});var z7t=U6,Iv=Fs,U7t=kv,G7t=$6,$7t=G6,Z7t=Iv.add,W7t=Iv.has,q7t=Iv.remove,X7t=function(t){var e=z7t(this),r=G7t(t).getIterator(),n=U7t(e);return $7t(r,function(i){W7t(e,i)?q7t(n,i):Z7t(n,i)}),n},K7t=Bs,Y7t=X7t,J7t=Z6;K7t({target:"Set",proto:!0,real:!0,forced:!J7t("symmetricDifference")},{symmetricDifference:Y7t});var tct=U6,ect=Fs.add,rct=kv,nct=$6,ict=G6,oct=function(t){var e=tct(this),r=nct(t).getIterator(),n=rct(e);return ict(r,function(i){ect(n,i)}),n},act=Bs,sct=oct,lct=Z6;act({target:"Set",proto:!0,real:!0,forced:!lct("union")},{union:sct});var cct=wv,uct=String,eI=function(t){if(cct(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return uct(t)},Vv=Vo,hct=Md,dct=eI,pct=Ld,fct=Vv("".charAt),rI=Vv("".charCodeAt),Tct=Vv("".slice),nI=function(t){return function(e,r){var n=dct(pct(e)),i=hct(r),o=n.length,a,s;return i<0||i>=o?t?"":void 0:(a=rI(n,i),a<55296||a>56319||i+1===o||(s=rI(n,i+1))<56320||s>57343?t?fct(n,i):a:t?Tct(n,i,i+2):(a-55296<<10)+(s-56320)+65536)}},Qct={codeAt:nI(!1),charAt:nI(!0)},mct=Qct.charAt,gct=eI,iI=Pd,yct=_v,oI=vv,aI="String Iterator",_ct=iI.set,vct=iI.getterFor(aI);yct(String,"String",function(t){_ct(this,{type:aI,string:gct(t),index:0})},function(){var t=vct(this),e=t.string,r=t.index,n;return r>=e.length?oI(void 0,!0):(n=mct(e,r),t.index+=n.length,oI(n,!1))});var bct=q1,Lct=bct,wct=Lct,xct=wct.Set,Ect={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Mct=N_,Rv=Mct("span").classList,sI=Rv&&Rv.constructor&&Rv.constructor.prototype,Sct=sI===Object.prototype?void 0:sI,lI=q1,cI=Ect,Hct=Sct,Nc=Q0t,uI=Ad,Cct=Dd,Act=wa,Nv=Act("iterator"),Dv=Nc.values,hI=function(t,e){if(t){if(t[Nv]!==Dv)try{uI(t,Nv,Dv)}catch{t[Nv]=Dv}if(Cct(t,e,!0),cI[e]){for(var r in Nc)if(t[r]!==Nc[r])try{uI(t,r,Nc[r])}catch{t[r]=Nc[r]}}}};for(var Bv in cI)hI(lI[Bv]&&lI[Bv].prototype,Bv);hI(Hct,"DOMTokenList");var Oct=xct,kct=Oct,Pct=kct,Ict=Pct;const Dc=e3(Ict);var dI={exports:{}};/**
34
34
  * MapLibre GL JS
35
35
  * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.5.2/LICENSE.txt
36
36
  */(function(t,e){(function(r,n){t.exports=n()})(I,function(){var r={},n={};function i(a,s,u){if(n[a]=u,a==="index"){var d="var sharedModule = {}; ("+n.shared+")(sharedModule); ("+n.worker+")(sharedModule);",f={};return n.shared(f),n.index(r,f),typeof window<"u"&&r.setWorkerUrl(window.URL.createObjectURL(new Blob([d],{type:"text/javascript"}))),r}}i("shared",["exports"],function(a){function s(h,l,p,g){return new(p||(p=Promise))(function(x,C){function A(z){try{N(g.next(z))}catch(q){C(q)}}function k(z){try{N(g.throw(z))}catch(q){C(q)}}function N(z){var q;z.done?x(z.value):(q=z.value,q instanceof p?q:new p(function(K){K(q)})).then(A,k)}N((g=g.apply(h,l||[])).next())})}function u(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}typeof SuppressedError=="function"&&SuppressedError;var d=f;function f(h,l){this.x=h,this.y=l}f.prototype={clone:function(){return new f(this.x,this.y)},add:function(h){return this.clone()._add(h)},sub:function(h){return this.clone()._sub(h)},multByPoint:function(h){return this.clone()._multByPoint(h)},divByPoint:function(h){return this.clone()._divByPoint(h)},mult:function(h){return this.clone()._mult(h)},div:function(h){return this.clone()._div(h)},rotate:function(h){return this.clone()._rotate(h)},rotateAround:function(h,l){return this.clone()._rotateAround(h,l)},matMult:function(h){return this.clone()._matMult(h)},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(h){return this.x===h.x&&this.y===h.y},dist:function(h){return Math.sqrt(this.distSqr(h))},distSqr:function(h){var l=h.x-this.x,p=h.y-this.y;return l*l+p*p},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(h){return Math.atan2(this.y-h.y,this.x-h.x)},angleWith:function(h){return this.angleWithSep(h.x,h.y)},angleWithSep:function(h,l){return Math.atan2(this.x*l-this.y*h,this.x*h+this.y*l)},_matMult:function(h){var l=h[2]*this.x+h[3]*this.y;return this.x=h[0]*this.x+h[1]*this.y,this.y=l,this},_add:function(h){return this.x+=h.x,this.y+=h.y,this},_sub:function(h){return this.x-=h.x,this.y-=h.y,this},_mult:function(h){return this.x*=h,this.y*=h,this},_div:function(h){return this.x/=h,this.y/=h,this},_multByPoint:function(h){return this.x*=h.x,this.y*=h.y,this},_divByPoint:function(h){return this.x/=h.x,this.y/=h.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var h=this.y;return this.y=this.x,this.x=-h,this},_rotate:function(h){var l=Math.cos(h),p=Math.sin(h),g=p*this.x+l*this.y;return this.x=l*this.x-p*this.y,this.y=g,this},_rotateAround:function(h,l){var p=Math.cos(h),g=Math.sin(h),x=l.y+g*(this.x-l.x)+p*(this.y-l.y);return this.x=l.x+p*(this.x-l.x)-g*(this.y-l.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},f.convert=function(h){return h instanceof f?h:Array.isArray(h)?new f(h[0],h[1]):h};var T=u(d),Q=_;function _(h,l,p,g){this.cx=3*h,this.bx=3*(p-h)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(g-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=h,this.p1y=l,this.p2x=p,this.p2y=g}_.prototype={sampleCurveX:function(h){return((this.ax*h+this.bx)*h+this.cx)*h},sampleCurveY:function(h){return((this.ay*h+this.by)*h+this.cy)*h},sampleCurveDerivativeX:function(h){return(3*this.ax*h+2*this.bx)*h+this.cx},solveCurveX:function(h,l){if(l===void 0&&(l=1e-6),h<0)return 0;if(h>1)return 1;for(var p=h,g=0;g<8;g++){var x=this.sampleCurveX(p)-h;if(Math.abs(x)<l)return p;var C=this.sampleCurveDerivativeX(p);if(Math.abs(C)<1e-6)break;p-=x/C}var A=0,k=1;for(p=h,g=0;g<20&&(x=this.sampleCurveX(p),!(Math.abs(x-h)<l));g++)h>x?A=p:k=p,p=.5*(k-A)+A;return p},solve:function(h,l){return this.sampleCurveY(this.solveCurveX(h,l))}};var L=u(Q);let b,M;function E(){return b==null&&(b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),b}function O(){if(M==null&&(M=!1,E())){const h=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(h){for(let p=0;p<5*5;p++){const g=4*p;h.fillStyle=`rgb(${g},${g+1},${g+2})`,h.fillRect(p%5,Math.floor(p/5),1,1)}const l=h.getImageData(0,0,5,5).data;for(let p=0;p<5*5*4;p++)if(p%4!=3&&l[p]!==p){M=!0;break}}}return M||!1}function P(h,l,p,g){const x=new L(h,l,p,g);return C=>x.solve(C)}const D=P(.25,.1,.25,1);function j(h,l,p){return Math.min(p,Math.max(l,h))}function $(h,l,p){const g=p-l,x=((h-l)%g+g)%g+l;return x===l?p:x}function U(h,...l){for(const p of l)for(const g in p)h[g]=p[g];return h}let tt=1;function it(h,l,p){const g={};for(const x in h)g[x]=l.call(this,h[x],x,h);return g}function lt(h,l,p){const g={};for(const x in h)l.call(this,h[x],x,h)&&(g[x]=h[x]);return g}function rt(h){return Array.isArray(h)?h.map(rt):typeof h=="object"&&h?it(h,rt):h}const mt={};function Pt(h){mt[h]||(typeof console<"u"&&console.warn(h),mt[h]=!0)}function Gt(h,l,p){return(p.y-h.y)*(l.x-h.x)>(l.y-h.y)*(p.x-h.x)}function re(h){return typeof WorkerGlobalScope<"u"&&h!==void 0&&h instanceof WorkerGlobalScope}let me=null;function ue(h){return typeof ImageBitmap<"u"&&h instanceof ImageBitmap}const Ke="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Sr(h,l,p,g,x){return s(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const C=new VideoFrame(h,{timestamp:0});try{const A=C==null?void 0:C.format;if(!A||!A.startsWith("BGR")&&!A.startsWith("RGB"))throw new Error(`Unrecognized format ${A}`);const k=A.startsWith("BGR"),N=new Uint8ClampedArray(g*x*4);if(yield C.copyTo(N,function(z,q,K,et,st){const ut=4*Math.max(-q,0),Tt=(Math.max(0,K)-K)*et*4+ut,Lt=4*et,St=Math.max(0,q),$t=Math.max(0,K);return{rect:{x:St,y:$t,width:Math.min(z.width,q+et)-St,height:Math.min(z.height,K+st)-$t},layout:[{offset:Tt,stride:Lt}]}}(h,l,p,g,x)),k)for(let z=0;z<N.length;z+=4){const q=N[z];N[z]=N[z+2],N[z+2]=q}return N}finally{C.close()}})}let ee,ce;const be="AbortError";function Se(){return new Error(be)}const $e={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Ge(h){return $e.REGISTERED_PROTOCOLS[h.substring(0,h.indexOf("://"))]}const We="global-dispatcher";class zt extends Error{constructor(l,p,g,x){super(`AJAXError: ${p} (${l}): ${g}`),this.status=l,this.statusText=p,this.url=g,this.body=x}}const Kt=()=>re(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,pe=function(h,l){if(/:\/\//.test(h.url)&&!/^https?:|^file:/.test(h.url)){const g=Ge(h.url);if(g)return g(h,l);if(re(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:h,targetMapId:We},l)}if(!(/^file:/.test(p=h.url)||/^file:/.test(Kt())&&!/^\w+:/.test(p))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(g,x){return s(this,void 0,void 0,function*(){const C=new Request(g.url,{method:g.method||"GET",body:g.body,credentials:g.credentials,headers:g.headers,cache:g.cache,referrer:Kt(),signal:x.signal});g.type!=="json"||C.headers.has("Accept")||C.headers.set("Accept","application/json");const A=yield fetch(C);if(!A.ok){const z=yield A.blob();throw new zt(A.status,A.statusText,g.url,z)}let k;k=g.type==="arrayBuffer"||g.type==="image"?A.arrayBuffer():g.type==="json"?A.json():A.text();const N=yield k;if(x.signal.aborted)throw Se();return{data:N,cacheControl:A.headers.get("Cache-Control"),expires:A.headers.get("Expires")}})}(h,l);if(re(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:h,mustQueue:!0,targetMapId:We},l)}var p;return function(g,x){return new Promise((C,A)=>{var k;const N=new XMLHttpRequest;N.open(g.method||"GET",g.url,!0),g.type!=="arrayBuffer"&&g.type!=="image"||(N.responseType="arraybuffer");for(const z in g.headers)N.setRequestHeader(z,g.headers[z]);g.type==="json"&&(N.responseType="text",!((k=g.headers)===null||k===void 0)&&k.Accept||N.setRequestHeader("Accept","application/json")),N.withCredentials=g.credentials==="include",N.onerror=()=>{A(new Error(N.statusText))},N.onload=()=>{if(!x.signal.aborted)if((N.status>=200&&N.status<300||N.status===0)&&N.response!==null){let z=N.response;if(g.type==="json")try{z=JSON.parse(N.response)}catch(q){return void A(q)}C({data:z,cacheControl:N.getResponseHeader("Cache-Control"),expires:N.getResponseHeader("Expires")})}else{const z=new Blob([N.response],{type:N.getResponseHeader("Content-Type")});A(new zt(N.status,N.statusText,g.url,z))}},x.signal.addEventListener("abort",()=>{N.abort(),A(Se())}),N.send(g.body)})}(h,l)};function ae(h){if(!h||h.indexOf("://")<=0||h.indexOf("data:image/")===0||h.indexOf("blob:")===0)return!0;const l=new URL(h),p=window.location;return l.protocol===p.protocol&&l.host===p.host}function Ce(h,l,p){p[h]&&p[h].indexOf(l)!==-1||(p[h]=p[h]||[],p[h].push(l))}function er(h,l,p){if(p&&p[h]){const g=p[h].indexOf(l);g!==-1&&p[h].splice(g,1)}}class Pe{constructor(l,p={}){U(this,p),this.type=l}}class Ve extends Pe{constructor(l,p={}){super("error",U({error:l},p))}}class Je{on(l,p){return this._listeners=this._listeners||{},Ce(l,p,this._listeners),this}off(l,p){return er(l,p,this._listeners),er(l,p,this._oneTimeListeners),this}once(l,p){return p?(this._oneTimeListeners=this._oneTimeListeners||{},Ce(l,p,this._oneTimeListeners),this):new Promise(g=>this.once(l,g))}fire(l,p){typeof l=="string"&&(l=new Pe(l,p||{}));const g=l.type;if(this.listens(g)){l.target=this;const x=this._listeners&&this._listeners[g]?this._listeners[g].slice():[];for(const k of x)k.call(this,l);const C=this._oneTimeListeners&&this._oneTimeListeners[g]?this._oneTimeListeners[g].slice():[];for(const k of C)er(g,k,this._oneTimeListeners),k.call(this,l);const A=this._eventedParent;A&&(U(l,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),A.fire(l))}else l instanceof Ve&&console.error(l.error);return this}listens(l){return this._listeners&&this._listeners[l]&&this._listeners[l].length>0||this._oneTimeListeners&&this._oneTimeListeners[l]&&this._oneTimeListeners[l].length>0||this._eventedParent&&this._eventedParent.listens(l)}setEventedParent(l,p){return this._eventedParent=l,this._eventedParentData=p,this}}var Ot={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const jr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function zr(h,l){const p={};for(const g in h)g!=="ref"&&(p[g]=h[g]);return jr.forEach(g=>{g in l&&(p[g]=l[g])}),p}function _r(h,l){if(Array.isArray(h)){if(!Array.isArray(l)||h.length!==l.length)return!1;for(let p=0;p<h.length;p++)if(!_r(h[p],l[p]))return!1;return!0}if(typeof h=="object"&&h!==null&&l!==null){if(typeof l!="object"||Object.keys(h).length!==Object.keys(l).length)return!1;for(const p in h)if(!_r(h[p],l[p]))return!1;return!0}return h===l}function br(h,l){h.push(l)}function qr(h,l,p){br(p,{command:"addSource",args:[h,l[h]]})}function mi(h,l,p){br(l,{command:"removeSource",args:[h]}),p[h]=!0}function bi(h,l,p,g){mi(h,p,g),qr(h,l,p)}function qn(h,l,p){let g;for(g in h[p])if(Object.prototype.hasOwnProperty.call(h[p],g)&&g!=="data"&&!_r(h[p][g],l[p][g]))return!1;for(g in l[p])if(Object.prototype.hasOwnProperty.call(l[p],g)&&g!=="data"&&!_r(h[p][g],l[p][g]))return!1;return!0}function he(h,l,p,g,x,C){h=h||{},l=l||{};for(const A in h)Object.prototype.hasOwnProperty.call(h,A)&&(_r(h[A],l[A])||p.push({command:C,args:[g,A,l[A],x]}));for(const A in l)Object.prototype.hasOwnProperty.call(l,A)&&!Object.prototype.hasOwnProperty.call(h,A)&&(_r(h[A],l[A])||p.push({command:C,args:[g,A,l[A],x]}))}function gr(h){return h.id}function Jr(h,l){return h[l.id]=l,h}class de{constructor(l,p,g,x){this.message=(l?`${l}: `:"")+g,x&&(this.identifier=x),p!=null&&p.__line__&&(this.line=p.__line__)}}function gi(h,...l){for(const p of l)for(const g in p)h[g]=p[g];return h}class Vn extends Error{constructor(l,p){super(p),this.message=p,this.key=l}}class oi{constructor(l,p=[]){this.parent=l,this.bindings={};for(const[g,x]of p)this.bindings[g]=x}concat(l){return new oi(this,l)}get(l){if(this.bindings[l])return this.bindings[l];if(this.parent)return this.parent.get(l);throw new Error(`${l} not found in scope.`)}has(l){return!!this.bindings[l]||!!this.parent&&this.parent.has(l)}}const Ui={kind:"null"},Ee={kind:"number"},kr={kind:"string"},fr={kind:"boolean"},ai={kind:"color"},lo={kind:"object"},Tr={kind:"value"},ui={kind:"collator"},bo={kind:"formatted"},Ji={kind:"padding"},wn={kind:"resolvedImage"},xt={kind:"variableAnchorOffsetCollection"};function ot(h,l){return{kind:"array",itemType:h,N:l}}function at(h){if(h.kind==="array"){const l=at(h.itemType);return typeof h.N=="number"?`array<${l}, ${h.N}>`:h.itemType.kind==="value"?"array":`array<${l}>`}return h.kind}const ht=[Ui,Ee,kr,fr,ai,bo,lo,ot(Tr),Ji,wn,xt];function _t(h,l){if(l.kind==="error")return null;if(h.kind==="array"){if(l.kind==="array"&&(l.N===0&&l.itemType.kind==="value"||!_t(h.itemType,l.itemType))&&(typeof h.N!="number"||h.N===l.N))return null}else{if(h.kind===l.kind)return null;if(h.kind==="value"){for(const p of ht)if(!_t(p,l))return null}}return`Expected ${at(h)} but found ${at(l)} instead.`}function At(h,l){return l.some(p=>p.kind===h.kind)}function Vt(h,l){return l.some(p=>p==="null"?h===null:p==="array"?Array.isArray(h):p==="object"?h&&!Array.isArray(h)&&typeof h=="object":p===typeof h)}function Dt(h,l){return h.kind==="array"&&l.kind==="array"?h.itemType.kind===l.itemType.kind&&typeof h.N=="number":h.kind===l.kind}const Ht=.96422,Jt=.82521,ne=4/29,qt=6/29,Ct=3*qt*qt,Yt=qt*qt*qt,Le=Math.PI/180,Ye=180/Math.PI;function Hr(h){return(h%=360)<0&&(h+=360),h}function dr([h,l,p,g]){let x,C;const A=Yr((.2225045*(h=Xr(h))+.7168786*(l=Xr(l))+.0606169*(p=Xr(p)))/1);h===l&&l===p?x=C=A:(x=Yr((.4360747*h+.3850649*l+.1430804*p)/Ht),C=Yr((.0139322*h+.0971045*l+.7141733*p)/Jt));const k=116*A-16;return[k<0?0:k,500*(x-A),200*(A-C),g]}function Xr(h){return h<=.04045?h/12.92:Math.pow((h+.055)/1.055,2.4)}function Yr(h){return h>Yt?Math.pow(h,1/3):h/Ct+ne}function Cr([h,l,p,g]){let x=(h+16)/116,C=isNaN(l)?x:x+l/500,A=isNaN(p)?x:x-p/200;return x=1*Zr(x),C=Ht*Zr(C),A=Jt*Zr(A),[Lr(3.1338561*C-1.6168667*x-.4906146*A),Lr(-.9787684*C+1.9161415*x+.033454*A),Lr(.0719453*C-.2289914*x+1.4052427*A),g]}function Lr(h){return(h=h<=.00304?12.92*h:1.055*Math.pow(h,1/2.4)-.055)<0?0:h>1?1:h}function Zr(h){return h>qt?h*h*h:Ct*(h-ne)}function sn(h){return parseInt(h.padEnd(2,h),16)/255}function Rn(h,l){return Li(l?h/100:h,0,1)}function Li(h,l,p){return Math.min(Math.max(l,h),p)}function wi(h){return!h.some(Number.isNaN)}const ys={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 Ur{constructor(l,p,g,x=1,C=!0){this.r=l,this.g=p,this.b=g,this.a=x,C||(this.r*=x,this.g*=x,this.b*=x,x||this.overwriteGetter("rgb",[l,p,g,x]))}static parse(l){if(l instanceof Ur)return l;if(typeof l!="string")return;const p=function(g){if((g=g.toLowerCase().trim())==="transparent")return[0,0,0,0];const x=ys[g];if(x){const[A,k,N]=x;return[A/255,k/255,N/255,1]}if(g.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(g)){const A=g.length<6?1:2;let k=1;return[sn(g.slice(k,k+=A)),sn(g.slice(k,k+=A)),sn(g.slice(k,k+=A)),sn(g.slice(k,k+A)||"ff")]}if(g.startsWith("rgb")){const A=g.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(A){const[k,N,z,q,K,et,st,ut,Tt,Lt,St,$t]=A,It=[q||" ",st||" ",Lt].join("");if(It===" "||It===" /"||It===",,"||It===",,,"){const Bt=[z,et,Tt].join(""),te=Bt==="%%%"?100:Bt===""?255:0;if(te){const Qe=[Li(+N/te,0,1),Li(+K/te,0,1),Li(+ut/te,0,1),St?Rn(+St,$t):1];if(wi(Qe))return Qe}}return}}const C=g.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(C){const[A,k,N,z,q,K,et,st,ut]=C,Tt=[N||" ",q||" ",et].join("");if(Tt===" "||Tt===" /"||Tt===",,"||Tt===",,,"){const Lt=[+k,Li(+z,0,100),Li(+K,0,100),st?Rn(+st,ut):1];if(wi(Lt))return function([St,$t,It,Bt]){function te(Qe){const ze=(Qe+St/30)%12,mr=$t*Math.min(It,1-It);return It-mr*Math.max(-1,Math.min(ze-3,9-ze,1))}return St=Hr(St),$t/=100,It/=100,[te(0),te(8),te(4),Bt]}(Lt)}}}(l);return p?new Ur(...p,!1):void 0}get rgb(){const{r:l,g:p,b:g,a:x}=this,C=x||1/0;return this.overwriteGetter("rgb",[l/C,p/C,g/C,x])}get hcl(){return this.overwriteGetter("hcl",function(l){const[p,g,x,C]=dr(l),A=Math.sqrt(g*g+x*x);return[Math.round(1e4*A)?Hr(Math.atan2(x,g)*Ye):NaN,A,p,C]}(this.rgb))}get lab(){return this.overwriteGetter("lab",dr(this.rgb))}overwriteGetter(l,p){return Object.defineProperty(this,l,{value:p}),p}toString(){const[l,p,g,x]=this.rgb;return`rgba(${[l,p,g].map(C=>Math.round(255*C)).join(",")},${x})`}}Ur.black=new Ur(0,0,0,1),Ur.white=new Ur(1,1,1,1),Ur.transparent=new Ur(0,0,0,0),Ur.red=new Ur(1,0,0,1);class Ni{constructor(l,p,g){this.sensitivity=l?p?"variant":"case":p?"accent":"base",this.locale=g,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(l,p){return this.collator.compare(l,p)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class o1{constructor(l,p,g,x,C){this.text=l,this.image=p,this.scale=g,this.fontStack=x,this.textColor=C}}class Fr{constructor(l){this.sections=l}static fromString(l){return new Fr([new o1(l,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(l=>l.text.length!==0||l.image&&l.image.name.length!==0)}static factory(l){return l instanceof Fr?l:Fr.fromString(l)}toString(){return this.sections.length===0?"":this.sections.map(l=>l.text).join("")}}class Xn{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof Xn)return l;if(typeof l=="number")return new Xn([l,l,l,l]);if(Array.isArray(l)&&!(l.length<1||l.length>4)){for(const p of l)if(typeof p!="number")return;switch(l.length){case 1:l=[l[0],l[0],l[0],l[0]];break;case 2:l=[l[0],l[1],l[0],l[1]];break;case 3:l=[l[0],l[1],l[2],l[1]]}return new Xn(l)}}toString(){return JSON.stringify(this.values)}}const Ba=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ln{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof ln)return l;if(Array.isArray(l)&&!(l.length<1)&&l.length%2==0){for(let p=0;p<l.length;p+=2){const g=l[p],x=l[p+1];if(typeof g!="string"||!Ba.has(g)||!Array.isArray(x)||x.length!==2||typeof x[0]!="number"||typeof x[1]!="number")return}return new ln(l)}}toString(){return JSON.stringify(this.values)}}class Kr{constructor(l){this.name=l.name,this.available=l.available}toString(){return this.name}static fromString(l){return l?new Kr({name:l,available:!1}):null}}function R1(h,l,p,g){return typeof h=="number"&&h>=0&&h<=255&&typeof l=="number"&&l>=0&&l<=255&&typeof p=="number"&&p>=0&&p<=255?g===void 0||typeof g=="number"&&g>=0&&g<=1?null:`Invalid rgba value [${[h,l,p,g].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof g=="number"?[h,l,p,g]:[h,l,p]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Lo(h){if(h===null||typeof h=="string"||typeof h=="boolean"||typeof h=="number"||h instanceof Ur||h instanceof Ni||h instanceof Fr||h instanceof Xn||h instanceof ln||h instanceof Kr)return!0;if(Array.isArray(h)){for(const l of h)if(!Lo(l))return!1;return!0}if(typeof h=="object"){for(const l in h)if(!Lo(h[l]))return!1;return!0}return!1}function cn(h){if(h===null)return Ui;if(typeof h=="string")return kr;if(typeof h=="boolean")return fr;if(typeof h=="number")return Ee;if(h instanceof Ur)return ai;if(h instanceof Ni)return ui;if(h instanceof Fr)return bo;if(h instanceof Xn)return Ji;if(h instanceof ln)return xt;if(h instanceof Kr)return wn;if(Array.isArray(h)){const l=h.length;let p;for(const g of h){const x=cn(g);if(p){if(p===x)continue;p=Tr;break}p=x}return ot(p||Tr,l)}return lo}function hi(h){const l=typeof h;return h===null?"":l==="string"||l==="number"||l==="boolean"?String(h):h instanceof Ur||h instanceof Fr||h instanceof Xn||h instanceof ln||h instanceof Kr?h.toString():JSON.stringify(h)}class a1{constructor(l,p){this.type=l,this.value=p}static parse(l,p){if(l.length!==2)return p.error(`'literal' expression requires exactly one argument, but found ${l.length-1} instead.`);if(!Lo(l[1]))return p.error("invalid value");const g=l[1];let x=cn(g);const C=p.expectedType;return x.kind!=="array"||x.N!==0||!C||C.kind!=="array"||typeof C.N=="number"&&C.N!==0||(x=C),new a1(x,g)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Nn{constructor(l){this.name="ExpressionEvaluationError",this.message=l}toJSON(){return this.message}}const Fa={string:kr,number:Ee,boolean:fr,object:lo};class Gi{constructor(l,p){this.type=l,this.args=p}static parse(l,p){if(l.length<2)return p.error("Expected at least one argument.");let g,x=1;const C=l[0];if(C==="array"){let k,N;if(l.length>2){const z=l[1];if(typeof z!="string"||!(z in Fa)||z==="object")return p.error('The item type argument of "array" must be one of string, number, boolean',1);k=Fa[z],x++}else k=Tr;if(l.length>3){if(l[2]!==null&&(typeof l[2]!="number"||l[2]<0||l[2]!==Math.floor(l[2])))return p.error('The length argument to "array" must be a positive integer literal',2);N=l[2],x++}g=ot(k,N)}else{if(!Fa[C])throw new Error(`Types doesn't contain name = ${C}`);g=Fa[C]}const A=[];for(;x<l.length;x++){const k=p.parse(l[x],x,Tr);if(!k)return null;A.push(k)}return new Gi(g,A)}evaluate(l){for(let p=0;p<this.args.length;p++){const g=this.args[p].evaluate(l);if(!_t(this.type,cn(g)))return g;if(p===this.args.length-1)throw new Nn(`Expected value to be of type ${at(this.type)}, but found ${at(cn(g))} instead.`)}throw new Error}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}const v1={"to-boolean":fr,"to-color":ai,"to-number":Ee,"to-string":kr};class wo{constructor(l,p){this.type=l,this.args=p}static parse(l,p){if(l.length<2)return p.error("Expected at least one argument.");const g=l[0];if(!v1[g])throw new Error(`Can't parse ${g} as it is not part of the known types`);if((g==="to-boolean"||g==="to-string")&&l.length!==2)return p.error("Expected one argument.");const x=v1[g],C=[];for(let A=1;A<l.length;A++){const k=p.parse(l[A],A,Tr);if(!k)return null;C.push(k)}return new wo(x,C)}evaluate(l){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(l);case"color":{let p,g;for(const x of this.args){if(p=x.evaluate(l),g=null,p instanceof Ur)return p;if(typeof p=="string"){const C=l.parseColor(p);if(C)return C}else if(Array.isArray(p)&&(g=p.length<3||p.length>4?`Invalid rbga value ${JSON.stringify(p)}: expected an array containing either three or four numeric values.`:R1(p[0],p[1],p[2],p[3]),!g))return new Ur(p[0]/255,p[1]/255,p[2]/255,p[3])}throw new Nn(g||`Could not parse color from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"padding":{let p;for(const g of this.args){p=g.evaluate(l);const x=Xn.parse(p);if(x)return x}throw new Nn(`Could not parse padding from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"variableAnchorOffsetCollection":{let p;for(const g of this.args){p=g.evaluate(l);const x=ln.parse(p);if(x)return x}throw new Nn(`Could not parse variableAnchorOffsetCollection from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"number":{let p=null;for(const g of this.args){if(p=g.evaluate(l),p===null)return 0;const x=Number(p);if(!isNaN(x))return x}throw new Nn(`Could not convert ${JSON.stringify(p)} to number.`)}case"formatted":return Fr.fromString(hi(this.args[0].evaluate(l)));case"resolvedImage":return Kr.fromString(hi(this.args[0].evaluate(l)));default:return hi(this.args[0].evaluate(l))}}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}const jo=["Unknown","Point","LineString","Polygon"];class _s{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"?jo[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(l){let p=this._parseColorCache[l];return p||(p=this._parseColorCache[l]=Ur.parse(l)),p}}class b1{constructor(l,p,g=[],x,C=new oi,A=[]){this.registry=l,this.path=g,this.key=g.map(k=>`[${k}]`).join(""),this.scope=C,this.errors=A,this.expectedType=x,this._isConstant=p}parse(l,p,g,x,C={}){return p?this.concat(p,g,x)._parse(l,C):this._parse(l,C)}_parse(l,p){function g(x,C,A){return A==="assert"?new Gi(C,[x]):A==="coerce"?new wo(C,[x]):x}if(l!==null&&typeof l!="string"&&typeof l!="boolean"&&typeof l!="number"||(l=["literal",l]),Array.isArray(l)){if(l.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const x=l[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 A=C.parse(l,this);if(!A)return null;if(this.expectedType){const k=this.expectedType,N=A.type;if(k.kind!=="string"&&k.kind!=="number"&&k.kind!=="boolean"&&k.kind!=="object"&&k.kind!=="array"||N.kind!=="value")if(k.kind!=="color"&&k.kind!=="formatted"&&k.kind!=="resolvedImage"||N.kind!=="value"&&N.kind!=="string")if(k.kind!=="padding"||N.kind!=="value"&&N.kind!=="number"&&N.kind!=="array")if(k.kind!=="variableAnchorOffsetCollection"||N.kind!=="value"&&N.kind!=="array"){if(this.checkSubtype(k,N))return null}else A=g(A,k,p.typeAnnotation||"coerce");else A=g(A,k,p.typeAnnotation||"coerce");else A=g(A,k,p.typeAnnotation||"coerce");else A=g(A,k,p.typeAnnotation||"assert")}if(!(A instanceof a1)&&A.type.kind!=="resolvedImage"&&this._isConstant(A)){const k=new _s;try{A=new a1(A.type,A.evaluate(k))}catch(N){return this.error(N.message),null}}return A}return this.error(`Unknown expression "${x}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(l===void 0?"'undefined' value invalid. Use null instead.":typeof l=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof l} instead.`)}concat(l,p,g){const x=typeof l=="number"?this.path.concat(l):this.path,C=g?this.scope.concat(g):this.scope;return new b1(this.registry,this._isConstant,x,p||null,C,this.errors)}error(l,...p){const g=`${this.key}${p.map(x=>`[${x}]`).join("")}`;this.errors.push(new Vn(g,l))}checkSubtype(l,p){const g=_t(l,p);return g&&this.error(g),g}}class Gr{constructor(l,p){this.type=p.type,this.bindings=[].concat(l),this.result=p}evaluate(l){return this.result.evaluate(l)}eachChild(l){for(const p of this.bindings)l(p[1]);l(this.result)}static parse(l,p){if(l.length<4)return p.error(`Expected at least 3 arguments, but found ${l.length-1} instead.`);const g=[];for(let C=1;C<l.length-1;C+=2){const A=l[C];if(typeof A!="string")return p.error(`Expected string, but found ${typeof A} instead.`,C);if(/[^a-zA-Z0-9_]/.test(A))return p.error("Variable names must contain only alphanumeric characters or '_'.",C);const k=p.parse(l[C+1],C+1);if(!k)return null;g.push([A,k])}const x=p.parse(l[l.length-1],l.length-1,p.expectedType,g);return x?new Gr(g,x):null}outputDefined(){return this.result.outputDefined()}}class N1{constructor(l,p){this.type=p.type,this.name=l,this.boundExpression=p}static parse(l,p){if(l.length!==2||typeof l[1]!="string")return p.error("'var' expression requires exactly one string literal argument.");const g=l[1];return p.scope.has(g)?new N1(g,p.scope.get(g)):p.error(`Unknown variable "${g}". Make sure "${g}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(l){return this.boundExpression.evaluate(l)}eachChild(){}outputDefined(){return!1}}class V{constructor(l,p,g){this.type=l,this.index=p,this.input=g}static parse(l,p){if(l.length!==3)return p.error(`Expected 2 arguments, but found ${l.length-1} instead.`);const g=p.parse(l[1],1,Ee),x=p.parse(l[2],2,ot(p.expectedType||Tr));return g&&x?new V(x.type.itemType,g,x):null}evaluate(l){const p=this.index.evaluate(l),g=this.input.evaluate(l);if(p<0)throw new Nn(`Array index out of bounds: ${p} < 0.`);if(p>=g.length)throw new Nn(`Array index out of bounds: ${p} > ${g.length-1}.`);if(p!==Math.floor(p))throw new Nn(`Array index must be an integer, but found ${p} instead.`);return g[p]}eachChild(l){l(this.index),l(this.input)}outputDefined(){return!1}}class Z{constructor(l,p){this.type=fr,this.needle=l,this.haystack=p}static parse(l,p){if(l.length!==3)return p.error(`Expected 2 arguments, but found ${l.length-1} instead.`);const g=p.parse(l[1],1,Tr),x=p.parse(l[2],2,Tr);return g&&x?At(g.type,[fr,kr,Ee,Ui,Tr])?new Z(g,x):p.error(`Expected first argument to be of type boolean, string, number or null, but found ${at(g.type)} instead`):null}evaluate(l){const p=this.needle.evaluate(l),g=this.haystack.evaluate(l);if(!g)return!1;if(!Vt(p,["boolean","string","number","null"]))throw new Nn(`Expected first argument to be of type boolean, string, number or null, but found ${at(cn(p))} instead.`);if(!Vt(g,["string","array"]))throw new Nn(`Expected second argument to be of type array or string, but found ${at(cn(g))} instead.`);return g.indexOf(p)>=0}eachChild(l){l(this.needle),l(this.haystack)}outputDefined(){return!0}}class F{constructor(l,p,g){this.type=Ee,this.needle=l,this.haystack=p,this.fromIndex=g}static parse(l,p){if(l.length<=2||l.length>=5)return p.error(`Expected 3 or 4 arguments, but found ${l.length-1} instead.`);const g=p.parse(l[1],1,Tr),x=p.parse(l[2],2,Tr);if(!g||!x)return null;if(!At(g.type,[fr,kr,Ee,Ui,Tr]))return p.error(`Expected first argument to be of type boolean, string, number or null, but found ${at(g.type)} instead`);if(l.length===4){const C=p.parse(l[3],3,Ee);return C?new F(g,x,C):null}return new F(g,x)}evaluate(l){const p=this.needle.evaluate(l),g=this.haystack.evaluate(l);if(!Vt(p,["boolean","string","number","null"]))throw new Nn(`Expected first argument to be of type boolean, string, number or null, but found ${at(cn(p))} instead.`);if(!Vt(g,["string","array"]))throw new Nn(`Expected second argument to be of type array or string, but found ${at(cn(g))} instead.`);if(this.fromIndex){const x=this.fromIndex.evaluate(l);return g.indexOf(p,x)}return g.indexOf(p)}eachChild(l){l(this.needle),l(this.haystack),this.fromIndex&&l(this.fromIndex)}outputDefined(){return!1}}class X{constructor(l,p,g,x,C,A){this.inputType=l,this.type=p,this.input=g,this.cases=x,this.outputs=C,this.otherwise=A}static parse(l,p){if(l.length<5)return p.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if(l.length%2!=1)return p.error("Expected an even number of arguments.");let g,x;p.expectedType&&p.expectedType.kind!=="value"&&(x=p.expectedType);const C={},A=[];for(let z=2;z<l.length-1;z+=2){let q=l[z];const K=l[z+1];Array.isArray(q)||(q=[q]);const et=p.concat(z);if(q.length===0)return et.error("Expected at least one branch label.");for(const ut of q){if(typeof ut!="number"&&typeof ut!="string")return et.error("Branch labels must be numbers or strings.");if(typeof ut=="number"&&Math.abs(ut)>Number.MAX_SAFE_INTEGER)return et.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ut=="number"&&Math.floor(ut)!==ut)return et.error("Numeric branch labels must be integer values.");if(g){if(et.checkSubtype(g,cn(ut)))return null}else g=cn(ut);if(C[String(ut)]!==void 0)return et.error("Branch labels must be unique.");C[String(ut)]=A.length}const st=p.parse(K,z,x);if(!st)return null;x=x||st.type,A.push(st)}const k=p.parse(l[1],1,Tr);if(!k)return null;const N=p.parse(l[l.length-1],l.length-1,x);return N?k.type.kind!=="value"&&p.concat(1).checkSubtype(g,k.type)?null:new X(g,x,k,C,A,N):null}evaluate(l){const p=this.input.evaluate(l);return(cn(p)===this.inputType&&this.outputs[this.cases[p]]||this.otherwise).evaluate(l)}eachChild(l){l(this.input),this.outputs.forEach(l),l(this.otherwise)}outputDefined(){return this.outputs.every(l=>l.outputDefined())&&this.otherwise.outputDefined()}}class nt{constructor(l,p,g){this.type=l,this.branches=p,this.otherwise=g}static parse(l,p){if(l.length<4)return p.error(`Expected at least 3 arguments, but found only ${l.length-1}.`);if(l.length%2!=0)return p.error("Expected an odd number of arguments.");let g;p.expectedType&&p.expectedType.kind!=="value"&&(g=p.expectedType);const x=[];for(let A=1;A<l.length-1;A+=2){const k=p.parse(l[A],A,fr);if(!k)return null;const N=p.parse(l[A+1],A+1,g);if(!N)return null;x.push([k,N]),g=g||N.type}const C=p.parse(l[l.length-1],l.length-1,g);if(!C)return null;if(!g)throw new Error("Can't infer output type");return new nt(g,x,C)}evaluate(l){for(const[p,g]of this.branches)if(p.evaluate(l))return g.evaluate(l);return this.otherwise.evaluate(l)}eachChild(l){for(const[p,g]of this.branches)l(p),l(g);l(this.otherwise)}outputDefined(){return this.branches.every(([l,p])=>p.outputDefined())&&this.otherwise.outputDefined()}}class dt{constructor(l,p,g,x){this.type=l,this.input=p,this.beginIndex=g,this.endIndex=x}static parse(l,p){if(l.length<=2||l.length>=5)return p.error(`Expected 3 or 4 arguments, but found ${l.length-1} instead.`);const g=p.parse(l[1],1,Tr),x=p.parse(l[2],2,Ee);if(!g||!x)return null;if(!At(g.type,[ot(Tr),kr,Tr]))return p.error(`Expected first argument to be of type array or string, but found ${at(g.type)} instead`);if(l.length===4){const C=p.parse(l[3],3,Ee);return C?new dt(g.type,g,x,C):null}return new dt(g.type,g,x)}evaluate(l){const p=this.input.evaluate(l),g=this.beginIndex.evaluate(l);if(!Vt(p,["string","array"]))throw new Nn(`Expected first argument to be of type array or string, but found ${at(cn(p))} instead.`);if(this.endIndex){const x=this.endIndex.evaluate(l);return p.slice(g,x)}return p.slice(g)}eachChild(l){l(this.input),l(this.beginIndex),this.endIndex&&l(this.endIndex)}outputDefined(){return!1}}function gt(h,l){const p=h.length-1;let g,x,C=0,A=p,k=0;for(;C<=A;)if(k=Math.floor((C+A)/2),g=h[k],x=h[k+1],g<=l){if(k===p||l<x)return k;C=k+1}else{if(!(g>l))throw new Nn("Input is not a number.");A=k-1}return 0}class Wt{constructor(l,p,g){this.type=l,this.input=p,this.labels=[],this.outputs=[];for(const[x,C]of g)this.labels.push(x),this.outputs.push(C)}static parse(l,p){if(l.length-1<4)return p.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return p.error("Expected an even number of arguments.");const g=p.parse(l[1],1,Ee);if(!g)return null;const x=[];let C=null;p.expectedType&&p.expectedType.kind!=="value"&&(C=p.expectedType);for(let A=1;A<l.length;A+=2){const k=A===1?-1/0:l[A],N=l[A+1],z=A,q=A+1;if(typeof k!="number")return p.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(x.length&&x[x.length-1][0]>=k)return p.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',z);const K=p.parse(N,q,C);if(!K)return null;C=C||K.type,x.push([k,K])}return new Wt(C,g,x)}evaluate(l){const p=this.labels,g=this.outputs;if(p.length===1)return g[0].evaluate(l);const x=this.input.evaluate(l);if(x<=p[0])return g[0].evaluate(l);const C=p.length;return x>=p[C-1]?g[C-1].evaluate(l):g[gt(p,x)].evaluate(l)}eachChild(l){l(this.input);for(const p of this.outputs)l(p)}outputDefined(){return this.outputs.every(l=>l.outputDefined())}}function ie(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var Te=Me;function Me(h,l,p,g){this.cx=3*h,this.bx=3*(p-h)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(g-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=h,this.p1y=l,this.p2x=p,this.p2y=g}Me.prototype={sampleCurveX:function(h){return((this.ax*h+this.bx)*h+this.cx)*h},sampleCurveY:function(h){return((this.ay*h+this.by)*h+this.cy)*h},sampleCurveDerivativeX:function(h){return(3*this.ax*h+2*this.bx)*h+this.cx},solveCurveX:function(h,l){if(l===void 0&&(l=1e-6),h<0)return 0;if(h>1)return 1;for(var p=h,g=0;g<8;g++){var x=this.sampleCurveX(p)-h;if(Math.abs(x)<l)return p;var C=this.sampleCurveDerivativeX(p);if(Math.abs(C)<1e-6)break;p-=x/C}var A=0,k=1;for(p=h,g=0;g<20&&(x=this.sampleCurveX(p),!(Math.abs(x-h)<l));g++)h>x?A=p:k=p,p=.5*(k-A)+A;return p},solve:function(h,l){return this.sampleCurveY(this.solveCurveX(h,l))}};var ye=ie(Te);function or(h,l,p){return h+p*(l-h)}function vn(h,l,p){return h.map((g,x)=>or(g,l[x],p))}const Qr={number:or,color:function(h,l,p,g="rgb"){switch(g){case"rgb":{const[x,C,A,k]=vn(h.rgb,l.rgb,p);return new Ur(x,C,A,k,!1)}case"hcl":{const[x,C,A,k]=h.hcl,[N,z,q,K]=l.hcl;let et,st;if(isNaN(x)||isNaN(N))isNaN(x)?isNaN(N)?et=NaN:(et=N,A!==1&&A!==0||(st=z)):(et=x,q!==1&&q!==0||(st=C));else{let $t=N-x;N>x&&$t>180?$t-=360:N<x&&x-N>180&&($t+=360),et=x+p*$t}const[ut,Tt,Lt,St]=function([$t,It,Bt,te]){return $t=isNaN($t)?0:$t*Le,Cr([Bt,Math.cos($t)*It,Math.sin($t)*It,te])}([et,st??or(C,z,p),or(A,q,p),or(k,K,p)]);return new Ur(ut,Tt,Lt,St,!1)}case"lab":{const[x,C,A,k]=Cr(vn(h.lab,l.lab,p));return new Ur(x,C,A,k,!1)}}},array:vn,padding:function(h,l,p){return new Xn(vn(h.values,l.values,p))},variableAnchorOffsetCollection:function(h,l,p){const g=h.values,x=l.values;if(g.length!==x.length)throw new Nn(`Cannot interpolate values of different length. from: ${h.toString()}, to: ${l.toString()}`);const C=[];for(let A=0;A<g.length;A+=2){if(g[A]!==x[A])throw new Nn(`Cannot interpolate values containing mismatched anchors. from[${A}]: ${g[A]}, to[${A}]: ${x[A]}`);C.push(g[A]);const[k,N]=g[A+1],[z,q]=x[A+1];C.push([or(k,z,p),or(N,q,p)])}return new ln(C)}};class en{constructor(l,p,g,x,C){this.type=l,this.operator=p,this.interpolation=g,this.input=x,this.labels=[],this.outputs=[];for(const[A,k]of C)this.labels.push(A),this.outputs.push(k)}static interpolationFactor(l,p,g,x){let C=0;if(l.name==="exponential")C=se(p,l.base,g,x);else if(l.name==="linear")C=se(p,1,g,x);else if(l.name==="cubic-bezier"){const A=l.controlPoints;C=new ye(A[0],A[1],A[2],A[3]).solve(se(p,1,g,x))}return C}static parse(l,p){let[g,x,C,...A]=l;if(!Array.isArray(x)||x.length===0)return p.error("Expected an interpolation type expression.",1);if(x[0]==="linear")x={name:"linear"};else if(x[0]==="exponential"){const z=x[1];if(typeof z!="number")return p.error("Exponential interpolation requires a numeric base.",1,1);x={name:"exponential",base:z}}else{if(x[0]!=="cubic-bezier")return p.error(`Unknown interpolation type ${String(x[0])}`,1,0);{const z=x.slice(1);if(z.length!==4||z.some(q=>typeof q!="number"||q<0||q>1))return p.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);x={name:"cubic-bezier",controlPoints:z}}}if(l.length-1<4)return p.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return p.error("Expected an even number of arguments.");if(C=p.parse(C,2,Ee),!C)return null;const k=[];let N=null;g==="interpolate-hcl"||g==="interpolate-lab"?N=ai:p.expectedType&&p.expectedType.kind!=="value"&&(N=p.expectedType);for(let z=0;z<A.length;z+=2){const q=A[z],K=A[z+1],et=z+3,st=z+4;if(typeof q!="number")return p.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',et);if(k.length&&k[k.length-1][0]>=q)return p.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',et);const ut=p.parse(K,st,N);if(!ut)return null;N=N||ut.type,k.push([q,ut])}return Dt(N,Ee)||Dt(N,ai)||Dt(N,Ji)||Dt(N,xt)||Dt(N,ot(Ee))?new en(N,g,x,C,k):p.error(`Type ${at(N)} is not interpolatable.`)}evaluate(l){const p=this.labels,g=this.outputs;if(p.length===1)return g[0].evaluate(l);const x=this.input.evaluate(l);if(x<=p[0])return g[0].evaluate(l);const C=p.length;if(x>=p[C-1])return g[C-1].evaluate(l);const A=gt(p,x),k=en.interpolationFactor(this.interpolation,x,p[A],p[A+1]),N=g[A].evaluate(l),z=g[A+1].evaluate(l);switch(this.operator){case"interpolate":return Qr[this.type.kind](N,z,k);case"interpolate-hcl":return Qr.color(N,z,k,"hcl");case"interpolate-lab":return Qr.color(N,z,k,"lab")}}eachChild(l){l(this.input);for(const p of this.outputs)l(p)}outputDefined(){return this.outputs.every(l=>l.outputDefined())}}function se(h,l,p,g){const x=g-p,C=h-p;return x===0?0:l===1?C/x:(Math.pow(l,C)-1)/(Math.pow(l,x)-1)}class ar{constructor(l,p){this.type=l,this.args=p}static parse(l,p){if(l.length<2)return p.error("Expectected at least one argument.");let g=null;const x=p.expectedType;x&&x.kind!=="value"&&(g=x);const C=[];for(const k of l.slice(1)){const N=p.parse(k,1+C.length,g,void 0,{typeAnnotation:"omit"});if(!N)return null;g=g||N.type,C.push(N)}if(!g)throw new Error("No output type");const A=x&&C.some(k=>_t(x,k.type));return new ar(A?Tr:g,C)}evaluate(l){let p,g=null,x=0;for(const C of this.args)if(x++,g=C.evaluate(l),g&&g instanceof Kr&&!g.available&&(p||(p=g.name),g=null,x===this.args.length&&(g=p)),g!==null)break;return g}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}function hn(h,l){return h==="=="||h==="!="?l.kind==="boolean"||l.kind==="string"||l.kind==="number"||l.kind==="null"||l.kind==="value":l.kind==="string"||l.kind==="number"||l.kind==="value"}function Ai(h,l,p,g){return g.compare(l,p)===0}function xn(h,l,p){const g=h!=="=="&&h!=="!=";return class LK{constructor(C,A,k){this.type=fr,this.lhs=C,this.rhs=A,this.collator=k,this.hasUntypedArgument=C.type.kind==="value"||A.type.kind==="value"}static parse(C,A){if(C.length!==3&&C.length!==4)return A.error("Expected two or three arguments.");const k=C[0];let N=A.parse(C[1],1,Tr);if(!N)return null;if(!hn(k,N.type))return A.concat(1).error(`"${k}" comparisons are not supported for type '${at(N.type)}'.`);let z=A.parse(C[2],2,Tr);if(!z)return null;if(!hn(k,z.type))return A.concat(2).error(`"${k}" comparisons are not supported for type '${at(z.type)}'.`);if(N.type.kind!==z.type.kind&&N.type.kind!=="value"&&z.type.kind!=="value")return A.error(`Cannot compare types '${at(N.type)}' and '${at(z.type)}'.`);g&&(N.type.kind==="value"&&z.type.kind!=="value"?N=new Gi(z.type,[N]):N.type.kind!=="value"&&z.type.kind==="value"&&(z=new Gi(N.type,[z])));let q=null;if(C.length===4){if(N.type.kind!=="string"&&z.type.kind!=="string"&&N.type.kind!=="value"&&z.type.kind!=="value")return A.error("Cannot use collator to compare non-string types.");if(q=A.parse(C[3],3,ui),!q)return null}return new LK(N,z,q)}evaluate(C){const A=this.lhs.evaluate(C),k=this.rhs.evaluate(C);if(g&&this.hasUntypedArgument){const N=cn(A),z=cn(k);if(N.kind!==z.kind||N.kind!=="string"&&N.kind!=="number")throw new Nn(`Expected arguments for "${h}" to be (string, string) or (number, number), but found (${N.kind}, ${z.kind}) instead.`)}if(this.collator&&!g&&this.hasUntypedArgument){const N=cn(A),z=cn(k);if(N.kind!=="string"||z.kind!=="string")return l(C,A,k)}return this.collator?p(C,A,k,this.collator.evaluate(C)):l(C,A,k)}eachChild(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)}outputDefined(){return!0}}}const n6=xn("==",function(h,l,p){return l===p},Ai),J9=xn("!=",function(h,l,p){return l!==p},function(h,l,p,g){return!Ai(0,l,p,g)}),Dn=xn("<",function(h,l,p){return l<p},function(h,l,p,g){return g.compare(l,p)<0}),J0=xn(">",function(h,l,p){return l>p},function(h,l,p,g){return g.compare(l,p)>0}),M7=xn("<=",function(h,l,p){return l<=p},function(h,l,p,g){return g.compare(l,p)<=0}),la=xn(">=",function(h,l,p){return l>=p},function(h,l,p,g){return g.compare(l,p)>=0});class C3{constructor(l,p,g){this.type=ui,this.locale=g,this.caseSensitive=l,this.diacriticSensitive=p}static parse(l,p){if(l.length!==2)return p.error("Expected one argument.");const g=l[1];if(typeof g!="object"||Array.isArray(g))return p.error("Collator options argument must be an object.");const x=p.parse(g["case-sensitive"]!==void 0&&g["case-sensitive"],1,fr);if(!x)return null;const C=p.parse(g["diacritic-sensitive"]!==void 0&&g["diacritic-sensitive"],1,fr);if(!C)return null;let A=null;return g.locale&&(A=p.parse(g.locale,1,kr),!A)?null:new C3(x,C,A)}evaluate(l){return new Ni(this.caseSensitive.evaluate(l),this.diacriticSensitive.evaluate(l),this.locale?this.locale.evaluate(l):null)}eachChild(l){l(this.caseSensitive),l(this.diacriticSensitive),this.locale&&l(this.locale)}outputDefined(){return!1}}class i6{constructor(l,p,g,x,C){this.type=kr,this.number=l,this.locale=p,this.currency=g,this.minFractionDigits=x,this.maxFractionDigits=C}static parse(l,p){if(l.length!==3)return p.error("Expected two arguments.");const g=p.parse(l[1],1,Ee);if(!g)return null;const x=l[2];if(typeof x!="object"||Array.isArray(x))return p.error("NumberFormat options argument must be an object.");let C=null;if(x.locale&&(C=p.parse(x.locale,1,kr),!C))return null;let A=null;if(x.currency&&(A=p.parse(x.currency,1,kr),!A))return null;let k=null;if(x["min-fraction-digits"]&&(k=p.parse(x["min-fraction-digits"],1,Ee),!k))return null;let N=null;return x["max-fraction-digits"]&&(N=p.parse(x["max-fraction-digits"],1,Ee),!N)?null:new i6(g,C,A,k,N)}evaluate(l){return new Intl.NumberFormat(this.locale?this.locale.evaluate(l):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(l):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(l):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(l):void 0}).format(this.number.evaluate(l))}eachChild(l){l(this.number),this.locale&&l(this.locale),this.currency&&l(this.currency),this.minFractionDigits&&l(this.minFractionDigits),this.maxFractionDigits&&l(this.maxFractionDigits)}outputDefined(){return!1}}class A3{constructor(l){this.type=bo,this.sections=l}static parse(l,p){if(l.length<2)return p.error("Expected at least one argument.");const g=l[1];if(!Array.isArray(g)&&typeof g=="object")return p.error("First argument must be an image or text section.");const x=[];let C=!1;for(let A=1;A<=l.length-1;++A){const k=l[A];if(C&&typeof k=="object"&&!Array.isArray(k)){C=!1;let N=null;if(k["font-scale"]&&(N=p.parse(k["font-scale"],1,Ee),!N))return null;let z=null;if(k["text-font"]&&(z=p.parse(k["text-font"],1,ot(kr)),!z))return null;let q=null;if(k["text-color"]&&(q=p.parse(k["text-color"],1,ai),!q))return null;const K=x[x.length-1];K.scale=N,K.font=z,K.textColor=q}else{const N=p.parse(l[A],1,Tr);if(!N)return null;const z=N.type.kind;if(z!=="string"&&z!=="value"&&z!=="null"&&z!=="resolvedImage")return p.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");C=!0,x.push({content:N,scale:null,font:null,textColor:null})}}return new A3(x)}evaluate(l){return new Fr(this.sections.map(p=>{const g=p.content.evaluate(l);return cn(g)===wn?new o1("",g,null,null,null):new o1(hi(g),null,p.scale?p.scale.evaluate(l):null,p.font?p.font.evaluate(l).join(","):null,p.textColor?p.textColor.evaluate(l):null)}))}eachChild(l){for(const p of this.sections)l(p.content),p.scale&&l(p.scale),p.font&&l(p.font),p.textColor&&l(p.textColor)}outputDefined(){return!1}}class O3{constructor(l){this.type=wn,this.input=l}static parse(l,p){if(l.length!==2)return p.error("Expected two arguments.");const g=p.parse(l[1],1,kr);return g?new O3(g):p.error("No image name provided.")}evaluate(l){const p=this.input.evaluate(l),g=Kr.fromString(p);return g&&l.availableImages&&(g.available=l.availableImages.indexOf(p)>-1),g}eachChild(l){l(this.input)}outputDefined(){return!1}}class o6{constructor(l){this.type=Ee,this.input=l}static parse(l,p){if(l.length!==2)return p.error(`Expected 1 argument, but found ${l.length-1} instead.`);const g=p.parse(l[1],1);return g?g.type.kind!=="array"&&g.type.kind!=="string"&&g.type.kind!=="value"?p.error(`Expected argument of type string or array, but found ${at(g.type)} instead.`):new o6(g):null}evaluate(l){const p=this.input.evaluate(l);if(typeof p=="string"||Array.isArray(p))return p.length;throw new Nn(`Expected value to be of type string or array, but found ${at(cn(p))} instead.`)}eachChild(l){l(this.input)}outputDefined(){return!1}}const L1=8192;function t5(h,l){const p=(180+h[0])/360,g=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+h[1]*Math.PI/360)))/360,x=Math.pow(2,l.z);return[Math.round(p*x*L1),Math.round(g*x*L1)]}function b2(h,l){const p=Math.pow(2,l.z);return[(x=(h[0]/L1+l.x)/p,360*x-180),(g=(h[1]/L1+l.y)/p,360/Math.PI*Math.atan(Math.exp((180-360*g)*Math.PI/180))-90)];var g,x}function Wr(h,l){h[0]=Math.min(h[0],l[0]),h[1]=Math.min(h[1],l[1]),h[2]=Math.max(h[2],l[0]),h[3]=Math.max(h[3],l[1])}function L2(h,l){return!(h[0]<=l[0]||h[2]>=l[2]||h[1]<=l[1]||h[3]>=l[3])}function S7(h,l,p){const g=h[0]-l[0],x=h[1]-l[1],C=h[0]-p[0],A=h[1]-p[1];return g*A-C*x==0&&g*C<=0&&x*A<=0}function k3(h,l,p,g){return(x=[g[0]-p[0],g[1]-p[1]])[0]*(C=[l[0]-h[0],l[1]-h[1]])[1]-x[1]*C[0]!=0&&!(!w1(h,l,p,g)||!w1(p,g,h,l));var x,C}function th(h,l,p){for(const g of p)for(let x=0;x<g.length-1;++x)if(k3(h,l,g[x],g[x+1]))return!0;return!1}function w2(h,l,p=!1){let g=!1;for(const k of l)for(let N=0;N<k.length-1;N++){if(S7(h,k[N],k[N+1]))return p;(C=k[N])[1]>(x=h)[1]!=(A=k[N+1])[1]>x[1]&&x[0]<(A[0]-C[0])*(x[1]-C[1])/(A[1]-C[1])+C[0]&&(g=!g)}var x,C,A;return g}function a6(h,l){for(const p of l)if(w2(h,p))return!0;return!1}function s6(h,l){for(const p of h)if(!w2(p,l))return!1;for(let p=0;p<h.length-1;++p)if(th(h[p],h[p+1],l))return!1;return!0}function H7(h,l){for(const p of l)if(s6(h,p))return!0;return!1}function w1(h,l,p,g){const x=g[0]-p[0],C=g[1]-p[1],A=(h[0]-p[0])*C-x*(h[1]-p[1]),k=(l[0]-p[0])*C-x*(l[1]-p[1]);return A>0&&k<0||A<0&&k>0}function l6(h,l,p){const g=[];for(let x=0;x<h.length;x++){const C=[];for(let A=0;A<h[x].length;A++){const k=t5(h[x][A],p);Wr(l,k),C.push(k)}g.push(C)}return g}function e5(h,l,p){const g=[];for(let x=0;x<h.length;x++){const C=l6(h[x],l,p);g.push(C)}return g}function C7(h,l,p,g){if(h[0]<p[0]||h[0]>p[2]){const x=.5*g;let C=h[0]-p[0]>x?-g:p[0]-h[0]>x?g:0;C===0&&(C=h[0]-p[2]>x?-g:p[2]-h[0]>x?g:0),h[0]+=C}Wr(l,h)}function r5(h,l,p,g){const x=Math.pow(2,g.z)*L1,C=[g.x*L1,g.y*L1],A=[];for(const k of h)for(const N of k){const z=[N.x+C[0],N.y+C[1]];C7(z,l,p,x),A.push(z)}return A}function P3(h,l,p,g){const x=Math.pow(2,g.z)*L1,C=[g.x*L1,g.y*L1],A=[];for(const N of h){const z=[];for(const q of N){const K=[q.x+C[0],q.y+C[1]];Wr(l,K),z.push(K)}A.push(z)}if(l[2]-l[0]<=x/2){(k=l)[0]=k[1]=1/0,k[2]=k[3]=-1/0;for(const N of A)for(const z of N)C7(z,l,p,x)}var k;return A}class ja{constructor(l,p){this.type=fr,this.geojson=l,this.geometries=p}static parse(l,p){if(l.length!==2)return p.error(`'within' expression requires exactly one argument, but found ${l.length-1} instead.`);if(Lo(l[1])){const g=l[1];if(g.type==="FeatureCollection"){const x=[];for(const C of g.features){const{type:A,coordinates:k}=C.geometry;A==="Polygon"&&x.push(k),A==="MultiPolygon"&&x.push(...k)}if(x.length)return new ja(g,{type:"MultiPolygon",coordinates:x})}else if(g.type==="Feature"){const x=g.geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new ja(g,g.geometry)}else if(g.type==="Polygon"||g.type==="MultiPolygon")return new ja(g,g)}return p.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(l){if(l.geometry()!=null&&l.canonicalID()!=null){if(l.geometryType()==="Point")return function(p,g){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],A=p.canonicalID();if(g.type==="Polygon"){const k=l6(g.coordinates,C,A),N=r5(p.geometry(),x,C,A);if(!L2(x,C))return!1;for(const z of N)if(!w2(z,k))return!1}if(g.type==="MultiPolygon"){const k=e5(g.coordinates,C,A),N=r5(p.geometry(),x,C,A);if(!L2(x,C))return!1;for(const z of N)if(!a6(z,k))return!1}return!0}(l,this.geometries);if(l.geometryType()==="LineString")return function(p,g){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],A=p.canonicalID();if(g.type==="Polygon"){const k=l6(g.coordinates,C,A),N=P3(p.geometry(),x,C,A);if(!L2(x,C))return!1;for(const z of N)if(!s6(z,k))return!1}if(g.type==="MultiPolygon"){const k=e5(g.coordinates,C,A),N=P3(p.geometry(),x,C,A);if(!L2(x,C))return!1;for(const z of N)if(!H7(z,k))return!1}return!0}(l,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let n5=class{constructor(h=[],l=eh){if(this.data=h,this.length=this.data.length,this.compare=l,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(h){this.data.push(h),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const h=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),h}peek(){return this.data[0]}_up(h){const{data:l,compare:p}=this,g=l[h];for(;h>0;){const x=h-1>>1,C=l[x];if(p(g,C)>=0)break;l[h]=C,h=x}l[h]=g}_down(h){const{data:l,compare:p}=this,g=this.length>>1,x=l[h];for(;h<g;){let C=1+(h<<1),A=l[C];const k=C+1;if(k<this.length&&p(l[k],A)<0&&(C=k,A=l[k]),p(A,x)>=0)break;l[h]=A,h=C}l[h]=x}};function eh(h,l){return h<l?-1:h>l?1:0}function vs(h,l,p,g,x){i5(h,l,p,g||h.length-1,x||rh)}function i5(h,l,p,g,x){for(;g>p;){if(g-p>600){var C=g-p+1,A=l-p+1,k=Math.log(C),N=.5*Math.exp(2*k/3),z=.5*Math.sqrt(k*N*(C-N)/C)*(A-C/2<0?-1:1);i5(h,l,Math.max(p,Math.floor(l-A*N/C+z)),Math.min(g,Math.floor(l+(C-A)*N/C+z)),x)}var q=h[l],K=p,et=g;for(I3(h,p,l),x(h[g],q)>0&&I3(h,p,g);K<et;){for(I3(h,K,et),K++,et--;x(h[K],q)<0;)K++;for(;x(h[et],q)>0;)et--}x(h[p],q)===0?I3(h,p,et):I3(h,++et,g),et<=l&&(p=et+1),l<=et&&(g=et-1)}}function I3(h,l,p){var g=h[l];h[l]=h[p],h[p]=g}function rh(h,l){return h<l?-1:h>l?1:0}function x2(h,l){if(h.length<=1)return[h];const p=[];let g,x;for(const C of h){const A=o5(C);A!==0&&(C.area=Math.abs(A),x===void 0&&(x=A<0),x===A<0?(g&&p.push(g),g=[C]):g.push(C))}if(g&&p.push(g),l>1)for(let C=0;C<p.length;C++)p[C].length<=l||(vs(p[C],l,1,p[C].length-1,V3),p[C]=p[C].slice(0,l));return p}function V3(h,l){return l.area-h.area}function o5(h){let l=0;for(let p,g,x=0,C=h.length,A=C-1;x<C;A=x++)p=h[x],g=h[A],l+=(g.x-p.x)*(p.y+g.y);return l}const c6=1/298.257223563,u6=c6*(2-c6),E2=Math.PI/180;class a5{constructor(l){const p=6378.137*E2*1e3,g=Math.cos(l*E2),x=1/(1-u6*(1-g*g)),C=Math.sqrt(x);this.kx=p*C*g,this.ky=p*C*x*(1-u6)}distance(l,p){const g=this.wrap(l[0]-p[0])*this.kx,x=(l[1]-p[1])*this.ky;return Math.sqrt(g*g+x*x)}pointOnLine(l,p){let g,x,C,A,k=1/0;for(let N=0;N<l.length-1;N++){let z=l[N][0],q=l[N][1],K=this.wrap(l[N+1][0]-z)*this.kx,et=(l[N+1][1]-q)*this.ky,st=0;K===0&&et===0||(st=(this.wrap(p[0]-z)*this.kx*K+(p[1]-q)*this.ky*et)/(K*K+et*et),st>1?(z=l[N+1][0],q=l[N+1][1]):st>0&&(z+=K/this.kx*st,q+=et/this.ky*st)),K=this.wrap(p[0]-z)*this.kx,et=(p[1]-q)*this.ky;const ut=K*K+et*et;ut<k&&(k=ut,g=z,x=q,C=N,A=st)}return{point:[g,x],index:C,t:Math.max(0,Math.min(1,A))}}wrap(l){for(;l<-180;)l+=360;for(;l>180;)l-=360;return l}}function A7(h,l){return l[0]-h[0]}function h6(h){return h[1]-h[0]+1}function ca(h,l){return h[1]>=h[0]&&h[1]<l}function R3(h,l){if(h[0]>h[1])return[null,null];const p=h6(h);if(l){if(p===2)return[h,null];const x=Math.floor(p/2);return[[h[0],h[0]+x],[h[0]+x,h[1]]]}if(p===1)return[h,null];const g=Math.floor(p/2)-1;return[[h[0],h[0]+g],[h[0]+g+1,h[1]]]}function d6(h,l){if(!ca(l,h.length))return[1/0,1/0,-1/0,-1/0];const p=[1/0,1/0,-1/0,-1/0];for(let g=l[0];g<=l[1];++g)Wr(p,h[g]);return p}function N3(h){const l=[1/0,1/0,-1/0,-1/0];for(const p of h)for(const g of p)Wr(l,g);return l}function za(h){return h[0]!==-1/0&&h[1]!==-1/0&&h[2]!==1/0&&h[3]!==1/0}function x1(h,l,p){if(!za(h)||!za(l))return NaN;let g=0,x=0;return h[2]<l[0]&&(g=l[0]-h[2]),h[0]>l[2]&&(g=h[0]-l[2]),h[1]>l[3]&&(x=h[1]-l[3]),h[3]<l[1]&&(x=l[1]-h[3]),p.distance([0,0],[g,x])}function tn(h,l,p){const g=p.pointOnLine(l,h);return p.distance(h,g.point)}function M2(h,l,p,g,x){const C=Math.min(tn(h,[p,g],x),tn(l,[p,g],x)),A=Math.min(tn(p,[h,l],x),tn(g,[h,l],x));return Math.min(C,A)}function Pr(h,l,p,g,x){if(!ca(l,h.length)||!ca(g,p.length))return 1/0;let C=1/0;for(let A=l[0];A<l[1];++A){const k=h[A],N=h[A+1];for(let z=g[0];z<g[1];++z){const q=p[z],K=p[z+1];if(k3(k,N,q,K))return 0;C=Math.min(C,M2(k,N,q,K,x))}}return C}function s5(h,l,p,g,x){if(!ca(l,h.length)||!ca(g,p.length))return NaN;let C=1/0;for(let A=l[0];A<=l[1];++A)for(let k=g[0];k<=g[1];++k)if(C=Math.min(C,x.distance(h[A],p[k])),C===0)return C;return C}function yn(h,l,p){if(w2(h,l,!0))return 0;let g=1/0;for(const x of l){const C=x[0],A=x[x.length-1];if(C!==A&&(g=Math.min(g,tn(h,[A,C],p)),g===0))return g;const k=p.pointOnLine(x,h);if(g=Math.min(g,p.distance(h,k.point)),g===0)return g}return g}function dn(h,l,p,g){if(!ca(l,h.length))return NaN;for(let C=l[0];C<=l[1];++C)if(w2(h[C],p,!0))return 0;let x=1/0;for(let C=l[0];C<l[1];++C){const A=h[C],k=h[C+1];for(const N of p)for(let z=0,q=N.length,K=q-1;z<q;K=z++){const et=N[K],st=N[z];if(k3(A,k,et,st))return 0;x=Math.min(x,M2(A,k,et,st,g))}}return x}function S2(h,l){for(const p of h)for(const g of p)if(w2(g,l,!0))return!0;return!1}function l5(h,l,p,g=1/0){const x=N3(h),C=N3(l);if(g!==1/0&&x1(x,C,p)>=g)return g;if(L2(x,C)){if(S2(h,l))return 0}else if(S2(l,h))return 0;let A=1/0;for(const k of h)for(let N=0,z=k.length,q=z-1;N<z;q=N++){const K=k[q],et=k[N];for(const st of l)for(let ut=0,Tt=st.length,Lt=Tt-1;ut<Tt;Lt=ut++){const St=st[Lt],$t=st[ut];if(k3(K,et,St,$t))return 0;A=Math.min(A,M2(K,et,St,$t,p))}}return A}function c5(h,l,p,g,x,C){if(!C)return;const A=x1(d6(g,C),x,p);A<l&&h.push([A,C,[0,0]])}function p6(h,l,p,g,x,C,A){if(!C||!A)return;const k=x1(d6(g,C),d6(x,A),p);k<l&&h.push([k,C,A])}function D3(h,l,p,g,x=1/0){let C=Math.min(g.distance(h[0],p[0][0]),x);if(C===0)return C;const A=new n5([[0,[0,h.length-1],[0,0]]],A7),k=N3(p);for(;A.length>0;){const N=A.pop();if(N[0]>=C)continue;const z=N[1],q=l?50:100;if(h6(z)<=q){if(!ca(z,h.length))return NaN;if(l){const K=dn(h,z,p,g);if(isNaN(K)||K===0)return K;C=Math.min(C,K)}else for(let K=z[0];K<=z[1];++K){const et=yn(h[K],p,g);if(C=Math.min(C,et),C===0)return 0}}else{const K=R3(z,l);c5(A,C,g,h,k,K[0]),c5(A,C,g,h,k,K[1])}}return C}function B3(h,l,p,g,x,C=1/0){let A=Math.min(C,x.distance(h[0],p[0]));if(A===0)return A;const k=new n5([[0,[0,h.length-1],[0,p.length-1]]],A7);for(;k.length>0;){const N=k.pop();if(N[0]>=A)continue;const z=N[1],q=N[2],K=l?50:100,et=g?50:100;if(h6(z)<=K&&h6(q)<=et){if(!ca(z,h.length)&&ca(q,p.length))return NaN;let st;if(l&&g)st=Pr(h,z,p,q,x),A=Math.min(A,st);else if(l&&!g){const ut=h.slice(z[0],z[1]+1);for(let Tt=q[0];Tt<=q[1];++Tt)if(st=tn(p[Tt],ut,x),A=Math.min(A,st),A===0)return A}else if(!l&&g){const ut=p.slice(q[0],q[1]+1);for(let Tt=z[0];Tt<=z[1];++Tt)if(st=tn(h[Tt],ut,x),A=Math.min(A,st),A===0)return A}else st=s5(h,z,p,q,x),A=Math.min(A,st)}else{const st=R3(z,l),ut=R3(q,g);p6(k,A,x,h,p,st[0],ut[0]),p6(k,A,x,h,p,st[0],ut[1]),p6(k,A,x,h,p,st[1],ut[0]),p6(k,A,x,h,p,st[1],ut[1])}}return A}function H2(h){return h.type==="MultiPolygon"?h.coordinates.map(l=>({type:"Polygon",coordinates:l})):h.type==="MultiLineString"?h.coordinates.map(l=>({type:"LineString",coordinates:l})):h.type==="MultiPoint"?h.coordinates.map(l=>({type:"Point",coordinates:l})):[h]}class zo{constructor(l,p){this.type=Ee,this.geojson=l,this.geometries=p}static parse(l,p){if(l.length!==2)return p.error(`'distance' expression requires exactly one argument, but found ${l.length-1} instead.`);if(Lo(l[1])){const g=l[1];if(g.type==="FeatureCollection")return new zo(g,g.features.map(x=>H2(x.geometry)).flat());if(g.type==="Feature")return new zo(g,H2(g.geometry));if("type"in g&&"coordinates"in g)return new zo(g,H2(g))}return p.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(l){if(l.geometry()!=null&&l.canonicalID()!=null){if(l.geometryType()==="Point")return function(p,g){const x=p.geometry(),C=x.flat().map(N=>b2([N.x,N.y],p.canonical));if(x.length===0)return NaN;const A=new a5(C[0][1]);let k=1/0;for(const N of g){switch(N.type){case"Point":k=Math.min(k,B3(C,!1,[N.coordinates],!1,A,k));break;case"LineString":k=Math.min(k,B3(C,!1,N.coordinates,!0,A,k));break;case"Polygon":k=Math.min(k,D3(C,!1,N.coordinates,A,k))}if(k===0)return k}return k}(l,this.geometries);if(l.geometryType()==="LineString")return function(p,g){const x=p.geometry(),C=x.flat().map(N=>b2([N.x,N.y],p.canonical));if(x.length===0)return NaN;const A=new a5(C[0][1]);let k=1/0;for(const N of g){switch(N.type){case"Point":k=Math.min(k,B3(C,!0,[N.coordinates],!1,A,k));break;case"LineString":k=Math.min(k,B3(C,!0,N.coordinates,!0,A,k));break;case"Polygon":k=Math.min(k,D3(C,!0,N.coordinates,A,k))}if(k===0)return k}return k}(l,this.geometries);if(l.geometryType()==="Polygon")return function(p,g){const x=p.geometry();if(x.length===0||x[0].length===0)return NaN;const C=x2(x,0).map(N=>N.map(z=>z.map(q=>b2([q.x,q.y],p.canonical)))),A=new a5(C[0][0][0][1]);let k=1/0;for(const N of g)for(const z of C){switch(N.type){case"Point":k=Math.min(k,D3([N.coordinates],!1,z,A,k));break;case"LineString":k=Math.min(k,D3(N.coordinates,!0,z,A,k));break;case"Polygon":k=Math.min(k,l5(z,N.coordinates,A,k))}if(k===0)return k}return k}(l,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const bs={"==":n6,"!=":J9,">":J0,"<":Dn,">=":la,"<=":M7,array:Gi,at:V,boolean:Gi,case:nt,coalesce:ar,collator:C3,format:A3,image:O3,in:Z,"index-of":F,interpolate:en,"interpolate-hcl":en,"interpolate-lab":en,length:o6,let:Gr,literal:a1,match:X,number:Gi,"number-format":i6,object:Gi,slice:dt,step:Wt,string:Gi,"to-boolean":wo,"to-color":wo,"to-number":wo,"to-string":wo,var:N1,within:ja,distance:zo};class xi{constructor(l,p,g,x){this.name=l,this.type=p,this._evaluate=g,this.args=x}evaluate(l){return this._evaluate(l,this.args)}eachChild(l){this.args.forEach(l)}outputDefined(){return!1}static parse(l,p){const g=l[0],x=xi.definitions[g];if(!x)return p.error(`Unknown expression "${g}". If you wanted a literal array, use ["literal", [...]].`,0);const C=Array.isArray(x)?x[0]:x.type,A=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,k=A.filter(([z])=>!Array.isArray(z)||z.length===l.length-1);let N=null;for(const[z,q]of k){N=new b1(p.registry,ws,p.path,null,p.scope);const K=[];let et=!1;for(let st=1;st<l.length;st++){const ut=l[st],Tt=Array.isArray(z)?z[st-1]:z.type,Lt=N.parse(ut,1+K.length,Tt);if(!Lt){et=!0;break}K.push(Lt)}if(!et)if(Array.isArray(z)&&z.length!==K.length)N.error(`Expected ${z.length} arguments, but found ${K.length} instead.`);else{for(let st=0;st<K.length;st++){const ut=Array.isArray(z)?z[st]:z.type,Tt=K[st];N.concat(st+1).checkSubtype(ut,Tt.type)}if(N.errors.length===0)return new xi(g,C,q,K)}}if(k.length===1)p.errors.push(...N.errors);else{const z=(k.length?k:A).map(([K])=>{return et=K,Array.isArray(et)?`(${et.map(at).join(", ")})`:`(${at(et.type)}...)`;var et}).join(" | "),q=[];for(let K=1;K<l.length;K++){const et=p.parse(l[K],1+q.length);if(!et)return null;q.push(at(et.type))}p.error(`Expected arguments of type ${z}, but found (${q.join(", ")}) instead.`)}return null}static register(l,p){xi.definitions=p;for(const g in p)l[g]=xi}}function u5(h,[l,p,g,x]){l=l.evaluate(h),p=p.evaluate(h),g=g.evaluate(h);const C=x?x.evaluate(h):1,A=R1(l,p,g,C);if(A)throw new Nn(A);return new Ur(l/255,p/255,g/255,C,!1)}function D1(h,l){return h in l}function f6(h,l){const p=l[h];return p===void 0?null:p}function Ls(h){return{type:h}}function ws(h){if(h instanceof N1)return ws(h.boundExpression);if(h instanceof xi&&h.name==="error"||h instanceof C3||h instanceof ja||h instanceof zo)return!1;const l=h instanceof wo||h instanceof Gi;let p=!0;return h.eachChild(g=>{p=l?p&&ws(g):p&&g instanceof a1}),!!p&&C2(h)&&F3(h,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function C2(h){if(h instanceof xi&&(h.name==="get"&&h.args.length===1||h.name==="feature-state"||h.name==="has"&&h.args.length===1||h.name==="properties"||h.name==="geometry-type"||h.name==="id"||/^filter-/.test(h.name))||h instanceof ja||h instanceof zo)return!1;let l=!0;return h.eachChild(p=>{l&&!C2(p)&&(l=!1)}),l}function A2(h){if(h instanceof xi&&h.name==="feature-state")return!1;let l=!0;return h.eachChild(p=>{l&&!A2(p)&&(l=!1)}),l}function F3(h,l){if(h instanceof xi&&l.indexOf(h.name)>=0)return!1;let p=!0;return h.eachChild(g=>{p&&!F3(g,l)&&(p=!1)}),p}function h5(h){return{result:"success",value:h}}function B1(h){return{result:"error",value:h}}function Ua(h){return h["property-type"]==="data-driven"||h["property-type"]==="cross-faded-data-driven"}function d5(h){return!!h.expression&&h.expression.parameters.indexOf("zoom")>-1}function Nt(h){return!!h.expression&&h.expression.interpolated}function Zt(h){return h instanceof Number?"number":h instanceof String?"string":h instanceof Boolean?"boolean":Array.isArray(h)?"array":h===null?"null":typeof h}function Oe(h){return typeof h=="object"&&h!==null&&!Array.isArray(h)}function pr(h){return h}function En(h,l){const p=l.type==="color",g=h.stops&&typeof h.stops[0][0]=="object",x=g||!(g||h.property!==void 0),C=h.type||(Nt(l)?"exponential":"interval");if(p||l.type==="padding"){const q=p?Ur.parse:Xn.parse;(h=gi({},h)).stops&&(h.stops=h.stops.map(K=>[K[0],q(K[1])])),h.default=q(h.default?h.default:l.default)}if(h.colorSpace&&(A=h.colorSpace)!=="rgb"&&A!=="hcl"&&A!=="lab")throw new Error(`Unknown color space: "${h.colorSpace}"`);var A;let k,N,z;if(C==="exponential")k=Uo;else if(C==="interval")k=si;else if(C==="categorical"){k=Kn,N=Object.create(null);for(const q of h.stops)N[q[0]]=q[1];z=typeof h.stops[0][0]}else{if(C!=="identity")throw new Error(`Unknown function type "${C}"`);k=yi}if(g){const q={},K=[];for(let ut=0;ut<h.stops.length;ut++){const Tt=h.stops[ut],Lt=Tt[0].zoom;q[Lt]===void 0&&(q[Lt]={zoom:Lt,type:h.type,property:h.property,default:h.default,stops:[]},K.push(Lt)),q[Lt].stops.push([Tt[0].value,Tt[1]])}const et=[];for(const ut of K)et.push([q[ut].zoom,En(q[ut],l)]);const st={name:"linear"};return{kind:"composite",interpolationType:st,interpolationFactor:en.interpolationFactor.bind(void 0,st),zoomStops:et.map(ut=>ut[0]),evaluate:({zoom:ut},Tt)=>Uo({stops:et,base:h.base},l,ut).evaluate(ut,Tt)}}if(x){const q=C==="exponential"?{name:"exponential",base:h.base!==void 0?h.base:1}:null;return{kind:"camera",interpolationType:q,interpolationFactor:en.interpolationFactor.bind(void 0,q),zoomStops:h.stops.map(K=>K[0]),evaluate:({zoom:K})=>k(h,l,K,N,z)}}return{kind:"source",evaluate(q,K){const et=K&&K.properties?K.properties[h.property]:void 0;return et===void 0?Nr(h.default,l.default):k(h,l,et,N,z)}}}function Nr(h,l,p){return h!==void 0?h:l!==void 0?l:p!==void 0?p:void 0}function Kn(h,l,p,g,x){return Nr(typeof p===x?g[p]:void 0,h.default,l.default)}function si(h,l,p){if(Zt(p)!=="number")return Nr(h.default,l.default);const g=h.stops.length;if(g===1||p<=h.stops[0][0])return h.stops[0][1];if(p>=h.stops[g-1][0])return h.stops[g-1][1];const x=gt(h.stops.map(C=>C[0]),p);return h.stops[x][1]}function Uo(h,l,p){const g=h.base!==void 0?h.base:1;if(Zt(p)!=="number")return Nr(h.default,l.default);const x=h.stops.length;if(x===1||p<=h.stops[0][0])return h.stops[0][1];if(p>=h.stops[x-1][0])return h.stops[x-1][1];const C=gt(h.stops.map(q=>q[0]),p),A=function(q,K,et,st){const ut=st-et,Tt=q-et;return ut===0?0:K===1?Tt/ut:(Math.pow(K,Tt)-1)/(Math.pow(K,ut)-1)}(p,g,h.stops[C][0],h.stops[C+1][0]),k=h.stops[C][1],N=h.stops[C+1][1],z=Qr[l.type]||pr;return typeof k.evaluate=="function"?{evaluate(...q){const K=k.evaluate.apply(void 0,q),et=N.evaluate.apply(void 0,q);if(K!==void 0&&et!==void 0)return z(K,et,A,h.colorSpace)}}:z(k,N,A,h.colorSpace)}function yi(h,l,p){switch(l.type){case"color":p=Ur.parse(p);break;case"formatted":p=Fr.fromString(p.toString());break;case"resolvedImage":p=Kr.fromString(p.toString());break;case"padding":p=Xn.parse(p);break;default:Zt(p)===l.type||l.type==="enum"&&l.values[p]||(p=void 0)}return Nr(p,h.default,l.default)}xi.register(bs,{error:[{kind:"error"},[kr],(h,[l])=>{throw new Nn(l.evaluate(h))}],typeof:[kr,[Tr],(h,[l])=>at(cn(l.evaluate(h)))],"to-rgba":[ot(Ee,4),[ai],(h,[l])=>{const[p,g,x,C]=l.evaluate(h).rgb;return[255*p,255*g,255*x,C]}],rgb:[ai,[Ee,Ee,Ee],u5],rgba:[ai,[Ee,Ee,Ee,Ee],u5],has:{type:fr,overloads:[[[kr],(h,[l])=>D1(l.evaluate(h),h.properties())],[[kr,lo],(h,[l,p])=>D1(l.evaluate(h),p.evaluate(h))]]},get:{type:Tr,overloads:[[[kr],(h,[l])=>f6(l.evaluate(h),h.properties())],[[kr,lo],(h,[l,p])=>f6(l.evaluate(h),p.evaluate(h))]]},"feature-state":[Tr,[kr],(h,[l])=>f6(l.evaluate(h),h.featureState||{})],properties:[lo,[],h=>h.properties()],"geometry-type":[kr,[],h=>h.geometryType()],id:[Tr,[],h=>h.id()],zoom:[Ee,[],h=>h.globals.zoom],"heatmap-density":[Ee,[],h=>h.globals.heatmapDensity||0],"line-progress":[Ee,[],h=>h.globals.lineProgress||0],accumulated:[Tr,[],h=>h.globals.accumulated===void 0?null:h.globals.accumulated],"+":[Ee,Ls(Ee),(h,l)=>{let p=0;for(const g of l)p+=g.evaluate(h);return p}],"*":[Ee,Ls(Ee),(h,l)=>{let p=1;for(const g of l)p*=g.evaluate(h);return p}],"-":{type:Ee,overloads:[[[Ee,Ee],(h,[l,p])=>l.evaluate(h)-p.evaluate(h)],[[Ee],(h,[l])=>-l.evaluate(h)]]},"/":[Ee,[Ee,Ee],(h,[l,p])=>l.evaluate(h)/p.evaluate(h)],"%":[Ee,[Ee,Ee],(h,[l,p])=>l.evaluate(h)%p.evaluate(h)],ln2:[Ee,[],()=>Math.LN2],pi:[Ee,[],()=>Math.PI],e:[Ee,[],()=>Math.E],"^":[Ee,[Ee,Ee],(h,[l,p])=>Math.pow(l.evaluate(h),p.evaluate(h))],sqrt:[Ee,[Ee],(h,[l])=>Math.sqrt(l.evaluate(h))],log10:[Ee,[Ee],(h,[l])=>Math.log(l.evaluate(h))/Math.LN10],ln:[Ee,[Ee],(h,[l])=>Math.log(l.evaluate(h))],log2:[Ee,[Ee],(h,[l])=>Math.log(l.evaluate(h))/Math.LN2],sin:[Ee,[Ee],(h,[l])=>Math.sin(l.evaluate(h))],cos:[Ee,[Ee],(h,[l])=>Math.cos(l.evaluate(h))],tan:[Ee,[Ee],(h,[l])=>Math.tan(l.evaluate(h))],asin:[Ee,[Ee],(h,[l])=>Math.asin(l.evaluate(h))],acos:[Ee,[Ee],(h,[l])=>Math.acos(l.evaluate(h))],atan:[Ee,[Ee],(h,[l])=>Math.atan(l.evaluate(h))],min:[Ee,Ls(Ee),(h,l)=>Math.min(...l.map(p=>p.evaluate(h)))],max:[Ee,Ls(Ee),(h,l)=>Math.max(...l.map(p=>p.evaluate(h)))],abs:[Ee,[Ee],(h,[l])=>Math.abs(l.evaluate(h))],round:[Ee,[Ee],(h,[l])=>{const p=l.evaluate(h);return p<0?-Math.round(-p):Math.round(p)}],floor:[Ee,[Ee],(h,[l])=>Math.floor(l.evaluate(h))],ceil:[Ee,[Ee],(h,[l])=>Math.ceil(l.evaluate(h))],"filter-==":[fr,[kr,Tr],(h,[l,p])=>h.properties()[l.value]===p.value],"filter-id-==":[fr,[Tr],(h,[l])=>h.id()===l.value],"filter-type-==":[fr,[kr],(h,[l])=>h.geometryType()===l.value],"filter-<":[fr,[kr,Tr],(h,[l,p])=>{const g=h.properties()[l.value],x=p.value;return typeof g==typeof x&&g<x}],"filter-id-<":[fr,[Tr],(h,[l])=>{const p=h.id(),g=l.value;return typeof p==typeof g&&p<g}],"filter->":[fr,[kr,Tr],(h,[l,p])=>{const g=h.properties()[l.value],x=p.value;return typeof g==typeof x&&g>x}],"filter-id->":[fr,[Tr],(h,[l])=>{const p=h.id(),g=l.value;return typeof p==typeof g&&p>g}],"filter-<=":[fr,[kr,Tr],(h,[l,p])=>{const g=h.properties()[l.value],x=p.value;return typeof g==typeof x&&g<=x}],"filter-id-<=":[fr,[Tr],(h,[l])=>{const p=h.id(),g=l.value;return typeof p==typeof g&&p<=g}],"filter->=":[fr,[kr,Tr],(h,[l,p])=>{const g=h.properties()[l.value],x=p.value;return typeof g==typeof x&&g>=x}],"filter-id->=":[fr,[Tr],(h,[l])=>{const p=h.id(),g=l.value;return typeof p==typeof g&&p>=g}],"filter-has":[fr,[Tr],(h,[l])=>l.value in h.properties()],"filter-has-id":[fr,[],h=>h.id()!==null&&h.id()!==void 0],"filter-type-in":[fr,[ot(kr)],(h,[l])=>l.value.indexOf(h.geometryType())>=0],"filter-id-in":[fr,[ot(Tr)],(h,[l])=>l.value.indexOf(h.id())>=0],"filter-in-small":[fr,[kr,ot(Tr)],(h,[l,p])=>p.value.indexOf(h.properties()[l.value])>=0],"filter-in-large":[fr,[kr,ot(Tr)],(h,[l,p])=>function(g,x,C,A){for(;C<=A;){const k=C+A>>1;if(x[k]===g)return!0;x[k]>g?A=k-1:C=k+1}return!1}(h.properties()[l.value],p.value,0,p.value.length-1)],all:{type:fr,overloads:[[[fr,fr],(h,[l,p])=>l.evaluate(h)&&p.evaluate(h)],[Ls(fr),(h,l)=>{for(const p of l)if(!p.evaluate(h))return!1;return!0}]]},any:{type:fr,overloads:[[[fr,fr],(h,[l,p])=>l.evaluate(h)||p.evaluate(h)],[Ls(fr),(h,l)=>{for(const p of l)if(p.evaluate(h))return!0;return!1}]]},"!":[fr,[fr],(h,[l])=>!l.evaluate(h)],"is-supported-script":[fr,[kr],(h,[l])=>{const p=h.globals&&h.globals.isSupportedScript;return!p||p(l.evaluate(h))}],upcase:[kr,[kr],(h,[l])=>l.evaluate(h).toUpperCase()],downcase:[kr,[kr],(h,[l])=>l.evaluate(h).toLowerCase()],concat:[kr,Ls(Tr),(h,l)=>l.map(p=>hi(p.evaluate(h))).join("")],"resolved-locale":[kr,[ui],(h,[l])=>l.evaluate(h).resolvedLocale()]});class di{constructor(l,p){var g;this.expression=l,this._warningHistory={},this._evaluator=new _s,this._defaultValue=p?(g=p).type==="color"&&Oe(g.default)?new Ur(0,0,0,0):g.type==="color"?Ur.parse(g.default)||null:g.type==="padding"?Xn.parse(g.default)||null:g.type==="variableAnchorOffsetCollection"?ln.parse(g.default)||null:g.default===void 0?null:g.default:null,this._enumValues=p&&p.type==="enum"?p.values:null}evaluateWithoutErrorHandling(l,p,g,x,C,A){return this._evaluator.globals=l,this._evaluator.feature=p,this._evaluator.featureState=g,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=A,this.expression.evaluate(this._evaluator)}evaluate(l,p,g,x,C,A){this._evaluator.globals=l,this._evaluator.feature=p||null,this._evaluator.featureState=g||null,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=A||null;try{const k=this.expression.evaluate(this._evaluator);if(k==null||typeof k=="number"&&k!=k)return this._defaultValue;if(this._enumValues&&!(k in this._enumValues))throw new Nn(`Expected value to be one of ${Object.keys(this._enumValues).map(N=>JSON.stringify(N)).join(", ")}, but found ${JSON.stringify(k)} instead.`);return k}catch(k){return this._warningHistory[k.message]||(this._warningHistory[k.message]=!0,typeof console<"u"&&console.warn(k.message)),this._defaultValue}}}function xo(h){return Array.isArray(h)&&h.length>0&&typeof h[0]=="string"&&h[0]in bs}function co(h,l){const p=new b1(bs,ws,[],l?function(x){const C={color:ai,string:kr,number:Ee,enum:kr,boolean:fr,formatted:bo,padding:Ji,resolvedImage:wn,variableAnchorOffsetCollection:xt};return x.type==="array"?ot(C[x.value]||Tr,x.length):C[x.type]}(l):void 0),g=p.parse(h,void 0,void 0,void 0,l&&l.type==="string"?{typeAnnotation:"coerce"}:void 0);return g?h5(new di(g,l)):B1(p.errors)}class $i{constructor(l,p){this.kind=l,this._styleExpression=p,this.isStateDependent=l!=="constant"&&!A2(p.expression)}evaluateWithoutErrorHandling(l,p,g,x,C,A){return this._styleExpression.evaluateWithoutErrorHandling(l,p,g,x,C,A)}evaluate(l,p,g,x,C,A){return this._styleExpression.evaluate(l,p,g,x,C,A)}}class E1{constructor(l,p,g,x){this.kind=l,this.zoomStops=g,this._styleExpression=p,this.isStateDependent=l!=="camera"&&!A2(p.expression),this.interpolationType=x}evaluateWithoutErrorHandling(l,p,g,x,C,A){return this._styleExpression.evaluateWithoutErrorHandling(l,p,g,x,C,A)}evaluate(l,p,g,x,C,A){return this._styleExpression.evaluate(l,p,g,x,C,A)}interpolationFactor(l,p,g){return this.interpolationType?en.interpolationFactor(this.interpolationType,l,p,g):0}}function xs(h,l){const p=co(h,l);if(p.result==="error")return p;const g=p.value.expression,x=C2(g);if(!x&&!Ua(l))return B1([new Vn("","data expressions not supported")]);const C=F3(g,["zoom"]);if(!C&&!d5(l))return B1([new Vn("","zoom expressions not supported")]);const A=ua(g);return A||C?A instanceof Vn?B1([A]):A instanceof en&&!Nt(l)?B1([new Vn("",'"interpolate" expressions cannot be used with this property')]):h5(A?new E1(x?"camera":"composite",p.value,A.labels,A instanceof en?A.interpolation:void 0):new $i(x?"constant":"source",p.value)):B1([new Vn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Es{constructor(l,p){this._parameters=l,this._specification=p,gi(this,En(this._parameters,this._specification))}static deserialize(l){return new Es(l._parameters,l._specification)}static serialize(l){return{_parameters:l._parameters,_specification:l._specification}}}function ua(h){let l=null;if(h instanceof Gr)l=ua(h.result);else if(h instanceof ar){for(const p of h.args)if(l=ua(p),l)break}else(h instanceof Wt||h instanceof en)&&h.input instanceof xi&&h.input.name==="zoom"&&(l=h);return l instanceof Vn||h.eachChild(p=>{const g=ua(p);g instanceof Vn?l=g:!l&&g?l=new Vn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):l&&g&&l!==g&&(l=new Vn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),l}function F1(h){if(h===!0||h===!1)return!0;if(!Array.isArray(h)||h.length===0)return!1;switch(h[0]){case"has":return h.length>=2&&h[1]!=="$id"&&h[1]!=="$type";case"in":return h.length>=3&&(typeof h[1]!="string"||Array.isArray(h[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return h.length!==3||Array.isArray(h[1])||Array.isArray(h[2]);case"any":case"all":for(const l of h.slice(1))if(!F1(l)&&typeof l!="boolean")return!1;return!0;default:return!0}}const j3={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function uo(h){if(h==null)return{filter:()=>!0,needGeometry:!1};F1(h)||(h=rn(h));const l=co(h,j3);if(l.result==="error")throw new Error(l.value.map(p=>`${p.key}: ${p.message}`).join(", "));return{filter:(p,g,x)=>l.value.evaluate(p,g,{},x),needGeometry:fn(h)}}function z3(h,l){return h<l?-1:h>l?1:0}function fn(h){if(!Array.isArray(h))return!1;if(h[0]==="within"||h[0]==="distance")return!0;for(let l=1;l<h.length;l++)if(fn(h[l]))return!0;return!1}function rn(h){if(!h)return!0;const l=h[0];return h.length<=1?l!=="any":l==="=="?O2(h[1],h[2],"=="):l==="!="?Zi(O2(h[1],h[2],"==")):l==="<"||l===">"||l==="<="||l===">="?O2(h[1],h[2],l):l==="any"?(p=h.slice(1),["any"].concat(p.map(rn))):l==="all"?["all"].concat(h.slice(1).map(rn)):l==="none"?["all"].concat(h.slice(1).map(rn).map(Zi)):l==="in"?Go(h[1],h.slice(2)):l==="!in"?Zi(Go(h[1],h.slice(2))):l==="has"?U3(h[1]):l!=="!has"||Zi(U3(h[1]));var p}function O2(h,l,p){switch(h){case"$type":return[`filter-type-${p}`,l];case"$id":return[`filter-id-${p}`,l];default:return[`filter-${p}`,h,l]}}function Go(h,l){if(l.length===0)return!1;switch(h){case"$type":return["filter-type-in",["literal",l]];case"$id":return["filter-id-in",["literal",l]];default:return l.length>200&&!l.some(p=>typeof p!=typeof l[0])?["filter-in-large",h,["literal",l.sort(z3)]]:["filter-in-small",h,["literal",l]]}}function U3(h){switch(h){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",h]}}function Zi(h){return["!",h]}function M1(h){const l=typeof h;if(l==="number"||l==="boolean"||l==="string"||h==null)return JSON.stringify(h);if(Array.isArray(h)){let x="[";for(const C of h)x+=`${M1(C)},`;return`${x}]`}const p=Object.keys(h).sort();let g="{";for(let x=0;x<p.length;x++)g+=`${JSON.stringify(p[x])}:${M1(h[p[x]])},`;return`${g}}`}function j1(h){let l="";for(const p of jr)l+=`/${M1(h[p])}`;return l}function k2(h){const l=h.value;return l?[new de(h.key,l,"constants have been deprecated as of v8")]:[]}function Tn(h){return h instanceof Number||h instanceof String||h instanceof Boolean?h.valueOf():h}function s1(h){if(Array.isArray(h))return h.map(s1);if(h instanceof Object&&!(h instanceof Number||h instanceof String||h instanceof Boolean)){const l={};for(const p in h)l[p]=s1(h[p]);return l}return Tn(h)}function Ei(h){const l=h.key,p=h.value,g=h.valueSpec||{},x=h.objectElementValidators||{},C=h.style,A=h.styleSpec,k=h.validateSpec;let N=[];const z=Zt(p);if(z!=="object")return[new de(l,p,`object expected, ${z} found`)];for(const q in p){const K=q.split(".")[0],et=g[K]||g["*"];let st;if(x[K])st=x[K];else if(g[K])st=k;else if(x["*"])st=x["*"];else{if(!g["*"]){N.push(new de(l,p[q],`unknown property "${q}"`));continue}st=k}N=N.concat(st({key:(l&&`${l}.`)+q,value:p[q],valueSpec:et,style:C,styleSpec:A,object:p,objectKey:q,validateSpec:k},p))}for(const q in g)x[q]||g[q].required&&g[q].default===void 0&&p[q]===void 0&&N.push(new de(l,p,`missing required property "${q}"`));return N}function G3(h){const l=h.value,p=h.valueSpec,g=h.style,x=h.styleSpec,C=h.key,A=h.arrayElementValidator||h.validateSpec;if(Zt(l)!=="array")return[new de(C,l,`array expected, ${Zt(l)} found`)];if(p.length&&l.length!==p.length)return[new de(C,l,`array length ${p.length} expected, length ${l.length} found`)];if(p["min-length"]&&l.length<p["min-length"])return[new de(C,l,`array length at least ${p["min-length"]} expected, length ${l.length} found`)];let k={type:p.value,values:p.values};x.$version<7&&(k.function=p.function),Zt(p.value)==="object"&&(k=p.value);let N=[];for(let z=0;z<l.length;z++)N=N.concat(A({array:l,arrayIndex:z,value:l[z],valueSpec:k,validateSpec:h.validateSpec,style:g,styleSpec:x,key:`${C}[${z}]`}));return N}function Ga(h){const l=h.key,p=h.value,g=h.valueSpec;let x=Zt(p);return x==="number"&&p!=p&&(x="NaN"),x!=="number"?[new de(l,p,`number expected, ${x} found`)]:"minimum"in g&&p<g.minimum?[new de(l,p,`${p} is less than the minimum value ${g.minimum}`)]:"maximum"in g&&p>g.maximum?[new de(l,p,`${p} is greater than the maximum value ${g.maximum}`)]:[]}function $3(h){const l=h.valueSpec,p=Tn(h.value.type);let g,x,C,A={};const k=p!=="categorical"&&h.value.property===void 0,N=!k,z=Zt(h.value.stops)==="array"&&Zt(h.value.stops[0])==="array"&&Zt(h.value.stops[0][0])==="object",q=Ei({key:h.key,value:h.value,valueSpec:h.styleSpec.function,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,objectElementValidators:{stops:function(st){if(p==="identity")return[new de(st.key,st.value,'identity function may not have a "stops" property')];let ut=[];const Tt=st.value;return ut=ut.concat(G3({key:st.key,value:Tt,valueSpec:st.valueSpec,validateSpec:st.validateSpec,style:st.style,styleSpec:st.styleSpec,arrayElementValidator:K})),Zt(Tt)==="array"&&Tt.length===0&&ut.push(new de(st.key,Tt,"array must have at least one stop")),ut},default:function(st){return st.validateSpec({key:st.key,value:st.value,valueSpec:l,validateSpec:st.validateSpec,style:st.style,styleSpec:st.styleSpec})}}});return p==="identity"&&k&&q.push(new de(h.key,h.value,'missing required property "property"')),p==="identity"||h.value.stops||q.push(new de(h.key,h.value,'missing required property "stops"')),p==="exponential"&&h.valueSpec.expression&&!Nt(h.valueSpec)&&q.push(new de(h.key,h.value,"exponential functions not supported")),h.styleSpec.$version>=8&&(N&&!Ua(h.valueSpec)?q.push(new de(h.key,h.value,"property functions not supported")):k&&!d5(h.valueSpec)&&q.push(new de(h.key,h.value,"zoom functions not supported"))),p!=="categorical"&&!z||h.value.property!==void 0||q.push(new de(h.key,h.value,'"property" property is required')),q;function K(st){let ut=[];const Tt=st.value,Lt=st.key;if(Zt(Tt)!=="array")return[new de(Lt,Tt,`array expected, ${Zt(Tt)} found`)];if(Tt.length!==2)return[new de(Lt,Tt,`array length 2 expected, length ${Tt.length} found`)];if(z){if(Zt(Tt[0])!=="object")return[new de(Lt,Tt,`object expected, ${Zt(Tt[0])} found`)];if(Tt[0].zoom===void 0)return[new de(Lt,Tt,"object stop key must have zoom")];if(Tt[0].value===void 0)return[new de(Lt,Tt,"object stop key must have value")];if(C&&C>Tn(Tt[0].zoom))return[new de(Lt,Tt[0].zoom,"stop zoom values must appear in ascending order")];Tn(Tt[0].zoom)!==C&&(C=Tn(Tt[0].zoom),x=void 0,A={}),ut=ut.concat(Ei({key:`${Lt}[0]`,value:Tt[0],valueSpec:{zoom:{}},validateSpec:st.validateSpec,style:st.style,styleSpec:st.styleSpec,objectElementValidators:{zoom:Ga,value:et}}))}else ut=ut.concat(et({key:`${Lt}[0]`,value:Tt[0],valueSpec:{},validateSpec:st.validateSpec,style:st.style,styleSpec:st.styleSpec},Tt));return xo(s1(Tt[1]))?ut.concat([new de(`${Lt}[1]`,Tt[1],"expressions are not allowed in function stops.")]):ut.concat(st.validateSpec({key:`${Lt}[1]`,value:Tt[1],valueSpec:l,validateSpec:st.validateSpec,style:st.style,styleSpec:st.styleSpec}))}function et(st,ut){const Tt=Zt(st.value),Lt=Tn(st.value),St=st.value!==null?st.value:ut;if(g){if(Tt!==g)return[new de(st.key,St,`${Tt} stop domain type must match previous stop domain type ${g}`)]}else g=Tt;if(Tt!=="number"&&Tt!=="string"&&Tt!=="boolean")return[new de(st.key,St,"stop domain value must be a number, string, or boolean")];if(Tt!=="number"&&p!=="categorical"){let $t=`number expected, ${Tt} found`;return Ua(l)&&p===void 0&&($t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new de(st.key,St,$t)]}return p!=="categorical"||Tt!=="number"||isFinite(Lt)&&Math.floor(Lt)===Lt?p!=="categorical"&&Tt==="number"&&x!==void 0&&Lt<x?[new de(st.key,St,"stop domain values must appear in ascending order")]:(x=Lt,p==="categorical"&&Lt in A?[new de(st.key,St,"stop domain values must be unique")]:(A[Lt]=!0,[])):[new de(st.key,St,`integer expected, found ${Lt}`)]}}function z1(h){const l=(h.expressionContext==="property"?xs:co)(s1(h.value),h.valueSpec);if(l.result==="error")return l.value.map(g=>new de(`${h.key}${g.key}`,h.value,g.message));const p=l.value.expression||l.value._styleExpression.expression;if(h.expressionContext==="property"&&h.propertyKey==="text-font"&&!p.outputDefined())return[new de(h.key,h.value,`Invalid data expression for "${h.propertyKey}". Output values must be contained as literals within the expression.`)];if(h.expressionContext==="property"&&h.propertyType==="layout"&&!A2(p))return[new de(h.key,h.value,'"feature-state" data expressions are not supported with layout properties.')];if(h.expressionContext==="filter"&&!A2(p))return[new de(h.key,h.value,'"feature-state" data expressions are not supported with filters.')];if(h.expressionContext&&h.expressionContext.indexOf("cluster")===0){if(!F3(p,["zoom","feature-state"]))return[new de(h.key,h.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(h.expressionContext==="cluster-initial"&&!C2(p))return[new de(h.key,h.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function $a(h){const l=h.key,p=h.value,g=h.valueSpec,x=[];return Array.isArray(g.values)?g.values.indexOf(Tn(p))===-1&&x.push(new de(l,p,`expected one of [${g.values.join(", ")}], ${JSON.stringify(p)} found`)):Object.keys(g.values).indexOf(Tn(p))===-1&&x.push(new de(l,p,`expected one of [${Object.keys(g.values).join(", ")}], ${JSON.stringify(p)} found`)),x}function P2(h){return F1(s1(h.value))?z1(gi({},h,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Za(h)}function Za(h){const l=h.value,p=h.key;if(Zt(l)!=="array")return[new de(p,l,`array expected, ${Zt(l)} found`)];const g=h.styleSpec;let x,C=[];if(l.length<1)return[new de(p,l,"filter array must have at least 1 element")];switch(C=C.concat($a({key:`${p}[0]`,value:l[0],valueSpec:g.filter_operator,style:h.style,styleSpec:h.styleSpec})),Tn(l[0])){case"<":case"<=":case">":case">=":l.length>=2&&Tn(l[1])==="$type"&&C.push(new de(p,l,`"$type" cannot be use with operator "${l[0]}"`));case"==":case"!=":l.length!==3&&C.push(new de(p,l,`filter array for operator "${l[0]}" must have 3 elements`));case"in":case"!in":l.length>=2&&(x=Zt(l[1]),x!=="string"&&C.push(new de(`${p}[1]`,l[1],`string expected, ${x} found`)));for(let A=2;A<l.length;A++)x=Zt(l[A]),Tn(l[1])==="$type"?C=C.concat($a({key:`${p}[${A}]`,value:l[A],valueSpec:g.geometry_type,style:h.style,styleSpec:h.styleSpec})):x!=="string"&&x!=="number"&&x!=="boolean"&&C.push(new de(`${p}[${A}]`,l[A],`string, number, or boolean expected, ${x} found`));break;case"any":case"all":case"none":for(let A=1;A<l.length;A++)C=C.concat(Za({key:`${p}[${A}]`,value:l[A],style:h.style,styleSpec:h.styleSpec}));break;case"has":case"!has":x=Zt(l[1]),l.length!==2?C.push(new de(p,l,`filter array for "${l[0]}" operator must have 2 elements`)):x!=="string"&&C.push(new de(`${p}[1]`,l[1],`string expected, ${x} found`))}return C}function I2(h,l){const p=h.key,g=h.validateSpec,x=h.style,C=h.styleSpec,A=h.value,k=h.objectKey,N=C[`${l}_${h.layerType}`];if(!N)return[];const z=k.match(/^(.*)-transition$/);if(l==="paint"&&z&&N[z[1]]&&N[z[1]].transition)return g({key:p,value:A,valueSpec:C.transition,style:x,styleSpec:C});const q=h.valueSpec||N[k];if(!q)return[new de(p,A,`unknown property "${k}"`)];let K;if(Zt(A)==="string"&&Ua(q)&&!q.tokens&&(K=/^{([^}]+)}$/.exec(A)))return[new de(p,A,`"${k}" does not support interpolation syntax
@@ -1726,4 +1726,4 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
1726
1726
  state: () => new MyClass()
1727
1727
  Found in store "${U.$id}".`),L&&o&&r.hydrate&&r.hydrate(U.$state,L),d=!0,f=!0,U}function Vzt(t,e,r){let n,i;const o=typeof e=="function";n=t,i=o?r:e;function a(s,u){const d=y.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&K9&&K9._testing?null:s)||(d?y.inject(Ozt,null):null),s&&Ng(s),process.env.NODE_ENV!=="production"&&!K9)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
1728
1728
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
1729
- This will fail in production.`);s=K9,s._s.has(n)||(o?OS(n,e,i,s):Iq(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const T="__hot:"+n,Q=o?OS(T,e,i,s,!0):Iq(T,Da({},i),s,!0);u._hotUpdate(Q),delete s.state.value[T],s._s.delete(T)}if(process.env.NODE_ENV!=="production"&&HS){const T=y.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,_="_pStores"in Q?Q._pStores:Q._pStores={};_[n]=f}}return f}return a.$id=n,a}function Rzt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const Nzt=Vzt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),Dzt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},Vq=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${e}.${o.label}`},s=Vq(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},Bzt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},Fzt={name:"FlatmapVuer",components:{Button:sO,Col:Lc,Loading:dst,Radio:LO,Icon:T1,RadioGroup:wO,Row:bc,Select:gd,Dialog:Mat,MapSvgIcon:SH.MapSvgIcon,MapSvgSpriteColor:SH.MapSvgSpriteColor,Tooltip:_y.Tooltip,TreeControls:_y.TreeControls,SelectionsGroup:VO,SvgLegends:RO,ElIconWarningFilled:NC,ElIconArrowDown:By,ElIconArrowLeft:VC,DrawToolbar:_y.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:y.markRaw(new Czt(`${t.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(this.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},t==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(t==="tool"){if(e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=e}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"&&this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1),this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?(this.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),n},addAnnotationFeature:async function(){if(this.mapImp&&(this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.featureAnnotationSubmitted||(this.loading=!0);const t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=Vq(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{NO(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},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(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),s=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(a.includes(_.models)){u=!1;return}}),u&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.selectGeoJSONFeatures("-1"),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const u={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.featuresAlert=e.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},changeViewingMode:function(t){t&&(this.viewingMode=t),this.closeTooltip()},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,Dzt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,a=this.$refs[i||o];if(a){const{parentElement:s,nextElementSibling:u}=a.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(s)||d(u))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.tooltipEntry)),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.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(){var t,e;this.sensor=y.markRaw(new Ast(this.$refs.display,this.mapResize)),console.log(this.mapImp.options),((t=this.mapImp.options)==null?void 0:t.style)==="functional"?this.isFC=!0:((e=this.mapImp.options)==null?void 0:e.style)==="centreline"&&(this.isCentreLine=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.isCentreLine||this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!this.isCentreLine,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.tooltipEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&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(t){return this.mapImp?this.mapImp.search(t):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:4},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},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},connectivityInfoSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManager:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:y.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:Hst,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Mst,tooltipEntry:Bzt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:"View internal identifiers of features"},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:y.markRaw({alert:{with:!0,without:!0}})}},computed:{...Rzt(Nzt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},mounted:function(){this.openMapRef=y.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=y.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=y.markRaw(new xS(this.flatmapAPI)),this.flatmapQueries=y.markRaw(new Sst),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},gs=t=>(y.pushScopeId("data-v-d272b145"),t=t(),y.popScopeId(),t),jzt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},zzt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Uzt={style:{height:"100%",width:"100%"},ref:"display"},Gzt={class:"beta-popovers"},$zt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Zzt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Wzt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),qzt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Xzt=gs(()=>y.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Kzt={key:1,class:"warning-text"},Yzt=gs(()=>y.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Jzt=gs(()=>y.createElementVNode("b",null,"Neuron Connection mode",-1)),tUt=gs(()=>y.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)),eUt=gs(()=>y.createElementVNode("b",null,"Now can display up to 6 panes",-1)),rUt=gs(()=>y.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)),nUt={class:"bottom-right-control"},iUt=gs(()=>y.createElementVNode("div",null,[y.createTextVNode(" Fit to "),y.createElementVNode("br"),y.createTextVNode(" window ")],-1)),oUt=["innerHTML"],aUt=["innerHTML"],sUt={style:{"margin-bottom":"2px"}},lUt={key:0,class:"viewing-mode-title"},cUt=["onClick"],uUt=["onClick"];function hUt(t,e,r,n,i,o){const a=y.resolveComponent("map-svg-sprite-color"),s=NC,u=T1,d=yd,f=By,T=y.resolveComponent("DrawToolbar"),Q=y.resolveComponent("map-svg-icon"),_=RO,L=y.resolveComponent("tree-controls"),b=VO,M=VC,E=sO,O=bc,P=Lc,D=L_,j=gd,$=LO,U=wO,tt=y.resolveComponent("Tooltip"),it=kO,lt=x_;return y.withDirectives((y.openBlock(),y.createElementBlock("div",jzt,[y.createVNode(a),y.createElementVNode("div",zzt,[y.createElementVNode("div",Uzt,null,512),y.withDirectives(y.createElementVNode("div",Gzt,[y.createElementVNode("div",null,[y.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:y.withCtx(()=>[r.displayWarning?(y.openBlock(),y.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=rt=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=rt=>o.hideTooltip(7))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),r.isLegacy?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[Xzt,y.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(y.openBlock(),y.createElementBlock("span",Kzt,"Beta"))],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[r.isLegacy?(y.openBlock(),y.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=rt=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(y.openBlock(),y.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),$zt,y.createTextVNode(" models available in "),Zzt,y.createTextVNode(". ")],32)):(y.openBlock(),y.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),Wzt,y.createTextVNode(" models available in "),qzt,y.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(y.openBlock(),y.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:y.withCtx(()=>[r.displayLatestChanges?(y.openBlock(),y.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=rt=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=rt=>o.hideTooltip(8))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),Yzt],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[Jzt,tUt,eUt,rUt]),_:1},8,["visible"])):y.createCommentVNode("",!0)],512),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(u,{class:y.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:y.withCtx(()=>[y.createVNode(f)]),_:1},8,["class","onClick"]),[[y.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(y.openBlock(),y.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,drawnType:t.drawnType,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("div",nUt,[y.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[11]||(e[11]=rt=>o.zoomIn()),onMouseover:e[12]||(e[12]=rt=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),y.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[14]||(e[14]=rt=>o.zoomOut()),onMouseover:e[15]||(e[15]=rt=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=rt=>o.hideTooltip(2))})]),_:1},8,["visible"]),y.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[17]||(e[17]=rt=>o.resetView()),onMouseover:e[18]||(e[18]=rt=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=rt=>o.hideTooltip(3))})]),default:y.withCtx(()=>[iUt]),_:1},8,["visible"])],512),[[y.vShow,!r.disableUI]]),y.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.withDirectives((y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:y.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?y.createCommentVNode("",!0):(y.openBlock(),y.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(y.openBlock(),y.createBlock(d,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=rt=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=rt=>o.hideTooltip(9))},null,40,oUt),[[it,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):y.createCommentVNode("",!0),y.createVNode(d,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:t.hoverVisibilities[5].value,ref:"markerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,aUt),[[y.vShow,t.hoverVisibilities[0].value],[it,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(y.openBlock(),y.createBlock(L,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):y.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(y.openBlock(),y.createBlock(b,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(y.openBlock(),y.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(y.openBlock(),y.createBlock(b,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(y.openBlock(),y.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):y.createCommentVNode("",!0)],6)),[[it,void 0,"checkBoxPopover"]]),y.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:y.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(M)]),_:1})],2)],2),[[y.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(y.openBlock(),y.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(r.openMapOptions,rt=>(y.openBlock(),y.createBlock(O,{key:rt.key},{default:y.withCtx(()=>[y.createVNode(E,{type:"primary",plain:"",onClick:mt=>t.$emit("open-map",rt.key)},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):y.createCommentVNode("",!0),y.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Viewing Mode")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createElementVNode("div",sUt,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.viewingModes,(rt,mt,Pt)=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:mt},[mt===t.viewingMode?(y.openBlock(),y.createElementBlock("span",lUt,[y.createElementVNode("b",null,y.toDisplayString(mt),1)])):(y.openBlock(),y.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Gt=>o.changeViewingMode(mt)},y.toDisplayString(mt),9,cUt))],64))),128))]),y.createVNode(O,{class:"viewing-mode-description"},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Drawn By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[23]||(e[23]=rt=>t.drawnType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.drawnTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(P,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Annotated By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[24]||(e[24]=rt=>t.annotatedType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.annotatedTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(P,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:1,class:"backgroundSpacer"})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:2,class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Flight path display")]),_:1})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:3,class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:y.withCtx(()=>[y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("2D")]),_:1}),y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):y.createCommentVNode("",!0),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Organs display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:t.colourRadio,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Colour")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Outlines display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Show")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Change background")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.availableBackground,rt=>(y.openBlock(),y.createElementBlock("div",{key:rt,class:y.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:mt=>o.backgroundChangeCallback(rt)},null,10,uUt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:y.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(y.openBlock(),y.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[28]||(e[28]=rt=>o.showTooltip(4)),onMouseout:e[29]||(e[29]=rt=>o.hideTooltip(4))},null,512)):y.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[30]||(e[30]=rt=>o.showTooltip(5)),onMouseout:e[31]||(e[31]=rt=>o.hideTooltip(5))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(tt,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[y.vShow,t.tooltipDisplay]])])])),[[lt,t.loading]])}const kS=bd(Fzt,[["render",hUt],["__scopeId","data-v-d272b145"]]);function dUt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const Rq=new dUt,Nq={"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"},pUt={name:"MultiFlatmapVuer",components:{Col:Lc,Row:bc,Option:L_,Select:gd,Popover:yd,FlatmapVuer:kS},mounted:function(){this.initialise(),Rq.on("onActionClick",t=>{this.resourceSelected(t)}),Rq.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=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,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new xS(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in Nq?Nq[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})})},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{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},connectivityInfoSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:y.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},fUt=t=>(y.pushScopeId("data-v-5364de02"),t=t(),y.popScopeId(),t),TUt={class:"multi-container",ref:"multiContainer"},QUt={key:0,style:{position:"absolute","z-index":"10"}},mUt=fUt(()=>y.createElementVNode("div",{class:"species-display-text"},"Species",-1)),gUt={class:"select-box-icon"};function yUt(t,e,r,n,i,o){const a=L_,s=gd,u=yd,d=kS;return y.openBlock(),y.createElementBlock("div",TUt,[r.disableUI?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",QUt,[mUt,y.createVNode(u,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:y.withCtx(()=>[y.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>(y.openBlock(),y.createBlock(a,{key:T,label:T,value:T},{default:y.withCtx(()=>[y.createElementVNode("span",gUt,[y.createElementVNode("i",{class:y.normalizeClass(f.iconClass)},null,2)]),y.createTextVNode(" "+y.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>y.withDirectives((y.openBlock(),y.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onOpenMap:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[y.vShow,t.activeSpecies==T]])),128))],512)}const _Ut=bd(pUt,[["render",yUt],["__scopeId","data-v-5364de02"]]);fo.FlatmapVuer=kS,fo.MultiFlatmapVuer=_Ut,Object.defineProperty(fo,Symbol.toStringTag,{value:"Module"})});
1729
+ This will fail in production.`);s=K9,s._s.has(n)||(o?OS(n,e,i,s):Iq(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const T="__hot:"+n,Q=o?OS(T,e,i,s,!0):Iq(T,Da({},i),s,!0);u._hotUpdate(Q),delete s.state.value[T],s._s.delete(T)}if(process.env.NODE_ENV!=="production"&&HS){const T=y.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,_="_pStores"in Q?Q._pStores:Q._pStores={};_[n]=f}}return f}return a.$id=n,a}function Rzt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const Nzt=Vzt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),Dzt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},Vq=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${e}.${o.label}`},s=Vq(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},Bzt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},Fzt={name:"FlatmapVuer",components:{Button:sO,Col:Lc,Loading:dst,Radio:LO,Icon:T1,RadioGroup:wO,Row:bc,Select:gd,Dialog:Mat,MapSvgIcon:SH.MapSvgIcon,MapSvgSpriteColor:SH.MapSvgSpriteColor,Tooltip:_y.Tooltip,TreeControls:_y.TreeControls,SelectionsGroup:VO,SvgLegends:RO,ElIconWarningFilled:NC,ElIconArrowDown:By,ElIconArrowLeft:VC,DrawToolbar:_y.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:y.markRaw(new Czt(`${t.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(this.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},t==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(t==="tool"){if(e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=e}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"&&this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1),this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?(this.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),n},addAnnotationFeature:async function(){if(this.mapImp&&(this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.featureAnnotationSubmitted||(this.loading=!0);const t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=Vq(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{NO(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},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(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),s=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(a.includes(_.models)){u=!1;return}}),u&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.selectGeoJSONFeatures("-1"),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const u={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.featuresAlert=e.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},changeViewingMode:function(t){t&&(this.viewingMode=t),this.closeTooltip()},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,Dzt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,a=this.$refs[i||o];if(a){const{parentElement:s,nextElementSibling:u}=a.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(s)||d(u))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.tooltipEntry)),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.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(){var t,e;this.sensor=y.markRaw(new Ast(this.$refs.display,this.mapResize)),console.log(this.mapImp.options),((t=this.mapImp.options)==null?void 0:t.style)==="functional"?this.isFC=!0:((e=this.mapImp.options)==null?void 0:e.style)==="centreline"&&(this.isCentreLine=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.isCentreLine||this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!this.isCentreLine,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.tooltipEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&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(t){return this.mapImp?this.mapImp.search(t):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:4},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},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},connectivityInfoSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManager:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:y.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:Hst,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Mst,tooltipEntry:Bzt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:"View internal identifiers of features"},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:y.markRaw({alert:{with:!0,without:!0}})}},computed:{...Rzt(Nzt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},mounted:function(){this.openMapRef=y.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=y.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=y.markRaw(new xS(this.flatmapAPI)),this.flatmapQueries=y.markRaw(new Sst),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},gs=t=>(y.pushScopeId("data-v-778bc86b"),t=t(),y.popScopeId(),t),jzt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},zzt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Uzt={style:{height:"100%",width:"100%"},ref:"display"},Gzt={class:"beta-popovers"},$zt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Zzt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Wzt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),qzt=gs(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Xzt=gs(()=>y.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Kzt={key:1,class:"warning-text"},Yzt=gs(()=>y.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Jzt=gs(()=>y.createElementVNode("b",null,"Neuron Connection mode",-1)),tUt=gs(()=>y.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)),eUt=gs(()=>y.createElementVNode("b",null,"Now can display up to 6 panes",-1)),rUt=gs(()=>y.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)),nUt={class:"bottom-right-control"},iUt=gs(()=>y.createElementVNode("div",null,[y.createTextVNode(" Fit to "),y.createElementVNode("br"),y.createTextVNode(" window ")],-1)),oUt=["innerHTML"],aUt=["innerHTML"],sUt={style:{"margin-bottom":"2px"}},lUt={key:0,class:"viewing-mode-title"},cUt=["onClick"],uUt=["onClick"];function hUt(t,e,r,n,i,o){const a=y.resolveComponent("map-svg-sprite-color"),s=NC,u=T1,d=yd,f=By,T=y.resolveComponent("DrawToolbar"),Q=y.resolveComponent("map-svg-icon"),_=RO,L=y.resolveComponent("tree-controls"),b=VO,M=VC,E=sO,O=bc,P=Lc,D=L_,j=gd,$=LO,U=wO,tt=y.resolveComponent("Tooltip"),it=kO,lt=x_;return y.withDirectives((y.openBlock(),y.createElementBlock("div",jzt,[y.createVNode(a),y.createElementVNode("div",zzt,[y.createElementVNode("div",Uzt,null,512),y.withDirectives(y.createElementVNode("div",Gzt,[y.createElementVNode("div",null,[y.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:y.withCtx(()=>[r.displayWarning?(y.openBlock(),y.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=rt=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=rt=>o.hideTooltip(7))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),r.isLegacy?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[Xzt,y.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(y.openBlock(),y.createElementBlock("span",Kzt,"Beta"))],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[r.isLegacy?(y.openBlock(),y.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=rt=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(y.openBlock(),y.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),$zt,y.createTextVNode(" models available in "),Zzt,y.createTextVNode(". ")],32)):(y.openBlock(),y.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),Wzt,y.createTextVNode(" models available in "),qzt,y.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(y.openBlock(),y.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:y.withCtx(()=>[r.displayLatestChanges?(y.openBlock(),y.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=rt=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=rt=>o.hideTooltip(8))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),Yzt],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[Jzt,tUt,eUt,rUt]),_:1},8,["visible"])):y.createCommentVNode("",!0)],512),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(u,{class:y.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:y.withCtx(()=>[y.createVNode(f)]),_:1},8,["class","onClick"]),[[y.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(y.openBlock(),y.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,drawnType:t.drawnType,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("div",nUt,[y.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[11]||(e[11]=rt=>o.zoomIn()),onMouseover:e[12]||(e[12]=rt=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=rt=>o.hideTooltip(1))},[y.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),y.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[14]||(e[14]=rt=>o.zoomOut()),onMouseover:e[15]||(e[15]=rt=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=rt=>o.hideTooltip(2))},[y.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),y.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[17]||(e[17]=rt=>o.resetView()),onMouseover:e[18]||(e[18]=rt=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=rt=>o.hideTooltip(3))},[y.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:y.withCtx(()=>[iUt]),_:1},8,["visible"])],512),[[y.vShow,!r.disableUI]]),y.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.withDirectives((y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:y.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?y.createCommentVNode("",!0):(y.openBlock(),y.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(y.openBlock(),y.createBlock(d,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=rt=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=rt=>o.hideTooltip(9))},null,40,oUt),[[it,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):y.createCommentVNode("",!0),y.createVNode(d,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:t.hoverVisibilities[0].value,ref:"markerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,aUt),[[y.vShow,t.hoverVisibilities[0].value],[it,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(y.openBlock(),y.createBlock(L,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):y.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(y.openBlock(),y.createBlock(b,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(y.openBlock(),y.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(y.openBlock(),y.createBlock(b,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(y.openBlock(),y.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):y.createCommentVNode("",!0)],6)),[[it,void 0,"checkBoxPopover"]]),y.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:y.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(M)]),_:1})],2)],2),[[y.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(y.openBlock(),y.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(r.openMapOptions,rt=>(y.openBlock(),y.createBlock(O,{key:rt.key},{default:y.withCtx(()=>[y.createVNode(E,{type:"primary",plain:"",onClick:mt=>t.$emit("open-map",rt.key)},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):y.createCommentVNode("",!0),y.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Viewing Mode")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createElementVNode("div",sUt,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.viewingModes,(rt,mt,Pt)=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:mt},[mt===t.viewingMode?(y.openBlock(),y.createElementBlock("span",lUt,[y.createElementVNode("b",null,y.toDisplayString(mt),1)])):(y.openBlock(),y.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Gt=>o.changeViewingMode(mt)},y.toDisplayString(mt),9,cUt))],64))),128))]),y.createVNode(O,{class:"viewing-mode-description"},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Drawn By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[23]||(e[23]=rt=>t.drawnType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.drawnTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(P,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Annotated By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[24]||(e[24]=rt=>t.annotatedType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.annotatedTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(P,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:1,class:"backgroundSpacer"})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:2,class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Flight path display")]),_:1})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:3,class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:y.withCtx(()=>[y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("2D")]),_:1}),y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):y.createCommentVNode("",!0),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Organs display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:t.colourRadio,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Colour")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Outlines display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Show")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Change background")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.availableBackground,rt=>(y.openBlock(),y.createElementBlock("div",{key:rt,class:y.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:mt=>o.backgroundChangeCallback(rt)},null,10,uUt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:y.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(y.openBlock(),y.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:e[28]||(e[28]=rt=>o.showTooltip(4)),onMouseout:e[29]||(e[29]=rt=>o.hideTooltip(4))},[y.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):y.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:e[30]||(e[30]=rt=>o.showTooltip(5)),onMouseout:e[31]||(e[31]=rt=>o.hideTooltip(5))},[y.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(tt,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[y.vShow,t.tooltipDisplay]])])])),[[lt,t.loading]])}const kS=bd(Fzt,[["render",hUt],["__scopeId","data-v-778bc86b"]]);function dUt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const Rq=new dUt,Nq={"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"},pUt={name:"MultiFlatmapVuer",components:{Col:Lc,Row:bc,Option:L_,Select:gd,Popover:yd,FlatmapVuer:kS},mounted:function(){this.initialise(),Rq.on("onActionClick",t=>{this.resourceSelected(t)}),Rq.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=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,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new xS(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in Nq?Nq[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})})},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{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},connectivityInfoSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:y.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},fUt=t=>(y.pushScopeId("data-v-5364de02"),t=t(),y.popScopeId(),t),TUt={class:"multi-container",ref:"multiContainer"},QUt={key:0,style:{position:"absolute","z-index":"10"}},mUt=fUt(()=>y.createElementVNode("div",{class:"species-display-text"},"Species",-1)),gUt={class:"select-box-icon"};function yUt(t,e,r,n,i,o){const a=L_,s=gd,u=yd,d=kS;return y.openBlock(),y.createElementBlock("div",TUt,[r.disableUI?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",QUt,[mUt,y.createVNode(u,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:y.withCtx(()=>[y.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>(y.openBlock(),y.createBlock(a,{key:T,label:T,value:T},{default:y.withCtx(()=>[y.createElementVNode("span",gUt,[y.createElementVNode("i",{class:y.normalizeClass(f.iconClass)},null,2)]),y.createTextVNode(" "+y.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>y.withDirectives((y.openBlock(),y.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onOpenMap:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[y.vShow,t.activeSpecies==T]])),128))],512)}const _Ut=bd(pUt,[["render",yUt],["__scopeId","data-v-5364de02"]]);fo.FlatmapVuer=kS,fo.MultiFlatmapVuer=_Ut,Object.defineProperty(fo,Symbol.toStringTag,{value:"Module"})});