@maptiler/geocoding-control 1.2.3 → 1.2.4

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.
package/openlayers.umd.js CHANGED
@@ -3,7 +3,7 @@
3
3
  `+c.weight+`
4
4
  `+d;fr.get(m)===void 0&&(fr.set(m,100,!0),a(c.style,c.weight,d)||(fr.set(m,0,!0),s===void 0&&(s=setInterval(u,32))))}}}(),hm=function(){let i;return function(t){let e=Sl[t];if(e==null){if(el){const n=Dc(t),r=Th(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=t,document.body.appendChild(i),e=i.offsetHeight,document.body.removeChild(i);Sl[t]=e}return e}}();function Th(i,t){return zs||(zs=ti(1,1)),i!=Il&&(zs.font=i,Il=zs.font),zs.measureText(t)}function ja(i,t){return Th(i,t).width}function Mh(i,t,e){if(t in e)return e[t];const n=t.split(`
5
5
  `).reduce((r,s)=>Math.max(r,ja(i,s)),0);return e[t]=n,n}function fm(i,t){const e=[],n=[],r=[];let s=0,o=0,a=0,u=0;for(let l=0,c=t.length;l<=c;l+=2){const h=t[l];if(h===`
6
- `||l===c){s=Math.max(s,o),r.push(o),o=0,a+=u;continue}const f=t[l+1]||i.font,g=ja(f,h);e.push(g),o+=g;const d=hm(f);n.push(d),u=Math.max(u,d)}return{width:s,height:a,widths:e,heights:n,lineWidths:r}}function gm(i,t,e,n,r,s,o,a,u,l,c){i.save(),e!==1&&(i.globalAlpha*=e),t&&i.setTransform.apply(i,t),n.contextInstructions?(i.translate(u,l),i.scale(c[0],c[1]),dm(n,i)):c[0]<0||c[1]<0?(i.translate(u,l),i.scale(c[0],c[1]),i.drawImage(n,r,s,o,a,0,0,o,a)):i.drawImage(n,r,s,o,a,u,l,o*c[0],a*c[1]),i.restore()}function dm(i,t){const e=i.contextInstructions;for(let n=0,r=e.length;n<r;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}function Za(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}function Xt(){}function pm(i,t){for(const e in t)i[e]=t[e];return i}function Ph(i){return i()}function Oh(){return Object.create(null)}function Vi(i){i.forEach(Ph)}function Dh(i){return typeof i=="function"}function Qr(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Ka;function De(i,t){return i===t?!0:(Ka||(Ka=document.createElement("a")),Ka.href=t,i===Ka.href)}function mm(i){return Object.keys(i).length===0}function _m(i,t,e,n){if(i){const r=Ah(i,t,e,n);return i[0](r)}}function Ah(i,t,e,n){return i[1]&&n?pm(e.ctx.slice(),i[1](n(t))):e.ctx}function ym(i,t,e,n){if(i[2]&&n){const r=i[2](n(e));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let a=0;a<o;a+=1)s[a]=t.dirty[a]|r[a];return s}return t.dirty|r}return t.dirty}function vm(i,t,e,n,r,s){if(r){const o=Ah(t,e,n,s);i.p(o,r)}}function Em(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function Fh(i){return i??""}function gt(i,t){i.appendChild(t)}function Ut(i,t,e){i.insertBefore(t,e||null)}function Gt(i){i.parentNode&&i.parentNode.removeChild(i)}function It(i){return document.createElement(i)}function Xi(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function gr(i){return document.createTextNode(i)}function gn(){return gr(" ")}function Cm(){return gr("")}function Xe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function xm(i){return function(t){return t.preventDefault(),i.call(this,t)}}function D(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Im(i){return Array.from(i.childNodes)}function ko(i,t){t=""+t,i.data!==t&&(i.data=t)}function kh(i,t){i.value=t??""}function Ja(i,t,e,n){e==null?i.style.removeProperty(t):i.style.setProperty(t,e,"")}function dr(i,t,e){i.classList.toggle(t,!!e)}function Sm(i,t,{bubbles:e=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:t,bubbles:e,cancelable:n})}let Go;function Bo(i){Go=i}function Gh(){if(!Go)throw new Error("Function called outside component initialization");return Go}function wm(i){Gh().$$.on_destroy.push(i)}function Lm(){const i=Gh();return(t,e,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[t];if(r){const s=Sm(t,e,{cancelable:n});return r.slice().forEach(o=>{o.call(i,s)}),!s.defaultPrevented}return!0}}function Bh(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const Vs=[],wl=[];let Xs=[];const zh=[],Nm=Promise.resolve();let Ll=!1;function Rm(){Ll||(Ll=!0,Nm.then(Vh))}function Nl(i){Xs.push(i)}const Rl=new Set;let Us=0;function Vh(){if(Us!==0)return;const i=Go;do{try{for(;Us<Vs.length;){const t=Vs[Us];Us++,Bo(t),bm(t.$$)}}catch(t){throw Vs.length=0,Us=0,t}for(Bo(null),Vs.length=0,Us=0;wl.length;)wl.pop()();for(let t=0;t<Xs.length;t+=1){const e=Xs[t];Rl.has(e)||(Rl.add(e),e())}Xs.length=0}while(Vs.length);for(;zh.length;)zh.pop()();Ll=!1,Rl.clear(),Bo(i)}function bm(i){if(i.fragment!==null){i.update(),Vi(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Nl)}}function Tm(i){const t=[],e=[];Xs.forEach(n=>i.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Xs=t}const Qa=new Set;let $r;function $a(){$r={r:0,c:[],p:$r}}function tu(){$r.r||Vi($r.c),$r=$r.p}function Kt(i,t){i&&i.i&&(Qa.delete(i),i.i(t))}function me(i,t,e,n){if(i&&i.o){if(Qa.has(i))return;Qa.add(i),$r.c.push(()=>{Qa.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}function Xh(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Mm(i,t){me(i,1,1,()=>{t.delete(i.key)})}function Pm(i,t,e,n,r,s,o,a,u,l,c,h){let f=i.length,g=s.length,d=f;const m={};for(;d--;)m[i[d].key]=d;const p=[],_=new Map,y=new Map,v=[];for(d=g;d--;){const R=h(r,s,d),T=e(R);let w=o.get(T);w?v.push(()=>w.p(R,t)):(w=l(T,R),w.c()),_.set(T,p[d]=w),T in m&&y.set(T,Math.abs(d-m[T]))}const C=new Set,x=new Set;function b(R){Kt(R,1),R.m(a,c),o.set(R.key,R),c=R.first,g--}for(;f&&g;){const R=p[g-1],T=i[f-1],w=R.key,O=T.key;R===T?(c=R.first,f--,g--):_.has(O)?!o.has(w)||C.has(w)?b(R):x.has(O)?f--:y.get(w)>y.get(O)?(x.add(w),b(R)):(C.add(O),f--):(u(T,o),f--)}for(;f--;){const R=i[f];_.has(R.key)||u(R,o)}for(;g;)b(p[g-1]);return Vi(v),p}function pr(i){i&&i.c()}function Ui(i,t,e){const{fragment:n,after_update:r}=i.$$;n&&n.m(t,e),Nl(()=>{const s=i.$$.on_mount.map(Ph).filter(Dh);i.$$.on_destroy?i.$$.on_destroy.push(...s):Vi(s),i.$$.on_mount=[]}),r.forEach(Nl)}function Yi(i,t){const e=i.$$;e.fragment!==null&&(Tm(e.after_update),Vi(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Om(i,t){i.$$.dirty[0]===-1&&(Vs.push(i),Rm(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ts(i,t,e,n,r,s,o=null,a=[-1]){const u=Go;Bo(i);const l=i.$$={fragment:null,ctx:[],props:s,update:Xt,not_equal:r,bound:Oh(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Oh(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};o&&o(l.root);let c=!1;if(l.ctx=e?e(i,t.props||{},(h,f,...g)=>{const d=g.length?g[0]:f;return l.ctx&&r(l.ctx[h],l.ctx[h]=d)&&(!l.skip_bound&&l.bound[h]&&l.bound[h](d),c&&Om(i,h)),f}):[],l.update(),c=!0,Vi(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const h=Im(t.target);l.fragment&&l.fragment.l(h),h.forEach(Gt)}else l.fragment&&l.fragment.c();t.intro&&Kt(i.$$.fragment),Ui(i,t.target,t.anchor),Vh()}Bo(u)}class es{constructor(){Jn(this,"$$");Jn(this,"$$set")}$destroy(){Yi(this,1),this.$destroy=Xt}$on(t,e){if(!Dh(e))return Xt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!mm(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dm="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dm);function Am(i){let t,e;return{c(){t=Xi("svg"),e=Xi("path"),D(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),D(t,"viewBox","0 0 14 14"),D(t,"width","13"),D(t,"height","13"),D(t,"class","svelte-en2qvf")},m(n,r){Ut(n,t,r),gt(t,e)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(t)}}}class Uh extends es{constructor(t){super(),ts(this,t,null,Am,Qr,{})}}function Fm(i){let t,e;return{c(){t=Xi("svg"),e=Xi("path"),D(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),D(t,"viewBox","0 0 30 30"),D(t,"fill","none"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"class","svelte-d2loi5")},m(n,r){Ut(n,t,r),gt(t,e)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(t)}}}class Yh extends es{constructor(t){super(),ts(this,t,null,Fm,Qr,{})}}function km(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"area.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"area.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Gm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"reverse.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"reverse.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Bm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"poi.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"poi.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function zm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"postal_code.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"postal_code.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Vm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"street.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"street.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Xm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"road.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"road.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Um(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"housenumber.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"housenumber.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Ym(i){let t,e,n,r;return{c(){t=It("img"),De(t.src,e=i[5])||D(t,"src",e),D(t,"alt",i[4]),D(t,"class","svelte-ltkwvy")},m(s,o){Ut(s,t,o),n||(r=Xe(t,"error",i[14]),n=!0)},p(s,o){o&32&&!De(t.src,e=s[5])&&D(t,"src",e),o&16&&D(t,"alt",s[4])},d(s){s&&Gt(t),n=!1,r()}}}function Wh(i){let t,e;return{c(){t=It("span"),e=gr(i[6]),D(t,"class","secondary svelte-ltkwvy")},m(n,r){Ut(n,t,r),gt(t,e)},p(n,r){r&64&&ko(e,n[6])},d(n){n&&Gt(t)}}}function Wm(i){var R,T;let t,e,n,r,s,o,a,u,l=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",c,h,f=i[2]==="always"||i[2]&&!i[0].address&&((R=i[0].properties)==null?void 0:R.kind)!=="road"&&((T=i[0].properties)==null?void 0:T.kind)!=="road_relation"&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],g,d,m=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",p,_,y;function v(w,O){var z,F;return O&1&&(e=null),O&1&&(n=null),O&1&&(r=null),w[5]?Ym:w[0].address?Um:((z=w[0].properties)==null?void 0:z.kind)==="road"||((F=w[0].properties)==null?void 0:F.kind)==="road_relation"?Xm:(e==null&&(e=!!w[0].id.startsWith("address.")),e?Vm:(n==null&&(n=!!w[0].id.startsWith("postal_code.")),n?zm:(r==null&&(r=!!w[0].id.startsWith("poi.")),r?Bm:w[7]?Gm:km)))}let C=v(i,-1),x=C(i),b=f&&Wh(i);return{c(){t=It("li"),x.c(),s=gn(),o=It("span"),a=It("span"),u=It("span"),c=gr(l),h=gn(),b&&b.c(),g=gn(),d=It("span"),p=gr(m),D(u,"class","primary svelte-ltkwvy"),D(a,"class","svelte-ltkwvy"),D(d,"class","line2 svelte-ltkwvy"),D(o,"class","texts svelte-ltkwvy"),D(t,"tabindex","0"),D(t,"data-selected",i[1]),D(t,"class","svelte-ltkwvy"),dr(t,"selected",i[1])},m(w,O){Ut(w,t,O),x.m(t,null),gt(t,s),gt(t,o),gt(o,a),gt(a,u),gt(u,c),gt(a,h),b&&b.m(a,null),gt(o,g),gt(o,d),gt(d,p),_||(y=[Xe(t,"mouseenter",i[12]),Xe(t,"focus",i[13])],_=!0)},p(w,[O]){var z,F;C===(C=v(w,O))&&x?x.p(w,O):(x.d(1),x=C(w),x&&(x.c(),x.m(t,s))),O&1&&l!==(l=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&ko(c,l),O&37&&(f=w[2]==="always"||w[2]&&!w[0].address&&((z=w[0].properties)==null?void 0:z.kind)!=="road"&&((F=w[0].properties)==null?void 0:F.kind)!=="road_relation"&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),f?b?b.p(w,O):(b=Wh(w),b.c(),b.m(a,null)):b&&(b.d(1),b=null),O&1&&m!==(m=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&ko(p,m),O&2&&D(t,"data-selected",w[1]),O&2&&dr(t,"selected",w[1])},i:Xt,o:Xt,d(w){w&&Gt(t),x.d(),b&&b.d(),_=!1,Vi(y)}}}function qm(i,t,e){var v;let n,r,{feature:s}=t,{selected:o=!1}=t,{showPlaceType:a}=t,{missingIconsCache:u}=t,{iconsBaseUrl:l}=t;const c=(v=s.properties)==null?void 0:v.categories;let h,f,g=0,d=s.place_type[0]==="reverse";function m(C){f&&u.add(f),e(10,g++,g)}function p(C){Bh.call(this,i,C)}function _(C){Bh.call(this,i,C)}const y=C=>m(C.currentTarget);return i.$$set=C=>{"feature"in C&&e(0,s=C.feature),"selected"in C&&e(1,o=C.selected),"showPlaceType"in C&&e(2,a=C.showPlaceType),"missingIconsCache"in C&&e(9,u=C.missingIconsCache),"iconsBaseUrl"in C&&e(3,l=C.iconsBaseUrl)},i.$$.update=()=>{var C,x,b,R;if(i.$$.dirty&3640)do e(11,n--,n),e(4,h=c==null?void 0:c[n]),e(5,f=h?l+h.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!f||u.has(f)));i.$$.dirty&1&&e(6,r=s.id.startsWith("poi.")?(x=(C=s.properties)==null?void 0:C.categories)==null?void 0:x.join(", "):((R=(b=s.properties)==null?void 0:b.place_type_name)==null?void 0:R[0])??s.place_type[0])},e(11,n=(c==null?void 0:c.length)??0),[s,o,a,l,h,f,r,d,m,u,g,n,p,_,y]}class Hm extends es{constructor(t){super(),ts(this,t,qm,Wm,Qr,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function jm(i){let t;return{c(){t=It("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',D(t,"class","svelte-7cmwmc")},m(e,n){Ut(e,t,n)},p:Xt,i:Xt,o:Xt,d(e){e&&Gt(t)}}}class Zm extends es{constructor(t){super(),ts(this,t,null,jm,Qr,{})}}function Km(i){let t,e;return{c(){t=Xi("svg"),e=Xi("path"),D(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),D(t,"viewBox","0 0 60.006 21.412"),D(t,"width","14"),D(t,"height","20"),D(t,"class","svelte-en2qvf")},m(n,r){Ut(n,t,r),gt(t,e)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(t)}}}class Jm extends es{constructor(t){super(),ts(this,t,null,Km,Qr,{})}}function Qm(i){let t,e,n;return{c(){t=Xi("svg"),e=Xi("circle"),n=Xi("path"),D(e,"cx","4.789"),D(e,"cy","4.787"),D(e,"r","3.85"),Ja(e,"stroke-width","1.875"),Ja(e,"fill","none"),D(n,"d","M12.063 12.063 7.635 7.635"),Ja(n,"stroke-width","1.875"),Ja(n,"stroke-linecap","round"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"width","13"),D(t,"height","13"),D(t,"viewBox","0 0 13 13"),D(t,"class","svelte-1bpbt60")},m(r,s){Ut(r,t,s),gt(t,e),gt(t,n)},p:Xt,i:Xt,o:Xt,d(r){r&&Gt(t)}}}class $m extends es{constructor(t){super(),ts(this,t,null,Qm,Qr,{})}}function t_(i,t,e){const n=t[1],r=t[0],s=n-r;return i===n&&e?i:((i-r)%s+s)%s+r}function qh(i){const t=[...i];return t[2]<t[0]&&(t[2]+=360),t}let zo;async function e_(i,t,e){const n=i==null?void 0:i.getCenterAndZoom();for(const r of t??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");t:if(r.type==="client-geolocation"){if(zo&&r.cachedLocationExpiry&&zo.time+r.cachedLocationExpiry>Date.now()){if(!zo.coords)break t;return zo.coords}let s;try{return s=await new Promise((o,a)=>{e.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(u=>{o([u.coords.longitude,u.coords.latitude].map(l=>l.toFixed(6)).join(","))},u=>{a(u)},r)}),s}catch{}finally{r.cachedLocationExpiry&&(zo={time:Date.now(),coords:s})}if(e.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Hh=/([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})/,jh=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,Zh=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,Kh=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,Jh=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function n_(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(i=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(o=>Number(o.trim()));let e=Qh(t[0],i),n=Qh(t[1],i);e.endsWith('.0"')&&n.endsWith('.0"')&&(e=e.replace(/\.0"$/,'"'),n=n.replace(/\.0"$/,'"'));const r=t[0]>=0?" N":" S",s=t[1]>=0?" E":" W";return`${e+r}, ${n+s}`}else throw new Error("no decimal coordinates to convert")}function Qh(i,t){const e=Math.abs(i),n=Math.floor(e),r=(e-n)*60;if(t=="DM"){let a=i_(r,3).toFixed(3).padStart(6,"0");return`${n}° ${a}'`}let s=Math.floor(r),o=((r-s)*60).toFixed(1).padStart(4,"0");return s=s.toString().padStart(2,"0"),`${n}° ${s}' ${o}"`}function i_(i,t){const e=Math.pow(10,t);return Math.round((i+Number.EPSILON)*e)/e}function bl(i,t){t||(t=5),i=i.replace(/\s+/g," ").trim();let e=null,n=null,r="",s="",o=[],a=!1;if(Hh.test(i))if(o=Hh.exec(i),a=Vo(o),a)e=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(e*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1);else throw new Error("invalid coordinate format");else if(jh.test(i))if(o=jh.exec(i),a=Vo(o),a){if(e=o[2],n=o[6],e.includes(",")&&(e=e.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),Number(Math.round(e))==Number(e))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");o[1]?(r=o[1],s=o[5]):o[4]&&(r=o[4],s=o[8])}else throw new Error("invalid decimal coordinate format");else if(Zh.test(i))if(o=Zh.exec(i),a=Vo(o),a)e=Math.abs(parseInt(o[2])),o[4]&&(e+=o[4]/60),o[6]&&(e+=o[6].replace(",",".")/3600),parseInt(o[2])<0&&(e=-1*e),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],s=o[8]):o[7]&&(r=o[7],s=o[14]);else throw new Error("invalid DMS coordinates format");else if(Kh.test(i))if(o=Kh.exec(i),a=Vo(o),a)e=Math.abs(parseInt(o[2])),o[4]&&(e+=o[4]/60),o[6]&&(e+=o[6]/3600),parseInt(o[2])<0&&(e=-1*e),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],s=o[9]):o[8]&&(r=o[8],s=o[16]);else throw new Error("invalid DMS coordinates format");else if(Jh.test(i))if(o=Jh.exec(i),a=Vo(o),a)e=Math.abs(parseInt(o[2])),o[4]&&(e+=o[4].replace(",",".")/60),o[6]&&(e+=o[6].replace(",",".")/3600),parseInt(o[2])<0&&(e=-1*e),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],s=o[9]):o[8]&&(r=o[8],s=o[16]);else throw new Error("invalid coordinates format");if(a){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(e)>=90)throw new Error("invalid latitude value");if((r||s)&&(!r||!s))throw new Error("invalid coordinates format");if(r&&r==s)throw new Error("invalid coordinates format");let u=/S|SOUTH/i;u.test(r)&&e>0&&(e=-1*e),u=/W|WEST/i,u.test(s)&&n>0&&(n=-1*n);const l=o[0].trim();let c,h;const f=/[,/;\u0020]/g,g=l.match(f);if(g==null){const p=Math.floor(i.length/2);c=l.substring(0,p).trim(),h=l.substring(p).trim()}else{let p;g.length%2==1?p=Math.floor(g.length/2):p=g.length/2-1;let _=0;if(p==0)_=l.indexOf(g[0]),c=l.substring(0,_).trim(),h=l.substring(_+1).trim();else{let y=0,v=0;for(;y<=p;)_=l.indexOf(g[y],v),v=_+1,y++;c=l.substring(0,_).trim(),h=l.substring(_+1).trim()}}const d=c.split(".");if(d.length==2&&d[1]==0&&d[1].length!=2)throw new Error("invalid coordinates format");const m=h.split(".");if(m.length==2&&m[1]==0&&m[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(c)||/^\d+$/.test(h))throw new Error("degree only coordinate/s provided");return isNaN(e)&&e.includes(",")&&(e=e.replace(",",".")),e=Number(Number(e).toFixed(t)),isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(t)),Object.freeze({verbatimCoordinates:l,verbatimLatitude:c,verbatimLongitude:h,decimalLatitude:e,decimalLongitude:n,decimalCoordinates:`${e},${n}`,closeEnough:r_,toCoordinateFormat:n_})}else throw new Error("coordinates pattern match failed")}function Vo(i){if(!isNaN(i[0]))return!1;const t=[...i];if(t.shift(),t.length%2>0)return!1;const e=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=t.length/2;for(let s=0;s<r;s++){const o=t[s],a=t[s+r],u=e.test(o)&&e.test(a),l=n.test(o)&&n.test(a),c=o==a;if(!(o==null&&a==null)){if(o==null||a==null)return!1;if(u||l||c)continue;return!1}}return!0}function $h(i,t){const e=Math.abs(i-t);return Number(e.toFixed(6))<=1e-5}function r_(i){if(i.includes(",")){const t=i.split(",");if(Number(t[0])==NaN||Number(t[1])==NaN)throw new Error("coords are not valid decimals");return $h(this.decimalLatitude,Number(t[0]))&&$h(this.decimalLongitude,t[1])}else throw new Error("coords being tested must be separated by a comma")}const s_=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});bl.to=s_;const o_=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],a_={decimalLatitude:40.123,decimalLongitude:-74.123},u_=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],l_=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764}];function c_(){const i=[];return o_.forEach(t=>{t.decimalLatitude?i.push(t):i.push({...t,...a_})}),[...i,...u_,...l_]}const h_=c_();bl.formats=h_.map(i=>i.verbatimCoordinates);const f_=bl;function tf(i,t,e){const n=i.slice();return n[81]=t[e],n[83]=e,n}function ef(i){let t,e;return t=new Zm({}),{c(){pr(t.$$.fragment)},m(n,r){Ui(t,n,r),e=!0},i(n){e||(Kt(t.$$.fragment,n),e=!0)},o(n){me(t.$$.fragment,n),e=!1},d(n){Yi(t,n)}}}function nf(i){let t,e,n,r,s;return e=new Jm({}),{c(){t=It("button"),pr(e.$$.fragment),D(t,"type","button"),D(t,"title",i[9]),D(t,"class","svelte-zh3kmv"),dr(t,"active",i[0])},m(o,a){Ut(o,t,a),Ui(e,t,null),n=!0,r||(s=Xe(t,"click",i[67]),r=!0)},p(o,a){(!n||a[0]&512)&&D(t,"title",o[9]),(!n||a[0]&1)&&dr(t,"active",o[0])},i(o){n||(Kt(e.$$.fragment,o),n=!0)},o(o){me(e.$$.fragment,o),n=!1},d(o){o&&Gt(t),Yi(e),r=!1,s()}}}function g_(i){let t,e=[],n=new Map,r,s,o,a=Xh(i[14]);const u=l=>l[81].id+(l[81].address?","+l[81].address:"");for(let l=0;l<a.length;l+=1){let c=tf(i,a,l),h=u(c);n.set(h,e[l]=rf(h,c))}return{c(){t=It("ul");for(let l=0;l<e.length;l+=1)e[l].c();D(t,"class","svelte-zh3kmv")},m(l,c){Ut(l,t,c);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);r=!0,s||(o=[Xe(t,"mouseleave",i[71]),Xe(t,"blur",i[72])],s=!0)},p(l,c){c[0]&17880064&&(a=Xh(l[14]),$a(),e=Pm(e,c,u,1,l,a,n,t,Mm,rf,null,tf),tu())},i(l){if(!r){for(let c=0;c<a.length;c+=1)Kt(e[c]);r=!0}},o(l){for(let c=0;c<e.length;c+=1)me(e[c]);r=!1},d(l){l&&Gt(t);for(let c=0;c<e.length;c+=1)e[c].d();s=!1,Vi(o)}}}function d_(i){let t,e,n,r,s,o;return e=new Yh({}),{c(){t=It("div"),pr(e.$$.fragment),n=gn(),r=It("div"),s=gr(i[7]),D(r,"class","svelte-zh3kmv"),D(t,"class","no-results svelte-zh3kmv")},m(a,u){Ut(a,t,u),Ui(e,t,null),gt(t,n),gt(t,r),gt(r,s),o=!0},p(a,u){(!o||u[0]&128)&&ko(s,a[7])},i(a){o||(Kt(e.$$.fragment,a),o=!0)},o(a){me(e.$$.fragment,a),o=!1},d(a){a&&Gt(t),Yi(e)}}}function p_(i){let t="",e;return{c(){e=gr(t)},m(n,r){Ut(n,e,r)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(e)}}}function m_(i){let t,e,n,r,s,o,a,u,l,c,h;return e=new Yh({}),u=new Uh({}),{c(){t=It("div"),pr(e.$$.fragment),n=gn(),r=It("div"),s=gr(i[6]),o=gn(),a=It("button"),pr(u.$$.fragment),D(r,"class","svelte-zh3kmv"),D(a,"class","svelte-zh3kmv"),D(t,"class","error svelte-zh3kmv")},m(f,g){Ut(f,t,g),Ui(e,t,null),gt(t,n),gt(t,r),gt(r,s),gt(t,o),gt(t,a),Ui(u,a,null),l=!0,c||(h=Xe(a,"click",i[68]),c=!0)},p(f,g){(!l||g[0]&64)&&ko(s,f[6])},i(f){l||(Kt(e.$$.fragment,f),Kt(u.$$.fragment,f),l=!0)},o(f){me(e.$$.fragment,f),me(u.$$.fragment,f),l=!1},d(f){f&&Gt(t),Yi(e),Yi(u),c=!1,h()}}}function rf(i,t){let e,n,r;function s(){return t[69](t[83])}function o(){return t[70](t[81])}return n=new Hm({props:{feature:t[81],showPlaceType:t[10],selected:t[15]===t[83],missingIconsCache:t[20],iconsBaseUrl:t[12]}}),n.$on("mouseenter",s),n.$on("focus",o),{key:i,first:null,c(){e=Cm(),pr(n.$$.fragment),this.first=e},m(a,u){Ut(a,e,u),Ui(n,a,u),r=!0},p(a,u){t=a;const l={};u[0]&16384&&(l.feature=t[81]),u[0]&1024&&(l.showPlaceType=t[10]),u[0]&49152&&(l.selected=t[15]===t[83]),u[0]&4096&&(l.iconsBaseUrl=t[12]),n.$set(l)},i(a){r||(Kt(n.$$.fragment,a),r=!0)},o(a){me(n.$$.fragment,a),r=!1},d(a){a&&Gt(e),Yi(n,a)}}}function __(i){let t,e,n,r,s,o,a,u,l,c,h,f,g,d,m,p,_,y,v,C,x,b=!1;s=new $m({}),h=new Uh({});let R=i[19]&&ef(),T=i[5]===!0&&nf(i);const w=i[59].default,O=_m(w,i,i[58],null),z=[m_,p_,d_,g_],F=[];function Y(L,M){var B,U;return L[18]?0:L[16]?((B=L[14])==null?void 0:B.length)===0?2:L[16]&&((U=L[14])!=null&&U.length)?3:-1:1}return~(p=Y(i))&&(_=F[p]=z[p](i)),{c(){t=gn(),e=It("form"),n=It("div"),r=It("button"),pr(s.$$.fragment),o=gn(),a=It("input"),u=gn(),l=It("div"),c=It("button"),pr(h.$$.fragment),f=gn(),R&&R.c(),g=gn(),T&&T.c(),d=gn(),O&&O.c(),m=gn(),_&&_.c(),D(r,"class","search-button svelte-zh3kmv"),D(r,"type","button"),D(a,"placeholder",i[8]),D(a,"aria-label",i[8]),D(a,"class","svelte-zh3kmv"),D(c,"type","button"),D(c,"title",i[3]),D(c,"class","svelte-zh3kmv"),D(l,"class","clear-button-container svelte-zh3kmv"),dr(l,"displayable",i[1]!==""),D(n,"class","input-group svelte-zh3kmv"),D(e,"tabindex","0"),D(e,"class",y=Fh(i[2])+" svelte-zh3kmv"),dr(e,"can-collapse",i[4]&&i[1]==="")},m(L,M){Ut(L,t,M),Ut(L,e,M),gt(e,n),gt(n,r),Ui(s,r,null),gt(n,o),gt(n,a),i[61](a),kh(a,i[1]),gt(n,u),gt(n,l),gt(l,c),Ui(h,c,null),gt(l,f),R&&R.m(l,null),gt(n,g),T&&T.m(n,null),gt(n,d),O&&O.m(n,null),gt(e,m),~p&&F[p].m(e,null),v=!0,C||(x=[Xe(r,"click",i[60]),Xe(a,"input",i[62]),Xe(a,"focus",i[63]),Xe(a,"blur",i[64]),Xe(a,"keydown",i[22]),Xe(a,"input",i[65]),Xe(c,"click",i[66]),Xe(e,"submit",xm(i[21]))],C=!0)},p(L,M){(!v||M[0]&256)&&D(a,"placeholder",L[8]),(!v||M[0]&256)&&D(a,"aria-label",L[8]),M[0]&2&&a.value!==L[1]&&kh(a,L[1]),(!v||M[0]&8)&&D(c,"title",L[3]),L[19]?R?M[0]&524288&&Kt(R,1):(R=ef(),R.c(),Kt(R,1),R.m(l,null)):R&&($a(),me(R,1,1,()=>{R=null}),tu()),(!v||M[0]&2)&&dr(l,"displayable",L[1]!==""),L[5]===!0?T?(T.p(L,M),M[0]&32&&Kt(T,1)):(T=nf(L),T.c(),Kt(T,1),T.m(n,d)):T&&($a(),me(T,1,1,()=>{T=null}),tu()),O&&O.p&&(!v||M[1]&134217728)&&vm(O,w,L,L[58],v?ym(w,L[58],M,null):Em(L[58]),null);let B=p;p=Y(L),p===B?~p&&F[p].p(L,M):(_&&($a(),me(F[B],1,1,()=>{F[B]=null}),tu()),~p?(_=F[p],_?_.p(L,M):(_=F[p]=z[p](L),_.c()),Kt(_,1),_.m(e,null)):_=null),(!v||M[0]&4&&y!==(y=Fh(L[2])+" svelte-zh3kmv"))&&D(e,"class",y),(!v||M[0]&22)&&dr(e,"can-collapse",L[4]&&L[1]==="")},i(L){v||(Kt(b),Kt(s.$$.fragment,L),Kt(h.$$.fragment,L),Kt(R),Kt(T),Kt(O,L),Kt(_),v=!0)},o(L){me(b),me(s.$$.fragment,L),me(h.$$.fragment,L),me(R),me(T),me(O,L),me(_),v=!1},d(L){L&&(Gt(t),Gt(e)),Yi(s),i[61](null),Yi(h),R&&R.d(),T&&T.d(),O&&O.d(L),~p&&F[p].d(),C=!1,Vi(x)}}}function y_(i,t,e){let n,{$$slots:r={},$$scope:s}=t,{class:o=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:h=!1}=t,{country:f=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:d=!1}=t,{errorMessage:m="Something went wrong…"}=t,{filter:p=()=>!0}=t,{flyTo:_=!0}=t,{fuzzyMatch:y=!0}=t,{language:v=void 0}=t,{limit:C=void 0}=t,{mapController:x=void 0}=t,{minLength:b=2}=t,{noResultsMessage:R="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:T="Search"}=t,{proximity:w=[{type:"server-geolocation"}]}=t,{reverseActive:O=d==="always"}=t,{reverseButtonTitle:z="toggle reverse geocoding"}=t,{searchValue:F=""}=t,{showFullGeometry:Y=!0}=t,{showPlaceType:L="ifNeeded"}=t,{showResultsWhileTyping:M=!0}=t,{selectFirst:B=!0}=t,{flyToSelected:U=!1}=t,{markerOnSelected:J=!0}=t,{types:rt=void 0}=t,{excludeTypes:Ct=!1}=t,{zoom:Tt=16}=t,{maxZoom:k=18}=t,{apiUrl:ze="https://api.maptiler.com/geocoding"}=t,{fetchParameters:ge={}}=t,{iconsBaseUrl:Ve="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.3/icons/"}=t,{adjustUrlQuery:Ia=N=>{}}=t;function vc(){Zn.focus()}function Xu(){Zn.blur()}function Sa(N,dt=!0,Le=!1){e(1,F=N),dt?(e(15,Pt=-1),ws()):(Ra(!Le,Le),setTimeout(()=>{Zn.focus(),Zn.select()}))}function Uu(){e(14,ct=void 0),e(55,nt=void 0),e(15,Pt=-1)}function Ec(){e(54,Mt=[]),e(55,nt=void 0)}let Gr=!1,ct,Mt,nt,Yu="",Zn,Pt=-1,wn,Br=[],sr,vi,Ss,or;const wa=new Set,Kn=Lm();wm(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function ws(N){if(vi&&(clearTimeout(vi),vi=void 0),Pt>-1&&ct)e(55,nt=ct[Pt]),e(1,F=nt.place_type[0]==="reverse"?nt.place_name:nt.place_name.replace(/,.*/,"")),e(18,wn=void 0),e(54,Mt=void 0),e(15,Pt=-1);else if(F){const dt=N||!zr(F);La(F,{exact:!0}).then(()=>{e(54,Mt=ct),e(55,nt=void 0),dt&&Wu()}).catch(Le=>e(18,wn=Le))}}function zr(N){try{return f_(N,6)}catch{return!1}}async function La(N,{byId:dt=!1,exact:Le=!1}={}){e(18,wn=void 0),sr==null||sr.abort();const Pe=new AbortController;e(19,sr=Pe);try{const Q=zr(N),kt=new URLSearchParams;if(v!==void 0&&kt.set("language",Array.isArray(v)?v.join(","):v??""),rt&&kt.set("types",rt.join(",")),Ct&&kt.set("excludeTypes",String(Ct)),u&&kt.set("bbox",u.map(Qu=>Qu.toFixed(6)).join(",")),f&&kt.set("country",Array.isArray(f)?f.join(","):f),!dt&&!Q){const Qu=await e_(x,w,Pe);Qu&&kt.set("proximity",Qu),(Le||!M)&&kt.set("autocomplete","false"),kt.set("fuzzyMatch",String(y))}C!==void 0&&(!Q||(rt==null?void 0:rt.length)===1)&&kt.set("limit",String(C)),kt.set("key",a),Ia(kt);const hn=ze+"/"+encodeURIComponent(Q?Q.decimalLongitude+","+Q.decimalLatitude:N)+".json?"+kt.toString();if(hn===Yu){dt?(e(14,ct=void 0),e(55,nt=Br[0])):e(14,ct=Br);return}Yu=hn;const Pa=await fetch(hn,{signal:Pe.signal,...ge});if(!Pa.ok)throw new Error(await Pa.text());const Cc=await Pa.json();Kn("response",{url:hn,featureCollection:Cc}),dt?(e(14,ct=void 0),e(55,nt=Cc.features[0]),Br=[nt]):(e(14,ct=Cc.features.filter(p)),Q&&ct.unshift({type:"Feature",properties:{},id:"reverse_"+Q.decimalLongitude+"_"+Q.decimalLatitude,text:Q.decimalLatitude+", "+Q.decimalLongitude,place_name:Q.decimalLatitude+", "+Q.decimalLongitude,place_type:["reverse"],center:[Q.decimalLongitude,Q.decimalLatitude],bbox:[Q.decimalLongitude,Q.decimalLatitude,Q.decimalLongitude,Q.decimalLatitude],geometry:{type:"Point",coordinates:[Q.decimalLongitude,Q.decimalLatitude]}}),Br=ct,Q&&Zn.focus())}catch(Q){if(Q&&typeof Q=="object"&&"name"in Q&&Q.name==="AbortError")return;throw Q}finally{Pe===sr&&e(19,sr=void 0)}}function Wu(){var Le;if(!(Mt!=null&&Mt.length)||!_)return;const N=[180,90,-180,-90],dt=!Mt.some(Pe=>!Pe.matching_text);for(const Pe of Mt)if(dt||!Pe.matching_text)for(const Q of[0,1,2,3])N[Q]=Math[Q<2?"min":"max"](N[Q],((Le=Pe.bbox)==null?void 0:Le[Q])??Pe.center[Q%2]);x&&Mt.length>0&&(nt&&N[0]===N[2]&&N[1]===N[3]?x.flyTo(nt.center,Tt):x.fitBounds(qh(N),50,k))}function qu(N){e(0,O=d==="always"),e(14,ct=void 0),e(55,nt=void 0),e(15,Pt=-1),Sa(N[1].toFixed(6)+", "+t_(N[0],[-180,180],!0).toFixed(6),!1,!0)}function Na(N){if(!ct)return;let dt=N.key==="ArrowDown"?1:N.key==="ArrowUp"?-1:0;dt&&(Pt===(B?0:-1)&&dt===-1&&e(15,Pt=ct.length),e(15,Pt+=dt),Pt>=ct.length&&e(15,Pt=-1),Pt<0&&B&&e(15,Pt=0),N.preventDefault())}function Ra(N=!0,dt=!1){if(e(18,wn=void 0),M||dt){if(vi&&clearTimeout(vi),F.length<b)return;const Le=F;vi=window.setTimeout(()=>{La(Le).catch(Pe=>e(18,wn=Pe))},N?g:0)}else e(14,ct=void 0),e(18,wn=void 0)}function ba(N){e(55,nt=N),e(1,F=N.place_name),e(15,Pt=-1)}const Hu=()=>Zn.focus();function ju(N){wl[N?"unshift":"push"](()=>{Zn=N,e(17,Zn)})}function Ta(){F=this.value,e(1,F),e(13,Gr),e(27,c)}const Zu=()=>e(13,Gr=!0),Ma=()=>e(13,Gr=!1),Ls=()=>Ra(),Ns=()=>{e(1,F=""),Zn.focus()},Rs=()=>e(0,O=!O),Ku=()=>e(18,wn=void 0),Ju=N=>e(15,Pt=N),Qe=N=>ba(N),Vr=()=>{B||e(15,Pt=-1)},cn=()=>{};return i.$$set=N=>{"class"in N&&e(2,o=N.class),"apiKey"in N&&e(25,a=N.apiKey),"bbox"in N&&e(26,u=N.bbox),"clearButtonTitle"in N&&e(3,l=N.clearButtonTitle),"clearOnBlur"in N&&e(27,c=N.clearOnBlur),"collapsed"in N&&e(4,h=N.collapsed),"country"in N&&e(28,f=N.country),"debounceSearch"in N&&e(29,g=N.debounceSearch),"enableReverse"in N&&e(5,d=N.enableReverse),"errorMessage"in N&&e(6,m=N.errorMessage),"filter"in N&&e(30,p=N.filter),"flyTo"in N&&e(31,_=N.flyTo),"fuzzyMatch"in N&&e(32,y=N.fuzzyMatch),"language"in N&&e(33,v=N.language),"limit"in N&&e(34,C=N.limit),"mapController"in N&&e(35,x=N.mapController),"minLength"in N&&e(36,b=N.minLength),"noResultsMessage"in N&&e(7,R=N.noResultsMessage),"placeholder"in N&&e(8,T=N.placeholder),"proximity"in N&&e(37,w=N.proximity),"reverseActive"in N&&e(0,O=N.reverseActive),"reverseButtonTitle"in N&&e(9,z=N.reverseButtonTitle),"searchValue"in N&&e(1,F=N.searchValue),"showFullGeometry"in N&&e(38,Y=N.showFullGeometry),"showPlaceType"in N&&e(10,L=N.showPlaceType),"showResultsWhileTyping"in N&&e(39,M=N.showResultsWhileTyping),"selectFirst"in N&&e(11,B=N.selectFirst),"flyToSelected"in N&&e(40,U=N.flyToSelected),"markerOnSelected"in N&&e(41,J=N.markerOnSelected),"types"in N&&e(42,rt=N.types),"excludeTypes"in N&&e(43,Ct=N.excludeTypes),"zoom"in N&&e(44,Tt=N.zoom),"maxZoom"in N&&e(45,k=N.maxZoom),"apiUrl"in N&&e(46,ze=N.apiUrl),"fetchParameters"in N&&e(47,ge=N.fetchParameters),"iconsBaseUrl"in N&&e(12,Ve=N.iconsBaseUrl),"adjustUrlQuery"in N&&e(48,Ia=N.adjustUrlQuery),"$$scope"in N&&e(58,s=N.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&134225920&&setTimeout(()=>{e(16,Ss=Gr),c&&!Gr&&e(1,F="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&32&&F.length<b&&(e(55,nt=void 0),e(14,ct=void 0),e(18,wn=void 0),e(54,Mt=ct)),i.$$.dirty[1]&16777344&&Y&&nt&&!nt.address&&nt.geometry.type==="Point"&&nt.place_type[0]!=="reverse"&&La(nt.id,{byId:!0}).catch(N=>e(18,wn=N)),i.$$.dirty[1]&50356241&&(x&&nt&&nt.id!==or&&_&&(!nt.bbox||nt.bbox[0]===nt.bbox[2]&&nt.bbox[1]===nt.bbox[3]?x.flyTo(nt.center,nt.id.startsWith("poi.")||nt.id.startsWith("address.")?k:Tt):x.fitBounds(qh(nt.bbox),50,k),e(14,ct=void 0),e(54,Mt=void 0),e(15,Pt=-1)),e(56,or=nt==null?void 0:nt.id)),i.$$.dirty[0]&18432&&B&&ct!=null&&ct.length&&e(15,Pt=0),i.$$.dirty[0]&2050&&(B||e(15,Pt=-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&8388608&&Mt!==ct&&e(54,Mt=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&8388624&&x&&x.setEventHandler(N=>{switch(N.type){case"mapClick":O&&qu(N.coordinates);break;case"markerClick":{const dt=ct==null?void 0:ct.find(Le=>Le.id===N.id);dt&&ba(dt)}break;case"markerMouseEnter":Mt&&e(15,Pt=Ss?(ct==null?void 0:ct.findIndex(dt=>dt.id===N.id))??-1:-1);break;case"markerMouseLeave":Mt&&e(15,Pt=-1);break}}),i.$$.dirty[0]&49152&&e(57,n=ct==null?void 0:ct[Pt]),i.$$.dirty[1]&67133969&&x&&n&&_&&U&&x.flyTo(n.center,n.id.startsWith("poi.")||n.id.startsWith("address.")?k:Tt),i.$$.dirty[1]&1040&&(J||x==null||x.setMarkers(void 0,void 0)),i.$$.dirty[1]&75498512&&x&&J&&!Mt&&(x.setMarkers(n?[n]:void 0,void 0),x.setSelectedMarker(n?0:-1)),i.$$.dirty[1]&25165840&&x&&x.setMarkers(Mt,nt),i.$$.dirty[0]&32768|i.$$.dirty[1]&8388624&&Mt&&x&&x.setSelectedMarker(Pt),i.$$.dirty[0]&2|i.$$.dirty[1]&16&&x){const N=zr(F);x.setReverseMarker(N?[N.decimalLongitude,N.decimalLatitude]:void 0)}i.$$.dirty[1]&67108864&&Kn("select",n),i.$$.dirty[1]&16777216&&Kn("pick",nt),i.$$.dirty[0]&81920&&Kn("optionsVisibilityChange",Ss&&!!ct),i.$$.dirty[0]&16384&&Kn("featuresListed",ct),i.$$.dirty[1]&8388608&&Kn("featuresMarked",Mt),i.$$.dirty[0]&1&&Kn("reverseToggle",O),i.$$.dirty[0]&2&&Kn("queryChange",F),i.$$.dirty[0]&1|i.$$.dirty[1]&16&&x&&x.indicateReverse(O)},[O,F,o,l,h,d,m,R,T,z,L,B,Ve,Gr,ct,Pt,Ss,Zn,wn,sr,wa,ws,Na,Ra,ba,a,u,c,f,g,p,_,y,v,C,x,b,w,Y,M,U,J,rt,Ct,Tt,k,ze,ge,Ia,vc,Xu,Sa,Uu,Ec,Mt,nt,or,n,s,r,Hu,ju,Ta,Zu,Ma,Ls,Ns,Rs,Ku,Ju,Qe,Vr,cn]}let v_=class extends es{constructor(t){super(),ts(this,t,y_,__,Qr,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}};class ii extends ar{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new ii(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const n=this.getStyle();return n&&t.setStyle(n),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&($n(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Qn(t,Ln.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?E_(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function E_(i){if(typeof i=="function")return i;let t;return Array.isArray(i)?t=i:(ue(typeof i.getZIndex=="function",41),t=[i]),function(){return t}}class ns{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new ns({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}function sf(i,t,e,n,r,s,o){let a,u;const l=(e-t)/n;if(l===1)a=t;else if(l===2)a=t,u=r;else if(l!==0){let c=i[t],h=i[t+1],f=0;const g=[0];for(let p=t+n;p<e;p+=n){const _=i[p],y=i[p+1];f+=Math.sqrt((_-c)*(_-c)+(y-h)*(y-h)),g.push(f),c=_,h=y}const d=r*f,m=_d(g,d);m<0?(u=(d-g[-m-2])/(g[-m-1]-g[-m-2]),a=t+(-m-2)*n):a=t+m*n}o=o>1?o:2,s=s||new Array(o);for(let c=0;c<o;++c)s[c]=a===void 0?NaN:u===void 0?i[a+c]:fn(i[a+c],i[a+n+c],u);return s}function Tl(i,t,e,n,r,s){if(e==t)return null;let o;if(r<i[t+n-1])return s?(o=i.slice(t,t+n),o[n-1]=r,o):null;if(i[e-1]<r)return s?(o=i.slice(e-n,e),o[n-1]=r,o):null;if(r==i[t+n-1])return i.slice(t,t+n);let a=t/n,u=e/n;for(;a<u;){const f=a+u>>1;r<i[(f+1)*n-1]?u=f:a=f+1}const l=i[a*n-1];if(r==l)return i.slice((a-1)*n,(a-1)*n+n);const c=i[(a+1)*n-1],h=(r-l)/(c-l);o=[];for(let f=0;f<n-1;++f)o.push(fn(i[(a-1)*n+f],i[a*n+f],h));return o.push(r),o}function C_(i,t,e,n,r,s,o){if(o)return Tl(i,t,e[e.length-1],n,r,s);let a;if(r<i[n-1])return s?(a=i.slice(0,n),a[n-1]=r,a):null;if(i[i.length-1]<r)return s?(a=i.slice(i.length-n),a[n-1]=r,a):null;for(let u=0,l=e.length;u<l;++u){const c=e[u];if(t!=c){if(r<i[t+n-1])return null;if(r<=i[c-1])return Tl(i,t,c,n,r,!1);t=c}}return null}function of(i,t,e,n){let r=i[t],s=i[t+1],o=0;for(let a=t+n;a<e;a+=n){const u=i[a],l=i[a+1];o+=Math.sqrt((u-r)*(u-r)+(l-s)*(l-s)),r=u,s=l}return o}let eu=class wc extends jr{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){this.flatCoordinates?Gi(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new wc(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,r){return r<Ur(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),dl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))}forEachSegment(t){return xh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,Tl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return hr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return sf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return of(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=_l(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new wc(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ua(this.flatCoordinates,0,t,this.stride),this.changed()}};class Ys{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Ys({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const Zt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class nu{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Za(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new nu({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return xt()}getImage(t){return xt()}getHitDetectionImage(){return xt()}getPixelRatio(t){return 1}getImageState(){return xt()}getImageSize(){return xt()}getOrigin(){return xt()}getSize(){return xt()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Za(t)}listenImageChange(t){xt()}load(){xt()}unlistenImageChange(t){xt()}}function Ci(i){return Array.isArray(i)?oh(i):i}class iu extends nu{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new iu({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_;if(!t)return null;const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const n=this.renderOptions_,r=ti(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return Zt.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const b=r;r=s,s=b}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,u=s*Math.sin(a),l=Math.sqrt(s*s-u*u),c=r-l,h=Math.sqrt(u*u+c*c),f=h/u;if(t==="miter"&&f<=n)return f*e;const g=e/2/f,d=e/2*(c/h),p=Math.sqrt((r+g)*(r+g)+d*d)-r;if(this.radius2_===void 0||t==="bevel")return p*2;const _=r*Math.sin(a),y=Math.sqrt(r*r-_*_),v=s-y,x=Math.sqrt(_*_+v*v)/_;if(x<=n){const b=x*e/2-s-r;return 2*Math.max(p,b)}return p*2}createRenderOptions(){let t=Bs,e=0,n=null,r=0,s,o=0;this.stroke_&&(s=this.stroke_.getColor(),s===null&&(s=Do),s=Ci(s),o=this.stroke_.getWidth(),o===void 0&&(o=Fo),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=Bs),e=this.stroke_.getMiterLimit(),e===void 0&&(e=Oo));const a=this.calculateLineJoinSize_(t,o,e),u=Math.max(this.radius_,this.radius2_||0),l=Math.ceil(2*u+a);return{strokeStyle:s,strokeWidth:o,size:l,lineDash:n,lineDashOffset:r,lineJoin:t,miterLimit:e}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let r=this.fill_.getColor();r===null&&(r=tn),e.fillStyle=Ci(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){if(this.fill_){let e=this.fill_.getColor(),n=0;if(typeof e=="string"&&(e=Xa(e)),e===null?n=1:Array.isArray(e)&&(n=e.length===4?e[3]:1),n===0){const r=ti(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(e*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let a=0;a<e;a++){const u=s+a*o,l=a%2===0?n:r;t.lineTo(l*Math.cos(u),l*Math.sin(u))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=tn,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}}class ru extends iu{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new ru({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}class is{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=af,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new is({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=af,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function x_(i){let t;if(typeof i=="function")t=i;else{let e;Array.isArray(i)?e=i:(ue(typeof i.getZIndex=="function",41),e=[i]),t=function(){return e}}return t}let Ml=null;function I_(i,t){if(!Ml){const e=new ns({color:"rgba(255,255,255,0.4)"}),n=new Ys({color:"#3399CC",width:1.25});Ml=[new is({image:new ru({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return Ml}function af(i){return i.getGeometry()}const S_="#333";class su{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Za(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new ns({color:S_}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const t=this.getScale();return new su({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Za(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function w_(i,t,e,n,r){uf(i,t,e||0,n||i.length-1,r||L_)}function uf(i,t,e,n,r){for(;n>e;){if(n-e>600){var s=n-e+1,o=t-e+1,a=Math.log(s),u=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*u*(s-u)/s)*(o-s/2<0?-1:1),c=Math.max(e,Math.floor(t-o*u/s+l)),h=Math.min(n,Math.floor(t+(s-o)*u/s+l));uf(i,t,c,h,r)}var f=i[t],g=e,d=n;for(Xo(i,e,t),r(i[n],f)>0&&Xo(i,e,n);g<d;){for(Xo(i,g,d),g++,d--;r(i[g],f)<0;)g++;for(;r(i[d],f)>0;)d--}r(i[e],f)===0?Xo(i,e,d):(d++,Xo(i,d,n)),d<=t&&(e=d+1),t<=d&&(n=d-1)}}function Xo(i,t,e){var n=i[t];i[t]=i[e],i[e]=n}function L_(i,t){return i<t?-1:i>t?1:0}let lf=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!au(t,e))return n;const r=this.toBBox,s=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],u=e.leaf?r(a):a;au(t,u)&&(e.leaf?n.push(a):Ol(t,u)?this._all(a,n):s.push(a))}e=s.pop()}return n}collides(t){let e=this.data;if(!au(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const s=e.children[r],o=e.leaf?this.toBBox(s):s;if(au(t,o)){if(e.leaf||Ol(t,o))return!0;n.push(s)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=qs([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),s=[],o=[];let a,u,l;for(;n||s.length;){if(n||(n=s.pop(),u=s[s.length-1],a=o.pop(),l=!0),n.leaf){const c=N_(t,n.children,e);if(c!==-1)return n.children.splice(c,1),s.push(n),this._condense(s),this}!l&&!n.leaf&&Ol(n,r)?(s.push(n),o.push(a),a=0,u=n,n=n.children[0]):u?(a++,n=u.children[a],l=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const s=n-e+1;let o=this._maxEntries,a;if(s<=o)return a=qs(t.slice(e,n+1)),Ws(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=qs([]),a.leaf=!1,a.height=r;const u=Math.ceil(s/o),l=u*Math.ceil(Math.sqrt(o));cf(t,e,n,l,this.compareMinX);for(let c=e;c<=n;c+=l){const h=Math.min(c+l-1,n);cf(t,c,h,u,this.compareMinY);for(let f=c;f<=h;f+=u){const g=Math.min(f+u-1,h);a.children.push(this._build(t,f,g,r-1))}}return Ws(a,this.toBBox),a}_chooseSubtree(t,e,n,r){for(;r.push(e),!(e.leaf||r.length-1===n);){let s=1/0,o=1/0,a;for(let u=0;u<e.children.length;u++){const l=e.children[u],c=Pl(l),h=T_(t,l)-c;h<o?(o=h,s=c<s?c:s,a=l):h===o&&c<s&&(s=c,a=l)}e=a||e.children[0]}return e}_insert(t,e,n){const r=n?t:this.toBBox(t),s=[],o=this._chooseSubtree(r,this.data,e,s);for(o.children.push(t),Yo(o,r);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)}_split(t,e){const n=t[e],r=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,r);const o=this._chooseSplitIndex(n,s,r),a=qs(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Ws(n,this.toBBox),Ws(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=qs([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ws(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,s=1/0,o=1/0;for(let a=e;a<=n-e;a++){const u=Uo(t,0,a,this.toBBox),l=Uo(t,a,n,this.toBBox),c=M_(u,l),h=Pl(u)+Pl(l);c<s?(s=c,r=a,o=h<o?h:o):c===s&&h<o&&(o=h,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:R_,s=t.leaf?this.compareMinY:b_,o=this._allDistMargin(t,e,n,r),a=this._allDistMargin(t,e,n,s);o<a&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const s=this.toBBox,o=Uo(t,0,e,s),a=Uo(t,n-e,n,s);let u=ou(o)+ou(a);for(let l=e;l<n-e;l++){const c=t.children[l];Yo(o,t.leaf?s(c):c),u+=ou(o)}for(let l=n-e-1;l>=e;l--){const c=t.children[l];Yo(a,t.leaf?s(c):c),u+=ou(a)}return u}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Yo(e[r],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Ws(t[e],this.toBBox)}};function N_(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n<t.length;n++)if(e(i,t[n]))return n;return-1}function Ws(i,t){Uo(i,0,i.children.length,t,i)}function Uo(i,t,e,n,r){r||(r=qs(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=t;s<e;s++){const o=i.children[s];Yo(r,i.leaf?n(o):o)}return r}function Yo(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function R_(i,t){return i.minX-t.minX}function b_(i,t){return i.minY-t.minY}function Pl(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function ou(i){return i.maxX-i.minX+(i.maxY-i.minY)}function T_(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function M_(i,t){const e=Math.max(i.minX,t.minX),n=Math.max(i.minY,t.minY),r=Math.min(i.maxX,t.maxX),s=Math.min(i.maxY,t.maxY);return Math.max(0,r-e)*Math.max(0,s-n)}function Ol(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function au(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function qs(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function cf(i,t,e,n,r){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;w_(i,o,t,e,r),s.push(t,o,o,e)}}function P_(i,t,e){const n=i;let r=!0,s=!1,o=!1;const a=[Da(n,Ln.LOAD,function(){o=!0,s||t()})];return n.src&&Sd?(s=!0,n.decode().then(function(){r&&t()}).catch(function(u){r&&(o?t():e())})):a.push(Da(n,Ln.ERROR,e)),function(){r=!1,a.forEach($n)}}let Wo=null;class O_ extends Tc{constructor(t,e,n,r,s,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=r,this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=s,this.size_=n,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Zt.LOADED){Wo||(Wo=ti(1,1,void 0,{willReadFrequently:!0})),Wo.drawImage(this.image_,0,0);try{Wo.getImageData(0,0,1,1),this.tainted_=!1}catch{Wo=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Ln.CHANGE)}handleImageError_(){this.imageState_=Zt.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Zt.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=ti(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Zt.IDLE){this.image_||this.initializeImage_(),this.imageState_=Zt.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=P_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Zt.LOADED)return;const e=this.image_,n=document.createElement("canvas");n.width=Math.ceil(e.width*t),n.height=Math.ceil(e.height*t);const r=n.getContext("2d");r.scale(t,t),r.drawImage(e,0,0),r.globalCompositeOperation="multiply",r.fillStyle=rh(this.color_),r.fillRect(0,0,n.width/t,n.height/t),r.globalCompositeOperation="destination-in",r.drawImage(e,0,0),this.canvas_[t]=n}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function D_(i,t,e,n,r,s){let o=uh.get(t,n,s);return o||(o=new O_(i,t,e,n,r,s),uh.set(t,n,s,o)),o}function hf(i,t,e,n){return e!==void 0&&n!==void 0?[e/i,n/t]:e!==void 0?e/i:n!==void 0?n/t:1}class qo extends nu{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,r=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:r,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;this.imgSize_=t.imgSize;let a=t.src;ue(!(a!==void 0&&o),4),ue(!o||o&&this.imgSize_,5),(a===void 0||a.length===0)&&o&&(a=o.src||de(o)),ue(a!==void 0&&a.length>0,6),ue(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),69);const u=t.src!==void 0?Zt.IDLE:Zt.LOADED;if(this.color_=t.color!==void 0?Xa(t.color):null,this.iconImage_=D_(o,a,this.imgSize_!==void 0?this.imgSize_:null,this.crossOrigin_,u,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let l,c;if(t.size)[l,c]=t.size;else{const h=this.getImage(1);if(h instanceof HTMLCanvasElement||h.src&&h.complete)l=h.width,c=h.height;else{this.initialOptions_=t;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(hf(g[0],g[1],t.width,t.height))};this.listenImageChange(f);return}}l!==void 0&&this.setScale(hf(l,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new qo({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=r[0]),this.anchorYUnits_=="fraction"&&(t[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+r[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==Zt.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==Zt.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(Ln.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Ln.CHANGE,t)}}function ff(i){return new is({fill:Ho(i,""),stroke:jo(i,""),text:A_(i),image:F_(i)})}function Ho(i,t){const e=i[t+"fill-color"];if(e)return e==="none"?null:new ns({color:e})}function jo(i,t){const e=i[t+"stroke-width"],n=i[t+"stroke-color"];if(!(!e&&!n))return new Ys({width:e,color:n,lineCap:i[t+"stroke-line-cap"],lineJoin:i[t+"stroke-line-join"],lineDash:i[t+"stroke-line-dash"],lineDashOffset:i[t+"stroke-line-dash-offset"],miterLimit:i[t+"stroke-miter-limit"]})}function A_(i){const t=i["text-value"];return t?new su({text:t,font:i["text-font"],maxAngle:i["text-max-angle"],offsetX:i["text-offset-x"],offsetY:i["text-offset-y"],overflow:i["text-overflow"],placement:i["text-placement"],repeat:i["text-repeat"],scale:i["text-scale"],rotateWithView:i["text-rotate-with-view"],rotation:i["text-rotation"],textAlign:i["text-align"],justify:i["text-justify"],textBaseline:i["text-baseline"],padding:i["text-padding"],fill:Ho(i,"text-"),backgroundFill:Ho(i,"text-background-"),stroke:jo(i,"text-"),backgroundStroke:jo(i,"text-background-")}):void 0}function F_(i){const t=i["icon-src"],e=i["icon-img"];if(t||e)return new qo({src:t,img:e,imgSize:i["icon-img-size"],anchor:i["icon-anchor"],anchorOrigin:i["icon-anchor-origin"],anchorXUnits:i["icon-anchor-x-units"],anchorYUnits:i["icon-anchor-y-units"],color:i["icon-color"],crossOrigin:i["icon-cross-origin"],offset:i["icon-offset"],displacement:i["icon-displacement"],opacity:i["icon-opacity"],scale:i["icon-scale"],width:i["icon-width"],height:i["icon-height"],rotation:i["icon-rotation"],rotateWithView:i["icon-rotate-with-view"],size:i["icon-size"],declutterMode:i["icon-declutter-mode"]});const n=i["shape-points"];if(n){const s="shape-";return new iu({points:n,fill:Ho(i,s),stroke:jo(i,s),radius:i["shape-radius"],radius1:i["shape-radius1"],radius2:i["shape-radius2"],angle:i["shape-angle"],displacement:i["shape-displacement"],rotation:i["shape-rotation"],rotateWithView:i["shape-rotate-with-view"],scale:i["shape-scale"],declutterMode:i["shape-declutter-mode"]})}const r=i["circle-radius"];if(r){const s="circle-";return new ru({radius:r,fill:Ho(i,s),stroke:jo(i,s),displacement:i["circle-displacement"],scale:i["circle-scale"],rotation:i["circle-rotation"],rotateWithView:i["circle-rotate-with-view"],declutterMode:i["circle-declutter-mode"]})}}const gf={RENDER_ORDER:"renderOrder"};class k_ extends am{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(gf.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new lf(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(gf.RENDER_ORDER,t)}setStyle(t){let e;if(t===void 0)e=I_;else if(t===null)e=null;else if(typeof t=="function")e=t;else if(t instanceof is)e=t;else if(Array.isArray(t)){const n=t.length,r=new Array(n);for(let s=0;s<n;++s){const o=t[s];o instanceof is?r[s]=o:r[s]=ff(o)}e=r}else e=ff(t);this.style_=e,this.styleFunction_=t===null?void 0:x_(this.style_),this.changed()}}const H={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},uu=[H.FILL],mr=[H.STROKE],rs=[H.BEGIN_PATH],df=[H.CLOSE_PATH];class pf{drawCustom(t,e,n,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}class Zo extends pf{constructor(t,e,n,r){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,u=t.length;a<u;a+=e)r[0]=t[a],r[1]=t[a+1],zd(n,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(t,e,n,r,s,o){const a=this.coordinates;let u=a.length;const l=this.getBufferedMaxExtent();o&&(e+=r);let c=t[e],h=t[e+1];const f=this.tmpCoordinate_;let g=!0,d,m,p;for(d=e+r;d<n;d+=r)f[0]=t[d],f[1]=t[d+1],p=sl(l,f),p!==m?(g&&(a[u++]=c,a[u++]=h,g=!1),a[u++]=f[0],a[u++]=f[1]):p===pe.INTERSECTING?(a[u++]=f[0],a[u++]=f[1],g=!1):g=!0,c=f[0],h=f[1],m=p;return(s&&g||d===e+r)&&(a[u++]=c,a[u++]=h),u}drawCustomCoordinates_(t,e,n,r,s){for(let o=0,a=n.length;o<a;++o){const u=n[o],l=this.appendFlatLineCoordinates(t,e,u,r,!1,!1);s.push(l),e=u}return e}drawCustom(t,e,n,r){this.beginGeometry(t,e);const s=t.getType(),o=t.getStride(),a=this.coordinates.length;let u,l,c,h,f;switch(s){case"MultiPolygon":u=t.getOrientedFlatCoordinates(),h=[];const g=t.getEndss();f=0;for(let d=0,m=g.length;d<m;++d){const p=[];f=this.drawCustomCoordinates_(u,f,g[d],o,p),h.push(p)}this.instructions.push([H.CUSTOM,a,h,t,n,yl]),this.hitDetectionInstructions.push([H.CUSTOM,a,h,t,r||n,yl]);break;case"Polygon":case"MultiLineString":c=[],u=s=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),f=this.drawCustomCoordinates_(u,0,t.getEnds(),o,c),this.instructions.push([H.CUSTOM,a,c,t,n,Mo]),this.hitDetectionInstructions.push([H.CUSTOM,a,c,t,r||n,Mo]);break;case"LineString":case"Circle":u=t.getFlatCoordinates(),l=this.appendFlatLineCoordinates(u,0,u.length,o,!1,!1),this.instructions.push([H.CUSTOM,a,l,t,n,hr]),this.hitDetectionInstructions.push([H.CUSTOM,a,l,t,r||n,hr]);break;case"MultiPoint":u=t.getFlatCoordinates(),l=this.appendFlatPointCoordinates(u,o),l>a&&(this.instructions.push([H.CUSTOM,a,l,t,n,hr]),this.hitDetectionInstructions.push([H.CUSTOM,a,l,t,r||n,hr]));break;case"Point":u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),l=this.coordinates.length,this.instructions.push([H.CUSTOM,a,l,t,n]),this.hitDetectionInstructions.push([H.CUSTOM,a,l,t,r||n]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[H.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[H.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let r,s,o=-1;for(e=0;e<n;++e)r=t[e],s=r[0],s==H.END_GEOMETRY?o=e:s==H.BEGIN_GEOMETRY&&(r[2]=e,yd(this.hitDetectionInstructions,o,e),o=-1)}setFillStrokeStyle(t,e){const n=this.state;if(t){const r=t.getColor();n.fillStyle=Ci(r||tn)}else n.fillStyle=void 0;if(e){const r=e.getColor();n.strokeStyle=Ci(r||Do);const s=e.getLineCap();n.lineCap=s!==void 0?s:qa;const o=e.getLineDash();n.lineDash=o?o.slice():Bi;const a=e.getLineDashOffset();n.lineDashOffset=a||zi;const u=e.getLineJoin();n.lineJoin=u!==void 0?u:Bs;const l=e.getWidth();n.lineWidth=l!==void 0?l:Fo;const c=e.getMiterLimit();n.miterLimit=c!==void 0?c:Oo,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const e=t.fillStyle,n=[H.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(!0),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[H.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,r=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,u=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||s!=t.currentLineDash&&!bs(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=u||t.currentMiterLimit!=l)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=u,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[H.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Bd(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;il(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class G_ extends Zo{constructor(t,e,n,r){super(t,e,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const n=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([H.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([H.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const n=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([H.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([H.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const n=t.getAnchor(),r=t.getSize(),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}class B_ extends Zo{constructor(t,e,n,r){super(t,e,n,r)}drawFlatCoordinates_(t,e,n,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),a=[H.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n}drawLineString(t,e){const n=this.state,r=n.strokeStyle,s=n.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi],rs);const o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(mr),this.endGeometry(e)}drawMultiLineString(t,e){const n=this.state,r=n.strokeStyle,s=n.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi],rs);const o=t.getEnds(),a=t.getFlatCoordinates(),u=t.getStride();let l=0;for(let c=0,h=o.length;c<h;++c)l=this.drawFlatCoordinates_(a,l,o[c],u);this.hitDetectionInstructions.push(mr),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(mr),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(mr),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(rs)}}class mf extends Zo{constructor(t,e,n,r){super(t,e,n,r)}drawFlatCoordinatess_(t,e,n,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,u=n.length;this.instructions.push(rs),this.hitDetectionInstructions.push(rs);for(let l=0;l<u;++l){const c=n[l],h=this.coordinates.length,f=this.appendFlatLineCoordinates(t,e,c,r,!0,!a),g=[H.MOVE_TO_LINE_TO,h,f];this.instructions.push(g),this.hitDetectionInstructions.push(g),a&&(this.instructions.push(df),this.hitDetectionInstructions.push(df)),e=c}return o&&(this.instructions.push(uu),this.hitDetectionInstructions.push(uu)),a&&(this.instructions.push(mr),this.hitDetectionInstructions.push(mr)),e}drawCircle(t,e){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_FILL_STYLE,tn]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi]);const o=t.getFlatCoordinates(),a=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const l=[H.CIRCLE,u];this.instructions.push(rs,l),this.hitDetectionInstructions.push(rs,l),n.fillStyle!==void 0&&(this.instructions.push(uu),this.hitDetectionInstructions.push(uu)),n.strokeStyle!==void 0&&(this.instructions.push(mr),this.hitDetectionInstructions.push(mr)),this.endGeometry(e)}drawPolygon(t,e){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_FILL_STYLE,tn]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi]);const o=t.getEnds(),a=t.getOrientedFlatCoordinates(),u=t.getStride();this.drawFlatCoordinatess_(a,0,o,u),this.endGeometry(e)}drawMultiPolygon(t,e){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_FILL_STYLE,tn]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi]);const o=t.getEndss(),a=t.getOrientedFlatCoordinates(),u=t.getStride();let l=0;for(let c=0,h=o.length;c<h;++c)l=this.drawFlatCoordinatess_(a,l,o[c],u);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let n=0,r=e.length;n<r;++n)e[n]=Zr(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}function z_(i,t,e,n,r){const s=[];let o=e,a=0,u=t.slice(e,2);for(;a<i&&o+r<n;){const[l,c]=u.slice(-2),h=t[o+r],f=t[o+r+1],g=Math.sqrt((h-l)*(h-l)+(f-c)*(f-c));if(a+=g,a>=i){const d=(i-a+g)/g,m=fn(l,h,d),p=fn(c,f,d);u.push(m,p),s.push(u),u=[m,p],a==i&&(o+=r),a=0}else if(a<i)u.push(t[o+r],t[o+r+1]),o+=r;else{const d=g-a,m=fn(l,h,d/g),p=fn(c,f,d/g);u.push(m,p),s.push(u),u=[m,p],a=0,o+=r}}return a>0&&s.push(u),s}function V_(i,t,e,n,r){let s=e,o=e,a=0,u=0,l=e,c,h,f,g,d,m,p,_,y,v;for(h=e;h<n;h+=r){const C=t[h],x=t[h+1];d!==void 0&&(y=C-d,v=x-m,g=Math.sqrt(y*y+v*v),p!==void 0&&(u+=f,c=Math.acos((p*y+_*v)/(f*g)),c>i&&(u>a&&(a=u,s=l,o=h),u=0,l=h-r)),f=g,p=y,_=v),d=C,m=x}return u+=g,u>a?[l,h]:[s,o]}const lu={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class X_ extends Zo{constructor(t,e,n,r){super(t,e,n,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[tn]={fillStyle:tn},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const n=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!n&&!r)return;const o=this.coordinates;let a=o.length;const u=t.getType();let l=null,c=t.getStride();if(s.placement==="line"&&(u=="LineString"||u=="MultiLineString"||u=="Polygon"||u=="MultiPolygon")){if(!ei(this.getBufferedMaxExtent(),t.getExtent()))return;let h;if(l=t.getFlatCoordinates(),u=="LineString")h=[l.length];else if(u=="MultiLineString")h=t.getEnds();else if(u=="Polygon")h=t.getEnds().slice(0,1);else if(u=="MultiPolygon"){const m=t.getEndss();h=[];for(let p=0,_=m.length;p<_;++p)h.push(m[p][0])}this.beginGeometry(t,e);const f=s.repeat,g=f?void 0:s.textAlign;let d=0;for(let m=0,p=h.length;m<p;++m){let _;f?_=z_(f*this.resolution,l,d,h[m],c):_=[l.slice(d,h[m])];for(let y=0,v=_.length;y<v;++y){const C=_[y];let x=0,b=C.length;if(g==null){const T=V_(s.maxAngle,C,0,C.length,2);x=T[0],b=T[1]}for(let T=x;T<b;T+=c)o.push(C[T],C[T+1]);const R=o.length;d=h[m],this.drawChars_(a,R),a=R}}this.endGeometry(e)}else{let h=s.overflow?null:[];switch(u){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),c=2;break;case"Polygon":l=t.getFlatInteriorPoint(),s.overflow||h.push(l[2]/this.resolution),c=3;break;case"MultiPolygon":const _=t.getFlatInteriorPoints();l=[];for(let y=0,v=_.length;y<v;y+=3)s.overflow||h.push(_[y+2]/this.resolution),l.push(_[y],_[y+1]);if(l.length===0)return;c=2;break}const f=this.appendFlatPointCoordinates(l,c);if(f===a)return;if(h&&(f-a)/2!==l.length/c){let _=a/2;h=h.filter((y,v)=>{const C=o[(_+v)*2]===l[v*c]&&o[(_+v)*2+1]===l[v*c+1];return C||--_,C})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&this.updateFillStyle(this.state,this.createFill),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let g=s.padding;if(g!=Jr&&(s.scale[0]<0||s.scale[1]<0)){let _=s.padding[0],y=s.padding[1],v=s.padding[2],C=s.padding[3];s.scale[0]<0&&(y=-y,C=-C),s.scale[1]<0&&(_=-_,v=-v),g=[_,y,v,C]}const d=this.pixelRatio;this.instructions.push([H.DRAW_IMAGE,a,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,g==Jr?Jr:g.map(function(_){return _*d}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);const m=1/d,p=this.state.fillStyle;s.backgroundFill&&(this.state.fillStyle=tn,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([H.DRAW_IMAGE,a,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,g,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?tn:this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),s.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Ao,justify:e.justify,textBaseline:e.textBaseline||Ha,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const u=this.pixelRatio,l=lu[r.textBaseline],c=this.textOffsetY_*u,h=this.text_,f=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([H.DRAW_CHARS,t,e,l,r.overflow,a,r.maxAngle,u,c,s,f*u,h,o,1]),this.hitDetectionInstructions.push([H.DRAW_CHARS,t,e,l,r.overflow,a&&tn,r.maxAngle,1,c,s,f,h,o,1/u])}setTextStyle(t,e){let n,r,s;if(!t)this.text_="";else{const o=t.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Ci(o.getColor()||tn)):(r=null,this.textFillState_=r);const a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const d=a.getLineDash(),m=a.getLineDashOffset(),p=a.getWidth(),_=a.getMiterLimit();s.lineCap=a.getLineCap()||qa,s.lineDash=d?d.slice():Bi,s.lineDashOffset=m===void 0?zi:m,s.lineJoin=a.getLineJoin()||Bs,s.lineWidth=p===void 0?Fo:p,s.miterLimit=_===void 0?Oo:_,s.strokeStyle=Ci(a.getColor()||Do)}n=this.textState_;const u=t.getFont()||bh;cm(u);const l=t.getScaleArray();n.overflow=t.getOverflow(),n.font=u,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Ha,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Jr,n.scale=l===void 0?[1,1]:l;const c=t.getOffsetX(),h=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=f===void 0?!1:f,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:de(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=r?typeof r.fillStyle=="string"?r.fillStyle:"|"+de(r.fillStyle):""}this.declutterImageWithText_=e}}const U_={Circle:mf,Default:Zo,Image:G_,LineString:B_,Polygon:mf,Text:X_};class _f{constructor(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const r in n){const s=n[r].finish();t[e][r]=s}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let s=r[e];if(s===void 0){const o=U_[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=s}return s}}class Y_ extends wo{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return xt()}getData(t){return null}prepareFrame(t){return xt()}renderFrame(t,e){return xt()}loadedTileCallback(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n}createLoadedTileFinder(t,e,n){return(r,s)=>{const o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,s,o)}}forEachFeatureAtCoordinate(t,e,n,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Zt.LOADED||e.getState()===Zt.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Zt.LOADED&&e!=Zt.ERROR&&t.addEventListener(Ln.CHANGE,this.boundHandleImageChange_),e==Zt.IDLE&&(t.load(),e=t.getState()),e==Zt.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const yf=[];let Hs=null;function W_(){Hs=ti(1,1,void 0,{willReadFrequently:!0})}class q_ extends Y_{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=cr(),this.pixelTransform=cr(),this.inversePixelTransform=cr(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,n){Hs||W_(),Hs.clearRect(0,0,1,1);let r;try{Hs.drawImage(t,e,n,1,1,0,0,1,1),r=Hs.getImageData(0,0,1,1).data}catch{return Hs=null,null}return r}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const r=this.getLayer().getClassName();let s,o;if(t&&t.className===r&&(!n||t&&t.style.backgroundColor&&bs(Xa(t.style.backgroundColor),Xa(n)))){const a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=ti();const u=o.canvas;s.appendChild(u),a=u.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const r=qc(n),s=Hc(n),o=Wc(n),a=Yc(n);$e(e.coordinateToPixelTransform,r),$e(e.coordinateToPixelTransform,s),$e(e.coordinateToPixelTransform,o),$e(e.coordinateToPixelTransform,a);const u=this.inversePixelTransform;$e(u,r),$e(u,s),$e(u,o),$e(u,a),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}dispatchRenderEvent_(t,e,n){const r=this.getLayer();if(r.hasListener(t)){const s=new lm(t,this.inversePixelTransform,n,e);r.dispatchEvent(s)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(To.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(To.POSTRENDER,t,e)}getRenderTransform(t,e,n,r,s,o,a){const u=s/2,l=o/2,c=r/e,h=-c,f=-t[0]+a,g=-t[1];return bo(this.tempTransform,u,l,c,h,-n,f,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function H_(i,t,e,n,r,s,o,a,u,l,c,h){let f=i[t],g=i[t+1],d=0,m=0,p=0,_=0;function y(){d=f,m=g,t+=n,f=i[t],g=i[t+1],_+=p,p=Math.sqrt((f-d)*(f-d)+(g-m)*(g-m))}do y();while(t<e-n&&_+p<s);let v=p===0?0:(s-_)/p;const C=fn(d,f,v),x=fn(m,g,v),b=t-n,R=_,T=s+a*u(l,r,c);for(;t<e-n&&_+p<T;)y();v=p===0?0:(T-_)/p;const w=fn(d,f,v),O=fn(m,g,v);let z;if(h){const B=[C,x,w,O];fh(B,0,4,2,h,B,B),z=B[0]>B[2]}else z=C>w;const F=Math.PI,Y=[],L=b+n===t;t=b,p=0,_=R,f=i[t],g=i[t+1];let M;if(L){y(),M=Math.atan2(g-m,f-d),z&&(M+=M>0?-F:F);const B=(w+C)/2,U=(O+x)/2;return Y[0]=[B,U,(T-s)/2,M,r],Y}r=r.replace(/\n/g," ");for(let B=0,U=r.length;B<U;){y();let J=Math.atan2(g-m,f-d);if(z&&(J+=J>0?-F:F),M!==void 0){let ge=J-M;if(ge+=ge>F?-2*F:ge<-F?2*F:0,Math.abs(ge)>o)return null}M=J;const rt=B;let Ct=0;for(;B<U;++B){const ge=z?U-B-1:B,Ve=a*u(l,r[ge],c);if(t+n<e&&_+p<s+Ct+Ve/2)break;Ct+=Ve}if(B===rt)continue;const Tt=z?r.substring(U-rt,U-B):r.substring(rt,B);v=p===0?0:(s+Ct/2-_)/p;const k=fn(d,f,v),ze=fn(m,g,v);Y.push([k,ze,Ct/2,J,Tt]),s+=Ct}return Y}const js=Yr(),_r=[],Wi=[],qi=[],yr=[];function vf(i){return i[3].declutterBox}const Ef=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Dl(i,t){return t==="start"?t=Ef.test(i)?"right":"left":t==="end"&&(t=Ef.test(i)?"left":"right"),lu[t]}function j_(i,t,e){return e>0&&i.push(`
6
+ `||l===c){s=Math.max(s,o),r.push(o),o=0,a+=u;continue}const f=t[l+1]||i.font,g=ja(f,h);e.push(g),o+=g;const d=hm(f);n.push(d),u=Math.max(u,d)}return{width:s,height:a,widths:e,heights:n,lineWidths:r}}function gm(i,t,e,n,r,s,o,a,u,l,c){i.save(),e!==1&&(i.globalAlpha*=e),t&&i.setTransform.apply(i,t),n.contextInstructions?(i.translate(u,l),i.scale(c[0],c[1]),dm(n,i)):c[0]<0||c[1]<0?(i.translate(u,l),i.scale(c[0],c[1]),i.drawImage(n,r,s,o,a,0,0,o,a)):i.drawImage(n,r,s,o,a,u,l,o*c[0],a*c[1]),i.restore()}function dm(i,t){const e=i.contextInstructions;for(let n=0,r=e.length;n<r;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}function Za(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}function Xt(){}function pm(i,t){for(const e in t)i[e]=t[e];return i}function Ph(i){return i()}function Oh(){return Object.create(null)}function Vi(i){i.forEach(Ph)}function Dh(i){return typeof i=="function"}function Qr(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Ka;function De(i,t){return i===t?!0:(Ka||(Ka=document.createElement("a")),Ka.href=t,i===Ka.href)}function mm(i){return Object.keys(i).length===0}function _m(i,t,e,n){if(i){const r=Ah(i,t,e,n);return i[0](r)}}function Ah(i,t,e,n){return i[1]&&n?pm(e.ctx.slice(),i[1](n(t))):e.ctx}function ym(i,t,e,n){if(i[2]&&n){const r=i[2](n(e));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let a=0;a<o;a+=1)s[a]=t.dirty[a]|r[a];return s}return t.dirty|r}return t.dirty}function vm(i,t,e,n,r,s){if(r){const o=Ah(t,e,n,s);i.p(o,r)}}function Em(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function Fh(i){return i??""}function gt(i,t){i.appendChild(t)}function Ut(i,t,e){i.insertBefore(t,e||null)}function Gt(i){i.parentNode&&i.parentNode.removeChild(i)}function It(i){return document.createElement(i)}function Xi(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function gr(i){return document.createTextNode(i)}function gn(){return gr(" ")}function Cm(){return gr("")}function Xe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function xm(i){return function(t){return t.preventDefault(),i.call(this,t)}}function D(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Im(i){return Array.from(i.childNodes)}function ko(i,t){t=""+t,i.data!==t&&(i.data=t)}function kh(i,t){i.value=t??""}function Ja(i,t,e,n){e==null?i.style.removeProperty(t):i.style.setProperty(t,e,"")}function dr(i,t,e){i.classList.toggle(t,!!e)}function Sm(i,t,{bubbles:e=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:t,bubbles:e,cancelable:n})}let Go;function Bo(i){Go=i}function Gh(){if(!Go)throw new Error("Function called outside component initialization");return Go}function wm(i){Gh().$$.on_destroy.push(i)}function Lm(){const i=Gh();return(t,e,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[t];if(r){const s=Sm(t,e,{cancelable:n});return r.slice().forEach(o=>{o.call(i,s)}),!s.defaultPrevented}return!0}}function Bh(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const Vs=[],wl=[];let Xs=[];const zh=[],Nm=Promise.resolve();let Ll=!1;function Rm(){Ll||(Ll=!0,Nm.then(Vh))}function Nl(i){Xs.push(i)}const Rl=new Set;let Us=0;function Vh(){if(Us!==0)return;const i=Go;do{try{for(;Us<Vs.length;){const t=Vs[Us];Us++,Bo(t),bm(t.$$)}}catch(t){throw Vs.length=0,Us=0,t}for(Bo(null),Vs.length=0,Us=0;wl.length;)wl.pop()();for(let t=0;t<Xs.length;t+=1){const e=Xs[t];Rl.has(e)||(Rl.add(e),e())}Xs.length=0}while(Vs.length);for(;zh.length;)zh.pop()();Ll=!1,Rl.clear(),Bo(i)}function bm(i){if(i.fragment!==null){i.update(),Vi(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Nl)}}function Tm(i){const t=[],e=[];Xs.forEach(n=>i.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Xs=t}const Qa=new Set;let $r;function $a(){$r={r:0,c:[],p:$r}}function tu(){$r.r||Vi($r.c),$r=$r.p}function Kt(i,t){i&&i.i&&(Qa.delete(i),i.i(t))}function me(i,t,e,n){if(i&&i.o){if(Qa.has(i))return;Qa.add(i),$r.c.push(()=>{Qa.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}function Xh(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Mm(i,t){me(i,1,1,()=>{t.delete(i.key)})}function Pm(i,t,e,n,r,s,o,a,u,l,c,h){let f=i.length,g=s.length,d=f;const m={};for(;d--;)m[i[d].key]=d;const p=[],_=new Map,y=new Map,v=[];for(d=g;d--;){const R=h(r,s,d),T=e(R);let w=o.get(T);w?v.push(()=>w.p(R,t)):(w=l(T,R),w.c()),_.set(T,p[d]=w),T in m&&y.set(T,Math.abs(d-m[T]))}const C=new Set,x=new Set;function b(R){Kt(R,1),R.m(a,c),o.set(R.key,R),c=R.first,g--}for(;f&&g;){const R=p[g-1],T=i[f-1],w=R.key,O=T.key;R===T?(c=R.first,f--,g--):_.has(O)?!o.has(w)||C.has(w)?b(R):x.has(O)?f--:y.get(w)>y.get(O)?(x.add(w),b(R)):(C.add(O),f--):(u(T,o),f--)}for(;f--;){const R=i[f];_.has(R.key)||u(R,o)}for(;g;)b(p[g-1]);return Vi(v),p}function pr(i){i&&i.c()}function Ui(i,t,e){const{fragment:n,after_update:r}=i.$$;n&&n.m(t,e),Nl(()=>{const s=i.$$.on_mount.map(Ph).filter(Dh);i.$$.on_destroy?i.$$.on_destroy.push(...s):Vi(s),i.$$.on_mount=[]}),r.forEach(Nl)}function Yi(i,t){const e=i.$$;e.fragment!==null&&(Tm(e.after_update),Vi(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Om(i,t){i.$$.dirty[0]===-1&&(Vs.push(i),Rm(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ts(i,t,e,n,r,s,o=null,a=[-1]){const u=Go;Bo(i);const l=i.$$={fragment:null,ctx:[],props:s,update:Xt,not_equal:r,bound:Oh(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Oh(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};o&&o(l.root);let c=!1;if(l.ctx=e?e(i,t.props||{},(h,f,...g)=>{const d=g.length?g[0]:f;return l.ctx&&r(l.ctx[h],l.ctx[h]=d)&&(!l.skip_bound&&l.bound[h]&&l.bound[h](d),c&&Om(i,h)),f}):[],l.update(),c=!0,Vi(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const h=Im(t.target);l.fragment&&l.fragment.l(h),h.forEach(Gt)}else l.fragment&&l.fragment.c();t.intro&&Kt(i.$$.fragment),Ui(i,t.target,t.anchor),Vh()}Bo(u)}class es{constructor(){Jn(this,"$$");Jn(this,"$$set")}$destroy(){Yi(this,1),this.$destroy=Xt}$on(t,e){if(!Dh(e))return Xt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!mm(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dm="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dm);function Am(i){let t,e;return{c(){t=Xi("svg"),e=Xi("path"),D(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),D(t,"viewBox","0 0 14 14"),D(t,"width","13"),D(t,"height","13"),D(t,"class","svelte-en2qvf")},m(n,r){Ut(n,t,r),gt(t,e)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(t)}}}class Uh extends es{constructor(t){super(),ts(this,t,null,Am,Qr,{})}}function Fm(i){let t,e;return{c(){t=Xi("svg"),e=Xi("path"),D(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),D(t,"viewBox","0 0 30 30"),D(t,"fill","none"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"class","svelte-d2loi5")},m(n,r){Ut(n,t,r),gt(t,e)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(t)}}}class Yh extends es{constructor(t){super(),ts(this,t,null,Fm,Qr,{})}}function km(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"area.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"area.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Gm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"reverse.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"reverse.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Bm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"poi.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"poi.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function zm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"postal_code.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"postal_code.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Vm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"street.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"street.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Xm(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"road.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"road.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Um(i){let t,e;return{c(){t=It("img"),De(t.src,e=i[3]+"housenumber.svg")||D(t,"src",e),D(t,"alt",i[6]),D(t,"class","svelte-ltkwvy")},m(n,r){Ut(n,t,r)},p(n,r){r&8&&!De(t.src,e=n[3]+"housenumber.svg")&&D(t,"src",e),r&64&&D(t,"alt",n[6])},d(n){n&&Gt(t)}}}function Ym(i){let t,e,n,r;return{c(){t=It("img"),De(t.src,e=i[5])||D(t,"src",e),D(t,"alt",i[4]),D(t,"class","svelte-ltkwvy")},m(s,o){Ut(s,t,o),n||(r=Xe(t,"error",i[14]),n=!0)},p(s,o){o&32&&!De(t.src,e=s[5])&&D(t,"src",e),o&16&&D(t,"alt",s[4])},d(s){s&&Gt(t),n=!1,r()}}}function Wh(i){let t,e;return{c(){t=It("span"),e=gr(i[6]),D(t,"class","secondary svelte-ltkwvy")},m(n,r){Ut(n,t,r),gt(t,e)},p(n,r){r&64&&ko(e,n[6])},d(n){n&&Gt(t)}}}function Wm(i){var R,T;let t,e,n,r,s,o,a,u,l=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",c,h,f=i[2]==="always"||i[2]&&!i[0].address&&((R=i[0].properties)==null?void 0:R.kind)!=="road"&&((T=i[0].properties)==null?void 0:T.kind)!=="road_relation"&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],g,d,m=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",p,_,y;function v(w,O){var z,F;return O&1&&(e=null),O&1&&(n=null),O&1&&(r=null),w[5]?Ym:w[0].address?Um:((z=w[0].properties)==null?void 0:z.kind)==="road"||((F=w[0].properties)==null?void 0:F.kind)==="road_relation"?Xm:(e==null&&(e=!!w[0].id.startsWith("address.")),e?Vm:(n==null&&(n=!!w[0].id.startsWith("postal_code.")),n?zm:(r==null&&(r=!!w[0].id.startsWith("poi.")),r?Bm:w[7]?Gm:km)))}let C=v(i,-1),x=C(i),b=f&&Wh(i);return{c(){t=It("li"),x.c(),s=gn(),o=It("span"),a=It("span"),u=It("span"),c=gr(l),h=gn(),b&&b.c(),g=gn(),d=It("span"),p=gr(m),D(u,"class","primary svelte-ltkwvy"),D(a,"class","svelte-ltkwvy"),D(d,"class","line2 svelte-ltkwvy"),D(o,"class","texts svelte-ltkwvy"),D(t,"tabindex","0"),D(t,"data-selected",i[1]),D(t,"class","svelte-ltkwvy"),dr(t,"selected",i[1])},m(w,O){Ut(w,t,O),x.m(t,null),gt(t,s),gt(t,o),gt(o,a),gt(a,u),gt(u,c),gt(a,h),b&&b.m(a,null),gt(o,g),gt(o,d),gt(d,p),_||(y=[Xe(t,"mouseenter",i[12]),Xe(t,"focus",i[13])],_=!0)},p(w,[O]){var z,F;C===(C=v(w,O))&&x?x.p(w,O):(x.d(1),x=C(w),x&&(x.c(),x.m(t,s))),O&1&&l!==(l=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&ko(c,l),O&37&&(f=w[2]==="always"||w[2]&&!w[0].address&&((z=w[0].properties)==null?void 0:z.kind)!=="road"&&((F=w[0].properties)==null?void 0:F.kind)!=="road_relation"&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),f?b?b.p(w,O):(b=Wh(w),b.c(),b.m(a,null)):b&&(b.d(1),b=null),O&1&&m!==(m=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&ko(p,m),O&2&&D(t,"data-selected",w[1]),O&2&&dr(t,"selected",w[1])},i:Xt,o:Xt,d(w){w&&Gt(t),x.d(),b&&b.d(),_=!1,Vi(y)}}}function qm(i,t,e){var v;let n,r,{feature:s}=t,{selected:o=!1}=t,{showPlaceType:a}=t,{missingIconsCache:u}=t,{iconsBaseUrl:l}=t;const c=(v=s.properties)==null?void 0:v.categories;let h,f,g=0,d=s.place_type[0]==="reverse";function m(C){f&&u.add(f),e(10,g++,g)}function p(C){Bh.call(this,i,C)}function _(C){Bh.call(this,i,C)}const y=C=>m(C.currentTarget);return i.$$set=C=>{"feature"in C&&e(0,s=C.feature),"selected"in C&&e(1,o=C.selected),"showPlaceType"in C&&e(2,a=C.showPlaceType),"missingIconsCache"in C&&e(9,u=C.missingIconsCache),"iconsBaseUrl"in C&&e(3,l=C.iconsBaseUrl)},i.$$.update=()=>{var C,x,b,R;if(i.$$.dirty&3640)do e(11,n--,n),e(4,h=c==null?void 0:c[n]),e(5,f=h?l+h.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!f||u.has(f)));i.$$.dirty&1&&e(6,r=s.id.startsWith("poi.")?(x=(C=s.properties)==null?void 0:C.categories)==null?void 0:x.join(", "):((R=(b=s.properties)==null?void 0:b.place_type_name)==null?void 0:R[0])??s.place_type[0])},e(11,n=(c==null?void 0:c.length)??0),[s,o,a,l,h,f,r,d,m,u,g,n,p,_,y]}class Hm extends es{constructor(t){super(),ts(this,t,qm,Wm,Qr,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function jm(i){let t;return{c(){t=It("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',D(t,"class","svelte-7cmwmc")},m(e,n){Ut(e,t,n)},p:Xt,i:Xt,o:Xt,d(e){e&&Gt(t)}}}class Zm extends es{constructor(t){super(),ts(this,t,null,jm,Qr,{})}}function Km(i){let t,e;return{c(){t=Xi("svg"),e=Xi("path"),D(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),D(t,"viewBox","0 0 60.006 21.412"),D(t,"width","14"),D(t,"height","20"),D(t,"class","svelte-en2qvf")},m(n,r){Ut(n,t,r),gt(t,e)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(t)}}}class Jm extends es{constructor(t){super(),ts(this,t,null,Km,Qr,{})}}function Qm(i){let t,e,n;return{c(){t=Xi("svg"),e=Xi("circle"),n=Xi("path"),D(e,"cx","4.789"),D(e,"cy","4.787"),D(e,"r","3.85"),Ja(e,"stroke-width","1.875"),Ja(e,"fill","none"),D(n,"d","M12.063 12.063 7.635 7.635"),Ja(n,"stroke-width","1.875"),Ja(n,"stroke-linecap","round"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"width","13"),D(t,"height","13"),D(t,"viewBox","0 0 13 13"),D(t,"class","svelte-1bpbt60")},m(r,s){Ut(r,t,s),gt(t,e),gt(t,n)},p:Xt,i:Xt,o:Xt,d(r){r&&Gt(t)}}}class $m extends es{constructor(t){super(),ts(this,t,null,Qm,Qr,{})}}function t_(i,t,e){const n=t[1],r=t[0],s=n-r;return i===n&&e?i:((i-r)%s+s)%s+r}function qh(i){const t=[...i];return t[2]<t[0]&&(t[2]+=360),t}let zo;async function e_(i,t,e){const n=i==null?void 0:i.getCenterAndZoom();for(const r of t??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");t:if(r.type==="client-geolocation"){if(zo&&r.cachedLocationExpiry&&zo.time+r.cachedLocationExpiry>Date.now()){if(!zo.coords)break t;return zo.coords}let s;try{return s=await new Promise((o,a)=>{e.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(u=>{o([u.coords.longitude,u.coords.latitude].map(l=>l.toFixed(6)).join(","))},u=>{a(u)},r)}),s}catch{}finally{r.cachedLocationExpiry&&(zo={time:Date.now(),coords:s})}if(e.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Hh=/([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})/,jh=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,Zh=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,Kh=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,Jh=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function n_(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(i=="DD")return this.decimalCoordinates;const t=this.decimalCoordinates.split(",").map(o=>Number(o.trim()));let e=Qh(t[0],i),n=Qh(t[1],i);e.endsWith('.0"')&&n.endsWith('.0"')&&(e=e.replace(/\.0"$/,'"'),n=n.replace(/\.0"$/,'"'));const r=t[0]>=0?" N":" S",s=t[1]>=0?" E":" W";return`${e+r}, ${n+s}`}else throw new Error("no decimal coordinates to convert")}function Qh(i,t){const e=Math.abs(i),n=Math.floor(e),r=(e-n)*60;if(t=="DM"){let a=i_(r,3).toFixed(3).padStart(6,"0");return`${n}° ${a}'`}let s=Math.floor(r),o=((r-s)*60).toFixed(1).padStart(4,"0");return s=s.toString().padStart(2,"0"),`${n}° ${s}' ${o}"`}function i_(i,t){const e=Math.pow(10,t);return Math.round((i+Number.EPSILON)*e)/e}function bl(i,t){t||(t=5),i=i.replace(/\s+/g," ").trim();let e=null,n=null,r="",s="",o=[],a=!1;if(Hh.test(i))if(o=Hh.exec(i),a=Vo(o),a)e=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(e*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1);else throw new Error("invalid coordinate format");else if(jh.test(i))if(o=jh.exec(i),a=Vo(o),a){if(e=o[2],n=o[6],e.includes(",")&&(e=e.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),Number(Math.round(e))==Number(e))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");o[1]?(r=o[1],s=o[5]):o[4]&&(r=o[4],s=o[8])}else throw new Error("invalid decimal coordinate format");else if(Zh.test(i))if(o=Zh.exec(i),a=Vo(o),a)e=Math.abs(parseInt(o[2])),o[4]&&(e+=o[4]/60),o[6]&&(e+=o[6].replace(",",".")/3600),parseInt(o[2])<0&&(e=-1*e),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],s=o[8]):o[7]&&(r=o[7],s=o[14]);else throw new Error("invalid DMS coordinates format");else if(Kh.test(i))if(o=Kh.exec(i),a=Vo(o),a)e=Math.abs(parseInt(o[2])),o[4]&&(e+=o[4]/60),o[6]&&(e+=o[6]/3600),parseInt(o[2])<0&&(e=-1*e),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],s=o[9]):o[8]&&(r=o[8],s=o[16]);else throw new Error("invalid DMS coordinates format");else if(Jh.test(i))if(o=Jh.exec(i),a=Vo(o),a)e=Math.abs(parseInt(o[2])),o[4]&&(e+=o[4].replace(",",".")/60),o[6]&&(e+=o[6].replace(",",".")/3600),parseInt(o[2])<0&&(e=-1*e),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],s=o[9]):o[8]&&(r=o[8],s=o[16]);else throw new Error("invalid coordinates format");if(a){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(e)>=90)throw new Error("invalid latitude value");if((r||s)&&(!r||!s))throw new Error("invalid coordinates format");if(r&&r==s)throw new Error("invalid coordinates format");let u=/S|SOUTH/i;u.test(r)&&e>0&&(e=-1*e),u=/W|WEST/i,u.test(s)&&n>0&&(n=-1*n);const l=o[0].trim();let c,h;const f=/[,/;\u0020]/g,g=l.match(f);if(g==null){const p=Math.floor(i.length/2);c=l.substring(0,p).trim(),h=l.substring(p).trim()}else{let p;g.length%2==1?p=Math.floor(g.length/2):p=g.length/2-1;let _=0;if(p==0)_=l.indexOf(g[0]),c=l.substring(0,_).trim(),h=l.substring(_+1).trim();else{let y=0,v=0;for(;y<=p;)_=l.indexOf(g[y],v),v=_+1,y++;c=l.substring(0,_).trim(),h=l.substring(_+1).trim()}}const d=c.split(".");if(d.length==2&&d[1]==0&&d[1].length!=2)throw new Error("invalid coordinates format");const m=h.split(".");if(m.length==2&&m[1]==0&&m[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(c)||/^\d+$/.test(h))throw new Error("degree only coordinate/s provided");return isNaN(e)&&e.includes(",")&&(e=e.replace(",",".")),e=Number(Number(e).toFixed(t)),isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(t)),Object.freeze({verbatimCoordinates:l,verbatimLatitude:c,verbatimLongitude:h,decimalLatitude:e,decimalLongitude:n,decimalCoordinates:`${e},${n}`,closeEnough:r_,toCoordinateFormat:n_})}else throw new Error("coordinates pattern match failed")}function Vo(i){if(!isNaN(i[0]))return!1;const t=[...i];if(t.shift(),t.length%2>0)return!1;const e=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=t.length/2;for(let s=0;s<r;s++){const o=t[s],a=t[s+r],u=e.test(o)&&e.test(a),l=n.test(o)&&n.test(a),c=o==a;if(!(o==null&&a==null)){if(o==null||a==null)return!1;if(u||l||c)continue;return!1}}return!0}function $h(i,t){const e=Math.abs(i-t);return Number(e.toFixed(6))<=1e-5}function r_(i){if(i.includes(",")){const t=i.split(",");if(Number(t[0])==NaN||Number(t[1])==NaN)throw new Error("coords are not valid decimals");return $h(this.decimalLatitude,Number(t[0]))&&$h(this.decimalLongitude,t[1])}else throw new Error("coords being tested must be separated by a comma")}const s_=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});bl.to=s_;const o_=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],a_={decimalLatitude:40.123,decimalLongitude:-74.123},u_=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],l_=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764}];function c_(){const i=[];return o_.forEach(t=>{t.decimalLatitude?i.push(t):i.push({...t,...a_})}),[...i,...u_,...l_]}const h_=c_();bl.formats=h_.map(i=>i.verbatimCoordinates);const f_=bl;function tf(i,t,e){const n=i.slice();return n[81]=t[e],n[83]=e,n}function ef(i){let t,e;return t=new Zm({}),{c(){pr(t.$$.fragment)},m(n,r){Ui(t,n,r),e=!0},i(n){e||(Kt(t.$$.fragment,n),e=!0)},o(n){me(t.$$.fragment,n),e=!1},d(n){Yi(t,n)}}}function nf(i){let t,e,n,r,s;return e=new Jm({}),{c(){t=It("button"),pr(e.$$.fragment),D(t,"type","button"),D(t,"title",i[9]),D(t,"class","svelte-zh3kmv"),dr(t,"active",i[0])},m(o,a){Ut(o,t,a),Ui(e,t,null),n=!0,r||(s=Xe(t,"click",i[67]),r=!0)},p(o,a){(!n||a[0]&512)&&D(t,"title",o[9]),(!n||a[0]&1)&&dr(t,"active",o[0])},i(o){n||(Kt(e.$$.fragment,o),n=!0)},o(o){me(e.$$.fragment,o),n=!1},d(o){o&&Gt(t),Yi(e),r=!1,s()}}}function g_(i){let t,e=[],n=new Map,r,s,o,a=Xh(i[14]);const u=l=>l[81].id+(l[81].address?","+l[81].address:"");for(let l=0;l<a.length;l+=1){let c=tf(i,a,l),h=u(c);n.set(h,e[l]=rf(h,c))}return{c(){t=It("ul");for(let l=0;l<e.length;l+=1)e[l].c();D(t,"class","svelte-zh3kmv")},m(l,c){Ut(l,t,c);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);r=!0,s||(o=[Xe(t,"mouseleave",i[71]),Xe(t,"blur",i[72])],s=!0)},p(l,c){c[0]&17880064&&(a=Xh(l[14]),$a(),e=Pm(e,c,u,1,l,a,n,t,Mm,rf,null,tf),tu())},i(l){if(!r){for(let c=0;c<a.length;c+=1)Kt(e[c]);r=!0}},o(l){for(let c=0;c<e.length;c+=1)me(e[c]);r=!1},d(l){l&&Gt(t);for(let c=0;c<e.length;c+=1)e[c].d();s=!1,Vi(o)}}}function d_(i){let t,e,n,r,s,o;return e=new Yh({}),{c(){t=It("div"),pr(e.$$.fragment),n=gn(),r=It("div"),s=gr(i[7]),D(r,"class","svelte-zh3kmv"),D(t,"class","no-results svelte-zh3kmv")},m(a,u){Ut(a,t,u),Ui(e,t,null),gt(t,n),gt(t,r),gt(r,s),o=!0},p(a,u){(!o||u[0]&128)&&ko(s,a[7])},i(a){o||(Kt(e.$$.fragment,a),o=!0)},o(a){me(e.$$.fragment,a),o=!1},d(a){a&&Gt(t),Yi(e)}}}function p_(i){let t="",e;return{c(){e=gr(t)},m(n,r){Ut(n,e,r)},p:Xt,i:Xt,o:Xt,d(n){n&&Gt(e)}}}function m_(i){let t,e,n,r,s,o,a,u,l,c,h;return e=new Yh({}),u=new Uh({}),{c(){t=It("div"),pr(e.$$.fragment),n=gn(),r=It("div"),s=gr(i[6]),o=gn(),a=It("button"),pr(u.$$.fragment),D(r,"class","svelte-zh3kmv"),D(a,"class","svelte-zh3kmv"),D(t,"class","error svelte-zh3kmv")},m(f,g){Ut(f,t,g),Ui(e,t,null),gt(t,n),gt(t,r),gt(r,s),gt(t,o),gt(t,a),Ui(u,a,null),l=!0,c||(h=Xe(a,"click",i[68]),c=!0)},p(f,g){(!l||g[0]&64)&&ko(s,f[6])},i(f){l||(Kt(e.$$.fragment,f),Kt(u.$$.fragment,f),l=!0)},o(f){me(e.$$.fragment,f),me(u.$$.fragment,f),l=!1},d(f){f&&Gt(t),Yi(e),Yi(u),c=!1,h()}}}function rf(i,t){let e,n,r;function s(){return t[69](t[83])}function o(){return t[70](t[81])}return n=new Hm({props:{feature:t[81],showPlaceType:t[10],selected:t[15]===t[83],missingIconsCache:t[20],iconsBaseUrl:t[12]}}),n.$on("mouseenter",s),n.$on("focus",o),{key:i,first:null,c(){e=Cm(),pr(n.$$.fragment),this.first=e},m(a,u){Ut(a,e,u),Ui(n,a,u),r=!0},p(a,u){t=a;const l={};u[0]&16384&&(l.feature=t[81]),u[0]&1024&&(l.showPlaceType=t[10]),u[0]&49152&&(l.selected=t[15]===t[83]),u[0]&4096&&(l.iconsBaseUrl=t[12]),n.$set(l)},i(a){r||(Kt(n.$$.fragment,a),r=!0)},o(a){me(n.$$.fragment,a),r=!1},d(a){a&&Gt(e),Yi(n,a)}}}function __(i){let t,e,n,r,s,o,a,u,l,c,h,f,g,d,m,p,_,y,v,C,x,b=!1;s=new $m({}),h=new Uh({});let R=i[19]&&ef(),T=i[5]===!0&&nf(i);const w=i[59].default,O=_m(w,i,i[58],null),z=[m_,p_,d_,g_],F=[];function Y(L,M){var B,U;return L[18]?0:L[16]?((B=L[14])==null?void 0:B.length)===0?2:L[16]&&((U=L[14])!=null&&U.length)?3:-1:1}return~(p=Y(i))&&(_=F[p]=z[p](i)),{c(){t=gn(),e=It("form"),n=It("div"),r=It("button"),pr(s.$$.fragment),o=gn(),a=It("input"),u=gn(),l=It("div"),c=It("button"),pr(h.$$.fragment),f=gn(),R&&R.c(),g=gn(),T&&T.c(),d=gn(),O&&O.c(),m=gn(),_&&_.c(),D(r,"class","search-button svelte-zh3kmv"),D(r,"type","button"),D(a,"placeholder",i[8]),D(a,"aria-label",i[8]),D(a,"class","svelte-zh3kmv"),D(c,"type","button"),D(c,"title",i[3]),D(c,"class","svelte-zh3kmv"),D(l,"class","clear-button-container svelte-zh3kmv"),dr(l,"displayable",i[1]!==""),D(n,"class","input-group svelte-zh3kmv"),D(e,"tabindex","0"),D(e,"class",y=Fh(i[2])+" svelte-zh3kmv"),dr(e,"can-collapse",i[4]&&i[1]==="")},m(L,M){Ut(L,t,M),Ut(L,e,M),gt(e,n),gt(n,r),Ui(s,r,null),gt(n,o),gt(n,a),i[61](a),kh(a,i[1]),gt(n,u),gt(n,l),gt(l,c),Ui(h,c,null),gt(l,f),R&&R.m(l,null),gt(n,g),T&&T.m(n,null),gt(n,d),O&&O.m(n,null),gt(e,m),~p&&F[p].m(e,null),v=!0,C||(x=[Xe(r,"click",i[60]),Xe(a,"input",i[62]),Xe(a,"focus",i[63]),Xe(a,"blur",i[64]),Xe(a,"keydown",i[22]),Xe(a,"input",i[65]),Xe(c,"click",i[66]),Xe(e,"submit",xm(i[21]))],C=!0)},p(L,M){(!v||M[0]&256)&&D(a,"placeholder",L[8]),(!v||M[0]&256)&&D(a,"aria-label",L[8]),M[0]&2&&a.value!==L[1]&&kh(a,L[1]),(!v||M[0]&8)&&D(c,"title",L[3]),L[19]?R?M[0]&524288&&Kt(R,1):(R=ef(),R.c(),Kt(R,1),R.m(l,null)):R&&($a(),me(R,1,1,()=>{R=null}),tu()),(!v||M[0]&2)&&dr(l,"displayable",L[1]!==""),L[5]===!0?T?(T.p(L,M),M[0]&32&&Kt(T,1)):(T=nf(L),T.c(),Kt(T,1),T.m(n,d)):T&&($a(),me(T,1,1,()=>{T=null}),tu()),O&&O.p&&(!v||M[1]&134217728)&&vm(O,w,L,L[58],v?ym(w,L[58],M,null):Em(L[58]),null);let B=p;p=Y(L),p===B?~p&&F[p].p(L,M):(_&&($a(),me(F[B],1,1,()=>{F[B]=null}),tu()),~p?(_=F[p],_?_.p(L,M):(_=F[p]=z[p](L),_.c()),Kt(_,1),_.m(e,null)):_=null),(!v||M[0]&4&&y!==(y=Fh(L[2])+" svelte-zh3kmv"))&&D(e,"class",y),(!v||M[0]&22)&&dr(e,"can-collapse",L[4]&&L[1]==="")},i(L){v||(Kt(b),Kt(s.$$.fragment,L),Kt(h.$$.fragment,L),Kt(R),Kt(T),Kt(O,L),Kt(_),v=!0)},o(L){me(b),me(s.$$.fragment,L),me(h.$$.fragment,L),me(R),me(T),me(O,L),me(_),v=!1},d(L){L&&(Gt(t),Gt(e)),Yi(s),i[61](null),Yi(h),R&&R.d(),T&&T.d(),O&&O.d(L),~p&&F[p].d(),C=!1,Vi(x)}}}function y_(i,t,e){let n,{$$slots:r={},$$scope:s}=t,{class:o=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:h=!1}=t,{country:f=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:d=!1}=t,{errorMessage:m="Something went wrong…"}=t,{filter:p=()=>!0}=t,{flyTo:_=!0}=t,{fuzzyMatch:y=!0}=t,{language:v=void 0}=t,{limit:C=void 0}=t,{mapController:x=void 0}=t,{minLength:b=2}=t,{noResultsMessage:R="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:T="Search"}=t,{proximity:w=[{type:"server-geolocation"}]}=t,{reverseActive:O=d==="always"}=t,{reverseButtonTitle:z="toggle reverse geocoding"}=t,{searchValue:F=""}=t,{showFullGeometry:Y=!0}=t,{showPlaceType:L="ifNeeded"}=t,{showResultsWhileTyping:M=!0}=t,{selectFirst:B=!0}=t,{flyToSelected:U=!1}=t,{markerOnSelected:J=!0}=t,{types:rt=void 0}=t,{excludeTypes:Ct=!1}=t,{zoom:Tt=16}=t,{maxZoom:k=18}=t,{apiUrl:ze="https://api.maptiler.com/geocoding"}=t,{fetchParameters:ge={}}=t,{iconsBaseUrl:Ve="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.4/icons/"}=t,{adjustUrlQuery:Ia=N=>{}}=t;function vc(){Zn.focus()}function Xu(){Zn.blur()}function Sa(N,dt=!0,Le=!1){e(1,F=N),dt?(e(15,Pt=-1),ws()):(Ra(!Le,Le),setTimeout(()=>{Zn.focus(),Zn.select()}))}function Uu(){e(14,ct=void 0),e(55,nt=void 0),e(15,Pt=-1)}function Ec(){e(54,Mt=[]),e(55,nt=void 0)}let Gr=!1,ct,Mt,nt,Yu="",Zn,Pt=-1,wn,Br=[],sr,vi,Ss,or;const wa=new Set,Kn=Lm();wm(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function ws(N){if(vi&&(clearTimeout(vi),vi=void 0),Pt>-1&&ct)e(55,nt=ct[Pt]),e(1,F=nt.place_type[0]==="reverse"?nt.place_name:nt.place_name.replace(/,.*/,"")),e(18,wn=void 0),e(54,Mt=void 0),e(15,Pt=-1);else if(F){const dt=N||!zr(F);La(F,{exact:!0}).then(()=>{e(54,Mt=ct),e(55,nt=void 0),dt&&Wu()}).catch(Le=>e(18,wn=Le))}}function zr(N){try{return f_(N,6)}catch{return!1}}async function La(N,{byId:dt=!1,exact:Le=!1}={}){e(18,wn=void 0),sr==null||sr.abort();const Pe=new AbortController;e(19,sr=Pe);try{const Q=zr(N),kt=new URLSearchParams;if(v!==void 0&&kt.set("language",Array.isArray(v)?v.join(","):v??""),rt&&kt.set("types",rt.join(",")),Ct&&kt.set("excludeTypes",String(Ct)),u&&kt.set("bbox",u.map(Qu=>Qu.toFixed(6)).join(",")),f&&kt.set("country",Array.isArray(f)?f.join(","):f),!dt&&!Q){const Qu=await e_(x,w,Pe);Qu&&kt.set("proximity",Qu),(Le||!M)&&kt.set("autocomplete","false"),kt.set("fuzzyMatch",String(y))}C!==void 0&&(!Q||(rt==null?void 0:rt.length)===1)&&kt.set("limit",String(C)),kt.set("key",a),Ia(kt);const hn=ze+"/"+encodeURIComponent(Q?Q.decimalLongitude+","+Q.decimalLatitude:N)+".json?"+kt.toString();if(hn===Yu){dt?(e(14,ct=void 0),e(55,nt=Br[0])):e(14,ct=Br);return}Yu=hn;const Pa=await fetch(hn,{signal:Pe.signal,...ge});if(!Pa.ok)throw new Error(await Pa.text());const Cc=await Pa.json();Kn("response",{url:hn,featureCollection:Cc}),dt?(e(14,ct=void 0),e(55,nt=Cc.features[0]),Br=[nt]):(e(14,ct=Cc.features.filter(p)),Q&&ct.unshift({type:"Feature",properties:{},id:"reverse_"+Q.decimalLongitude+"_"+Q.decimalLatitude,text:Q.decimalLatitude+", "+Q.decimalLongitude,place_name:Q.decimalLatitude+", "+Q.decimalLongitude,place_type:["reverse"],center:[Q.decimalLongitude,Q.decimalLatitude],bbox:[Q.decimalLongitude,Q.decimalLatitude,Q.decimalLongitude,Q.decimalLatitude],geometry:{type:"Point",coordinates:[Q.decimalLongitude,Q.decimalLatitude]}}),Br=ct,Q&&Zn.focus())}catch(Q){if(Q&&typeof Q=="object"&&"name"in Q&&Q.name==="AbortError")return;throw Q}finally{Pe===sr&&e(19,sr=void 0)}}function Wu(){var Le;if(!(Mt!=null&&Mt.length)||!_)return;const N=[180,90,-180,-90],dt=!Mt.some(Pe=>!Pe.matching_text);for(const Pe of Mt)if(dt||!Pe.matching_text)for(const Q of[0,1,2,3])N[Q]=Math[Q<2?"min":"max"](N[Q],((Le=Pe.bbox)==null?void 0:Le[Q])??Pe.center[Q%2]);x&&Mt.length>0&&(nt&&N[0]===N[2]&&N[1]===N[3]?x.flyTo(nt.center,Tt):x.fitBounds(qh(N),50,k))}function qu(N){e(0,O=d==="always"),e(14,ct=void 0),e(55,nt=void 0),e(15,Pt=-1),Sa(N[1].toFixed(6)+", "+t_(N[0],[-180,180],!0).toFixed(6),!1,!0)}function Na(N){if(!ct)return;let dt=N.key==="ArrowDown"?1:N.key==="ArrowUp"?-1:0;dt&&(Pt===(B?0:-1)&&dt===-1&&e(15,Pt=ct.length),e(15,Pt+=dt),Pt>=ct.length&&e(15,Pt=-1),Pt<0&&B&&e(15,Pt=0),N.preventDefault())}function Ra(N=!0,dt=!1){if(e(18,wn=void 0),M||dt){if(vi&&clearTimeout(vi),F.length<b)return;const Le=F;vi=window.setTimeout(()=>{La(Le).catch(Pe=>e(18,wn=Pe))},N?g:0)}else e(14,ct=void 0),e(18,wn=void 0)}function ba(N){e(55,nt=N),e(1,F=N.place_name),e(15,Pt=-1)}const Hu=()=>Zn.focus();function ju(N){wl[N?"unshift":"push"](()=>{Zn=N,e(17,Zn)})}function Ta(){F=this.value,e(1,F),e(13,Gr),e(27,c)}const Zu=()=>e(13,Gr=!0),Ma=()=>e(13,Gr=!1),Ls=()=>Ra(),Ns=()=>{e(1,F=""),Zn.focus()},Rs=()=>e(0,O=!O),Ku=()=>e(18,wn=void 0),Ju=N=>e(15,Pt=N),Qe=N=>ba(N),Vr=()=>{B||e(15,Pt=-1)},cn=()=>{};return i.$$set=N=>{"class"in N&&e(2,o=N.class),"apiKey"in N&&e(25,a=N.apiKey),"bbox"in N&&e(26,u=N.bbox),"clearButtonTitle"in N&&e(3,l=N.clearButtonTitle),"clearOnBlur"in N&&e(27,c=N.clearOnBlur),"collapsed"in N&&e(4,h=N.collapsed),"country"in N&&e(28,f=N.country),"debounceSearch"in N&&e(29,g=N.debounceSearch),"enableReverse"in N&&e(5,d=N.enableReverse),"errorMessage"in N&&e(6,m=N.errorMessage),"filter"in N&&e(30,p=N.filter),"flyTo"in N&&e(31,_=N.flyTo),"fuzzyMatch"in N&&e(32,y=N.fuzzyMatch),"language"in N&&e(33,v=N.language),"limit"in N&&e(34,C=N.limit),"mapController"in N&&e(35,x=N.mapController),"minLength"in N&&e(36,b=N.minLength),"noResultsMessage"in N&&e(7,R=N.noResultsMessage),"placeholder"in N&&e(8,T=N.placeholder),"proximity"in N&&e(37,w=N.proximity),"reverseActive"in N&&e(0,O=N.reverseActive),"reverseButtonTitle"in N&&e(9,z=N.reverseButtonTitle),"searchValue"in N&&e(1,F=N.searchValue),"showFullGeometry"in N&&e(38,Y=N.showFullGeometry),"showPlaceType"in N&&e(10,L=N.showPlaceType),"showResultsWhileTyping"in N&&e(39,M=N.showResultsWhileTyping),"selectFirst"in N&&e(11,B=N.selectFirst),"flyToSelected"in N&&e(40,U=N.flyToSelected),"markerOnSelected"in N&&e(41,J=N.markerOnSelected),"types"in N&&e(42,rt=N.types),"excludeTypes"in N&&e(43,Ct=N.excludeTypes),"zoom"in N&&e(44,Tt=N.zoom),"maxZoom"in N&&e(45,k=N.maxZoom),"apiUrl"in N&&e(46,ze=N.apiUrl),"fetchParameters"in N&&e(47,ge=N.fetchParameters),"iconsBaseUrl"in N&&e(12,Ve=N.iconsBaseUrl),"adjustUrlQuery"in N&&e(48,Ia=N.adjustUrlQuery),"$$scope"in N&&e(58,s=N.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&134225920&&setTimeout(()=>{e(16,Ss=Gr),c&&!Gr&&e(1,F="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&32&&F.length<b&&(e(55,nt=void 0),e(14,ct=void 0),e(18,wn=void 0),e(54,Mt=ct)),i.$$.dirty[1]&16777344&&Y&&nt&&!nt.address&&nt.geometry.type==="Point"&&nt.place_type[0]!=="reverse"&&La(nt.id,{byId:!0}).catch(N=>e(18,wn=N)),i.$$.dirty[1]&50356241&&(x&&nt&&nt.id!==or&&_&&(!nt.bbox||nt.bbox[0]===nt.bbox[2]&&nt.bbox[1]===nt.bbox[3]?x.flyTo(nt.center,nt.id.startsWith("poi.")||nt.id.startsWith("address.")?k:Tt):x.fitBounds(qh(nt.bbox),50,k),e(14,ct=void 0),e(54,Mt=void 0),e(15,Pt=-1)),e(56,or=nt==null?void 0:nt.id)),i.$$.dirty[0]&18432&&B&&ct!=null&&ct.length&&e(15,Pt=0),i.$$.dirty[0]&2050&&(B||e(15,Pt=-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&8388608&&Mt!==ct&&e(54,Mt=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&8388624&&x&&x.setEventHandler(N=>{switch(N.type){case"mapClick":O&&qu(N.coordinates);break;case"markerClick":{const dt=ct==null?void 0:ct.find(Le=>Le.id===N.id);dt&&ba(dt)}break;case"markerMouseEnter":Mt&&e(15,Pt=Ss?(ct==null?void 0:ct.findIndex(dt=>dt.id===N.id))??-1:-1);break;case"markerMouseLeave":Mt&&e(15,Pt=-1);break}}),i.$$.dirty[0]&49152&&e(57,n=ct==null?void 0:ct[Pt]),i.$$.dirty[1]&67133969&&x&&n&&_&&U&&x.flyTo(n.center,n.id.startsWith("poi.")||n.id.startsWith("address.")?k:Tt),i.$$.dirty[1]&1040&&(J||x==null||x.setMarkers(void 0,void 0)),i.$$.dirty[1]&75498512&&x&&J&&!Mt&&(x.setMarkers(n?[n]:void 0,void 0),x.setSelectedMarker(n?0:-1)),i.$$.dirty[1]&25165840&&x&&x.setMarkers(Mt,nt),i.$$.dirty[0]&32768|i.$$.dirty[1]&8388624&&Mt&&x&&x.setSelectedMarker(Pt),i.$$.dirty[0]&2|i.$$.dirty[1]&16&&x){const N=zr(F);x.setReverseMarker(N?[N.decimalLongitude,N.decimalLatitude]:void 0)}i.$$.dirty[1]&67108864&&Kn("select",n),i.$$.dirty[1]&16777216&&Kn("pick",nt),i.$$.dirty[0]&81920&&Kn("optionsVisibilityChange",Ss&&!!ct),i.$$.dirty[0]&16384&&Kn("featuresListed",ct),i.$$.dirty[1]&8388608&&Kn("featuresMarked",Mt),i.$$.dirty[0]&1&&Kn("reverseToggle",O),i.$$.dirty[0]&2&&Kn("queryChange",F),i.$$.dirty[0]&1|i.$$.dirty[1]&16&&x&&x.indicateReverse(O)},[O,F,o,l,h,d,m,R,T,z,L,B,Ve,Gr,ct,Pt,Ss,Zn,wn,sr,wa,ws,Na,Ra,ba,a,u,c,f,g,p,_,y,v,C,x,b,w,Y,M,U,J,rt,Ct,Tt,k,ze,ge,Ia,vc,Xu,Sa,Uu,Ec,Mt,nt,or,n,s,r,Hu,ju,Ta,Zu,Ma,Ls,Ns,Rs,Ku,Ju,Qe,Vr,cn]}let v_=class extends es{constructor(t){super(),ts(this,t,y_,__,Qr,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}};class ii extends ar{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new ii(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const n=this.getStyle();return n&&t.setStyle(n),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&($n(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Qn(t,Ln.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?E_(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function E_(i){if(typeof i=="function")return i;let t;return Array.isArray(i)?t=i:(ue(typeof i.getZIndex=="function",41),t=[i]),function(){return t}}class ns{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new ns({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}function sf(i,t,e,n,r,s,o){let a,u;const l=(e-t)/n;if(l===1)a=t;else if(l===2)a=t,u=r;else if(l!==0){let c=i[t],h=i[t+1],f=0;const g=[0];for(let p=t+n;p<e;p+=n){const _=i[p],y=i[p+1];f+=Math.sqrt((_-c)*(_-c)+(y-h)*(y-h)),g.push(f),c=_,h=y}const d=r*f,m=_d(g,d);m<0?(u=(d-g[-m-2])/(g[-m-1]-g[-m-2]),a=t+(-m-2)*n):a=t+m*n}o=o>1?o:2,s=s||new Array(o);for(let c=0;c<o;++c)s[c]=a===void 0?NaN:u===void 0?i[a+c]:fn(i[a+c],i[a+n+c],u);return s}function Tl(i,t,e,n,r,s){if(e==t)return null;let o;if(r<i[t+n-1])return s?(o=i.slice(t,t+n),o[n-1]=r,o):null;if(i[e-1]<r)return s?(o=i.slice(e-n,e),o[n-1]=r,o):null;if(r==i[t+n-1])return i.slice(t,t+n);let a=t/n,u=e/n;for(;a<u;){const f=a+u>>1;r<i[(f+1)*n-1]?u=f:a=f+1}const l=i[a*n-1];if(r==l)return i.slice((a-1)*n,(a-1)*n+n);const c=i[(a+1)*n-1],h=(r-l)/(c-l);o=[];for(let f=0;f<n-1;++f)o.push(fn(i[(a-1)*n+f],i[a*n+f],h));return o.push(r),o}function C_(i,t,e,n,r,s,o){if(o)return Tl(i,t,e[e.length-1],n,r,s);let a;if(r<i[n-1])return s?(a=i.slice(0,n),a[n-1]=r,a):null;if(i[i.length-1]<r)return s?(a=i.slice(i.length-n),a[n-1]=r,a):null;for(let u=0,l=e.length;u<l;++u){const c=e[u];if(t!=c){if(r<i[t+n-1])return null;if(r<=i[c-1])return Tl(i,t,c,n,r,!1);t=c}}return null}function of(i,t,e,n){let r=i[t],s=i[t+1],o=0;for(let a=t+n;a<e;a+=n){const u=i[a],l=i[a+1];o+=Math.sqrt((u-r)*(u-r)+(l-s)*(l-s)),r=u,s=l}return o}let eu=class wc extends jr{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){this.flatCoordinates?Gi(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new wc(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,r){return r<Ur(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),dl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))}forEachSegment(t){return xh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,Tl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return hr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return sf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return of(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=_l(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new wc(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ua(this.flatCoordinates,0,t,this.stride),this.changed()}};class Ys{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Ys({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const Zt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class nu{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Za(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new nu({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return xt()}getImage(t){return xt()}getHitDetectionImage(){return xt()}getPixelRatio(t){return 1}getImageState(){return xt()}getImageSize(){return xt()}getOrigin(){return xt()}getSize(){return xt()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Za(t)}listenImageChange(t){xt()}load(){xt()}unlistenImageChange(t){xt()}}function Ci(i){return Array.isArray(i)?oh(i):i}class iu extends nu{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new iu({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_;if(!t)return null;const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const n=this.renderOptions_,r=ti(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return Zt.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const b=r;r=s,s=b}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,u=s*Math.sin(a),l=Math.sqrt(s*s-u*u),c=r-l,h=Math.sqrt(u*u+c*c),f=h/u;if(t==="miter"&&f<=n)return f*e;const g=e/2/f,d=e/2*(c/h),p=Math.sqrt((r+g)*(r+g)+d*d)-r;if(this.radius2_===void 0||t==="bevel")return p*2;const _=r*Math.sin(a),y=Math.sqrt(r*r-_*_),v=s-y,x=Math.sqrt(_*_+v*v)/_;if(x<=n){const b=x*e/2-s-r;return 2*Math.max(p,b)}return p*2}createRenderOptions(){let t=Bs,e=0,n=null,r=0,s,o=0;this.stroke_&&(s=this.stroke_.getColor(),s===null&&(s=Do),s=Ci(s),o=this.stroke_.getWidth(),o===void 0&&(o=Fo),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=Bs),e=this.stroke_.getMiterLimit(),e===void 0&&(e=Oo));const a=this.calculateLineJoinSize_(t,o,e),u=Math.max(this.radius_,this.radius2_||0),l=Math.ceil(2*u+a);return{strokeStyle:s,strokeWidth:o,size:l,lineDash:n,lineDashOffset:r,lineJoin:t,miterLimit:e}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let r=this.fill_.getColor();r===null&&(r=tn),e.fillStyle=Ci(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){if(this.fill_){let e=this.fill_.getColor(),n=0;if(typeof e=="string"&&(e=Xa(e)),e===null?n=1:Array.isArray(e)&&(n=e.length===4?e[3]:1),n===0){const r=ti(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(e*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let a=0;a<e;a++){const u=s+a*o,l=a%2===0?n:r;t.lineTo(l*Math.cos(u),l*Math.sin(u))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=tn,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}}class ru extends iu{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new ru({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}class is{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=af,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new is({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=af,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function x_(i){let t;if(typeof i=="function")t=i;else{let e;Array.isArray(i)?e=i:(ue(typeof i.getZIndex=="function",41),e=[i]),t=function(){return e}}return t}let Ml=null;function I_(i,t){if(!Ml){const e=new ns({color:"rgba(255,255,255,0.4)"}),n=new Ys({color:"#3399CC",width:1.25});Ml=[new is({image:new ru({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return Ml}function af(i){return i.getGeometry()}const S_="#333";class su{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Za(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new ns({color:S_}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const t=this.getScale();return new su({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Za(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function w_(i,t,e,n,r){uf(i,t,e||0,n||i.length-1,r||L_)}function uf(i,t,e,n,r){for(;n>e;){if(n-e>600){var s=n-e+1,o=t-e+1,a=Math.log(s),u=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*u*(s-u)/s)*(o-s/2<0?-1:1),c=Math.max(e,Math.floor(t-o*u/s+l)),h=Math.min(n,Math.floor(t+(s-o)*u/s+l));uf(i,t,c,h,r)}var f=i[t],g=e,d=n;for(Xo(i,e,t),r(i[n],f)>0&&Xo(i,e,n);g<d;){for(Xo(i,g,d),g++,d--;r(i[g],f)<0;)g++;for(;r(i[d],f)>0;)d--}r(i[e],f)===0?Xo(i,e,d):(d++,Xo(i,d,n)),d<=t&&(e=d+1),t<=d&&(n=d-1)}}function Xo(i,t,e){var n=i[t];i[t]=i[e],i[e]=n}function L_(i,t){return i<t?-1:i>t?1:0}let lf=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!au(t,e))return n;const r=this.toBBox,s=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],u=e.leaf?r(a):a;au(t,u)&&(e.leaf?n.push(a):Ol(t,u)?this._all(a,n):s.push(a))}e=s.pop()}return n}collides(t){let e=this.data;if(!au(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const s=e.children[r],o=e.leaf?this.toBBox(s):s;if(au(t,o)){if(e.leaf||Ol(t,o))return!0;n.push(s)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=qs([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),s=[],o=[];let a,u,l;for(;n||s.length;){if(n||(n=s.pop(),u=s[s.length-1],a=o.pop(),l=!0),n.leaf){const c=N_(t,n.children,e);if(c!==-1)return n.children.splice(c,1),s.push(n),this._condense(s),this}!l&&!n.leaf&&Ol(n,r)?(s.push(n),o.push(a),a=0,u=n,n=n.children[0]):u?(a++,n=u.children[a],l=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const s=n-e+1;let o=this._maxEntries,a;if(s<=o)return a=qs(t.slice(e,n+1)),Ws(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=qs([]),a.leaf=!1,a.height=r;const u=Math.ceil(s/o),l=u*Math.ceil(Math.sqrt(o));cf(t,e,n,l,this.compareMinX);for(let c=e;c<=n;c+=l){const h=Math.min(c+l-1,n);cf(t,c,h,u,this.compareMinY);for(let f=c;f<=h;f+=u){const g=Math.min(f+u-1,h);a.children.push(this._build(t,f,g,r-1))}}return Ws(a,this.toBBox),a}_chooseSubtree(t,e,n,r){for(;r.push(e),!(e.leaf||r.length-1===n);){let s=1/0,o=1/0,a;for(let u=0;u<e.children.length;u++){const l=e.children[u],c=Pl(l),h=T_(t,l)-c;h<o?(o=h,s=c<s?c:s,a=l):h===o&&c<s&&(s=c,a=l)}e=a||e.children[0]}return e}_insert(t,e,n){const r=n?t:this.toBBox(t),s=[],o=this._chooseSubtree(r,this.data,e,s);for(o.children.push(t),Yo(o,r);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)}_split(t,e){const n=t[e],r=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,r);const o=this._chooseSplitIndex(n,s,r),a=qs(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Ws(n,this.toBBox),Ws(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=qs([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ws(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,s=1/0,o=1/0;for(let a=e;a<=n-e;a++){const u=Uo(t,0,a,this.toBBox),l=Uo(t,a,n,this.toBBox),c=M_(u,l),h=Pl(u)+Pl(l);c<s?(s=c,r=a,o=h<o?h:o):c===s&&h<o&&(o=h,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:R_,s=t.leaf?this.compareMinY:b_,o=this._allDistMargin(t,e,n,r),a=this._allDistMargin(t,e,n,s);o<a&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const s=this.toBBox,o=Uo(t,0,e,s),a=Uo(t,n-e,n,s);let u=ou(o)+ou(a);for(let l=e;l<n-e;l++){const c=t.children[l];Yo(o,t.leaf?s(c):c),u+=ou(o)}for(let l=n-e-1;l>=e;l--){const c=t.children[l];Yo(a,t.leaf?s(c):c),u+=ou(a)}return u}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Yo(e[r],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Ws(t[e],this.toBBox)}};function N_(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n<t.length;n++)if(e(i,t[n]))return n;return-1}function Ws(i,t){Uo(i,0,i.children.length,t,i)}function Uo(i,t,e,n,r){r||(r=qs(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=t;s<e;s++){const o=i.children[s];Yo(r,i.leaf?n(o):o)}return r}function Yo(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function R_(i,t){return i.minX-t.minX}function b_(i,t){return i.minY-t.minY}function Pl(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function ou(i){return i.maxX-i.minX+(i.maxY-i.minY)}function T_(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function M_(i,t){const e=Math.max(i.minX,t.minX),n=Math.max(i.minY,t.minY),r=Math.min(i.maxX,t.maxX),s=Math.min(i.maxY,t.maxY);return Math.max(0,r-e)*Math.max(0,s-n)}function Ol(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function au(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function qs(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function cf(i,t,e,n,r){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;w_(i,o,t,e,r),s.push(t,o,o,e)}}function P_(i,t,e){const n=i;let r=!0,s=!1,o=!1;const a=[Da(n,Ln.LOAD,function(){o=!0,s||t()})];return n.src&&Sd?(s=!0,n.decode().then(function(){r&&t()}).catch(function(u){r&&(o?t():e())})):a.push(Da(n,Ln.ERROR,e)),function(){r=!1,a.forEach($n)}}let Wo=null;class O_ extends Tc{constructor(t,e,n,r,s,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=r,this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=s,this.size_=n,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Zt.LOADED){Wo||(Wo=ti(1,1,void 0,{willReadFrequently:!0})),Wo.drawImage(this.image_,0,0);try{Wo.getImageData(0,0,1,1),this.tainted_=!1}catch{Wo=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Ln.CHANGE)}handleImageError_(){this.imageState_=Zt.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Zt.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=ti(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Zt.IDLE){this.image_||this.initializeImage_(),this.imageState_=Zt.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=P_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Zt.LOADED)return;const e=this.image_,n=document.createElement("canvas");n.width=Math.ceil(e.width*t),n.height=Math.ceil(e.height*t);const r=n.getContext("2d");r.scale(t,t),r.drawImage(e,0,0),r.globalCompositeOperation="multiply",r.fillStyle=rh(this.color_),r.fillRect(0,0,n.width/t,n.height/t),r.globalCompositeOperation="destination-in",r.drawImage(e,0,0),this.canvas_[t]=n}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function D_(i,t,e,n,r,s){let o=uh.get(t,n,s);return o||(o=new O_(i,t,e,n,r,s),uh.set(t,n,s,o)),o}function hf(i,t,e,n){return e!==void 0&&n!==void 0?[e/i,n/t]:e!==void 0?e/i:n!==void 0?n/t:1}class qo extends nu{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,r=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:r,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;this.imgSize_=t.imgSize;let a=t.src;ue(!(a!==void 0&&o),4),ue(!o||o&&this.imgSize_,5),(a===void 0||a.length===0)&&o&&(a=o.src||de(o)),ue(a!==void 0&&a.length>0,6),ue(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),69);const u=t.src!==void 0?Zt.IDLE:Zt.LOADED;if(this.color_=t.color!==void 0?Xa(t.color):null,this.iconImage_=D_(o,a,this.imgSize_!==void 0?this.imgSize_:null,this.crossOrigin_,u,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let l,c;if(t.size)[l,c]=t.size;else{const h=this.getImage(1);if(h instanceof HTMLCanvasElement||h.src&&h.complete)l=h.width,c=h.height;else{this.initialOptions_=t;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(hf(g[0],g[1],t.width,t.height))};this.listenImageChange(f);return}}l!==void 0&&this.setScale(hf(l,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new qo({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=r[0]),this.anchorYUnits_=="fraction"&&(t[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+r[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==Zt.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==Zt.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(Ln.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Ln.CHANGE,t)}}function ff(i){return new is({fill:Ho(i,""),stroke:jo(i,""),text:A_(i),image:F_(i)})}function Ho(i,t){const e=i[t+"fill-color"];if(e)return e==="none"?null:new ns({color:e})}function jo(i,t){const e=i[t+"stroke-width"],n=i[t+"stroke-color"];if(!(!e&&!n))return new Ys({width:e,color:n,lineCap:i[t+"stroke-line-cap"],lineJoin:i[t+"stroke-line-join"],lineDash:i[t+"stroke-line-dash"],lineDashOffset:i[t+"stroke-line-dash-offset"],miterLimit:i[t+"stroke-miter-limit"]})}function A_(i){const t=i["text-value"];return t?new su({text:t,font:i["text-font"],maxAngle:i["text-max-angle"],offsetX:i["text-offset-x"],offsetY:i["text-offset-y"],overflow:i["text-overflow"],placement:i["text-placement"],repeat:i["text-repeat"],scale:i["text-scale"],rotateWithView:i["text-rotate-with-view"],rotation:i["text-rotation"],textAlign:i["text-align"],justify:i["text-justify"],textBaseline:i["text-baseline"],padding:i["text-padding"],fill:Ho(i,"text-"),backgroundFill:Ho(i,"text-background-"),stroke:jo(i,"text-"),backgroundStroke:jo(i,"text-background-")}):void 0}function F_(i){const t=i["icon-src"],e=i["icon-img"];if(t||e)return new qo({src:t,img:e,imgSize:i["icon-img-size"],anchor:i["icon-anchor"],anchorOrigin:i["icon-anchor-origin"],anchorXUnits:i["icon-anchor-x-units"],anchorYUnits:i["icon-anchor-y-units"],color:i["icon-color"],crossOrigin:i["icon-cross-origin"],offset:i["icon-offset"],displacement:i["icon-displacement"],opacity:i["icon-opacity"],scale:i["icon-scale"],width:i["icon-width"],height:i["icon-height"],rotation:i["icon-rotation"],rotateWithView:i["icon-rotate-with-view"],size:i["icon-size"],declutterMode:i["icon-declutter-mode"]});const n=i["shape-points"];if(n){const s="shape-";return new iu({points:n,fill:Ho(i,s),stroke:jo(i,s),radius:i["shape-radius"],radius1:i["shape-radius1"],radius2:i["shape-radius2"],angle:i["shape-angle"],displacement:i["shape-displacement"],rotation:i["shape-rotation"],rotateWithView:i["shape-rotate-with-view"],scale:i["shape-scale"],declutterMode:i["shape-declutter-mode"]})}const r=i["circle-radius"];if(r){const s="circle-";return new ru({radius:r,fill:Ho(i,s),stroke:jo(i,s),displacement:i["circle-displacement"],scale:i["circle-scale"],rotation:i["circle-rotation"],rotateWithView:i["circle-rotate-with-view"],declutterMode:i["circle-declutter-mode"]})}}const gf={RENDER_ORDER:"renderOrder"};class k_ extends am{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(gf.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new lf(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(gf.RENDER_ORDER,t)}setStyle(t){let e;if(t===void 0)e=I_;else if(t===null)e=null;else if(typeof t=="function")e=t;else if(t instanceof is)e=t;else if(Array.isArray(t)){const n=t.length,r=new Array(n);for(let s=0;s<n;++s){const o=t[s];o instanceof is?r[s]=o:r[s]=ff(o)}e=r}else e=ff(t);this.style_=e,this.styleFunction_=t===null?void 0:x_(this.style_),this.changed()}}const H={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},uu=[H.FILL],mr=[H.STROKE],rs=[H.BEGIN_PATH],df=[H.CLOSE_PATH];class pf{drawCustom(t,e,n,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}class Zo extends pf{constructor(t,e,n,r){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,u=t.length;a<u;a+=e)r[0]=t[a],r[1]=t[a+1],zd(n,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(t,e,n,r,s,o){const a=this.coordinates;let u=a.length;const l=this.getBufferedMaxExtent();o&&(e+=r);let c=t[e],h=t[e+1];const f=this.tmpCoordinate_;let g=!0,d,m,p;for(d=e+r;d<n;d+=r)f[0]=t[d],f[1]=t[d+1],p=sl(l,f),p!==m?(g&&(a[u++]=c,a[u++]=h,g=!1),a[u++]=f[0],a[u++]=f[1]):p===pe.INTERSECTING?(a[u++]=f[0],a[u++]=f[1],g=!1):g=!0,c=f[0],h=f[1],m=p;return(s&&g||d===e+r)&&(a[u++]=c,a[u++]=h),u}drawCustomCoordinates_(t,e,n,r,s){for(let o=0,a=n.length;o<a;++o){const u=n[o],l=this.appendFlatLineCoordinates(t,e,u,r,!1,!1);s.push(l),e=u}return e}drawCustom(t,e,n,r){this.beginGeometry(t,e);const s=t.getType(),o=t.getStride(),a=this.coordinates.length;let u,l,c,h,f;switch(s){case"MultiPolygon":u=t.getOrientedFlatCoordinates(),h=[];const g=t.getEndss();f=0;for(let d=0,m=g.length;d<m;++d){const p=[];f=this.drawCustomCoordinates_(u,f,g[d],o,p),h.push(p)}this.instructions.push([H.CUSTOM,a,h,t,n,yl]),this.hitDetectionInstructions.push([H.CUSTOM,a,h,t,r||n,yl]);break;case"Polygon":case"MultiLineString":c=[],u=s=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),f=this.drawCustomCoordinates_(u,0,t.getEnds(),o,c),this.instructions.push([H.CUSTOM,a,c,t,n,Mo]),this.hitDetectionInstructions.push([H.CUSTOM,a,c,t,r||n,Mo]);break;case"LineString":case"Circle":u=t.getFlatCoordinates(),l=this.appendFlatLineCoordinates(u,0,u.length,o,!1,!1),this.instructions.push([H.CUSTOM,a,l,t,n,hr]),this.hitDetectionInstructions.push([H.CUSTOM,a,l,t,r||n,hr]);break;case"MultiPoint":u=t.getFlatCoordinates(),l=this.appendFlatPointCoordinates(u,o),l>a&&(this.instructions.push([H.CUSTOM,a,l,t,n,hr]),this.hitDetectionInstructions.push([H.CUSTOM,a,l,t,r||n,hr]));break;case"Point":u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),l=this.coordinates.length,this.instructions.push([H.CUSTOM,a,l,t,n]),this.hitDetectionInstructions.push([H.CUSTOM,a,l,t,r||n]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[H.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[H.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let r,s,o=-1;for(e=0;e<n;++e)r=t[e],s=r[0],s==H.END_GEOMETRY?o=e:s==H.BEGIN_GEOMETRY&&(r[2]=e,yd(this.hitDetectionInstructions,o,e),o=-1)}setFillStrokeStyle(t,e){const n=this.state;if(t){const r=t.getColor();n.fillStyle=Ci(r||tn)}else n.fillStyle=void 0;if(e){const r=e.getColor();n.strokeStyle=Ci(r||Do);const s=e.getLineCap();n.lineCap=s!==void 0?s:qa;const o=e.getLineDash();n.lineDash=o?o.slice():Bi;const a=e.getLineDashOffset();n.lineDashOffset=a||zi;const u=e.getLineJoin();n.lineJoin=u!==void 0?u:Bs;const l=e.getWidth();n.lineWidth=l!==void 0?l:Fo;const c=e.getMiterLimit();n.miterLimit=c!==void 0?c:Oo,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const e=t.fillStyle,n=[H.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(!0),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[H.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,r=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,u=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||s!=t.currentLineDash&&!bs(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=u||t.currentMiterLimit!=l)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=u,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[H.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Bd(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;il(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class G_ extends Zo{constructor(t,e,n,r){super(t,e,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const n=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([H.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([H.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const n=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([H.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([H.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const n=t.getAnchor(),r=t.getSize(),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}class B_ extends Zo{constructor(t,e,n,r){super(t,e,n,r)}drawFlatCoordinates_(t,e,n,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),a=[H.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n}drawLineString(t,e){const n=this.state,r=n.strokeStyle,s=n.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi],rs);const o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(mr),this.endGeometry(e)}drawMultiLineString(t,e){const n=this.state,r=n.strokeStyle,s=n.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi],rs);const o=t.getEnds(),a=t.getFlatCoordinates(),u=t.getStride();let l=0;for(let c=0,h=o.length;c<h;++c)l=this.drawFlatCoordinates_(a,l,o[c],u);this.hitDetectionInstructions.push(mr),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(mr),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(mr),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(rs)}}class mf extends Zo{constructor(t,e,n,r){super(t,e,n,r)}drawFlatCoordinatess_(t,e,n,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,u=n.length;this.instructions.push(rs),this.hitDetectionInstructions.push(rs);for(let l=0;l<u;++l){const c=n[l],h=this.coordinates.length,f=this.appendFlatLineCoordinates(t,e,c,r,!0,!a),g=[H.MOVE_TO_LINE_TO,h,f];this.instructions.push(g),this.hitDetectionInstructions.push(g),a&&(this.instructions.push(df),this.hitDetectionInstructions.push(df)),e=c}return o&&(this.instructions.push(uu),this.hitDetectionInstructions.push(uu)),a&&(this.instructions.push(mr),this.hitDetectionInstructions.push(mr)),e}drawCircle(t,e){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_FILL_STYLE,tn]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi]);const o=t.getFlatCoordinates(),a=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const l=[H.CIRCLE,u];this.instructions.push(rs,l),this.hitDetectionInstructions.push(rs,l),n.fillStyle!==void 0&&(this.instructions.push(uu),this.hitDetectionInstructions.push(uu)),n.strokeStyle!==void 0&&(this.instructions.push(mr),this.hitDetectionInstructions.push(mr)),this.endGeometry(e)}drawPolygon(t,e){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_FILL_STYLE,tn]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi]);const o=t.getEnds(),a=t.getOrientedFlatCoordinates(),u=t.getStride();this.drawFlatCoordinatess_(a,0,o,u),this.endGeometry(e)}drawMultiPolygon(t,e){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_FILL_STYLE,tn]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([H.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Bi,zi]);const o=t.getEndss(),a=t.getOrientedFlatCoordinates(),u=t.getStride();let l=0;for(let c=0,h=o.length;c<h;++c)l=this.drawFlatCoordinatess_(a,l,o[c],u);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let n=0,r=e.length;n<r;++n)e[n]=Zr(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}function z_(i,t,e,n,r){const s=[];let o=e,a=0,u=t.slice(e,2);for(;a<i&&o+r<n;){const[l,c]=u.slice(-2),h=t[o+r],f=t[o+r+1],g=Math.sqrt((h-l)*(h-l)+(f-c)*(f-c));if(a+=g,a>=i){const d=(i-a+g)/g,m=fn(l,h,d),p=fn(c,f,d);u.push(m,p),s.push(u),u=[m,p],a==i&&(o+=r),a=0}else if(a<i)u.push(t[o+r],t[o+r+1]),o+=r;else{const d=g-a,m=fn(l,h,d/g),p=fn(c,f,d/g);u.push(m,p),s.push(u),u=[m,p],a=0,o+=r}}return a>0&&s.push(u),s}function V_(i,t,e,n,r){let s=e,o=e,a=0,u=0,l=e,c,h,f,g,d,m,p,_,y,v;for(h=e;h<n;h+=r){const C=t[h],x=t[h+1];d!==void 0&&(y=C-d,v=x-m,g=Math.sqrt(y*y+v*v),p!==void 0&&(u+=f,c=Math.acos((p*y+_*v)/(f*g)),c>i&&(u>a&&(a=u,s=l,o=h),u=0,l=h-r)),f=g,p=y,_=v),d=C,m=x}return u+=g,u>a?[l,h]:[s,o]}const lu={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class X_ extends Zo{constructor(t,e,n,r){super(t,e,n,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[tn]={fillStyle:tn},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const n=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!n&&!r)return;const o=this.coordinates;let a=o.length;const u=t.getType();let l=null,c=t.getStride();if(s.placement==="line"&&(u=="LineString"||u=="MultiLineString"||u=="Polygon"||u=="MultiPolygon")){if(!ei(this.getBufferedMaxExtent(),t.getExtent()))return;let h;if(l=t.getFlatCoordinates(),u=="LineString")h=[l.length];else if(u=="MultiLineString")h=t.getEnds();else if(u=="Polygon")h=t.getEnds().slice(0,1);else if(u=="MultiPolygon"){const m=t.getEndss();h=[];for(let p=0,_=m.length;p<_;++p)h.push(m[p][0])}this.beginGeometry(t,e);const f=s.repeat,g=f?void 0:s.textAlign;let d=0;for(let m=0,p=h.length;m<p;++m){let _;f?_=z_(f*this.resolution,l,d,h[m],c):_=[l.slice(d,h[m])];for(let y=0,v=_.length;y<v;++y){const C=_[y];let x=0,b=C.length;if(g==null){const T=V_(s.maxAngle,C,0,C.length,2);x=T[0],b=T[1]}for(let T=x;T<b;T+=c)o.push(C[T],C[T+1]);const R=o.length;d=h[m],this.drawChars_(a,R),a=R}}this.endGeometry(e)}else{let h=s.overflow?null:[];switch(u){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),c=2;break;case"Polygon":l=t.getFlatInteriorPoint(),s.overflow||h.push(l[2]/this.resolution),c=3;break;case"MultiPolygon":const _=t.getFlatInteriorPoints();l=[];for(let y=0,v=_.length;y<v;y+=3)s.overflow||h.push(_[y+2]/this.resolution),l.push(_[y],_[y+1]);if(l.length===0)return;c=2;break}const f=this.appendFlatPointCoordinates(l,c);if(f===a)return;if(h&&(f-a)/2!==l.length/c){let _=a/2;h=h.filter((y,v)=>{const C=o[(_+v)*2]===l[v*c]&&o[(_+v)*2+1]===l[v*c+1];return C||--_,C})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&this.updateFillStyle(this.state,this.createFill),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let g=s.padding;if(g!=Jr&&(s.scale[0]<0||s.scale[1]<0)){let _=s.padding[0],y=s.padding[1],v=s.padding[2],C=s.padding[3];s.scale[0]<0&&(y=-y,C=-C),s.scale[1]<0&&(_=-_,v=-v),g=[_,y,v,C]}const d=this.pixelRatio;this.instructions.push([H.DRAW_IMAGE,a,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,g==Jr?Jr:g.map(function(_){return _*d}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);const m=1/d,p=this.state.fillStyle;s.backgroundFill&&(this.state.fillStyle=tn,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([H.DRAW_IMAGE,a,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,g,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?tn:this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),s.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Ao,justify:e.justify,textBaseline:e.textBaseline||Ha,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const u=this.pixelRatio,l=lu[r.textBaseline],c=this.textOffsetY_*u,h=this.text_,f=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([H.DRAW_CHARS,t,e,l,r.overflow,a,r.maxAngle,u,c,s,f*u,h,o,1]),this.hitDetectionInstructions.push([H.DRAW_CHARS,t,e,l,r.overflow,a&&tn,r.maxAngle,1,c,s,f,h,o,1/u])}setTextStyle(t,e){let n,r,s;if(!t)this.text_="";else{const o=t.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Ci(o.getColor()||tn)):(r=null,this.textFillState_=r);const a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const d=a.getLineDash(),m=a.getLineDashOffset(),p=a.getWidth(),_=a.getMiterLimit();s.lineCap=a.getLineCap()||qa,s.lineDash=d?d.slice():Bi,s.lineDashOffset=m===void 0?zi:m,s.lineJoin=a.getLineJoin()||Bs,s.lineWidth=p===void 0?Fo:p,s.miterLimit=_===void 0?Oo:_,s.strokeStyle=Ci(a.getColor()||Do)}n=this.textState_;const u=t.getFont()||bh;cm(u);const l=t.getScaleArray();n.overflow=t.getOverflow(),n.font=u,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Ha,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Jr,n.scale=l===void 0?[1,1]:l;const c=t.getOffsetX(),h=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=f===void 0?!1:f,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:de(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=r?typeof r.fillStyle=="string"?r.fillStyle:"|"+de(r.fillStyle):""}this.declutterImageWithText_=e}}const U_={Circle:mf,Default:Zo,Image:G_,LineString:B_,Polygon:mf,Text:X_};class _f{constructor(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const r in n){const s=n[r].finish();t[e][r]=s}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let s=r[e];if(s===void 0){const o=U_[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=s}return s}}class Y_ extends wo{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return xt()}getData(t){return null}prepareFrame(t){return xt()}renderFrame(t,e){return xt()}loadedTileCallback(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n}createLoadedTileFinder(t,e,n){return(r,s)=>{const o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,s,o)}}forEachFeatureAtCoordinate(t,e,n,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Zt.LOADED||e.getState()===Zt.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Zt.LOADED&&e!=Zt.ERROR&&t.addEventListener(Ln.CHANGE,this.boundHandleImageChange_),e==Zt.IDLE&&(t.load(),e=t.getState()),e==Zt.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const yf=[];let Hs=null;function W_(){Hs=ti(1,1,void 0,{willReadFrequently:!0})}class q_ extends Y_{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=cr(),this.pixelTransform=cr(),this.inversePixelTransform=cr(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,n){Hs||W_(),Hs.clearRect(0,0,1,1);let r;try{Hs.drawImage(t,e,n,1,1,0,0,1,1),r=Hs.getImageData(0,0,1,1).data}catch{return Hs=null,null}return r}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const r=this.getLayer().getClassName();let s,o;if(t&&t.className===r&&(!n||t&&t.style.backgroundColor&&bs(Xa(t.style.backgroundColor),Xa(n)))){const a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=ti();const u=o.canvas;s.appendChild(u),a=u.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const r=qc(n),s=Hc(n),o=Wc(n),a=Yc(n);$e(e.coordinateToPixelTransform,r),$e(e.coordinateToPixelTransform,s),$e(e.coordinateToPixelTransform,o),$e(e.coordinateToPixelTransform,a);const u=this.inversePixelTransform;$e(u,r),$e(u,s),$e(u,o),$e(u,a),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}dispatchRenderEvent_(t,e,n){const r=this.getLayer();if(r.hasListener(t)){const s=new lm(t,this.inversePixelTransform,n,e);r.dispatchEvent(s)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(To.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(To.POSTRENDER,t,e)}getRenderTransform(t,e,n,r,s,o,a){const u=s/2,l=o/2,c=r/e,h=-c,f=-t[0]+a,g=-t[1];return bo(this.tempTransform,u,l,c,h,-n,f,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function H_(i,t,e,n,r,s,o,a,u,l,c,h){let f=i[t],g=i[t+1],d=0,m=0,p=0,_=0;function y(){d=f,m=g,t+=n,f=i[t],g=i[t+1],_+=p,p=Math.sqrt((f-d)*(f-d)+(g-m)*(g-m))}do y();while(t<e-n&&_+p<s);let v=p===0?0:(s-_)/p;const C=fn(d,f,v),x=fn(m,g,v),b=t-n,R=_,T=s+a*u(l,r,c);for(;t<e-n&&_+p<T;)y();v=p===0?0:(T-_)/p;const w=fn(d,f,v),O=fn(m,g,v);let z;if(h){const B=[C,x,w,O];fh(B,0,4,2,h,B,B),z=B[0]>B[2]}else z=C>w;const F=Math.PI,Y=[],L=b+n===t;t=b,p=0,_=R,f=i[t],g=i[t+1];let M;if(L){y(),M=Math.atan2(g-m,f-d),z&&(M+=M>0?-F:F);const B=(w+C)/2,U=(O+x)/2;return Y[0]=[B,U,(T-s)/2,M,r],Y}r=r.replace(/\n/g," ");for(let B=0,U=r.length;B<U;){y();let J=Math.atan2(g-m,f-d);if(z&&(J+=J>0?-F:F),M!==void 0){let ge=J-M;if(ge+=ge>F?-2*F:ge<-F?2*F:0,Math.abs(ge)>o)return null}M=J;const rt=B;let Ct=0;for(;B<U;++B){const ge=z?U-B-1:B,Ve=a*u(l,r[ge],c);if(t+n<e&&_+p<s+Ct+Ve/2)break;Ct+=Ve}if(B===rt)continue;const Tt=z?r.substring(U-rt,U-B):r.substring(rt,B);v=p===0?0:(s+Ct/2-_)/p;const k=fn(d,f,v),ze=fn(m,g,v);Y.push([k,ze,Ct/2,J,Tt]),s+=Ct}return Y}const js=Yr(),_r=[],Wi=[],qi=[],yr=[];function vf(i){return i[3].declutterBox}const Ef=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Dl(i,t){return t==="start"?t=Ef.test(i)?"right":"left":t==="end"&&(t=Ef.test(i)?"left":"right"),lu[t]}function j_(i,t,e){return e>0&&i.push(`
7
7
  `,""),i.push(t,""),i}class Z_{constructor(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=cr(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,n,r){const s=t+e+n+r;if(this.labels_[s])return this.labels_[s];const o=r?this.strokeStates[r]:null,a=n?this.fillStates[n]:null,u=this.textStates[e],l=this.pixelRatio,c=[u.scale[0]*l,u.scale[1]*l],h=Array.isArray(t),f=u.justify?lu[u.justify]:Dl(Array.isArray(t)?t[0]:t,u.textAlign||Ao),g=r&&o.lineWidth?o.lineWidth:0,d=h?t:t.split(`
8
8
  `).reduce(j_,[]),{width:m,height:p,widths:_,heights:y,lineWidths:v}=fm(u,d),C=m+g,x=[],b=(C+2)*c[0],R=(p+g)*c[1],T={width:b<0?Math.floor(b):Math.ceil(b),height:R<0?Math.floor(R):Math.ceil(R),contextInstructions:x};(c[0]!=1||c[1]!=1)&&x.push("scale",c),r&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",g),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)),n&&x.push("fillStyle",a.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const w=.5-f;let O=f*C+w*g;const z=[],F=[];let Y=0,L=0,M=0,B=0,U;for(let J=0,rt=d.length;J<rt;J+=2){const Ct=d[J];if(Ct===`
9
9
  `){L+=Y,Y=0,O=f*C+w*g,++B;continue}const Tt=d[J+1]||u.font;Tt!==U&&(r&&z.push("font",Tt),n&&F.push("font",Tt),U=Tt),Y=Math.max(Y,y[M]);const k=[Ct,O+w*_[M]+f*(_[M]-v[B]),.5*(g+Y)+L];O+=_[M],r&&z.push("strokeText",k),n&&F.push("fillText",k),++M}return Array.prototype.push.apply(x,z),Array.prototype.push.apply(x,F),this.labels_[s]=T,T}replayTextBackground_(t,e,n,r,s,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,s),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,e,n,r,s,o,a,u,l,c,h,f,g,d,m,p){a*=f[0],u*=f[1];let _=n-a,y=r-u;const v=s+l>t?t-l:s,C=o+c>e?e-c:o,x=d[3]+v*f[0]+d[1],b=d[0]+C*f[1]+d[2],R=_-d[3],T=y-d[0];(m||h!==0)&&(_r[0]=R,yr[0]=R,_r[1]=T,Wi[1]=T,Wi[0]=R+x,qi[0]=Wi[0],qi[1]=T+b,yr[1]=qi[1]);let w;return h!==0?(w=bo(cr(),n,r,1,1,h,-n,-r),$e(w,_r),$e(w,Wi),$e(w,qi),$e(w,yr),Wr(Math.min(_r[0],Wi[0],qi[0],yr[0]),Math.min(_r[1],Wi[1],qi[1],yr[1]),Math.max(_r[0],Wi[0],qi[0],yr[0]),Math.max(_r[1],Wi[1],qi[1],yr[1]),js)):Wr(Math.min(R,R+x),Math.min(T,T+b),Math.max(R,R+x),Math.max(T,T+b),js),g&&(_=Math.round(_),y=Math.round(y)),{drawImageX:_,drawImageY:y,drawImageW:v,drawImageH:C,originX:l,originY:c,declutterBox:{minX:js[0],minY:js[1],maxX:js[2],maxY:js[3],value:p},canvasTransform:w,scale:f}}replayImageOrLabel_(t,e,n,r,s,o,a){const u=!!(o||a),l=r.declutterBox,c=t.canvas,h=a?a[2]*r.scale[0]/2:0;return l.minX-h<=c.width/e&&l.maxX+h>=0&&l.minY-h<=c.height/e&&l.maxY+h>=0&&(u&&this.replayTextBackground_(t,_r,Wi,qi,yr,o,a),gm(t,r.canvasTransform,s,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(t){if(this.alignFill_){const e=$e(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,n,r){const s=this.textStates[e],o=this.createLabel(t,e,r,n),a=this.strokeStates[n],u=this.pixelRatio,l=Dl(Array.isArray(t)?t[0]:t,s.textAlign||Ao),c=lu[s.textBaseline||Ha],h=a&&a.lineWidth?a.lineWidth:0,f=o.width/u-2*s.scale[0],g=l*f+2*(.5-l)*h,d=c*o.height/u+2*(.5-c)*h;return{label:o,anchorX:g,anchorY:d}}execute_(t,e,n,r,s,o,a,u){let l;this.pixelCoordinates_&&bs(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Hr(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),pp(this.renderedTransform_,n));let c=0;const h=r.length;let f=0,g,d,m,p,_,y,v,C,x,b,R,T,w=0,O=0,z=null,F=null;const Y=this.coordinateCache_,L=this.viewRotation_,M=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,B={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},U=this.instructions!=r||this.overlaps?0:200;let J,rt,Ct,Tt;for(;c<h;){const k=r[c];switch(k[0]){case H.BEGIN_GEOMETRY:J=k[1],Tt=k[3],J.getGeometry()?a!==void 0&&!ei(a,Tt.getExtent())?c=k[2]+1:++c:c=k[2];break;case H.BEGIN_PATH:w>U&&(this.fill_(t),w=0),O>U&&(t.stroke(),O=0),!w&&!O&&(t.beginPath(),p=NaN,_=NaN),++c;break;case H.CIRCLE:f=k[1];const ge=l[f],Ve=l[f+1],Ia=l[f+2],vc=l[f+3],Xu=Ia-ge,Sa=vc-Ve,Uu=Math.sqrt(Xu*Xu+Sa*Sa);t.moveTo(ge+Uu,Ve),t.arc(ge,Ve,Uu,0,2*Math.PI,!0),++c;break;case H.CLOSE_PATH:t.closePath(),++c;break;case H.CUSTOM:f=k[1],g=k[2];const Ec=k[3],Gr=k[4],ct=k.length==6?k[5]:void 0;B.geometry=Ec,B.feature=J,c in Y||(Y[c]=[]);const Mt=Y[c];ct?ct(l,f,g,2,Mt):(Mt[0]=l[f],Mt[1]=l[f+1],Mt.length=2),Gr(Mt,B),++c;break;case H.DRAW_IMAGE:f=k[1],g=k[2],C=k[3],d=k[4],m=k[5];let nt=k[6];const Yu=k[7],Zn=k[8],Pt=k[9],wn=k[10];let Br=k[11];const sr=k[12];let vi=k[13];const Ss=k[14],or=k[15];if(!C&&k.length>=20){x=k[19],b=k[20],R=k[21],T=k[22];const Qe=this.drawLabelWithPointPlacement_(x,b,R,T);C=Qe.label,k[3]=C;const Vr=k[23];d=(Qe.anchorX-Vr)*this.pixelRatio,k[4]=d;const cn=k[24];m=(Qe.anchorY-cn)*this.pixelRatio,k[5]=m,nt=C.height,k[6]=nt,vi=C.width,k[13]=vi}let wa;k.length>25&&(wa=k[25]);let Kn,ws,zr;k.length>17?(Kn=k[16],ws=k[17],zr=k[18]):(Kn=Jr,ws=!1,zr=!1),wn&&M?Br+=L:!wn&&!M&&(Br-=L);let La=0;for(;f<g;f+=2){if(wa&&wa[La++]<vi/this.pixelRatio)continue;const Qe=this.calculateImageOrLabelDimensions_(C.width,C.height,l[f],l[f+1],vi,nt,d,m,Zn,Pt,Br,sr,s,Kn,ws||zr,J),Vr=[t,e,C,Qe,Yu,ws?z:null,zr?F:null];if(u){if(Ss==="none")continue;if(Ss==="obstacle"){u.insert(Qe.declutterBox);continue}else{let cn,N;if(or){const dt=g-f;if(!or[dt]){or[dt]=Vr;continue}if(cn=or[dt],delete or[dt],N=vf(cn),u.collides(N))continue}if(u.collides(Qe.declutterBox))continue;cn&&(u.insert(N),this.replayImageOrLabel_.apply(this,cn)),u.insert(Qe.declutterBox)}}this.replayImageOrLabel_.apply(this,Vr)}++c;break;case H.DRAW_CHARS:const Wu=k[1],qu=k[2],Na=k[3],Ra=k[4];T=k[5];const ba=k[6],Hu=k[7],ju=k[8];R=k[9];const Ta=k[10];x=k[11],b=k[12];const Zu=[k[13],k[13]],Ma=this.textStates[b],Ls=Ma.font,Ns=[Ma.scale[0]*Hu,Ma.scale[1]*Hu];let Rs;Ls in this.widths_?Rs=this.widths_[Ls]:(Rs={},this.widths_[Ls]=Rs);const Ku=of(l,Wu,qu,2),Ju=Math.abs(Ns[0])*Mh(Ls,x,Rs);if(Ra||Ju<=Ku){const Qe=this.textStates[b].textAlign,Vr=(Ku-Ju)*Dl(x,Qe),cn=H_(l,Wu,qu,2,x,Vr,ba,Math.abs(Ns[0]),Mh,Ls,Rs,M?0:this.viewRotation_);t:if(cn){const N=[];let dt,Le,Pe,Q,kt;if(R)for(dt=0,Le=cn.length;dt<Le;++dt){kt=cn[dt],Pe=kt[4],Q=this.createLabel(Pe,b,"",R),d=kt[2]+(Ns[0]<0?-Ta:Ta),m=Na*Q.height+(.5-Na)*2*Ta*Ns[1]/Ns[0]-ju;const hn=this.calculateImageOrLabelDimensions_(Q.width,Q.height,kt[0],kt[1],Q.width,Q.height,d,m,0,0,kt[3],Zu,!1,Jr,!1,J);if(u&&u.collides(hn.declutterBox))break t;N.push([t,e,Q,hn,1,null,null])}if(T)for(dt=0,Le=cn.length;dt<Le;++dt){kt=cn[dt],Pe=kt[4],Q=this.createLabel(Pe,b,T,""),d=kt[2],m=Na*Q.height-ju;const hn=this.calculateImageOrLabelDimensions_(Q.width,Q.height,kt[0],kt[1],Q.width,Q.height,d,m,0,0,kt[3],Zu,!1,Jr,!1,J);if(u&&u.collides(hn.declutterBox))break t;N.push([t,e,Q,hn,1,null,null])}u&&u.load(N.map(vf));for(let hn=0,Pa=N.length;hn<Pa;++hn)this.replayImageOrLabel_.apply(this,N[hn])}}++c;break;case H.END_GEOMETRY:if(o!==void 0){J=k[1];const Qe=o(J,Tt);if(Qe)return Qe}++c;break;case H.FILL:U?w++:this.fill_(t),++c;break;case H.MOVE_TO_LINE_TO:for(f=k[1],g=k[2],rt=l[f],Ct=l[f+1],y=rt+.5|0,v=Ct+.5|0,(y!==p||v!==_)&&(t.moveTo(rt,Ct),p=y,_=v),f+=2;f<g;f+=2)rt=l[f],Ct=l[f+1],y=rt+.5|0,v=Ct+.5|0,(f==g-2||y!==p||v!==_)&&(t.lineTo(rt,Ct),p=y,_=v);++c;break;case H.SET_FILL_STYLE:z=k,this.alignFill_=k[2],w&&(this.fill_(t),w=0,O&&(t.stroke(),O=0)),t.fillStyle=k[1],++c;break;case H.SET_STROKE_STYLE:F=k,O&&(t.stroke(),O=0),this.setStrokeStyle_(t,k),++c;break;case H.STROKE:U?O++:t.stroke(),++c;break;default:++c;break}}w&&this.fill_(t),O&&t.stroke()}execute(t,e,n,r,s,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,s,void 0,void 0,o)}executeHitDetection(t,e,n,r,s){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,s)}}const Al=["Polygon","Circle","LineString","Image","Text","Default"];class Cf{constructor(t,e,n,r,s,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=cr(),this.createExecutors_(s)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t){for(const e in t){let n=this.executorsByZIndex_[e];n===void 0&&(n={},this.executorsByZIndex_[e]=n);const r=t[e];for(const s in r){const o=r[s];n[s]=new Z_(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let r=0,s=t.length;r<s;++r)if(t[r]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,r,s,o){r=Math.round(r);const a=r*2+1,u=bo(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-n,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=ti(a,a,void 0,{willReadFrequently:!0}));const c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):l||c.clearRect(0,0,a,a);let h;this.renderBuffer_!==void 0&&(h=Yr(),Ud(h,t),il(h,e*(this.renderBuffer_+r),h));const f=K_(r);let g;function d(x,b){const R=c.getImageData(0,0,a,a).data;for(let T=0,w=f.length;T<w;T++)if(R[f[T]]>0){if(!o||g!=="Image"&&g!=="Text"||o.includes(x)){const O=(f[T]-3)/4,z=r-O%a,F=r-(O/a|0),Y=s(x,b,z*z+F*F);if(Y)return Y}c.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Io);let p,_,y,v,C;for(p=m.length-1;p>=0;--p){const x=m[p].toString();for(y=this.executorsByZIndex_[x],_=Al.length-1;_>=0;--_)if(g=Al[_],v=y[g],v!==void 0&&(C=v.executeHitDetection(c,u,n,d,h),C))return C}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],r=e[1],s=e[2],o=e[3],a=[n,r,n,o,s,o,s,r];return Hr(a,0,8,2,t,a),a}isEmpty(){return So(this.executorsByZIndex_)}execute(t,e,n,r,s,o,a){const u=Object.keys(this.executorsByZIndex_).map(Number);u.sort(Io),this.maxExtent_&&(t.save(),this.clip(t,n)),o=o||Al;let l,c,h,f,g,d;for(a&&u.reverse(),l=0,c=u.length;l<c;++l){const m=u[l].toString();for(g=this.executorsByZIndex_[m],h=0,f=o.length;h<f;++h){const p=o[h];d=g[p],d!==void 0&&d.execute(t,e,n,r,s,a)}}this.maxExtent_&&t.restore()}}const Fl={};function K_(i){if(Fl[i]!==void 0)return Fl[i];const t=i*2+1,e=i*i,n=new Array(e+1);for(let s=0;s<=i;++s)for(let o=0;o<=i;++o){const a=s*s+o*o;if(a>e)break;let u=n[a];u||(u=[],n[a]=u),u.push(((i+s)*t+(i+o))*4+3),s>0&&u.push(((i-s)*t+(i+o))*4+3),o>0&&(u.push(((i+s)*t+(i-o))*4+3),s>0&&u.push(((i-s)*t+(i-o))*4+3))}const r=[];for(let s=0,o=n.length;s<o;++s)n[s]&&r.push(...n[s]);return Fl[i]=r,r}class J_ extends pf{constructor(t,e,n,r,s,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=n,this.transform_=r,this.transformRotation_=r?tp(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=cr()}drawImages_(t,e,n,r){if(!this.image_)return;const s=Hr(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,u=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=u*this.imageOpacity_);let l=this.imageRotation_;this.transformRotation_===0&&(l-=this.viewRotation_),this.imageRotateWithView_&&(l+=this.viewRotation_);for(let c=0,h=s.length;c<h;c+=2){const f=s[c]-this.imageAnchorX_,g=s[c+1]-this.imageAnchorY_;if(l!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const d=f+this.imageAnchorX_,m=g+this.imageAnchorY_;bo(a,d,m,1,1,l,-d,-m),o.setTransform.apply(o,a),o.translate(d,m),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,f,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=u)}drawText_(t,e,n,r){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=Hr(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);e<n;e+=r){const u=s[e]+this.textOffsetX_,l=s[e+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.translate(u-this.textOffsetX_,l-this.textOffsetY_),o.rotate(a),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)):(this.textStrokeState_&&o.strokeText(this.text_,u,l),this.textFillState_&&o.fillText(this.text_,u,l))}}moveToLineTo_(t,e,n,r,s){const o=this.context_,a=Hr(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let u=a.length;s&&(u-=2);for(let l=2;l<u;l+=2)o.lineTo(a[l],a[l+1]);return s&&o.closePath(),n}drawRings_(t,e,n,r){for(let s=0,o=n.length;s<o;++s)e=this.moveToLineTo_(t,e,n[s],r,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ei(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=zp(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],s=Math.sqrt(n*n+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],s,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ei(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(ei(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,r=t.getFlatCoordinates();let s=0;const o=t.getEnds(),a=t.getStride();n.beginPath();for(let u=0,l=o.length;u<l;++u)s=this.moveToLineTo_(r,s,o[u],a,!1);n.stroke()}if(this.text_!==""){const n=t.getFlatMidpoints();this.drawText_(n,0,n.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ei(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ei(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getOrientedFlatCoordinates();let r=0;const s=t.getEndss(),o=t.getStride();e.beginPath();for(let a=0,u=s.length;a<u;++a){const l=s[a];r=this.drawRings_(n,r,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),bs(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,n=this.contextTextState_,r=t.textAlign?t.textAlign:Ao;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const n=t.getColor();this.fillState_={fillStyle:Ci(n||tn)}}if(!e)this.strokeState_=null;else{const n=e.getColor(),r=e.getLineCap(),s=e.getLineDash(),o=e.getLineDashOffset(),a=e.getLineJoin(),u=e.getWidth(),l=e.getMiterLimit(),c=s||Bi;this.strokeState_={lineCap:r!==void 0?r:qa,lineDash:this.pixelRatio_===1?c:c.map(h=>h*this.pixelRatio_),lineDashOffset:(o||zi)*this.pixelRatio_,lineJoin:a!==void 0?a:Bs,lineWidth:(u!==void 0?u:Fo)*this.pixelRatio_,miterLimit:l!==void 0?l:Oo,strokeStyle:Ci(n||Do)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),r=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const g=e.getColor();this.textFillState_={fillStyle:Ci(g||tn)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const g=n.getColor(),d=n.getLineCap(),m=n.getLineDash(),p=n.getLineDashOffset(),_=n.getLineJoin(),y=n.getWidth(),v=n.getMiterLimit();this.textStrokeState_={lineCap:d!==void 0?d:qa,lineDash:m||Bi,lineDashOffset:p||zi,lineJoin:_!==void 0?_:Bs,lineWidth:y!==void 0?y:Fo,miterLimit:v!==void 0?v:Oo,strokeStyle:Ci(g||Do)}}const r=t.getFont(),s=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),u=t.getRotation(),l=t.getScaleArray(),c=t.getText(),h=t.getTextAlign(),f=t.getTextBaseline();this.textState_={font:r!==void 0?r:bh,textAlign:h!==void 0?h:Ao,textBaseline:f!==void 0?f:Ha},this.text_=c!==void 0?Array.isArray(c)?c.reduce((g,d,m)=>g+=m%2?" ":d,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=u!==void 0?u:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}}}const xi=.5;function Q_(i,t,e,n,r,s,o){const a=i[0]*xi,u=i[1]*xi,l=ti(a,u);l.imageSmoothingEnabled=!1;const c=l.canvas,h=new J_(l,xi,r,null,o),f=e.length,g=Math.floor((256*256*256-1)/f),d={};for(let p=1;p<=f;++p){const _=e[p-1],y=_.getStyleFunction()||n;if(!y)continue;let v=y(_,s);if(!v)continue;Array.isArray(v)||(v=[v]);const x=(p*g).toString(16).padStart(7,"#00000");for(let b=0,R=v.length;b<R;++b){const T=v[b],w=T.getGeometryFunction()(_);if(!w||!ei(r,w.getExtent()))continue;const O=T.clone(),z=O.getFill();z&&z.setColor(x);const F=O.getStroke();F&&(F.setColor(x),F.setLineDash(null)),O.setText(void 0);const Y=T.getImage();if(Y){const U=Y.getImageSize();if(!U)continue;const J=ti(U[0],U[1],void 0,{alpha:!1}),rt=J.canvas;J.fillStyle=x,J.fillRect(0,0,rt.width,rt.height),O.setImage(new qo({img:rt,imgSize:U,anchor:Y.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:Y.getOrigin(),opacity:1,size:Y.getSize(),scale:Y.getScale(),rotation:Y.getRotation(),rotateWithView:Y.getRotateWithView()}))}const L=O.getZIndex()||0;let M=d[L];M||(M={},d[L]=M,M.Polygon=[],M.Circle=[],M.LineString=[],M.Point=[]);const B=w.getType();if(B==="GeometryCollection"){const U=w.getGeometriesArrayRecursive();for(let J=0,rt=U.length;J<rt;++J){const Ct=U[J];M[Ct.getType().replace("Multi","")].push(Ct,O)}}else M[B.replace("Multi","")].push(w,O)}}const m=Object.keys(d).map(Number).sort(Io);for(let p=0,_=m.length;p<_;++p){const y=d[m[p]];for(const v in y){const C=y[v];for(let x=0,b=C.length;x<b;x+=2){h.setStyle(C[x+1]);for(let R=0,T=t.length;R<T;++R)h.setTransform(t[R]),h.drawGeometry(C[x])}}}return l.getImageData(0,0,c.width,c.height)}function $_(i,t,e){const n=[];if(e){const r=Math.floor(Math.round(i[0])*xi),s=Math.floor(Math.round(i[1])*xi),o=(Oe(r,0,e.width-1)+Oe(s,0,e.height-1)*e.width)*4,a=e.data[o],u=e.data[o+1],c=e.data[o+2]+256*(u+256*a),h=Math.floor((256*256*256-1)/t.length);c&&c%h===0&&n.push(t[c/h-1])}return n}const ty=.5,xf={Point:ly,LineString:oy,Polygon:hy,MultiPoint:cy,MultiLineString:ay,MultiPolygon:uy,GeometryCollection:sy,Circle:iy};function ey(i,t){return parseInt(de(i),10)-parseInt(de(t),10)}function ny(i,t){const e=kl(i,t);return e*e}function kl(i,t){return ty*i/t}function iy(i,t,e,n,r){const s=e.getFill(),o=e.getStroke();if(s||o){const u=i.getBuilder(e.getZIndex(),"Circle");u.setFillStrokeStyle(s,o),u.drawCircle(t,n)}const a=e.getText();if(a&&a.getText()){const u=(r||i).getBuilder(e.getZIndex(),"Text");u.setTextStyle(a),u.drawText(t,n)}}function If(i,t,e,n,r,s,o){let a=!1;const u=e.getImage();if(u){const l=u.getImageState();l==Zt.LOADED||l==Zt.ERROR?u.unlistenImageChange(r):(l==Zt.IDLE&&u.load(),u.listenImageChange(r),a=!0)}return ry(i,t,e,n,s,o),a}function ry(i,t,e,n,r,s){const o=e.getGeometryFunction()(t);if(!o)return;const a=o.simplifyTransformed(n,r);if(e.getRenderer())Sf(i,a,e,t);else{const l=xf[a.getType()];l(i,a,e,t,s)}}function Sf(i,t,e,n){if(t.getType()=="GeometryCollection"){const s=t.getGeometries();for(let o=0,a=s.length;o<a;++o)Sf(i,s[o],e,n);return}i.getBuilder(e.getZIndex(),"Default").drawCustom(t,n,e.getRenderer(),e.getHitDetectionRenderer())}function sy(i,t,e,n,r){const s=t.getGeometriesArray();let o,a;for(o=0,a=s.length;o<a;++o){const u=xf[s[o].getType()];u(i,s[o],e,n,r)}}function oy(i,t,e,n,r){const s=e.getStroke();if(s){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawLineString(t,n)}const o=e.getText();if(o&&o.getText()){const a=(r||i).getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n)}}function ay(i,t,e,n,r){const s=e.getStroke();if(s){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawMultiLineString(t,n)}const o=e.getText();if(o&&o.getText()){const a=(r||i).getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n)}}function uy(i,t,e,n,r){const s=e.getFill(),o=e.getStroke();if(o||s){const u=i.getBuilder(e.getZIndex(),"Polygon");u.setFillStrokeStyle(s,o),u.drawMultiPolygon(t,n)}const a=e.getText();if(a&&a.getText()){const u=(r||i).getBuilder(e.getZIndex(),"Text");u.setTextStyle(a),u.drawText(t,n)}}function ly(i,t,e,n,r){const s=e.getImage(),o=e.getText();let a;if(s){if(s.getImageState()!=Zt.LOADED)return;let u=i;if(r){const c=s.getDeclutterMode();if(c!=="none")if(u=r,c==="obstacle"){const h=i.getBuilder(e.getZIndex(),"Image");h.setImageStyle(s,a),h.drawPoint(t,n)}else o&&o.getText()&&(a={})}const l=u.getBuilder(e.getZIndex(),"Image");l.setImageStyle(s,a),l.drawPoint(t,n)}if(o&&o.getText()){let u=i;r&&(u=r);const l=u.getBuilder(e.getZIndex(),"Text");l.setTextStyle(o,a),l.drawText(t,n)}}function cy(i,t,e,n,r){const s=e.getImage(),o=e.getText();let a;if(s){if(s.getImageState()!=Zt.LOADED)return;let u=i;if(r){const c=s.getDeclutterMode();if(c!=="none")if(u=r,c==="obstacle"){const h=i.getBuilder(e.getZIndex(),"Image");h.setImageStyle(s,a),h.drawMultiPoint(t,n)}else o&&o.getText()&&(a={})}const l=u.getBuilder(e.getZIndex(),"Image");l.setImageStyle(s,a),l.drawMultiPoint(t,n)}if(o&&o.getText()){let u=i;r&&(u=r);const l=u.getBuilder(e.getZIndex(),"Text");l.setTextStyle(o,a),l.drawText(t,n)}}function hy(i,t,e,n,r){const s=e.getFill(),o=e.getStroke();if(s||o){const u=i.getBuilder(e.getZIndex(),"Polygon");u.setFillStrokeStyle(s,o),u.drawPolygon(t,n)}const a=e.getText();if(a&&a.getText()){const u=(r||i).getBuilder(e.getZIndex(),"Text");u.setTextStyle(a),u.drawText(t,n)}}class fy extends q_{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Yr(),this.wrappedRenderedExtent_=Yr(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,n){const r=e.extent,s=e.viewState,o=s.center,a=s.resolution,u=s.projection,l=s.rotation,c=u.getExtent(),h=this.getLayer().getSource(),f=e.pixelRatio,g=e.viewHints,d=!(g[Rn.ANIMATING]||g[Rn.INTERACTING]),m=this.compositionContext_,p=Math.round(e.size[0]*f),_=Math.round(e.size[1]*f),y=h.getWrapX()&&u.canWrapX(),v=y?Nn(c):null,C=y?Math.ceil((r[2]-c[2])/v)+1:1;let x=y?Math.floor((r[0]-c[0])/v):0;do{const b=this.getRenderTransform(o,a,l,f,p,_,x*v);t.execute(m,1,b,l,d,void 0,n)}while(++x<C)}setupCompositionContext_(){if(this.opacity_!==1){const t=ti(this.context.canvas.width,this.context.canvas.height,yf);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,wd(this.compositionContext_),yf.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];mp(this.pixelTransform,1/n,1/n),_p(this.inversePixelTransform,this.pixelTransform);const s=vp(this.pixelTransform);this.useContainer(e,s,this.getBackground(t));const o=this.context,a=o.canvas,u=this.replayGroup_,l=this.declutterExecutorGroup;let c=u&&!u.isEmpty()||l&&!l.isEmpty();if(!c&&!(this.getLayer().hasListener(To.PRERENDER)||this.getLayer().hasListener(To.POSTRENDER)))return null;const h=Math.round(t.size[0]*n),f=Math.round(t.size[1]*n);a.width!=h||a.height!=f?(a.width=h,a.height=f,a.style.transform!==s&&(a.style.transform=s)):this.containerReused||o.clearRect(0,0,h,f),this.preRender(o,t);const g=t.viewState;g.projection,this.opacity_=r.opacity,this.setupCompositionContext_();let d=!1;if(c&&r.extent&&this.clipping){const m=Ro(r.extent);c=ei(m,t.extent),d=c&&!Ds(m,t.extent),d&&this.clipUnrotated(this.compositionContext_,t,m)}return c&&this.renderWorlds(u,t),d&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==g.rotation&&(this.renderedRotation_=g.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=[this.context.canvas.width,this.context.canvas.height];$e(this.pixelTransform,n);const r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,u=this.wrappedRenderedExtent_,l=this.getLayer(),c=[],h=n[0]*xi,f=n[1]*xi;c.push(this.getRenderTransform(r,s,o,xi,h,f,0).slice());const g=l.getSource(),d=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Ds(d,u)){let m=u[0];const p=Nn(d);let _=0,y;for(;m<d[0];)--_,y=p*_,c.push(this.getRenderTransform(r,s,o,xi,h,f,y).slice()),m+=p;for(_=0,m=u[2];m>d[2];)++_,y=p*_,c.push(this.getRenderTransform(r,s,o,xi,h,f,y).slice()),m-=p}this.hitDetectionImageData_=Q_(n,c,this.renderedFeatures_,l.getStyleFunction(),u,s,o)}e($_(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,r,s){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,u=this.getLayer(),l={},c=function(g,d,m){const p=de(g),_=l[p];if(_){if(_!==!0&&m<_.distanceSq){if(m===0)return l[p]=!0,s.splice(s.lastIndexOf(_),1),r(g,u,d);_.geometry=d,_.distanceSq=m}}else{if(m===0)return l[p]=!0,r(g,u,d);s.push(l[p]={feature:g,layer:u,geometry:d,distanceSq:m,callback:r})}};let h;const f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(g=>h=g.forEachFeatureAtCoordinate(t,o,a,n,c,g===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(d=>d.value):null)),h}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const r=t.viewHints[Rn.ANIMATING],s=t.viewHints[Rn.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const u=t.extent,l=t.viewState,c=l.projection,h=l.resolution,f=t.pixelRatio,g=e.getRevision(),d=e.getRenderBuffer();let m=e.getRenderOrder();m===void 0&&(m=ey);const p=l.center.slice(),_=il(u,d*h),y=_.slice(),v=[_.slice()],C=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!Ds(C,t.extent)){const M=Nn(C),B=Math.max(Nn(_)/2,M);_[0]=C[0]-B,_[2]=C[2]+B,ip(p,c);const U=jc(v[0],c);U[0]<C[0]&&U[2]<C[2]?v.push([U[0]+M,U[1],U[2]+M,U[3]]):U[0]>C[0]&&U[2]>C[2]&&v.push([U[0]-M,U[1],U[2]-M,U[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==g&&this.renderedRenderOrder_==m&&Ds(this.wrappedRenderedExtent_,_))return bs(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=p,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const x=new _f(kl(h,f),_,h,f);let b;this.getLayer().getDeclutter()&&(b=new _f(kl(h,f),_,h,f));let R;for(let M=0,B=v.length;M<B;++M)n.loadFeatures(v[M],h,c);const T=ny(h,f);let w=!0;const O=M=>{let B;const U=M.getStyleFunction()||e.getStyleFunction();if(U&&(B=U(M,h)),B){const J=this.renderFeature(M,T,B,x,R,b);w=w&&!J}},z=eh(_),F=n.getFeaturesInExtent(z);m&&F.sort(m);for(let M=0,B=F.length;M<B;++M)O(F[M]);this.renderedFeatures_=F,this.ready=w;const Y=x.finish(),L=new Cf(_,h,f,n.getOverlaps(),Y,e.getRenderBuffer());return b&&(this.declutterExecutorGroup=new Cf(_,h,f,n.getOverlaps(),b.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=g,this.renderedRenderOrder_=m,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=p,this.renderedProjection_=c,this.replayGroup_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,n,r,s,o){if(!n)return!1;let a=!1;if(Array.isArray(n))for(let u=0,l=n.length;u<l;++u)a=If(r,t,n[u],e,this.boundHandleStyleImageChange_,s,o)||a;else a=If(r,t,n,e,this.boundHandleStyleImageChange_,s,o);return a}}class gy extends k_{constructor(t){super(t)}createRenderer(){return new fy(this)}}class wf{constructor(t){this.rbush_=new lf(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[de(e)]=n}load(t,e){const n=new Array(e.length);for(let r=0,s=e.length;r<s;r++){const o=t[r],a=e[r],u={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};n[r]=u,this.items_[de(a)]=u}this.rbush_.load(n)}remove(t){const e=de(t),n=this.items_[e];return delete this.items_[e],this.rbush_.remove(n)!==null}update(t,e){const n=this.items_[de(e)],r=[n.minX,n.minY,n.maxX,n.maxY];Xc(r,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(r){return r.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let r=0,s=t.length;r<s;r++)if(n=e(t[r]),n)return n;return n}isEmpty(){return So(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return Wr(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}class dy extends ar{constructor(t){super(),this.projection=Fs(t.projection),this.attributions_=Lf(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(n,r){e.viewResolver=n,e.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Lf(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Lf(i){return i?Array.isArray(i)?function(t){return i}:typeof i=="function"?i:function(t){return[i]}:null}const ri={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function py(i,t){return[[-1/0,-1/0,1/0,1/0]]}let my=!1;function _y(i,t,e,n,r,s,o){const a=new XMLHttpRequest;a.open("GET",typeof i=="function"?i(e,n,r):i,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=my,a.onload=function(u){if(!a.status||a.status>=200&&a.status<300){const l=t.getType();let c;l=="json"||l=="text"?c=a.responseText:l=="xml"?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):l=="arraybuffer"&&(c=a.response),c?s(t.readFeatures(c,{extent:e,featureProjection:r}),t.readProjection(c)):o()}else o()},a.onerror=o,a.send()}function Nf(i,t){return function(e,n,r,s,o){const a=this;_y(i,t,e,n,r,function(u,l){a.addFeatures(u),s!==void 0&&s(u)},o||Ts)}}class vr extends st{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class yy extends dy{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ts,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(ue(this.format_,7),this.loader_=Nf(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:py;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new wf:null,this.loadedExtentsRtree_=new wf,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(t.features)?r=t.features:t.features&&(n=t.features,r=n.getArray()),!e&&n===void 0&&(n=new gp(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=de(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new vr(ri.ADDFEATURE,t))}setupChangeEvents_(t,e){this.featureChangeKeys_[t]=[Qn(e,Ln.CHANGE,this.handleFeatureChange_,this),Qn(e,ae.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(t,e){let n=!0;const r=e.getId();return r!==void 0&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(ue(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],r=[];for(let s=0,o=t.length;s<o;s++){const a=t[s],u=de(a);this.addToIndex_(u,a)&&n.push(a)}for(let s=0,o=n.length;s<o;s++){const a=n[s],u=de(a);this.setupChangeEvents_(u,a);const l=a.getGeometry();if(l){const c=l.getExtent();e.push(c),r.push(a)}else this.nullGeometryFeatures_[u]=a}if(this.featuresRtree_&&this.featuresRtree_.load(e,r),this.hasListener(ri.ADDFEATURE))for(let s=0,o=n.length;s<o;s++)this.dispatchEvent(new vr(ri.ADDFEATURE,n[s]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(ri.ADDFEATURE,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(ri.REMOVEFEATURE,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(ks.ADD,n=>{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(ks.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach($n);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const n=r=>{this.removeFeatureInternal(r)};this.featuresRtree_.forEach(n);for(const r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new vr(ri.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(r){if(r.getGeometry().intersectsCoordinate(t))return e(r)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){if(n.getGeometry().intersectsExtent(t)){const s=e(n);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),So(this.nullGeometryFeatures_)||Gi(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const r=Jd(t,e);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],r=t[1];let s=null;const o=[NaN,NaN];let a=1/0;const u=[-1/0,-1/0,1/0,1/0];return e=e||vd,this.featuresRtree_.forEachInExtent(u,function(l){if(e(l)){const c=l.getGeometry(),h=a;if(a=c.closestPointXY(n,r,o,a),a<h){s=l;const f=Math.sqrt(a);u[0]=n-f,u[1]=r-f,u[2]=n+f,u[3]=r+f}}}),s}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=de(e),r=e.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);else{const o=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}const s=e.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new vr(ri.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:de(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&So(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,n){const r=this.loadedExtentsRtree_,s=this.strategy_(t,e,n);for(let o=0,a=s.length;o<a;++o){const u=s[o];r.forEachInExtent(u,function(c){return Ds(c.extent,u)})||(++this.loadingExtentsCount_,this.dispatchEvent(new vr(ri.FEATURESLOADSTART)),this.loader_.call(this,u,e,n,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new vr(ri.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new vr(ri.FEATURESLOADERROR))}),r.insert(u,{extent:u.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let n;e.forEachInExtent(t,function(r){if(Xc(r.extent,t))return n=r,!0}),n&&e.remove(n)}removeFeature(t){if(!t)return;const e=de(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=de(t),n=this.featureChangeKeys_[e];if(!n)return;n.forEach($n),delete this.featureChangeKeys_[e];const r=t.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new vr(ri.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e}setLoader(t){this.loader_=t}setUrl(t){ue(this.format_,7),this.url_=t,this.setLoader(Nf(t,this.format_))}}let vy=class Lc extends dh{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach($n),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Qn(this.geometries_[t],Ln.CHANGE,this.changed,this))}clone(){const t=new Lc(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,n,r){if(r<Ur(this.getExtent(),t,e))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(t,e,n,r);return r}containsXY(t,e){const n=this.geometries_;for(let r=0,s=n.length;r<s;++r)if(n[r].containsXY(t,e))return!0;return!1}computeExtent(t){ka(t);const e=this.geometries_;for(let n=0,r=e.length;n<r;++n)Xd(t,e[n].getExtent());return t}getGeometries(){return Rf(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let n=0,r=e.length;n<r;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],n=this.geometries_;let r=!1;for(let s=0,o=n.length;s<o;++s){const a=n[s],u=a.getSimplifiedGeometry(t);e.push(u),u!==a&&(r=!0)}if(r){const s=new Lc(null);return s.setGeometriesArray(e),s}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let n=0,r=e.length;n<r;++n)if(e[n].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const n=this.geometries_;for(let r=0,s=n.length;r<s;++r)n[r].rotate(t,e);this.changed()}scale(t,e,n){n||(n=As(this.getExtent()));const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)r[s].scale(t,e,n);this.changed()}setGeometries(t){this.setGeometriesArray(Rf(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let n=0,r=e.length;n<r;++n)e[n].applyTransform(t);this.changed()}translate(t,e){const n=this.geometries_;for(let r=0,s=n.length;r<s;++r)n[r].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function Rf(i){const t=[];for(let e=0,n=i.length;e<n;++e)t.push(i[e].clone());return t}let bf=class Nc extends jr{constructor(t,e,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&n)this.setFlatCoordinates(e,t),this.ends_=n;else{let r=this.getLayout();const s=t,o=[],a=[];for(let u=0,l=s.length;u<l;++u){const c=s[u];u===0&&(r=c.getLayout()),Gi(o,c.getFlatCoordinates()),a.push(o.length)}this.setFlatCoordinates(r,o),this.ends_=a}}appendLineString(t){this.flatCoordinates?Gi(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Nc(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,r){return r<Ur(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(gl(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),pl(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))}getCoordinateAtM(t,e,n){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,n=n!==void 0?n:!1,C_(this.flatCoordinates,0,this.ends_,this.stride,t,e,n))}getCoordinates(){return Mo(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new eu(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,n=this.layout,r=[];let s=0;for(let o=0,a=e.length;o<a;++o){const u=e[o],l=new eu(t.slice(s,u),n);r.push(l),s=u}return r}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let n=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const u=r[o],l=sf(e,n,u,s,.5);Gi(t,l),n=u}return t}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Wp(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,n),new Nc(e,"XY",n)}getType(){return"MultiLineString"}intersectsExtent(t){return Qp(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=ml(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},Ey=class md extends jr{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?Gi(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){const t=new md(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,r){if(r<Ur(this.getExtent(),t,e))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,u=s.length;a<u;a+=o){const l=qr(t,e,s[a],s[a+1]);if(l<r){r=l;for(let c=0;c<o;++c)n[c]=s[a+c];n.length=o}}return r}getCoordinates(){return hr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Gs(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,n=this.stride,r=[];for(let s=0,o=t.length;s<o;s+=n){const a=new Gs(t.slice(s,s+n),e);r.push(a)}return r}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,n=this.stride;for(let r=0,s=e.length;r<s;r+=n){const o=e[r],a=e[r+1];if(rl(t,o,a))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ua(this.flatCoordinates,0,t,this.stride),this.changed()}};function Cy(i,t,e,n){const r=[];let s=Yr();for(let o=0,a=e.length;o<a;++o){const u=e[o];s=Vc(i,t,u[0],n),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=u[u.length-1]}return r}let Tf=class Rc extends jr{constructor(t,e,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(t[0])){let r=this.getLayout();const s=t,o=[],a=[];for(let u=0,l=s.length;u<l;++u){const c=s[u];u===0&&(r=c.getLayout());const h=o.length,f=c.getEnds();for(let g=0,d=f.length;g<d;++g)f[g]+=h;Gi(o,c.getFlatCoordinates()),a.push(f)}e=r,t=o,n=a}e!==void 0&&n?(this.setFlatCoordinates(e,t),this.endss_=n):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const n=this.flatCoordinates.length;Gi(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let r=0,s=e.length;r<s;++r)e[r]+=n}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let r=0;r<t;++r)e[r]=this.endss_[r].slice();const n=new Rc(this.flatCoordinates.slice(),this.layout,e);return n.applyProperties(this),n}closestPointXY(t,e,n,r){return r<Ur(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Vp(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Xp(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))}containsXY(t,e){return Kp(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return jp(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Lh(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,yl(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Cy(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Jp(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Ey(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;nm(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Lh(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Hp(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,n),new Rc(e,"XY",n)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const s=this.endss_[t-1];e=s[s.length-1]}const n=this.endss_[t].slice(),r=n[n.length-1];if(e!==0)for(let s=0,o=n.length;s<o;++s)n[s]-=e;return new Po(this.flatCoordinates.slice(e,r),this.layout,n)}getPolygons(){const t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[];let s=0;for(let o=0,a=n.length;o<a;++o){const u=n[o].slice(),l=u[u.length-1];if(s!==0)for(let h=0,f=u.length;h<f;++h)u[h]-=s;const c=new Po(e.slice(s,l),t,u);r.push(c),s=l}return r}getType(){return"MultiPolygon"}intersectsExtent(t){return tm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const n=Yp(this.flatCoordinates,0,t,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{const r=n[n.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}};var Ue=63710088e-1,Mf={centimeters:Ue*100,centimetres:Ue*100,degrees:Ue/111325,feet:Ue*3.28084,inches:Ue*39.37,kilometers:Ue/1e3,kilometres:Ue/1e3,meters:Ue,metres:Ue,miles:Ue/1609.344,millimeters:Ue*1e3,millimetres:Ue*1e3,nauticalmiles:Ue/1852,radians:1,yards:Ue*1.0936};function cu(i,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=i,n}function xy(i,t,e){if(e===void 0&&(e={}),!i)throw new Error("coordinates is required");if(!Array.isArray(i))throw new Error("coordinates must be an Array");if(i.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pf(i[0])||!Pf(i[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:i};return cu(n,t,e)}function Iy(i,t,e){e===void 0&&(e={});for(var n=0,r=i;n<r.length;n++){var s=r[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:i};return cu(a,t,e)}function Gl(i,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=i,e}function Sy(i,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:i};return cu(n,t,e)}function wy(i,t){var e=Mf[t];return i*e}function Ly(i,t){t===void 0&&(t="kilometers");var e=Mf[t];if(!e)throw new Error(t+" units is invalid");return i/e}function Pf(i){return!isNaN(i)&&i!==null&&!Array.isArray(i)}function Of(i,t,e){if(i!==null)for(var n,r,s,o,a,u,l,c=0,h=0,f,g=i.type,d=g==="FeatureCollection",m=g==="Feature",p=d?i.features.length:1,_=0;_<p;_++){l=d?i.features[_].geometry:m?i.geometry:i,f=l?l.type==="GeometryCollection":!1,a=f?l.geometries.length:1;for(var y=0;y<a;y++){var v=0,C=0;if(o=f?l.geometries[y]:l,o!==null){u=o.coordinates;var x=o.type;switch(c=0,x){case null:break;case"Point":if(t(u,h,_,v,C)===!1)return!1;h++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],h,_,v,C)===!1)return!1;h++,x==="MultiPoint"&&v++}x==="LineString"&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(r=0;r<u[n].length-c;r++){if(t(u[n][r],h,_,v,C)===!1)return!1;h++}x==="MultiLineString"&&v++,x==="Polygon"&&C++}x==="Polygon"&&v++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(C=0,r=0;r<u[n].length;r++){for(s=0;s<u[n][r].length-c;s++){if(t(u[n][r][s],h,_,v,C)===!1)return!1;h++}C++}v++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(Of(o.geometries[n],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Df(i,t){if(i.type==="Feature")t(i,0);else if(i.type==="FeatureCollection")for(var e=0;e<i.features.length&&t(i.features[e],e)!==!1;e++);}function Af(i,t){var e,n,r,s,o,a,u,l,c,h,f=0,g=i.type==="FeatureCollection",d=i.type==="Feature",m=g?i.features.length:1;for(e=0;e<m;e++){for(a=g?i.features[e].geometry:d?i.geometry:i,l=g?i.features[e].properties:d?i.properties:{},c=g?i.features[e].bbox:d?i.bbox:void 0,h=g?i.features[e].id:d?i.id:void 0,u=a?a.type==="GeometryCollection":!1,o=u?a.geometries.length:1,r=0;r<o;r++){if(s=u?a.geometries[r]:a,s===null){if(t(null,f,l,c,h)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,f,l,c,h)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],f,l,c,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Bl(i){var t=[1/0,1/0,-1/0,-1/0];return Of(i,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Bl.default=Bl;function Ny(i,t){t===void 0&&(t={});var e=Bl(i),n=(e[0]+e[2])/2,r=(e[1]+e[3])/2;return xy([n,r],t.properties,t)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);r<s;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(i){return typeof i=="number"&&isFinite(i)},Number.isInteger=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(i){return i!==i},Math.trunc=Math.trunc||function(i){return i<0?Math.ceil(i):Math.floor(i)};var ss=function(){};ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss},ss.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var St=function(i){function t(e){i.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new i().stack}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t}(Error),j=function(){},Ff={MAX_VALUE:{configurable:!0}};j.isNaN=function(t){return Number.isNaN(t)},j.doubleToLongBits=function(t){return t},j.longBitsToDouble=function(t){return t},j.isInfinite=function(t){return!Number.isFinite(t)},Ff.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(j,Ff);var en=function(){},hu=function(){},Zs=function(){};function nn(){}var E=function i(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=i.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=i.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},os={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};E.prototype.setOrdinate=function(t,e){switch(t){case E.X:this.x=e;break;case E.Y:this.y=e;break;case E.Z:this.z=e;break;default:throw new St("Invalid ordinate index: "+t)}},E.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!ss.equalsWithTolerance(this.x,e.x,n)||!ss.equalsWithTolerance(this.y,e.y,n))}},E.prototype.getOrdinate=function(t){switch(t){case E.X:return this.x;case E.Y:return this.y;case E.Z:return this.z}throw new St("Invalid ordinate index: "+t)},E.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||j.isNaN(this.z))&&j.isNaN(t.z)},E.prototype.equals=function(t){return t instanceof E?this.equals2D(t):!1},E.prototype.equalInZ=function(t,e){return ss.equalsWithTolerance(this.z,t.z,e)},E.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},E.prototype.clone=function(){},E.prototype.copy=function(){return new E(this)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},E.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},E.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},E.prototype.hashCode=function(){var t=17;return t=37*t+E.hashCode(this.x),t=37*t+E.hashCode(this.y),t},E.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},E.prototype.interfaces_=function(){return[en,hu,nn]},E.prototype.getClass=function(){return E},E.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=j.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},os.DimensionalComparator.get=function(){return Hi},os.serialVersionUID.get=function(){return 6683108902428367e3},os.NULL_ORDINATE.get=function(){return j.NaN},os.X.get=function(){return 0},os.Y.get=function(){return 1},os.Z.get=function(){return 2},Object.defineProperties(E,os);var Hi=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new St("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};Hi.prototype.compare=function(t,e){var n=t,r=e,s=Hi.compare(n.x,r.x);if(s!==0)return s;var o=Hi.compare(n.y,r.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Hi.compare(n.z,r.z);return a},Hi.prototype.interfaces_=function(){return[Zs]},Hi.prototype.getClass=function(){return Hi},Hi.compare=function(t,e){return t<e?-1:t>e?1:j.isNaN(t)?j.isNaN(e)?0:-1:j.isNaN(e)?1:0};var Ks=function(){};Ks.prototype.create=function(){},Ks.prototype.interfaces_=function(){return[]},Ks.prototype.getClass=function(){return Ks};var I=function(){},Ko={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};I.prototype.interfaces_=function(){return[]},I.prototype.getClass=function(){return I},I.toLocationSymbol=function(t){switch(t){case I.EXTERIOR:return"e";case I.BOUNDARY:return"b";case I.INTERIOR:return"i";case I.NONE:return"-"}throw new St("Unknown location value: "+t)},Ko.INTERIOR.get=function(){return 0},Ko.BOUNDARY.get=function(){return 1},Ko.EXTERIOR.get=function(){return 2},Ko.NONE.get=function(){return-1},Object.defineProperties(I,Ko);var q=function(i,t){return i.interfaces_&&i.interfaces_().indexOf(t)>-1},Ye=function(){},kf={LOG_10:{configurable:!0}};Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.log10=function(t){var e=Math.log(t);return j.isInfinite(e)||j.isNaN(e)?e:e/Ye.LOG_10},Ye.min=function(t,e,n,r){var s=t;return e<s&&(s=e),n<s&&(s=n),r<s&&(s=r),s},Ye.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],s=arguments[1],o=arguments[2];return r<s?s:r>o?o:r}},Ye.wrap=function(t,e){return t<0?e- -t%e:t%e},Ye.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},Ye.average=function(t,e){return(t+e)/2},kf.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ye,kf);var bn=function(t){this.str=t};bn.prototype.append=function(t){this.str+=t},bn.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},bn.prototype.toString=function(t){return this.str};var Tn=function(t){this.value=t};Tn.prototype.intValue=function(){return this.value},Tn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Tn.isNaN=function(t){return Number.isNaN(t)};var Jo=function(){};Jo.isWhitespace=function(t){return t<=32&&t>=0||t===127},Jo.toUpperCase=function(t){return t.toUpperCase()};var S=function i(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof i){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];i.call(this,i.parse(n))}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.init(r,s)}},dn={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};S.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},S.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=S.magnitude(n._hi),s=S.TEN.pow(r);n=n.divide(s),n.gt(S.TEN)?(n=n.divide(S.TEN),r+=1):n.lt(S.ONE)&&(n=n.multiply(S.TEN),r-=1);for(var o=r+1,a=new bn,u=S.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===o&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var h=!1,f=0;c>9?(h=!0,f="9"):f="0"+c,a.append(f),n=n.subtract(S.valueOf(c)).multiply(S.TEN),h&&n.selfAdd(S.TEN);var g=!0,d=S.magnitude(n._hi);if(d<0&&Math.abs(d)>=u-l&&(g=!1),!g)break}return e[0]=r,a.toString()},S.prototype.sqr=function(){return this.multiply(this)},S.prototype.doubleValue=function(){return this._hi+this._lo},S.prototype.subtract=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},S.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},S.prototype.isZero=function(){return this._hi===0&&this._lo===0},S.prototype.selfSubtract=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},S.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},S.prototype.min=function(t){return this.le(t)?this:t},S.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/n,c=S.SPLIT*l,s=c-l,f=S.SPLIT*n,s=c-s,o=l-s,a=f-n,h=l*n,a=f-a,u=n-a,f=s*a-h+s*u+o*a+o*u,c=(this._hi-h-f+this._lo-l*r)/n,f=l+c,this._hi=f,this._lo=l-f+c,this}},S.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},S.prototype.divide=function(){if(arguments[0]instanceof S){var t=arguments[0],e=null,n=null,r=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/t._hi,a=S.SPLIT*o,e=a-o,l=S.SPLIT*t._hi,e=a-e,n=o-e,r=l-t._hi,u=o*t._hi,r=l-r,s=t._hi-r,l=e*r-u+e*s+n*r+n*s,a=(this._hi-u-l+this._lo-o*t._lo)/t._hi,l=o+a;var c=l,h=o-l+a;return new S(c,h)}else if(typeof arguments[0]=="number"){var f=arguments[0];return j.isNaN(f)?S.createNaN():S.copy(this).selfDivide(f,0)}},S.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},S.prototype.pow=function(t){if(t===0)return S.valueOf(1);var e=new S(this),n=S.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(e),r/=2,r>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},S.prototype.ceil=function(){if(this.isNaN())return S.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new S(t,e)},S.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},S.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},S.prototype.setValue=function(){if(arguments[0]instanceof S){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},S.prototype.max=function(t){return this.ge(t)?this:t},S.prototype.sqrt=function(){if(this.isZero())return S.valueOf(0);if(this.isNegative())return S.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=S.valueOf(e),r=this.subtract(n.sqr()),s=r._hi*(t*.5);return n.add(s)},S.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,r=null,s=null,o=null,a=null,u=null;return s=this._hi+e,a=s-this._hi,o=s-a,o=e-a+(this._hi-o),u=o+this._lo,n=s+u,r=u+(s-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],h=null,f=null,g=null,d=null,m=null,p=null,_=null,y=null;m=this._hi+l,g=this._lo+c,_=m-this._hi,y=g-this._lo,p=m-_,d=g-y,p=l-_+(this._hi-p),d=c-y+(this._lo-d),_=p+g,h=m+_,f=_+(m-h),_=d+f;var v=h+_,C=_+(h-v);return this._hi=v,this._lo=C,this}},S.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof S){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null;l=S.SPLIT*this._hi,s=l-this._hi,c=S.SPLIT*n,s=l-s,o=this._hi-s,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=s*a-l+s*u+o*a+o*u+(this._hi*r+this._lo*n);var h=l+c;s=l-h;var f=c+s;return this._hi=h,this._lo=f,this}},S.prototype.selfSqr=function(){return this.selfMultiply(this)},S.prototype.floor=function(){if(this.isNaN())return S.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new S(t,e)},S.prototype.negate=function(){return this.isNaN()?this:new S(-this._hi,-this._lo)},S.prototype.clone=function(){},S.prototype.multiply=function(){if(arguments[0]instanceof S){var t=arguments[0];return t.isNaN()?S.createNaN():S.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return j.isNaN(e)?S.createNaN():S.copy(this).selfMultiply(e,0)}},S.prototype.isNaN=function(){return j.isNaN(this._hi)},S.prototype.intValue=function(){return Math.trunc(this._hi)},S.prototype.toString=function(){var t=S.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},S.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(r<0)s="0."+S.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var o=r-n.length,a=S.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},S.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=S.SPLIT*s,t=o-s,u=S.SPLIT*this._hi,t=o-t,e=s-t,n=u-this._hi,a=s*this._hi,n=u-n,r=this._hi-n,u=t*n-a+t*r+e*n+e*r,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,c=s-l+o;return new S(l,c)},S.prototype.toSciNotation=function(){if(this.isZero())return S.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=S.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+r:o+r},S.prototype.abs=function(){return this.isNaN()?S.NaN:this.isNegative()?this.negate():new S(this)},S.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},S.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},S.prototype.add=function(){if(arguments[0]instanceof S){var t=arguments[0];return S.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return S.copy(this).selfAdd(e)}},S.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof S){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},S.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},S.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},S.prototype.trunc=function(){return this.isNaN()?S.NaN:this.isPositive()?this.floor():this.ceil()},S.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},S.prototype.interfaces_=function(){return[nn,en,hu]},S.prototype.getClass=function(){return S},S.sqr=function(t){return S.valueOf(t).selfMultiply(t)},S.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return S.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new S(e)}},S.sqrt=function(t){return S.valueOf(t).sqrt()},S.parse=function(t){for(var e=0,n=t.length;Jo.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var s=t.charAt(e);(s==="-"||s==="+")&&(e++,s==="-"&&(r=!0))}for(var o=new S,a=0,u=0,l=0;!(e>=n);){var c=t.charAt(e);if(e++,Jo.isDigit(c)){var h=c-"0";o.selfMultiply(S.TEN),o.selfAdd(h),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var f=t.substring(e);try{l=Tn.parseInt(f)}catch(_){throw _ instanceof Error?new Error("Invalid exponent "+f+" in string "+t):_}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=o,d=a-u-l;if(d===0)g=o;else if(d>0){var m=S.TEN.pow(d);g=o.divide(m)}else if(d<0){var p=S.TEN.pow(-d);g=o.multiply(p)}return r?g.negate():g},S.createNaN=function(){return new S(j.NaN,j.NaN)},S.copy=function(t){return new S(t)},S.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n)),s=Math.pow(10,r);return s*10<=e&&(r+=1),r},S.stringOfChar=function(t,e){for(var n=new bn,r=0;r<e;r++)n.append(t);return n.toString()},dn.PI.get=function(){return new S(3.141592653589793,12246467991473532e-32)},dn.TWO_PI.get=function(){return new S(6.283185307179586,24492935982947064e-32)},dn.PI_2.get=function(){return new S(1.5707963267948966,6123233995736766e-32)},dn.E.get=function(){return new S(2.718281828459045,14456468917292502e-32)},dn.NaN.get=function(){return new S(j.NaN,j.NaN)},dn.EPS.get=function(){return 123259516440783e-46},dn.SPLIT.get=function(){return 134217729},dn.MAX_PRINT_DIGITS.get=function(){return 32},dn.TEN.get=function(){return S.valueOf(10)},dn.ONE.get=function(){return S.valueOf(1)},dn.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},dn.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(S,dn);var Ne=function(){},Gf={DP_SAFE_EPSILON:{configurable:!0}};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.orientationIndex=function(t,e,n){var r=Ne.orientationIndexFilter(t,e,n);if(r<=1)return r;var s=S.valueOf(e.x).selfAdd(-t.x),o=S.valueOf(e.y).selfAdd(-t.y),a=S.valueOf(n.x).selfAdd(-e.x),u=S.valueOf(n.y).selfAdd(-e.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},Ne.signOfDet2x2=function(t,e,n,r){var s=t.multiply(r).selfSubtract(e.multiply(n));return s.signum()},Ne.intersection=function(t,e,n,r){var s=S.valueOf(r.y).selfSubtract(n.y).selfMultiply(S.valueOf(e.x).selfSubtract(t.x)),o=S.valueOf(r.x).selfSubtract(n.x).selfMultiply(S.valueOf(e.y).selfSubtract(t.y)),a=s.subtract(o),u=S.valueOf(r.x).selfSubtract(n.x).selfMultiply(S.valueOf(t.y).selfSubtract(n.y)),l=S.valueOf(r.y).selfSubtract(n.y).selfMultiply(S.valueOf(t.x).selfSubtract(n.x)),c=u.subtract(l),h=c.selfDivide(a).doubleValue(),f=S.valueOf(t.x).selfAdd(S.valueOf(e.x).selfSubtract(t.x).selfMultiply(h)).doubleValue(),g=S.valueOf(e.x).selfSubtract(t.x).selfMultiply(S.valueOf(t.y).selfSubtract(n.y)),d=S.valueOf(e.y).selfSubtract(t.y).selfMultiply(S.valueOf(t.x).selfSubtract(n.x)),m=g.subtract(d),p=m.selfDivide(a).doubleValue(),_=S.valueOf(n.y).selfAdd(S.valueOf(r.y).selfSubtract(n.y).selfMultiply(p)).doubleValue();return new E(f,_)},Ne.orientationIndexFilter=function(t,e,n){var r=null,s=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=s-o;if(s>0){if(o<=0)return Ne.signum(a);r=s+o}else if(s<0){if(o>=0)return Ne.signum(a);r=-s-o}else return Ne.signum(a);var u=Ne.DP_SAFE_EPSILON*r;return a>=u||-a>=u?Ne.signum(a):2},Ne.signum=function(t){return t>0?1:t<0?-1:0},Gf.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ne,Gf);var it=function(){},Qo={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Qo.X.get=function(){return 0},Qo.Y.get=function(){return 1},Qo.Z.get=function(){return 2},Qo.M.get=function(){return 3},it.prototype.setOrdinate=function(t,e,n){},it.prototype.size=function(){},it.prototype.getOrdinate=function(t,e){},it.prototype.getCoordinate=function(){},it.prototype.getCoordinateCopy=function(t){},it.prototype.getDimension=function(){},it.prototype.getX=function(t){},it.prototype.clone=function(){},it.prototype.expandEnvelope=function(t){},it.prototype.copy=function(){},it.prototype.getY=function(t){},it.prototype.toCoordinateArray=function(){},it.prototype.interfaces_=function(){return[hu]},it.prototype.getClass=function(){return it},Object.defineProperties(it,Qo);var Bf=function(){},Js=function(i){function t(){i.call(this,"Projective point not representable on the Cartesian plane.")}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Bf),te=function(){};te.arraycopy=function(t,e,n,r,s){for(var o=0,a=e;a<e+s;a++)n[r+o]=t[a],o++},te.getProperty=function(t){return{"line.separator":`