yio-map 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,249 @@
1
+ var YioMap=(function(){"use strict";var ZC=Object.defineProperty;var nm=be=>{throw TypeError(be)};var qC=(be,Ie,Ye)=>Ie in be?ZC(be,Ie,{enumerable:!0,configurable:!0,writable:!0,value:Ye}):be[Ie]=Ye;var Gt=(be,Ie,Ye)=>qC(be,typeof Ie!="symbol"?Ie+"":Ie,Ye),hd=(be,Ie,Ye)=>Ie.has(be)||nm("Cannot "+Ye);var M=(be,Ie,Ye)=>(hd(be,Ie,"read from private field"),Ye?Ye.call(be):Ie.get(be)),ae=(be,Ie,Ye)=>Ie.has(be)?nm("Cannot add the same private member more than once"):Ie instanceof WeakSet?Ie.add(be):Ie.set(be,Ye),pe=(be,Ie,Ye,Ls)=>(hd(be,Ie,"write to private field"),Ls?Ls.call(be,Ye):Ie.set(be,Ye),Ye),le=(be,Ie,Ye)=>(hd(be,Ie,"access private method"),Ye);/**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */var im,mi,zn,Ps,sm,om,Pr,ni,yi,Di,jn,Mr,_i,am,Ji,$i,lm,cm,en,ud,Ms,Fr,Lr,dd,hm,Yo,Fs,de,fd,um,Ql,dm,fm,gm,pm,Am,mm,ym,_m,xm,Em,wm,vm,st,Ko,kr,tn,Dr,Un,ri,Zo,qo,Or,Gr,Vn,Wn,Br,nn,Ct,Cm,gd,pd,bm,ql,Ad;const be=globalThis,Ie=be.ShadowRoot&&(be.ShadyCSS===void 0||be.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ye=Symbol(),Ls=new WeakMap;let md=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Ye)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Ie&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Ls.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ls.set(t,e))}return e}toString(){return this.cssText}};const Qo=n=>new md(typeof n=="string"?n:n+"",void 0,Ye),yd=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new md(t,n,Ye)},Tm=(n,e)=>{if(Ie)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=be.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},_d=Ie?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Qo(t)})(n):n;/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const{is:Rm,defineProperty:Sm,getOwnPropertyDescriptor:Im,getOwnPropertyNames:Pm,getOwnPropertySymbols:Mm,getPrototypeOf:Fm}=Object,cn=globalThis,xd=cn.trustedTypes,Lm=xd?xd.emptyScript:"",Jl=cn.reactiveElementPolyfillSupport,ks=(n,e)=>n,$l={toAttribute(n,e){switch(e){case Boolean:n=n?Lm:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Ed=(n,e)=>!Rm(n,e),wd={attribute:!0,type:String,converter:$l,reflect:!1,useDefault:!1,hasChanged:Ed};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),cn.litPropertyMetadata??(cn.litPropertyMetadata=new WeakMap);let Nr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=wd){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&Sm(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:s}=Im(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:r,set(o){const a=r==null?void 0:r.call(this);s==null||s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??wd}static _$Ei(){if(this.hasOwnProperty(ks("elementProperties")))return;const e=Fm(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ks("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ks("properties"))){const t=this.properties,i=[...Pm(t),...Mm(t)];for(const r of i)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(_d(r))}else e!==void 0&&t.push(_d(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Tm(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var s;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:$l).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var s,o;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const a=i.getPropertyOptions(r),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)==null?void 0:s.fromAttribute)!==void 0?a.converter:$l;this._$Em=r;const c=l.fromAttribute(t,a.type);this[r]=c??((o=this._$Ej)==null?void 0:o.get(r))??c,this._$Em=null}}requestUpdate(e,t,i,r=!1,s){var o;if(e!==void 0){const a=this.constructor;if(r===!1&&(s=this[e]),i??(i=a.getPropertyOptions(e)),!((i.hasChanged??Ed)(s,t)||i.useDefault&&i.reflect&&s===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(a._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:r,wrapped:s},o){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,o]of r){const{wrapped:a}=o,l=this[s];a!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,o,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(r=>{var s;return(s=r.hostUpdate)==null?void 0:s.call(r)}),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Nr.elementStyles=[],Nr.shadowRootOptions={mode:"open"},Nr[ks("elementProperties")]=new Map,Nr[ks("finalized")]=new Map,Jl==null||Jl({ReactiveElement:Nr}),(cn.reactiveElementVersions??(cn.reactiveElementVersions=[])).push("2.1.2");/**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const Ds=globalThis,vd=n=>n,Jo=Ds.trustedTypes,Cd=Jo?Jo.createPolicy("lit-html",{createHTML:n=>n}):void 0,bd="$lit$",hn=`lit$${Math.random().toFixed(9).slice(2)}$`,Td="?"+hn,km=`<${Td}>`,Xn=document,Os=()=>Xn.createComment(""),Gs=n=>n===null||typeof n!="object"&&typeof n!="function",ec=Array.isArray,Dm=n=>ec(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",tc=`[
14
+ \f\r]`,Bs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rd=/-->/g,Sd=/>/g,Yn=RegExp(`>|${tc}(?:([^\\s"'>=/]+)(${tc}*=${tc}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Id=/'/g,Pd=/"/g,Md=/^(?:script|style|textarea|title)$/i,Om=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Bt=Om(1),zr=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),Fd=new WeakMap,Kn=Xn.createTreeWalker(Xn,129);function Ld(n,e){if(!ec(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Cd!==void 0?Cd.createHTML(e):e}const Gm=(n,e)=>{const t=n.length-1,i=[];let r,s=e===2?"<svg>":e===3?"<math>":"",o=Bs;for(let a=0;a<t;a++){const l=n[a];let c,h,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,h=o.exec(l),h!==null);)d=o.lastIndex,o===Bs?h[1]==="!--"?o=Rd:h[1]!==void 0?o=Sd:h[2]!==void 0?(Md.test(h[2])&&(r=RegExp("</"+h[2],"g")),o=Yn):h[3]!==void 0&&(o=Yn):o===Yn?h[0]===">"?(o=r??Bs,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?Yn:h[3]==='"'?Pd:Id):o===Pd||o===Id?o=Yn:o===Rd||o===Sd?o=Bs:(o=Yn,r=void 0);const g=o===Yn&&n[a+1].startsWith("/>")?" ":"";s+=o===Bs?l+km:u>=0?(i.push(c),l.slice(0,u)+bd+l.slice(u)+hn+g):l+hn+(u===-2?a:g)}return[Ld(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Ns{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0;const a=e.length-1,l=this.parts,[c,h]=Gm(e,t);if(this.el=Ns.createElement(c,i),Kn.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Kn.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const u of r.getAttributeNames())if(u.endsWith(bd)){const d=h[o++],g=r.getAttribute(u).split(hn),f=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:f[2],strings:g,ctor:f[1]==="."?Nm:f[1]==="?"?zm:f[1]==="@"?jm:$o}),r.removeAttribute(u)}else u.startsWith(hn)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Md.test(r.tagName)){const u=r.textContent.split(hn),d=u.length-1;if(d>0){r.textContent=Jo?Jo.emptyScript:"";for(let g=0;g<d;g++)r.append(u[g],Os()),Kn.nextNode(),l.push({type:2,index:++s});r.append(u[d],Os())}}}else if(r.nodeType===8)if(r.data===Td)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(hn,u+1))!==-1;)l.push({type:7,index:s}),u+=hn.length-1}s++}}static createElement(e,t){const i=Xn.createElement("template");return i.innerHTML=e,i}}function jr(n,e,t=n,i){var o,a;if(e===zr)return e;let r=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const s=Gs(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=jr(n,r._$AS(n,e.values),r,i)),e}let Bm=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??Xn).importNode(t,!0);Kn.currentNode=r;let s=Kn.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new zs(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new Um(s,this,e)),this._$AV.push(c),l=i[++a]}o!==(l==null?void 0:l.index)&&(s=Kn.nextNode(),o++)}return Kn.currentNode=Xn,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}};class zs{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=lt,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=jr(this,e,t),Gs(e)?e===lt||e==null||e===""?(this._$AH!==lt&&this._$AR(),this._$AH=lt):e!==this._$AH&&e!==zr&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Dm(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==lt&&Gs(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xn.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ns.createElement(Ld(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(t);else{const o=new Bm(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Fd.get(e.strings);return t===void 0&&Fd.set(e.strings,t=new Ns(e)),t}k(e){ec(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new zs(this.O(Os()),this.O(Os()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const r=vd(e).nextSibling;vd(e).remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class $o{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=lt,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=lt}_$AI(e,t=this,i,r){const s=this.strings;let o=!1;if(s===void 0)e=jr(this,e,t,0),o=!Gs(e)||e!==this._$AH&&e!==zr,o&&(this._$AH=e);else{const a=e;let l,c;for(e=s[0],l=0;l<s.length-1;l++)c=jr(this,a[i+l],t,l),c===zr&&(c=this._$AH[l]),o||(o=!Gs(c)||c!==this._$AH[l]),c===lt?e=lt:e!==lt&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===lt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Nm extends $o{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===lt?void 0:e}}class zm extends $o{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==lt)}}class jm extends $o{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=jr(this,e,t,0)??lt)===zr)return;const i=this._$AH,r=e===lt&&i!==lt||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==lt&&(i===lt||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Um{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){jr(this,e)}}const ic=Ds.litHtmlPolyfillSupport;ic==null||ic(Ns,zs),(Ds.litHtmlVersions??(Ds.litHtmlVersions=[])).push("3.3.2");const Vm=(n,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let r=i._$litPart$;if(r===void 0){const s=(t==null?void 0:t.renderBefore)??null;i._$litPart$=r=new zs(e.insertBefore(Os(),s),s,void 0,t??{})}return r._$AI(n),r};/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */const Zn=globalThis;class Ur extends Nr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Vm(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return zr}}Ur._$litElement$=!0,Ur.finalized=!0,(im=Zn.litElementHydrateSupport)==null||im.call(Zn,{LitElement:Ur});const nc=Zn.litElementPolyfillSupport;nc==null||nc({LitElement:Ur}),(Zn.litElementVersions??(Zn.litElementVersions=[])).push("4.2.2");const Wm=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}',Hm=".layer-control{bottom:.5em;left:.5em}.layer-control>button{cursor:pointer;display:flex;align-items:center;justify-content:center}.svgContainer{width:22px;height:22px;scale:.8}.ol-touch .ol-control button>.svgContainer{scale:1.2}.layer-selection{position:absolute;bottom:0;display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;z-index:10;padding:10px 0 10px 10px;background-color:#fff}.layer-selection.fade-out{opacity:0;transition:opacity .15s ease-out}.layer-selection.hidden{display:none}.image-box{cursor:pointer;text-align:center;width:100px;height:100px;margin-right:10px;border-radius:4px;border:2px solid #bdbdbd}.image-box.selected{border:2px solid #474747}.image-box:hover{box-shadow:0 0 6px #949494}.image-box img{pointer-events:none;width:100px;height:100px;border-radius:4px;object-fit:cover}",pt={ADD:"add",REMOVE:"remove"},Vr={PROPERTYCHANGE:"propertychange"},K={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class js{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Xm(n,e,t){let i,r;t=t||wi;let s=0,o=n.length,a=!1;for(;s<o;)i=s+(o-s>>1),r=+t(n[i],e),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function wi(n,e){return n>e?1:n<e?-1:0}function Ym(n,e){return n<e?1:n>e?-1:0}function ea(n,e,t){if(n[0]<=e)return 0;const i=n.length;if(e<=n[i-1])return i-1;if(typeof t=="function"){for(let r=1;r<i;++r){const s=n[r];if(s===e)return r;if(s<e)return t(e,n[r-1],s)>0?r-1:r}return i-1}if(t>0){for(let r=1;r<i;++r)if(n[r]<e)return r-1;return i-1}if(t<0){for(let r=1;r<i;++r)if(n[r]<=e)return r;return i-1}for(let r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return n[r-1]-e<e-n[r]?r-1:r}return i-1}function Km(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function vi(n,e){const t=Array.isArray(e)?e:[e],i=t.length;for(let r=0;r<i;r++)n[n.length]=t[r]}function Bi(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function Zm(n,e,t){const i=e||wi;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||o===0)})}function Wr(){return!0}function Hr(){return!1}function Us(){}function kd(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!Bi(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function qn(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}function Vs(n){for(const e in n)delete n[e]}function un(n){let e;for(e in n)return!1;return!e}class Nt{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Ws extends js{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){const t=typeof e=="string",i=t?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=t?new Nt(e):e;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=r.length;c<h;++c)if("handleEvent"in r[c]?l=r[c].handleEvent(s):l=r[c].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let c=a[i];for(delete a[i];c--;)this.removeEventListener(i,Us);delete o[i]}return l}disposeInternal(){this.listeners_&&Vs(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const r=i.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=Us,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}function ce(n,e,t,i,r){if(r){const o=t;t=function(a){return n.removeEventListener(e,t),o.call(i??this,a)}}else i&&i!==n&&(t=t.bind(i));const s={target:n,type:e,listener:t};return n.addEventListener(e,t),s}function ta(n,e,t,i){return ce(n,e,t,i,!0)}function Te(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Vs(n))}class Hs extends Ws{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(K.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ce(this,e[s],t);return r}return ce(this,e,t)}onceInternal(e,t){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=ta(this,e[s],t)}else i=ta(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)qm(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}}Hs.prototype.on,Hs.prototype.once,Hs.prototype.un;function qm(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)Te(n[e]);else Te(n)}function Q(){throw new Error("Unimplemented abstract method.")}let Qm=0;function Y(n){return n.ol_uid||(n.ol_uid=String(++Qm))}class Dd extends Nt{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class Ci extends Hs{constructor(e){super(),this.on,this.once,this.un,Y(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new Dd(i,e,t)),i=Vr.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Dd(i,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,i){const r=this.values_||(this.values_={});if(i)r[e]=t;else{const s=r[e];r[e]=t,s!==t&&this.notify(e,s)}}setProperties(e,t){for(const i in e)this.set(i,e[i],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],un(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}const Od={LENGTH:"length"};class ia extends Nt{constructor(e,t,i){super(e),this.element=t,this.index=i}}class Rt extends Ci{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let i=1,r=this.array_.length;i<r;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,i=e.length;t<i;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)e(t[i],i,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Od.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new ia(pt.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)if(t[i]===e)return this.removeAt(i)}removeAt(e){if(e<0||e>=this.getLength())return;const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ia(pt.REMOVE,t,e)),t}setAt(e,t){const i=this.getLength();if(e>=i){this.insertAt(e,t);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t,e);const r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new ia(pt.REMOVE,r,e)),this.dispatchEvent(new ia(pt.ADD,t,e))}updateLength_(){this.set(Od.LENGTH,this.array_.length)}assertUnique_(e,t){const i=this.array_;for(let r=0,s=i.length;r<s;++r)if(i[r]===e&&r!==t)throw new Error("Duplicate item added to a unique collection")}}class Xr extends Nt{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}class Ni extends Xr{constructor(e,t,i,r,s,o){super(e,t,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const he={SINGLECLICK:"singleclick",CLICK:K.CLICK,DBLCLICK:K.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Qn=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Qn.includes("safari")&&!Qn.includes("chrom")&&(Qn.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Qn));const Jm=Qn.includes("webkit")&&!Qn.includes("edge"),Gd=Qn.includes("macintosh"),$m=typeof devicePixelRatio<"u"?devicePixelRatio:1,ut=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Bd=typeof Image<"u"&&Image.prototype.decode,ey=typeof createImageBitmap=="function",Nd=(function(){let n=!1;try{const e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n})(),rc={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class ty extends Ws{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ce(i,rc.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ce(i,rc.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(K.TOUCHMOVE,this.boundHandleTouchMove_,Nd?{passive:!1}:!1)}emulateClick_(e){let t=new Ni(he.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Ni(he.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Ni(he.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==he.POINTERUP||t.type==he.POINTERCANCEL){delete this.trackedTouches_[i];for(const r in this.trackedTouches_)if(this.trackedTouches_[r].target!==t.target){delete this.trackedTouches_[r];break}}else(t.type==he.POINTERDOWN||t.type==he.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new Ni(he.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Te),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const t=new Ni(he.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ce(i,he.POINTERMOVE,this.handlePointerMove_,this),ce(i,he.POINTERUP,this.handlePointerUp_,this),ce(this.element_,he.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ce(this.element_.getRootNode(),he.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new Ni(he.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Ni(he.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Te(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(K.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Te(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Te),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const dn={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},At={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function me(n,e){if(!n)throw new Error(e)}const na=1/0;class iy{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Vs(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,i=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){me(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const t=this.priorityFunction_(e);return t!=na?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,i=this.priorities_,r=t.length,s=t[e],o=i[e],a=e;for(;e<r>>1;){const l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),h=c<r&&i[c]<i[l]?c:l;t[e]=t[h],i[e]=i[h],e=h}t[e]=s,i[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const i=this.elements_,r=this.priorities_,s=i[t],o=r[t];for(;t>e;){const a=this.getParentIndex_(t);if(r[a]>o)i[t]=i[a],r[t]=r[a],t=a;else break}i[t]=s,r[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,i=this.priorities_;let r=0;const s=t.length;let o,a,l;for(a=0;a<s;++a)o=t[a],l=e(o),l==na?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}class zd extends iy{constructor(e,t){super(i=>e.apply(null,i),i=>i[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(K.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===G.LOADED||i===G.ERROR||i===G.EMPTY){i!==G.ERROR&&t.removeEventListener(K.CHANGE,this.boundHandleTileChange_);const r=t.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let i=0;for(;this.tilesLoading_<e&&i<t&&this.getCount()>0;){const r=this.dequeue()[0],s=r.getKey();r.getState()===G.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function ny(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return na;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}const De={ANIMATING:0,INTERACTING:1},ai={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Pe(n,e,t){return Math.min(Math.max(n,e),t)}function ry(n,e,t,i,r,s){const o=r-t,a=s-i;if(o!==0||a!==0){const l=((n-t)*o+(e-i)*a)/(o*o+a*a);l>1?(t=r,i=s):l>0&&(t+=o*l,i+=a*l)}return zi(n,e,t,i)}function zi(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function sy(n){const e=n.length;for(let i=0;i<e;i++){let r=i,s=Math.abs(n[i][i]);for(let a=i+1;a<e;a++){const l=Math.abs(n[a][i]);l>s&&(s=l,r=a)}if(s===0)return null;const o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a<e;a++){const l=-n[a][i]/n[i][i];for(let c=i;c<e+1;c++)i==c?n[a][c]=0:n[a][c]+=l*n[i][c]}}const t=new Array(e);for(let i=e-1;i>=0;i--){t[i]=n[i][e]/n[i][i];for(let r=i-1;r>=0;r--)n[r][e]-=n[r][i]*t[i]}return t}function jd(n){return n*180/Math.PI}function fn(n){return n*Math.PI/180}function gn(n,e){const t=n%e;return t*e<0?t+e:t}function zt(n,e,t){return n+t*(e-n)}function Xs(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function ra(n,e){return Math.floor(Xs(n,e))}function pn(n,e){return Math.ceil(Xs(n,e))}function sc(n,e,t){if(n>=e&&n<t)return n;const i=t-e;return((n-e)%i+i)%i+e}function Ud(n,e,t){return(function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const l=e?0:s[0]*r,c=e?0:s[1]*r,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,g=n[2]-l/2+h,f=n[1]+c/2+u,p=n[3]-c/2+u;d>g&&(d=(g+d)/2,g=d),f>p&&(f=(p+f)/2,p=f);let A=Pe(i[0],d,g),m=Pe(i[1],f,p);if(o&&t&&r){const y=30*r;A+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-g)/y),m+=-y*Math.log(1+Math.max(0,f-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-p)/y)}return[A,m]})}function oy(n){return n}const ct={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function mt(n){const e=jt();for(let t=0,i=n.length;t<i;++t)Ks(e,n[t]);return e}function ay(n,e,t){const i=Math.min.apply(null,n),r=Math.min.apply(null,e),s=Math.max.apply(null,n),o=Math.max.apply(null,e);return bi(i,r,s,o,t)}function ji(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function Vd(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function Jn(n,e,t){let i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function $n(n,e){return oc(n,e[0],e[1])}function Ui(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function oc(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function ac(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=ct.UNKNOWN;return o<t?l=l|ct.LEFT:o>r&&(l=l|ct.RIGHT),a<i?l=l|ct.BELOW:a>s&&(l=l|ct.ABOVE),l===ct.UNKNOWN&&(l=ct.INTERSECTING),l}function jt(){return[1/0,1/0,-1/0,-1/0]}function bi(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function Yr(n){return bi(1/0,1/0,-1/0,-1/0,n)}function Ys(n,e){const t=n[0],i=n[1];return bi(t,i,t,i,e)}function lc(n,e,t,i,r){const s=Yr(r);return Wd(s,n,e,t,i)}function Vi(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function cc(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function Ks(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function Wd(n,e,t,i,r){for(;t<i;t+=r)ly(n,e[t],e[t+1]);return n}function ly(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function hc(n,e){let t;return t=e(sa(n)),t||(t=e(oa(n)),t)||(t=e(la(n)),t)||(t=e(li(n)),t)?t:!1}function Zs(n){let e=0;return er(n)||(e=ne(n)*Oe(n)),e}function sa(n){return[n[0],n[1]]}function oa(n){return[n[2],n[1]]}function Ut(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function cy(n,e){let t;if(e==="bottom-left")t=sa(n);else if(e==="bottom-right")t=oa(n);else if(e==="top-left")t=li(n);else if(e==="top-right")t=la(n);else throw new Error("Invalid corner");return t}function aa(n,e,t,i,r){const[s,o,a,l,c,h,u,d]=Hd(n,e,t,i);return bi(Math.min(s,a,c,u),Math.min(o,l,h,d),Math.max(s,a,c,u),Math.max(o,l,h,d),r)}function Hd(n,e,t,i){const r=e*i[0]/2,s=e*i[1]/2,o=Math.cos(t),a=Math.sin(t),l=r*o,c=r*a,h=s*o,u=s*a,d=n[0],g=n[1];return[d-l+u,g-c-h,d-l-u,g-c+h,d+l-u,g+c+h,d+l+u,g+c-h,d-l+u,g-c-h]}function Oe(n){return n[3]-n[1]}function xt(n,e,t){const i=t||jt();return ze(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):Yr(i),i}function li(n){return[n[0],n[3]]}function la(n){return[n[2],n[3]]}function ne(n){return n[2]-n[0]}function ze(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function er(n){return n[2]<n[0]||n[3]<n[1]}function hy(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function uy(n,e,t){let i=!1;const r=ac(n,e),s=ac(n,t);if(r===ct.INTERSECTING||s===ct.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],c=n[3],h=e[0],u=e[1],d=t[0],g=t[1],f=(g-u)/(d-h);let p,A;s&ct.ABOVE&&!(r&ct.ABOVE)&&(p=d-(g-c)/f,i=p>=o&&p<=l),!i&&s&ct.RIGHT&&!(r&ct.RIGHT)&&(A=g-(d-l)*f,i=A>=a&&A<=c),!i&&s&ct.BELOW&&!(r&ct.BELOW)&&(p=d-(g-a)/f,i=p>=o&&p<=l),!i&&s&ct.LEFT&&!(r&ct.LEFT)&&(A=g-(d-o)*f,i=A>=a&&A<=c)}return i}function Xd(n,e,t,i){if(er(n))return Yr(t);let r=[];if(i>1){const a=n[2]-n[0],l=n[3]-n[1];for(let c=0;c<i;++c)r.push(n[0]+a*c/i,n[1],n[2],n[1]+l*c/i,n[2]-a*c/i,n[3],n[0],n[3]-l*c/i)}else r=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]];e(r,r,2);const s=[],o=[];for(let a=0,l=r.length;a<l;a+=2)s.push(r[a]),o.push(r[a+1]);return ay(s,o,t)}function Yd(n,e){const t=e.getExtent(),i=Ut(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=ne(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}function uc(n,e,t){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];Yd(n,e);const r=ne(i);if(ne(n)>r&&!t)return[[i[0],n[1],i[2],n[3]]];if(n[0]<i[0])return[[n[0]+r,n[1],i[2],n[3]],[i[0],n[1],n[2],n[3]]];if(n[2]>i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-r,n[3]]]}return[n]}function dy(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function dc(n,e){const t=n[0],i=n[1],r=e[0],s=e[1],o=r[0],a=r[1],l=s[0],c=s[1],h=l-o,u=c-a,d=h===0&&u===0?0:(h*(t-o)+u*(i-a))/(h*h+u*u||0);let g,f;return d<=0?(g=o,f=a):d>=1?(g=l,f=c):(g=o+d*h,f=a+d*u),[g,f]}function Et(n,e){let t=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=e[i]){t=!1;break}return t}function fc(n,e){const t=Math.cos(e),i=Math.sin(e),r=n[0]*t-n[1]*i,s=n[1]*t+n[0]*i;return n[0]=r,n[1]=s,n}function fy(n,e){return n[0]*=e,n[1]*=e,n}function Kr(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function tr(n,e){return Math.sqrt(Kr(n,e))}function gy(n,e){return Kr(n,dc(n,e))}function gc(n,e){if(e.canWrapX()){const t=ne(e.getExtent()),i=py(n,e,t);i&&(n[0]-=i*t)}return n}function py(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(t=t||ne(i),r=Math.floor((n[0]-i[0])/t)),r}function Kd(n){return Math.pow(n,3)}function Zr(n){return 1-Kd(1-n)}function Ay(n){return 3*n*n-2*n*n*n}function my(n){return n}const yy=63710088e-1;function Zd(n,e,t){t=t||yy;const i=fn(n[1]),r=fn(e[1]),s=(r-i)/2,o=fn(e[0]-n[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(r);return 2*t*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function qd(...n){console.warn(...n)}const An={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ca{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||An[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const qs=6378137,qr=Math.PI*qs,_y=[-qr,-qr,qr,qr],xy=[-180,-85,180,85],ha=qs*Math.log(Math.tan(Math.PI/2));class Qr extends ca{constructor(e){super({code:e,units:"m",extent:_y,global:!0,worldExtent:xy,getPointResolution:function(t,i){return t/Math.cosh(i[1]/qs)}})}}const Qd=[new Qr("EPSG:3857"),new Qr("EPSG:102100"),new Qr("EPSG:102113"),new Qr("EPSG:900913"),new Qr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Qr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ey(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;s<r;s+=i){e[s]=qr*n[s]/180;let o=qs*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>ha?o=ha:o<-ha&&(o=-ha),e[s+1]=o}return e}function wy(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;s<r;s+=i)e[s]=180*n[s]/qr,e[s+1]=360*Math.atan(Math.exp(n[s+1]/qs))/Math.PI-90;return e}const vy=6378137,Jd=[-180,-90,180,90],Cy=Math.PI*vy/180;class ir extends ca{constructor(e,t){super({code:e,units:"degrees",extent:Jd,axisOrientation:t,global:!0,metersPerUnit:Cy,worldExtent:Jd})}}const $d=[new ir("CRS:84"),new ir("EPSG:4326","neu"),new ir("urn:ogc:def:crs:OGC:1.3:CRS84"),new ir("urn:ogc:def:crs:OGC:2:84"),new ir("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ir("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ir("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let pc={};function by(n){return pc[n]||pc[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Ty(n,e){pc[n]=e}let Jr={};function Qs(n,e,t){const i=n.getCode(),r=e.getCode();i in Jr||(Jr[i]={}),Jr[i][r]=t}function Ac(n,e){return n in Jr&&e in Jr[n]?Jr[n][e]:null}const ua=.9996,Qt=.00669438,da=Qt*Qt,fa=da*Qt,nr=Qt/(1-Qt),ef=Math.sqrt(1-Qt),$r=(1-ef)/(1+ef),tf=$r*$r,mc=tf*$r,yc=mc*$r,nf=yc*$r,rf=1-Qt/4-3*da/64-5*fa/256,Ry=3*Qt/8+3*da/32+45*fa/1024,Sy=15*da/256+45*fa/1024,Iy=35*fa/3072,Py=3/2*$r-27/32*mc+269/512*nf,My=21/16*tf-55/32*yc,Fy=151/96*mc-417/128*nf,Ly=1097/512*yc,ga=6378137;function ky(n,e,t){const i=n-5e5,o=(t.north?e:e-1e7)/ua/(ga*rf),a=o+Py*Math.sin(2*o)+My*Math.sin(4*o)+Fy*Math.sin(6*o)+Ly*Math.sin(8*o),l=Math.sin(a),c=l*l,h=Math.cos(a),u=l/h,d=u*u,g=d*d,f=1-Qt*c,p=Math.sqrt(1-Qt*c),A=ga/p,m=(1-Qt)/f,y=nr*h**2,E=y*y,x=i/(A*ua),_=x*x,w=_*x,v=w*x,C=v*x,b=C*x,T=a-u/m*(_/2-v/24*(5+3*d+10*y-4*E-9*nr))+b/720*(61+90*d+298*y+45*g-252*nr-3*E);let I=(x-w/6*(1+2*d+y)+C/120*(5-2*y+28*d-3*E+8*nr+24*g))/h;return I=sc(I+fn(af(t.number)),-Math.PI,Math.PI),[jd(I),jd(T)]}const sf=-80,of=84,Dy=-180,Oy=180;function Gy(n,e,t){n=sc(n,Dy,Oy),e<sf?e=sf:e>of&&(e=of);const i=fn(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=fn(n),h=af(t.number),u=fn(h),d=ga/Math.sqrt(1-Qt*r**2),g=nr*s**2,f=s*sc(c-u,-Math.PI,Math.PI),p=f*f,A=p*f,m=A*f,y=m*f,E=y*f,x=ga*(rf*i-Ry*Math.sin(2*i)+Sy*Math.sin(4*i)-Iy*Math.sin(6*i)),_=ua*d*(f+A/6*(1-a+g)+y/120*(5-18*a+l+72*g-58*nr))+5e5;let w=ua*(x+d*o*(p/2+m/24*(5-a+9*g+4*g**2)+E/720*(61-58*a+l+600*g-330*nr)));return t.north||(w+=1e7),[_,w]}function af(n){return(n-1)*6-180+3}const By=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function lf(n){let e=0;for(const r of By){const s=n.match(r);if(s){e=parseInt(s[1]);break}}if(!e)return null;let t=0,i=!1;return e>32700&&e<32761?t=e-32700:e>32600&&e<32661&&(i=!0,t=e-32600),t?{number:t,north:i}:null}function cf(n,e){return function(t,i,r,s){const o=t.length;r=r>1?r:2,s=s??r,i||(r>2?i=t.slice():i=new Array(o));for(let a=0;a<o;a+=s){const l=t[a],c=t[a+1],h=n(l,c,e);i[a]=h[0],i[a+1]=h[1]}return i}}function Ny(n){return lf(n)?new ca({code:n,units:"m"}):null}function zy(n){const e=lf(n.getCode());return e?{forward:cf(Gy,e),inverse:cf(ky,e)}:null}const jy=[zy],Uy=[Ny];let _c=!0;function hf(n){_c=!1}function xc(n,e){if(e!==void 0){for(let t=0,i=n.length;t<i;++t)e[t]=n[t];e=e}else e=n.slice();return e}function Ec(n){Ty(n.getCode(),n),Qs(n,n,xc)}function Vy(n){n.forEach(Ec)}function ye(n){if(typeof n!="string")return n;const e=by(n);if(e)return e;for(const t of Uy){const i=t(n);if(i)return i}return null}function wc(n,e,t,i){n=ye(n);let r;const s=n.getPointResolutionFunc();if(s){if(r=s(e,t),i&&i!==n.getUnits()){const o=n.getMetersPerUnit();o&&(r=r*o/An[i])}}else{const o=n.getUnits();if(o=="degrees"&&!i||i=="degrees")r=e;else{const a=eo(n,ye("EPSG:4326"));if(!a&&o!=="degrees")r=e*n.getMetersPerUnit();else{let c=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];c=a(c,c,2);const h=Zd(c.slice(0,2),c.slice(2,4)),u=Zd(c.slice(4,6),c.slice(6,8));r=(h+u)/2}const l=i?An[i]:n.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function uf(n){Vy(n),n.forEach(function(e){n.forEach(function(t){e!==t&&Qs(e,t,xc)})})}function Wy(n,e,t,i){n.forEach(function(r){e.forEach(function(s){Qs(r,s,t),Qs(s,r,i)})})}function vc(n,e){return n?typeof n=="string"?ye(n):n:ye(e)}function Hy(n){return(function(e,t,i,r){const s=e.length;i=i!==void 0?i:2,r=r??i,t=t!==void 0?t:new Array(s);for(let o=0;o<s;o+=r){const a=n(e.slice(o,o+i)),l=a.length;for(let c=0,h=r;c<h;++c)t[o+c]=c>=l?e[o+c]:a[c]}return t})}function Js(n,e){return hf(),pa(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function $s(n,e){const t=pa(n,"EPSG:3857","EPSG:4326"),i=t[0];return(i<-180||i>180)&&(t[0]=gn(i+180,360)-180),t}function tt(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||eo(n,e)===xc)&&t}function eo(n,e){const t=n.getCode(),i=e.getCode();let r=Ac(t,i);if(r)return r;let s=null,o=null;for(const l of jy)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=Cc(s.inverse,o.forward);else{const l=Ac(t,a);l&&(r=Cc(l,o.forward))}else{const l=Ac(a,i);l&&(r=Cc(s.inverse,l))}return r&&(Ec(n),Ec(e),Qs(n,e,r)),r}function Cc(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function rr(n,e){const t=ye(n),i=ye(e);return eo(t,i)}function pa(n,e,t){const i=rr(e,t);if(!i){const r=ye(e).getCode(),s=ye(t).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(n,void 0,n.length)}function Aa(n,e,t,i){const r=rr(e,t);return Xd(n,r,void 0,i)}let Xy=null;function Yy(){return Xy}function sr(n,e){return n}function je(n,e){return _c&&!Et(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(_c=!1,qd("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function ma(n,e){return n}function ci(n,e){return n}function Ky(){uf(Qd),uf($d),Wy($d,Qd,Ey,wy)}Ky();const df=new Array(6);function St(){return[1,0,0,1,0,0]}function ff(n){return Tc(n,1,0,0,1,0,0)}function bc(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=e[0],c=e[1],h=e[2],u=e[3],d=e[4],g=e[5];return n[0]=t*l+r*c,n[1]=i*l+s*c,n[2]=t*h+r*u,n[3]=i*h+s*u,n[4]=t*d+r*g+o,n[5]=i*d+s*g+a,n}function Tc(n,e,t,i,r,s,o){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function Zy(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function $e(n,e){const t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function Rc(n,e,t){return bc(n,Tc(df,e,0,0,t,0,0))}function qy(n,e,t){return bc(n,Tc(df,1,0,0,1,e,t))}function Ti(n,e,t,i,r,s,o,a){const l=Math.sin(s),c=Math.cos(s);return n[0]=i*c,n[1]=r*l,n[2]=-i*l,n[3]=r*c,n[4]=o*i*c-a*i*l+e,n[5]=o*r*l+a*r*c+t,n}function gf(n,e){const t=Qy(e);me(t!==0,"Transformation matrix cannot be inverted");const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*l-o*a)/t,n[5]=-(i*l-r*a)/t,n}function Qy(n){return n[0]*n[3]-n[1]*n[2]}const Jy=[1e5,1e5,1e5,1e5,2,2];function $y(n){return"matrix("+n.join(", ")+")"}function Sc(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function e0(n,e){const t=Sc(n),i=Sc(e);for(let r=0;r<6;++r)if(Math.round((t[r]-i[r])*Jy[r])!==0)return!1;return!0}function mn(n,e,t,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<t;l+=i){const c=n[l],h=n[l+1];s[a++]=r[0]*c+r[2]*h+r[4],s[a++]=r[1]*c+r[3]*h+r[5];for(let u=2;u<o;u++)s[a++]=n[l+u]}return s&&s.length!=a&&(s.length=a),s}function Ic(n,e,t,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),c=s[0],h=s[1];let u=0;for(let d=e;d<t;d+=i){const g=n[d]-c,f=n[d+1]-h;o[u++]=c+g*a-f*l,o[u++]=h+g*l+f*a;for(let p=d+2;p<d+i;++p)o[u++]=n[p]}return o&&o.length!=u&&(o.length=u),o}function t0(n,e,t,i,r,s,o,a){a=a||[];const l=o[0],c=o[1];let h=0;for(let u=e;u<t;u+=i){const d=n[u]-l,g=n[u+1]-c;a[h++]=l+r*d,a[h++]=c+s*g;for(let f=u+2;f<u+i;++f)a[h++]=n[f]}return a&&a.length!=h&&(a.length=h),a}function i0(n,e,t,i,r,s,o){o=o||[];let a=0;for(let l=e;l<t;l+=i){o[a++]=n[l]+r,o[a++]=n[l+1]+s;for(let c=l+2;c<l+i;++c)o[a++]=n[c]}return o&&o.length!=a&&(o.length=a),o}const pf=St(),n0=[NaN,NaN];class Af extends Ci{constructor(){super(),this.extent_=jt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=kd((e,t,i)=>{if(!i)return this.getSimplifiedGeometry(t);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return Q()}closestPointXY(e,t,i,r){return Q()}containsXY(e,t){return this.closestPointXY(e,t,n0,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return Q()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Yr(t),this.extentRevision_=this.getRevision()}return hy(this.extent_,e)}rotate(e,t){Q()}scale(e,t,i){Q()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return Q()}getType(){return Q()}applyTransform(e){Q()}intersectsExtent(e){return Q()}translate(e,t){Q()}transform(e,t){const i=ye(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=Oe(c)/Oe(l);Ti(pf,c[0],c[3],h,-h,0,0,0);const u=mn(s,0,s.length,a,pf,o),d=rr(i,t);return d?d(u,u,a):u}:rr(i,t);return this.applyTransform(r),this}}class yn extends Af{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return lc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return Q()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=ya(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){Q()}setLayout(e,t,i){let r;if(e)r=ya(e);else{for(let s=0;s<i;++s){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}r=t.length,e=or(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Ic(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){t===void 0&&(t=e),i||(i=Ut(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();t0(r,0,r.length,s,e,t,i,r),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();i0(i,0,i.length,r,e,t,i),this.changed()}}}function or(n){let e;return n==2?e="XY":n==3?e="XYZ":n==4&&(e="XYZM"),e}function ya(n){let e;return n=="XY"?e=2:n=="XYZ"||n=="XYM"?e=3:n=="XYZM"&&(e=4),e}function r0(n,e,t){const i=n.getFlatCoordinates();if(!i)return null;const r=n.getStride();return mn(i,0,i.length,r,e,t)}function mf(n,e,t,i){let r=0;const s=n[t-i],o=n[t-i+1];let a=0,l=0;for(;e<t;e+=i){const c=n[e]-s,h=n[e+1]-o;r+=l*c-a*h,a=c,l=h}return r/2}function yf(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=mf(n,e,a,i),e=a}return r}function s0(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=yf(n,e,a,i),e=a[a.length-1]}return r}function _f(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],c=n[t]-a,h=n[t+1]-l;let u;if(c===0&&h===0)u=e;else{const d=((r-a)*c+(s-l)*h)/(c*c+h*h);if(d>1)u=t;else if(d>0){for(let g=0;g<i;++g)o[g]=zt(n[e+g],n[t+g],d);o.length=i;return}else u=e}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function Pc(n,e,t,i,r){let s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){const a=n[e],l=n[e+1],c=zi(s,o,a,l);c>r&&(r=c),s=a,o=l}return r}function Mc(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Pc(n,e,a,i,r),e=a}return r}function o0(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Mc(n,e,a,i,r),e=a[a.length-1]}return r}function Fc(n,e,t,i,r,s,o,a,l,c,h){if(e==t)return c;let u,d;if(r===0){if(d=zi(o,a,n[e],n[e+1]),d<c){for(u=0;u<i;++u)l[u]=n[e+u];return l.length=i,d}return c}h=h||[NaN,NaN];let g=e+i;for(;g<t;)if(_f(n,g-i,g,i,o,a,h),d=zi(o,a,h[0],h[1]),d<c){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(d)-Math.sqrt(c))/r|0,1);if(s&&(_f(n,t-i,e,i,o,a,h),d=zi(o,a,h[0],h[1]),d<c)){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i}return c}function Lc(n,e,t,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=t.length;u<d;++u){const g=t[u];c=Fc(n,e,g,i,r,s,o,a,l,c,h),e=g}return c}function a0(n,e,t,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=t.length;u<d;++u){const g=t[u];c=Lc(n,e,g,i,r,s,o,a,l,c,h),e=g[g.length-1]}return c}function xf(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function _a(n,e,t,i){for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0;a<i;++a)n[e++]=o[a]}return e}function to(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=_a(n,e,t[o],i);r[s++]=l,e=l}return r.length=s,r}function Ef(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=to(n,e,t[o],i,r[s]);l.length===0&&(l[0]=e),r[s++]=l,e=l[l.length-1]}return r.length=s,r}function _n(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=e;o<t;o+=i)r[s++]=n.slice(o,o+i);return r.length=s,r}function io(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=_n(n,e,l,i,r[s]),e=l}return r.length=s,r}function kc(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=l.length===1&&l[0]===e?[]:io(n,e,l,i,r[s]),e=l[l.length-1]}return r.length=s,r}function xa(n,e,t,i,r,s,o){const a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const c=[e,t-i];let h=0;for(;c.length>0;){const u=c.pop(),d=c.pop();let g=0;const f=n[d],p=n[d+1],A=n[u],m=n[u+1];for(let y=d+i;y<u;y+=i){const E=n[y],x=n[y+1],_=ry(E,x,f,p,A,m);_>g&&(h=y,g=_)}g>r&&(l[(h-e)/i]=1,d+i<h&&c.push(d,h),h+i<u&&c.push(h,u))}for(let u=0;u<a;++u)l[u]&&(s[o++]=n[e+u*i],s[o++]=n[e+u*i+1]);return o}function wf(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l];o=xa(n,e,h,i,r,s,o),a.push(o),e=h}return o}function ar(n,e){return e*Math.round(n/e)}function l0(n,e,t,i,r,s,o){if(e==t)return o;let a=ar(n[e],r),l=ar(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let c,h;do if(c=ar(n[e],r),h=ar(n[e+1],r),e+=i,e==t)return s[o++]=c,s[o++]=h,o;while(c==a&&h==l);for(;e<t;){const u=ar(n[e],r),d=ar(n[e+1],r);if(e+=i,u==c&&d==h)continue;const g=c-a,f=h-l,p=u-a,A=d-l;if(g*A==f*p&&(g<0&&p<g||g==p||g>0&&p>g)&&(f<0&&A<f||f==A||f>0&&A>f)){c=u,h=d;continue}s[o++]=c,s[o++]=h,a=c,l=h,c=u,h=d}return s[o++]=c,s[o++]=h,o}function Dc(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l];o=l0(n,e,h,i,r,s,o),a.push(o),e=h}return o}function c0(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l],u=[];o=Dc(n,e,h,i,r,s,o,u),a.push(u),e=h[h.length-1]}return o}class no extends yn{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new no(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return mf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new no(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_a(this.flatCoordinates,0,e,this.stride),this.changed()}}class It extends yn{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new It(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=zi(e,t,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return Ys(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return oc(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=xf(this.flatCoordinates,0,e,this.stride),this.changed()}}function h0(n,e,t,i,r){return!hc(r,function(o){return!lr(n,e,t,i,o[0],o[1])})}function lr(n,e,t,i,r,s){let o=0,a=n[t-i],l=n[t-i+1];for(;e<t;e+=i){const c=n[e],h=n[e+1];l<=s?h>s&&(c-a)*(s-l)-(r-a)*(h-l)>0&&o++:h<=s&&(c-a)*(s-l)-(r-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function Oc(n,e,t,i,r,s){if(t.length===0||!lr(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(lr(n,t[o-1],t[o],i,r,s))return!1;return!0}function u0(n,e,t,i,r,s){if(t.length===0)return!1;for(let o=0,a=t.length;o<a;++o){const l=t[o];if(Oc(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function Gc(n,e,t,i,r,s,o){let a,l,c,h,u,d,g;const f=r[s+1],p=[];for(let y=0,E=t.length;y<E;++y){const x=t[y];for(h=n[x-i],d=n[x-i+1],a=e;a<x;a+=i)u=n[a],g=n[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(c=(f-d)/(g-d)*(u-h)+h,p.push(c)),h=u,d=g}let A=NaN,m=-1/0;for(p.sort(wi),h=p[0],a=1,l=p.length;a<l;++a){u=p[a];const y=Math.abs(u-h);y>m&&(c=(h+u)/2,Oc(n,e,t,i,c,f)&&(A=c,m=y)),h=u}return isNaN(A)&&(A=r[s]),o?(o.push(A,f,m),o):[A,f,m]}function vf(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const l=t[o];s=Gc(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function Cf(n,e,t,i,r){let s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function Ea(n,e,t,i,r,s){return s=s??Wd(jt(),n,e,t,i),ze(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Cf(n,e,t,i,function(o,a){return uy(r,o,a)}):!1}function d0(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(Ea(n,e,t[s],i,r))return!0;e=t[s]}return!1}function bf(n,e,t,i,r){return!!(Ea(n,e,t,i,r)||lr(n,e,t,i,r[0],r[1])||lr(n,e,t,i,r[0],r[3])||lr(n,e,t,i,r[2],r[1])||lr(n,e,t,i,r[2],r[3]))}function Tf(n,e,t,i,r){if(!bf(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(let s=1,o=t.length;s<o;++s)if(h0(n,t[s-1],t[s],i,r)&&!Ea(n,t[s-1],t[s],i,r))return!1;return!0}function f0(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Tf(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function g0(n,e,t,i){for(;e<t-i;){for(let r=0;r<i;++r){const s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function Bc(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],l=n[e+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function Nc(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=Bc(n,e,a,i);if(s===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;e=a}return!0}function Rf(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!Nc(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function wa(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=Bc(n,e,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&g0(n,e,a,i),e=a}return e}function zc(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=wa(n,e,t[s],i,r);return e}function jc(n,e){const t=[];let i=0,r=0,s;for(let o=0,a=e.length;o<a;++o){const l=e[o],c=Bc(n,i,l,2);if(s===void 0&&(s=c),c===s)t.push(e.slice(r,o+1));else{if(t.length===0)continue;t[t.length-1].push(e[r])}r=o+1,i=l}return t}class Jt extends yn{constructor(e,t,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&i?(this.setFlatCoordinates(t,e),this.ends_=i):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?vi(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Jt(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Mc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lc(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return Oc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return yf(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),wa(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,io(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=Ut(this.getExtent());this.flatInteriorPoint_=Gc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new It(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new no(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],c=new no(t.slice(s,l),e);r.push(c),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Nc(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=wa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Dc(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new Jt(t,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Tf(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=to(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Sf(n){if(er(n))throw new Error("Cannot create polygon from empty extent");const e=n[0],t=n[1],i=n[2],r=n[3],s=[e,t,e,r,i,r,i,t,e,t];return new Jt(s,"XY",[s.length])}function Uc(n,e,t,i){const r=ne(e)/t[0],s=Oe(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function Vc(n,e,t){let i=Math.min(n,e);const r=50;return i*=Math.log(1+r*Math.max(0,n/e-1))/r+1,t&&(i=Math.max(i,t),i/=Math.log(1+r*Math.max(0,t/n-1))/r+1),Pe(i,t/2,e*2)}function p0(n,e,t,i){return e=e!==void 0?e:!0,(function(r,s,o,a){if(r!==void 0){const l=n[0],c=n[n.length-1],h=t?Uc(l,t,o,i):l;if(a)return e?Vc(r,h,c):Pe(r,c,h);const u=Math.min(h,r),d=Math.floor(ea(n,u,s));return n[d]>h&&d<n.length-1?n[d+1]:n[d]}})}function A0(n,e,t,i,r,s){return i=i!==void 0?i:!0,t=t!==void 0?t:0,(function(o,a,l,c){if(o!==void 0){const h=r?Uc(e,r,l,s):e;if(c)return i?Vc(o,h,t):Pe(o,t,h);const u=1e-9,d=Math.ceil(Math.log(e/h)/Math.log(n)-u),g=-a*(.5-u)+.5,f=Math.min(h,o),p=Math.floor(Math.log(e/f)/Math.log(n)+g),A=Math.max(d,p),m=e/Math.pow(n,A);return Pe(m,t,h)}})}function If(n,e,t,i,r){return t=t!==void 0?t:!0,(function(s,o,a,l){if(s!==void 0){const c=i?Uc(n,i,a,r):n;return!t||!l?Pe(s,e,c):Vc(s,c,e)}})}function Wc(n){if(n!==void 0)return 0}function Pf(n){if(n!==void 0)return n}function m0(n){const e=2*Math.PI/n;return(function(t,i){if(i)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t})}function y0(n){const e=fn(5);return(function(t,i){return i||t===void 0?t:Math.abs(t)<=e?0:t})}const Mf=42,Hc=256,Xc=0;class Ri extends Ci{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=vc(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&hf(),e.center&&(e.center=je(e.center,this.projection_)),e.extent&&(e.extent=ci(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in ai)delete t[a];this.setProperties(t,!0);const i=x0(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const r=_0(e),s=i.constraint,o=E0(e);this.constraints_={center:r,resolution:s,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenterInternal();if(i){const r=e||[0,0,0,0];t=t||[0,0,0,0];const s=this.getResolution(),o=s/2*(r[3]-t[3]+t[1]-r[1]),a=s/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let r=arguments[i];r.center&&(r=Object.assign({},r),r.center=je(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=je(r.anchor,this.getProjection())),t[i]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,i;t>1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){const h=arguments[r];h.center&&this.setCenterInternal(h.center),h.zoom!==void 0?this.setZoom(h.zoom):h.resolution&&this.setResolution(h.resolution),h.rotation!==void 0&&this.setRotation(h.rotation)}if(r===t){i&&va(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const c=[];for(;r<t;++r){const h=arguments[r],u={start:s,complete:!1,anchor:h.anchor,duration:h.duration!==void 0?h.duration:1e3,easing:h.easing||Ay,callback:i};if(h.center&&(u.sourceCenter=o,u.targetCenter=h.center.slice(),o=u.targetCenter),h.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(h.zoom),a=u.targetResolution):h.resolution&&(u.sourceResolution=a,u.targetResolution=h.resolution,a=u.targetResolution),h.rotation!==void 0){u.sourceRotation=l;const d=gn(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}w0(u)?u.complete=!0:s+=u.duration,c.push(u)}this.animations_.push(c),this.setHint(De.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[De.ANIMATING]>0}getInteracting(){return this.hints_[De.INTERACTING]>0}cancelAnimations(){this.setHint(De.ANIMATING,-this.hints_[De.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&va(r[0].callback,!1),!e)for(let s=0,o=r.length;s<o;++s){const a=r[s];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(l.complete)continue;const c=e-l.start;let h=l.duration>0?c/l.duration:1;h>=1?(l.complete=!0,h=1):s=!1;const u=l.easing(h);if(l.sourceCenter){const d=l.sourceCenter[0],g=l.sourceCenter[1],f=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const A=d+u*(f-d),m=g+u*(p-g);this.targetCenter_=[A,m]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?gn(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(De.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&va(o,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let i;const r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-t[0],r[1]-t[1]],fc(i,e-this.getRotation()),dy(i,t)),i}calculateCenterZoom(e,t){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const o=t[0]-e*(t[0]-r[0])/s,a=t[1]-e*(t[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(e){const t=this.viewportSize_;if(e){const i=t[0],r=t[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&sr(e,this.getProjection())}getCenterInternal(){return this.get(ai.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return ma(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();me(t,"The view center is not defined");const i=this.getResolution();me(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return me(r!==void 0,"The view rotation is not defined"),aa(t,i,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(ai.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(ci(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=ne(e)/t[0],r=Oe(e)/t[1];return Math.max(i,r)}getResolutionForValueFunction(e){e=e||2;const t=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(t/i)/Math.log(e);return(function(s){return t/Math.pow(e,s*r)})}getRotation(){return this.get(ai.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/t;return(function(o){return Math.log(i/o)/t/s})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const i=this.padding_;return i&&(t=[t[0]-i[1]-i[3],t[1]-i[0]-i[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();r=Yc(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],t,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,i,r;if(this.resolutions_){const s=ea(this.resolutions_,e,1);t=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){var t;if((t=this.resolutions_)!=null&&t.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=Pe(Math.floor(e),0,this.resolutions_.length-2),r=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(r,Pe(e-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(me(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){me(!er(e),"Cannot fit empty extent provided as `geometry`");const r=ci(e,this.getProjection());i=Sf(r)}else if(e.getType()==="Circle"){const r=ci(e.getExtent(),this.getProjection());i=Sf(r),i.rotate(this.getRotation(),Ut(r))}else i=e;this.fitInternal(i,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),i=Math.cos(t),r=Math.sin(-t),s=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=s.length;u<d;u+=o){const g=s[u]*i-s[u+1]*r,f=s[u]*r+s[u+1]*i;a=Math.min(a,g),l=Math.min(l,f),c=Math.max(c,g),h=Math.max(h,f)}return[a,l,c,h]}fitInternal(e,t){t=t||{};let i=t.size;i||(i=this.getViewportSizeMinusPadding_());const r=t.padding!==void 0?t.padding:[0,0,0,0],s=t.nearest!==void 0?t.nearest:!1;let o;t.minResolution!==void 0?o=t.minResolution:t.maxZoom!==void 0?o=this.getResolutionForZoom(t.maxZoom):o=0;const a=this.rotatedExtentForGeometry(e);let l=this.getResolutionForExtentInternal(a,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);const c=this.getRotation(),h=Math.sin(c),u=Math.cos(c),d=Ut(a);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;const g=d[0]*u-d[1]*h,f=d[1]*u+d[0]*h,p=this.getConstrainedCenter([g,f],l),A=t.callback?t.callback:Us;t.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:t.duration,easing:t.easing},A):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),va(A,!0))}centerOn(e,t,i){this.centerOnInternal(je(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal(Yc(e,t,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,i,r){let s;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-i),l=Yc(e,r,[a[0]/2+o[3],a[1]/2+o[0]],t,i);s=[e[0]-l[0],e[1]-l[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=sr(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&je(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);t&&(this.targetCenter_=this.calculateCenterZoom(s,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=je(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&je(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const i=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,s,i),a=this.constraints_.center(this.targetCenter_,o,s,i,this.calculateCenterShift(this.targetCenter_,o,r,s));this.get(ai.ROTATION)!==r&&this.set(ai.ROTATION,r),this.get(ai.RESOLUTION)!==o&&(this.set(ai.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(ai.CENTER)||!Et(this.get(ai.CENTER),a))&&this.set(ai.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,i){e=e!==void 0?e:200;const r=t||0,s=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(s),a=this.constraints_.resolution(this.targetResolution_,r,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,s,o));if(e===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=s,this.targetCenter_=l,this.applyTargetState_();return}i=i||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==s||!this.getCenterInternal()||!Et(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:l,resolution:a,duration:e,easing:Zr,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(De.INTERACTING,1)}endInteraction(e,t,i){i=i&&je(i,this.getProjection()),this.endInteractionInternal(e,t,i)}endInteractionInternal(e,t,i){this.getInteracting()&&(this.setHint(De.INTERACTING,-1),this.resolveConstraints(e,t,i))}getConstrainedCenter(e,t){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),i)}getConstrainedZoom(e,t){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,t))}getConstrainedResolution(e,t){t=t||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,i)}}function va(n,e){setTimeout(function(){n(e)},0)}function _0(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return Ud(n.extent,n.constrainOnlyCenter,t)}const e=vc(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,Ud(t,!1,!1)}return oy}function x0(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:Xc,a=n.maxZoom!==void 0?n.maxZoom:28;const l=n.zoomFactor!==void 0?n.zoomFactor:2,c=n.multiWorld!==void 0?n.multiWorld:!1,h=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,u=n.showFullExtent!==void 0?n.showFullExtent:!1,d=vc(n.projection,"EPSG:3857"),g=d.getExtent();let f=n.constrainOnlyCenter,p=n.extent;if(!c&&!p&&d.isGlobal()&&(f=!1,p=g),n.resolutions!==void 0){const A=n.resolutions;t=A[o],i=A[a]!==void 0?A[a]:A[A.length-1],n.constrainResolution?e=p0(A,h,!f&&p,u):e=If(t,i,h,!f&&p,u)}else{const m=(g?Math.max(ne(g),Oe(g)):360*An.degrees/d.getMetersPerUnit())/Hc/Math.pow(2,Xc),y=m/Math.pow(2,28-Xc);t=n.maxResolution,t!==void 0?o=0:t=m/Math.pow(l,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=t/Math.pow(l,a):i=m/Math.pow(l,a):i=y),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=A0(l,t,i,h,!f&&p,u):e=If(t,i,h,!f&&p,u)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function E0(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?y0():t===!1?Pf:typeof t=="number"?m0(t):Pf}return Wc}function w0(n){return!(n.sourceCenter&&n.targetCenter&&!Et(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function Yc(n,e,t,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=n[0]*s-n[1]*o,l=n[1]*s+n[0]*o;a+=(e[0]/2-t[0])*i,l+=(t[1]-e[1]/2)*i,o=-o;const c=a*s-l*o,h=l*s+a*o;return[c,h]}const Ca="ol-hidden",ba="ol-unselectable",Kc="ol-control",Ff="ol-collapsed",v0=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(""),"i"),Lf=["style","variant","weight","size","lineHeight","family"],Zc={normal:400,bold:700},qc=function(n){const e=n.match(v0);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,r=Lf.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[Lf[i]]=typeof s=="string"?s.trim():s)}return isNaN(Number(t.weight))&&t.weight in Zc&&(t.weight=Zc[t.weight]),t.families=t.family.split(/,\s?/).map(i=>i.trim().replace(/^['"]|['"]$/g,"")),t};function Me(n,e,t,i){let r;return t&&t.length?r=t.shift():ut?r=new class extends OffscreenCanvas{constructor(){super(...arguments);Gt(this,"style",{})}}(n??300,e??150):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}let Qc;function Ta(){return Qc||(Qc=Me(1,1)),Qc}function ro(n){const e=n.canvas;e.width=1,e.height=1,n.clearRect(0,0,1,1)}function kf(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function C0(n){for(;n.lastChild;)n.lastChild.remove()}function b0(n,e){const t=n.childNodes;for(let i=0;;++i){const r=t[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){n.appendChild(s);continue}if(!s){n.removeChild(r),--i;continue}n.insertBefore(s,r)}}}function Df(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){const t=this.childNodes.indexOf(e);if(t===-1)throw new Error("Node to remove was not found");return this.childNodes.splice(t,1),e},insertBefore:function(e,t){const i=this.childNodes.indexOf(t);if(i===-1)throw new Error("Reference node not found");return this.childNodes.splice(i,0,e),e},style:{}},{get(e,t,i){return t==="firstElementChild"?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,i)}})}function xn(n){return typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}class so extends Ci{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){var t;this.map_&&((t=this.element)==null||t.remove());for(let i=0,r=this.listenerKeys.length;i<r;++i)Te(this.listenerKeys[i]);if(this.listenerKeys.length=0,this.map_=e,e){const i=this.target_??e.getOverlayContainerStopEvent();this.element&&i.appendChild(this.element),this.render!==Us&&this.listenerKeys.push(ce(e,dn.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class Of extends so{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;const t=e.className!==void 0?e.className:"ol-attribution",i=e.tipLabel!==void 0?e.tipLabel:"Attributions",r=e.expandClassName!==void 0?e.expandClassName:t+"-expand",s=e.collapseLabel!==void 0?e.collapseLabel:"›",o=e.collapseClassName!==void 0?e.collapseClassName:t+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;const a=e.label!==void 0?e.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(K.CLICK,this.handleClick_.bind(this),!1);const c=t+" "+ba+" "+Kc+(this.collapsed_&&this.collapsible_?" "+Ff:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=c,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t=this.getMap().getAllLayers(),i=new Set(t.flatMap(r=>r.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(r=>i.add(r)):i.add(this.attributions_)),!this.overrideCollapsible_){const r=!t.some(s=>{var o;return((o=s.getSource())==null?void 0:o.getAttributionsCollapsible())===!1});this.setCollapsible(r)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=await Promise.all(this.collectSourceAttributions_(e).map(r=>qn(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Bi(t,this.renderedAttributions_)){C0(this.ulElement_);for(let r=0,s=t.length;r<s;++r){const o=document.createElement("li");o.innerHTML=t[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Ff),this.collapsed_?kf(this.collapseLabel_,this.label_):kf(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}class T0 extends so{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});const t=e.className!==void 0?e.className:"ol-rotate",i=e.label!==void 0?e.label:"⇧",r=e.compassClassName!==void 0?e.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=r,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(r));const s=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=t+"-reset",o.setAttribute("type","button"),o.title=s,o.appendChild(this.label_),o.addEventListener(K.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+ba+" "+Kc,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration!==void 0?e.duration:250,this.autoHide_=e.autoHide!==void 0?e.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Ca)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const i=t.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:Zr}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const i=t.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(Ca);!s&&i===0?this.element.classList.add(Ca):s&&i!==0&&this.element.classList.remove(Ca)}this.label_.style.transform=r}this.rotation_=i}}class R0 extends so{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const t=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,r=e.zoomInClassName!==void 0?e.zoomInClassName:t+"-in",s=e.zoomOutClassName!==void 0?e.zoomOutClassName:t+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",c=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=r,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(K.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=c,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(K.CLICK,this.handleClick_.bind(this,-i),!1);const d=t+" "+ba+" "+Kc,g=this.element;g.className=d,g.appendChild(h),g.appendChild(u),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Zr})):i.setZoom(s)}}}function Gf(n){n=n||{};const e=new Rt;return(n.zoom!==void 0?n.zoom:!0)&&e.push(new R0(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&e.push(new T0(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&e.push(new Of(n.attributionOptions)),e}class S0{constructor(e,t,i){this.decay_=e,this.minVelocity_=t,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let i=t-3;for(;i>0&&this.points_[i+2]>e;)i-=3;const r=this.points_[t+2]-this.points_[i+2];if(r<16.666666666666668)return!1;const s=this.points_[t]-this.points_[i],o=this.points_[t+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Jc={ACTIVE:"active"};class En extends Ci{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Jc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Jc.ACTIVE,e)}setMap(e){this.map_=e}}function I0(n,e,t){const i=n.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:my,center:n.getConstrainedCenter(r)})}}function $c(n,e,t,i){const r=n.getZoom();if(r===void 0)return;const s=n.getConstrainedZoom(r+e),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:i!==void 0?i:250,easing:Zr})}class P0 extends En{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let t=!1;if(e.type==he.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();$c(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function eh(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](t),!!i);++r);return i}}const M0=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},F0=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},L0=function(n){const e=n.map.getTargetElement(),t=e.getRootNode(),i=n.map.getOwnerDocument().activeElement;return t instanceof ShadowRoot?t.host.contains(i):e.contains(i)},Bf=function(n){const e=n.map.getTargetElement(),t=e.getRootNode();return(t instanceof ShadowRoot?t.host:e).hasAttribute("tabindex")?L0(n):!0},es=Wr,Nf=function(n){const e=n.originalEvent;return"pointerId"in e&&e.button==0&&!(Jm&&Gd&&e.ctrlKey)},zf=Hr,k0=function(n){return n.type==he.SINGLECLICK},Ra=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},D0=function(n){const e=n.originalEvent;return Gd?e.metaKey:e.ctrlKey},th=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},jf=function(n){const e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},ih=function(n){const e=n.originalEvent;return"pointerId"in e&&e.pointerType=="mouse"},nh=function(n){const e=n.originalEvent;return"pointerId"in e&&e.isPrimary&&e.button===0};class cr extends En{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==he.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==he.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==he.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==he.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function rh(n){const e=n.length;let t=0,i=0;for(let r=0;r<e;r++)t+=n[r].clientX,i+=n[r].clientY;return{clientX:t/e,clientY:i/e}}class O0 extends cr{constructor(e){super({stopDown:Hr}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:eh(Ra,nh);this.condition_=e.onFocusOnly?eh(Bf,t):t,this.noKinetic_=!1}handleDragEvent(e){const t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());const i=this.targetPointers,r=t.getEventPixel(rh(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){const s=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],a=e.map.getView();fy(s,a.getResolution()),fc(s,a.getRotation()),a.adjustCenterInternal(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=i.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,i=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),l=t.getCoordinateFromPixelInternal([a[0]-r*Math.cos(s),a[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(l),duration:500,easing:Zr})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class G0 extends cr{constructor(e){e=e||{},super({stopDown:Hr}),this.condition_=e.condition?e.condition:F0,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!ih(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===Wc)return;const r=t.getSize(),s=e.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return ih(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return ih(e)&&Nf(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class B0 extends js{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],t[0])+i,r.top=Math.min(e[1],t[1])+i,r.width=Math.abs(t[0]-e[0])+i,r.height=Math.abs(t[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Jt([r])}getGeometry(){return this.geometry_}}const ts={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class oo extends Nt{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class N0 extends cr{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new B0(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Nf,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,i){const r=i[0]-t[0],s=i[1]-t[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new oo(ts.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new oo(t?ts.BOXEND:ts.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new oo(ts.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new oo(ts.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new oo(ts.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class z0 extends N0{constructor(e){e=e||{};const t=e.condition?e.condition:th;super({condition:t,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Zr})}}const hr={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class j0 extends En{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return Ra(t)&&jf(t)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==K.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==hr.DOWN||r==hr.LEFT||r==hr.RIGHT||r==hr.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;r==hr.DOWN?c=-a:r==hr.LEFT?l=-a:r==hr.RIGHT?l=a:c=a;const h=[l,c];fc(h,o.getRotation()),I0(o,h,this.duration_),i.preventDefault(),t=!0}}return!t}}class U0 extends En{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!D0(t)&&jf(t)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let t=!1;if(e.type==K.KEYDOWN||e.type==K.KEYPRESS){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==="+"||r==="-")){const s=e.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();$c(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}const V0=40,W0=300;class H0 extends En{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const t=e.condition?e.condition:es;this.condition_=e.onFocusOnly?eh(Bf,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==K.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let s=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:s*=V0;break;case WheelEvent.DOM_DELTA_PAGE:s*=W0;break}if(s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-Pe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),$c(t,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}class X0 extends cr{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=Hr),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let t=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=l}this.lastAngle_=s;const o=e.map,a=o.getView();a.getConstraints().rotation!==Wc&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(rh(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}class Y0 extends cr{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=Hr),super(t),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,c=l.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(rh(this.targetPointers))),l.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}function K0(n){n=n||{};const e=new Rt,t=new S0(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&e.push(new G0),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&e.push(new P0({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&e.push(new O0({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&e.push(new X0),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&e.push(new Y0({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(e.push(new j0),e.push(new U0({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&e.push(new H0({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&e.push(new z0({duration:n.zoomDuration})),e}const Ee={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class Uf extends Ci{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const t=Object.assign({},e);typeof e.properties=="object"&&(delete t.properties,Object.assign(t,e.properties)),t[Ee.OPACITY]=e.opacity!==void 0?e.opacity:1,me(typeof t[Ee.OPACITY]=="number","Layer opacity must be a number"),t[Ee.VISIBLE]=e.visible!==void 0?e.visible:!0,t[Ee.Z_INDEX]=e.zIndex,t[Ee.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[Ee.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[Ee.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[Ee.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return t.opacity=Pe(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=i===void 0&&!t.managed?1/0:i,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return Q()}getLayerStatesArray(e){return Q()}getExtent(){return this.get(Ee.EXTENT)}getMaxResolution(){return this.get(Ee.MAX_RESOLUTION)}getMinResolution(){return this.get(Ee.MIN_RESOLUTION)}getMinZoom(){return this.get(Ee.MIN_ZOOM)}getMaxZoom(){return this.get(Ee.MAX_ZOOM)}getOpacity(){return this.get(Ee.OPACITY)}getSourceState(){return Q()}getVisible(){return this.get(Ee.VISIBLE)}getZIndex(){return this.get(Ee.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(Ee.EXTENT,e)}setMaxResolution(e){this.set(Ee.MAX_RESOLUTION,e)}setMinResolution(e){this.set(Ee.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(Ee.MAX_ZOOM,e)}setMinZoom(e){this.set(Ee.MIN_ZOOM,e)}setOpacity(e){me(typeof e=="number","Layer opacity must be a number"),this.set(Ee.OPACITY,e)}setVisible(e){this.set(Ee.VISIBLE,e)}setZIndex(e){this.set(Ee.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const wn={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class vn extends Nt{constructor(e,t){super(e),this.layer=t}}const sh={LAYERS:"layers"};class Si extends Uf{constructor(e){e=e||{};const t=Object.assign({},e);delete t.layers;let i=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(sh.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Rt(i.slice(),{unique:!0}):me(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Rt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Te),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(ce(e,pt.ADD,this.handleLayersAdd_,this),ce(e,pt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Te);Vs(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i<r;i++){const s=t[i];this.registerLayerListeners_(s),this.dispatchEvent(new vn(wn.ADDLAYER,s))}this.changed()}registerLayerListeners_(e){const t=[ce(e,Vr.PROPERTYCHANGE,this.handleLayerChange_,this),ce(e,K.CHANGE,this.handleLayerChange_,this)];e instanceof Si&&t.push(ce(e,wn.ADDLAYER,this.handleLayerGroupAdd_,this),ce(e,wn.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[Y(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new vn(wn.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new vn(wn.REMOVELAYER,e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new vn(wn.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=Y(t);this.listenerKeys_[i].forEach(Te),delete this.listenerKeys_[i],this.dispatchEvent(new vn(wn.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(sh.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const i=t.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new vn(wn.REMOVELAYER,i[r]))}this.set(sh.LAYERS,e)}getLayersArray(e){return e=e!==void 0?e:[],this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){const t=e!==void 0?e:[],i=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let o=i,a=t.length;o<a;o++){const l=t[o];l.opacity*=r.opacity,l.visible=l.visible&&r.visible,l.maxResolution=Math.min(l.maxResolution,r.maxResolution),l.minResolution=Math.max(l.minResolution,r.minResolution),l.minZoom=Math.max(l.minZoom,r.minZoom),l.maxZoom=Math.min(l.maxZoom,r.maxZoom),r.extent!==void 0&&(l.extent!==void 0?l.extent=xt(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return"ready"}}const $t={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class is extends Uf{constructor(e){const t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(Ee.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get(Ee.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Te(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=ce(e,K.CHANGE,this.handleSourceChange_,this),e.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof Ri?t={viewState:e.getState(),extent:e.calculateExtent()}:t=e,!t.layerStatesArray&&i&&(t.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(o=>o.layer===this),!r)return!1}else r=this.getLayerState();const s=this.getExtent();return oh(r,t.viewState)&&(!s||ze(s,t.extent))}getAttributions(e){var s;if(!this.isVisible(e))return[];const t=(s=this.getSource())==null?void 0:s.getAttributions();if(!t)return[];const i=e instanceof Ri?e.getViewStateAndExtent():e;let r=t(i);return Array.isArray(r)||(r=[r]),r}render(e,t){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){const t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(Ee.MAP,e)}getMapInternal(){return this.get(Ee.MAP)}setMap(e){this.mapPrecomposeKey_&&(Te(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(Te(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=ce(e,$t.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=ce(this,K.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);me(!t.some(r=>r.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(i)}setSource(e){this.set(Ee.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function oh(n,e){if(!n.visible)return!1;const t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}function Vf(n,e,t=0,i=n.length-1,r=Z0){for(;i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(t,Math.floor(e-c*u/l+d)),f=Math.min(i,Math.floor(e+(l-c)*u/l+d));Vf(n,e,g,f,r)}const s=n[e];let o=t,a=i;for(ao(n,t,e),r(n[i],s)>0&&ao(n,t,i);o<a;){for(ao(n,o,a),o++,a--;r(n[o],s)<0;)o++;for(;r(n[a],s)>0;)a--}r(n[t],s)===0?ao(n,t,a):(a++,ao(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function ao(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function Z0(n,e){return n<e?-1:n>e?1:0}let Wf=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!Ia(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?r(a):a;Ia(e,l)&&(t.leaf?i.push(a):lh(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!Ia(e,t))return!1;const i=[];for(;t;){for(let r=0;r<t.children.length;r++){const s=t.children[r],o=t.leaf?this.toBBox(s):s;if(Ia(e,o)){if(t.leaf||lh(e,o))return!0;i.push(s)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=rs([]),this}remove(e,t){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],o=[];let a,l,c;for(;i||s.length;){if(i||(i=s.pop(),l=s[s.length-1],a=o.pop(),c=!0),i.leaf){const h=q0(e,i.children,t);if(h!==-1)return i.children.splice(h,1),s.push(i),this._condense(s),this}!c&&!i.leaf&&lh(i,r)?(s.push(i),o.push(a),a=0,l=i,i=i.children[0]):l?(a++,i=l.children[a],c=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,r){const s=i-t+1;let o=this._maxEntries,a;if(s<=o)return a=rs(e.slice(t,i+1)),ns(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=rs([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));Hf(e,t,i,c,this.compareMinX);for(let h=t;h<=i;h+=c){const u=Math.min(h+c-1,i);Hf(e,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const g=Math.min(d+l-1,u);a.children.push(this._build(e,d,g,r-1))}}return ns(a,this.toBBox),a}_chooseSubtree(e,t,i,r){for(;r.push(t),!(t.leaf||r.length-1===i);){let s=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],h=ah(c),u=$0(e,c)-h;u<o?(o=u,s=h<s?h:s,a=c):u===o&&h<s&&(s=h,a=c)}t=a||t.children[0]}return t}_insert(e,t,i){const r=i?e:this.toBBox(e),s=[],o=this._chooseSubtree(r,this.data,t,s);for(o.children.push(e),co(o,r);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)}_split(e,t){const i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const o=this._chooseSplitIndex(i,s,r),a=rs(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,ns(i,this.toBBox),ns(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=rs([e,t]),this.data.height=e.height+1,this.data.leaf=!1,ns(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let r,s=1/0,o=1/0;for(let a=t;a<=i-t;a++){const l=lo(e,0,a,this.toBBox),c=lo(e,a,i,this.toBBox),h=e_(l,c),u=ah(l)+ah(c);h<s?(s=h,r=a,o=u<o?u:o):h===s&&u<o&&(o=u,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:Q0,s=e.leaf?this.compareMinY:J0,o=this._allDistMargin(e,t,i,r),a=this._allDistMargin(e,t,i,s);o<a&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);const s=this.toBBox,o=lo(e,0,t,s),a=lo(e,i-t,i,s);let l=Sa(o)+Sa(a);for(let c=t;c<i-t;c++){const h=e.children[c];co(o,e.leaf?s(h):h),l+=Sa(o)}for(let c=i-t-1;c>=t;c--){const h=e.children[c];co(a,e.leaf?s(h):h),l+=Sa(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)co(t[r],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():ns(e[t],this.toBBox)}};function q0(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i<e.length;i++)if(t(n,e[i]))return i;return-1}function ns(n,e){lo(n,0,n.children.length,e,n)}function lo(n,e,t,i,r){r||(r=rs(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<t;s++){const o=n.children[s];co(r,n.leaf?i(o):o)}return r}function co(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function Q0(n,e){return n.minX-e.minX}function J0(n,e){return n.minY-e.minY}function ah(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Sa(n){return n.maxX-n.minX+(n.maxY-n.minY)}function $0(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function e_(n,e){const t=Math.max(n.minX,e.minX),i=Math.max(n.minY,e.minY),r=Math.min(n.maxX,e.maxX),s=Math.min(n.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,s-i)}function lh(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function Ia(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function rs(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Hf(n,e,t,i,r){const s=[e,t];for(;s.length;){if(t=s.pop(),e=s.pop(),t-e<=i)continue;const o=e+Math.ceil((t-e)/i/2)*i;Vf(n,o,e,t,r),s.push(e,o,o,t)}}const ch=[NaN,NaN,NaN,0];let hh;function t_(){return hh||(hh=Me(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),hh}const i_=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,n_=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,r_=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,s_=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Pa(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function ho(n){throw new Error('failed to parse "'+n+'" as color')}function Xf(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(n_)||n.match(i_)||n.match(r_);if(s){const o=s[4],a=100/255;return[Pe(Pa(s[1],a)+.5|0,0,255),Pe(Pa(s[2],a)+.5|0,0,255),Pe(Pa(s[3],a)+.5|0,0,255),o!==void 0?Pe(Pa(o,100),0,1):1]}ho(n)}if(n.startsWith("#")){if(s_.test(n)){const s=n.substring(1),o=s.length<=4?1:2,a=[0,0,0,255];for(let l=0,c=s.length;l<c;l+=o){let h=parseInt(s.substring(l,l+o),16);o===1&&(h+=h<<4),a[l/o]=h}return a[3]=a[3]/255,a}ho(n)}const e=t_();e.fillStyle="#abcdef";let t=e.fillStyle;e.fillStyle=n,e.fillStyle===t&&(e.fillStyle="#fedcba",t=e.fillStyle,e.fillStyle=n,e.fillStyle===t&&ho(n));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return Xf(i);e.clearRect(0,0,1,1),e.fillRect(0,0,1,1);const r=Array.from(e.getImageData(0,0,1,1).data);return r[3]=Xs(r[3]/255,3),r}function o_(n){return typeof n=="string"?n:mh(n)}const a_=1024,uo={};let uh=0;function l_(n){if(n.length===4)return n;const e=n.slice();return e[3]=1,e}function dh(n){return n>.0031308?Math.pow(n,.4166666666666667)*269.025-14.025:n*3294.6}function fh(n){return n>.2068965?Math.pow(n,3):(n-.13793103448275862)*.12841854934601665}function gh(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function ph(n){return n>.0088564?Math.pow(n,.3333333333333333):n/.12841854934601665+.13793103448275862}function Yf(n){const e=gh(n[0]),t=gh(n[1]),i=gh(n[2]),r=ph(e*.222488403+t*.716873169+i*.06060791),s=500*(ph(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-ph(e*.016863605+t*.117638439+i*.865350722)),a=Math.atan2(o,s)*(180/Math.PI);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,n[3]]}function c_(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=fh(e),s=fh(e+t/500*Math.cos(i)),o=fh(e-t/200*Math.sin(i)),a=dh(s*3.021973625-r*1.617392459-o*.404875592),l=dh(s*-.943766287+r*1.916279586+o*.027607165),c=dh(s*.069407491-r*.22898585+o*1.159737864);return[Pe(a+.5|0,0,255),Pe(l+.5|0,0,255),Pe(c+.5|0,0,255),n[3]]}function Ah(n){if(n==="none")return ch;if(uo.hasOwnProperty(n))return uo[n];if(uh>=a_){let t=0;for(const i in uo)(t++&3)===0&&(delete uo[i],--uh)}const e=Xf(n);e.length!==4&&ho(n);for(const t of e)isNaN(t)&&ho(n);return uo[n]=e,++uh,e}function ss(n){return Array.isArray(n)?n:Ah(n)}function mh(n){let e=n[0];e!=(e|0)&&(e=e+.5|0);let t=n[1];t!=(t|0)&&(t=t+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const r=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+e+","+t+","+i+","+r+")"}function Kf(n){return n[0]>0&&n[1]>0}function h_(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function it(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let ur=0;const wt=1<<ur++,ue=1<<ur++,Pt=1<<ur++,hi=1<<ur++,dr=1<<ur++,fo=1<<ur++,Ma=Math.pow(2,ur)-1,yh={[wt]:"boolean",[ue]:"number",[Pt]:"string",[hi]:"color",[dr]:"number[]",[fo]:"size"},u_=Object.keys(yh).map(Number).sort(wi);function d_(n){return n in yh}function go(n){const e=[];for(const t of u_)po(n,t)&&e.push(yh[t]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function po(n,e){return(n&e)===e}function Cn(n,e){return n===e}class nt{constructor(e,t){if(!d_(e))throw new Error(`literal expressions must have a specific type, got ${go(e)}`);this.type=e,this.value=t}}class f_{constructor(e,t,...i){this.type=e,this.operator=t,this.args=i}}function Zf(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function dt(n,e,t){switch(typeof n){case"boolean":{if(Cn(e,Pt))return new nt(Pt,n?"true":"false");if(!po(e,wt))throw new Error(`got a boolean, but expected ${go(e)}`);return new nt(wt,n)}case"number":{if(Cn(e,fo))return new nt(fo,it(n));if(Cn(e,wt))return new nt(wt,!!n);if(Cn(e,Pt))return new nt(Pt,n.toString());if(!po(e,ue))throw new Error(`got a number, but expected ${go(e)}`);return new nt(ue,n)}case"string":{if(Cn(e,hi))return new nt(hi,Ah(n));if(Cn(e,wt))return new nt(wt,!!n);if(!po(e,Pt))throw new Error(`got a string, but expected ${go(e)}`);return new nt(Pt,n)}}if(!Array.isArray(n))throw new Error("expression must be an array or a primitive value");if(n.length===0)throw new Error("empty expression");if(typeof n[0]=="string")return C_(n,e,t);for(const i of n)if(typeof i!="number")throw new Error("expected an array of numbers");if(Cn(e,fo)){if(n.length!==2)throw new Error(`expected an array of two values for a size, got ${n.length}`);return new nt(fo,n)}if(Cn(e,hi)){if(n.length===3)return new nt(hi,[...n,1]);if(n.length===4)return new nt(hi,n);throw new Error(`expected an array of 3 or 4 values for a color, got ${n.length}`)}if(!po(e,dr))throw new Error(`got an array of numbers, but expected ${go(e)}`);return new nt(dr,n)}const k={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",LineMetric:"line-metric",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},g_={[k.Get]:J(te(1,1/0),qf),[k.Var]:J(te(1,1),p_),[k.Has]:J(te(1,1/0),qf),[k.Id]:J(A_,os),[k.Concat]:J(te(2,1/0),_e(Pt)),[k.GeometryType]:J(m_,os),[k.LineMetric]:J(os),[k.Resolution]:J(_h,os),[k.Zoom]:J(_h,os),[k.Time]:J(_h,os),[k.Any]:J(te(2,1/0),_e(wt)),[k.All]:J(te(2,1/0),_e(wt)),[k.Not]:J(te(1,1),_e(wt)),[k.Equal]:J(te(2,2),_e(Ma)),[k.NotEqual]:J(te(2,2),_e(Ma)),[k.GreaterThan]:J(te(2,2),_e(ue)),[k.GreaterThanOrEqualTo]:J(te(2,2),_e(ue)),[k.LessThan]:J(te(2,2),_e(ue)),[k.LessThanOrEqualTo]:J(te(2,2),_e(ue)),[k.Multiply]:J(te(2,1/0),Qf),[k.Coalesce]:J(te(2,1/0),Qf),[k.Divide]:J(te(2,2),_e(ue)),[k.Add]:J(te(2,1/0),_e(ue)),[k.Subtract]:J(te(2,2),_e(ue)),[k.Clamp]:J(te(3,3),_e(ue)),[k.Mod]:J(te(2,2),_e(ue)),[k.Pow]:J(te(2,2),_e(ue)),[k.Abs]:J(te(1,1),_e(ue)),[k.Floor]:J(te(1,1),_e(ue)),[k.Ceil]:J(te(1,1),_e(ue)),[k.Round]:J(te(1,1),_e(ue)),[k.Sin]:J(te(1,1),_e(ue)),[k.Cos]:J(te(1,1),_e(ue)),[k.Atan]:J(te(1,2),_e(ue)),[k.Sqrt]:J(te(1,1),_e(ue)),[k.Match]:J(te(4,1/0),Jf,__),[k.Between]:J(te(3,3),_e(ue)),[k.Interpolate]:J(te(6,1/0),Jf,x_),[k.Case]:J(te(3,1/0),y_,E_),[k.In]:J(te(2,2),w_),[k.Number]:J(te(1,1/0),_e(Ma)),[k.String]:J(te(1,1/0),_e(Ma)),[k.Array]:J(te(1,1/0),_e(ue)),[k.Color]:J(te(1,4),_e(ue)),[k.Band]:J(te(1,3),_e(ue)),[k.Palette]:J(te(2,2),v_),[k.ToString]:J(te(1,1),_e(wt|ue|Pt|hi))};function qf(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=n[s+1];switch(typeof o){case"number":{r[s]=new nt(ue,o);break}case"string":{r[s]=new nt(Pt,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}s===0&&t.properties.add(String(o))}return r}function p_(n,e,t){const i=n[1];if(typeof i!="string")throw new Error("expected a string argument for var operation");return t.variables.add(i),[new nt(Pt,i)]}function A_(n,e,t){t.featureId=!0}function m_(n,e,t){t.geometryType=!0}function _h(n,e,t){t.mapState=!0}function os(n,e,t){const i=n[0];if(n.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function te(n,e){return function(t,i,r){const s=t[0],o=t.length-1;if(n===e){if(o!==n){const a=n===1?"":"s";throw new Error(`expected ${n} argument${a} for ${s}, got ${o}`)}}else if(o<n||o>e){const a=e===1/0?`${n} or more`:`${n} to ${e}`;throw new Error(`expected ${a} arguments for ${s}, got ${o}`)}}}function Qf(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=dt(n[s+1],e,t);r[s]=o}return r}function _e(n){return function(e,t,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const a=dt(e[o+1],n,i);s[o]=a}return s}}function y_(n,e,t){const i=n[0],r=n.length-1;if(r%2===0)throw new Error(`expected an odd number of arguments for ${i}, got ${r} instead`)}function Jf(n,e,t){const i=n[0],r=n.length-1;if(r%2===1)throw new Error(`expected an even number of arguments for operation ${i}, got ${r} instead`)}function __(n,e,t){const i=n.length-1,r=Pt|ue|wt,s=dt(n[1],r,t),o=dt(n[n.length-1],e,t),a=new Array(i-2);for(let l=0;l<i-2;l+=2){try{const c=dt(n[l+2],s.type,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+1} of match expression: ${c.message}`)}try{const c=dt(n[l+3],o.type,t);a[l+1]=c}catch(c){throw new Error(`failed to parse argument ${l+2} of match expression: ${c.message}`)}}return[s,...a,o]}function x_(n,e,t){const i=n[1];let r;switch(i[0]){case"linear":r=1;break;case"exponential":const l=i[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);r=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const s=new nt(ue,r);let o;try{o=dt(n[2],ue,t)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(n.length-3);for(let l=0;l<a.length;l+=2){try{const c=dt(n[l+3],ue,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${c.message}`)}try{const c=dt(n[l+4],e,t);a[l+1]=c}catch(c){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${c.message}`)}}return[s,o,...a]}function E_(n,e,t){const i=dt(n[n.length-1],e,t),r=new Array(n.length-1);for(let s=0;s<r.length-1;s+=2){try{const o=dt(n[s+1],wt,t);r[s]=o}catch(o){throw new Error(`failed to parse argument ${s} of case expression: ${o.message}`)}try{const o=dt(n[s+2],i.type,t);r[s+1]=o}catch(o){throw new Error(`failed to parse argument ${s+1} of case expression: ${o.message}`)}}return r[r.length-1]=i,r}function w_(n,e,t){let i=n[2];if(!Array.isArray(i))throw new Error('the second argument for the "in" operator must be an array');let r;if(typeof i[0]=="string"){if(i[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(i[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');i=i[1],r=Pt}else r=ue;const s=new Array(i.length);for(let a=0;a<s.length;a++)try{const l=dt(i[a],r,t);s[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[dt(n[1],r,t),...s]}function v_(n,e,t){let i;try{i=dt(n[1],ue,t)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const r=n[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let o=0;o<s.length;o++){let a;try{a=dt(r[o],hi,t)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof nt))throw new Error(`the palette color at index ${o} must be a literal value`);s[o]=a}return[i,...s]}function J(...n){return function(e,t,i){const r=e[0];let s;for(let o=0;o<n.length;o++){const a=n[o](e,t,i);if(o==n.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");s=a}}return new f_(t,r,...s)}}function C_(n,e,t){const i=n[0],r=g_[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(n,e,t)}function $f(n){if(!n)return"";const e=n.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return $f(n.getGeometries()[0]);default:return""}}function eg(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function Wi(n,e,t){const i=dt(n,e,t);return ui(i)}function ui(n,e){if(n instanceof nt){if(n.type===hi&&typeof n.value=="string"){const i=Ah(n.value);return function(){return i}}return function(){return n.value}}const t=n.operator;switch(t){case k.Number:case k.String:case k.Coalesce:return b_(n);case k.Get:case k.Var:case k.Has:return T_(n);case k.Id:return i=>i.featureId;case k.GeometryType:return i=>i.geometryType;case k.Concat:{const i=n.args.map(r=>ui(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case k.Resolution:return i=>i.resolution;case k.Any:case k.All:case k.Between:case k.In:case k.Not:return S_(n);case k.Equal:case k.NotEqual:case k.LessThan:case k.LessThanOrEqualTo:case k.GreaterThan:case k.GreaterThanOrEqualTo:return R_(n);case k.Multiply:case k.Divide:case k.Add:case k.Subtract:case k.Clamp:case k.Mod:case k.Pow:case k.Abs:case k.Floor:case k.Ceil:case k.Round:case k.Sin:case k.Cos:case k.Atan:case k.Sqrt:return I_(n);case k.Case:return P_(n);case k.Match:return M_(n);case k.Interpolate:return F_(n);case k.ToString:return L_(n);default:throw new Error(`Unsupported operator ${t}`)}}function b_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.Coalesce:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case k.Number:case k.String:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a===t)return a}throw new Error(`Expected one of the values to be a ${t}`)};default:throw new Error(`Unsupported assertion operator ${t}`)}}function T_(n,e){const i=n.args[0].value;switch(n.operator){case k.Get:return r=>{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const h=s[a].value;o=o[h]}return o};case k.Var:return r=>r.variables[i];case k.Has:return r=>{const s=n.args;if(!(i in r.properties))return!1;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const h=s[a].value;if(!o||!Object.hasOwn(o,h))return!1;o=o[h]}return!0};default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function R_(n,e){const t=n.operator,i=ui(n.args[0]),r=ui(n.args[1]);switch(t){case k.Equal:return s=>i(s)===r(s);case k.NotEqual:return s=>i(s)!==r(s);case k.LessThan:return s=>i(s)<r(s);case k.LessThanOrEqualTo:return s=>i(s)<=r(s);case k.GreaterThan:return s=>i(s)>r(s);case k.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function S_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.Any:return s=>{for(let o=0;o<i;++o)if(r[o](s))return!0;return!1};case k.All:return s=>{for(let o=0;o<i;++o)if(!r[o](s))return!1;return!0};case k.Between:return s=>{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case k.In:return s=>{const o=r[0](s);for(let a=1;a<i;++a)if(o===r[a](s))return!0;return!1};case k.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function I_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.Multiply:return s=>{let o=1;for(let a=0;a<i;++a)o*=r[a](s);return o};case k.Divide:return s=>r[0](s)/r[1](s);case k.Add:return s=>{let o=0;for(let a=0;a<i;++a)o+=r[a](s);return o};case k.Subtract:return s=>r[0](s)-r[1](s);case k.Clamp:return s=>{const o=r[0](s),a=r[1](s);if(o<a)return a;const l=r[2](s);return o>l?l:o};case k.Mod:return s=>r[0](s)%r[1](s);case k.Pow:return s=>Math.pow(r[0](s),r[1](s));case k.Abs:return s=>Math.abs(r[0](s));case k.Floor:return s=>Math.floor(r[0](s));case k.Ceil:return s=>Math.ceil(r[0](s));case k.Round:return s=>Math.round(r[0](s));case k.Sin:return s=>Math.sin(r[0](s));case k.Cos:return s=>Math.cos(r[0](s));case k.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case k.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function P_(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ui(n.args[r]);return r=>{for(let s=0;s<t-1;s+=2)if(i[s](r))return i[s+1](r);return i[t-1](r)}}function M_(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ui(n.args[r]);return r=>{const s=i[0](r);for(let o=1;o<t-1;o+=2)if(s===i[o](r))return i[o+1](r);return i[t-1](r)}}function F_(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ui(n.args[r]);return r=>{const s=i[0](r),o=i[1](r);let a,l;for(let c=2;c<t;c+=2){const h=i[c](r);let u=i[c+1](r);const d=Array.isArray(u);if(d&&(u=l_(u)),h>=o)return c===2?u:d?k_(s,o,a,l,h,u):Ao(s,o,a,l,h,u);a=h,l=u}return l}}function L_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.ToString:return s=>{const o=r[0](s);return n.args[0].type===hi?mh(o):o.toString()};default:throw new Error(`Unsupported convert operator ${t}`)}}function Ao(n,e,t,i,r,s){const o=r-t;if(o===0)return i;const a=e-t,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(s-i)}function k_(n,e,t,i,r,s){if(r-t===0)return i;const a=Yf(i),l=Yf(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[Ao(n,e,t,a[0],r,l[0]),Ao(n,e,t,a[1],r,l[1]),a[2]+Ao(n,e,t,0,r,c),Ao(n,e,t,i[3],r,s[3])];return c_(h)}const W={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class xh extends Ws{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=typeof r=="function"?W.IDLE:r,this.image_=null,this.loader=typeof r=="function"?r:null}changed(){this.dispatchEvent(K.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==W.IDLE&&this.loader){this.state=W.LOADING,this.changed();const e=this.getResolution(),t=Array.isArray(e)?e[0]:e;qn(()=>this.loader(this.getExtent(),t,this.getPixelRatio())).then(i=>{"image"in i&&(this.image_=i.image),"extent"in i&&(this.extent=i.extent),"resolution"in i&&(this.resolution=i.resolution),"pixelRatio"in i&&(this.pixelRatio_=i.pixelRatio),(i instanceof HTMLImageElement||ey&&i instanceof ImageBitmap||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(this.image_=i),this.state=W.LOADED}).catch(i=>{this.state=W.ERROR,console.error(i)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}}function D_(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[ta(i,K.LOAD,function(){o=!0,s||e()})];return i.src&&Bd?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(ta(i,K.ERROR,t)),function(){r=!1,a.forEach(Te)}}function O_(n,e){return new Promise((t,i)=>{function r(){o(),t(n)}function s(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",r),n.removeEventListener("error",s)}n.addEventListener("load",r),n.addEventListener("error",s)})}function G_(n,e){return e&&(n.src=e),n.src&&Bd?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):O_(n)}class B_{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const t in this.cache_){const i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,i){const r=Eh(e,t,i);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,i){const r=Eh(e,t,i);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,i,r,s){const o=Eh(e,t,i),a=o in this.cache_;this.cache_[o]=r,s&&(r.getImageState()===W.IDLE&&r.load(),r.getImageState()===W.LOADING?r.ready().then(()=>{this.patternCache_[o]=Ta().createPattern(r.getImage(1),"repeat")}):this.patternCache_[o]=Ta().createPattern(r.getImage(1),"repeat")),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function Eh(n,e,t){const i=t?ss(t):"null";return e+":"+n+":"+i}const ei=new B_;let mo=null;class tg extends Ws{constructor(e,t,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=r===void 0?W.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===W.LOADED){mo||(mo=Me(1,1,void 0,{willReadFrequently:!0})),mo.drawImage(this.image_,0,0);try{mo.getImageData(0,0,1,1),this.tainted_=!1}catch{mo=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(K.CHANGE)}handleImageError_(){this.imageState_=W.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=W.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],t=this.size_[1],i=Me(e,t);i.fillRect(0,0,e,t),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===W.IDLE){this.image_||this.initializeImage_(),this.imageState_=W.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&G_(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==W.LOADED)return;const t=this.image_,i=Me(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=i.canvas;i.scale(e,e),i.drawImage(t,0,0),i.globalCompositeOperation="multiply",i.fillStyle=o_(this.color_),i.fillRect(0,0,r.width/e,r.height/e),i.globalCompositeOperation="destination-in",i.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===W.LOADED||this.imageState_===W.ERROR)e();else{const t=()=>{(this.imageState_===W.LOADED||this.imageState_===W.ERROR)&&(this.removeEventListener(K.CHANGE,t),e())};this.addEventListener(K.CHANGE,t)}})),this.ready_}}function Fa(n,e,t,i,r,s){let o=e===void 0?void 0:ei.get(e,t,r);return o||(o=new tg(n,n&&"src"in n?n.src||void 0:e,t,i,r),ei.set(e,t,r,o,s)),s&&o&&!ei.getPattern(e,t,r)&&ei.set(e,t,r,o,s),o}function Ii(n){return n?Array.isArray(n)?mh(n):typeof n=="object"&&"src"in n?N_(n):n:null}function N_(n){if(!n.offset||!n.size)return ei.getPattern(n.src,"anonymous",n.color);const e=n.src+":"+n.offset,t=ei.getPattern(e,void 0,n.color);if(t)return t;const i=ei.get(n.src,"anonymous",null);if(i.getImageState()!==W.LOADED)return null;const r=Me(n.size[0],n.size[1]);return r.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),Fa(r.canvas,e,void 0,W.LOADED,n.color,!0),ei.getPattern(e,void 0,n.color)}const ig="10px sans-serif",Mt="#000",as="round",Hi=[],Xi=0,ls="round",yo=10,_o="#000",xo="center",La="middle",fr=[0,0,0,0],Eo=1,gr=new Ci;let wo=null,ng;const wh={},z_=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function j_(n,e,t){return`${n} ${e} 16px "${t}"`}const U_=(function(){let e,t;async function i(s){await t.ready;const o=await t.load(s);if(o.length===0)return!1;const a=qc(s),l=a.families[0].toLowerCase(),c=a.weight;return o.some(h=>{const u=h.family.replace(/^['"]|['"]$/g,"").toLowerCase(),d=Zc[h.weight]||h.weight;return u===l&&h.style===a.style&&d==c})}async function r(){await t.ready;let s=!0;const o=gr.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const c=a[l];let h=o[c];h<100&&(await i(c)?(Vs(wh),gr.set(c,100)):(h+=10,gr.set(c,h,!0),h<100&&(s=!1)))}e=void 0,s||(e=setTimeout(r,100))}return async function(s){t||(t=ut?self.fonts:document.fonts);const o=qc(s);if(!o)return;const a=o.families;let l=!1;for(const c of a){if(z_.has(c))continue;const h=j_(o.style,o.weight,c);gr.get(h)===void 0&&(gr.set(h,0,!0),l=!0)}l&&(clearTimeout(e),e=setTimeout(r,100))}})(),V_=(function(){let n;return function(e){let t=wh[e];if(t==null){if(ut){const i=qc(e),r=rg(e,"Žg");t=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);wh[e]=t}return t}})();function rg(n,e){return wo||(wo=Me(1,1)),n!=ng&&(wo.font=n,ng=wo.font),wo.measureText(e)}function sg(n,e){return rg(n,e).width}function og(n,e,t){if(e in t)return t[e];const i=e.split(`
20
+ `).reduce((r,s)=>Math.max(r,sg(n,s)),0);return t[e]=i,i}function W_(n,e){const t=[],i=[],r=[];let s=0,o=0,a=0,l=0;for(let c=0,h=e.length;c<=h;c+=2){const u=e[c];if(u===`
21
+ `||c===h){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}const d=e[c+1]||n.font,g=sg(d,u);t.push(g),o+=g;const f=V_(d);i.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function H_(n,e,t,i,r,s,o,a,l,c,h){n.save(),t!==1&&(n.globalAlpha===void 0?n.globalAlpha=u=>u.globalAlpha*=t:n.globalAlpha*=t),e&&n.transform.apply(n,e),i.contextInstructions?(n.translate(l,c),n.scale(h[0],h[1]),X_(i,n)):h[0]<0||h[1]<0?(n.translate(l,c),n.scale(h[0],h[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,c,o*h[0],a*h[1]),n.restore()}function X_(n,e){const t=n.contextInstructions;for(let i=0,r=t.length;i<r;i+=2)Array.isArray(t[i+1])?e[t[i]].apply(e,t[i+1]):e[t[i]]=t[i+1]}class ka{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=it(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ka({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,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 Q()}getImage(e){return Q()}getHitDetectionImage(){return Q()}getPixelRatio(e){return 1}getImageState(){return Q()}getImageSize(){return Q()}getOrigin(){return Q()}getSize(){return Q()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=it(e)}listenImageChange(e){Q()}load(){Q()}unlistenImageChange(e){Q()}ready(){return Promise.resolve()}}class Da extends ka{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?W.LOADING:W.LOADED,this.imageState_===W.LOADING&&this.ready().then(()=>this.imageState_=W.LOADED),this.render()}clone(){const e=this.getScale(),t=new Da({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(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}getAnchor(){const e=this.size_,t=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-t[0]/i[0],e[1]/2+t[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){var s,o;const t=(s=this.fill_)==null?void 0:s.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(",");let r=(o=ei.get(i,null,null))==null?void 0:o.getImage(1);if(!r){const a=this.renderOptions_,l=Math.ceil(a.size*e),c=Me(l,l);this.draw_(a,c,e),r=c.canvas,ei.set(i,null,null,new tg(r,void 0,null,W.LOADED,null))}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}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(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,i){if(t===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return t;let r=this.radius,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const w=r;r=s,s=w}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=s*Math.sin(a),c=Math.sqrt(s*s-l*l),h=r-c,u=Math.sqrt(l*l+h*h),d=u/l;if(e==="miter"&&d<=i)return d*t;const g=t/2/d,f=t/2*(h/u),A=Math.sqrt((r+g)*(r+g)+f*f)-r;if(this.radius2_===void 0||e==="bevel")return A*2;const m=r*Math.sin(a),y=Math.sqrt(r*r-m*m),E=s-y,_=Math.sqrt(m*m+E*E)/m;if(_<=i){const w=_*t/2-s-r;return 2*Math.max(A,w)}return A*2}createRenderOptions(){let e=as,t=ls,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=Ii(this.stroke_.getColor()??_o),a=this.stroke_.getWidth()??Eo,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??ls,e=this.stroke_.getLineCap()??as,i=this.stroke_.getMiterLimit()??yo);const l=this.calculateLineJoinSize_(t,a,i),c=Math.max(this.radius,this.radius2_||0),h=Math.ceil(2*c+l);return{strokeStyle:o,strokeWidth:a,size:h,lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:t,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,i){if(t.scale(i,i),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let r=this.fill_.getColor();r===null&&(r=Mt),t.fillStyle=Ii(r),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let i=this.fill_.getColor(),r=0;typeof i=="string"&&(i=ss(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(t=Me(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_;const i=this.radius;if(t===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(t*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/t;for(let a=0;a<t;a++){const l=s+a*o,c=a%2===0?i:r;e.lineTo(c*Math.cos(l),c*Math.sin(l))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=Mt,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class pr extends Da{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){const e=this.getScale(),t=new pr({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}setRadius(e){this.radius=e,this.render()}}class Vt{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new Vt({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const t=Fa(null,e.src,"anonymous",void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===W.IDLE&&t.load(),t.getImageState()===W.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?Y(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:ss(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function ag(n,e,t,i){return t!==void 0&&i!==void 0?[t/n,i/e]:t!==void 0?t/n:i!==void 0?i/e:1}class Ar extends ka{constructor(e){e=e||{};const t=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,r=e.scale!==void 0?e.scale:1,s=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:t,rotation:i,scale:r,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:s,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null;const o=e.img!==void 0?e.img:null;let a=e.src;me(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||Y(o)),me(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),me(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(e.src!==void 0?l=W.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?W.LOADED:W.IDLE:l=W.LOADING:l=W.LOADED),this.color_=e.color!==void 0?ss(e.color):null,this.iconImage_=Fa(o,a,this.crossOrigin_,l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let c,h;if(e.size)[c,h]=e.size;else{const u=this.getImage(1);if(u.width&&u.height)c=u.width,h=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=e;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(ag(g[0],g[1],e.width,e.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(ag(c,h,e.width,e.height))}}clone(){let e,t,i;return this.initialOptions_?(t=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new Ar({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_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:t,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=r[0]),this.anchorYUnits_=="fraction"&&(e[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+r[1])}this.normalizedAnchor_=e}const t=this.getDisplacement(),i=this.getScaleArray();return[e[0]-t[0]/i[0],e[1]+t[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=Fa(null,e,this.crossOrigin_,W.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==W.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==W.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(K.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(K.CHANGE,e)}ready(){return this.iconImage_.ready()}}class ti{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new ti({color:Array.isArray(e)?e.slice():e||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(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}class rt{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=hg,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new rt({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=hg,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function Y_(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(me(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let vh=null;function lg(n,e){if(!vh){const t=new Vt({color:"rgba(255,255,255,0.4)"}),i=new ti({color:"#3399CC",width:1.25});vh=[new rt({image:new pr({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return vh}function cg(){const n={},e=[255,255,255,1],t=[0,153,255,1],i=3;return n.Polygon=[new rt({fill:new Vt({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new rt({stroke:new ti({color:e,width:i+2})}),new rt({stroke:new ti({color:t,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new rt({image:new pr({radius:i*2,fill:new Vt({color:t}),stroke:new ti({color:e,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function hg(n){return n.getGeometry()}const K_="#333";class Oa{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=it(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new Vt({color:K_}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Oa({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof Vt?this.getFill().clone():this.getFill(),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,declutterMode:this.getDeclutterMode()})}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_}getKeepUpright(){return this.keepUpright_}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_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=it(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}function Z_(n){return!0}function q_(n){const e=Zf(),t=Q_(n,e),i=eg();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,e.featureId){const o=r.getId();o!==void 0?i.featureId=o:i.featureId=null}return e.geometryType&&(i.geometryType=$f(r.getGeometry())),t(i)}}function ug(n){const e=Zf(),t=n.length,i=new Array(t);for(let o=0;o<t;++o)i[o]=Ch(n[o],e);const r=eg(),s=new Array(t);return function(o,a){if(r.properties=o.getPropertiesInternal(),r.resolution=a,e.featureId){const c=o.getId();c!==void 0?r.featureId=c:r.featureId=null}let l=0;for(let c=0;c<t;++c){const h=i[c](r);h&&(s[l]=h,l+=1)}return s.length=l,s}}function Q_(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r){const s=n[r],o="filter"in s?Wi(s.filter,wt,e):Z_;let a;if(Array.isArray(s.style)){const l=s.style.length;a=new Array(l);for(let c=0;c<l;++c)a[c]=Ch(s.style[c],e)}else a=[Ch(s.style,e)];i[r]={filter:o,styles:a}}return function(r){const s=[];let o=!1;for(let a=0;a<t;++a){const l=i[a].filter;if(l(r)&&!(n[a].else&&o)){o=!0;for(const c of i[a].styles){const h=c(r);h&&s.push(h)}}}return s}}function Ch(n,e){const t=vo(n,"",e),i=Co(n,"",e),r=J_(n,e),s=$_(n,e),o=Ft(n,"z-index",e);if(!t&&!i&&!r&&!s&&!un(n))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(n));const a=new rt;return function(l){let c=!0;if(t){const h=t(l);h&&(c=!1),a.setFill(h)}if(i){const h=i(l);h&&(c=!1),a.setStroke(h)}if(r){const h=r(l);h&&(c=!1),a.setText(h)}if(s){const h=s(l);h&&(c=!1),a.setImage(h)}return o&&a.setZIndex(o(l)),c?null:a}}function vo(n,e,t){let i;if(e+"fill-pattern-src"in n)i=nx(n,e+"fill-",t);else{if(n[e+"fill-color"]==="none")return s=>null;i=bh(n,e+"fill-color",t)}if(!i)return null;const r=new Vt;return function(s){const o=i(s);return o===ch?null:(r.setColor(o),r)}}function Co(n,e,t){const i=Ft(n,e+"stroke-width",t),r=bh(n,e+"stroke-color",t);if(!i&&!r)return null;const s=Yi(n,e+"stroke-line-cap",t),o=Yi(n,e+"stroke-line-join",t),a=dg(n,e+"stroke-line-dash",t),l=Ft(n,e+"stroke-line-dash-offset",t),c=Ft(n,e+"stroke-miter-limit",t),h=new ti;return function(u){if(r){const d=r(u);if(d===ch)return null;h.setColor(d)}if(i&&h.setWidth(i(u)),s){const d=s(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(d)}return a&&h.setLineDash(a(u)),l&&h.setLineDashOffset(l(u)),c&&h.setMiterLimit(c(u)),h}}function J_(n,e){const t="text-",i=Yi(n,t+"value",e);if(!i)return null;const r=vo(n,t,e),s=vo(n,t+"background-",e),o=Co(n,t,e),a=Co(n,t+"background-",e),l=Yi(n,t+"font",e),c=Ft(n,t+"max-angle",e),h=Ft(n,t+"offset-x",e),u=Ft(n,t+"offset-y",e),d=cs(n,t+"overflow",e),g=Yi(n,t+"placement",e),f=Ft(n,t+"repeat",e),p=Ba(n,t+"scale",e),A=cs(n,t+"rotate-with-view",e),m=Ft(n,t+"rotation",e),y=Yi(n,t+"align",e),E=Yi(n,t+"justify",e),x=Yi(n,t+"baseline",e),_=cs(n,t+"keep-upright",e),w=dg(n,t+"padding",e),v=za(n,t+"declutter-mode"),C=new Oa({declutterMode:v});return function(b){if(C.setText(i(b)),r&&C.setFill(r(b)),s&&C.setBackgroundFill(s(b)),o&&C.setStroke(o(b)),a&&C.setBackgroundStroke(a(b)),l&&C.setFont(l(b)),c&&C.setMaxAngle(c(b)),h&&C.setOffsetX(h(b)),u&&C.setOffsetY(u(b)),d&&C.setOverflow(d(b)),g){const T=g(b);if(T!=="point"&&T!=="line")throw new Error("Expected point or line for text-placement");C.setPlacement(T)}if(f&&C.setRepeat(f(b)),p&&C.setScale(p(b)),A&&C.setRotateWithView(A(b)),m&&C.setRotation(m(b)),y){const T=y(b);if(T!=="left"&&T!=="center"&&T!=="right"&&T!=="end"&&T!=="start")throw new Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(T)}if(E){const T=E(b);if(T!=="left"&&T!=="right"&&T!=="center")throw new Error("Expected left, right, or center for text-justify");C.setJustify(T)}if(x){const T=x(b);if(T!=="bottom"&&T!=="top"&&T!=="middle"&&T!=="alphabetic"&&T!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(T)}return w&&C.setPadding(w(b)),_&&C.setKeepUpright(_(b)),C}}function $_(n,e){return"icon-src"in n?ex(n,e):"shape-points"in n?tx(n,e):"circle-radius"in n?ix(n,e):null}function ex(n,e){const t="icon-",i=t+"src",r=Ag(n[i],i),s=Ga(n,t+"anchor",e),o=Ba(n,t+"scale",e),a=Ft(n,t+"opacity",e),l=Ga(n,t+"displacement",e),c=Ft(n,t+"rotation",e),h=cs(n,t+"rotate-with-view",e),u=gg(n,t+"anchor-origin"),d=pg(n,t+"anchor-x-units"),g=pg(n,t+"anchor-y-units"),f=ax(n,t+"color"),p=sx(n,t+"cross-origin"),A=ox(n,t+"offset"),m=gg(n,t+"offset-origin"),y=Na(n,t+"width"),E=Na(n,t+"height"),x=rx(n,t+"size"),_=za(n,t+"declutter-mode"),w=new Ar({src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:g,color:f,crossOrigin:p,offset:A,offsetOrigin:m,height:E,width:y,size:x,declutterMode:_});return function(v){return a&&w.setOpacity(a(v)),l&&w.setDisplacement(l(v)),c&&w.setRotation(c(v)),h&&w.setRotateWithView(h(v)),o&&w.setScale(o(v)),s&&w.setAnchor(s(v)),w}}function tx(n,e){const t="shape-",i=t+"points",r=t+"radius",s=Th(n[i],i),o=Th(n[r],r),a=vo(n,t,e),l=Co(n,t,e),c=Ba(n,t+"scale",e),h=Ga(n,t+"displacement",e),u=Ft(n,t+"rotation",e),d=cs(n,t+"rotate-with-view",e),g=Na(n,t+"radius2"),f=Na(n,t+"angle"),p=za(n,t+"declutter-mode"),A=new Da({points:s,radius:o,radius2:g,angle:f,declutterMode:p});return function(m){return a&&A.setFill(a(m)),l&&A.setStroke(l(m)),h&&A.setDisplacement(h(m)),u&&A.setRotation(u(m)),d&&A.setRotateWithView(d(m)),c&&A.setScale(c(m)),A}}function ix(n,e){const t="circle-",i=vo(n,t,e),r=Co(n,t,e),s=Ft(n,t+"radius",e),o=Ba(n,t+"scale",e),a=Ga(n,t+"displacement",e),l=Ft(n,t+"rotation",e),c=cs(n,t+"rotate-with-view",e),h=za(n,t+"declutter-mode"),u=new pr({radius:5,declutterMode:h});return function(d){return s&&u.setRadius(s(d)),i&&u.setFill(i(d)),r&&u.setStroke(r(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),c&&u.setRotateWithView(c(d)),o&&u.setScale(o(d)),u}}function Ft(n,e,t){if(!(e in n))return;const i=Wi(n[e],ue,t);return function(r){return Th(i(r),e)}}function Yi(n,e,t){if(!(e in n))return null;const i=Wi(n[e],Pt,t);return function(r){return Ag(i(r),e)}}function nx(n,e,t){const i=Yi(n,e+"pattern-src",t),r=fg(n,e+"pattern-offset",t),s=fg(n,e+"pattern-size",t),o=bh(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function cs(n,e,t){if(!(e in n))return null;const i=Wi(n[e],wt,t);return function(r){const s=i(r);if(typeof s!="boolean")throw new Error(`Expected a boolean for ${e}`);return s}}function bh(n,e,t){if(!(e in n))return null;const i=Wi(n[e],hi,t);return function(r){return mg(i(r),e)}}function dg(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr,t);return function(r){return bo(i(r),e)}}function Ga(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr,t);return function(r){const s=bo(i(r),e);if(s.length!==2)throw new Error(`Expected two numbers for ${e}`);return s}}function fg(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr,t);return function(r){return yg(i(r),e)}}function Ba(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr|ue,t);return function(r){return lx(i(r),e)}}function Na(n,e){const t=n[e];if(t!==void 0){if(typeof t!="number")throw new Error(`Expected a number for ${e}`);return t}}function rx(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return it(t);if(!Array.isArray(t))throw new Error(`Expected a number or size array for ${e}`);if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return t}}function sx(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);return t}}function gg(n,e){const t=n[e];if(t!==void 0){if(t!=="bottom-left"&&t!=="bottom-right"&&t!=="top-left"&&t!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return t}}function pg(n,e){const t=n[e];if(t!==void 0){if(t!=="pixels"&&t!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return t}}function ox(n,e){const t=n[e];if(t!==void 0)return bo(t,e)}function za(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);if(t!=="declutter"&&t!=="obstacle"&&t!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return t}}function ax(n,e){const t=n[e];if(t!==void 0)return mg(t,e)}function bo(n,e){if(!Array.isArray(n))throw new Error(`Expected an array for ${e}`);const t=n.length;for(let i=0;i<t;++i)if(typeof n[i]!="number")throw new Error(`Expected an array of numbers for ${e}`);return n}function Ag(n,e){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}function Th(n,e){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}function mg(n,e){if(typeof n=="string")return n;const t=bo(n,e),i=t.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return t}function yg(n,e){const t=bo(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function lx(n,e){return typeof n=="number"?n:yg(n,e)}const _g={RENDER_ORDER:"renderOrder"};class Rh extends is{constructor(e){e=e||{};const t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(_g.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new Wf(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(_g.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?lg:e;const t=cx(e);this.styleFunction_=e===null?void 0:Y_(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function cx(n){if(n===void 0)return lg;if(!n)return null;if(typeof n=="function"||n instanceof rt)return n;if(!Array.isArray(n))return ug([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof rt){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!(o instanceof rt))throw new Error("Expected a list of style instances");r[s]=o}return r}if("style"in t){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!("style"in o))throw new Error("Expected a list of rules with a style property");r[s]=o}return q_(r)}return ug(n)}class xg extends Nt{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}class hx extends js{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){Q()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Ti(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),gf(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let c;const h=t.viewState;function u(x,_,w,v){return s.call(o,_,x?w:null,v)}const d=h.projection,g=gc(e.slice(),d),f=[[0,0]];if(d.canWrapX()&&r){const x=d.getExtent(),_=ne(x);f.push([-_,0],[_,0])}const p=t.layerStatesArray,A=p.length,m=[],y=[];for(let x=0;x<f.length;x++)for(let _=A-1;_>=0;--_){const w=p[_],v=w.layer;if(v.hasRenderer()&&oh(w,h)&&a.call(l,v)){const C=v.getRenderer(),b=v.getSource();if(C&&b){const T=b.getWrapX()?g:e,I=u.bind(null,w.managed);y[0]=T[0]+f[x][0],y[1]=T[1]+f[x][1],c=C.forEachFeatureAtCoordinate(y,t,i,I,m)}if(c)return c}}if(m.length===0)return;const E=1/m.length;return m.forEach((x,_)=>x.distanceSq+=_*E),m.sort((x,_)=>x.distanceSq-_.distanceSq),m.some(x=>c=x.callback(x.feature,x.layer,x.geometry)),c}hasFeatureAtCoordinate(e,t,i,r,s,o){return this.forEachFeatureAtCoordinate(e,t,i,r,Wr,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){Q()}scheduleExpireIconCache(e){ei.canExpireCache()&&e.postRenderFunctions.push(ux)}}function ux(n,e){ei.expire()}class dx extends hx{constructor(e){super(e),this.fontChangeListenerKey_=ce(gr,Vr.PROPERTYCHANGE,e.redrawText,e),this.element_=ut?Df():document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=ba+" ol-layers";const i=e.getViewport();i&&i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const i=this.getMap();if(i.hasListener(e)){const r=new xg(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){Te(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent($t.PRECOMPOSE,e);const t=e.layerStatesArray.sort((c,h)=>c.zIndex-h.zIndex);t.some(c=>c.layer instanceof Rh&&c.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let c=0,h=t.length;c<h;++c){const u=t[c];e.layerIndex=c;const d=u.layer,g=d.getSourceState();if(!oh(u,r)||g!="ready"&&g!="undefined"){d.unrender();continue}const f=d.render(e,o);f&&(f!==o&&(this.children_.push(f),o=f),s.push(u))}this.declutter(e,s),b0(this.element_,this.children_);const l=this.getMap().getTargetElement();if(xn(l)){const c=l.getContext("2d");for(const h of this.children_){const u=h.firstElementChild||h,d=h.style.backgroundColor;if(d&&(!xn(u)||u.width>0)&&(c.fillStyle=d,c.fillRect(0,0,l.width,l.height)),xn(u)&&u.width>0){const g=h.style.opacity||u.style.opacity;c.globalAlpha=g===""?1:Number(g);const f=u.style.transform;if(f)c.setTransform(...Sc(f));else{const p=parseFloat(u.style.width)/u.width,A=parseFloat(u.style.height)/u.height;c.setTransform(p,0,0,A,0,0)}c.drawImage(u,0,0)}}c.globalAlpha=1,c.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent($t.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let i=t.length-1;i>=0;--i){const r=t[i],s=r.layer;s.getDeclutter()&&s.renderDeclutter(e,r)}t.forEach(i=>i.layer.renderDeferred(e))}}}function Eg(n){if(n instanceof is){n.setMapInternal(null);return}n instanceof Si&&n.getLayers().forEach(Eg)}function wg(n,e){if(n instanceof is){n.setMapInternal(e);return}if(n instanceof Si){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)wg(t[i],e)}}let To=class extends Ci{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=fx(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:$m,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=St(),this.pixelToCoordinateTransform_=St(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,ut||(this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,ut||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(ut?new Rt:Gf()),this.interactions=t.interactions||(ut?new Rt:K0({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new zd(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(At.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(At.VIEW,this.handleViewChanged_),this.addChangeListener(At.SIZE,this.handleSizeChanged_),this.addChangeListener(At.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof Ri)&&e.view.then(function(r){i.setView(new Ri(r))}),this.controls.addEventListener(pt.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(pt.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(pt.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(pt.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(pt.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(pt.REMOVE,r=>{const s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){wg(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){var e;this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),(e=this.resizeObserver_)==null||e.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Wr,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,t,null,o,null)}getFeaturesAtPixel(e,t){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},t),i}getAllLayers(){const e=[];function t(i){i.forEach(function(r){r instanceof Si?t(r.getLayers()):e.push(r)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const r=t.layerFilter!==void 0?t.layerFilter:Wr,s=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(At.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return sr(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?$e(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(At.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof Rt){t.setLayers(e);return}const i=t.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t];if(!r.visible)continue;const s=r.layer.getRenderer();if(s&&!s.ready)return!0;const o=r.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(e){const t=je(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?$e(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(At.SIZE)}getView(){return this.get(At.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,i,r){return ny(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){t=t||e.type;const i=new Ni(t,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===rc.POINTERDOWN||i===K.WHEEL||i===K.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=t.target,a=s instanceof ShadowRoot?s.host===o?s.host.ownerDocument:s:s===r?r.documentElement:s;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=0;s--){const o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const o=e.viewHints;if(o[De.ANIMATING]||o[De.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener($t.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent($t.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Xr(dn.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Xr(dn.LOADSTART,this,e))));const i=this.postRenderFunctions_;if(e)for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){var i,r;if(this.mapBrowserEventHandler_){for(let s=0,o=this.targetChangeHandlerKeys_.length;s<o;++s)Te(this.targetChangeHandlerKeys_[s]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(K.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(K.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!xn(this.targetElement_)){(i=this.resizeObserver_)==null||i.unobserve(this.targetElement_);const s=this.targetElement_.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.unobserve(s.host),this.setSize(void 0)}const e=this.getTarget(),t=typeof e=="string"?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{if(xn(t)||t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new dx(this)),!xn(t)){this.mapBrowserEventHandler_=new ty(this,this.moveTolerance_);for(const o in he)this.mapBrowserEventHandler_.addEventListener(he[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(K.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(K.WHEEL,this.boundHandleBrowserEvent_,Nd?{passive:!1}:!1);let s;if(this.keyboardEventTarget_)s=this.keyboardEventTarget_;else{const o=t.getRootNode();s=o instanceof ShadowRoot?o.host:t}if(this.targetChangeHandlerKeys_=[ce(s,K.KEYDOWN,this.handleBrowserEvent,this),ce(s,K.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){const o=t.getRootNode();o instanceof ShadowRoot&&this.resizeObserver_.observe(o.host),(r=this.resizeObserver_)==null||r.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Te(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Te(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=ce(e,Vr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ce(e,K.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Te),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new vn("addlayer",e)),this.layerGroupPropertyListenerKeys_=[ce(e,Vr.PROPERTYCHANGE,this.render,this),ce(e,K.CHANGE,this.render,this),ce(e,"addlayer",this.handleLayerAdd_,this),ce(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;const e=this.frameState_.layerStatesArray;for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){Eg(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(t!==void 0&&Kf(t)&&i&&i.isDef()){const o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:aa(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Y(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=aa(a.nextCenter,a.nextResolution,l,t)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!er(this.previousExtent_)&&!Vi(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Xr(dn.MOVESTART,this,r)),this.previousExtent_=Yr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[De.ANIMATING]&&!s.viewHints[De.INTERACTING]&&!Vi(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Xr(dn.MOVEEND,this,s)),Vd(s.extent,this.previousExtent_))),this.dispatchEvent(new Xr(dn.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(dn.LOADSTART)||this.hasListener(dn.LOADEND)||this.hasListener($t.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new vn("removelayer",t)),this.set(At.LAYERGROUP,e)}setSize(e){this.set(At.SIZE,e)}setTarget(e){this.set(At.TARGET,e)}setView(e){if(!e||e instanceof Ri){this.set(At.VIEW,e);return}this.set(At.VIEW,new Ri);const t=this;e.then(function(i){t.setView(new Ri(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){let r,s;if(xn(e))r=e.width,s=e.height;else{const o=getComputedStyle(e);r=e.offsetWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight)-parseFloat(o.borderRightWidth),s=e.offsetHeight-parseFloat(o.borderTopWidth)-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom)-parseFloat(o.borderBottomWidth)}!isNaN(r)&&!isNaN(s)&&(t=[Math.max(0,r),Math.max(0,s)],!Kf(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&qd("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!Bi(t,i))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function fx(n){let e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const t={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Si({layers:n.layers});t[At.LAYERGROUP]=i,t[At.TARGET]=n.target,t[At.VIEW]=n.view instanceof Ri?n.view:new Ri;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Rt(n.controls.slice()):(me(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new Rt(n.interactions.slice()):(me(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new Rt(n.overlays.slice()):(me(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Rt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}class Wt extends Ci{constructor(e){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_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new Wt(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const i=this.getStyle();return i&&e.setStyle(i),e}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_&&(Te(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=ce(e,K.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?gx(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function gx(n){if(typeof n=="function")return n;let e;return Array.isArray(n)?e=n:(me(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[n]),function(){return e}}function vg(n,e,t,i){const r=[];let s=jt();for(let o=0,a=t.length;o<a;++o){const l=t[o];s=lc(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}function ja(n,e,t,i,r,s,o){let a,l;const c=(t-e)/i;if(c===1)a=e;else if(c===2)a=e,l=r;else if(c!==0){let h=n[e],u=n[e+1],d=0;const g=[0];for(let A=e+i;A<t;A+=i){const m=n[A],y=n[A+1];d+=Math.sqrt((m-h)*(m-h)+(y-u)*(y-u)),g.push(d),h=m,u=y}const f=r*d,p=Xm(g,f);p<0?(l=(f-g[-p-2])/(g[-p-1]-g[-p-2]),a=e+(-p-2)*i):a=e+p*i}o=o>1?o:2,s=s||new Array(o);for(let h=0;h<o;++h)s[h]=a===void 0?NaN:l===void 0?n[a+h]:zt(n[a+h],n[a+i+h],l);return s}function Sh(n,e,t,i,r,s){if(t==e)return null;let o;if(r<n[e+i-1])return s?(o=n.slice(e,e+i),o[i-1]=r,o):null;if(n[t-1]<r)return s?(o=n.slice(t-i,t),o[i-1]=r,o):null;if(r==n[e+i-1])return n.slice(e,e+i);let a=e/i,l=t/i;for(;a<l;){const d=a+l>>1;r<n[(d+1)*i-1]?l=d:a=d+1}const c=n[a*i-1];if(r==c)return n.slice((a-1)*i,(a-1)*i+i);const h=n[(a+1)*i-1],u=(r-c)/(h-c);o=[];for(let d=0;d<i-1;++d)o.push(zt(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function px(n,e,t,i,r,s,o){if(o)return Sh(n,e,t[t.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let l=0,c=t.length;l<c;++l){const h=t[l];if(e!=h){if(r<n[e+i-1])return null;if(r<=n[h-1])return Sh(n,e,h,i,r,!1);e=h}}return null}class Ua extends yn{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new Ua(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=e-s[0],a=t-s[1],l=o*o+a*a;if(l<r){if(l===0)for(let c=0;c<this.stride;++c)i[c]=s[c];else{const c=this.getRadius()/Math.sqrt(l);i[0]=s[0]+c*o,i[1]=s[1]+c*a;for(let h=2;h<this.stride;++h)i[h]=s[h]}return i.length=this.stride,l}return r}containsXY(e,t){const i=this.flatCoordinates,r=e-i[0],s=t-i[1];return r*r+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const t=this.flatCoordinates,i=t[this.stride]-t[0];return bi(t[0]-i,t[1]-i,t[0]+i,t[1]+i,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return"Circle"}intersectsExtent(e){const t=this.getExtent();if(ze(e,t)){const i=this.getCenter();return e[0]<=i[0]&&e[2]>=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:hc(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+i;for(let s=1;s<t;++s)r[t+s]=e[s];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,i){this.setLayout(i,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const r=this.flatCoordinates;let s=xf(r,0,e,this.stride);r[s++]=r[0]+t;for(let o=1,a=this.stride;o<a;++o)r[s++]=r[o];r.length=s,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter(Ic(i,0,i.length,r,e,t,i)),this.changed()}}Ua.prototype.transform;class Ro extends Af{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Te),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,i=e.length;t<i;++t)this.changeEventsKeys_.push(ce(e[t],K.CHANGE,this.changed,this))}clone(){const e=new Ro(Ih(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Jn(this.getExtent(),e,t))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(e,t,i,r);return r}containsXY(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(e,t))return!0;return!1}computeExtent(e){Yr(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)cc(e,t[i].getExtent());return e}getGeometries(){return Ih(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].getType()===this.getType()?e=e.concat(t[i].getGeometriesArrayRecursive()):e.push(t[i]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],l=a.getSimplifiedGeometry(e);t.push(l),l!==a&&(r=!0)}return r?new Ro(t):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)if(t[i].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(e,t);this.changed()}scale(e,t,i){i||(i=Ut(this.getExtent()));const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)r[s].scale(e,t,i);this.changed()}setGeometries(e){this.setGeometriesArray(Ih(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].applyTransform(e);this.changed()}translate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Ih(n){return n.map(e=>e.clone())}function Ph(n,e,t,i){let r=n[e],s=n[e+1],o=0;for(let a=e+i;a<t;a+=i){const l=n[a],c=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(c-s)*(c-s)),r=l,s=c}return o}class ii extends yn{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){vi(this.flatCoordinates,e),this.changed()}clone(){const e=new ii(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return Cf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!="XYM"&&this.layout!="XYZM"?null:(t=t!==void 0?t:!1,Sh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return Ph(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new ii(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return Ea(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_a(this.flatCoordinates,0,e,this.stride),this.changed()}}class bn extends yn{constructor(e,t,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&i)this.setFlatCoordinates(t,e),this.ends_=i;else{const r=e,s=[],o=[];for(let l=0,c=r.length;l<c;++l){const h=r[l];vi(s,h.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(e){vi(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new bn(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Mc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lc(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))}getCoordinateAtM(e,t,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(t=t!==void 0?t:!1,i=i!==void 0?i:!1,px(this.flatCoordinates,0,this.ends_,this.stride,e,t,i))}getCoordinates(){return io(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new ii(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o],c=new ii(e.slice(s,l),i);r.push(c),s=l}return r}getLength(){const e=this.ends_;let t=0,i=0;for(let r=0,s=e.length;r<s;++r)i+=Ph(this.flatCoordinates,t,e[r],this.stride),t=e[r];return i}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const l=r[o],c=ja(t,i,l,s,.5);vi(e,c),i=l}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=wf(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new bn(t,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(e){return d0(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=to(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class mr extends yn{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){vi(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new mr(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Jn(this.getExtent(),e,t))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,l=s.length;a<l;a+=o){const c=zi(e,t,s[a],s[a+1]);if(c<r){r=c;for(let h=0;h<o;++h)i[h]=s[a+h];i.length=o}}return r}getCoordinates(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new It(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,i=this.stride,r=[];for(let s=0,o=e.length;s<o;s+=i){const a=new It(e.slice(s,s+i),t);r.push(a)}return r}getType(){return"MultiPoint"}intersectsExtent(e){const t=this.flatCoordinates,i=this.stride;for(let r=0,s=t.length;r<s;r+=i){const o=t[r],a=t[r+1];if(oc(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_a(this.flatCoordinates,0,e,this.stride),this.changed()}}class Tn extends yn{constructor(e,t,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){const r=e,s=[],o=[];for(let a=0,l=r.length;a<l;++a){const c=r[a],h=s.length,u=c.getEnds();for(let d=0,g=u.length;d<g;++d)u[d]+=h;vi(s,c.getFlatCoordinates()),o.push(u)}t=r.length===0?this.getLayout():r[0].getLayout(),e=s,i=o}t!==void 0&&i?(this.setFlatCoordinates(t,e),this.endss_=i):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;vi(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let r=0,s=t.length;r<s;++r)t[r]+=i}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let r=0;r<e;++r)t[r]=this.endss_[r].slice();const i=new Tn(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(o0(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),a0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return u0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return s0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),zc(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,kc(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=vg(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=vf(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new mr(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Rf(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=zc(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=c0(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new Tn(t,"XY",i)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const s=this.endss_[e-1];t=s[s.length-1]}const i=this.endss_[e].slice(),r=i[i.length-1];if(t!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=t;return new Jt(this.flatCoordinates.slice(t,r),this.layout,i)}getPolygons(){const e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o].slice(),c=l[l.length-1];if(s!==0)for(let u=0,d=l.length;u<d;++u)l[u]-=s;const h=new Jt(t.slice(s,c),e,l);r.push(h),s=c}return r}getType(){return"MultiPolygon"}intersectsExtent(e){return f0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ef(this.flatCoordinates,0,e,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}const Cg=St();class ht{constructor(e,t,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?Ys(this.flatCoordinates_):lc(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=Ut(this.getExtent());this.flatInteriorPoints_=Gc(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=jc(this.flatCoordinates_,this.ends_),t=vg(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=vf(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=ja(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=ja(e,t,o,2,.5);vi(this.flatMidpoints_,a),t=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=ye(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=Oe(i)/Oe(t);Ti(Cg,i[0],i[3],r,-r,0,0,0),mn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Cg,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new ht(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=kd((e,t)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),t&&this.simplifiedGeometry_.applyTransform(t);const i=this.simplifiedGeometry_.getFlatCoordinates();let r;switch(this.type_){case"LineString":i.length=xa(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=wf(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=Dc(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new ht(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}ht.prototype.getFlatCoordinates=ht.prototype.getOrientedFlatCoordinates;function Ax(n){const e=n.getType();switch(e){case"Point":return new It(n.getFlatCoordinates());case"MultiPoint":return new mr(n.getFlatCoordinates(),"XY");case"LineString":return new ii(n.getFlatCoordinates(),"XY");case"MultiLineString":return new bn(n.getFlatCoordinates(),"XY",n.getEnds());case"Polygon":const t=n.getFlatCoordinates(),i=n.getEnds(),r=jc(t,i);return r.length>1?new Tn(t,"XY",r):new Jt(t,"XY",i);default:throw new Error("Invalid geometry type:"+e)}}function bg(n,e){const t=n.getId(),i=Ax(n),r=n.getProperties(),s=new Wt;return s.setGeometry(i),t!==void 0&&s.setId(t),s.setProperties(r,!0),s}class Tg{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Wt,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let i=t.dataProjection?ye(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()==="tile-pixels"&&(i=ye(i),i.setWorldExtent(t.extent)),t={dataProjection:i,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return Q()}readFeature(e,t){return Q()}readFeatures(e,t){return Q()}readGeometry(e,t){return Q()}readProjection(e){return Q()}writeFeature(e,t){return Q()}writeFeatures(e,t){return Q()}writeGeometry(e,t){return Q()}}function Va(n,e,t){const i=t?ye(t.featureProjection):null,r=t?ye(t.dataProjection):null;let s=n;if(i&&r&&!tt(i,r)){e&&(s=n.clone());const o=e?i:r,a=e?r:i;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(rr(o,a))}if(e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(l){for(let c=0,h=l.length;c<h;++c)l[c]=Math.round(l[c]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const mx={Point:It,LineString:ii,Polygon:Jt,MultiPoint:mr,MultiLineString:bn,MultiPolygon:Tn};function yx(n,e,t){return Array.isArray(e[0])?(Rf(n,0,e,t)||(n=n.slice(),zc(n,0,e,t)),n):(Nc(n,0,e,t)||(n=n.slice(),wa(n,0,e,t)),n)}function Rg(n,e){var s;const t=n.geometry;if(!t)return[];if(Array.isArray(t))return t.map(o=>Rg({...n,geometry:o})).flat();const i=t.type==="MultiPolygon"?"Polygon":t.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const r=t.layout.length;return Va(new ht(i,i==="Polygon"?yx(t.flatCoordinates,t.ends,r):t.flatCoordinates,(s=t.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,e)}function Mh(n,e){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Mh(r,e));return new Ro(i)}const t=mx[n.type];return Va(new t(n.flatCoordinates,n.layout||"XY",n.ends),!1,e)}class _x extends Tg{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(Wa(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(Wa(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return Q()}readFeaturesFromObject(e,t){return Q()}readGeometry(e,t){return this.readGeometryFromObject(Wa(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return Q()}readProjection(e){return this.readProjectionFromObject(Wa(e))}readProjectionFromObject(e){return Q()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return Q()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return Q()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return Q()}}function Wa(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}return n!==null?n:null}class Fh extends _x{constructor(e){e=e||{},super(),this.dataProjection=ye(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=ye(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let i=null;e.type==="Feature"?i=e:i={type:"Feature",geometry:e,properties:null};const r=Lh(i.geometry);if(this.featureClass===ht)return Rg({geometry:r,id:i.id,properties:i.properties},t);const s=new Wt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(Mh(r,t)),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(e,t){const i=e;let r=null;if(i.type==="FeatureCollection"){const s=e;r=[];const o=s.features;for(let a=0,l=o.length;a<l;++a){const c=this.readFeatureFromObject(o[a],t);c&&r.push(c)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return xx(e,t)}readProjectionFromObject(e){const t=e.crs;let i;if(t)if(t.type=="name")i=ye(t.properties.name);else if(t.type==="EPSG")i=ye("EPSG:"+t.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={type:"Feature",geometry:null,properties:null},r=e.getId();if(r!==void 0&&(i.id=r),!e.hasProperties())return i;const s=e.getProperties(),o=e.getGeometry();return o&&(i.geometry=kh(o,t),delete s[e.getGeometryName()]),un(s)||(i.properties=s),i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{type:"FeatureCollection",features:i}}writeGeometryObject(e,t){return kh(e,this.adaptOptions(t))}}function Lh(n,e){if(!n)return null;let t;switch(n.type){case"Point":{t=wx(n);break}case"LineString":{t=vx(n);break}case"Polygon":{t=Rx(n);break}case"MultiPoint":{t=bx(n);break}case"MultiLineString":{t=Cx(n);break}case"MultiPolygon":{t=Tx(n);break}case"GeometryCollection":{t=Ex(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return t}function xx(n,e){const t=Lh(n);return Mh(t,e)}function Ex(n,e){return n.geometries.map(function(i){return Lh(i)})}function wx(n){const e=n.coordinates;return{type:"Point",flatCoordinates:e,layout:or(e.length)}}function vx(n){var i;const e=n.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:or(((i=e[0])==null?void 0:i.length)||2)}}function Cx(n){var s,o;const e=n.coordinates,t=((o=(s=e[0])==null?void 0:s[0])==null?void 0:o.length)||2,i=[],r=to(i,0,e,t);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:or(t)}}function bx(n){var t;const e=n.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:or(((t=e[0])==null?void 0:t.length)||2)}}function Tx(n){var s,o;const e=n.coordinates,t=[],i=((o=(s=e[0])==null?void 0:s[0])==null?void 0:o[0].length)||2,r=Ef(t,0,e,i);return{type:"MultiPolygon",flatCoordinates:t,ends:r,layout:or(i)}}function Rx(n){var s,o;const e=n.coordinates,t=[],i=(o=(s=e[0])==null?void 0:s[0])==null?void 0:o.length,r=to(t,0,e,i);return{type:"Polygon",flatCoordinates:t,ends:r,layout:or(i)}}function kh(n,e){n=Va(n,!0,e);const t=n.getType();let i;switch(t){case"Point":{i=Lx(n);break}case"LineString":{i=Ix(n);break}case"Polygon":{i=kx(n,e);break}case"MultiPoint":{i=Mx(n);break}case"MultiLineString":{i=Px(n);break}case"MultiPolygon":{i=Fx(n,e);break}case"GeometryCollection":{i=Sx(n,e);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function Sx(n,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return kh(i,e)})}}function Ix(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function Px(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function Mx(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function Fx(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function Lx(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function kx(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}var Dx=8,Ox={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Gx={"*":{type:"source"}},Bx=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Nx={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},zx={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},jx={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ux={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Vx={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Wx={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Hx={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Xx=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Yx={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Kx={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Zx={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},qx={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qx={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Jx={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},$x={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},e1={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},t1={type:"array",value:"*"},i1={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},n1={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},r1={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},s1={type:"array",value:"*",minimum:1},o1={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},a1={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},l1={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},c1={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},h1=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],u1={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},d1={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},f1={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},g1={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},p1={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},A1={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},m1={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},y1={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_1={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},x1={"*":{type:"string"}},E1={$version:Dx,$root:Ox,sources:Gx,source:Bx,source_vector:Nx,source_raster:zx,source_raster_dem:jx,source_geojson:Ux,source_video:Vx,source_image:Wx,layer:Hx,layout:Xx,layout_background:Yx,layout_fill:Kx,layout_circle:Zx,layout_heatmap:qx,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Qx,layout_symbol:Jx,layout_raster:$x,layout_hillshade:e1,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:t1,filter_operator:i1,geometry_type:n1,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:r1,expression:s1,light:o1,sky:a1,terrain:l1,projection:c1,paint:h1,paint_fill:u1,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:d1,paint_circle:f1,paint_heatmap:g1,paint_symbol:p1,paint_raster:A1,paint_hillshade:m1,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:y1,transition:_1,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:x1};const w1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function v1(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return w1.forEach(i=>{i in e&&(t[i]=e[i])}),t}function Sg(n){n=n.slice();const e=Object.create(null);for(let t=0;t<n.length;t++)e[n[t].id]=n[t];for(let t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=v1(n[t],e[n[t].ref]));return n}class Pi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Dh{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new Dh(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}}const Ha={kind:"null"},N={kind:"number"},ie={kind:"string"},ee={kind:"boolean"},Mi={kind:"color"},Xa={kind:"projectionDefinition"},yr={kind:"object"},$={kind:"value"},C1={kind:"error"},Ya={kind:"collator"},Ka={kind:"formatted"},Za={kind:"padding"},So={kind:"colorArray"},qa={kind:"numberArray"},Io={kind:"resolvedImage"},Qa={kind:"variableAnchorOffsetCollection"};function Ht(n,e){return{kind:"array",itemType:n,N:e}}function Ge(n){if(n.kind==="array"){const e=Ge(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const b1=[Ha,N,ie,ee,Mi,Xa,Ka,yr,Ht($),Za,qa,So,Io,Qa];function Po(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Po(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const t of b1)if(!Po(t,e))return null}}return`Expected ${Ge(n)} but found ${Ge(e)} instead.`}function Oh(n,e){return e.some(t=>t.kind===n.kind)}function _r(n,e){return e.some(t=>t==="null"?n===null:t==="array"?Array.isArray(n):t==="object"?n&&!Array.isArray(n)&&typeof n=="object":t===typeof n)}function Rn(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Ig=.96422,Pg=1,Mg=.82521,Fg=4/29,hs=6/29,Lg=3*hs*hs,T1=hs*hs*hs,R1=Math.PI/180,S1=180/Math.PI;function kg(n){return n=n%360,n<0&&(n+=360),n}function Dg([n,e,t,i]){n=Gh(n),e=Gh(e),t=Gh(t);let r,s;const o=Bh((.2225045*n+.7168786*e+.0606169*t)/Pg);n===e&&e===t?r=s=o:(r=Bh((.4360747*n+.3850649*e+.1430804*t)/Ig),s=Bh((.0139322*n+.0971045*e+.7141733*t)/Mg));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function Gh(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Bh(n){return n>T1?Math.pow(n,.3333333333333333):n/Lg+Fg}function Og([n,e,t,i]){let r=(n+16)/116,s=isNaN(e)?r:r+e/500,o=isNaN(t)?r:r-t/200;return r=Pg*zh(r),s=Ig*zh(s),o=Mg*zh(o),[Nh(3.1338561*s-1.6168667*r-.4906146*o),Nh(-.9787684*s+1.9161415*r+.033454*o),Nh(.0719453*s-.2289914*r+1.4052427*o),i]}function Nh(n){return n=n<=.00304?12.92*n:1.055*Math.pow(n,.4166666666666667)-.055,n<0?0:n>1?1:n}function zh(n){return n>hs?n*n*n:Lg*(n-Fg)}function I1(n){const[e,t,i,r]=Dg(n),s=Math.sqrt(t*t+i*i);return[Math.round(s*1e4)?kg(Math.atan2(i,t)*S1):NaN,s,e,r]}function P1([n,e,t,i]){return n=isNaN(n)?0:n*R1,Og([t,Math.cos(n)*e,Math.sin(n)*e,i])}function M1([n,e,t,i]){n=kg(n),e/=100,t/=100;function r(s){const o=(s+n/30)%12,a=e*Math.min(t,1-t);return t-a*Math.max(-1,Math.min(o-3,9-o,1))}return[r(0),r(8),r(4),i]}const F1=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Gg(n,e){return F1(n,e)?n[e]:void 0}function L1(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=Gg(k1,n);if(e){const[r,s,o]=e;return[r/255,s/255,o/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const s=n.length<6?1:2;let o=1;return[Ja(n.slice(o,o+=s)),Ja(n.slice(o,o+=s)),Ja(n.slice(o,o+=s)),Ja(n.slice(o,o+s)||"ff")]}if(n.startsWith("rgb")){const r=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,s=n.match(r);if(s){const[o,a,l,c,h,u,d,g,f,p,A,m]=s,y=[c||" ",d||" ",p].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){const E=[l,u,f].join(""),x=E==="%%%"?100:E===""?255:0;if(x){const _=[us(+a/x,0,1),us(+h/x,0,1),us(+g/x,0,1),A?Bg(+A,m):1];if(Ng(_))return _}}return}}const t=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,i=n.match(t);if(i){const[r,s,o,a,l,c,h,u,d]=i,g=[o||" ",l||" ",h].join("");if(g===" "||g===" /"||g===",,"||g===",,,"){const f=[+s,us(+a,0,100),us(+c,0,100),u?Bg(+u,d):1];if(Ng(f))return M1(f)}}}function Ja(n){return parseInt(n.padEnd(2,n),16)/255}function Bg(n,e){return us(e?n/100:n,0,1)}function us(n,e,t){return Math.min(Math.max(e,n),t)}function Ng(n){return!n.some(Number.isNaN)}const k1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function xr(n,e,t){return n+t*(e-n)}function Mo(n,e,t){return n.map((i,r)=>xr(i,e[r],t))}class xe{constructor(e,t,i,r=1,s=!0){this.r=e,this.g=t,this.b=i,this.a=r,s||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[e,t,i,r]))}static parse(e){if(e instanceof xe)return e;if(typeof e!="string")return;const t=L1(e);if(t)return new xe(...t,!1)}get rgb(){const{r:e,g:t,b:i,a:r}=this,s=r||1/0;return this.overwriteGetter("rgb",[e/s,t/s,i/s,r])}get hcl(){return this.overwriteGetter("hcl",I1(this.rgb))}get lab(){return this.overwriteGetter("lab",Dg(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,i,r]=this.rgb;return`rgba(${[e,t,i].map(s=>Math.round(s*255)).join(",")},${r})`}static interpolate(e,t,i,r="rgb"){switch(r){case"rgb":{const[s,o,a,l]=Mo(e.rgb,t.rgb,i);return new xe(s,o,a,l,!1)}case"hcl":{const[s,o,a,l]=e.hcl,[c,h,u,d]=t.hcl;let g,f;if(!isNaN(s)&&!isNaN(c)){let E=c-s;c>s&&E>180?E-=360:c<s&&s-c>180&&(E+=360),g=s+i*E}else isNaN(s)?isNaN(c)?g=NaN:(g=c,(a===1||a===0)&&(f=h)):(g=s,(u===1||u===0)&&(f=o));const[p,A,m,y]=P1([g,f??xr(o,h,i),xr(a,u,i),xr(l,d,i)]);return new xe(p,A,m,y,!1)}case"lab":{const[s,o,a,l]=Og(Mo(e.lab,t.lab,i));return new xe(s,o,a,l,!1)}}}}xe.black=new xe(0,0,0,1),xe.white=new xe(1,1,1,1),xe.transparent=new xe(0,0,0,0),xe.red=new xe(1,0,0,1);class jh{constructor(e,t,i){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const D1=["bottom","center","top"];class Uh{constructor(e,t,i,r,s,o){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=s,this.verticalAlign=o}}class Ki{constructor(e){this.sections=e}static fromString(e){return new Ki([new Uh(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ki?e:Ki.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class di{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof di)return e;if(typeof e=="number")return new di([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if(typeof t!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new di(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new di(Mo(e.values,t.values,i))}}class fi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof fi)return e;if(typeof e=="number")return new fi([e]);if(Array.isArray(e)){for(const t of e)if(typeof t!="number")return;return new fi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new fi(Mo(e.values,t.values,i))}}class Xt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xt)return e;if(typeof e=="string"){const i=xe.parse(e);return i?new Xt([i]):void 0}if(!Array.isArray(e))return;const t=[];for(const i of e){if(typeof i!="string")return;const r=xe.parse(i);if(!r)return;t.push(r)}return new Xt(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i,r="rgb"){const s=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let o=0;o<e.values.length;o++)s.push(xe.interpolate(e.values[o],t.values[o],i,r));return new Xt(s)}}class Ue extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const O1=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Fi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Fi)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t<e.length;t+=2){const i=e[t],r=e[t+1];if(typeof i!="string"||!O1.has(i)||!Array.isArray(r)||r.length!==2||typeof r[0]!="number"||typeof r[1]!="number")return}return new Fi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){const r=e.values,s=t.values;if(r.length!==s.length)throw new Ue(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const o=[];for(let a=0;a<r.length;a+=2){if(r[a]!==s[a])throw new Ue(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${r[a]}, to[${a}]: ${s[a]}`);o.push(r[a]);const[l,c]=r[a+1],[h,u]=s[a+1];o.push([xr(l,h,i),xr(c,u,i)])}return new Fi(o)}}class Sn{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Sn({name:e,available:!1}):null}}class gi{constructor(e,t,i){this.from=e,this.to=t,this.transition=i}static interpolate(e,t,i){return new gi(e,t,i)}static parse(e){if(e instanceof gi)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new gi(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new gi(e.from,e.to,e.transition);if(typeof e=="string")return new gi(e,e,1)}}function zg(n,e,t,i){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof i>"u"||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[n,e,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[n,e,t,i]:[n,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Fo(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof gi||n instanceof xe||n instanceof jh||n instanceof Ki||n instanceof di||n instanceof fi||n instanceof Xt||n instanceof Fi||n instanceof Sn)return!0;if(Array.isArray(n)){for(const e of n)if(!Fo(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!Fo(n[e]))return!1;return!0}else return!1}function et(n){if(n===null)return Ha;if(typeof n=="string")return ie;if(typeof n=="boolean")return ee;if(typeof n=="number")return N;if(n instanceof xe)return Mi;if(n instanceof gi)return Xa;if(n instanceof jh)return Ya;if(n instanceof Ki)return Ka;if(n instanceof di)return Za;if(n instanceof fi)return qa;if(n instanceof Xt)return So;if(n instanceof Fi)return Qa;if(n instanceof Sn)return Io;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=et(i);if(!t)t=r;else{if(t===r)continue;t=$;break}}return Ht(t||$,e)}else return yr}function Lo(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof xe||n instanceof gi||n instanceof Ki||n instanceof di||n instanceof fi||n instanceof Xt||n instanceof Fi||n instanceof Sn?n.toString():JSON.stringify(n)}class ds{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Fo(e[1]))return t.error("invalid value");const i=e[1];let r=et(i);const s=t.expectedType;return r.kind==="array"&&r.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(r=s),new ds(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const $a={string:ie,number:N,boolean:ee,object:yr};class pi{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=1,r;const s=e[0];if(s==="array"){let a;if(e.length>2){const c=e[1];if(typeof c!="string"||!(c in $a)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=$a[c],i++}else a=$;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],i++}r=Ht(a,l)}else{if(!$a[s])throw new Error(`Types doesn't contain name = ${s}`);r=$a[s]}const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,$);if(!a)return null;o.push(a)}return new pi(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(Po(this.type,et(i))){if(t===this.args.length-1)throw new Ue(`Expected value to be of type ${Ge(this.type)}, but found ${Ge(et(i))} instead.`)}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const jg={"to-boolean":ee,"to-color":Mi,"to-number":N,"to-string":ie};class In{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0];if(!jg[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return t.error("Expected one argument.");const r=jg[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,$);if(!a)return null;s.push(a)}return new In(r,s)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,i;for(const r of this.args){if(t=r.evaluate(e),i=null,t instanceof xe)return t;if(typeof t=="string"){const s=e.parseColor(t);if(s)return s}else if(Array.isArray(t)&&(t.length<3||t.length>4?i=`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:i=zg(t[0],t[1],t[2],t[3]),!i))return new xe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ue(i||`Could not parse color from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const i of this.args){t=i.evaluate(e);const r=di.parse(t);if(r)return r}throw new Ue(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const i of this.args){t=i.evaluate(e);const r=fi.parse(t);if(r)return r}throw new Ue(`Could not parse numberArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const i of this.args){t=i.evaluate(e);const r=Xt.parse(t);if(r)return r}throw new Ue(`Could not parse colorArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const i of this.args){t=i.evaluate(e);const r=Fi.parse(t);if(r)return r}throw new Ue(`Could not parse variableAnchorOffsetCollection from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const i of this.args){if(t=i.evaluate(e),t===null)return 0;const r=Number(t);if(!isNaN(r))return r}throw new Ue(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ki.fromString(Lo(this.args[0].evaluate(e)));case"resolvedImage":return Sn.fromString(Lo(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Lo(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const G1=["Unknown","Point","LineString","Polygon"];class Ug{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?G1[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=xe.parse(e),this._parseColorCache.set(e,t)),t}}class el{constructor(e,t,i=[],r,s=new Dh,o=[]){this.registry=e,this.path=i,this.key=i.map(a=>`[${a}]`).join(""),this.scope=s,this.errors=o,this.expectedType=r,this._isConstant=t}parse(e,t,i,r,s={}){return t?this.concat(t,i,r)._parse(e,s):this._parse(e,s)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(r,s,o){return o==="assert"?new pi(s,[r]):o==="coerce"?new In(s,[r]):r}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=e[0];if(typeof r!="string")return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){const a=this.expectedType,l=o.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&l.kind==="value")o=i(o,a,t.typeAnnotation||"assert");else if(a.kind==="projectionDefinition"&&["string","array"].includes(l.kind)||["color","formatted","resolvedImage"].includes(a.kind)&&["value","string"].includes(l.kind)||["padding","numberArray"].includes(a.kind)&&["value","number","array"].includes(l.kind)||a.kind==="colorArray"&&["value","string","array"].includes(l.kind)||a.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(l.kind))o=i(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(o instanceof ds)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new Ug;try{o=new ds(o.type,o.evaluate(a))}catch(l){return this.error(l.message),null}}return o}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i){const r=typeof e=="number"?this.path.concat(e):this.path,s=i?this.scope.concat(i):this.scope;return new el(this.registry,this._isConstant,r,t||null,s,this.errors)}error(e,...t){const i=`${this.key}${t.map(r=>`[${r}]`).join("")}`;this.errors.push(new Pi(i,e))}checkSubtype(e,t){const i=Po(e,t);return i&&this.error(i),i}}class tl{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let s=1;s<e.length-1;s+=2){const o=e[s];if(typeof o!="string")return t.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",s);const a=t.parse(e[s+1],s+1);if(!a)return null;i.push([o,a])}const r=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return r?new tl(i,r):null}outputDefined(){return this.result.outputDefined()}}class il{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new il(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Vh{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,N),r=t.parse(e[2],2,Ht(t.expectedType||$));if(!i||!r)return null;const s=r.type;return new Vh(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new Ue(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new Ue(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new Ue(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Wh{constructor(e,t){this.type=ee,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,$),r=t.parse(e[2],2,$);return!i||!r?null:Oh(i.type,[ee,ie,N,Ha,$])?new Wh(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!_r(t,["boolean","string","number","null"]))throw new Ue(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(et(t))} instead.`);if(!_r(i,["string","array"]))throw new Ue(`Expected second argument to be of type array or string, but found ${Ge(et(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class nl{constructor(e,t,i){this.type=N,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,$),r=t.parse(e[2],2,$);if(!i||!r)return null;if(!Oh(i.type,[ee,ie,N,Ha,$]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new nl(i,r,s):null}else return new nl(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!_r(t,["boolean","string","number","null"]))throw new Ue(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(et(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),_r(i,["string"])){const s=i.indexOf(t,r);return s===-1?-1:[...i.slice(0,s)].length}else{if(_r(i,["array"]))return i.indexOf(t,r);throw new Ue(`Expected second argument to be of type array or string, but found ${Ge(et(i))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Hh{constructor(e,t,i,r,s,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=s,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let i,r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);const s={},o=[];for(let c=2;c<e.length-1;c+=2){let h=e[c];const u=e[c+1];Array.isArray(h)||(h=[h]);const d=t.concat(c);if(h.length===0)return d.error("Expected at least one branch label.");for(const f of h){if(typeof f!="number"&&typeof f!="string")return d.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return d.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof f=="number"&&Math.floor(f)!==f)return d.error("Numeric branch labels must be integer values.");if(!i)i=et(f);else if(d.checkSubtype(i,et(f)))return null;if(typeof s[String(f)]<"u")return d.error("Branch labels must be unique.");s[String(f)]=o.length}const g=t.parse(u,c,r);if(!g)return null;r=r||g.type,o.push(g)}const a=t.parse(e[1],1,$);if(!a)return null;const l=t.parse(e[e.length-1],e.length-1,r);return!l||a.type.kind!=="value"&&t.concat(1).checkSubtype(i,a.type)?null:new Hh(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(et(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Xh{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const r=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,ee);if(!a)return null;const l=t.parse(e[o+1],o+1,i);if(!l)return null;r.push([a,l]),i=i||l.type}const s=t.parse(e[e.length-1],e.length-1,i);if(!s)return null;if(!i)throw new Error("Can't infer output type");return new Xh(i,r,s)}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class rl{constructor(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,$),r=t.parse(e[2],2,N);if(!i||!r)return null;if(!Oh(i.type,[Ht($),ie,$]))return t.error(`Expected first argument to be of type array or string, but found ${Ge(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new rl(i.type,i,r,s):null}else return new rl(i.type,i,r)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);let r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),_r(t,["string"]))return[...t].slice(i,r).join("");if(_r(t,["array"]))return t.slice(i,r);throw new Ue(`Expected first argument to be of type array or string, but found ${Ge(et(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Vg(n,e){const t=n.length-1;let i=0,r=t,s=0,o,a;for(;i<=r;)if(s=Math.floor((i+r)/2),o=n[s],a=n[s+1],o<=e){if(s===t||e<a)return s;i=s+1}else if(o>e)r=s-1;else throw new Ue("Input is not a number.");return 0}class sl{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[r,s]of i)this.labels.push(r),this.outputs.push(s)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,N);if(!i)return null;const r=[];let s=null;t.expectedType&&t.expectedType.kind!=="value"&&(s=t.expectedType);for(let o=1;o<e.length;o+=2){const a=o===1?-1/0:e[o],l=e[o+1],c=o,h=o+1;if(typeof a!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(r.length&&r[r.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);const u=t.parse(l,h,s);if(!u)return null;s=s||u.type,r.push([a,u])}return new sl(s,i,r)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=Vg(t,r);return i[o].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function B1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yh,Wg;function N1(){if(Wg)return Yh;Wg=1,Yh=n;function n(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=i,this.p2y=r}return n.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,r=0;r<8;r++){var s=this.sampleCurveX(i)-e;if(Math.abs(s)<t)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i=i-s/o}var a=0,l=1;for(i=e,r=0;r<20&&(s=this.sampleCurveX(i),!(Math.abs(s-e)<t));r++)e>s?a=i:l=i,i=(l-a)*.5+a;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Yh}var z1=N1(),j1=B1(z1);class Li{constructor(e,t,i,r,s){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of s)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,i,r){let s=0;if(e.name==="exponential")s=Kh(t,e.base,i,r);else if(e.name==="linear")s=Kh(t,1,i,r);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new j1(o[0],o[1],o[2],o[3]).solve(Kh(t,1,i,r))}return s}static parse(e,t){let[i,r,s,...o]=e;if(!Array.isArray(r)||r.length===0)return t.error("Expected an interpolation type expression.",1);if(r[0]==="linear")r={name:"linear"};else if(r[0]==="exponential"){const c=r[1];if(typeof c!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:c}}else if(r[0]==="cubic-bezier"){const c=r.slice(1);if(c.length!==4||c.some(h=>typeof h!="number"||h<0||h>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:c}}else return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(s=t.parse(s,2,N),!s)return null;const a=[];let l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&t.expectedType!=So?l=Mi:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){const h=o[c],u=o[c+1],d=c+3,g=c+4;if(typeof h!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);const f=t.parse(u,g,l);if(!f)return null;l=l||f.type,a.push([h,f])}return!Rn(l,N)&&!Rn(l,Xa)&&!Rn(l,Mi)&&!Rn(l,Za)&&!Rn(l,qa)&&!Rn(l,So)&&!Rn(l,Qa)&&!Rn(l,Ht(N))?t.error(`Type ${Ge(l)} is not interpolatable.`):new Li(l,i,r,s,a)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=Vg(t,r),a=t[o],l=t[o+1],c=Li.interpolationFactor(this.interpolation,r,a,l),h=i[o].evaluate(e),u=i[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return xr(h,u,c);case"color":return xe.interpolate(h,u,c);case"padding":return di.interpolate(h,u,c);case"colorArray":return Xt.interpolate(h,u,c);case"numberArray":return fi.interpolate(h,u,c);case"variableAnchorOffsetCollection":return Fi.interpolate(h,u,c);case"array":return Mo(h,u,c);case"projectionDefinition":return gi.interpolate(h,u,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return xe.interpolate(h,u,c,"hcl");case"colorArray":return Xt.interpolate(h,u,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return xe.interpolate(h,u,c,"lab");case"colorArray":return Xt.interpolate(h,u,c,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Kh(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class ko{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=null;const r=t.expectedType;r&&r.kind!=="value"&&(i=r);const s=[];for(const a of e.slice(1)){const l=t.parse(a,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,s.push(l)}if(!i)throw new Error("No output type");return r&&s.some(a=>Po(r,a.type))?new ko($,s):new ko(i,s)}evaluate(e){let t=null,i=0,r;for(const s of this.args)if(i++,t=s.evaluate(e),t&&t instanceof Sn&&!t.available&&(r||(r=t.name),t=null,i===this.args.length&&(t=r)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Hg(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function U1(n,e,t){return e===t}function V1(n,e,t){return e!==t}function W1(n,e,t){return e<t}function H1(n,e,t){return e>t}function X1(n,e,t){return e<=t}function Y1(n,e,t){return e>=t}function Xg(n,e,t,i){return i.compare(e,t)===0}function K1(n,e,t,i){return!Xg(n,e,t,i)}function Z1(n,e,t,i){return i.compare(e,t)<0}function q1(n,e,t,i){return i.compare(e,t)>0}function Q1(n,e,t,i){return i.compare(e,t)<=0}function J1(n,e,t,i){return i.compare(e,t)>=0}function fs(n,e,t){const i=n!=="=="&&n!=="!=";return class rm{constructor(s,o,a){this.type=ee,this.lhs=s,this.rhs=o,this.collator=a,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");const a=s[0];let l=o.parse(s[1],1,$);if(!l)return null;if(!Hg(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${Ge(l.type)}'.`);let c=o.parse(s[2],2,$);if(!c)return null;if(!Hg(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${Ge(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${Ge(l.type)}' and '${Ge(c.type)}'.`);i&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new pi(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new pi(l.type,[c])));let h=null;if(s.length===4){if(l.type.kind!=="string"&&c.type.kind!=="string"&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(h=o.parse(s[3],3,Ya),!h)return null}return new rm(l,c,h)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=et(o),c=et(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new Ue(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${l.kind}, ${c.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const l=et(o),c=et(a);if(l.kind!=="string"||c.kind!=="string")return e(s,o,a)}return this.collator?t(s,o,a,this.collator.evaluate(s)):e(s,o,a)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}}}const $1=fs("==",U1,Xg),eE=fs("!=",V1,K1),tE=fs("<",W1,Z1),iE=fs(">",H1,q1),nE=fs("<=",X1,Q1),rE=fs(">=",Y1,J1);class ol{constructor(e,t,i){this.type=Ya,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");const i=e[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");const r=t.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,ee);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,ee);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ie),!o)?null:new ol(r,s,o)}evaluate(e){return new jh(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Zh{constructor(e,t,i,r,s){this.type=ie,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,N);if(!i)return null;const r=e[2];if(typeof r!="object"||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let s=null;if(r.locale&&(s=t.parse(r.locale,1,ie),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,ie),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=t.parse(r["min-fraction-digits"],1,N),!a))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parse(r["max-fraction-digits"],1,N),!l)?null:new Zh(i,s,o,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class qh{constructor(e){this.type=Ka,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");const r=[];let s=!1;for(let o=1;o<=e.length-1;++o){const a=e[o];if(s&&typeof a=="object"&&!Array.isArray(a)){s=!1;let l=null;if(a["font-scale"]&&(l=t.parse(a["font-scale"],1,N),!l))return null;let c=null;if(a["text-font"]&&(c=t.parse(a["text-font"],1,Ht(ie)),!c))return null;let h=null;if(a["text-color"]&&(h=t.parse(a["text-color"],1,Mi),!h))return null;let u=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!D1.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(u=t.parse(a["vertical-align"],1,ie),!u)return null}const d=r[r.length-1];d.scale=l,d.font=c,d.textColor=h,d.verticalAlign=u}else{const l=t.parse(e[o],1,$);if(!l)return null;const c=l.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,r.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new qh(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return et(r)===Io?new Uh("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Uh(Lo(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)};return new Ki(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Qh{constructor(e){this.type=Io,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,ie);return i?new Qh(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=Sn.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}}class Jh{constructor(e){this.type=N,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${Ge(i.type)} instead.`):new Jh(i):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return[...t].length;if(Array.isArray(t))return t.length;throw new Ue(`Expected value to be of type string or array, but found ${Ge(et(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const ki=8192;function sE(n,e){const t=oE(n[0]),i=lE(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*ki),Math.round(i*r*ki)]}function $h(n,e){const t=Math.pow(2,e.z),i=(n[0]/ki+e.x)/t,r=(n[1]/ki+e.y)/t;return[aE(i),cE(r)]}function oE(n){return(180+n)/360}function aE(n){return n*360-180}function lE(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function cE(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function Do(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function Oo(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function hE(n,e,t){return e[1]>n[1]!=t[1]>n[1]&&n[0]<(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1])+e[0]}function uE(n,e,t){const i=n[0]-e[0],r=n[1]-e[1],s=n[0]-t[0],o=n[1]-t[1];return i*o-s*r===0&&i*s<=0&&r*o<=0}function al(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]],s=[i[0]-t[0],i[1]-t[1]];return pE(s,r)===0?!1:!!(Kg(n,e,t,i)&&Kg(t,i,n,e))}function dE(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(al(n,e,i[r],i[r+1]))return!0;return!1}function gs(n,e,t=!1){let i=!1;for(const r of e)for(let s=0;s<r.length-1;s++){if(uE(n,r[s],r[s+1]))return t;hE(n,r[s],r[s+1])&&(i=!i)}return i}function fE(n,e){for(const t of e)if(gs(n,t))return!0;return!1}function Yg(n,e){for(const t of n)if(!gs(t,e))return!1;for(let t=0;t<n.length-1;++t)if(dE(n[t],n[t+1],e))return!1;return!0}function gE(n,e){for(const t of e)if(Yg(n,t))return!0;return!1}function pE(n,e){return n[0]*e[1]-n[1]*e[0]}function Kg(n,e,t,i){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1],l=i[0]-t[0],c=i[1]-t[1],h=r*c-l*s,u=o*c-l*a;return h>0&&u<0||h<0&&u>0}function eu(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=[];for(let o=0;o<n[r].length;o++){const a=sE(n[r][o],t);Do(e,a),s.push(a)}i.push(s)}return i}function Zg(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=eu(n[r],e,t);i.push(s)}return i}function qg(n,e,t,i){if(n[0]<t[0]||n[0]>t[2]){const r=i*.5;let s=n[0]-t[0]>r?-i:t[0]-n[0]>r?i:0;s===0&&(s=n[0]-t[2]>r?-i:t[2]-n[0]>r?i:0),n[0]+=s}Do(e,n)}function AE(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function Qg(n,e,t,i){const r=Math.pow(2,i.z)*ki,s=[i.x*ki,i.y*ki],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];qg(c,e,t,r),o.push(c)}return o}function Jg(n,e,t,i){const r=Math.pow(2,i.z)*ki,s=[i.x*ki,i.y*ki],o=[];for(const a of n){const l=[];for(const c of a){const h=[c.x+s[0],c.y+s[1]];Do(e,h),l.push(h)}o.push(l)}if(e[2]-e[0]<=r/2){AE(e);for(const a of o)for(const l of a)qg(l,e,t,r)}return o}function mE(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=eu(e.coordinates,i,r),o=Qg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!gs(a,s))return!1}if(e.type==="MultiPolygon"){const s=Zg(e.coordinates,i,r),o=Qg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!fE(a,s))return!1}return!0}function yE(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=eu(e.coordinates,i,r),o=Jg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!Yg(a,s))return!1}if(e.type==="MultiPolygon"){const s=Zg(e.coordinates,i,r),o=Jg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!gE(a,s))return!1}return!0}class Er{constructor(e,t){this.type=ee,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Fo(e[1])){const i=e[1];if(i.type==="FeatureCollection"){const r=[];for(const s of i.features){const{type:o,coordinates:a}=s.geometry;o==="Polygon"&&r.push(a),o==="MultiPolygon"&&r.push(...a)}if(r.length){const s={type:"MultiPolygon",coordinates:r};return new Er(i,s)}}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new Er(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new Er(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return mE(e,this.geometries);if(e.geometryType()==="LineString")return yE(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class $g{constructor(e=[],t=(i,r)=>i<r?-1:i>r?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,r=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(i(r,o)>=0)break;t[e]=o,e=s}t[e]=r}_down(e){const{data:t,compare:i}=this,r=this.length>>1,s=t[e];for(;e<r;){let o=(e<<1)+1;const a=o+1;if(a<this.length&&i(t[a],t[o])<0&&(o=a),i(t[o],s)>=0)break;t[e]=t[o],e=o}t[e]=s}}function _E(n,e){if(n.length<=1)return[n];const i=[];let r,s;for(const o of n){const a=xE(o);a!==0&&(o.area=Math.abs(a),s===void 0&&(s=a<0),s===a<0?(r&&i.push(r),r=[o]):r.push(o))}return r&&i.push(r),i}function xE(n){let e=0;for(let t=0,i=n.length,r=i-1,s,o;t<i;r=t++)s=n[t],o=n[r],e+=(o.x-s.x)*(s.y+o.y);return e}const EE=6378.137,ep=1/298.257223563,tp=ep*(2-ep),ip=Math.PI/180;class tu{constructor(e){const t=ip*EE*1e3,i=Math.cos(e*ip),r=1/(1-tp*(1-i*i)),s=Math.sqrt(r);this.kx=t*s*i,this.ky=t*s*r*(1-tp)}distance(e,t){const i=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(e,t){let i=1/0,r,s,o,a;for(let l=0;l<e.length-1;l++){let c=e[l][0],h=e[l][1],u=this.wrap(e[l+1][0]-c)*this.kx,d=(e[l+1][1]-h)*this.ky,g=0;(u!==0||d!==0)&&(g=(this.wrap(t[0]-c)*this.kx*u+(t[1]-h)*this.ky*d)/(u*u+d*d),g>1?(c=e[l+1][0],h=e[l+1][1]):g>0&&(c+=u/this.kx*g,h+=d/this.ky*g)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-h)*this.ky;const f=u*u+d*d;f<i&&(i=f,r=c,s=h,o=l,a=g)}return{point:[r,s],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}const iu=100,nu=50;function np(n,e){return e[0]-n[0]}function ll(n){return n[1]-n[0]+1}function Zi(n,e){return n[1]>=n[0]&&n[1]<e}function ru(n,e){if(n[0]>n[1])return[null,null];const t=ll(n);if(e){if(t===2)return[n,null];const r=Math.floor(t/2);return[[n[0],n[0]+r],[n[0]+r,n[1]]]}if(t===1)return[n,null];const i=Math.floor(t/2)-1;return[[n[0],n[0]+i],[n[0]+i+1,n[1]]]}function su(n,e){if(!Zi(e,n.length))return[1/0,1/0,-1/0,-1/0];const t=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)Do(t,n[i]);return t}function ou(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const i of t)Do(e,i);return e}function rp(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function au(n,e,t){if(!rp(n)||!rp(e))return NaN;let i=0,r=0;return n[2]<e[0]&&(i=e[0]-n[2]),n[0]>e[2]&&(i=n[0]-e[2]),n[1]>e[3]&&(r=n[1]-e[3]),n[3]<e[1]&&(r=e[1]-n[3]),t.distance([0,0],[i,r])}function wr(n,e,t){const i=t.pointOnLine(e,n);return t.distance(n,i.point)}function lu(n,e,t,i,r){const s=Math.min(wr(n,[t,i],r),wr(e,[t,i],r)),o=Math.min(wr(t,[n,e],r),wr(i,[n,e],r));return Math.min(s,o)}function wE(n,e,t,i,r){if(!(Zi(e,n.length)&&Zi(i,t.length)))return 1/0;let o=1/0;for(let a=e[0];a<e[1];++a){const l=n[a],c=n[a+1];for(let h=i[0];h<i[1];++h){const u=t[h],d=t[h+1];if(al(l,c,u,d))return 0;o=Math.min(o,lu(l,c,u,d,r))}}return o}function vE(n,e,t,i,r){if(!(Zi(e,n.length)&&Zi(i,t.length)))return NaN;let o=1/0;for(let a=e[0];a<=e[1];++a)for(let l=i[0];l<=i[1];++l)if(o=Math.min(o,r.distance(n[a],t[l])),o===0)return o;return o}function CE(n,e,t){if(gs(n,e,!0))return 0;let i=1/0;for(const r of e){const s=r[0],o=r[r.length-1];if(s!==o&&(i=Math.min(i,wr(n,[o,s],t)),i===0))return i;const a=t.pointOnLine(r,n);if(i=Math.min(i,t.distance(n,a.point)),i===0)return i}return i}function bE(n,e,t,i){if(!Zi(e,n.length))return NaN;for(let s=e[0];s<=e[1];++s)if(gs(n[s],t,!0))return 0;let r=1/0;for(let s=e[0];s<e[1];++s){const o=n[s],a=n[s+1];for(const l of t)for(let c=0,h=l.length,u=h-1;c<h;u=c++){const d=l[u],g=l[c];if(al(o,a,d,g))return 0;r=Math.min(r,lu(o,a,d,g,i))}}return r}function sp(n,e){for(const t of n)for(const i of t)if(gs(i,e,!0))return!0;return!1}function TE(n,e,t,i=1/0){const r=ou(n),s=ou(e);if(i!==1/0&&au(r,s,t)>=i)return i;if(Oo(r,s)){if(sp(n,e))return 0}else if(sp(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,h=c-1;l<c;h=l++){const u=a[h],d=a[l];for(const g of e)for(let f=0,p=g.length,A=p-1;f<p;A=f++){const m=g[A],y=g[f];if(al(u,d,m,y))return 0;o=Math.min(o,lu(u,d,m,y,t))}}return o}function op(n,e,t,i,r,s){if(!s)return;const o=au(su(i,s),r,t);o<e&&n.push([o,s,[0,0]])}function cl(n,e,t,i,r,s,o){if(!s||!o)return;const a=au(su(i,s),su(r,o),t);a<e&&n.push([a,s,o])}function hl(n,e,t,i,r=1/0){let s=Math.min(i.distance(n[0],t[0][0]),r);if(s===0)return s;const o=new $g([[0,[0,n.length-1],[0,0]]],np),a=ou(t);for(;o.length>0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],h=e?nu:iu;if(ll(c)<=h){if(!Zi(c,n.length))return NaN;if(e){const u=bE(n,c,t,i);if(isNaN(u)||u===0)return u;s=Math.min(s,u)}else for(let u=c[0];u<=c[1];++u){const d=CE(n[u],t,i);if(s=Math.min(s,d),s===0)return 0}}else{const u=ru(c,e);op(o,s,i,n,a,u[0]),op(o,s,i,n,a,u[1])}}return s}function ul(n,e,t,i,r,s=1/0){let o=Math.min(s,r.distance(n[0],t[0]));if(o===0)return o;const a=new $g([[0,[0,n.length-1],[0,t.length-1]]],np);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],h=l[2],u=e?nu:iu,d=i?nu:iu;if(ll(c)<=u&&ll(h)<=d){if(!Zi(c,n.length)&&Zi(h,t.length))return NaN;let g;if(e&&i)g=wE(n,c,t,h,r),o=Math.min(o,g);else if(e&&!i){const f=n.slice(c[0],c[1]+1);for(let p=h[0];p<=h[1];++p)if(g=wr(t[p],f,r),o=Math.min(o,g),o===0)return o}else if(!e&&i){const f=t.slice(h[0],h[1]+1);for(let p=c[0];p<=c[1];++p)if(g=wr(n[p],f,r),o=Math.min(o,g),o===0)return o}else g=vE(n,c,t,h,r),o=Math.min(o,g)}else{const g=ru(c,e),f=ru(h,i);cl(a,o,r,n,t,g[0],f[0]),cl(a,o,r,n,t,g[0],f[1]),cl(a,o,r,n,t,g[1],f[0]),cl(a,o,r,n,t,g[1],f[1])}}return o}function RE(n,e){const t=n.geometry(),i=t.flat().map(o=>$h([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new tu(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,ul(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,ul(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,hl(i,!1,o.coordinates,r,s));break}if(s===0)return s}return s}function SE(n,e){const t=n.geometry(),i=t.flat().map(o=>$h([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new tu(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,ul(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,ul(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,hl(i,!0,o.coordinates,r,s));break}if(s===0)return s}return s}function IE(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const i=_E(t).map(o=>o.map(a=>a.map(l=>$h([l.x,l.y],n.canonical)))),r=new tu(i[0][0][0][1]);let s=1/0;for(const o of e)for(const a of i){switch(o.type){case"Point":s=Math.min(s,hl([o.coordinates],!1,a,r,s));break;case"LineString":s=Math.min(s,hl(o.coordinates,!0,a,r,s));break;case"Polygon":s=Math.min(s,TE(a,o.coordinates,r,s));break}if(s===0)return s}return s}function cu(n){return n.type==="MultiPolygon"?n.coordinates.map(e=>({type:"Polygon",coordinates:e})):n.type==="MultiLineString"?n.coordinates.map(e=>({type:"LineString",coordinates:e})):n.type==="MultiPoint"?n.coordinates.map(e=>({type:"Point",coordinates:e})):[n]}class vr{constructor(e,t){this.type=N,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Fo(e[1])){const i=e[1];if(i.type==="FeatureCollection")return new vr(i,i.features.map(r=>cu(r.geometry)).flat());if(i.type==="Feature")return new vr(i,cu(i.geometry));if("type"in i&&"coordinates"in i)return new vr(i,cu(i))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return RE(e,this.geometries);if(e.geometryType()==="LineString")return SE(e,this.geometries);if(e.geometryType()==="Polygon")return IE(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Go{constructor(e){this.type=$,this.key=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=e[1];return i==null?t.error("Global state property must be defined."):typeof i!="string"?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Go(i)}evaluate(e){var t;const i=(t=e.globals)===null||t===void 0?void 0:t.globalState;return!i||Object.keys(i).length===0?null:Gg(i,this.key)}eachChild(){}outputDefined(){return!1}}const dl={"==":$1,"!=":eE,">":iE,"<":tE,">=":rE,"<=":nE,array:pi,at:Vh,boolean:pi,case:Xh,coalesce:ko,collator:ol,format:qh,image:Qh,in:Wh,"index-of":nl,interpolate:Li,"interpolate-hcl":Li,"interpolate-lab":Li,length:Jh,let:tl,literal:ds,match:Hh,number:pi,"number-format":Zh,object:pi,slice:rl,step:sl,string:pi,"to-boolean":In,"to-color":In,"to-number":In,"to-string":In,var:il,within:Er,distance:vr,"global-state":Go};class Yt{constructor(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const i=e[0],r=Yt.definitions[i];if(!r)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([c])=>!Array.isArray(c)||c.length===e.length-1);let l=null;for(const[c,h]of a){l=new el(t.registry,fl,t.path,null,t.scope);const u=[];let d=!1;for(let g=1;g<e.length;g++){const f=e[g],p=Array.isArray(c)?c[g-1]:c.type,A=l.parse(f,1+u.length,p);if(!A){d=!0;break}u.push(A)}if(!d){if(Array.isArray(c)&&c.length!==u.length){l.error(`Expected ${c.length} arguments, but found ${u.length} instead.`);continue}for(let g=0;g<u.length;g++){const f=Array.isArray(c)?c[g]:c.type,p=u[g];l.concat(g+1).checkSubtype(f,p.type)}if(l.errors.length===0)return new Yt(i,s,h,u)}}if(a.length===1)t.errors.push(...l.errors);else{const h=(a.length?a:o).map(([d])=>ME(d)).join(" | "),u=[];for(let d=1;d<e.length;d++){const g=t.parse(e[d],1+u.length);if(!g)return null;u.push(Ge(g.type))}t.error(`Expected arguments of type ${h}, but found (${u.join(", ")}) instead.`)}return null}static register(e,t){Yt.definitions=t;for(const i in t)e[i]=Yt}}function ap(n,[e,t,i,r]){e=e.evaluate(n),t=t.evaluate(n),i=i.evaluate(n);const s=r?r.evaluate(n):1,o=zg(e,t,i,s);if(o)throw new Ue(o);return new xe(e/255,t/255,i/255,s,!1)}function lp(n,e){return n in e}function hu(n,e){const t=e[n];return typeof t>"u"?null:t}function PE(n,e,t,i){for(;t<=i;){const r=t+i>>1;if(e[r]===n)return!0;e[r]>n?i=r-1:t=r+1}return!1}function Cr(n){return{type:n}}Yt.register(dl,{error:[C1,[ie],(n,[e])=>{throw new Ue(e.evaluate(n))}],typeof:[ie,[$],(n,[e])=>Ge(et(e.evaluate(n)))],"to-rgba":[Ht(N,4),[Mi],(n,[e])=>{const[t,i,r,s]=e.evaluate(n).rgb;return[t*255,i*255,r*255,s]}],rgb:[Mi,[N,N,N],ap],rgba:[Mi,[N,N,N,N],ap],has:{type:ee,overloads:[[[ie],(n,[e])=>lp(e.evaluate(n),n.properties())],[[ie,yr],(n,[e,t])=>lp(e.evaluate(n),t.evaluate(n))]]},get:{type:$,overloads:[[[ie],(n,[e])=>hu(e.evaluate(n),n.properties())],[[ie,yr],(n,[e,t])=>hu(e.evaluate(n),t.evaluate(n))]]},"feature-state":[$,[ie],(n,[e])=>hu(e.evaluate(n),n.featureState||{})],properties:[yr,[],n=>n.properties()],"geometry-type":[ie,[],n=>n.geometryType()],id:[$,[],n=>n.id()],zoom:[N,[],n=>n.globals.zoom],"heatmap-density":[N,[],n=>n.globals.heatmapDensity||0],elevation:[N,[],n=>n.globals.elevation||0],"line-progress":[N,[],n=>n.globals.lineProgress||0],accumulated:[$,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[N,Cr(N),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[N,Cr(N),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:N,overloads:[[[N,N],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[N],(n,[e])=>-e.evaluate(n)]]},"/":[N,[N,N],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[N,[N,N],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[N,[],()=>Math.LN2],pi:[N,[],()=>Math.PI],e:[N,[],()=>Math.E],"^":[N,[N,N],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[N,[N],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[N,[N],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[N,[N],(n,[e])=>Math.log(e.evaluate(n))],log2:[N,[N],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[N,[N],(n,[e])=>Math.sin(e.evaluate(n))],cos:[N,[N],(n,[e])=>Math.cos(e.evaluate(n))],tan:[N,[N],(n,[e])=>Math.tan(e.evaluate(n))],asin:[N,[N],(n,[e])=>Math.asin(e.evaluate(n))],acos:[N,[N],(n,[e])=>Math.acos(e.evaluate(n))],atan:[N,[N],(n,[e])=>Math.atan(e.evaluate(n))],min:[N,Cr(N),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[N,Cr(N),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[N,[N],(n,[e])=>Math.abs(e.evaluate(n))],round:[N,[N],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[N,[N],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[N,[N],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[ee,[ie,$],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[ee,[$],(n,[e])=>n.id()===e.value],"filter-type-==":[ee,[ie],(n,[e])=>n.geometryType()===e.value],"filter-<":[ee,[ie,$],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<r}],"filter-id-<":[ee,[$],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[ee,[ie,$],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[ee,[$],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[ee,[ie,$],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[ee,[$],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[ee,[ie,$],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[ee,[$],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[ee,[$],(n,[e])=>e.value in n.properties()],"filter-has-id":[ee,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[ee,[Ht(ie)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[ee,[Ht($)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[ee,[ie,Ht($)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[ee,[ie,Ht($)],(n,[e,t])=>PE(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:ee,overloads:[[[ee,ee],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[Cr(ee),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:ee,overloads:[[[ee,ee],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[Cr(ee),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[ee,[ee],(n,[e])=>!e.evaluate(n)],"is-supported-script":[ee,[ie],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[ie,[ie],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[ie,[ie],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[ie,Cr($),(n,e)=>e.map(t=>Lo(t.evaluate(n))).join("")],"resolved-locale":[ie,[Ya],(n,[e])=>e.evaluate(n).resolvedLocale()]});function ME(n){return Array.isArray(n)?`(${n.map(Ge).join(", ")})`:`(${Ge(n.type)}...)`}function fl(n){if(n instanceof il)return fl(n.boundExpression);if(n instanceof Yt&&n.name==="error")return!1;if(n instanceof ol)return!1;if(n instanceof Er)return!1;if(n instanceof vr)return!1;if(n instanceof Go)return!1;const e=n instanceof In||n instanceof pi;let t=!0;return n.eachChild(i=>{e?t=t&&fl(i):t=t&&i instanceof ds}),t?uu(n)&&fu(n,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function uu(n){if(n instanceof Yt){if(n.name==="get"&&n.args.length===1)return!1;if(n.name==="feature-state")return!1;if(n.name==="has"&&n.args.length===1)return!1;if(n.name==="properties"||n.name==="geometry-type"||n.name==="id")return!1;if(/^filter-/.test(n.name))return!1}if(n instanceof Er||n instanceof vr)return!1;let e=!0;return n.eachChild(t=>{e&&!uu(t)&&(e=!1)}),e}function du(n){if(n instanceof Yt&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!du(t)&&(e=!1)}),e}function fu(n,e){if(n instanceof Yt&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!fu(i,e)&&(t=!1)}),t}function gu(n){return{result:"success",value:n}}function ps(n){return{result:"error",value:n}}function FE(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function LE(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function kE(n){return!!n.expression&&n.expression.interpolated}function cp(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&et(n)===yr}class DE{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Ug,this._defaultValue=t?NE(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,r,s,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null;try{const a=this.expression.evaluate(this._evaluator);if(a==null||typeof a=="number"&&a!==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new Ue(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(a)} instead.`);return a}catch(a){return this._warningHistory[a.message]||(this._warningHistory[a.message]=!0,typeof console<"u"&&console.warn(a.message)),this._defaultValue}}}function OE(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in dl}function hp(n,e){const t=new el(dl,fl,[],e?BE(e):void 0),i=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?gu(new DE(i,e)):ps(t.errors)}class up{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!du(t.expression),this.globalStateRefs=pl(t.expression)}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}}class dp{constructor(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!du(t.expression),this.globalStateRefs=pl(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}interpolationFactor(e,t,i){return this.interpolationType?Li.interpolationFactor(this.interpolationType,e,t,i):0}}function GE(n,e){const t=hp(n,e);if(t.result==="error")return t;const i=t.value.expression,r=uu(i);if(!r&&!FE(e))return ps([new Pi("","data expressions not supported")]);const s=fu(i,["zoom"]);if(!s&&!LE(e))return ps([new Pi("","zoom expressions not supported")]);const o=gl(i);if(!o&&!s)return ps([new Pi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Pi)return ps([o]);if(o instanceof Li&&!kE(e))return ps([new Pi("",'"interpolate" expressions cannot be used with this property')]);if(!o)return gu(r?new up("constant",t.value):new up("source",t.value));const a=o instanceof Li?o.interpolation:void 0;return gu(r?new dp("camera",t.value,o.labels,a):new dp("composite",t.value,o.labels,a))}function gl(n){let e=null;if(n instanceof tl)e=gl(n.result);else if(n instanceof ko){for(const t of n.args)if(e=gl(t),e)break}else(n instanceof sl||n instanceof Li)&&n.input instanceof Yt&&n.input.name==="zoom"&&(e=n);return e instanceof Pi||n.eachChild(t=>{const i=gl(t);i instanceof Pi?e=i:!e&&i?e=new Pi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Pi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function pl(n,e=new Set){return n instanceof Go&&e.add(n.key),n.eachChild(t=>{pl(t,e)}),e}function BE(n){const e={color:Mi,string:ie,number:N,enum:ie,boolean:ee,formatted:Ka,padding:Za,numberArray:qa,colorArray:So,projectionDefinition:Xa,resolvedImage:Io,variableAnchorOffsetCollection:Qa};return n.type==="array"?Ht(e[n.value]||$,n.length):e[n.type]}function NE(n){if(n.type==="color"&&cp(n.default))return new xe(0,0,0,0);switch(n.type){case"color":return xe.parse(n.default)||null;case"padding":return di.parse(n.default)||null;case"numberArray":return fi.parse(n.default)||null;case"colorArray":return Xt.parse(n.default)||null;case"variableAnchorOffsetCollection":return Fi.parse(n.default)||null;case"projectionDefinition":return gi.parse(n.default)||null;default:return n.default===void 0?null:n.default}}function fp(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!fp(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const zE={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function jE(n){if(n==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};fp(n)||(n=Al(n));const e=hp(n,zE);if(e.result==="error")throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));{const t=gp(n);return{filter:(i,r,s)=>e.value.evaluate(i,r,{},s),needGeometry:t,getGlobalStateRefs:()=>pl(e.value.expression)}}}function UE(n,e){return n<e?-1:n>e?1:0}function gp(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e<n.length;e++)if(gp(n[e]))return!0;return!1}function Al(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?pu(n[1],n[2],"=="):e==="!="?ml(pu(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?pu(n[1],n[2],e):e==="any"?VE(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(Al)):e==="none"?["all"].concat(n.slice(1).map(Al).map(ml)):e==="in"?pp(n[1],n.slice(2)):e==="!in"?ml(pp(n[1],n.slice(2))):e==="has"?Ap(n[1]):e==="!has"?ml(Ap(n[1])):!0}function pu(n,e,t){switch(n){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,n,e]}}function VE(n){return["any"].concat(n.map(Al))}function pp(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",n,["literal",e.sort(UE)]]:["filter-in-small",n,["literal",e]]}}function Ap(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function ml(n){return["!",n]}function Bo(n){return typeof n=="object"?["literal",n]:n}function WE(n,e){let t=n.stops;if(!t)return HE(n,e);const i=t&&typeof t[0][0]=="object",r=i||n.property!==void 0,s=i||!r;return t=t.map(o=>!r&&e.tokens&&typeof o[1]=="string"?[o[0],ZE(o[1])]:[o[0],Bo(o[1])]),i?XE(n,e,t):s?KE(n,e,t):mu(n,e,t)}function HE(n,e){const t=["get",n.property];if(n.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,n.default];{const i=[e.type==="color"?"to-color":e.type,t,Bo(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function Au(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function XE(n,e,t){const i={},r={},s=[];for(let a=0;a<t.length;a++){const l=t[a],c=l[0].zoom;i[c]===void 0&&(i[c]={zoom:c,type:n.type,property:n.property,default:n.default},r[c]=[],s.push(c)),r[c].push([l[0].value,l[1]])}if(_u({},e)==="exponential"){const a=[Au(n),["linear"],["zoom"]];for(const l of s){const c=mu(i[l],e,r[l]);As(a,l,c,!1)}return a}else{const a=["step",["zoom"]];for(const l of s){const c=mu(i[l],e,r[l]);As(a,l,c,!0)}return yu(a),a}}function YE(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function mp(n,e){const t=Bo(YE(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function mu(n,e,t){const i=_u(n,e),r=["get",n.property];if(i==="categorical"&&typeof t[0][0]=="boolean"){const s=["case"];for(const o of t)s.push(["==",r,o[0]],o[1]);return s.push(mp(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)As(s,o[0],o[1],!1);return s.push(mp(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)As(s,o[0],o[1],!0);return yu(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,Bo(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[Au(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)As(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,Bo(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function KE(n,e,t,i=["zoom"]){const r=_u(n,e);let s,o=!1;if(r==="interval")s=["step",i],o=!0;else if(r==="exponential"){const a=n.base!==void 0?n.base:1;s=[Au(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)As(s,a[0],a[1],o);return yu(s),s}function yu(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function As(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function _u(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function ZE(n){const e=["concat"],t=/{([^{}]+)}/g;let i=0;for(let r=t.exec(n);r!==null;r=t.exec(n)){const s=n.slice(i,t.lastIndex-r[0].length);i=t.lastIndex,s.length>0&&e.push(s),e.push(["get",r[1]])}if(e.length===1)return n;if(i<n.length)e.push(n.slice(i));else if(e.length===2)return["to-string",e[1]];return e}const qE=E1;var yp={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},No=" ",_p=/(italic|oblique)$/i,xp={};function xu(n,e,t){var i=xp[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,l,c=0,h=n.length;c<h;++c){var u=n[c],d=u.split(" "),g=d[d.length-1].toLowerCase();g=="normal"||g=="italic"||g=="oblique"?(s=l?s:g,l=!0,d.pop(),g=d[d.length-1].toLowerCase()):_p.test(g)&&(g=g.replace(_p,""),s=l?s:d[d.length-1].replace(g,""),l=!0);for(var f in yp){var p=d.length>1?d[d.length-2].toLowerCase():"";if(g==f||g==f.replace("-","")||p+"-"+g==f){r=a?r:yp[f],d.pop(),p&&f.startsWith(p)&&d.pop();break}}!a&&typeof g=="number"&&(r=g,a=!0);var A=d.join(No).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");A.indexOf(No)!==-1&&(A='"'+A+'"'),o.push(A)}i=xp[n]=[s,r,o]}return i[0]+No+i[1]+No+e+"px"+(t?"/"+t:"")+No+i[2]}class Ep{drawCustom(e,t,i,r,s){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,i){}drawFeature(e,t,i){}drawGeometryCollection(e,t,i){}drawLineString(e,t,i){}drawMultiLineString(e,t,i){}drawMultiPoint(e,t,i){}drawMultiPolygon(e,t,i){}drawPoint(e,t,i){}drawPolygon(e,t,i){}drawText(e,t,i){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}}class QE extends Ep{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.transformRotation_=r?Xs(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_=St()}drawImages_(e,t,i,r){if(!this.image_)return;const s=mn(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let h=0,u=s.length;h<u;h+=2){const d=s[h]-this.imageAnchorX_,g=s[h+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const f=d+this.imageAnchorX_,p=g+this.imageAnchorY_;Ti(a,f,p,1,1,c,-f,-p),o.save(),o.transform.apply(o,a),o.translate(f,p),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.restore()}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(e,t,i,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=mn(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);t<i;t+=r){const l=s[t]+this.textOffsetX_,c=s[t+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(l-this.textOffsetX_,c-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.restore()):(this.textStrokeState_&&o.strokeText(this.text_,l,c),this.textFillState_&&o.fillText(this.text_,l,c))}}moveToLineTo_(e,t,i,r,s){const o=this.context_,a=mn(e,t,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;s&&(l-=2);for(let c=2;c<l;c+=2)o.lineTo(a[c],a[c+1]);return s&&o.closePath(),i}drawRings_(e,t,i,r){for(let s=0,o=i.length;s<o;++s)t=this.moveToLineTo_(e,t,i[s],r,!0);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=r0(e,this.transform_,this.pixelCoordinates_),i=t[2]-t[0],r=t[3]-t[1],s=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(t[0],t[1],s,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case"Point":this.drawPoint(e);break;case"LineString":this.drawLineString(e);break;case"Polygon":this.drawPolygon(e);break;case"MultiPoint":this.drawMultiPoint(e);break;case"MultiLineString":this.drawMultiLineString(e);break;case"MultiPolygon":this.drawMultiPolygon(e);break;case"GeometryCollection":this.drawGeometryCollection(e);break;case"Circle":this.drawCircle(e);break}}drawFeature(e,t){const i=t.getGeometryFunction()(e);i&&(this.setStyle(t),this.drawGeometry(i))}drawGeometryCollection(e){const t=e.getGeometriesArray();for(let i=0,r=t.length;i<r;++i)this.drawGeometry(t[i])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(i,0,i.length,e.getStride(),!1),t.stroke()}if(this.text_!==""){const t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getExtent();if(ze(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,r=e.getFlatCoordinates();let s=0;const o=e.getEnds(),a=e.getStride();i.beginPath();for(let l=0,c=o.length;l<c;++l)s=this.moveToLineTo_(r,s,o[l],a,!1);i.stroke()}if(this.text_!==""){const i=e.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getOrientedFlatCoordinates();let r=0;const s=e.getEndss(),o=e.getStride();t.beginPath();for(let a=0,l=s.length;a<l;++a){const c=s[a];r=this.drawRings_(i,r,c,o)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){const t=this.context_,i=this.contextFillState_;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){const t=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=e.lineCap&&(i.lineCap=e.lineCap,t.lineCap=e.lineCap),Bi(i.lineDash,e.lineDash)||t.setLineDash(i.lineDash=e.lineDash),i.lineDashOffset!=e.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),i.lineJoin!=e.lineJoin&&(i.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){const t=this.context_,i=this.contextTextState_,r=e.textAlign?e.textAlign:xo;i?(i.font!=e.font&&(i.font=e.font,t.font=e.font),i.textAlign!=r&&(i.textAlign=r,t.textAlign=r),i.textBaseline!=e.textBaseline&&(i.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{const i=e.getColor();this.fillState_={fillStyle:Ii(i||Mt)}}if(!t)this.strokeState_=null;else{const i=t.getColor(),r=t.getLineCap(),s=t.getLineDash(),o=t.getLineDashOffset(),a=t.getLineJoin(),l=t.getWidth(),c=t.getMiterLimit(),h=s||Hi;this.strokeState_={lineCap:r!==void 0?r:as,lineDash:this.pixelRatio_===1?h:h.map(u=>u*this.pixelRatio_),lineDashOffset:(o||Xi)*this.pixelRatio_,lineJoin:a!==void 0?a:ls,lineWidth:(l!==void 0?l:Eo)*this.pixelRatio_,miterLimit:c!==void 0?c:yo,strokeStyle:Ii(i||_o)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}const i=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),s=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*i,this.imageAnchorY_=r[1]*i,this.imageHeight_=t[1]*i,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();const o=e.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=t[0]*i}setTextStyle(e){if(!e)this.text_="";else{const t=e.getFill();if(!t)this.textFillState_=null;else{const g=t.getColor();this.textFillState_={fillStyle:Ii(g||Mt)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const g=i.getColor(),f=i.getLineCap(),p=i.getLineDash(),A=i.getLineDashOffset(),m=i.getLineJoin(),y=i.getWidth(),E=i.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:as,lineDash:p||Hi,lineDashOffset:A||Xi,lineJoin:m!==void 0?m:ls,lineWidth:y!==void 0?y:Eo,miterLimit:E!==void 0?E:yo,strokeStyle:Ii(g||_o)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),h=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r!==void 0?r:ig,textAlign:u!==void 0?u:xo,textBaseline:d!==void 0?d:La},this.text_=h!==void 0?Array.isArray(h)?h.reduce((g,f,p)=>g+=p%2?" ":f,""):h:"",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_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const JE=.5,wp={Point:ow,LineString:nw,Polygon:lw,MultiPoint:aw,MultiLineString:rw,MultiPolygon:sw,GeometryCollection:iw,Circle:ew};function $E(n,e){return parseInt(Y(n),10)-parseInt(Y(e),10)}function Eu(n,e){const t=vp(n,e);return t*t}function vp(n,e){return JE*n/e}function ew(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),"Circle");l.setFillStrokeStyle(s,o),l.drawCircle(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i)}}function yl(n,e,t,i,r,s,o,a){const l=[],c=t.getImage();if(c){let d=!0;const g=c.getImageState();g==W.LOADED||g==W.ERROR?d=!1:g==W.IDLE&&c.load(),d&&l.push(c.ready())}const h=t.getFill();h&&h.loading()&&l.push(h.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>r(null)),tw(n,e,t,i,s,o,a),u}function tw(n,e,t,i,r,s,o){const a=t.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);if(t.getRenderer())Cp(n,l,t,e,o);else{const h=wp[l.getType()];h(n,l,t,e,o,s)}}function Cp(n,e,t,i,r){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a<l;++a)Cp(n,o[a],t,i,r);return}n.getBuilder(t.getZIndex(),"Default").drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer(),r)}function iw(n,e,t,i,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const c=wp[o[a].getType()];c(n,o[a],t,i,r,s)}}function nw(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawLineString(e,i,r)}const o=t.getText();if(o&&o.getText()){const a=n.getBuilder(t.getZIndex(),"Text");a.setTextStyle(o),a.drawText(e,i,r)}}function rw(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawMultiLineString(e,i,r)}const o=t.getText();if(o&&o.getText()){const a=n.getBuilder(t.getZIndex(),"Text");a.setTextStyle(o),a.drawText(e,i,r)}}function sw(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(o||s){const l=n.getBuilder(t.getZIndex(),"Polygon");l.setFillStrokeStyle(s,o),l.drawMultiPolygon(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i,r)}}function ow(n,e,t,i,r,s){const o=t.getImage(),a=t.getText(),l=a&&a.getText(),c=s&&o&&l?{}:void 0;if(o){if(o.getImageState()!=W.LOADED)return;const h=n.getBuilder(t.getZIndex(),"Image");h.setImageStyle(o,c),h.drawPoint(e,i,r)}if(l){const h=n.getBuilder(t.getZIndex(),"Text");h.setTextStyle(a,c),h.drawText(e,i,r)}}function aw(n,e,t,i,r,s){const o=t.getImage(),a=o&&o.getOpacity()!==0,l=t.getText(),c=l&&l.getText(),h=s&&a&&c?{}:void 0;if(a){if(o.getImageState()!=W.LOADED)return;const u=n.getBuilder(t.getZIndex(),"Image");u.setImageStyle(o,h),u.drawMultiPoint(e,i,r)}if(c){const u=n.getBuilder(t.getZIndex(),"Text");u.setTextStyle(l,h),u.drawText(e,i,r)}}function lw(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),"Polygon");l.setFillStrokeStyle(s,o),l.drawPolygon(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i,r)}}let cw=!1;function bp(n,e,t,i,r,s,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,i,r):n,!0),e.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=cw,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let h;c=="text"||c=="json"?h=a.responseText:c=="xml"?h=a.responseXML||a.responseText:c=="arraybuffer"&&(h=a.response),h?s(e.readFeatures(h,{extent:t,featureProjection:r}),e.readProjection(h)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function Tp(n,e){return function(t,i,r,s,o){bp(n,e,t,i,r,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}function hw(n,e){return[[-1/0,-1/0,1/0,1/0]]}function uw(n,e){return[n]}class wu{constructor(e){this.rbush_=new Wf(e),this.items_={}}insert(e,t){const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(i),this.items_[Y(t)]=i}load(e,t){const i=new Array(t.length);for(let r=0,s=t.length;r<s;r++){const o=e[r],a=t[r],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[r]=l,this.items_[Y(a)]=l}this.rbush_.load(i)}remove(e){const t=Y(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[Y(t)],r=[i.minX,i.minY,i.maxX,i.maxY];Vi(r,e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(r){return r.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let i;for(let r=0,s=e.length;r<s;r++)if(i=t(e[r]),i)return i;return i}isEmpty(){return un(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return bi(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const t in e.items_)this.items_[t]=e.items_[t]}}class ms extends Ci{constructor(e){super(),this.projection=ye(e.projection),this.attributions_=Rp(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(i,r){t.viewResolver=i,t.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Rp(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Rp(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),e=>n):null}const Lt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Pn extends Nt{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class Mn extends ms{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=Us,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(me(this.format_,"`format` must be set when `url` is set"),this.loader_=Tp(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:hw;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new wu:null,this.loadedExtentsRtree_=new wu,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,r;Array.isArray(e.features)?r=e.features:e.features&&(i=e.features,r=i.getArray()),!t&&i===void 0&&(i=new Rt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=Y(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);const i=e.getGeometry();if(i){const r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new Pn(Lt.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof ht||(this.featureChangeKeys_[e]=[ce(t,K.CHANGE,this.handleFeatureChange_,this),ce(t,Vr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let i=!0;if(t.getId()!==void 0){const r=String(t.getId());if(!(r in this.idIndex_))this.idIndex_[r]=t;else if(t instanceof ht){const s=this.idIndex_[r];s instanceof ht?Array.isArray(s)?s.push(t):this.idIndex_[r]=[s,t]:i=!1}else i=!1}return i&&(me(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const t=[],i=[],r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s],l=Y(a);this.addToIndex_(l,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],l=Y(a);this.setupChangeEvents_(l,a);const c=a.getGeometry();if(c){const h=c.getExtent();t.push(h),r.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(Lt.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new Pn(Lt.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(Lt.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(Lt.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(pt.ADD,i=>{t||(t=!0,this.addFeature(i.element),t=!1)}),e.addEventListener(pt.REMOVE,i=>{t||(t=!0,this.removeFeature(i.element),t=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Te);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(i=>{this.removeFeatureInternal(i)});for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const t=new Pn(Lt.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){const s=r.getGeometry();if(s instanceof ht||s.intersectsCoordinate(e))return t(r)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(i){const r=i.getGeometry();if(r instanceof ht||r.intersectsExtent(e)){const s=t(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),un(this.nullGeometryFeatures_)||vi(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const t=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){t.push(i)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const r=uc(e,t);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){const i=e[0],r=e[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return t=t||Wr,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const h=c.getGeometry(),u=a;if(a=h instanceof ht?0:h.closestPointXY(i,r,o,a),a<u){s=c;const d=Math.sqrt(a);l[0]=i-d,l[1]=r-d,l[2]=i+d,l[3]=r+d}}}),s}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const t=this.idIndex_[e.toString()];return t!==void 0?t:null}getFeatureByUid(e){const t=this.uidIndex_[e];return t!==void 0?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const t=e.target,i=Y(t),r=t.getGeometry();if(!r)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[i]=t);else{const o=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,t)):this.featuresRtree_&&this.featuresRtree_.update(o,t)}const s=t.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[o]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[i]=t;this.changed(),this.dispatchEvent(new Pn(Lt.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:Y(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&un(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,i){const r=this.loadedExtentsRtree_,s=this.strategy_(e,t,i);for(let o=0,a=s.length;o<a;++o){const l=s[o];r.forEachInExtent(l,function(h){return Ui(h.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Pn(Lt.FEATURESLOADSTART)),this.loader_.call(this,l,t,i,h=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pn(Lt.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pn(Lt.FEATURESLOADERROR))}),r.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_,i=t.forEachInExtent(e,function(r){if(Vi(r.extent,e))return r});i&&t.remove(i)}removeFeatures(e){let t=!1;for(let i=0,r=e.length;i<r;++i)t=this.removeFeatureInternal(e[i])||t;t&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const t=Y(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e);const i=this.featureChangeKeys_[t];i==null||i.forEach(Te),delete this.featureChangeKeys_[t];const r=e.getId();if(r!==void 0){const s=r.toString(),o=this.idIndex_[s];o===e?delete this.idIndex_[s]:Array.isArray(o)&&(o.splice(o.indexOf(e),1),o.length===1&&(this.idIndex_[s]=o[0]))}return delete this.uidIndex_[t],this.hasListener(Lt.REMOVEFEATURE)&&this.dispatchEvent(new Pn(Lt.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){me(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(Tp(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const Z={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},_l=[Z.FILL],Fn=[Z.STROKE],br=[Z.BEGIN_PATH],Sp=[Z.CLOSE_PATH];class zo extends Ep{constructor(e,t,i,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){const t=this.pixelRatio;return t==1?e:e.map(function(i){return i*t})}appendFlatPointCoordinates(e,t){const i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,l=e.length;a<l;a+=t)r[0]=e[a],r[1]=e[a+1],$n(i,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(e,t,i,r,s,o){const a=this.coordinates;let l=a.length;const c=this.getBufferedMaxExtent();o&&(t+=r);let h=e[t],u=e[t+1];const d=this.tmpCoordinate_;let g=!0,f,p,A;for(f=t+r;f<i;f+=r)d[0]=e[f],d[1]=e[f+1],A=ac(c,d),A!==p?(g&&(a[l++]=h,a[l++]=u,g=!1),a[l++]=d[0],a[l++]=d[1]):A===ct.INTERSECTING?(a[l++]=d[0],a[l++]=d[1],g=!1):g=!0,h=d[0],u=d[1],p=A;return(s&&g||f===t+r)&&(a[l++]=h,a[l++]=u),l}drawCustomCoordinates_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o){const l=i[o],c=this.appendFlatLineCoordinates(e,t,l,r,!1,!1);s.push(c),t=l}return t}drawCustom(e,t,i,r,s){this.beginGeometry(e,t,s);const o=e.getType(),a=e.getStride(),l=this.coordinates.length;let c,h,u,d,g;switch(o){case"MultiPolygon":c=e.getOrientedFlatCoordinates(),d=[];const f=e.getEndss();g=0;for(let p=0,A=f.length;p<A;++p){const m=[];g=this.drawCustomCoordinates_(c,g,f[p],a,m),d.push(m)}this.instructions.push([Z.CUSTOM,l,d,e,i,kc,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,d,e,r||i,kc,s]);break;case"Polygon":case"MultiLineString":u=[],c=o=="Polygon"?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),g=this.drawCustomCoordinates_(c,0,e.getEnds(),a,u),this.instructions.push([Z.CUSTOM,l,u,e,i,io,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,u,e,r||i,io,s]);break;case"LineString":case"Circle":c=e.getFlatCoordinates(),h=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([Z.CUSTOM,l,h,e,i,_n,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,h,e,r||i,_n,s]);break;case"MultiPoint":c=e.getFlatCoordinates(),h=this.appendFlatPointCoordinates(c,a),h>l&&(this.instructions.push([Z.CUSTOM,l,h,e,i,_n,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,h,e,r||i,_n,s]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([Z.CUSTOM,l,h,e,i,void 0,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,h,e,r||i,void 0,s]);break}this.endGeometry(t)}beginGeometry(e,t,i){this.beginGeometryInstruction1_=[Z.BEGIN_GEOMETRY,t,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Z.BEGIN_GEOMETRY,t,0,e,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let t;const i=e.length;let r,s,o=-1;for(t=0;t<i;++t)r=e[t],s=r[0],s==Z.END_GEOMETRY?o=t:s==Z.BEGIN_GEOMETRY&&(r[2]=t,Km(this.hitDetectionInstructions,o,t),o=-1)}fillStyleToState(e,t={}){if(e){const i=e.getColor();t.fillPatternScale=i&&typeof i=="object"&&"src"in i?this.pixelRatio:1,t.fillStyle=Ii(i||Mt)}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){const i=e.getColor();t.strokeStyle=Ii(i||_o);const r=e.getLineCap();t.lineCap=r!==void 0?r:as;const s=e.getLineDash();t.lineDash=s?s.slice():Hi;const o=e.getLineDashOffset();t.lineDashOffset=o||Xi;const a=e.getLineJoin();t.lineJoin=a!==void 0?a:ls;const l=e.getWidth();t.lineWidth=l!==void 0?l:Eo;const c=e.getMiterLimit();t.miterLimit=c!==void 0?c:yo,t.lineWidth>this.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0;return t}setFillStrokeStyle(e,t){const i=this.state;this.fillStyleToState(e,i),this.strokeStyleToState(t,i)}createFill(e){const t=e.fillStyle,i=[Z.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Z.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,t){const i=e.strokeStyle,r=e.lineCap,s=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,l=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!Bi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c)&&(t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=s,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=l,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[Z.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Vd(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;ji(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class dw extends zo{constructor(e,t,i,r){super(e,t,i,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(e,t,i){if(!this.image_||this.maxExtent&&!$n(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,i);const r=e.getFlatCoordinates(),s=e.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,s);this.instructions.push([Z.DRAW_IMAGE,o,a,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([Z.DRAW_IMAGE,o,a,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(t)}drawMultiPoint(e,t,i){if(!this.image_)return;this.beginGeometry(e,t,i);const r=e.getFlatCoordinates(),s=[];for(let l=0,c=r.length;l<c;l+=e.getStride())(!this.maxExtent||$n(this.maxExtent,r.slice(l,l+2)))&&s.push(r[l],r[l+1]);const o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,2);this.instructions.push([Z.DRAW_IMAGE,o,a,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([Z.DRAW_IMAGE,o,a,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(t)}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(e,t){const i=e.getAnchor(),r=e.getSize(),s=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}class fw extends zo{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,i,r,!1,!1),a=[Z.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi],br);const a=e.getFlatCoordinates(),l=e.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(Fn),this.endGeometry(t)}drawMultiLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi],br);const a=e.getEnds(),l=e.getFlatCoordinates(),c=e.getStride();let h=0;for(let u=0,d=a.length;u<d;++u)h=this.drawFlatCoordinates_(l,h,a[u],c);this.hitDetectionInstructions.push(Fn),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Fn),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Fn),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(br)}}class Ip extends zo{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,l=i.length;this.instructions.push(br),this.hitDetectionInstructions.push(br);for(let c=0;c<l;++c){const h=i[c],u=this.coordinates.length,d=this.appendFlatLineCoordinates(e,t,h,r,!0,!a),g=[Z.MOVE_TO_LINE_TO,u,d];this.instructions.push(g),this.hitDetectionInstructions.push(g),a&&(this.instructions.push(Sp),this.hitDetectionInstructions.push(Sp)),t=h}return o&&(this.instructions.push(_l),this.hitDetectionInstructions.push(_l)),a&&(this.instructions.push(Fn),this.hitDetectionInstructions.push(Fn)),t}drawCircle(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_FILL_STYLE,Mt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi]);const a=e.getFlatCoordinates(),l=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const h=[Z.CIRCLE,c];this.instructions.push(br,h),this.hitDetectionInstructions.push(br,h),r.fillStyle!==void 0&&(this.instructions.push(_l),this.hitDetectionInstructions.push(_l)),r.strokeStyle!==void 0&&(this.instructions.push(Fn),this.hitDetectionInstructions.push(Fn)),this.endGeometry(t)}drawPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_FILL_STYLE,Mt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi]);const a=e.getEnds(),l=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(l,0,a,c),this.endGeometry(t)}drawMultiPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_FILL_STYLE,Mt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi]);const a=e.getEndss(),l=e.getOrientedFlatCoordinates(),c=e.getStride();let h=0;for(let u=0,d=a.length;u<d;++u)h=this.drawFlatCoordinatess_(l,h,a[u],c);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const e=this.tolerance;if(e!==0){const t=this.coordinates;for(let i=0,r=t.length;i<r;++i)t[i]=ar(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}}function gw(n,e,t,i,r){const s=[];let o=t,a=0,l=e.slice(t,2);for(;a<n&&o+r<i;){const[c,h]=l.slice(-2),u=e[o+r],d=e[o+r+1],g=Math.sqrt((u-c)*(u-c)+(d-h)*(d-h));if(a+=g,a>=n){const f=(n-a+g)/g,p=zt(c,u,f),A=zt(h,d,f);l.push(p,A),s.push(l),l=[p,A],a==n&&(o+=r),a=0}else if(a<n)l.push(e[o+r],e[o+r+1]),o+=r;else{const f=g-a,p=zt(c,u,f/g),A=zt(h,d,f/g);l.push(p,A),s.push(l),l=[p,A],a=0,o+=r}}return a>0&&s.push(l),s}function pw(n,e,t,i,r){let s=t,o=t,a=0,l=0,c=t,h,u,d,g,f,p,A,m,y,E;for(u=t;u<i;u+=r){const x=e[u],_=e[u+1];f!==void 0&&(y=x-f,E=_-p,g=Math.sqrt(y*y+E*E),A!==void 0&&(l+=d,h=Math.acos((A*y+m*E)/(d*g)),h>n&&(l>a&&(a=l,s=c,o=u),l=0,c=u-r)),d=g,A=y,m=E),f=x,p=_}return l+=g,l>a?[c,u]:[s,o]}const xl={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Aw extends zo{constructor(e,t,i,r){super(e,t,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Mt]={fillStyle:Mt},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,i){const r=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!r&&!s)return;const a=this.coordinates;let l=a.length;const c=e.getType();let h=null,u=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!ze(this.maxExtent,e.getExtent()))return;let d;if(h=e.getFlatCoordinates(),c=="LineString")d=[h.length];else if(c=="MultiLineString")d=e.getEnds();else if(c=="Polygon")d=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const A=e.getEndss();d=[];for(let m=0,y=A.length;m<y;++m)d.push(A[m][0])}this.beginGeometry(e,t,i);const g=o.repeat,f=g?void 0:o.textAlign;let p=0;for(let A=0,m=d.length;A<m;++A){let y;g?y=gw(g*this.resolution,h,p,d[A],u):y=[h.slice(p,d[A])];for(let E=0,x=y.length;E<x;++E){const _=y[E];let w=0,v=_.length;if(f==null){const b=pw(o.maxAngle,_,0,_.length,2);w=b[0],v=b[1]}for(let b=w;b<v;b+=u)a.push(_[b],_[b+1]);const C=a.length;p=d[A],this.drawChars_(l,C),l=C}}this.endGeometry(t)}else{let d=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":h=e.getFlatCoordinates();break;case"LineString":h=e.getFlatMidpoint();break;case"Circle":h=e.getCenter();break;case"MultiLineString":h=e.getFlatMidpoints(),u=2;break;case"Polygon":h=e.getFlatInteriorPoint(),o.overflow||d.push(h[2]/this.resolution),u=3;break;case"MultiPolygon":const x=e.getFlatInteriorPoints();h=[];for(let _=0,w=x.length;_<w;_+=3)o.overflow||d.push(x[_+2]/this.resolution),h.push(x[_],x[_+1]);if(h.length===0)return;u=2;break}const g=this.appendFlatPointCoordinates(h,u);if(g===l)return;if(d&&(g-l)/2!==h.length/u){let x=l/2;d=d.filter((_,w)=>{const v=a[(x+w)*2]===h[w*u]&&a[(x+w)*2+1]===h[w*u+1];return v||--x,v})}this.saveTextStates_();const f=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,p=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(e,t,i);let A=o.padding;if(A!=fr&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],_=o.padding[1],w=o.padding[2],v=o.padding[3];o.scale[0]<0&&(_=-_,v=-v),o.scale[1]<0&&(x=-x,w=-w),A=[x,_,w,v]}const m=this.pixelRatio;this.instructions.push([Z.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,A==fr?fr:A.map(function(x){return x*m}),f,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const y=1/m,E=f?f.slice(0):null;E&&(E[1]=Mt),this.hitDetectionInstructions.push([Z.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,A,E,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Mt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),this.endGeometry(t)}}saveTextStates_(){const e=this.textStrokeState_,t=this.textState_,i=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:t.font,textAlign:t.textAlign||xo,justify:t.justify,textBaseline:t.textBaseline||La,scale:t.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,t){const i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=xl[r.textBaseline],h=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Z.DRAW_CHARS,e,t,c,r.overflow,a,r.maxAngle,l,h,s,d*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([Z.DRAW_CHARS,e,t,c,r.overflow,a&&Mt,r.maxAngle,l,h,s,d*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let i,r,s;if(!e)this.text_="";else{const o=e.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Ii(o.getColor()||Mt)):(r=null,this.textFillState_=r);const a=e.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const p=a.getLineDash(),A=a.getLineDashOffset(),m=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||as,s.lineDash=p?p.slice():Hi,s.lineDashOffset=A===void 0?Xi:A,s.lineJoin=a.getLineJoin()||ls,s.lineWidth=m===void 0?Eo:m,s.miterLimit=y===void 0?yo:y,s.strokeStyle=Ii(a.getColor()||_o)}i=this.textState_;const l=e.getFont()||ig;U_(l);const c=e.getScaleArray();i.overflow=e.getOverflow(),i.font=l,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.repeat=e.getRepeat(),i.justify=e.getJustify(),i.textBaseline=e.getTextBaseline()||La,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||fr,i.scale=c===void 0?[1,1]:c;const h=e.getOffsetX(),u=e.getOffsetY(),d=e.getRotateWithView(),g=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textKeepUpright_=g===void 0?!0:g,this.textRotation_=f===void 0?0:f,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:Y(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle=="string"?r.fillStyle:"|"+Y(r.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}const mw={Circle:Ip,Default:zo,Image:dw,LineString:fw,Polygon:Ip,Text:Aw};class Pp{constructor(e,t,i,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const t in this.buildersByZIndex_){e[t]=e[t]||{};const i=this.buildersByZIndex_[t];for(const r in i){const s=i[r].finish();e[t][r]=s}}return e}getBuilder(e,t){const i=e!==void 0?e.toString():"0";let r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[t];if(s===void 0){const o=mw[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}function yw(n,e,t,i,r,s,o,a,l,c,h,u,d=!0){let g=n[e],f=n[e+1],p=0,A=0,m=0,y=0;function E(){p=g,A=f,e+=i,g=n[e],f=n[e+1],y+=m,m=Math.sqrt((g-p)*(g-p)+(f-A)*(f-A))}do E();while(e<t-i&&y+m<s);let x=m===0?0:(s-y)/m;const _=zt(p,g,x),w=zt(A,f,x),v=e-i,C=y,b=s+a*l(c,r,h);for(;e<t-i&&y+m<b;)E();x=m===0?0:(b-y)/m;const T=zt(p,g,x),I=zt(A,f,x);let F=!1;if(d)if(u){const L=[_,w,T,I];Ic(L,0,4,2,u,L,L),F=L[0]>L[2]}else F=_>T;const P=Math.PI,B=[],R=v+i===e;e=v,m=0,y=C,g=n[e],f=n[e+1];let S;if(R){E(),S=Math.atan2(f-A,g-p),F&&(S+=S>0?-P:P);const L=(T+_)/2,z=(I+w)/2;return B[0]=[L,z,(b-s)/2,S,r],B}r=r.replace(/\n/g," ");for(let L=0,z=r.length;L<z;){E();let V=Math.atan2(f-A,g-p);if(F&&(V+=V>0?-P:P),S!==void 0){let se=V-S;if(se+=se>P?-2*P:se<-P?2*P:0,Math.abs(se)>o)return null}S=V;const U=L;let X=0;for(;L<z;++L){const se=F?z-L-1:L,we=a*l(c,r[se],h);if(e+i<t&&y+m<s+X+we/2)break;X+=we}if(L===U)continue;const D=F?r.substring(z-U,z-L):r.substring(U,L);x=m===0?0:(s+X/2-y)/m;const q=zt(p,g,x),O=zt(A,f,x);B.push([q,O,X/2,V,D]),s+=X}return B}class vu{constructor(){Gt(this,"pushMethodArgs_",(...e)=>(this.push_(e),this));this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Ta(),{get:(e,t)=>{if(typeof Ta()[t]=="function")return this.push_(t),this.pushMethodArgs_},set:(e,t,i)=>(this.push_(t,i),!0)})}push_(...e){const t=this.instructions_,i=this.zIndex+this.offset_;t[i]||(t[i]=[]),t[i].push(...e)}pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let i=0,r=t.length;i<r;++i){const s=t[i];if(typeof s=="function"){s(e);continue}const o=t[++i];if(typeof e[s]=="function")e[s](...o);else{if(typeof o=="function"){e[s]=o(e);continue}e[s]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const ys=jt(),Ln=[],qi=[],Qi=[],kn=[];function Mp(n){return n[3].declutterBox}const Fp=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Cu(n,e){return e==="start"?e=Fp.test(n)?"right":"left":e==="end"&&(e=Fp.test(n)?"left":"right"),xl[e]}function _w(n,e,t){return t>0&&n.push(`
22
+ `,""),n.push(e,""),n}function xw(n,e,t){return t%2===0&&(n+=e),n}class Ew{constructor(e,t,i,r,s){this.overlaps=i,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=St(),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_={},this.zIndexContext_=s?new vu:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,i,r){const s=e+t+i+r;if(this.labels_[s])return this.labels_[s];const o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[t],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],u=l.justify?xl[l.justify]:Cu(Array.isArray(e)?e[0]:e,l.textAlign||xo),d=r&&o.lineWidth?o.lineWidth:0,g=Array.isArray(e)?e:String(e).split(`
23
+ `).reduce(_w,[]),{width:f,height:p,widths:A,heights:m,lineWidths:y}=W_(l,g),E=f+d,x=[],_=(E+2)*h[0],w=(p+d)*h[1],v={width:_<0?Math.floor(_):Math.ceil(_),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:x};(h[0]!=1||h[1]!=1)&&x.push("scale",h),r&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",d),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)),i&&x.push("fillStyle",a.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const C=.5-u;let b=u*E+C*d;const T=[],I=[];let F=0,P=0,B=0,R=0,S;for(let L=0,z=g.length;L<z;L+=2){const V=g[L];if(V===`
24
+ `){P+=F,F=0,b=u*E+C*d,++R;continue}const U=g[L+1]||l.font;U!==S&&(r&&T.push("font",U),i&&I.push("font",U),S=U),F=Math.max(F,m[B]);const X=[V,b+C*A[B]+u*(A[B]-y[R]),.5*(d+F)+P];b+=A[B],r&&T.push("strokeText",X),i&&I.push("fillText",X),++B}return Array.prototype.push.apply(x,T),Array.prototype.push.apply(x,I),this.labels_[s]=v,v}replayTextBackground_(e,t,i,r,s,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,t),o&&(this.alignAndScaleFill_=o[2],e.fillStyle=o[1],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())}calculateImageOrLabelDimensions_(e,t,i,r,s,o,a,l,c,h,u,d,g,f,p,A){a*=d[0],l*=d[1];let m=i-a,y=r-l;const E=s+c>e?e-c:s,x=o+h>t?t-h:o,_=f[3]+E*d[0]+f[1],w=f[0]+x*d[1]+f[2],v=m-f[3],C=y-f[0];(p||u!==0)&&(Ln[0]=v,kn[0]=v,Ln[1]=C,qi[1]=C,qi[0]=v+_,Qi[0]=qi[0],Qi[1]=C+w,kn[1]=Qi[1]);let b;return u!==0?(b=Ti(St(),i,r,1,1,u,-i,-r),$e(b,Ln),$e(b,qi),$e(b,Qi),$e(b,kn),bi(Math.min(Ln[0],qi[0],Qi[0],kn[0]),Math.min(Ln[1],qi[1],Qi[1],kn[1]),Math.max(Ln[0],qi[0],Qi[0],kn[0]),Math.max(Ln[1],qi[1],Qi[1],kn[1]),ys)):bi(Math.min(v,v+_),Math.min(C,C+w),Math.max(v,v+_),Math.max(C,C+w),ys),g&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:E,drawImageH:x,originX:c,originY:h,declutterBox:{minX:ys[0],minY:ys[1],maxX:ys[2],maxY:ys[3],value:A},canvasTransform:b,scale:d}}replayImageOrLabel_(e,t,i,r,s,o,a){const l=!!(o||a),c=r.declutterBox,h=a?a[2]*r.scale[0]/2:0;return c.minX-h<=t[0]&&c.maxX+h>=0&&c.minY-h<=t[1]&&c.maxY+h>=0&&(l&&this.replayTextBackground_(e,Ln,qi,Qi,kn,o,a),H_(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){const t=this.alignAndScaleFill_;if(t){const i=$e(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(i[0]%r,i[1]%r),t!==1&&e.scale(t,t),e.rotate(this.viewRotation_)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],t[1]&&(e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,i,r){const s=this.textStates[t],o=this.createLabel(e,t,r,i),a=this.strokeStates[i],l=this.pixelRatio,c=Cu(Array.isArray(e)?e[0]:e,s.textAlign||xo),h=xl[s.textBaseline||La],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],g=c*d+2*(.5-c)*u,f=h*o.height/l+2*(.5-h)*u;return{label:o,anchorX:g,anchorY:f}}execute_(e,t,i,r,s,o,a,l){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&Bi(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=mn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Zy(this.renderedTransform_,i));let u=0;const d=r.length;let g=0,f,p,A,m,y,E,x,_,w,v,C,b,T,I=0,F=0;const P=this.coordinateCache_,B=this.viewRotation_,R=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,S={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},L=this.instructions!=r||this.overlaps?0:200;let z,V,U,X;for(;u<d;){const D=r[u];switch(D[0]){case Z.BEGIN_GEOMETRY:z=D[1],X=D[3],z.getGeometry()?a!==void 0&&!ze(a,X.getExtent())?u=D[2]+1:++u:u=D[2],c&&(c.zIndex=D[4]);break;case Z.BEGIN_PATH:I>L&&(this.fill_(e),I=0),F>L&&(e.stroke(),F=0),!I&&!F&&(e.beginPath(),y=NaN,E=NaN),++u;break;case Z.CIRCLE:g=D[1];const O=h[g],se=h[g+1],we=h[g+2],ge=h[g+3],We=we-O,ve=ge-se,Fe=Math.sqrt(We*We+ve*ve);e.moveTo(O+Fe,se),e.arc(O,se,Fe,0,2*Math.PI,!0),++u;break;case Z.CLOSE_PATH:e.closePath(),++u;break;case Z.CUSTOM:g=D[1],f=D[2];const xi=D[3],_t=D[4],ft=D[5];S.geometry=xi,S.feature=z,u in P||(P[u]=[]);const j=P[u];ft?ft(h,g,f,2,j):(j[0]=h[g],j[1]=h[g+1],j.length=2),c&&(c.zIndex=D[6]),_t(j,S),++u;break;case Z.DRAW_IMAGE:g=D[1],f=D[2],w=D[3],p=D[4],A=D[5];let Ke=D[6];const gt=D[7],re=D[8],rn=D[9],si=D[10];let Ve=D[11];const Oi=D[12];let Be=D[13];m=D[14]||"declutter";const Ne=D[15];if(!w&&D.length>=20){v=D[19],C=D[20],b=D[21],T=D[22];const Je=this.drawLabelWithPointPlacement_(v,C,b,T);w=Je.label,D[3]=w;const on=D[23];p=(Je.anchorX-on)*this.pixelRatio,D[4]=p;const kt=D[24];A=(Je.anchorY-kt)*this.pixelRatio,D[5]=A,Ke=w.height,D[6]=Ke,Be=w.width,D[13]=Be}let sn;D.length>25&&(sn=D[25]);let oi,Gi,Hn;D.length>17?(oi=D[16],Gi=D[17],Hn=D[18]):(oi=fr,Gi=null,Hn=null),si&&R?Ve+=B:!si&&!R&&(Ve-=B);let Le=0;for(;g<f;g+=2){if(sn&&sn[Le++]<Be/this.pixelRatio)continue;const Je=this.calculateImageOrLabelDimensions_(w.width,w.height,h[g],h[g+1],Be,Ke,p,A,re,rn,Ve,Oi,s,oi,!!Gi||!!Hn,z),on=[e,t,w,Je,gt,Gi,Hn];if(l){let kt,Dt,Ot;if(Ne){const Xe=f-g;if(!Ne[Xe]){Ne[Xe]={args:on,declutterMode:m};continue}const Tt=Ne[Xe];kt=Tt.args,Dt=Tt.declutterMode,delete Ne[Xe],Ot=Mp(kt)}let Ei,an;if(kt&&(Dt!=="declutter"||!l.collides(Ot))&&(Ei=!0),(m!=="declutter"||!l.collides(Je.declutterBox))&&(an=!0),Dt==="declutter"&&m==="declutter"){const Xe=Ei&&an;Ei=Xe,an=Xe}Ei&&(Dt!=="none"&&l.insert(Ot),this.replayImageOrLabel_.apply(this,kt)),an&&(m!=="none"&&l.insert(Je.declutterBox),this.replayImageOrLabel_.apply(this,on))}else this.replayImageOrLabel_.apply(this,on)}++u;break;case Z.DRAW_CHARS:const Se=D[1],Ce=D[2],Ae=D[3],Ze=D[4];T=D[5];const oe=D[6],fe=D[7],qe=D[8];b=D[9];const Qe=D[10];v=D[11],Array.isArray(v)&&(v=v.reduce(xw,"")),C=D[12];const Zt=[D[13],D[13]];m=D[14]||"declutter";const qt=D[15],ot=this.textStates[C],at=ot.font,Re=[ot.scale[0]*fe,ot.scale[1]*fe];let He;at in this.widths_?He=this.widths_[at]:(He={},this.widths_[at]=He);const bt=Ph(h,Se,Ce,2),ke=Math.abs(Re[0])*og(at,v,He);if(Ze||ke<=bt){const Je=this.textStates[C].textAlign,on=(bt-ke)*Cu(v,Je),kt=yw(h,Se,Ce,2,v,on,oe,Math.abs(Re[0]),og,at,He,R?0:this.viewRotation_,qt);e:if(kt){const Dt=[];let Ot,Ei,an,Xe,Tt;if(b)for(Ot=0,Ei=kt.length;Ot<Ei;++Ot){Tt=kt[Ot],an=Tt[4],Xe=this.createLabel(an,C,"",b),p=Tt[2]+(Re[0]<0?-Qe:Qe),A=Ae*Xe.height+(.5-Ae)*2*Qe*Re[1]/Re[0]-qe;const ln=this.calculateImageOrLabelDimensions_(Xe.width,Xe.height,Tt[0],Tt[1],Xe.width,Xe.height,p,A,0,0,Tt[3],Zt,!1,fr,!1,z);if(l&&m==="declutter"&&l.collides(ln.declutterBox))break e;Dt.push([e,t,Xe,ln,1,null,null])}if(T)for(Ot=0,Ei=kt.length;Ot<Ei;++Ot){Tt=kt[Ot],an=Tt[4],Xe=this.createLabel(an,C,T,""),p=Tt[2],A=Ae*Xe.height-qe;const ln=this.calculateImageOrLabelDimensions_(Xe.width,Xe.height,Tt[0],Tt[1],Xe.width,Xe.height,p,A,0,0,Tt[3],Zt,!1,fr,!1,z);if(l&&m==="declutter"&&l.collides(ln.declutterBox))break e;Dt.push([e,t,Xe,ln,1,null,null])}l&&m!=="none"&&l.load(Dt.map(Mp));for(let ln=0,KC=Dt.length;ln<KC;++ln)this.replayImageOrLabel_.apply(this,Dt[ln])}}++u;break;case Z.END_GEOMETRY:if(o!==void 0){z=D[1];const Je=o(z,X,m);if(Je)return Je}++u;break;case Z.FILL:L?I++:this.fill_(e),++u;break;case Z.MOVE_TO_LINE_TO:for(g=D[1],f=D[2],V=h[g],U=h[g+1],e.moveTo(V,U),y=V+.5|0,E=U+.5|0,g+=2;g<f;g+=2)V=h[g],U=h[g+1],x=V+.5|0,_=U+.5|0,(g==f-2||x!==y||_!==E)&&(e.lineTo(V,U),y=x,E=_);++u;break;case Z.SET_FILL_STYLE:this.alignAndScaleFill_=D[2],I&&(this.fill_(e),I=0,F&&(e.stroke(),F=0)),e.fillStyle=D[1],++u;break;case Z.SET_STROKE_STYLE:F&&(e.stroke(),F=0),this.setStrokeStyle_(e,D),++u;break;case Z.STROKE:L?F++:e.stroke(),++u;break;default:++u;break}}I&&this.fill_(e),F&&e.stroke()}execute(e,t,i,r,s,o){this.viewRotation_=r,this.execute_(e,t,i,this.instructions,s,void 0,void 0,o)}executeHitDetection(e,t,i,r,s){return this.viewRotation_=i,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,s)}}const Tr=["Polygon","Circle","LineString","Image","Text","Default"],El=["Image","Text"],ww=Tr.filter(n=>!El.includes(n));class Lp{constructor(e,t,i,r,s,o,a){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=St(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(e,t){const i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e,t){for(const i in e){let r=this.executorsByZIndex_[i];r===void 0&&(r={},this.executorsByZIndex_[i]=r);const s=e[i];for(const o in s){const a=s[o];r[o]=new Ew(this.resolution_,this.pixelRatio_,this.overlaps_,a,t)}}}hasExecutors(e){for(const t in this.executorsByZIndex_){const i=this.executorsByZIndex_[t];for(let r=0,s=e.length;r<s;++r)if(e[r]in i)return!0}return!1}forEachFeatureAtCoordinate(e,t,i,r,s,o){r=Math.round(r);const a=r*2+1,l=Ti(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=Me(a,a));const h=this.hitDetectionContext_;h.canvas.width!==a||h.canvas.height!==a?(h.canvas.width=a,h.canvas.height=a):c||h.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=jt(),Ks(u,e),ji(u,t*(this.renderBuffer_+r),u));const d=vw(r);let g;function f(_,w,v){const C=h.getImageData(0,0,a,a).data;for(let b=0,T=d.length;b<T;b++)if(C[d[b]]>0){if(!o||v==="none"||g!=="Image"&&g!=="Text"||o.includes(_)){const I=(d[b]-3)/4,F=r-I%a,P=r-(I/a|0),B=s(_,w,F*F+P*P);if(B)return B}h.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(wi);let A,m,y,E,x;for(A=p.length-1;A>=0;--A){const _=p[A].toString();for(y=this.executorsByZIndex_[_],m=Tr.length-1;m>=0;--m)if(g=Tr[m],E=y[g],E!==void 0&&(x=E.executeHitDetection(h,l,i,f,u),x))return x}}getClipCoords(e){const t=this.maxExtent_;if(!t)return null;const i=t[0],r=t[1],s=t[2],o=t[3],a=[i,r,i,o,s,o,s,r];return mn(a,0,8,2,e,a),a}isEmpty(){return un(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?Ym:wi),o=o||Tr;const c=Tr.length;for(let h=0,u=l.length;h<u;++h){const d=l[h].toString(),g=this.executorsByZIndex_[d];for(let f=0,p=o.length;f<p;++f){const A=o[f],m=g[A];if(m!==void 0){const y=a===null?void 0:m.getZIndexContext(),E=y?y.getContext():e,x=this.maxExtent_&&A!=="Image"&&A!=="Text";if(x&&(E.save(),this.clip(E,i)),!y||A==="Text"||A==="Image"?m.execute(E,t,i,r,s,a):y.pushFunction(_=>m.execute(_,t,i,r,s,a)),x&&E.restore(),y){y.offset();const _=l[h]*c+Tr.indexOf(A);this.deferredZIndexContexts_[_]||(this.deferredZIndexContexts_[_]=[]),this.deferredZIndexContexts_[_].push(y)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(wi);for(let i=0,r=t.length;i<r;++i)e[t[i]].forEach(s=>{s.draw(this.renderedContext_),s.clear()}),e[t[i]].length=0}}const bu={};function vw(n){if(bu[n]!==void 0)return bu[n];const e=n*2+1,t=n*n,i=new Array(t+1);for(let s=0;s<=n;++s)for(let o=0;o<=n;++o){const a=s*s+o*o;if(a>t)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+s)*e+(n+o))*4+3),s>0&&l.push(((n-s)*e+(n+o))*4+3),o>0&&(l.push(((n+s)*e+(n-o))*4+3),s>0&&l.push(((n-s)*e+(n-o))*4+3))}const r=[];for(let s=0,o=i.length;s<o;++s)i[s]&&r.push(...i[s]);return bu[n]=r,r}const Kt=.5;function kp(n,e,t,i,r,s,o,a,l){const c=l?ma(r):r,h=n[0]*Kt,u=n[1]*Kt,d=Me(h,u);d.imageSmoothingEnabled=!1;const g=d.canvas,f=new QE(d,Kt,r,null,o,a,l?eo(Yy(),l):null),p=t.length,A=Math.floor((256*256*256-1)/p),m={};for(let E=1;E<=p;++E){const x=t[E-1],_=x.getStyleFunction()||i;if(!_)continue;let w=_(x,s);if(!w)continue;Array.isArray(w)||(w=[w]);const C=(E*A).toString(16).padStart(7,"#00000");for(let b=0,T=w.length;b<T;++b){const I=w[b],F=I.getGeometryFunction()(x);if(!F||!ze(c,F.getExtent()))continue;const P=I.clone(),B=P.getFill();B&&B.setColor(C);const R=P.getStroke();R&&(R.setColor(C),R.setLineDash(null)),P.setText(void 0);const S=I.getImage();if(S){const U=S.getImageSize();if(!U)continue;const X=Me(U[0],U[1],void 0,{alpha:!1}),D=X.canvas;X.fillStyle=C,X.fillRect(0,0,D.width,D.height),P.setImage(new Ar({img:D,anchor:S.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:S.getOrigin(),opacity:1,size:S.getSize(),scale:S.getScale(),rotation:S.getRotation(),rotateWithView:S.getRotateWithView()}))}const L=P.getZIndex()||0;let z=m[L];z||(z={},m[L]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]);const V=F.getType();if(V==="GeometryCollection"){const U=F.getGeometriesArrayRecursive();for(let X=0,D=U.length;X<D;++X){const q=U[X];z[q.getType().replace("Multi","")].push(q,P)}}else z[V.replace("Multi","")].push(F,P)}}const y=Object.keys(m).map(Number).sort(wi);for(let E=0,x=y.length;E<x;++E){const _=m[y[E]];for(const w in _){const v=_[w];for(let C=0,b=v.length;C<b;C+=2){f.setStyle(v[C+1]);for(let T=0,I=e.length;T<I;++T)f.setTransform(e[T]),f.drawGeometry(v[C])}}}return d.getImageData(0,0,g.width,g.height)}function Dp(n,e,t){const i=[];if(t){const r=Math.floor(Math.round(n[0])*Kt),s=Math.floor(Math.round(n[1])*Kt),o=(Pe(r,0,t.width-1)+Pe(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],h=t.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/e.length);h&&h%u===0&&i.push(e[h/u-1])}return i}const Cw=5;class bw extends Hs{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=Cw}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return Q()}getData(e){return null}prepareFrame(e){return Q()}renderFrame(e,t){return Q()}forEachFeatureAtCoordinate(e,t,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const t=e.target;(t.getState()===W.LOADED||t.getState()===W.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=W.LOADED&&t!=W.ERROR&&e.addEventListener(K.CHANGE,this.boundHandleImageChange_),t==W.IDLE&&(e.load(),t=e.getState()),t==W.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Op=[];let _s=null;function Tw(){_s=Me(1,1,void 0,{willReadFrequently:!0})}class Tu extends bw{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=St(),this.pixelTransform=St(),this.inversePixelTransform=St(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,i){_s||Tw(),_s.clearRect(0,0,1,1);let r;try{_s.drawImage(e,t,i,1,1,0,0,1,1),r=_s.getImageData(0,0,1,1).data}catch{return _s=null,null}return r}getBackground(e){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(e.viewState.resolution)),i||void 0}useContainer(e,t,i){const r=this.getLayer().getClassName();let s,o;if(e&&e.className===r&&(!i||e&&e.style.backgroundColor&&Bi(ss(e.style.backgroundColor),ss(i)))){const a=e.firstElementChild;xn(a)&&(o=a.getContext("2d"))}if(o&&e0(o.canvas.style.transform,t)?(this.container=e,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=ut?Df():document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Me();const l=o.canvas;s.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(e,t,i){const r=li(i),s=la(i),o=oa(i),a=sa(i);$e(t.coordinateToPixelTransform,r),$e(t.coordinateToPixelTransform,s),$e(t.coordinateToPixelTransform,o),$e(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;$e(l,r),$e(l,s),$e(l,o),$e(l,a),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.clip()}prepareContainer(e,t){const i=e.extent,r=e.viewState.resolution,s=e.viewState.rotation,o=e.pixelRatio,a=Math.round(ne(i)/r*o),l=Math.round(Oe(i)/r*o);Ti(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,s,-a/2,-l/2),gf(this.inversePixelTransform,this.pixelTransform);const c=$y(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){const h=this.context.canvas;h.width!=a||h.height!=l?(h.width=a,h.height=l):this.context.clearRect(0,0,a,l),c!==h.style.transform&&(h.style.transform=c)}}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new xg(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_($t.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_($t.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new vu),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_($t.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_($t.POSTRENDER,this.context,e))}getRenderTransform(e,t,i,r,s,o,a){const l=s/2,c=o/2,h=r/t,u=-h,d=-e[0]+a,g=-e[1];return Ti(this.tempTransform,l,c,h,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class Rw extends Tu{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=jt(),this.wrappedRenderedExtent_=jt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,t,i){const r=t.extent,s=t.viewState,o=s.center,a=s.resolution,l=s.projection,c=s.rotation,h=l.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),g=t.pixelRatio,f=t.viewHints,p=!(f[De.ANIMATING]||f[De.INTERACTING]),A=this.context,m=Math.round(ne(r)/a*g),y=Math.round(Oe(r)/a*g),E=u.getWrapX()&&l.canWrapX(),x=E?ne(h):null,_=E?Math.ceil((r[2]-h[2])/x)+1:1;let w=E?Math.floor((r[0]-h[0])/x):0;do{let v=this.getRenderTransform(o,a,0,g,m,y,w*x);t.declutter&&(v=v.slice(0)),e.execute(A,[A.canvas.width,A.canvas.height],v,c,p,i===void 0?Tr:i?El:ww,i?d&&t.declutter[d]:void 0)}while(++w<_)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=Me(this.context.canvas.width,this.context.canvas.height,Op))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){const e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,ro(this.context),Op.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(e){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,e,!0)}renderDeferredInternal(e){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(e,t){const i=e.layerStatesArray[e.layerIndex];this.opacity_=i.opacity;const r=e.viewState;this.prepareContainer(e,t);const s=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener($t.PRERENDER)||this.getLayer().hasListener($t.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(s,e),r.projection,this.clipped_=!1,a&&i.extent&&this.clipping){const l=ci(i.extent);a=ze(l,e.extent),this.clipped_=a&&!Ui(l,e.extent),this.clipped_&&this.clipUnrotated(s,e,l)}return a&&this.renderWorlds(o,e,this.getLayer().getDeclutter()?!1:void 0),!e.declutter&&this.clipped_&&s.restore(),this.postRender(s,e),this.renderedRotation_!==r.rotation&&(this.renderedRotation_=r.rotation,this.hitDetectionImageData_=null),e.declutter||this.resetDrawContext_(),this.container}getFeatures(e){return new Promise(t=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],u=i[0]*Kt,d=i[1]*Kt;h.push(this.getRenderTransform(r,s,o,Kt,u,d,0).slice());const g=c.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Ui(f,l)){let p=l[0];const A=ne(f);let m=0,y;for(;p<f[0];)--m,y=A*m,h.push(this.getRenderTransform(r,s,o,Kt,u,d,y).slice()),p+=A;for(m=0,p=l[2];p>f[2];)++m,y=A*m,h.push(this.getRenderTransform(r,s,o,Kt,u,d,y).slice()),p-=A}this.hitDetectionImageData_=kp(i,h,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Eu(s,this.renderedPixelRatio_),null)}t(Dp(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,i,r,s){var d,g;if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,l=this.getLayer(),c={},h=function(f,p,A){const m=Y(f),y=c[m];if(y){if(y!==!0&&A<y.distanceSq){if(A===0)return c[m]=!0,s.splice(s.lastIndexOf(y),1),r(f,l,p);y.geometry=p,y.distanceSq=A}}else{if(A===0)return c[m]=!0,r(f,l,p);s.push(c[m]={feature:f,layer:l,geometry:p,distanceSq:A,callback:r})}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,o,a,i,h,u?(g=(d=t.declutter)==null?void 0:d[u])==null?void 0:g.all().map(f=>f.value):null)}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const t=this.getLayer(),i=t.getSource();if(!i)return!1;const r=e.viewHints[De.ANIMATING],s=e.viewHints[De.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,h=c.projection,u=c.resolution,d=e.pixelRatio,g=t.getRevision(),f=t.getRenderBuffer();let p=t.getRenderOrder();p===void 0&&(p=$E);const A=c.center.slice(),m=ji(l,f*u),y=m.slice(),E=[m.slice()],x=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!Ui(x,e.extent)){const B=ne(x),R=Math.max(ne(m)/2,B);m[0]=x[0]-R,m[2]=x[2]+R,gc(A,h);const S=Yd(E[0],h);S[0]<x[0]&&S[2]<x[2]?E.push([S[0]+B,S[1],S[2]+B,S[3]]):S[0]>x[0]&&S[2]>x[2]&&E.push([S[0]-B,S[1],S[2]-B,S[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&Ui(this.wrappedRenderedExtent_,m))return Bi(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=A,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const _=new Pp(vp(u,d),m,u,d);let w;for(let B=0,R=E.length;B<R;++B)i.loadFeatures(E[B],u,h);const v=Eu(u,d);let C=!0;const b=(B,R)=>{let S;const L=B.getStyleFunction()||t.getStyleFunction();if(L&&(S=L(B,u)),S){const z=this.renderFeature(B,v,S,_,w,this.getLayer().getDeclutter(),R);C=C&&!z}},T=ma(m),I=i.getFeaturesInExtent(T);p&&I.sort(p);for(let B=0,R=I.length;B<R;++B)b(I[B],B);this.renderedFeatures_=I,this.ready=C;const F=_.finish(),P=new Lp(m,u,d,i.getOverlaps(),F,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=m,this.renderedCenter_=A,this.renderedProjection_=h,this.renderedPixelRatio_=d,this.replayGroup_=P,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,i,r,s,o,a){if(!i)return!1;let l=!1;if(Array.isArray(i))for(let c=0,h=i.length;c<h;++c)l=yl(r,e,i[c],t,this.boundHandleStyleImageChange_,s,o,a)||l;else l=yl(r,e,i,t,this.boundHandleStyleImageChange_,s,o,a);return l}}class Dn extends Rh{constructor(e){super(e)}createRenderer(){return new Rw(this)}}class Sw extends xh{constructor(e,t,i,r,s){const o=s!==void 0?W.IDLE:W.LOADED;super(e,t,i,o),this.loader_=s!==void 0?s:null,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=W.ERROR):this.state=W.LOADED,this.changed()}load(){this.state==W.IDLE&&(this.state=W.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}class jo extends Ws{constructor(e,t,i){super(),i=i||{},this.tileCoord=e,this.state=t,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(K.CHANGE)}release(){this.setState(G.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==G.EMPTY){if(this.state!==G.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}}load(){Q()}getAlpha(e,t){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=t,this.transitionStarts_[e]=i;else if(i===-1)return 1;const r=t-i+1e3/60;return r>=this.transition_?1:Kd(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class Gp extends jo{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_,ut?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,r!==null&&(this.image_.crossOrigin=r)),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=G.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=G.ERROR,this.unlistenImage_(),this.image_=Iw(),this.changed()}handleImageLoad_(){if(ut)this.state=G.LOADED;else{const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=G.LOADED:this.state=G.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==G.ERROR&&(this.state=G.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=D_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function Iw(){const n=Me(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}class Ru{constructor(e,t,i,r){this.minX=e,this.maxX=t,this.minY=i,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function xs(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new Ru(n,e,t,i)}const Bp=[];class Pw extends jo{constructor(e,t,i,r,s){super(e,t,{transition:0}),this.context_=null,this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=r.bind(void 0,this),this.removeSourceTiles_=s,this.wrappedTileCoord=i}getContext(){return this.context_||(this.context_=Me(1,1,Bp)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=Y(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(ro(this.context_),Bp.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let Np=class extends jo{constructor(e,t,i,r,s,o){super(e,t,o),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==G.IDLE&&(this.setState(G.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(G.ERROR)}setFeatures(e){this.features_=e,this.setState(G.LOADED)}setLoader(e){this.loader_=e}};const zp="https://api.mapbox.com";function Su(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function Mw(n,e,t){if(typeof n=="string")return[{id:"default",url:jp(n,e,t)}];for(const i of n)i.url=jp(i.url,e,t);return n}function jp(n,e,t){const i=Su(n);if(!i)return decodeURI(new URL(n,t).href);const r="sprites/";if(i.indexOf(r)!==0)throw new Error(`unexpected sprites url: ${n}`);const s=i.slice(r.length);return`${zp}/styles/v1/${s}/sprite?access_token=${e}`}function wl(n,e){const t=Su(n);if(!t)return decodeURI(new URL(n,location.href).href);const i="styles/";if(t.indexOf(i)!==0)throw new Error(`unexpected style url: ${n}`);const r=t.slice(i.length);return`${zp}/styles/v1/${r}?&access_token=${e}`}const Fw=["a","b","c","d"];function vl(n,e,t,i){const r=new URL(n,i||location.href),s=Su(n);if(!s)return e?(r.searchParams.has(t)||r.searchParams.set(t,e),[decodeURI(r.href)]):[decodeURI(r.href)];if(s==="mapbox.satellite"){const o=window.devicePixelRatio>=1.5?"@2x":"";return[`https://api.mapbox.com/v4/${s}/{z}/{x}/{y}${o}.webp?access_token=${e}`]}return Fw.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}const yt=Object.freeze({}),Up={},Vp={};let Lw=0;function Iu(n){return n.id||(n.id=Lw++),n.id}function Pu(n,e){return Iu(n)+"."+Y(e)}function Mu(n){let e=Up[n.id];return e||(e={},Up[Iu(n)]=e),e}function Wp(n){let e=Vp[n.id];return e||(e={},Vp[Iu(n)]=e),e}function Fu(n){return n*Math.PI/180}const Ai=(function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n})();function Cl(n,e){if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(n,e);const t=document.createElement("canvas");return t.width=n,t.height=e,t}function bl(n,e){let t=0;const i=e.length;for(;t<i;++t)if(e[t]<n&&t+1<i){const s=e[t]/e[t+1];return t+Math.log(e[t]/n)/Math.log(s)}return i-1}function Uo(n,e){const t=Math.floor(n),i=Math.pow(2,n-t);return e[t]/i}const Es={};function ws(n,e,t={},i){if(e in Es)return i&&(i.url=Es[e][0].url),Es[e][1];const r=t.transformRequest&&t.transformRequest(e,n)||e,s=function(l){return delete Es[e],Promise.reject(new Error("Error fetching source "+e))},o=function(l){return delete Es[e],l.ok?l.json():Promise.reject(new Error("Error fetching source "+e))},a=qn(()=>r).then(l=>l instanceof Response?(i&&(i.url=l.url),o(l)):(l instanceof Request||(l=new Request(l)),l.headers.get("Accept")||l.headers.set("Accept","application/json"),i&&(i.url=l.url),fetch(l).then(o).catch(s))).catch(s);return Es[e]=[r,a],a}function Hp(n,e){if(typeof n=="string")if(n.trim().startsWith("{"))try{const t=JSON.parse(n);return Promise.resolve(t)}catch(t){return Promise.reject(t)}else return n=wl(n,e.accessToken),ws("Style",n,e);else return Promise.resolve(n)}const Xp={};function Yp(n,e,t={}){const i=[e,JSON.stringify(n)].toString();let r=Xp[i];if(!r||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof Np)a.setLoader((h,u,d)=>{const g=function(f){f.arrayBuffer().then(p=>{const m=a.getFormat().readFeatures(p,{extent:h,featureProjection:d});a.setFeatures(m)})};qn(()=>c).then(f=>{if(f instanceof Response)return g(f);fetch(f).then(g).catch(p=>a.setState(G.ERROR))}).catch(f=>a.setState(G.ERROR))});else{const h=a.getImage();qn(()=>c).then(u=>{if(typeof u=="string"){h.src=u;return}const d=g=>g.blob().then(f=>{const p=URL.createObjectURL(f);h.addEventListener("load",()=>URL.revokeObjectURL(p)),h.addEventListener("error",()=>URL.revokeObjectURL(p)),h.src=p});if(u instanceof Response)return d(u);fetch(u).then(d).catch(g=>a.setState(G.ERROR))}).catch(u=>a.setState(G.ERROR))}});const o=n.url;if(o&&!n.tiles){const a=vl(o,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(o.startsWith("mapbox://"))r=Promise.resolve({tileJson:Object.assign({},n,{url:void 0,tiles:a}),tileLoadFunction:s});else{const l={};r=ws("Source",a[0],t,l).then(function(c){return c.tiles=c.tiles.map(function(h){return c.scheme==="tms"&&(h=h.replace("{y}","{-y}")),vl(h,t.accessToken,t.accessTokenParam||"access_token",l.url)[0]}),Promise.resolve({tileJson:c,tileLoadFunction:s})})}}else n.tiles?(n=Object.assign({},n,{tiles:n.tiles.map(function(a){return n.scheme==="tms"&&(a=a.replace("{y}","{-y}")),vl(a,t.accessToken,t.accessTokenParam||"access_token",e||location.href)[0]})}),r=Promise.resolve({tileJson:Object.assign({},n),tileLoadFunction:s})):r=Promise.reject(new Error("source has no `tiles` nor `url`"));Xp[i]=r}return r}function Kp(n,e,t,i){const r=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=Cl(r[0],r[1]),o=s.getContext("2d");o.drawImage(n,e.x,e.y,e.width,e.height,t*e.pixelRatio,t*e.pixelRatio,e.width,e.height);const a=o.getImageData(0,0,r[0],r[1]);o.globalCompositeOperation="destination-over",o.fillStyle=`rgba(${i.r*255},${i.g*255},${i.b*255},${i.a})`;const l=a.data;for(let c=0,h=a.width;c<h;++c)for(let u=0,d=a.height;u<d;++u){const g=(u*h+c)*4;l[g+3]>0&&o.arc(c,u,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function kw(n,e,t){const i=Math.max(0,Math.min(1,(t-n)/(e-n)));return i*i*(3-2*i)}function Zp(n,e,t){const i=Cl(e.width,e.height),r=i.getContext("2d");r.drawImage(n,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let a=0,l=s.width;a<l;++a)for(let c=0,h=s.height;c<h;++c){const u=(c*l+a)*4,d=o[u+3]/255,g=.75,f=.1,p=kw(g-f,g+f,d);p>0?(o[u+0]=Math.round(255*t.r*p),o[u+1]=Math.round(255*t.g*p),o[u+2]=Math.round(255*t.b*p),o[u+3]=Math.round(255*p)):o[u+3]=0}return r.putImageData(s,0,0),i}const Dw=Array(256).join(" ");function Lu(n,e){if(e>=.05){let t="";const i=n.split(`
25
+ `),r=Dw.slice(0,Math.round(e/.1));for(let s=0,o=i.length;s<o;++s)s>0&&(t+=`
26
+ `),t+=i[s].split("").join(r);return t}return n}let ku;function qp(){return ku||(ku=Cl(1,1).getContext("2d")),ku}function Rr(n,e){return qp().measureText(n).width+(n.length-1)*e}const Tl={};gr.on("propertychange",()=>{for(const n in Tl)delete Tl[n]});function Du(n,e,t,i){if(n.indexOf(`
27
+ `)!==-1){const o=n.split(`
28
+ `),a=[];for(let l=0,c=o.length;l<c;++l)a.push(Du(o[l],e,t,i));return a.join(`
29
+ `)}const r=t+","+e+","+n+","+i;let s=Tl[r];if(!s){const o=n.split(" ");if(o.length>1){const a=qp();a.font=e;const c=a.measureText("M").width*t;let h="";const u=[];for(let d=0,g=o.length;d<g;++d){const f=o[d],p=h+(h?" ":"")+f;Rr(p,i)<=c?h=p:(h&&u.push(h),h=f)}h&&u.push(h);for(let d=0,g=u.length;d<g&&g>1;++d){const f=u[d];if(Rr(f,i)<c*.35){const p=d>0?Rr(u[d-1],i):1/0,A=d<g-1?Rr(u[d+1],i):1/0;u.splice(d,1),g-=1,p<A?(u[d-1]+=" "+f,d-=1):u[d]=f+" "+u[d]}}for(let d=0,g=u.length-1;d<g;++d){const f=u[d],p=u[d+1];if(Rr(f,i)>c*.7&&Rr(p,i)<c*.6){const A=f.split(" "),m=A.pop();Rr(m,i)<c*.2&&(u[d]=A.join(" "),u[d+1]=m+" "+p),g-=1}}s=u.join(`
30
+ `)}else s=n;s=Lu(s,i),Tl[r]=s}return s}const Ow=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],Qp={};function Gw(n,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){if(ut)return n;let t;for(let i=0,r=n.length;i<r;++i){const s=n[i];if(s in Qp)continue;Qp[s]=!0;const a=xu(s,16).split(" ");t||(t=[]),t.push([a.slice(3).join(" ").replace(/"/g,""),a[1],a[0]])}return t&&(async()=>{await document.fonts.ready;for(let i=0,r=t.length;i<r;++i){const s=t[i],o=s[0];if(Ow.includes(o))continue;const a=s[1],l=s[2];if(!(await document.fonts.load(`${l} ${a} 16px "${o}"`)).some(h=>h.family.replace(/^['"]|['"]$/g,"").toLowerCase()===o.toLowerCase()&&h.weight==a&&h.style===l)){const h=e.replace("{font-family}",o.replace(/ /g,"-").toLowerCase()).replace("{Font+Family}",o.replace(/ /g,"+")).replace("{fontweight}",a).replace("{-fontstyle}",l.replace("normal","").replace(/(.+)/,"-$1")).replace("{fontstyle}",l);if(!document.querySelector('link[href="'+h+'"]')){const u=document.createElement("link");u.href=h,u.rel="stylesheet",document.head.appendChild(u)}}}})(),n}const Bw={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Nw={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},zw=function(n,e){const t=GE(n,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return t.value},vt={zoom:0,distanceFromCenter:0};Yt.register(dl,{...Yt.definitions,pitch:[{kind:"number"},[],n=>vt.pitch||90],"distance-from-center":[{kind:"number"},[],n=>vt.distanceFromCenter||0]});let Rl,Ou;function H(n,e,t,i,r,s){const o=n.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[o]||(r[o]={});const a=r[o];if(!a[t]){let l=(n[e]||yt)[t];const c=qE[`${e}_${n.type}`][t];l===void 0&&(l=c.default);let h=OE(l);if(!h&&cp(l)&&(l=WE(l,c),h=!0),h){const u=zw(l,c);a[t]=u.evaluate.bind(u)}else{const u=c.type;(u==="color"||u==="colorArray")&&(l=xe.parse(l)),a[t]=function(){return l}}}return a[t](vt,i,s)}function Jp(n,e,t,i){return H(n,"layout",`${t}-allow-overlap`,e,i)?H(n,"layout",`${t}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function jw(n,e,t,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(n in i))try{i[n]=jE(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[n]=function(){return!1}}return i[n](vt,t)}function On(n,e){if(n){if(n.a===0||e===0)return;const t=n.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(n.r*255/t)+","+Math.round(n.g*255/t)+","+Math.round(n.b*255/t)+","+t*e+")"}return n}const Uw=/\{[^{}}]*\}/g;function Gu(n,e){return n.replace(Uw,function(t){return e[t.slice(1,-1)]||""})}function $p(n,e){let t=n.split(":")[0];return t===n&&(t="default"),e[t]}const Bu={};function Nu(n,e,t,i=Ai,r=void 0,s=void 0,o=void 0,a=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");Bu[Pu(e,n)]=Array.from(arguments);const l={};(typeof s=="string"||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const _ in s){const w=s[_];qn(()=>w).then(async v=>{let C;if(typeof Image<"u"){const b=new Image;if(typeof v=="string")b.crossOrigin="anonymous",b.src=v;else{let T;v instanceof Request?T=await fetch(v):v instanceof Response&&(T=v);const I=await T.blob();C=URL.createObjectURL(I),b.src=C}b.addEventListener("load",function T(){b.removeEventListener("load",T),l[_]={image:b,size:[b.width,b.height]},n.changed(),C&&URL.revokeObjectURL(C)}),b.addEventListener("error",function T(){URL.revokeObjectURL(C),b.removeEventListener("error",T)})}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const b=self;b.postMessage({action:"loadImage",src:v}),b.addEventListener("message",function(I){I.data.action==="imageLoaded"&&I.data.src===v&&(l[_]={image:I.data.image,size:[I.data.image.width,I.data.image.height]})})}})}const c=Sg(e.layers),h={},u=[],d={},g={},f=Mu(e),p=Wp(e);let A;for(let _=0,w=c.length;_<w;++_){const v=c[_],C=v.id;if(typeof t=="string"&&v.source==t||Array.isArray(t)&&t.indexOf(C)!==-1){const b=v["source-layer"];if(A){if(v.source!==A)throw new Error(`Layer "${C}" does not use source "${A}`)}else{A=v.source;const I=e.sources[A];if(!I)throw new Error(`Source "${A}" is not defined`);const F=I.type;if(F!=="vector"&&F!=="geojson")throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${F}"`)}let T=h[b];T||(T=[],h[b]=T),T.push({layer:v,index:_}),u.push(C)}}const m=new ti,y=new Vt,E=[],x=function(_,w,v){var z,V,U;const C=((U=(V=(z=n.getSource)==null?void 0:z.call(n))==null?void 0:V.format_)==null?void 0:U.layerName_)??"mvt:layer",b=_.getProperties(),T=h[b[C]];if(!T)return;let I=i.indexOf(w);I==-1&&(I=bl(w,i)),vt.zoom=I,vt.distanceFromCenter=0;const F=_.getGeometry(),P=Bw[F.getType()],B=n.get("map");if(B&&B instanceof To&&P===1){const X=B.getSize();if(X){const D=B.getView().getCenter(),q=Ut(F.getExtent());vt.distanceFromCenter=tr(D,q)/w/X[1]}}const R={id:_.getId(),properties:b,type:P},S=n.get("mapbox-featurestate")[_.getId()];let L=-1;for(let X=0,D=T.length;X<D;++X){const q=T[X],O=q.layer,se=O.id;if(v!==void 0&&v!==se)continue;const we=O.layout||yt,ge=O.paint||yt;if(we.visibility==="none"||"minzoom"in O&&I<O.minzoom||"maxzoom"in O&&I>=O.maxzoom)continue;const We=O.filter;if(!We||jw(se,We,R,p)){let ve,Fe,xi,_t,ft,j;const Ke=q.index;if(P==3&&(O.type=="fill"||O.type=="fill-extrusion"))if(Fe=H(O,"paint",O.type+"-opacity",R,f,S),O.type+"-pattern"in ge){const Le=H(O,"paint",O.type+"-pattern",R,f,S);if(Le){const Se=typeof Le=="string"?Gu(Le,b):Le.toString(),Ce=$p(Se,l);if(r&&r[Se]&&Ce){++L,j=E[L],(!j||!j.getFill()||j.getStroke()||j.getText())&&(j=new rt({fill:new Vt}),E[L]=j),xi=j.getFill(),j.setZIndex(Ke);const Ae=Se+"."+Fe;let Ze=g[Ae];if(!Ze){const oe=r[Se],fe=Cl(oe.width,oe.height),qe=fe.getContext("2d");qe.globalAlpha=Fe,qe.drawImage(Ce.image,oe.x,oe.y,oe.width,oe.height,0,0,oe.width,oe.height),Ze=qe.createPattern(fe,"repeat"),g[Ae]=Ze}xi.setColor(Ze)}}}else ve=On(H(O,"paint",O.type+"-color",R,f,S),Fe),O.type+"-outline-color"in ge&&(ft=On(H(O,"paint",O.type+"-outline-color",R,f,S),Fe)),ft||(ft=ve),(ve||ft)&&(++L,j=E[L],(!j||ve&&!j.getFill()||!ve&&j.getFill()||ft&&!j.getStroke()||!ft&&j.getStroke()||j.getText())&&(j=new rt({fill:ve?new Vt:void 0,stroke:ft?new ti:void 0}),E[L]=j),ve&&(xi=j.getFill(),xi.setColor(ve)),ft&&(_t=j.getStroke(),_t.setColor(ft),_t.setWidth(.5)),j.setZIndex(Ke));if(P!=1&&O.type=="line"){"line-pattern"in ge?ve=void 0:ve=On(H(O,"paint","line-color",R,f,S),H(O,"paint","line-opacity",R,f,S));const Le=H(O,"paint","line-width",R,f,S);ve&&Le>0&&(++L,j=E[L],(!j||!j.getStroke()||j.getFill()||j.getText())&&(j=new rt({stroke:new ti}),E[L]=j),_t=j.getStroke(),_t.setLineCap(H(O,"layout","line-cap",R,f,S)),_t.setLineJoin(H(O,"layout","line-join",R,f,S)),_t.setMiterLimit(H(O,"layout","line-miter-limit",R,f,S)),_t.setColor(ve),_t.setWidth(Le),_t.setLineDash(ge["line-dasharray"]?H(O,"paint","line-dasharray",R,f,S).map(function(Se){return Se*Le}):null),j.setZIndex(Ke))}let gt=!1,re=null,rn=0,si,Ve,Oi;if((P==1||P==2)&&"icon-image"in we){const Le=H(O,"layout","icon-image",R,f,S);if(Le){si=typeof Le=="string"?Gu(Le,b):Le.toString();let Se;const Ce=a?a(n,si):void 0,Ae=$p(si,l);if(r&&r[si]&&Ae||Ce){const Ze=H(O,"layout","icon-rotation-alignment",R,f,S);if(P==2){const oe=_.getGeometry();if(oe.getFlatMidpoint||oe.getFlatMidpoints){const fe=oe.getExtent();if(Math.sqrt(Math.max(Math.pow((fe[2]-fe[0])/w,2),Math.pow((fe[3]-fe[1])/w,2)))>150){const Qe=oe.getType()==="MultiLineString"?oe.getFlatMidpoints():oe.getFlatMidpoint();if(Ou||(Rl=[NaN,NaN],Ou=new ht("Point",Rl,[],2,{},void 0)),Se=Ou,Rl[0]=Qe[0],Rl[1]=Qe[1],H(O,"layout","symbol-placement",R,f,S)==="line"&&Ze==="map"){const qt=oe.getStride(),ot=oe.getFlatCoordinates();for(let at=0,Re=ot.length-qt;at<Re;at+=qt){const He=ot[at],bt=ot[at+1],ke=ot[at+qt],Je=ot[at+qt+1],on=Math.min(He,ke),kt=Math.max(He,ke),Dt=Qe[0],Ot=Qe[1],Ei=(Je-bt)*(Dt-He)-(ke-He)*(Ot-bt);if(Math.abs(Ei)<.001&&Dt<=kt&&Dt>=on){rn=Math.atan2(bt-Je,ke-He);break}}}}}}if(P!==2||Se){const oe=H(O,"layout","icon-size",R,f,S),fe=ge["icon-color"]!==void 0?H(O,"paint","icon-color",R,f,S):null;if(!fe||fe.a!==0){const qe=H(O,"paint","icon-halo-color",R,f,S),Qe=H(O,"paint","icon-halo-width",R,f,S);let Zt=`${si}.${oe}.${Qe}.${qe}`;if(fe!==null&&(Zt+=`.${fe}`),Ve=d[Zt],!Ve){const qt=Jp(O,R,"icon",f);let ot;"icon-offset"in we&&(ot=H(O,"layout","icon-offset",R,f,S).slice(0),ot[0]*=oe,ot[1]*=-oe);let at=fe?[fe.r*255,fe.g*255,fe.b*255,fe.a]:void 0;if(Ce){const Re={color:at,rotateWithView:Ze==="map",displacement:ot,declutterMode:qt,scale:oe};typeof Ce=="string"?Re.src=Ce:(Re.img=Ce,Re.imgSize=[Ce.width,Ce.height]),Ve=new Ar(Re)}else{const Re=r[si];let He,bt,ke;if(Qe)Re.sdf?(He=Kp(Zp(Ae.image,Re,fe||[0,0,0,1]),{x:0,y:0,width:Re.width,height:Re.height,pixelRatio:Re.pixelRatio},Qe,qe),at=void 0):He=Kp(Ae.image,Re,Qe,qe);else{if(Re.sdf&&!Ae.unSDFed){const Je=Zp(Ae.image,{x:0,y:0,width:Ae.size[0],height:Ae.size[1]},{r:1,g:1,b:1});Ae.image=Je,Ae.unSDFed=!0}He=Ae.image,bt=[Re.width,Re.height],ke=[Re.x,Re.y]}Ve=new Ar({color:at,img:He,imgSize:Ae.size,size:bt,offset:ke,rotateWithView:Ze==="map",scale:oe/Re.pixelRatio,displacement:ot,declutterMode:qt})}d[Zt]=Ve}}Ve&&(++L,j=E[L],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new rt,E[L]=j),j.setGeometry(Se),Ve.setRotation(rn+Fu(H(O,"layout","icon-rotate",R,f,S))),Ve.setOpacity(H(O,"paint","icon-opacity",R,f,S)),Ve.setAnchor(Nw[H(O,"layout","icon-anchor",R,f,S)]),j.setImage(Ve),re=j.getText(),j.setText(void 0),j.setZIndex(Ke),gt=!0,Oi=!1)}else Oi=!0}}}if(P==1&&O.type==="circle"){++L,j=E[L],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new rt,E[L]=j);const Le="circle-radius"in ge?H(O,"paint","circle-radius",R,f,S):5,Se=On(H(O,"paint","circle-stroke-color",R,f,S),H(O,"paint","circle-stroke-opacity",R,f,S)),Ce=H(O,"paint","circle-translate",R,f,S),Ae=On(H(O,"paint","circle-color",R,f,S),H(O,"paint","circle-opacity",R,f,S)),Ze=H(O,"paint","circle-stroke-width",R,f,S),oe=Le+"."+Se+"."+Ae+"."+Ze+"."+Ce[0]+"."+Ce[1];Ve=d[oe],Ve||(Ve=new pr({radius:Le,displacement:[Ce[0],-Ce[1]],stroke:Se&&Ze>0?new ti({width:Ze,color:Se}):void 0,fill:Ae?new Vt({color:Ae}):void 0,declutterMode:"none"}),d[oe]=Ve),j.setImage(Ve),re=j.getText(),j.setText(void 0),j.setGeometry(void 0),j.setZIndex(Ke),gt=!0}let Be,Ne,sn,oi,Gi,Hn;if("text-field"in we){oi=Math.round(H(O,"layout","text-size",R,f,S));const Le=H(O,"layout","text-font",R,f,S);sn=H(O,"layout","text-line-height",R,f,S),Ne=xu(o?o(Le,e.metadata?e.metadata["ol:webfonts"]:void 0):Le,oi,sn),Ne.includes("sans-serif")||(Ne+=",sans-serif"),Gi=H(O,"layout","text-letter-spacing",R,f,S),Hn=H(O,"layout","text-max-width",R,f,S);const Se=H(O,"layout","text-field",R,f,S);typeof Se=="object"&&Se.sections?Se.sections.length===1?Be=Se.toString():Be=Se.sections.reduce((Ce,Ae,Ze)=>{const oe=Ae.fontStack?Ae.fontStack.split(","):Le,fe=xu(o?o(oe):oe,oi*(Ae.scale||1),sn);let qe=Ae.text;if(qe===`
31
+ `)return Ce.push(`
32
+ `,""),Ce;if(P==2)return Ce.push(Lu(qe,Gi),fe),Ce;qe=Du(qe,fe,Hn,Gi).split(`
33
+ `);for(let Qe=0,Zt=qe.length;Qe<Zt;++Qe)Qe>0&&Ce.push(`
34
+ `,""),Ce.push(qe[Qe],fe);return Ce},[]):Be=Gu(Se,b).trim(),Fe=H(O,"paint","text-opacity",R,f,S)}if(Be&&Fe&&!Oi){gt||(++L,j=E[L],(!j||!j.getText()||j.getFill()||j.getStroke())&&(j=new rt,E[L]=j),j.setImage(void 0),j.setGeometry(void 0));const Le=Jp(O,R,"text",f);j.getText()||j.setText(re),re=j.getText(),(!re||"getDeclutterMode"in re&&re.getDeclutterMode()!==Le)&&(re=new Oa({padding:[2,2,2,2],declutterMode:Le}),j.setText(re));const Se=H(O,"layout","text-transform",R,f,S);Se=="uppercase"?Be=Array.isArray(Be)?Be.map((ke,Je)=>Je%2?ke:ke.toUpperCase()):Be.toUpperCase():Se=="lowercase"&&(Be=Array.isArray(Be)?Be.map((ke,Je)=>Je%2?ke:ke.toLowerCase()):Be.toLowerCase());const Ce=Array.isArray(Be)?Be:P==2?Lu(Be,Gi):Du(Be,Ne,Hn,Gi);if(re.setText(Ce),re.setFont(Ne),re.setRotation(Fu(H(O,"layout","text-rotate",R,f,S))),typeof re.setKeepUpright=="function"){const ke=H(O,"layout","text-keep-upright",R,f,S);re.setKeepUpright(ke)}const Ae=H(O,"layout","text-anchor",R,f,S),Ze=gt||P==1?"point":H(O,"layout","symbol-placement",R,f,S);let oe;if(Ze==="line-center"?(re.setPlacement("line"),oe="center"):re.setPlacement(Ze),Ze==="line"&&typeof re.setRepeat=="function"){const ke=H(O,"layout","symbol-spacing",R,f,S);re.setRepeat(ke*2)}re.setOverflow(Ze==="point");let fe=H(O,"paint","text-halo-width",R,f,S);const qe=H(O,"layout","text-offset",R,f,S),Qe=H(O,"paint","text-translate",R,f,S);let Zt=0,qt=0;if(Ze=="point"){oe="center",Ae.indexOf("left")!==-1?(oe="left",qt=fe):Ae.indexOf("right")!==-1&&(oe="right",qt=-fe);const ke=H(O,"layout","text-rotation-alignment",R,f,S);re.setRotateWithView(ke=="map")}else re.setMaxAngle(Fu(H(O,"layout","text-max-angle",R,f,S))*Be.length/Ce.length),re.setRotateWithView(!1);re.setTextAlign(oe);let ot="middle";Ae.indexOf("bottom")==0?(ot="bottom",Zt=-fe-.5*(sn-1)*oi):Ae.indexOf("top")==0&&(ot="top",Zt=fe+.5*(sn-1)*oi),re.setTextBaseline(ot);const at=H(O,"layout","text-justify",R,f,S);re.setJustify(at==="auto"?void 0:at),re.setOffsetX(qe[0]*oi+qt+Qe[0]),re.setOffsetY(qe[1]*oi+Zt+Qe[1]),y.setColor(On(H(O,"paint","text-color",R,f,S),Fe)),re.setFill(y);const Re=On(H(O,"paint","text-halo-color",R,f,S),Fe);if(Re&&fe>0){m.setColor(Re),fe*=2;const ke=.5*oi;m.setWidth(fe<=ke?fe:ke),re.setStroke(m)}else re.setStroke(void 0);const He=H(O,"layout","text-padding",R,f,S),bt=re.getPadding();He!==bt[0]&&(bt[0]=He,bt[1]=He,bt[2]=He,bt[3]=He),j.setZIndex(Ke)}}}if(L>-1)return E.length=L+1,E};return n.setStyle(x),n.set("mapbox-layers",u),n.set("mapbox-source",A),n.set("mapbox-featurestate",n.get("mapbox-featurestate")||{}),x}const zu=65536*65536,eA=1/zu,Vw=12,tA=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),ju=0,Sl=1,Vo=2,Il=5;class Ww{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,i=this.length){for(;this.pos<i;){const r=this.readVarint(),s=r>>3,o=this.pos;this.type=r&7,e(s,t,this),this.pos===o&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*zu;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*zu;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let i,r;return r=t[this.pos++],i=r&127,r<128||(r=t[this.pos++],i|=(r&127)<<7,r<128)||(r=t[this.pos++],i|=(r&127)<<14,r<128)||(r=t[this.pos++],i|=(r&127)<<21,r<128)?i:(r=t[this.pos],i|=(r&15)<<28,Hw(i,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=Vw&&tA?tA.decode(this.buf.subarray(t,e)):rv(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===Vo?this.readVarint()+this.pos:this.pos+1}skip(e){const t=e&7;if(t===ju)for(;this.buf[this.pos++]>127;);else if(t===Vo)this.pos=this.readVarint()+this.pos;else if(t===Il)this.pos+=4;else if(t===Sl)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*eA),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*eA),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Xw(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const t=this.pos;this.pos=sv(this.buf,e,this.pos);const i=this.pos-t;i>=128&&iA(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let i=0;i<t;i++)this.buf[this.pos++]=e[i]}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const r=this.pos-i;r>=128&&iA(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,i){this.writeTag(e,Vo),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Zw,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,qw,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,$w,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Qw,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Jw,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,ev,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,tv,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,iv,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,nv,t)}writeBytesField(e,t){this.writeTag(e,Vo),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,Il),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,Il),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Sl),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Sl),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,ju),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,ju),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,Vo),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,Il),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Sl),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function Hw(n,e,t){const i=t.buf;let r,s;if(s=i[t.pos++],r=(s&112)>>4,s<128||(s=i[t.pos++],r|=(s&127)<<3,s<128)||(s=i[t.pos++],r|=(s&127)<<10,s<128)||(s=i[t.pos++],r|=(s&127)<<17,s<128)||(s=i[t.pos++],r|=(s&127)<<24,s<128)||(s=i[t.pos++],r|=(s&1)<<31,s<128))return vs(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function vs(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function Xw(n,e){let t,i;if(n>=0?(t=n%4294967296|0,i=n/4294967296|0):(t=~(-n%4294967296),i=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,i=i+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Yw(t,i,e),Kw(i,e)}function Yw(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function Kw(n,e){const t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function iA(n,e,t){const i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(i);for(let r=t.pos-1;r>=n;r--)t.buf[r+i]=t.buf[r]}function Zw(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t])}function qw(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t])}function Qw(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t])}function Jw(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t])}function $w(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t])}function ev(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t])}function tv(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t])}function iv(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t])}function nv(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t])}function rv(n,e,t){let i="",r=e;for(;r<t;){const s=n[r];let o=null,a=s>239?4:s>223?3:s>191?2:1;if(r+a>t)break;let l,c,h;a===1?s<128&&(o=s):a===2?(l=n[r+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(o=(s&15)<<12|(l&63)<<6|c&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=n[r+1],c=n[r+2],h=n[r+3],(l&192)===128&&(c&192)===128&&(h&192)===128&&(o=(s&15)<<18|(l&63)<<12|(c&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),r+=a}return i}function sv(n,e,t){for(let i=0,r,s;i<e.length;i++){if(r=e.charCodeAt(i),r>55295&&r<57344)if(s)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,s=r;continue}else r=s-55296<<10|r-56320|65536,s=null;else{r>56319||i+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):s=r;continue}else s&&(n[t++]=239,n[t++]=191,n[t++]=189,s=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128)}return t}class nA extends Tg{constructor(e){super(),e=e||{},this.dataProjection=new ca({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:ht,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,i,r){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,l=0,c=0,h=0,u=0;for(;e.pos<s;){if(!a){const d=e.readVarint();o=d&7,a=d>>3}if(a--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&h>u&&(r.push(h),u=h),i.push(l,c),h+=2;else if(o===7)h>u&&(i.push(i[u],i[u+1]),h+=2);else throw new Error("Invalid command found in the PBF")}h>u&&(r.push(h),u=h)}createFeature_(e,t,i){const r=t.type;if(r===0)return null;let s;const o=t.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=t.id,o[this.layerName_]=t.layer.name;const l=[],c=[];this.readRawGeometry_(e,t,l,c);const h=hv(r,c.length);if(this.featureClass===ht)s=new this.featureClass(h,l,c,2,o,a),s.transform(i.dataProjection);else{let u;if(h=="Polygon"){const f=jc(l,c);u=f.length>1?new Tn(l,"XY",f):new Jt(l,"XY",c)}else u=h==="Point"?new It(l,"XY"):h==="LineString"?new ii(l,"XY"):h==="MultiPoint"?new mr(l,"XY"):h==="MultiLineString"?new bn(l,"XY",c):null;const d=this.featureClass;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const g=Va(u,!1,i);s.setGeometry(g),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return"arraybuffer"}readFeatures(e,t){const i=this.layers_;t=this.adaptOptions(t);const r=ye(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;const s=new Ww(e),o=s.readFields(ov,{}),a=[];for(const l in o){if(i&&!i.includes(l))continue;const c=o[l],h=c?[0,0,c.extent,c.extent]:null;r.setExtent(h);for(let u=0,d=c.length;u<d;++u){const g=cv(s,c,u),f=this.createFeature_(s,g,t);f!==null&&a.push(f)}}return a}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function ov(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(av,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function av(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){let i=null;const r=t.readVarint()+t.pos;for(;t.pos<r;)n=t.readVarint()>>3,i=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(i)}}function lv(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const i=t.readVarint()+t.pos;for(;t.pos<i;){const r=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[r]=s}}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function cv(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(lv,r,i),r}function hv(n,e){let t;return n===1?t=e===1?"Point":"MultiPoint":n===2?t=e===1?"LineString":"MultiLineString":n===3&&(t="Polygon"),t}class uv extends Tu{constructor(e){super(e),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(e){const t=e.layerStatesArray[e.layerIndex],i=e.pixelRatio,r=e.viewState,s=r.resolution,o=this.getLayer().getSource(),a=e.viewHints;let l=e.extent;if(t.extent!==void 0&&(l=xt(l,ci(t.extent,r.projection))),!a[De.ANIMATING]&&!a[De.INTERACTING]&&!er(l))if(o){const c=r.projection,h=o.getImage(l,s,i,c);h&&(this.loadImage(h)?this.image=h:h.getState()===W.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=$e(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!$n(s,r))return null;const o=this.image.getExtent(),a=this.image.getImage(),l=ne(o),c=Math.floor(a.width*((r[0]-o[0])/l));if(c<0||c>=a.width)return null;const h=Oe(o),u=Math.floor(a.height*((o[3]-r[1])/h));return u<0||u>=a.height?null:this.getImageData(a,c,u)}renderFrame(e,t){const i=this.image,r=i.getExtent(),s=i.getResolution(),[o,a]=Array.isArray(s)?s:[s,s],l=i.getPixelRatio(),c=e.layerStatesArray[e.layerIndex],h=e.pixelRatio,u=e.viewState,d=u.center,g=u.resolution,f=h*o/(g*l),p=h*a/(g*l);this.prepareContainer(e,t);const A=this.context.canvas.width,m=this.context.canvas.height,y=this.getRenderContext(e);let E=!1,x=!0;if(c.extent){const b=ci(c.extent,u.projection);x=ze(b,e.extent),E=x&&!Ui(b,e.extent),E&&this.clipUnrotated(y,e,b)}const _=i.getImage(),w=Ti(this.tempTransform,A/2,m/2,f,p,0,l*(r[0]-d[0])/o,l*(d[1]-r[3])/a);this.renderedResolution=a*h/l;const v=_.width*w[0],C=_.height*w[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,e),x&&v>=.5&&C>=.5){const b=w[4],T=w[5],I=c.opacity;I!==1&&(y.save(),y.globalAlpha=I),y.drawImage(_,0,0,+_.width,+_.height,b,T,v,C),I!==1&&y.restore()}return this.postRender(this.context,e),E&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}class dv extends is{constructor(e){e=e||{},super(e)}}class Uu extends dv{constructor(e){super(e)}createRenderer(){return new uv(this)}getData(e){return super.getData(e)}}function Pl(n){return n instanceof Image||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageBitmap?n:null}function fv(n){return n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Float32Array||n instanceof DataView?n:null}const gv=new Error("disposed");let Cs=null;function pv(n){Cs||(Cs=Me(n.width,n.height,void 0,{willReadFrequently:!0}));const e=Cs.canvas,t=n.width;e.width!==t&&(e.width=t);const i=n.height;return e.height!==i&&(e.height=i),Cs.clearRect(0,0,t,i),Cs.drawImage(n,0,0),Cs.getImageData(0,0,t,i).data}const Av=[256,256];class Ml extends jo{constructor(e){const t=G.IDLE;super(e.tileCoord,t,{transition:e.transition,interpolate:e.interpolate}),this.loader_=e.loader,this.data_=null,this.error_=null,this.size_=e.size||null,this.controller_=e.controller||null}getSize(){if(this.size_)return this.size_;const e=Pl(this.data_);return e?[e.width,e.height]:Av}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=G.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=G.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(gv),this.controller_=null),super.disposeInternal()}}let Vu;const bs=[];function rA(n,e,t,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,i)+1,Math.max(t,r)),n.restore()}function Wu(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-191.25)>2}function mv(){if(Vu===void 0){const n=Me(6,6,bs);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",rA(n,4,5,4,0),rA(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Vu=Wu(e,0)||Wu(e,4)||Wu(e,8),ro(n),bs.push(n.canvas)}return Vu}function Hu(n,e,t,i){const r=pa(t,e,n);let s=wc(e,i,t);const o=e.getMetersPerUnit();o!==void 0&&(s*=o);const a=n.getMetersPerUnit();a!==void 0&&(s/=a);const l=n.getExtent();if(!l||$n(l,r)){const c=wc(n,s,r)/s;isFinite(c)&&c>0&&(s/=c)}return s}function sA(n,e,t,i){const r=Ut(t);let s=Hu(n,e,r,i);return(!isFinite(s)||s<=0)&&hc(t,function(o){return s=Hu(n,e,o,i),isFinite(s)&&s>0}),s}function oA(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Me(Math.round(t*n),Math.round(t*e),bs);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(t,t);function p(_){return Math.round(_*t)/t}f.globalCompositeOperation="lighter";const A=jt();l.forEach(function(_,w,v){cc(A,_.extent)});let m;const y=t/i,E=(u?1:1+Math.pow(2,-24))/y;if(!d||l.length!==1||c!==0){if(m=Me(Math.round(ne(A)*y),Math.round(Oe(A)*y),bs),u||(m.imageSmoothingEnabled=!1),r&&g){const _=(r[0]-A[0])*y,w=-(r[3]-A[3])*y,v=ne(r)*y,C=Oe(r)*y;m.rect(_,w,v,C),m.clip()}l.forEach(function(_,w,v){if(_.image.width>0&&_.image.height>0){if(_.clipExtent){m.save();const F=(_.clipExtent[0]-A[0])*y,P=-(_.clipExtent[3]-A[3])*y,B=ne(_.clipExtent)*y,R=Oe(_.clipExtent)*y;m.rect(u?F:Math.round(F),u?P:Math.round(P),u?B:Math.round(F+B)-Math.round(F),u?R:Math.round(P+R)-Math.round(P)),m.clip()}const C=(_.extent[0]-A[0])*y,b=-(_.extent[3]-A[3])*y,T=ne(_.extent)*y,I=Oe(_.extent)*y;m.drawImage(_.image,c,c,_.image.width-2*c,_.image.height-2*c,u?C:Math.round(C),u?b:Math.round(b),u?T:Math.round(C+T)-Math.round(C),u?I:Math.round(b+I)-Math.round(b)),_.clipExtent&&m.restore()}})}const x=li(o);return a.getTriangles().forEach(function(_,w,v){const C=_.source,b=_.target;let T=C[0][0],I=C[0][1],F=C[1][0],P=C[1][1],B=C[2][0],R=C[2][1];const S=p((b[0][0]-x[0])/s),L=p(-(b[0][1]-x[1])/s),z=p((b[1][0]-x[0])/s),V=p(-(b[1][1]-x[1])/s),U=p((b[2][0]-x[0])/s),X=p(-(b[2][1]-x[1])/s),D=T,q=I;T=0,I=0,F-=D,P-=q,B-=D,R-=q;const O=[[F,P,0,0,z-S],[B,R,0,0,U-S],[0,0,F,P,V-L],[0,0,B,R,X-L]],se=sy(O);if(!se)return;if(f.save(),f.beginPath(),mv()||!u){f.moveTo(z,V);const ge=4,We=S-z,ve=L-V;for(let Fe=0;Fe<ge;Fe++)f.lineTo(z+p((Fe+1)*We/ge),V+p(Fe*ve/(ge-1))),Fe!=ge-1&&f.lineTo(z+p((Fe+1)*We/ge),V+p((Fe+1)*ve/(ge-1)));f.lineTo(U,X)}else f.moveTo(z,V),f.lineTo(S,L),f.lineTo(U,X);f.clip(),f.transform(se[0],se[2],se[1],se[3],S,L),f.translate(A[0]-D,A[3]-q);let we;if(m)we=m.canvas,f.scale(E,-E);else{const ge=l[0],We=ge.extent;we=ge.image,f.scale(ne(We)/we.width,-Oe(We)/we.height)}f.drawImage(we,0,0),f.restore()}),m&&(ro(m),bs.push(m.canvas)),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(_,w,v){const C=_.target,b=(C[0][0]-x[0])/s,T=-(C[0][1]-x[1])/s,I=(C[1][0]-x[0])/s,F=-(C[1][1]-x[1])/s,P=(C[2][0]-x[0])/s,B=-(C[2][1]-x[1])/s;f.beginPath(),f.moveTo(I,F),f.lineTo(b,T),f.lineTo(P,B),f.closePath(),f.stroke()}),f.restore()),f.canvas}const yv=10,aA=.25;class Xu{constructor(e,t,i,r,s,o,a){this.sourceProj_=e,this.targetProj_=t;let l={};const c=a?Hy(E=>$e(a,pa(E,this.targetProj_,this.sourceProj_))):rr(this.targetProj_,this.sourceProj_);this.transformInv_=function(E){const x=E[0]+"/"+E[1];return l[x]||(l[x]=c(E)),l[x]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&ne(r)>=ne(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ne(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ne(this.targetProj_.getExtent()):null;const h=li(i),u=la(i),d=oa(i),g=sa(i),f=this.transformInv_(h),p=this.transformInv_(u),A=this.transformInv_(d),m=this.transformInv_(g),y=yv+(o?Math.max(0,Math.ceil(Math.log2(Zs(i)/(o*o*256*256)))):0);if(this.addQuad_(h,u,d,g,f,p,A,m,y),this.wrapsXInSource_){let E=1/0;this.triangles_.forEach(function(x,_,w){E=Math.min(E,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-E>this.sourceWorldWidth_/2){const _=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];_[0][0]-E>this.sourceWorldWidth_/2&&(_[0][0]-=this.sourceWorldWidth_),_[1][0]-E>this.sourceWorldWidth_/2&&(_[1][0]-=this.sourceWorldWidth_),_[2][0]-E>this.sourceWorldWidth_/2&&(_[2][0]-=this.sourceWorldWidth_);const w=Math.min(_[0][0],_[1][0],_[2][0]);Math.max(_[0][0],_[1][0],_[2][0])-w<this.sourceWorldWidth_/2&&(x.source=_)}})}l={}}addTriangle_(e,t,i,r,s,o){this.triangles_.push({source:[r,s,o],target:[e,t,i]})}addQuad_(e,t,i,r,s,o,a,l,c){const h=mt([s,o,a,l]),u=this.sourceWorldWidth_?ne(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&u>.5&&u<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const A=mt([e,t,i,r]);f=ne(A)/this.targetWorldWidth_>aA||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>aA||f)}if(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!ze(h,this.maxSourceExtent_))return;let p=0;if(!f&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)f=!0;else if(p=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),p!=1&&p!=2&&p!=4&&p!=8)return}if(c>0){if(!f){const A=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(A);let y;g?y=(gn(s[0],d)+gn(a[0],d))/2-gn(m[0],d):y=(s[0]+a[0])/2-m[0];const E=(s[1]+a[1])/2-m[1];f=y*y+E*E>this.errorThresholdSquared_}if(f){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const A=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(A),y=[(r[0]+e[0])/2,(r[1]+e[1])/2],E=this.transformInv_(y);this.addQuad_(e,t,A,y,s,o,m,E,c-1),this.addQuad_(y,A,i,r,E,m,a,l,c-1)}else{const A=[(e[0]+t[0])/2,(e[1]+t[1])/2],m=this.transformInv_(A),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],E=this.transformInv_(y);this.addQuad_(e,A,y,r,s,m,E,l,c-1),this.addQuad_(A,t,i,y,m,o,a,E,c-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(p&11)==0&&this.addTriangle_(e,i,r,s,a,l),(p&14)==0&&this.addTriangle_(e,i,t,s,a,o),p&&((p&13)==0&&this.addTriangle_(t,r,e,o,l,s),(p&7)==0&&this.addTriangle_(t,r,i,o,l,a))}calculateSourceExtent(){const e=jt();return this.triangles_.forEach(function(t,i,r){const s=t.source;Ks(e,s[0]),Ks(e,s[1]),Ks(e,s[2])}),e}getTriangles(){return this.triangles_}}const Yu=.5;class lA extends jo{constructor(e,t,i,r,s,o,a,l,c,h,u,d){super(s,G.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const g=r.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const A=f?xt(g,f):g;if(Zs(A)===0){this.state=G.EMPTY;return}const m=e.getExtent();m&&(p?p=xt(p,m):p=m);const y=r.getResolution(this.wrappedTileCoord_[0]),E=sA(e,i,A,y);if(!isFinite(E)||E<=0){this.state=G.EMPTY;return}const x=h!==void 0?h:Yu;if(this.triangulation_=new Xu(e,i,A,p,E*x,y),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=t.getZForResolution(E);let _=this.triangulation_.calculateSourceExtent();if(p&&(e.canWrapX()?(_[1]=Pe(_[1],p[1],p[3]),_[3]=Pe(_[3],p[1],p[3])):_=xt(_,p)),!Zs(_))this.state=G.EMPTY;else{let w=0,v=0;e.canWrapX()&&(w=ne(m),v=Math.floor((_[0]-m[0])/w)),uc(_.slice(),e,!0).forEach(b=>{const T=t.getTileRangeForExtentAndZ(b,this.sourceZ_);for(let I=T.minX;I<=T.maxX;I++)for(let F=T.minY;F<=T.maxY;F++){const P=c(this.sourceZ_,I,F,a);if(P){const B=v*w;this.sourceTiles_.push({tile:P,offset:B})}}++v}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(t=>{var r;const i=t.tile;if(i&&i.getState()==G.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=t.offset,s[2]+=t.offset;const o=(r=this.clipExtent_)==null?void 0:r.slice();o&&(o[0]+=t.offset,o[2]+=t.offset),e.push({extent:s,clipExtent:o,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=G.ERROR;else{const t=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(t),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=oA(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=G.LOADED}this.changed()}load(){if(this.state==G.IDLE){this.state=G.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i==G.IDLE||i==G.LOADING){e++;const r=ce(t,K.CHANGE,s=>{const o=t.getState();(o==G.LOADED||o==G.ERROR||o==G.EMPTY)&&(Te(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t},i,r){t.getState()==G.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Te),this.sourcesListenerKeys_=null}release(){this.canvas_&&(ro(this.canvas_.getContext("2d")),bs.push(this.canvas_),this.canvas_=null),super.release()}}class cA{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const e=this.pop();e instanceof js&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const i=this.entries_[e];return me(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const t=this.entries_[e];return me(t!==void 0,"Tried to get a value for a key that does not exist in the cache"),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.key_;return e}getValues(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){var t;return(t=this.entries_[e])==null?void 0:t.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){me(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}function Fl(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function _v(n,e,t){return n+"/"+e+"/"+t}function Wo(n,e,t,i,r){return`${Y(n)},${e},${_v(t,i,r)}`}function xv(n){return hA(n[0],n[1],n[2])}function hA(n,e,t){return(e<<n)+t}function Ev(n,e){const t=n[0],i=n[1],r=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;const s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}function Ku(n,e,t){if(!(t in n))return n[t]=new Set([e]),!0;const i=n[t],r=i.has(e);return r||i.add(e),!r}function wv(n,e,t){const i=n[t];return i?i.delete(e):!1}function uA(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=xt(e,ci(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=xt(e,r))}return e}class dA extends Tu{constructor(e,t){super(e),t=t||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=jt(),this.tempTileRange_=new Ru(0,0,0,0),this.tempTileCoord_=Fl(0,0,0);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileCache_=new cA(i),this.sourceTileCache_=null,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new cA(512)),this.sourceTileCache_}getOrCreateTile(e,t,i,r){const s=this.tileCache_,a=this.getLayer().getSource(),l=Wo(a,a.getKey(),e,t,i);let c;if(s.containsKey(l))c=s.get(l);else{const h=r.viewState.projection,u=a.getProjection();if(c=a.getTile(e,t,i,r.pixelRatio,h,!u||tt(u,h)?void 0:this.getSourceTileCache()),!c)return null;s.set(l,c)}return c}getTile(e,t,i,r){const s=this.getOrCreateTile(e,t,i,r);return s||null}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=$e(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!$n(s,r))return null;const o=t.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(t.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(r,h),d=this.getTile(h,u[1],u[2],t);if(!d||d.getState()!==G.LOADED)continue;const g=l.getOrigin(h),f=it(l.getTileSize(h)),p=l.getResolution(h);let A;if(d instanceof Gp||d instanceof lA)A=d.getImage();else if(d instanceof Ml){if(A=Pl(d.getData()),!A)continue}else continue;const m=Math.floor(c*((r[0]-g[0])/p-u[1]*f[0])),y=Math.floor(c*((g[1]-r[1])/p-u[2]*f[1])),E=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(A,m+E,y+E)}return null}prepareFrame(e){var r;this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const t=this.getLayer().getSource();if(!t)return!1;const i=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),(r=this.sourceTileCache_)==null||r.clear())):this.renderedSourceRevision_=i,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(e,t,i,r,s){const o=e.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=Y(l);h in e.wantedTiles||(e.wantedTiles[h]={});const u=e.wantedTiles[h],d=a.getMapInternal(),g=Math.max(i-s,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),f=o.rotation,p=f?Hd(o.center,o.resolution,f,e.size):void 0;for(let A=i;A>=g;--A){const m=c.getTileRangeForExtentAndZ(t,A,this.tempTileRange_),y=c.getResolution(A);for(let E=m.minX;E<=m.maxX;++E)for(let x=m.minY;x<=m.maxY;++x){if(f&&!c.tileCoordIntersectsViewport([A,E,x],p))continue;const _=this.getTile(A,E,x,e);if(!_||!Ku(r,_,A))continue;const v=_.getKey();if(u[v]=!0,_.getState()===G.IDLE&&!e.tileQueue.isKeyQueued(v)){const C=Fl(A,E,x,this.tempTileCoord_);e.tileQueue.enqueue([_,h,c.getTileCoordCenter(C),y])}}}}findStaleTile_(e,t){const i=this.tileCache_,r=e[0],s=e[1],o=e[2],a=this.getStaleKeys();for(let l=0;l<a.length;++l){const c=Wo(this.getLayer().getSource(),a[l],r,s,o);if(i.containsKey(c)){const h=i.peek(c);if(h.getState()===G.LOADED)return h.endTransition(Y(this)),Ku(t,h,r),!0}}return!1}findAltTiles_(e,t,i,r){const s=e.getTileRangeForTileCoordAndZ(t,i,this.tempTileRange_);if(!s)return!1;let o=!0;const a=this.tileCache_,l=this.getLayer().getRenderSource(),c=l.getKey();for(let h=s.minX;h<=s.maxX;++h)for(let u=s.minY;u<=s.maxY;++u){const d=Wo(l,c,i,h,u);let g=!1;if(a.containsKey(d)){const f=a.peek(d);f.getState()===G.LOADED&&(Ku(r,f,i),g=!0)}g||(o=!1)}return o}renderFrame(e,t){this.renderComplete=!0;const i=e.layerStatesArray[e.layerIndex],r=e.viewState,s=r.projection,o=r.resolution,a=r.center,l=e.pixelRatio,c=this.getLayer(),h=c.getSource(),u=h.getTileGridForProjection(s),d=u.getZForResolution(o,h.zDirection),g=u.getResolution(d),f=h.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==f&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=f):this.renderedSourceKey_=f;let p=e.extent;const A=h.getTilePixelRatio(l);this.prepareContainer(e,t);const m=this.context.canvas.width,y=this.context.canvas.height,E=i.extent&&ci(i.extent);E&&(p=xt(p,ci(i.extent)));const x=g*m/2/A,_=g*y/2/A,w=[a[0]-x,a[1]-_,a[0]+x,a[1]+_],v={};this.renderedTiles.length=0;const C=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){const z=u.getZForResolution(r.nextResolution,h.zDirection),V=uA(e,e.nextExtent);this.enqueueTiles(e,V,z,v,C)}const b=uA(e,p);if(this.enqueueTiles(e,b,d,v,0),C>0&&setTimeout(()=>{this.enqueueTiles(e,b,d-1,v,C-1)},0),!(d in v))return this.container;const T=Y(this),I=e.time;for(const z of v[d]){const V=z.getState();if(V===G.EMPTY)continue;const U=z.tileCoord;if(V===G.LOADED&&z.getAlpha(T,I)===1){z.endTransition(T);continue}if(V!==G.ERROR&&(this.renderComplete=!1),this.findStaleTile_(U,v)){wv(v,z,d),e.animate=!0;continue}if(this.findAltTiles_(u,U,d+1,v))continue;const q=u.getMinZoom();for(let O=d-1;O>=q&&!this.findAltTiles_(u,U,O,v);--O);}const F=g/o*l/A,P=this.getRenderContext(e);Ti(this.tempTransform,m/2,y/2,F,F,0,-m/2,-y/2),i.extent&&this.clipUnrotated(P,e,E),h.getInterpolate()||(P.imageSmoothingEnabled=!1),this.preRender(P,e);const B=Object.keys(v).map(Number);B.sort(wi);let R;const S=[],L=[];for(let z=B.length-1;z>=0;--z){const V=B[z],U=h.getTilePixelSize(V,l,s),D=u.getResolution(V)/g,q=U[0]*D*F,O=U[1]*D*F,se=u.getTileCoordForCoordAndZ(li(w),V),we=u.getTileCoordExtent(se),ge=$e(this.tempTransform,[A*(we[0]-w[0])/g,A*(w[3]-we[3])/g]),We=A*h.getGutterForProjection(s);for(const ve of v[V]){if(ve.getState()!==G.LOADED)continue;const Fe=ve.tileCoord,xi=se[1]-Fe[1],_t=Math.round(ge[0]-(xi-1)*q),ft=se[2]-Fe[2],j=Math.round(ge[1]-(ft-1)*O),Ke=Math.round(ge[0]-xi*q),gt=Math.round(ge[1]-ft*O),re=_t-Ke,rn=j-gt,si=B.length===1;let Ve=!1;R=[Ke,gt,Ke+re,gt,Ke+re,gt+rn,Ke,gt+rn];for(let Oi=0,Be=S.length;Oi<Be;++Oi)if(!si&&V<L[Oi]){const Ne=S[Oi];ze([Ke,gt,Ke+re,gt+rn],[Ne[0],Ne[3],Ne[4],Ne[7]])&&(Ve||(P.save(),Ve=!0),P.beginPath(),P.moveTo(R[0],R[1]),P.lineTo(R[2],R[3]),P.lineTo(R[4],R[5]),P.lineTo(R[6],R[7]),P.moveTo(Ne[6],Ne[7]),P.lineTo(Ne[4],Ne[5]),P.lineTo(Ne[2],Ne[3]),P.lineTo(Ne[0],Ne[1]),P.clip())}S.push(R),L.push(V),this.drawTile(ve,e,Ke,gt,re,rn,We,si),Ve&&P.restore(),this.renderedTiles.unshift(ve),this.updateUsedTiles(e.usedTiles,h,ve)}}if(this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Vi(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.postRender(this.context,e),i.extent&&P.restore(),P.imageSmoothingEnabled=!0,this.renderComplete){const z=(V,U)=>{var O;const X=Y(h),D=U.wantedTiles[X],q=D?Object.keys(D).length:0;this.updateCacheSize(q),this.tileCache_.expireCache(),(O=this.sourceTileCache_)==null||O.expireCache()};e.postRenderFunctions.push(z)}return this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,i,r,s,o,a,l){let c;if(e instanceof Ml){if(c=Pl(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const h=this.getRenderContext(t),u=Y(this),d=t.layerStatesArray[t.layerIndex],g=d.opacity*(l?e.getAlpha(u,t.time):1),f=g!==h.globalAlpha;f&&(h.save(),h.globalAlpha=g),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,r,s,o),f&&h.restore(),g!==d.opacity?t.animate=!0:l&&e.endTransition(u)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,i){const r=Y(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}}const Gn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class vv extends is{constructor(e){e=e||{};const t=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Gn.PRELOAD)}setPreload(e){this.set(Gn.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Gn.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Gn.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class Ll extends vv{constructor(e){super(e)}createRenderer(){return new dA(this,{cacheSize:this.getCacheSize()})}}const Cv={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},fA={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class bv extends dA{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=St(),this.tileClipContexts_=null}enqueueTilesForNextExtent(){return this.getLayer().getRenderMode()!=="vector"}drawTile(e,t,i,r,s,o,a,l){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,i,r,s,o,a,l)}getTile(e,t,i,r){const s=this.getOrCreateTile(e,t,i,r);if(!s)return null;const o=r.viewState,a=o.resolution,l=r.viewHints,c=this.getLayer().getSource(),h=c.getTileGridForProjection(o.projection),u=!(l[De.ANIMATING]||l[De.INTERACTING]),d=h.getZForResolution(a,c.zDirection)===e;return u&&d?s.wantedResolution=a:s.wantedResolution||(s.wantedResolution=h.getResolution(e)),s}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,i){const r=this.getLayer(),s=r.getRevision(),o=r.getRenderOrder()||null,a=e.wantedResolution,l=e.getReplayState(r);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==o)return;const c=r.getSource(),h=!!r.getDeclutter(),u=c.getTileGrid(),g=c.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),f=c.getSourceTiles(t,i,e),p=Y(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],l.dirty=!1;for(let A=0,m=f.length;A<m;++A){const y=f[A];if(y.getState()!=G.LOADED)continue;const E=c.getProjection(),x=y.tileCoord;let _=u.getTileCoordExtent(x);i&&E&&!tt(i,E)&&(_=Aa(_,E,i,32));const w=xt(g,_),v=ji(w,r.getRenderBuffer()*a,this.tempExtent),C=Vi(_,w)?null:v,b=new Pp(0,w,a,t),T=Eu(a,t),I=function(S,L){let z;const V=S.getStyleFunction()||r.getStyleFunction();if(V&&(z=V(S,a)),z){const U=this.renderFeature(S,T,z,b,h,L);l.dirty=l.dirty||U}},F=y.getFeatures();o&&o!==l.renderedRenderOrder&&F.sort(o);for(let S=0,L=F.length;S<L;++S){let z=F[S];i&&y.projection&&!tt(i,y.projection)&&(z=z.clone(),z.getGeometry().applyTransform(rr(y.projection,i))),(!C||ze(C,z.getGeometry().getExtent()))&&I.call(this,z,S)}const P=b.finish(),B=r.getRenderMode()!=="vector"&&h&&f.length===1?null:w,R=new Lp(B,a,t,c.getOverlaps(),P,r.getRenderBuffer(),!0);e.executorGroups[p].push(R)}l.renderedRevision=s,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){var E,x;const o=t.viewState.resolution,a=t.viewState.rotation;i=i??0;const l=this.getLayer(),h=l.getSource().getTileGridForProjection(t.viewState.projection),u=mt([e]);ji(u,o*i,u);const d={},g=function(_,w,v){let C=_.getId();C===void 0&&(C=Y(_));const b=d[C];if(b){if(b!==!0&&v<b.distanceSq){if(v===0)return d[C]=!0,s.splice(s.lastIndexOf(b),1),r(_,l,w);b.geometry=w,b.distanceSq=v}}else{if(v===0)return d[C]=!0,r(_,l,w);s.push(d[C]={feature:_,layer:l,geometry:w,distanceSq:v,callback:r})}},f=this.renderedTiles,p=Y(l),A=l.getDeclutter(),m=A?(x=(E=t.declutter)==null?void 0:E[A])==null?void 0:x.all().map(_=>_.value):null;let y;e:for(let _=0,w=f.length;_<w;++_){const v=f[_],C=h.getTileCoordExtent(v.wrappedTileCoord);if(!ze(C,u))continue;const b=v.executorGroups[p];for(let T=0,I=b.length;T<I;++T)if(y=b[T].forEachFeatureAtCoordinate(e,o,a,i,g,m),y)break e}return y}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,i)=>{const r=this.getLayer(),s=r.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,c=s.getTileGridForProjection(o),h=$e(this.renderedPixelToCoordinateTransform_,e.slice()),u=c.getTileCoordForCoordAndResolution(h,l).toString(),d=this.renderedTiles.find(E=>E.tileCoord.toString()===u&&E.getState()===G.LOADED);if(!d||d.loadingSourceTiles>0){t([]);return}s.getWrapX()&&o.canWrapX()&&!Ui(a,c.getTileCoordExtent(d.tileCoord))&&gc(h,o);const g=Y(r),f=c.getTileCoordExtent(d.wrappedTileCoord),p=li(f),A=[(h[0]-p[0])/l,(p[1]-h[1])/l],m=d.getSourceTiles().reduce((E,x)=>E.concat(x.getFeatures()),[]);let y=d.hitDetectionImageData[g];if(!y){const E=it(c.getTileSize(c.getZForResolution(l,s.zDirection))),x=this.renderedRotation_,_=[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),l,0,Kt,E[0]*Kt,E[1]*Kt,0)];y=kp(E,_,m,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,x),d.hitDetectionImageData[g]=y}t(Dp(A,m,y))})}getFeaturesInExtent(e){const t=[],i=this.getTileCache();if(i.getCount()===0)return t;const s=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),o=s.getZForResolution(this.renderedResolution),a={};return i.forEach(l=>{if(l.tileCoord[0]!==o||l.getState()!==G.LOADED)return;const c=l.getSourceTiles();for(let h=0,u=c.length;h<u;++h){const d=c[h],g=d.getKey();if(g in a)continue;a[g]=!0;const f=d.tileCoord;if(ze(e,s.getTileCoordExtent(f))){const p=d.getFeatures();if(p)for(let A=0,m=p.length;A<m;++A){const y=p[A],E=y.getGeometry();ze(e,E.getExtent())&&t.push(y)}}}}),t}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){var d;const i=this.context,r=i.globalAlpha;i.globalAlpha=t.opacity;const s=e.viewHints,o=!(s[De.ANIMATING]||s[De.INTERACTING]),a=[this.context.canvas.width,this.context.canvas.height],l=this.getLayer().getDeclutter(),c=l?(d=e.declutter)==null?void 0:d[l]:void 0,h=Y(this.getLayer()),u=this.renderedTiles;for(let g=0,f=u.length;g<f;++g){const p=u[g],A=p.executorGroups[h];if(A)for(let m=A.length-1;m>=0;--m)A[m].execute(this.context,a,this.getTileRenderTransform(p,e),e.viewState.rotation,o,El,c)}i.globalAlpha=r}renderDeferredInternal(e){const t=this.renderedTiles,i=Y(this.getLayer()),r=t.reduce((l,c,h)=>(c.executorGroups[i].forEach(u=>l.push({executorGroup:u,index:h})),l),[]),s=r.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,c=r.length;l<c;++l){const h=r[l].executorGroup.getDeferredZIndexContexts();for(const u in h)o[u]=!0}Object.keys(o).map(Number).sort(wi).forEach(l=>{s.forEach((c,h)=>{c[l]&&(c[l].forEach(u=>{const{executorGroup:d,index:g}=r[h],f=d.getRenderedContext(),p=f.globalAlpha;f.globalAlpha=this.renderedOpacity_;const A=this.tileClipContexts_[g];A&&A.draw(f),u.draw(f),A&&f.restore(),f.globalAlpha=p,u.clear()}),c[l].length=0)})})}getTileRenderTransform(e,t){const i=t.pixelRatio,r=t.viewState,s=r.center,o=r.resolution,a=r.rotation,l=t.size,c=Math.round(l[0]*i),h=Math.round(l[1]*i),d=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),g=e.tileCoord,f=d.getTileCoordExtent(e.wrappedTileCoord),p=d.getTileCoordExtent(g,this.tempExtent)[0]-f[0];return bc(Rc(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,c,h,p))}postRender(e,t){var _;const i=t.viewHints,r=!(i[De.ANIMATING]||i[De.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),c=l?fA[o].filter(w=>!El.includes(w)):fA[o],h=t.viewState,u=h.rotation,d=s.getSource(),f=d.getTileGridForProjection(h.projection).getZForResolution(h.resolution,d.zDirection),p=this.renderedTiles,A=[],m=[],y=[],E=Y(s);let x=!0;for(let w=p.length-1;w>=0;--w){const v=p[w];x=x&&!v.getReplayState(s).dirty;const C=v.executorGroups[E].filter(R=>R.hasExecutors(c));if(C.length===0)continue;const b=this.getTileRenderTransform(v,t),T=v.tileCoord[0];let I=!1;const F=C[0].getClipCoords(b);let P=e,B;if(F){B=new vu,P=B.getContext();for(let R=0,S=A.length;R<S;++R)if(f!==T&&T<m[R]){const L=A[R];ze([F[0],F[3],F[4],F[7]],[L[0],L[3],L[4],L[7]])&&(I||(P.save(),I=!0),P.beginPath(),P.moveTo(F[0],F[1]),P.lineTo(F[2],F[3]),P.lineTo(F[4],F[5]),P.lineTo(F[6],F[7]),P.moveTo(L[6],L[7]),P.lineTo(L[4],L[5]),P.lineTo(L[2],L[3]),P.lineTo(L[0],L[1]),P.clip())}A.push(F),m.push(T)}for(let R=0,S=C.length;R<S;++R)C[R].execute(e,[e.canvas.width,e.canvas.height],b,u,r,c,(_=t.declutter)==null?void 0:_[l]);I&&(P===e?P.restore():y[w]=B)}e.globalAlpha=a,this.ready=x,this.tileClipContexts_=y,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,i,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,c=i.length;l<c;++l)a=yl(r,e,i[l],t,this.boundHandleStyleImageChange_,void 0,s,o)||a;else a=yl(r,e,i,t,this.boundHandleStyleImageChange_,void 0,s,o);return a}tileImageNeedsRender_(e){const t=this.getLayer();if(t.getRenderMode()==="vector")return!1;const i=e.getReplayState(t),r=t.getRevision(),s=e.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==r}renderTileImage_(e,t){const i=this.getLayer(),r=e.getReplayState(i),s=i.getRevision(),o=e.executorGroups[Y(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],c=i.getSource();let h=t.pixelRatio;const d=t.viewState.projection,g=c.getTileGridForProjection(d),f=g.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*f,A=g.getResolution(l),m=e.getContext();h=Math.round(Math.max(h,p/h));const y=c.getTilePixelSize(l,h,d);m.canvas.width=y[0],m.canvas.height=y[1];const E=h/p;if(E!==1){const v=ff(this.tmpTransform_);Rc(v,E,E),m.setTransform.apply(m,v)}const x=g.getTileCoordExtent(a,this.tempExtent),_=p/A,w=ff(this.tmpTransform_);Rc(w,_,-_),qy(w,-x[0],-x[3]);for(let v=0,C=o.length;v<C;++v)o[v].execute(m,[m.canvas.width*E,m.canvas.height*E],w,0,!0,Cv[i.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}}class Sr extends Rh{constructor(e){e=e||{};const t=Object.assign({},e);delete t.preload;const i=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=i;const r=e.renderMode||"hybrid";me(r=="hybrid"||r=="vector","`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=r,this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new bv(this,{cacheSize:this.cacheSize_})}getFeatures(e){return super.getFeatures(e)}getFeaturesInExtent(e){return this.getRenderer().getFeaturesInExtent(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(Gn.PRELOAD)}getUseInterimTilesOnError(){return this.get(Gn.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Gn.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Gn.USE_INTERIM_TILES_ON_ERROR,e)}}function Zu(n){return Array.isArray(n)?Math.min(...n):n}class Tv extends xh{constructor(e,t,i,r,s,o,a){let l=e.getExtent();l&&e.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);const h=c?xt(i,c):i,u=Ut(h),d=Hu(e,t,u,r),g=Yu,f=new Xu(e,t,h,l,d*g,r),p=f.calculateSourceExtent(),A=er(p)?null:o(p,d,s),m=A?W.IDLE:W.EMPTY,y=A?A.getPixelRatio():1;super(i,r,y,m),this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=f,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=A,this.sourcePixelRatio_=y,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==W.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==W.LOADED){const t=ne(this.targetExtent_)/this.targetResolution_,i=Oe(this.targetExtent_)/this.targetResolution_;this.canvas_=oA(t,i,this.sourcePixelRatio_,Zu(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=e,this.changed()}load(){if(this.state==W.IDLE){this.state=W.LOADING,this.changed();const e=this.sourceImage_.getState();e==W.LOADED||e==W.ERROR?this.reproject_():(this.sourceListenerKey_=ce(this.sourceImage_,K.CHANGE,t=>{const i=this.sourceImage_.getState();(i==W.LOADED||i==W.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){Te(this.sourceListenerKey_),this.sourceListenerKey_=null}}const kl=4,qu={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class Rv extends Nt{constructor(e,t){super(e),this.image=t}}class gA extends ms{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate!==void 0?e.interpolate:!0}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=e.loader?e.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(e){this.resolutions_=e}findNearestResolution(e){const t=this.getResolutions();if(t){const i=ea(t,e,0);e=t[i]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||tt(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&tt(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Vi(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Tv(s,r,e,t,i,(o,a,l)=>this.getImageInternal(o,a,l,s),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,i,r){if(this.loader){const s=Sv(e,t,i,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Ui(this.wantedExtent_,s)||Ui(this.image.getExtent(),s))&&(this.wantedResolution_&&Zu(this.wantedResolution_)===o||Zu(this.image.getResolution())===o)))return this.image;this.wantedProjection_=r,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new xh(s,o,i,this.loader),this.image.addEventListener(K.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case W.LOADING:this.loading=!0,i=qu.IMAGELOADSTART;break;case W.LOADED:this.loading=!1,i=qu.IMAGELOADEND;break;case W.ERROR:this.loading=!1,i=qu.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new Rv(i,t))}}function Sv(n,e,t,i){const r=e/t,s=Ut(n),o=pn(ne(n)/r,kl),a=pn(Oe(n)/r,kl),l=pn((i-1)*o/2,kl),c=o+2*l,h=pn((i-1)*a/2,kl),u=a+2*h;return aa(s,r,0,[c,u])}const Ts=[0,0,0],Bn=5;class Dl{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,me(Zm(this.resolutions_,(r,s)=>s-r),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let r=0,s=this.resolutions_.length-1;r<s;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,me(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=li(i)),me(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,me(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:Hc,me(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((r,s)=>{const o=new Ru(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,t,i){const r=this.getTileRangeForExtentAndZ(e,t);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([t,s,a])}forEachTileCoordParentTileRange(e,t,i,r){let s,o,a,l=null,c=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=xs(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,c,i),t(c,s))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,i){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const s=e[1]*2,o=e[2]*2;return xs(s,s+1,o,o+1,t)}const r=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;const r=e[0],s=e[1],o=e[2];if(t===r)return xs(s,o,s,o,i);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-r),c=Math.floor(s*l),h=Math.floor(o*l);if(t<r)return xs(c,c,h,h,i);const u=Math.floor(l*(s+1))-1,d=Math.floor(l*(o+1))-1;return xs(c,u,h,d,i)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,i)}getTileRangeForExtentAndZ(e,t,i){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Ts);const r=Ts[1],s=Ts[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Ts);const o=Ts[1],a=Ts[2];return xs(r,o,s,a,i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=it(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*i,t[1]-(e[2]+.5)*r[1]*i]}getTileCoordExtent(e,t){const i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=it(this.getTileSize(e[0]),this.tmpSize_),o=i[0]+e[1]*s[0]*r,a=i[1]-(e[2]+1)*s[1]*r,l=o+s[0]*r,c=a+s[1]*r;return bi(o,a,l,c,t)}getTileCoordForCoordAndResolution(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)}getTileCoordForXYAndResolution_(e,t,i,r,s){const o=this.getZForResolution(i),a=i/this.getResolution(o),l=this.getOrigin(o),c=it(this.getTileSize(o),this.tmpSize_);let h=a*(e-l[0])/i/c[0],u=a*(l[1]-t)/i/c[1];return r?(h=pn(h,Bn)-1,u=pn(u,Bn)-1):(h=ra(h,Bn),u=ra(u,Bn)),Fl(o,h,u,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),l=it(this.getTileSize(i),this.tmpSize_);let c=(e-o[0])/a/l[0],h=(o[1]-t)/a/l[1];return r?(c=pn(c,Bn)-1,h=pn(h,Bn)-1):(c=ra(c,Bn),h=ra(h,Bn)),Fl(i,c,h,s)}getTileCoordForCoordAndZ(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const i=ea(this.resolutions_,e,t||0);return Pe(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return bf(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const t=this.resolutions_.length,i=new Array(t);for(let r=this.minZoom;r<t;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i}}function Ol(n){let e=n.getDefaultTileGrid();return e||(e=Mv(n),n.setDefaultTileGrid(e)),e}function Iv(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=Ho(t);if(!$n(s,r)){const o=ne(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}return e}function Pv(n,e,t,i){i=i!==void 0?i:"top-left";const r=pA(n,e,t);return new Dl({extent:n,origin:cy(n,i),resolutions:r,tileSize:t})}function Gl(n){const e=n||{},t=e.extent||ye("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:pA(t,e.maxZoom,e.tileSize,e.maxResolution)};return new Dl(i)}function pA(n,e,t,i){e=e!==void 0?e:Mf,t=it(t!==void 0?t:Hc);const r=Oe(n),s=ne(n);i=i>0?i:Math.max(s/t[0],r/t[1]);const o=e+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=i/Math.pow(2,l);return a}function Mv(n,e,t,i){const r=Ho(n);return Pv(r,e,t,i)}function Ho(n){n=ye(n);let e=n.getExtent();if(!e){const t=180*An.degrees/n.getMetersPerUnit();e=bi(-t,-t,t,t)}return e}class Qu extends ms{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&it(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tmpSize=[0,0],this.key_=e.key||Y(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,i,r,s,o){return Q()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:Ol(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=it(r.getTileSize(e),this.tmpSize);return s==1?o:h_(o,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){const i=t!==void 0?t:this.getProjection(),r=t!==void 0?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=Iv(r,e,i)),Ev(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class AA extends Nt{constructor(e,t){super(e),this.tile=t}}function mA(n){return function(e){const t=e.buffers,i=e.meta,r=e.imageOps,s=e.width,o=e.height,a=t.length,l=t[0].byteLength;if(r){const d=new Array(a);for(let f=0;f<a;++f)d[f]=new ImageData(new Uint8ClampedArray(t[f]),s,o);return n(d,i).data.buffer}const c=new Uint8ClampedArray(l),h=new Array(a),u=new Array(a);for(let d=0;d<a;++d)h[d]=new Uint8ClampedArray(t[d]),u[d]=[0,0,0,0];for(let d=0;d<l;d+=4){for(let f=0;f<a;++f){const p=h[f];u[f][0]=p[d],u[f][1]=p[d+1],u[f][2]=p[d+2],u[f][3]=p[d+3]}const g=n(u,i);c[d]=g[0],c[d+1]=g[1],c[d+2]=g[2],c[d+3]=g[3]}return c.buffer}}function Fv(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"const "+s+" = "+n.lib[s].toString()+";"}).concat(["const __minion__ = ("+mA.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {'," const buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker(typeof Blob>"u"?"data:text/javascript;base64,"+Buffer.from(i.join(`
35
+ `),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function Lv(n,e){const t=mA(n.operation);let i=!1;return{postMessage:function(r){setTimeout(function(){i||e({data:{buffer:t(r),meta:r.meta}})},0)},terminate:function(){i=!0}}}class kv extends js{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;e.threads===0?t=0:this.imageOps_?t=1:t=e.threads||1;const i=new Array(t);if(t)for(let r=0;r<t;++r)i[r]=Fv(e,this.onWorkerMessage_.bind(this,r));else i[0]=Lv(e,this.onWorkerMessage_.bind(this,0));this.workers_=i,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,i){this.enqueue_({inputs:e,meta:t,callback:i}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;const e=this.queue_.shift();this.job_=e;const t=e.inputs[0].width,i=e.inputs[0].height,r=e.inputs.map(function(l){return l.data.buffer}),s=this.workers_.length;if(this.running_=s,s===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},r);return}const o=e.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;l<s;++l){const c=l*a,h=[];for(let u=0,d=r.length;u<d;++u)h.push(r[u].slice(c,c+a));this.workers_[l].postMessage({buffers:h,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},h)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){const e=this.job_,t=this.workers_.length;let i,r;if(t===1)i=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{const s=e.inputs[0].data.length;i=new Uint8ClampedArray(s),r=new Array(t);const o=4*Math.ceil(s/4/t);for(let a=0;a<t;++a){const l=this.dataLookup_[a].buffer,c=a*o;i.set(new Uint8ClampedArray(l),c),r[a]=this.dataLookup_[a].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(i,e.inputs[0].width,e.inputs[0].height),r),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}}const yA={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"};class _A extends Nt{constructor(e,t,i){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class Ju extends gA{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType!==void 0?e.operationType:"pixel",this.threads_=e.threads!==void 0?e.threads:1,this.layers_=Gv(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(K.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new zd(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:St(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:Ov(this.layers_),pixelRatio:1,pixelToCoordinateTransform:St(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:Y(this),renderTargets:{}},this.setAttributions(function(i){var s;const r=[];for(let o=0,a=e.sources.length;o<a;++o){const l=e.sources[o],c=l instanceof ms?l:l.getSource();if(!c)continue;const h=(s=c.getAttributions())==null?void 0:s(i);typeof h=="string"?r.push(h):h!==void 0&&r.push(...h)}return r}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new kv({operation:e,imageOps:this.operationType_==="image",queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,i){const r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);const s=Ut(e);r.size[0]=Math.ceil(ne(e)/t),r.size[1]=Math.ceil(Oe(e)/t),r.extent=[s[0]-r.size[0]*t/2,s[1]-r.size[1]*t/2,s[0]+r.size[0]*t/2,s[1]+r.size[1]*t/2],r.time=Date.now();const o=r.viewState;return o.center=s,o.projection=i,o.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let i=0,r=this.layers_.length;i<r;++i)if(t=this.layers_[i].getSource(),!t||t.getState()!=="ready"){e=!1;break}return e}getImage(e,t,i,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);const s=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=s,this.renderedImageCanvas_){const o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();(t!==o||!Vi(s.extent,a))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),s.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const e=this.requestedFrameState_,t=this.layers_.length,i=new Array(t);for(let s=0;s<t;++s){e.layerIndex=s,e.renderTargets={};const o=Dv(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new _A(yA.BEFOREOPERATIONS,e,r)),this.processor_.process(i,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,i,r){if(t||!i)return;const s=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!Vi(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round(ne(s)/o),c=Math.round(Oe(s)/o);a=Me(l,c),this.renderedImageCanvas_=new Sw(s,o,1,a.canvas)}a.putImageData(i,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new _A(yA.AFTEROPERATIONS,e,r))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let i=0,r=this.layers_.length;i<r&&(t=this.layers_[i].getSource().getResolutions(e),!t);++i);return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Ju.prototype.dispose;let Ir=null;function Dv(n,e){const t=n.getRenderer();if(!t)throw new Error("Unsupported layer type: "+n);if(!t.prepareFrame(e))return null;const i=e.size[0],r=e.size[1];if(i===0||r===0)return null;const s=t.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===i&&o.height===r)return o.getContext("2d").getImageData(0,0,i,r)}if(!Ir)Ir=Me(i,r,void 0,{willReadFrequently:!0});else{const a=Ir.canvas;a.width!==i||a.height!==r?Ir=Me(i,r,void 0,{willReadFrequently:!0}):Ir.clearRect(0,0,i,r)}return Ir.drawImage(o,0,0,i,r),Ir.getImageData(0,0,i,r)}function Ov(n){return n.map(function(e){return e.getLayerState()})}function Gv(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=Bv(n[i]);return t}function Bv(n){let e;return n instanceof ms?n instanceof Qu?e=new Ll({source:n}):n instanceof gA&&(e=new Uu({source:n})):e=n,e}function Nv(n,e,t,i){const r=document.createElement("script"),s="olc_"+Y(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=n+(n.includes("?")?"&":"?")+"callback="+s;const a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(l){clearTimeout(a),o(),e(l)},document.head.appendChild(r)}const zv=/\{z\}/g,jv=/\{x\}/g,Uv=/\{y\}/g,Vv=/\{-y\}/g;function xA(n,e,t,i,r){return n.replace(zv,e.toString()).replace(jv,t.toString()).replace(Uv,i.toString()).replace(Vv,function(){if(r===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-i).toString()})}function Wv(n,e,t,i){const r=hA(e,t,i),s=gn(r,n.length);return n[s]}function EA(n){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(n);if(t){const i=t[1].charCodeAt(0),r=t[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){const i=parseInt(t[2],10);for(let r=parseInt(t[1],10);r<=i;r++)e.push(n.replace(t[0],r.toString()));return e}return e.push(n),e}function Hv(n,e){return(function(t,i,r){if(!t)return;let s;const o=t[0];if(e){const a=e.getFullTileRange(o);a&&(s=a.getHeight()-1)}return xA(n,o,t[1],t[2],s)})}function wA(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=Hv(n[r],e);return Xv(i)}function Xv(n){return n.length===1?n[0]:(function(e,t,i){if(!e)return;const r=xv(e),s=gn(r,n.length);return n[s](e,t,i)})}const Rs={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Bl extends Qu{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===Bl.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=Rs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?Rs.TILELOADERROR:r==G.LOADED?Rs.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new AA(s,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,typeof t<"u"?this.setKey(t):this.changed()}setUrl(e){const t=EA(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
36
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(wA(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}}class Yv extends Bl{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Kv,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:Gp,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!tt(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||tt(t,e)))return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ol(e)),this.tileGridForProjection[i]}createTile_(e,t,i,r,s,o){const a=[e,t,i],l=this.getTileCoordForTileUrlFunction(a,s),c=l?this.tileUrlFunction(l,r,s):void 0,h=new this.tileClass(a,c!==void 0?G.IDLE:G.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(K.CHANGE,this.handleTileChange.bind(this)),h}getTile(e,t,i,r,s,o){const a=this.getProjection();if(!a||!s||tt(a,s))return this.getTileInternal(e,t,i,r,a||s);const l=[e,t,i],c=this.getKey(),h=this.getTileGridForProjection(a),u=this.getTileGridForProjection(s),d=this.getTileCoordForTileUrlFunction(l,s),g=new lA(a,h,s,u,l,d,this.getTilePixelRatio(r),this.getGutter(),(f,p,A,m)=>this.getTileInternal(f,p,A,m,a,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return g.key=c,g}getTileInternal(e,t,i,r,s,o){const a=this.getKey(),l=Wo(this,a,e,t,i);if(o&&o.containsKey(l))return o.get(l);const c=this.createTile_(e,t,i,r,s,a);return o==null||o.set(l,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const i=ye(e);if(i){const r=Y(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}function Kv(n,e){if(ut){const t=n.getCrossOrigin();let i="same-origin",r="same-origin";t==="anonymous"||t===""?(i="cors",r="omit"):t==="use-credentials"&&(i="cors",r="include"),fetch(e,{mode:i,credentials:r}).then(s=>{if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.blob()}).then(s=>createImageBitmap(s)).then(s=>{var l;const o=n.getImage();o.width=s.width,o.height=s.height,o.getContext("2d").drawImage(s,0,0),(l=s.close)==null||l.call(s),o.dispatchEvent(new Event("load"))}).catch(()=>{n.getImage().dispatchEvent(new Event("error"))});return}n.getImage().src=e}class vA extends Yv{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:ye("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)Nv(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",e.url),t.send()}else if(e.tileJSON)this.handleTileJSONResponse(e.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=ye("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=eo(t,i);r=Xd(e.bounds,c)}const s=Ho(i),o=e.minzoom||0,a=e.maxzoom||22,l=Gl({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=wA(e.tiles,l),e.attribution&&!this.getAttributions()){const c=r!==void 0?r:s;this.setAttributions(function(h){return ze(c,h.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}class $u extends Bl{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Ho(t),r=e.tileGrid||Gl({extent:i,maxResolution:e.maxResolution,maxZoom:e.maxZoom!==void 0?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,projection:t,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:CA,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection===void 0?1:e.zDirection}),this.format_=e.format?e.format:null,this.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=e.overlaps==null?!0:e.overlaps,this.tileClass=e.tileClass?e.tileClass:Np,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,i){if(i.getState()===G.IDLE){i.setState(G.LOADING);const r=i.wrappedTileCoord,s=this.getTileGridForProjection(t);let o=s.getTileCoordExtent(r);const a=r[0],l=s.getResolution(a);ji(o,-l,o);const c=this.projection;t&&this.projection&&!tt(t,c)&&(o=Aa(o,t,c));const h=this.tileGrid,u=h.getExtent();u&&xt(o,u,o);let d=l;t&&c&&!tt(t,c)&&(d=l/c.getMetersPerUnit()/t.getMetersPerUnit());const g=h.getZForResolution(d,this.zDirection);h.forEachTileCoord(o,g,f=>{const p=this.tileUrlFunction(f,e,t);this.sourceTiles_[p]||(this.sourceTiles_[p]=new this.tileClass(f,p?G.IDLE:G.EMPTY,p,this.format_,this.tileLoadFunction));const A=this.sourceTiles_[p];i.sourceTiles.push(A),this.tileKeysBySourceTileUrl_[p]||(this.tileKeysBySourceTileUrl_[p]=[]),this.tileKeysBySourceTileUrl_[p].push(i.getKey());const m=A.getState();if(m<G.LOADED){const y=E=>{this.handleTileChange(E);const x=A.getState();if(x===G.LOADED||x===G.ERROR){const _=A.getKey();_ in i.errorTileKeys?A.getState()===G.LOADED&&delete i.errorTileKeys[_]:i.loadingSourceTiles--,x===G.ERROR?i.errorTileKeys[_]=!0:A.removeEventListener(K.CHANGE,y),i.loadingSourceTiles===0&&i.setState(un(i.errorTileKeys)?G.LOADED:G.ERROR)}};A.addEventListener(K.CHANGE,y),i.loadingSourceTiles++}m===G.IDLE&&(A.extent=h.getTileCoordExtent(f),A.projection=this.projection,A.resolution=h.getResolution(f[0]),A.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(f=>f.getState()===G.ERROR)?G.ERROR:G.LOADED)}return i.sourceTiles}removeSourceTiles(e){const t=e.getKey(),i=e.sourceTiles;for(let r=0,s=i.length;r<s;++r){const o=i[r].getTileUrl();if(!this.tileKeysBySourceTileUrl_[o])return;const a=this.tileKeysBySourceTileUrl_[o].indexOf(t);a!==-1&&(this.tileKeysBySourceTileUrl_[o].splice(a,1),this.tileKeysBySourceTileUrl_[o].length===0&&(delete this.tileKeysBySourceTileUrl_[o],delete this.sourceTiles_[o]))}}getTile(e,t,i,r,s){const o=[e,t,i];let a=this.getTileCoordForTileUrlFunction(o,s);const l=this.getTileGrid().getExtent(),c=this.projection,h=this.getTileGridForProjection(s);if(a&&l){const g=h.getTileCoordExtent(a);ji(g,-h.getResolution(e),g),ze(l,!s||!c||tt(s,c)?g:Aa(g,s,c))||(a=null)}let u=!0;if(a!==null){const g=this.tileGrid,f=h.getResolution(e);let p=f;s&&c&&!tt(s,c)&&(p=f/c.getMetersPerUnit()/s.getMetersPerUnit());const A=g.getZForResolution(p,1),m=h.getTileCoordExtent(a);ji(m,-f,m),g.forEachTileCoord(!s||!c||tt(s,c)?m:Aa(m,s,c),A,y=>{u=u&&!this.tileUrlFunction(y,r,c)})}const d=new Pw(o,u?G.EMPTY:G.IDLE,a,this.getSourceTiles.bind(this,r,s),this.removeSourceTiles.bind(this));return d.key=this.getKey(),d}getTileGridForProjection(e){const t=e.getCode();let i=this.tileGrids_[t];if(!i){const r=this.projection;if(r!==null&&!tt(r,e))return Ol(e);const s=this.tileGrid,o=s.getResolutions().slice(),a=o.map(function(h,u){return s.getOrigin(u)}),l=o.map(function(h,u){return s.getTileSize(u)}),c=Mf+1;for(let h=o.length;h<c;++h)o.push(o[h-1]/2),a.push(a[h-1]),l.push(l[h-1]);i=new Dl({extent:s.getExtent(),origins:a,resolutions:o,tileSizes:l}),this.tileGrids_[t]=i}return i}getTilePixelRatio(e){return e}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=it(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}}function CA(n,e){n.setLoader(function(t,i,r){bp(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}function Zv(n,e){const t=n[0],i=t.width,r=t.height,s=t.data,o=new Uint8ClampedArray(s.length),a=e.resolution*2,l=i-1,c=r-1,h=[0,0,0,0],u=2*Math.PI,d=Math.PI/2,g=Math.PI*e.sunEl/180,f=Math.PI*e.sunAz/180,p=Math.cos(g),A=Math.sin(g),m=e.highlightColor,y=e.shadowColor,E=e.accentColor,x=e.encoding;let _,w,v,C,b,T,I,F,P,B,R,S,L,z,V,U,X,D,q,O,se,we;function ge(We,ve="mapbox"){if(ve==="mapbox")return(We[0]*256*256+We[1]*256+We[2])*.1-1e4;if(ve==="terrarium")return We[0]*256+We[1]+We[2]/256-32768}for(w=0;w<=c;++w)for(b=w===0?0:w-1,T=w===c?c:w+1,_=0;_<=l;++_)v=_===0?0:_-1,C=_===l?l:_+1,I=(w*i+v)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],F=e.vert*ge(h,x),I=(w*i+C)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],P=e.vert*ge(h,x),B=(P-F)/a,I=(b*i+_)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],F=e.vert*ge(h,x),I=(T*i+_)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],P=e.vert*ge(h,x),R=(P-F)/a,L=Math.atan2(R,-B),L<0?L=d-L:L>d?L=u-L+d:L=d-L,S=Math.atan(Math.sqrt(B*B+R*R)),we=A*Math.cos(S)+p*Math.sin(S)*Math.cos(f-L),z=Math.cos(S),V=255*we,q=Math.min(Math.max(2*e.sunEl,0),1),O=1.875-e.opacity*1.75,se=e.opacity!==.5?d*((Math.pow(O,S)-1)/(Math.pow(O,d)-1)):S,X={r:(1-z)*E.r*q*255,g:(1-z)*E.g*q*255,b:(1-z)*E.b*q*255,a:(1-z)*E.a*q*255},U=Math.abs(((L+f)/Math.PI+.5)%2-1),D={r:(m.r*(1-U)+y.r*U)*V,g:(m.g*(1-U)+y.g*U)*V,b:(m.b*(1-U)+y.b*U)*V,a:(m.a*(1-U)+y.a*U)*V},I=(w*i+_)*4,o[I]=X.r*(1-U)+D.r,o[I+1]=X.g*(1-U)+D.g,o[I+2]=X.b*(1-U)+D.b,o[I+3]=s[I+3]*e.opacity*q*Math.sin(se);return new ImageData(o,i,r)}function qv(n,e){const t=n[0],i=t.width,r=t.height,s=t.data,o=new Uint8ClampedArray(s.length),a=i-1,l=r-1,c=[0,0,0,0];let h,u,d;function g(C){return C>0?1/(1-C):1+C}function f(C){return C>0?1-1/(1.001-C):-C}function p(C){C*=Math.PI/180;const b=Math.sin(C),T=Math.cos(C);return[(2*T+1)/3,(-Math.sqrt(3)*b-T+1)/3,(Math.sqrt(3)*b-T+1)/3]}const A=f(e.saturation),m=g(e.contrast),y=p(e.hueRotate),E=y,x=[y[2],y[0],y[1]],_=[y[1],y[2],y[0]],w=e.brightnessLow,v=e.brightnessHigh;for(u=0;u<=l;++u)for(h=0;h<=a;++h){d=(u*i+h)*4,c[0]=s[d],c[1]=s[d+1],c[2]=s[d+2],c[3]=s[d+3];const C=c[0],b=c[1],T=c[2],I=(S,L)=>{let z=0;for(let V=0;V<S.length;V++)z+=S[V]*L[V];return z};let F=I([C,b,T],E),P=I([C,b,T],x),B=I([C,b,T],_);const R=(F+P+B)/3;F+=(R-F)*A,P+=(R-P)*A,B+=(R-B)*A,F=(F-.5)*m+.5,P=(P-.5)*m+.5,B=(B-.5)*m+.5,F=w*(255-F)+v*F,P=w*(255-P)+v*P,B=w*(255-B)+v*B,o[d]=F,o[d+1]=P,o[d+2]=B,o[d+3]=c[3]}return new ImageData(o,i,r)}function Qv(n,e=512){return n.getExtent()?Gl({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Ai}function bA(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((i,r)=>{e.accessToken=i,e.accessTokenParam=r})),e}function Jv(n,e,t="",i={},r=void 0){let s,o,a,l,c=!0;return typeof t!="string"&&!Array.isArray(t)?(a=t,l=a.source||a.layers,i=a):l=t,typeof i=="string"?(s=i,a={}):(s=i.styleUrl,a=i),a.updateSource===!1&&(c=!1),r||(r=a.resolutions),!s&&typeof e=="string"&&!e.trim().startsWith("{")&&(s=e),s&&(s=s.startsWith("data:")?location.href:wl(s,a.accessToken),a=bA(s,a)),new Promise(function(h,u){Hp(e,a).then(function(d){if(d.version!=8)return u(new Error("glStyle version 8 required."));if(!(n instanceof Dn||n instanceof Sr))return u(new Error("Can only apply to VectorLayer or VectorTileLayer"));const g=n instanceof Sr?"vector":"geojson";if(l?Array.isArray(l)?o=d.layers.find(function(x){return x.id===l[0]}).source:o=l:(o=d.layers.find(function(x){return x.source&&d.sources[x.source].type===g}).source,l=o),!o)return u(new Error(`No ${g} source found in the glStyle.`));function f(){if(!c)return Promise.resolve();if(n instanceof Sr)return ed(d.sources[o],s,a).then(function(v){const C=n.getSource();C?v!==C&&(C.setTileUrlFunction(v.getTileUrlFunction()),typeof C.setUrls=="function"&&typeof v.getUrls=="function"&&C.setUrls(v.getUrls()),C.format_||(C.format_=v.format_),C.getAttributions()||C.setAttributions(v.getAttributions()),C.getTileLoadFunction()===CA&&C.setTileLoadFunction(v.getTileLoadFunction()),tt(C.getProjection(),v.getProjection())&&(C.tileGrid=v.getTileGrid())):n.setSource(v);const b=n.getSource().getTileGrid();!isFinite(n.getMaxResolution())&&!isFinite(n.getMinZoom())&&b.getMinZoom()>0&&n.setMaxResolution(Uo(Math.max(0,b.getMinZoom()-1e-12),b.getResolutions()))});const x=d.sources[o];let _=n.getSource();(!_||_.get("mapbox-source")!==x)&&(_=id(x,s,a));const w=n.getSource();return w?_!==w&&(w.getAttributions()||w.setAttributions(_.getAttributions()),w.format_||(w.format_=_.getFormat()),w.url_=_.getUrl()):n.setSource(_),Promise.resolve()}let p,A;const m={},y={};function E(){if(!A&&(!d.sprite||m)){if(a.projection&&!r){const v=ye(a.projection).getUnits();v!=="m"&&(r=Ai.map(C=>C/An[v]))}let x;const _=n.getSource();_ instanceof $u&&_.format_ instanceof nA&&(x=_.format_.layerName_),A=Nu(n,d,l,r,m,y,(w,v=a.webfonts)=>Gw(w,v),a.getImage,x),n.getStyle()?f().then(h).catch(u):u(new Error(`Nothing to show for source [${o}]`))}else A?(n.setStyle(A),f().then(h).catch(u)):u(new Error("Something went wrong trying to apply style."))}if(d.sprite){const x=Mw(d.sprite,a.accessToken,s||location.href);p=ut?1:window.devicePixelRatio>=1.5?.5:1;const _=p==.5?"@2x":"";Promise.all(x.map(function(w){const v=new URL(w.url);let C=v.origin+v.pathname+_+".json"+v.search;return new Promise(function(b,T){ws("Sprite",C,a).then(b).catch(function(I){C=v.origin+v.pathname+".json"+v.search,ws("Sprite",C,a).then(b).catch(T)})}).then(function(b){b===void 0&&u(new Error("No sprites found."));let T;if(T=v.origin+v.pathname+_+".png"+v.search,a.transformRequest){const I=a.transformRequest(T,"SpriteImage")||T;(I instanceof Request||I instanceof Promise)&&(T=I)}y[w.id]=T;for(const I in b){const F=w.id=="default"?I:`${w.id}:${I}`;m[F]=b[I]}}).catch(function(b){u(new Error(`Sprites cannot be loaded: ${C}: ${b.message}`))})})).then(E).catch(u)}else E()}).catch(u)})}function TA(n,e){let t;return n.some(function(i){if(i.id==e)return t=i.source,!0}),t}function $v(n,e){const t=n.bounds;if(t){const i=Js([t[0],t[1]],e),r=Js([t[2],t[3]],e);return[i[0],i[1],r[0],r[1]]}return ye(e).getExtent()}function RA(n,e,t){const i=new vA({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=ye(t.projection||"EPSG:3857"),a=$v(r,o),l=o.getExtent(),c=r.minzoom||0,h=r.maxzoom||22,u={attributions:i.getAttributions(),projection:o,tileGrid:new Dl({origin:l?li(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:Qv(o,e.tileSize).slice(0,h+1),tileSize:s.getTileSize(0)})};return Array.isArray(r.tiles)?u.urls=r.tiles:u.url=r.tiles,u}function eC(n,e,t,i){const r={id:n.id,type:n.type},s=n.layout||{},o=n.paint||{};r.paint=o,vt.zoom=bl(e,t.resolutions||Ai),vt.distanceFromCenter=0;let a;const l=H(r,"paint","background-color",yt,i);return o["background-opacity"]!==void 0&&(a=H(r,"paint","background-opacity",yt,i)),s.visibility=="none"?void 0:On(l,a)}function tC(n,e,t){const i=ut?{style:{}}:document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new is({source:new ms({}),render(r){const s=eC(n,r.viewState.resolution,e,t);return i.style.backgroundColor=s,i}})}function ed(n,e,t){return new Promise(function(i,r){Yp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=RA(n,s,t);a.tileLoadFunction=o,a.format=new nA({layerName:"mvt:layer"});const l=new $u(a);l.set("mapbox-source",n),i(l)}).catch(r)})}function iC(n,e,t){const i=new Sr({declutter:!0,visible:!1});return ed(n,e,t).then(function(r){i.setSource(r)}).catch(function(r){i.setSource(void 0)}),i}function SA(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function IA(n,e,t){return new Promise(function(i,r){Yp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new vA({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=RA(n,s,t).tileGrid,t.projection&&(a.projection=ye(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,h,u){const d=SA(u);let g=l(c,h,u);if(g.indexOf(d)!=-1){const f=a.getTileGrid().getTileCoordExtent(c);g=g.replace(d,f.toString())}return g}),a.set("mapbox-source",n),i(a)}).catch(function(s){r(s)})})}function td(n,e,t){const i=new Ll;return IA(n,e,t).then(function(r){i.setSource(r)}).catch(function(){i.setSource(void 0)}),i}function nC(n,e,t){const i=td(n,e,t);return new Uu({source:new Ju({operationType:"image",operation:qv,sources:[i]})})}function rC(n,e,t){const i=td(n,e,t);return new Uu({source:new Ju({operationType:"image",operation:Zv,sources:[i]})})}function id(n,e,t){const i=t.projection?new Fh({dataProjection:t.projection}):new Fh,r=n.data,s={};if(typeof r=="string"){const[a]=vl(r,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(u,d,g)=>{const f=SA(g);return a.replace(f,`${u.join(",")}`)},h=new Mn({attributions:n.attribution,format:i,loader:(u,d,g,f,p)=>{const A=typeof c=="function"?c(u,d,g):c;ws("GeoJSON",A,t).then(m=>{const y=h.getFormat().readFeatures(m,{featureProjection:g});h.addFeatures(y),f(y)}).catch(m=>{h.removeLoadedExtent(u),p()})},strategy:uw});return h.set("mapbox-source",n),h}const l=new Mn({attributions:n.attribution,format:i,url:a,loader:(c,h,u,d,g)=>{ws("GeoJSON",a,t).then(f=>{const p=l.getFormat().readFeatures(f,{featureProjection:u});l.addFeatures(p),d(p)}).catch(f=>{l.removeLoadedExtent(c),g()})}});return l}s.features=i.readFeatures(r,{featureProjection:"EPSG:3857"});const o=new Mn(Object.assign({attributions:n.attribution,format:i},s));return o.set("mapbox-source",n),o}function sC(n,e,t){return new Dn({declutter:!0,source:id(n,e,t),visible:!1})}function oC(n,e,t){let i=null;return function(r){n.paint&&"raster-opacity"in n.paint&&r.frameState.viewState.zoom!==i&&(i=r.frameState.viewState.zoom,delete t[n.id],aC(n,e,i,t))}}function aC(n,e,t,i){vt.zoom=t,vt.distanceFromCenter=0;const r=H(n,"paint","raster-opacity",yt,i);e.setOpacity(r)}function lC(n,e){function t(){const i=e.get("mapbox-style");if(!i)return;const r=Sg(i.layers),s=n.get("mapbox-layers"),o=r.filter(function(a){return s.includes(a.id)}).some(function(a){return!a.layout||!a.layout.visibility||a.layout.visibility==="visible"});n.get("visible")!==o&&n.setVisible(o)}n.on("change",t),t()}function PA(n,e,t,i){const r=Mu(n),s=n.layers,o=t.type,a=t.source||TA(s,t.ref),l=n.sources[a];let c;if(o=="background")c=tC(t,i,r);else if(l.type=="vector")c=iC(l,e,i);else if(l.type=="raster"){const u=["raster-saturation","raster-contrast","raster-brightness-max","raster-brightness-min","raster-hue-rotate"];!!Object.keys(t.paint||{}).find(g=>u.includes(g))?(c=nC(l,e,i),c.getSource().on("beforeoperations",function(g){vt.zoom=bl(g.resolution,i.resolutions||Ai),vt.distanceFromCenter=0;const f=g.data;f.saturation=H(t,"paint","raster-saturation",yt,r),f.contrast=H(t,"paint","raster-contrast",yt,r),f.brightnessHigh=H(t,"paint","raster-brightness-max",yt,r),f.brightnessLow=H(t,"paint","raster-brightness-min",yt,r),f.hueRotate=H(t,"paint","raster-hue-rotate",yt,r)})):c=td(l,e,i),c.setVisible(t.layout?t.layout.visibility!=="none":!0),c.on("prerender",oC(t,c,r))}else if(l.type=="geojson")c=sC(l,e,i);else if(l.type=="raster-dem"&&t.type=="hillshade"){const u=rC(l,e,i);c=u,u.getSource().on("beforeoperations",function(d){const g=d.data;g.resolution=wc(i.projection||"EPSG:3857",d.resolution,Ut(d.extent),"m"),vt.zoom=bl(d.resolution,i.resolutions||Ai),vt.distanceFromCenter=0,g.encoding=l.encoding,g.vert=5*H(t,"paint","hillshade-exaggeration",yt,r),g.sunAz=H(t,"paint","hillshade-illumination-direction",yt,r),g.sunEl=35,g.opacity=.3,g.highlightColor=H(t,"paint","hillshade-highlight-color",yt,r),g.shadowColor=H(t,"paint","hillshade-shadow-color",yt,r),g.accentColor=H(t,"paint","hillshade-accent-color",yt,r)}),c.setVisible(t.layout?t.layout.visibility!=="none":!0)}const h=a;return c&&c.set("mapbox-source",h),c}function MA(n,e,t,i){const r=[];let s=null;if(e instanceof To){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const u=i.projection?ye(i.projection):s.getProjection();s=new Ri(Object.assign(s.getProperties(),{maxResolution:Ai[0]/An[u.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter(Js(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(Ai[0]/An[s.getProjection().getUnits()]/Math.pow(2,n.zoom)),(!s.getCenter()||s.getZoom()===void 0)&&s.fit(s.getProjection().getExtent(),{nearest:!0,size:e.getSize()})}e.set("mapbox-style",n),e.set("mapbox-metadata",{styleUrl:t,options:i});const o=n.layers;let a=[],l,c,h;for(let u=0,d=o.length;u<d;++u){const g=o[u],f=g.type;if(f=="heatmap"){console.debug(`layers[${u}].type "${f}" not supported`);continue}else h=g.source||TA(o,g.ref),(!h||h!=c)&&(a.length&&(r.push(Nl(l,a,n,t,e,i)),a=[]),l=PA(n,t,g,i),l instanceof Dn||l instanceof Sr||(a=[]),c=l.get("mapbox-source")),a.push(g.id)}return r.push(Nl(l,a,n,t,e,i)),Promise.all(r)}function FA(n,e,t={}){let i,r;if(ut){if(!(n instanceof To)&&!(n instanceof Si))throw new Error("ol-mapbox-style in a web worker requires a Map or a LayerGroup as first argument");r=n}else typeof n=="string"||n instanceof HTMLElement?r=new To({target:n}):r=n;if(typeof e=="string"){const s=e.startsWith("data:")?location.href:wl(e,t.accessToken);t=bA(s,t),i=new Promise(function(o,a){Hp(e,t).then(function(l){MA(l,r,s,t).then(function(){o(r)}).catch(a)}).catch(function(l){a(new Error(`Could not load ${e}: ${l.message}`))})})}else i=new Promise(function(s,o){MA(e,r,!t.styleUrl||t.styleUrl.startsWith("data:")?location.href:wl(t.styleUrl,t.accessToken),t).then(function(){s(r)}).catch(o)});return i}function Nl(n,e,t,i,r,s={}){let o=24,a=0;const l=t.layers;for(let c=0,h=l.length;c<h;++c){const u=l[c];e.indexOf(u.id)!==-1&&(o=Math.min("minzoom"in u?u.minzoom:0,o),a=Math.max("maxzoom"in u?u.maxzoom:24,a))}return new Promise(function(c,h){const u=function(){const g=n.getSource();if(!g||g.getState()==="error"){h(new Error("Error accessing data for source "+n.get("mapbox-source")));return}if("getTileGrid"in g){const f=g.getTileGrid();if(f){const p=f.getMinZoom();(o>0||p>0)&&n.setMaxResolution(Math.min(Uo(Math.max(0,o-1e-12),Ai),Uo(Math.max(0,p-1e-12),f.getResolutions()))),a<24&&n.setMinResolution(Uo(a,Ai))}}else o>0&&n.setMaxResolution(Uo(Math.max(0,o-1e-12),Ai));g instanceof Mn||g instanceof $u?Jv(n,t,e,Object.assign({styleUrl:i},s)).then(function(){lC(n,r),c()}).catch(h):c()};n.set("mapbox-layers",e);const d=r.getLayers();d.getArray().indexOf(n)===-1&&d.push(n),n.getSource()?u():n.once("change:source",u)})}function cC(n,e,t){const i=n.get("mapbox-style"),r=i.layers;let s,o=-1;s=r.length;let a;if(s>0&&r[s-1].source===e.source?(o=s-1,a=-1):s<r.length&&r[s].source===e.source&&(o=s,a=0),o===-1){const{options:h,styleUrl:u}=n.get("mapbox-metadata"),d=PA(i,u,e,h);return r.splice(s,0,e),Nl(d,[e.id],i,u,n,h)}if(r.some(h=>h.id===e.id))throw new Error(`Layer with id "${e.id}" already exists.`);const l=r[o].id,c=Bu[Pu(n.get("mapbox-style"),zl(n,l))];if(r.splice(s,0,e),c){const[h,u,d,g,f,p,A,m]=c;if(Array.isArray(d)){const y=d.indexOf(l)+a;d.splice(y,0,e.id)}Nu(h,u,d,g,f,p,A,m)}else zl(n,r[o].id).changed();return Promise.resolve()}function hC(n,e){const t=n.get("mapbox-style"),i=t.layers,r=i.findIndex(function(h){return h.id===e.id});if(r===-1)throw new Error(`Layer with id "${e.id}" not found.`);if(i[r].source!==e.source)throw new Error("Updated layer and previous version must use the same source.");delete Mu(t)[e.id],delete Wp(t)[e.id],i[r]=e;const o=Bu[Pu(n.get("mapbox-style"),zl(n,e.id))];if(o)return Nu.apply(void 0,o),Promise.resolve();const a=zl(n,e.id),{options:l,styleUrl:c}=n.get("mapbox-metadata");return Nl(a,[e.id],t,c,n,l)}function uC(n,e,t){const i=kA(n,e),r=n.getLayers().getArray().filter(function(a){return(a instanceof Dn||a instanceof Ll||a instanceof Sr)&&a.getSource()===i}),s=n.get("mapbox-metadata");let o;switch(t.type){case"vector":o=ed(t,s.styleUrl,s.options);break;case"geojson":o=Promise.resolve(id(t,s.styleUrl,s.options));break;case"raster":case"raster-dem":o=IA(t,s.styleUrl,s.options);break;default:return Promise.reject(new Error("Unsupported source type "+t.type))}return o.then(function(a){r.forEach(function(l){l.setSource(a)})}),o}function zl(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i){const s=t[i].get("mapbox-layers");if(s&&s.indexOf(e)!==-1)return t[i]}}function LA(n,e){const t=[],i=n.getLayers().getArray();for(let r=0,s=i.length;r<s;++r)i[r].get("mapbox-source")===e&&t.push(i[r]);return t}function kA(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i){const s=t[i].getSource();if(t[i].get("mapbox-source")===e)return s}}function jl(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function nd(n,e,t,i,r,s,o){o=o??jl();const a=1/(n-e),l=1/(t-i),c=1/(r-s);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*l,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*c,o[11]=0,o[12]=(n+e)*a,o[13]=(i+t)*l,o[14]=(s+r)*c,o[15]=1,o}function DA(n,e,t,i,r){return r=r??jl(),r[0]=n[0]*e,r[1]=n[1]*e,r[2]=n[2]*e,r[3]=n[3]*e,r[4]=n[4]*t,r[5]=n[5]*t,r[6]=n[6]*t,r[7]=n[7]*t,r[8]=n[8]*i,r[9]=n[9]*i,r[10]=n[10]*i,r[11]=n[11]*i,r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],r}function dC(n,e,t,i,r){r=r??jl();let s,o,a,l,c,h,u,d,g,f,p,A;return n===r?(r[12]=n[0]*e+n[4]*t+n[8]*i+n[12],r[13]=n[1]*e+n[5]*t+n[9]*i+n[13],r[14]=n[2]*e+n[6]*t+n[10]*i+n[14],r[15]=n[3]*e+n[7]*t+n[11]*i+n[15]):(s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],h=n[5],u=n[6],d=n[7],g=n[8],f=n[9],p=n[10],A=n[11],r[0]=s,r[1]=o,r[2]=a,r[3]=l,r[4]=c,r[5]=h,r[6]=u,r[7]=d,r[8]=g,r[9]=f,r[10]=p,r[11]=A,r[12]=s*e+c*t+g*i+n[12],r[13]=o*e+h*t+f*i+n[13],r[14]=a*e+u*t+p*i+n[14],r[15]=l*e+d*t+A*i+n[15]),r}function fC(n,e,t,i){return i=i??jl(),i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n,i[13]=e,i[14]=t,i[15]=1,i}const gC=`
37
+ attribute vec4 a_position;
38
+ attribute vec4 a_texcoord;
39
+
40
+ uniform mat4 u_matrix;
41
+ uniform mat4 u_textureMatrix;
42
+
43
+ varying vec2 v_texcoord;
44
+
45
+ void main() {
46
+ gl_Position = u_matrix * a_position;
47
+ vec2 texcoord = (u_textureMatrix * a_texcoord).xy;
48
+ v_texcoord = texcoord;
49
+ }
50
+ `,pC=`
51
+ precision mediump float;
52
+
53
+ varying vec2 v_texcoord;
54
+
55
+ uniform sampler2D u_texture;
56
+
57
+ void main() {
58
+ if (
59
+ v_texcoord.x < 0.0 ||
60
+ v_texcoord.y < 0.0 ||
61
+ v_texcoord.x > 1.0 ||
62
+ v_texcoord.y > 1.0
63
+ ) {
64
+ discard;
65
+ }
66
+ gl_FragColor = texture2D(u_texture, v_texcoord);
67
+ }
68
+ `;class AC{constructor(e){this.gl_=e,this.program_=rd(e,pC,gC),this.positionLocation=e.getAttribLocation(this.program_,"a_position"),this.texcoordLocation=e.getAttribLocation(this.program_,"a_texcoord"),this.matrixLocation=e.getUniformLocation(this.program_,"u_matrix"),this.textureMatrixLocation=e.getUniformLocation(this.program_,"u_textureMatrix"),this.textureLocation=e.getUniformLocation(this.program_,"u_texture"),this.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.positionBuffer),this.positions=[0,0,0,1,1,0,1,0,0,1,1,1],e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.positions),e.STATIC_DRAW),this.texcoordBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.texcoordBuffer),this.texcoords=[0,0,0,1,1,0,1,0,0,1,1,1],e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.texcoords),e.STATIC_DRAW)}drawImage(e,t,i,r,s,o,a,l,c,h,u,d,g){const f=this.gl_;l===void 0&&(l=r),c===void 0&&(c=s),o===void 0&&(o=t),a===void 0&&(a=i),h===void 0&&(h=o),u===void 0&&(u=a),d===void 0&&(d=f.canvas.width),g===void 0&&(g=f.canvas.height),f.bindTexture(f.TEXTURE_2D,e),f.useProgram(this.program_),f.bindBuffer(f.ARRAY_BUFFER,this.positionBuffer),f.enableVertexAttribArray(this.positionLocation),f.vertexAttribPointer(this.positionLocation,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.texcoordBuffer),f.enableVertexAttribArray(this.texcoordLocation),f.vertexAttribPointer(this.texcoordLocation,2,f.FLOAT,!1,0,0);let p=nd(0,d,0,g,-1,1);p=dC(p,l,c,0),p=DA(p,h,u,1),f.uniformMatrix4fv(this.matrixLocation,!1,p);let A=fC(r/t,s/i,0);A=DA(A,o/t,a/i,1),f.uniformMatrix4fv(this.textureMatrixLocation,!1,A),f.uniform1i(this.textureLocation,0),f.drawArrays(f.TRIANGLES,0,this.positions.length/2)}}function OA(n,e,t){const i=n.createShader(e);if(i===null)throw new Error("Shader compilation failed");if(n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const r=n.getShaderInfoLog(i);throw r===null?new Error("Shader info log creation failed"):new Error(r)}return i}function rd(n,e,t){const i=n.createProgram(),r=OA(n,n.VERTEX_SHADER,t),s=OA(n,n.FRAGMENT_SHADER,e);if(i===null)throw new Error("Program creation failed");if(n.attachShader(i,r),n.attachShader(i,s),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw n.getProgramInfoLog(i)===null?new Error("Program info log creation failed"):new Error;return i}const mC=`
69
+ attribute vec4 a_position;
70
+
71
+ uniform mat4 u_matrix;
72
+
73
+ void main() {
74
+ gl_Position = u_matrix * a_position;
75
+ }
76
+ `,yC=`
77
+ precision mediump float;
78
+
79
+ uniform vec4 u_val;
80
+ void main() {
81
+ gl_FragColor = u_val;
82
+ }
83
+ `,_C=`
84
+ attribute vec4 a_position;
85
+ attribute vec2 a_texcoord;
86
+
87
+ varying vec2 v_texcoord;
88
+
89
+ uniform mat4 u_matrix;
90
+
91
+ void main() {
92
+ gl_Position = u_matrix * a_position;
93
+ v_texcoord = a_texcoord;
94
+ }
95
+ `,xC=`
96
+ precision mediump float;
97
+
98
+ varying vec2 v_texcoord;
99
+
100
+ uniform sampler2D u_texture;
101
+
102
+ void main() {
103
+ if (v_texcoord.x < 0.0 || v_texcoord.x > 1.0 || v_texcoord.y < 0.0 || v_texcoord.y > 1.0) {
104
+ discard;
105
+ }
106
+ gl_FragColor = texture2D(u_texture, v_texcoord);
107
+ }
108
+ `;function EC(n,e,t,i){let r;return t&&t.length?r=t.shift():ut?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("webgl",i)}function wC(n){const e=n.canvas;e.width=1,e.height=1,n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT|n.STENCIL_BUFFER_BIT)}const GA=[];function vC(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Math.round(i*e),p=Math.round(i*t);n.canvas.width=f,n.canvas.height=p;let A,m;if(m=n.createTexture(),n.bindTexture(n.TEXTURE_2D,m),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),d?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,f,p,0,n.RGBA,h,null),A=n.createFramebuffer(),n.bindFramebuffer(n.FRAMEBUFFER,A),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,m,0),A===null)throw new Error("Could not create framebuffer");if(m===null)throw new Error("Could not create texture");if(l.length===0)return{width:f,height:p,framebuffer:A,texture:m};const y=jt();l.forEach(function(T,I,F){cc(y,T.extent)});let E,x,_;const w=1/r;{if(E=n.createTexture(),m===null)throw new Error("Could not create texture");x=Math.round(ne(y)*w),_=Math.round(Oe(y)*w);const T=n.getParameter(n.MAX_TEXTURE_SIZE),I=Math.max(x,_),F=I>T?T/I:1,P=Math.round(x*F),B=Math.round(_*F);n.bindTexture(n.TEXTURE_2D,E),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),d?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,P,B,0,n.RGBA,h,null);const R=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,R),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,E,0);const S=new AC(n);l.forEach(function(L,z,V){const U=(L.extent[0]-y[0])*w*F,X=-(L.extent[3]-y[3])*w*F,D=ne(L.extent)*w*F,q=Oe(L.extent)*w*F;if(n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,P,B),L.clipExtent){const O=(L.clipExtent[0]-y[0])*w*F,se=-(L.clipExtent[3]-y[3])*w*F,we=ne(L.clipExtent)*w*F,ge=Oe(L.clipExtent)*w*F;n.enable(n.SCISSOR_TEST),n.scissor(d?O:Math.round(O),d?se:Math.round(se),d?we:Math.round(O+we)-Math.round(O),d?ge:Math.round(se+ge)-Math.round(se))}S.drawImage(L.texture,L.width,L.height,c,c,L.width-2*c,L.height-2*c,d?U:Math.round(U),d?X:Math.round(X),d?D:Math.round(U+D)-Math.round(U),d?q:Math.round(X+q)-Math.round(X),P,B),n.disable(n.SCISSOR_TEST)}),n.deleteFramebuffer(R)}const v=li(o),C=li(y),b=T=>{const I=(T[0][0]-v[0])/s*i,F=-(T[0][1]-v[1])/s*i,P=(T[1][0]-v[0])/s*i,B=-(T[1][1]-v[1])/s*i,R=(T[2][0]-v[0])/s*i,S=-(T[2][1]-v[1])/s*i;return{u1:P,v1:B,u0:I,v0:F,u2:R,v2:S}};n.bindFramebuffer(n.FRAMEBUFFER,A),n.viewport(0,0,f,p);{const T=[],I=[],F=rd(n,xC,_C);n.useProgram(F);const P=n.getUniformLocation(F,"u_texture");n.bindTexture(n.TEXTURE_2D,E),n.uniform1i(P,0),a.getTriangles().forEach(function(U,X,D){const q=U.source,O=U.target,{u1:se,v1:we,u0:ge,v0:We,u2:ve,v2:Fe}=b(O),xi=(q[0][0]-C[0])/r/x,_t=-(q[0][1]-C[1])/r/_,ft=(q[1][0]-C[0])/r/x,j=-(q[1][1]-C[1])/r/_,Ke=(q[2][0]-C[0])/r/x,gt=-(q[2][1]-C[1])/r/_;T.push(se,we,ge,We,ve,Fe),I.push(ft,j,xi,_t,Ke,gt)});const B=nd(0,f,p,0,-1,1),R=n.getUniformLocation(F,"u_matrix");n.uniformMatrix4fv(R,!1,B);const S=n.getAttribLocation(F,"a_position"),L=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,L),n.bufferData(n.ARRAY_BUFFER,new Float32Array(T),n.STATIC_DRAW),n.vertexAttribPointer(S,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(S);const z=n.getAttribLocation(F,"a_texcoord"),V=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,V),n.bufferData(n.ARRAY_BUFFER,new Float32Array(I),n.STATIC_DRAW),n.vertexAttribPointer(z,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(z),n.drawArrays(n.TRIANGLES,0,T.length/2)}if(u){const T=rd(n,yC,mC);n.useProgram(T);const I=nd(0,f,p,0,-1,1),F=n.getUniformLocation(T,"u_matrix");n.uniformMatrix4fv(F,!1,I);const P=Array.isArray(u)?u:[0,0,0,255],B=n.getUniformLocation(T,"u_val");n.uniform4fv(B,P);const R=n.getAttribLocation(T,"a_position"),S=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,S),n.vertexAttribPointer(R,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(R);const L=a.getTriangles().reduce(function(z,V){const U=V.target,{u1:X,v1:D,u0:q,v0:O,u2:se,v2:we}=b(U);return z.concat([X,D,q,O,q,O,se,we,se,we,X,D])},[]);n.bufferData(n.ARRAY_BUFFER,new Float32Array(L),n.STATIC_DRAW),n.drawArrays(n.LINES,0,L.length/2)}return{width:f,height:p,framebuffer:A,texture:m}}class CC extends Ml{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.renderEdges_=e.renderEdges!==void 0?e.renderEdges:!1,this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const t=e.sourceProj,i=t.getExtent(),r=e.sourceTileGrid.getExtent();this.clipExtent_=t.canWrapX()?r?xt(i,r):i:r;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?xt(s,o):s;if(Zs(l)===0){this.state=G.EMPTY;return}i&&(a?a=xt(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=e.targetProj,u=sA(t,h,l,c);if(!isFinite(u)||u<=0){this.state=G.EMPTY;return}const d=e.errorThreshold!==void 0?e.errorThreshold:Yu;if(this.triangulation_=new Xu(t,h,l,a,u*d,c,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let g=this.triangulation_.calculateSourceExtent();if(a&&(t.canWrapX()?(g[1]=Pe(g[1],a[1],a[3]),g[3]=Pe(g[3],a[1],a[3])):g=xt(g,a)),!Zs(g))this.state=G.EMPTY;else{let f=0,p=0;t.canWrapX()&&(f=ne(i),p=Math.floor((g[0]-i[0])/f)),uc(g.slice(),t,!0).forEach(m=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(m,this.sourceZ_),E=e.getTileFunction;for(let x=y.minX;x<=y.maxX;x++)for(let _=y.minY;_<=y.maxY;_++){const w=E(this.sourceZ_,x,_,this.pixelRatio_);if(w){const v=p*f;this.sourceTiles_.push({tile:w,offset:v})}}++p}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const e=[];let t=!1;if(this.sourceTiles_.forEach(x=>{var X;const _=x.tile;if(!_||_.getState()!==G.LOADED)return;const w=_.getSize(),v=this.gutter_;let C;const b=fv(_.getData());b?C=b:(t=!0,C=pv(Pl(_.getData())));const T=[w[0]+2*v,w[1]+2*v],I=C instanceof Float32Array,F=T[0]*T[1],P=I?Float32Array:Uint8ClampedArray,B=new P(C.buffer),R=P.BYTES_PER_ELEMENT,S=R*B.length/F,L=B.byteLength/T[1],z=Math.floor(L/R/T[0]),V=this.sourceTileGrid_.getTileCoordExtent(_.tileCoord);V[0]+=x.offset,V[2]+=x.offset;const U=(X=this.clipExtent_)==null?void 0:X.slice();U&&(U[0]+=x.offset,U[2]+=x.offset),e.push({extent:V,clipExtent:U,data:B,dataType:P,bytesPerPixel:S,pixelSize:T,bandCount:z})}),this.sourceTiles_.length=0,e.length===0){this.state=G.ERROR,this.changed();return}const i=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(i),s=typeof r=="number"?r:r[0],o=typeof r=="number"?r:r[1],a=Math.round(s*this.pixelRatio_),l=Math.round(o*this.pixelRatio_),c=this.targetTileGrid_.getResolution(i),h=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=e[0].bandCount,g=new e[0].dataType(d*a*l),f=EC(a,l,GA,{premultipliedAlpha:!1,antialias:!1});let p;const A=f.RGBA;let m;e[0].dataType==Float32Array?(m=f.FLOAT,f.getExtension("WEBGL_color_buffer_float"),f.getExtension("OES_texture_float"),f.getExtension("EXT_float_blend"),p=f.getExtension("OES_texture_float_linear")!==null&&this.interpolate):(m=f.UNSIGNED_BYTE,p=this.interpolate);const y=4,E=Math.ceil(d/y);for(let x=E-1;x>=0;--x){const _=[];for(let P=0,B=e.length;P<B;++P){const R=e[P],S=R.pixelSize,L=S[0],z=S[1],V=new R.dataType(y*L*z),U=R.data;let X=x*y;for(let q=0,O=V.length;q<O;q+=y)V[q]=U[X],V[q+1]=U[X+1],V[q+2]=U[X+2],V[q+3]=U[X+3],X+=d;const D=f.createTexture();f.bindTexture(f.TEXTURE_2D,D),p?(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR)):(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST)),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texImage2D(f.TEXTURE_2D,0,A,L,z,0,A,m,V),_.push({extent:R.extent,clipExtent:R.clipExtent,texture:D,width:L,height:z})}const{framebuffer:w,width:v,height:C}=vC(f,s,o,this.pixelRatio_,h,c,u,this.triangulation_,_,this.gutter_,m,this.renderEdges_,p),b=v,T=C*y,I=new e[0].dataType(b*T);f.bindFramebuffer(f.FRAMEBUFFER,w),f.readPixels(0,0,v,C,f.RGBA,m,I);let F=x*y;for(let P=0,B=I.length;P<B;P+=y){const R=(b-1-(P/T|0))*T+P%T;g[F]=I[R],g[F+1]=I[R+1],g[F+2]=I[R+2],g[F+3]=I[R+3],F+=d}}if(wC(f),GA.push(f.canvas),t){const x=Me(s,o),_=new ImageData(g,s);x.putImageData(_,0,0),this.reprojData_=x.canvas}else this.reprojData_=g;this.reprojSize_=[a,l],this.state=G.LOADED,this.changed()}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i!==G.IDLE&&i!==G.LOADING)return;e++;const r=ce(t,K.CHANGE,()=>{const s=t.getState();(s==G.LOADED||s==G.ERROR||s==G.EMPTY)&&(Te(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t}){t.getState()==G.IDLE&&t.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(Te),this.sourcesListenerKeys_=null}}class bC extends Qu{constructor(e){const t=e.projection===void 0?"EPSG:3857":e.projection;let i=e.tileGrid;i===void 0&&t&&(i=Gl({extent:Ho(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize})),super({cacheSize:.1,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:t,tileGrid:i,state:e.state,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0,this.tileSize_=e.tileSize?it(e.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=e.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=e.bandCount===void 0?4:e.bandCount,this.tileGridForProjection_={},this.crossOrigin_=e.crossOrigin||"anonymous",this.transformMatrix=null}setTileSizes(e){this.tileSizes_=e}getTileSize(e){if(this.tileSizes_)return this.tileSizes_[e];if(this.tileSize_)return this.tileSize_;const t=this.getTileGrid();return t?it(t.getTileSize(e)):[256,256]}getGutterForProjection(e){const t=this.getProjection();return(!t||tt(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,i,r,s,o){const a=this.tileGrid||this.getTileGridForProjection(s||r),l=Math.max.apply(null,a.getResolutions().map((f,p)=>{const A=it(a.getTileSize(p)),m=this.getTileSize(p);return Math.max(m[0]/A[0],m[1]/A[1])})),c=this.getTileGridForProjection(r),h=[e,t,i],u=this.getTileCoordForTileUrlFunction(h,r),d=Object.assign({sourceProj:s||r,sourceTileGrid:a,targetProj:r,targetTileGrid:c,tileCoord:h,wrappedTileCoord:u,pixelRatio:l,gutter:this.gutter_,getTileFunction:(f,p,A,m)=>this.getTile(f,p,A,m,void 0,o),transformMatrix:this.transformMatrix},this.tileOptions),g=new CC(d);return g.key=this.getKey(),g}getTile(e,t,i,r,s,o){var w;const a=this.getProjection();if(s&&(a&&!tt(a,s)||this.transformMatrix))return this.getReprojTile_(e,t,i,s,a,o);const l=this.getTileSize(e),c=this.loader_,h=new AbortController,u={signal:h.signal,crossOrigin:this.crossOrigin_},d=this.getTileCoordForTileUrlFunction([e,t,i]);if(!d)return null;const g=this.getKey(),f=Wo(this,g,e,t,i);if(o&&o.containsKey(f))return o.get(f);const p=d[0],A=d[1],m=d[2],y=(w=this.getTileGrid())==null?void 0:w.getFullTileRange(p);y&&(u.maxY=y.getHeight()-1);function E(){return qn(function(){return c(p,A,m,u)})}const x=Object.assign({tileCoord:[e,t,i],loader:E,size:l,controller:h},this.tileOptions),_=new Ml(x);return _.key=this.getKey(),_.addEventListener(K.CHANGE,this.handleTileChange_),o==null||o.set(f,_),_}handleTileChange_(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=Rs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?Rs.TILELOADERROR:r==G.LOADED?Rs.TILELOADEND:void 0),s&&this.dispatchEvent(new AA(s,t))}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||tt(t,e))&&!this.transformMatrix)return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=Ol(e)),this.tileGridForProjection_[i]}setTileGridForProjection(e,t){const i=ye(e);if(i){const r=Y(i);r in this.tileGridForProjection_||(this.tileGridForProjection_[r]=t)}}}const TC=new Error("Image failed to load");function BA(n,e,t,i,r){return new Promise((s,o)=>{const a=new Image;a.crossOrigin=r.crossOrigin??null,a.addEventListener("load",()=>s(a)),a.addEventListener("error",()=>o(TC)),a.src=xA(n,e,t,i,r.maxY)})}function NA(n){return function(e,t,i,r){const s=Wv(n,e,t,i);return BA(s,e,t,i,r)}}function RC(n){return function(e,t,i,r){const s=n(e,t,i,r);return BA(s,e,t,i,r)}}function zA(n){let e;if(Array.isArray(n))e=NA(n);else if(typeof n=="string"){const t=EA(n);e=NA(t)}else if(typeof n=="function")e=RC(n);else throw new Error("The url option must be a single template, an array of templates, or a function for getting a URL");return e}let jA=0;function UA(n){return Array.isArray(n)?n.join(`
109
+ `):typeof n=="string"?n:(++jA,"url-function-key-"+jA)}class SC extends bC{constructor(e){e=e||{};let t=e.loader,i;e.url&&(t=zA(e.url),i=UA(e.url));const r=t?e.state:"loading",s=e.wrapX===void 0?!0:e.wrapX;super({loader:t,key:i,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize,gutter:e.gutter,maxResolution:e.maxResolution,projection:e.projection,tileGrid:e.tileGrid,state:r,wrapX:s,transition:e.transition,interpolate:e.interpolate!==!1,crossOrigin:e.crossOrigin,zDirection:e.zDirection})}setUrl(e){const t=zA(e);this.setLoader(t),this.setKey(UA(e)),this.getState()!=="ready"&&this.setState("ready")}}const IC="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOShgAHAAAAEgAAAISgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAAQVNDSUkAAABTY3JlZW5zaG90/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDShJQ0NfUFJPRklMRQABAQAADRhhcHBsAhAAAG1udHJSR0IgWFlaIAfpAAIAHAAJAB4AD2Fjc3BBUFBMAAAAAEFQUEwAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWRlc2MAAAFQAAAAYmRzY20AAAG0AAAB9GNwcnQAAAOoAAAAI3d0cHQAAAPMAAAAFHJYWVoAAAPgAAAAFGdYWVoAAAP0AAAAFGJYWVoAAAQIAAAAFHJUUkMAAAQcAAAIDGFhcmcAAAwoAAAAIHZjZ3QAAAxIAAAAMG5kaW4AAAx4AAAAPm1tb2QAAAy4AAAAKHZjZ3AAAAzgAAAAOGJUUkMAAAQcAAAIDGdUUkMAAAQcAAAIDGFhYmcAAAwoAAAAIGFhZ2cAAAwoAAAAIGRlc2MAAAAAAAAACERpc3BsYXkAAAAAAAAA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2Q==";class FC extends so{constructor(t){const i=t||{},r=document.createElement("button");r.innerHTML=`<div class="svgContainer"><svg width="22" height="22" viewBox="0 0 22 22" fill="rgb(102, 102, 102)" xmlns="http://www.w3.org/2000/svg">
110
+ <path d="M11 4.7 16.9 9.4 11 14.1 5.1 9.4 11 4.7ZM11 16.7 20.4 9.4 11 2.1 1.6 9.4 11 16.7M11 19.3 3.5 13.3 1.6 14.7 11 21.9 20.4 14.7 18.5 13.3 11 19.3"/>
111
+ </svg></div>`;const s=document.createElement("div");s.className="layer-control ol-unselectable ol-control",s.appendChild(r);const o=document.createElement("div");o.classList.add("layer-selection","hidden"),s.appendChild(o);super({element:s,target:i.target});Gt(this,"baseLayers",[{name:"positron",image:IC,styleUrl:"https://tiles.openfreemap.org/styles/positron"},{name:"orthofoto",image:PC,layer:new Ll({visible:!1,source:new SC({maxZoom:19,url:"https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpg",attributions:'<a href="https://basemap.at">© basemap.at</a>'})}),visible:!1},{name:"kataster",image:MC,styleUrl:"https://kataster.bev.gv.at/styles/kataster/style_basic.json"}].map((t,i)=>{t.styleUrl&&(t.layer=new Si({visible:i===0}),t.styleUrl&&FA(t.layer,t.styleUrl));const r=document.createElement("div");r.classList.add("image-box"),i===0&&r.classList.add("selected");const s=document.createElement("img");return s.src=t.image,s.alt=t.name,r.appendChild(s),r.addEventListener("click",o=>{this.baseLayers.forEach(a=>{o.target===a.thumbnailBox?a.thumbnailBox.classList.add("selected"):a.thumbnailBox.classList.remove("selected")}),this.baseLayers.forEach(a=>{a.layer.setVisible(a.name===t.name)})}),t.thumbnailBox=r,t}));Gt(this,"baseLayerGroup");Gt(this,"layerControlElement",null);this.baseLayers.forEach(a=>{o.appendChild(a.thumbnailBox)}),this.layerControlElement=o,r.addEventListener("click",this.toggleLayerSelection.bind(this),!1)}setMap(t){this.getMap()&&this.getMap().removeLayer(this.baseLayerGroup),t&&(this.baseLayerGroup=new Si({layers:this.baseLayers.map(i=>i.layer)}),t.addLayer(this.baseLayerGroup)),super.setMap(t)}set displayLayerSelection(t){if(t){this.layerControlElement.classList.remove("hidden");const i=()=>{this.displayLayerSelection=!1,this.getMap().getTargetElement().removeEventListener("click",i)};setTimeout(()=>{this.getMap().getTargetElement().addEventListener("click",i)}),this.getMap().once("moveend",()=>{this.displayLayerSelection&&(this.displayLayerSelection=!1,document.body.removeEventListener("click",i))})}else this.fadeOutAndHide()}get displayLayerSelection(){return!this.layerControlElement.classList.contains("hidden")}toggleLayerSelection(){this.displayLayerSelection=!this.displayLayerSelection}fadeOutAndHide(){this.layerControlElement.classList.add("fade-out"),setTimeout(()=>{this.layerControlElement.classList.remove("fade-out"),this.layerControlElement.classList.add("hidden")},150)}}class LC extends En{constructor(t){super();ae(this,Ps);ae(this,mi,null);ae(this,zn,new Dn({source:new Mn}));pe(this,mi,t.yioMap);const i=M(this,zn).getSource();i.addEventListener("change",r=>{M(this,mi).userSelect=i.getFeatures().map(s=>s.getProperties())})}setMap(t){const i=this.getMap();i&&i.removeLayer(M(this,zn)),t&&(t.addLayer(M(this,zn)),super.setMap(t))}handleEvent(t){return t.type==="pointermove"&&le(this,Ps,sm).call(this,t),t.type==="click"?le(this,Ps,om).call(this,t):!0}setActive(t){super.setActive(t),t||(M(this,zn).getSource().clear(),M(this,mi)&&(M(this,mi).userSelect.length=0))}}mi=new WeakMap,zn=new WeakMap,Ps=new WeakSet,sm=function(t){const i=this.getMap(),r=M(this,mi)._getContentLayer();i.getFeaturesAtPixel(t.pixel,{layerFilter:o=>r.getLayers().getArray().includes(o)}).filter(o=>o.get("id")!==void 0).length?i.getTargetElement().classList.add("cursor-pointer"):i.getTargetElement().classList.remove("cursor-pointer")},om=function(t){const i=this.getMap(),r=M(this,mi)._getContentLayer(),s=M(this,zn).getSource(),o=i.getFeaturesAtPixel(t.pixel,{layerFilter:a=>r.getLayers().getArray().includes(a)}).filter(a=>a.get("id")!==void 0);return s.clear(),s.addFeatures(o.map(a=>a instanceof ht?bg(a):a)),M(this,mi).notifyNextChange=!0,M(this,mi)._handleClick(t.originalEvent),o.length===0};function Nn(n,e){const t=n.length;return e<0?n[e+t]:e>=t?n[e-t]:n[e]}function Ss(n,e){const t=n.length;let i=Math.floor(e);const r=e-i;i>=t?i-=t:i<0&&(i+=t);let s=i+1;s>=t&&(s-=t);const o=n[i],a=o[0],l=o[1],c=n[s],h=c[0]-a,u=c[1]-l;return[a+h*r,l+u*r]}const Ul={index:-1,endIndex:NaN,closestTargetDistance:1/0};function VA(n,e,t,i){const r=n[0],s=n[1];let o=1/0,a=-1,l=NaN;for(let u=0;u<e.targets.length;++u){const d=e.targets[u],g=d.coordinates;let f=1/0,p;for(let A=0;A<g.length-1;++A){const m=g[A],y=g[A+1],E=XA(r,s,m,y);E.squaredDistance<f&&(f=E.squaredDistance,p=A+E.along)}f<o&&(o=f,d.ring&&e.targetIndex===u&&(d.endIndex>d.startIndex?p<d.startIndex&&(p+=g.length):d.endIndex<d.startIndex&&p>d.startIndex&&(p-=g.length)),l=p,a=u)}const c=e.targets[a];let h=c.ring;if(e.targetIndex===a&&h){const u=Ss(c.coordinates,l),d=t.getPixelFromCoordinate(u),g=t.getPixelFromCoordinate(e.startCoord);tr(d,g)>i&&(h=!1)}if(h){const u=c.coordinates,d=u.length,g=c.startIndex,f=l;if(g<f){const p=Hl(u,g,f);Hl(u,g,f-d)<p&&(l-=d)}else{const p=Hl(u,g,f);Hl(u,g,f+d)<p&&(l+=d)}}return Ul.index=a,Ul.endIndex=l,Ul.closestTargetDistance=o,Ul}function WA(n,e){const t=[];for(let i=0;i<e.length;++i){const s=e[i].getGeometry();HA(n,s,t)}return t}function HA(n,e,t){if(e instanceof ii){Vl(n,e.getCoordinates(),!1,t);return}if(e instanceof bn){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r)Vl(n,i[r],!1,t);return}if(e instanceof Jt){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r)Vl(n,i[r],!0,t);return}if(e instanceof Tn){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a)Vl(n,o[a],!0,t)}return}if(e instanceof Ro){const i=e.getGeometries();for(let r=0;r<i.length;++r)HA(n,i[r],t);return}}function Vl(n,e,t,i){const r=n[0],s=n[1];for(let o=0,a=e.length-1;o<a;++o){const l=e[o],c=e[o+1],h=XA(r,s,l,c);if(h.squaredDistance===0){const u=o+h.along;i.push({coordinates:e,ring:t,startIndex:u,endIndex:u});return}}}function Wl(n,e){return zi(n[0],n[1],e[0],e[1])}function Hl(n,e,t){let i,r;e<t?(i=e,r=t):(i=t,r=e);const s=Math.ceil(i),o=Math.floor(r);if(s>o){const l=Ss(n,i),c=Ss(n,r);return Wl(l,c)}let a=0;if(i<s){const l=Ss(n,i),c=Nn(n,s);a+=Wl(l,c)}if(o<r){const l=Nn(n,o),c=Ss(n,r);a+=Wl(l,c)}for(let l=s;l<o-1;++l){const c=Nn(n,l),h=Nn(n,l+1);a+=Wl(c,h)}return a}const sd={along:0,squaredDistance:0};function XA(n,e,t,i){const r=t[0],s=t[1],o=i[0],a=i[1],l=o-r,c=a-s;let h=0,u=r,d=s;return(l!==0||c!==0)&&(h=Pe(((n-r)*l+(e-s)*c)/(l*l+c*c),0,1),u+=l*h,d+=c*h),sd.along=h,sd.squaredDistance=Xs(zi(n,e,u,d),10),sd}const Xl={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Yl extends Nt{constructor(e,t){super(e),this.feature=t}}class kC extends cr{constructor(e){const t=e;t.stopDown||(t.stopDown=Hr),super(t),this.on,this.once,this.un,this.options_=e,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=OC(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Wr,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let i=e.geometryFunction;if(!i){const r=this.mode_;if(r==="Circle")i=(s,o,a)=>{const l=o||new Ua([NaN,NaN]),c=je(s[0]),h=Kr(c,je(s[s.length-1]));return l.setCenterAndRadius(c,Math.sqrt(h),this.geometryLayout_),l};else{let s;r==="Point"?s=It:r==="LineString"?s=ii:r==="Polygon"&&(s=Jt),i=(o,a,l)=>(a?r==="Polygon"?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])],this.geometryLayout_):a.setCoordinates([],this.geometryLayout_):a.setCoordinates(o,this.geometryLayout_):a=new s(o,this.geometryLayout_),a)}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Dn({source:new Mn({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:DC(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Ra,this.freehandCondition_,e.freehand?this.freehandCondition_=es:this.freehandCondition_=e.freehandCondition?e.freehandCondition:th,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Jc.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=es:t=e:t=zf,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehand_?this.freehandCondition_=es:this.freehandCondition_=this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:th}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===K.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===he.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===he.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===he.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===he.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===he.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===he.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===he.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new Ni(he.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),i=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),r=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),s=mt([i,r]),o=this.traceSource_.getFeaturesInExtent(s);if(o.length===0)return;const a=WA(e.coordinate,o);a.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:a,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,r=e.startIndex<=t;i===r?i&&t>e.endIndex||!i&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(i&&t<e.endIndex||!i&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e<t){const r=Math.ceil(e);let s=Math.floor(t);s===t&&(s-=1),i=s-r+1}else{const r=Math.floor(e);let s=Math.ceil(t);s===t&&(s+=1),i=r-s+1}i>0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const r=[];if(t<i){const s=Math.ceil(t);let o=Math.floor(i);o===i&&(o-=1);for(let a=s;a<=o;++a)r.push(Nn(e.coordinates,a))}else{const s=Math.floor(t);let o=Math.ceil(i);o===i&&(o+=1);for(let a=s;a>=o;--a)r.push(Nn(e.coordinates,a))}r.length&&this.appendCoordinates(r)}updateTrace_(e){const t=this.traceState_;if(!t.active)return;if(t.targetIndex===-1){const a=e.map.getPixelFromCoordinate(t.startCoord);if(tr(a,e.pixel)<this.snapTolerance_)return}const i=VA(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==i.index){if(t.targetIndex!==-1){const l=t.targets[t.targetIndex];this.removeTracedCoordinates_(l.startIndex,l.endIndex)}const a=t.targets[i.index];this.addTracedCoordinates_(a,a.startIndex,i.endIndex)}else{const a=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(a,i.endIndex)}t.targetIndex=i.index;const r=t.targets[t.targetIndex];r.endIndex=i.endIndex;const s=Ss(r.coordinates,r.endIndex),o=this.getMap().getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(o[0]),Math.round(o[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const i=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){const r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_==="Point")&&(this.atFinish_(e.pixel,i)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const t=this.downPx_,i=e.pixel,r=t[0]-i[0],s=t[1]-i[1],o=r*r+s*s;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let i=!1;if(this.sketchFeature_){let r=!1,s=[this.finishCoordinate_];const o=this.mode_;if(o==="Point")i=!0;else if(o==="Circle")i=this.sketchCoords_.length===2;else if(o==="LineString")r=!t&&this.sketchCoords_.length>this.minPoints_;else if(o==="Polygon"){const a=this.sketchCoords_;r=a[0].length>this.minPoints_,s=[a[0][0],a[0][a[0].length-2]],t?s=[a[0][0]]:s=[a[0][0],a[0][a[0].length-2]]}if(r){const a=this.getMap();for(let l=0,c=s.length;l<c;l++){const h=s[l],u=a.getPixelFromCoordinate(h),d=e[0]-u[0],g=e[1]-u[1],f=this.freehand_?1:this.snapTolerance_;if(i=Math.sqrt(d*d+g*g)<=f,i){this.finishCoordinate_=h;break}}}}return i}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new Wt(new It(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new Wt);const t=e.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),i.changed()):(i=new ii(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(e){const t=this.getMap().getView().getProjection(),i=ya(this.geometryLayout_);for(;e.length<i;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Wt(new ii(this.sketchLineCoords_)));const r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new Wt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new Yl(Xl.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const t=this.getMap(),i=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),s=ya(this.geometryLayout_);let o,a;for(;e.length<s;)e.push(0);this.mode_==="Point"?a=this.sketchCoords_:this.mode_==="Polygon"?(o=this.sketchCoords_[0],a=o[o.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(o=this.sketchCoords_,a=o[o.length-1]),a[0]=e[0],a[1]=e[1],this.geometryFunction_(this.sketchCoords_,i,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),i.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(i):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();let r,s;const o=this.mode_;return o==="LineString"||o==="Circle"?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),this.geometryFunction_(s,t,i)):o==="Polygon"&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),r&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),r=this.mode_;for(let s=0;s<e;++s){let o;if(r==="LineString"||r==="Circle"){if(o=this.sketchCoords_,o.splice(-2,1),o.length>=2){this.finishCoordinate_=o[o.length-2].slice();const a=this.finishCoordinate_.slice();o[o.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(o,t,i),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r==="Polygon"){o=this.sketchCoords_[0],o.splice(-2,1);const a=this.sketchLine_.getGeometry();if(o.length>=2){const l=o[o.length-2].slice();o[o.length-1]=l,this.createOrUpdateSketchPoint_(l)}a.setCoordinates(o),this.geometryFunction_(this.sketchCoords_,t,i)}if(o.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const i=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new mr([t])):this.type_==="MultiLineString"?e.setGeometry(new bn([t])):this.type_==="MultiPolygon"&&e.setGeometry(new Tn([t])),this.dispatchEvent(new Yl(Xl.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new Yl(Xl.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let r;if(t==="LineString"||t==="Circle")r=this.sketchCoords_;else if(t==="Polygon")r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&r.shift(),r.pop();for(let o=0;o<e.length;o++)this.addToDrawing_(e[o]);const s=e[e.length-1];this.sketchFeature_=this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const i=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=i.getCoordinates();const r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new Wt(new It(r)),this.updateSketchFeatures_(),this.dispatchEvent(new Yl(Xl.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){const e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}}function DC(){const n=cg();return function(e,t){return n[e.getGeometry().getType()]}}function OC(n){switch(n){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+n)}}const YA=0,Xo=1,KA=[0,0,0,0],Is=[],od={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};function ad(n,e,t){let i;switch(e){case"LineString":i=n;break;case"MultiLineString":case"Polygon":i=n[t[0]];break;case"MultiPolygon":i=n[t[1]][t[0]];break}return i}class ld extends Nt{constructor(e,t,i){super(e),this.features=t,this.mapBrowserEvent=i}}class GC extends cr{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:nh,this.defaultDeleteCondition_=function(i){return M0(i)&&k0(i)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:es,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new wu,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new Dn({source:new Mn({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:NC(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new Rt(this.source_.getFeatures()),this.source_.addEventListener(Lt.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Lt.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(pt.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(pt.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;e?e===!0?t=es:t=e:t=zf,this.traceCondition_=t}addFeature_(e){const t=e.getGeometry();if(t){const r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_),e.addEventListener(K.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Rt;const i=this.featuresBeingModified_.getArray();for(let r=0,s=t.length;r<s;++r){const o=t[r].feature;o&&!i.includes(o)&&this.featuresBeingModified_.push(o)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new ld(od.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(K.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){const t=this.rBush_,i=[];t.forEach(function(r){e===r.feature&&i.push(r)});for(let r=i.length-1;r>=0;--r){const s=i[r];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);t.remove(s)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,geometry:t,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:o};this.rBush_.insert(mt(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),h={feature:e,geometry:t,depth:[r],index:a,segment:c};this.rBush_.insert(mt(c),h)}}}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),h={feature:e,geometry:t,depth:[r],index:a,segment:c};this.rBush_.insert(mt(c),h)}}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a){const c=o[a];for(let h=0,u=c.length-1;h<u;++h){const d=c.slice(h,h+2),g={feature:e,geometry:t,depth:[a,r],index:h,segment:d};this.rBush_.insert(mt(d),g)}}}}writeCircleGeometry_(e,t){const i=t.getCenter(),r={feature:e,geometry:t,index:YA,segment:[i,i]},s={feature:e,geometry:t,index:Xo,segment:[i,i]},o=[r,s];r.featureSegments=o,s.featureSegments=o,this.rBush_.insert(Ys(i),r);let a=t;this.rBush_.insert(a.getExtent(),s)}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=i[r],o=this.SEGMENT_WRITERS_[s.getType()];o(e,s)}}createOrUpdateVertexFeature_(e,t,i,r){let s=this.vertexFeature_;return s?s.getGeometry().setCoordinates(e):(s=new Wt(new It(e)),this.vertexFeature_=s,this.overlay_.getSource().addFeature(s)),s.set("features",t),s.set("geometries",i),s.set("existing",r),s}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==he.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(e.type!=he.SINGLECLICK||!this.ignoreNextSingleClick_?t=this.removePoint():t=!0),e.type==he.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;this.getMap().getView().getProjection();const i=[],r=this.vertexFeature_.getGeometry().getCoordinates(),s=mt([r]),o=this.rBush_.getInExtent(s),a={};o.sort(BC);for(let l=0,c=o.length;l<c;++l){const h=o[l],u=h.segment;let d=Y(h.geometry);const g=h.depth;if(g&&(d+="-"+g.join("-")),a[d]||(a[d]=new Array(2)),h.geometry.getType()==="Circle"&&h.index===Xo){const f=qA(e,h);Et(f,r)&&!a[d][0]&&(this.dragSegments_.push([h,0]),a[d][0]=h);continue}if(Et(u[0],r)&&!a[d][0]){this.dragSegments_.push([h,0]),a[d][0]=h;continue}if(Et(u[1],r)&&!a[d][1]){if(a[d][0]&&a[d][0].index===0){let f=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":f=f[g[1]];case"Polygon":if(h.index!==f[g[0]].length-2)continue;break}}this.dragSegments_.push([h,1]),a[d][1]=h;continue}Y(u)in this.vertexSegments_&&!a[d][0]&&!a[d][1]&&i.push(h)}return i}deactivateTrace_(){this.traceState_={active:!1}}updateTrace_(e){const t=this.traceState_;if(!t.active)return;if(t.targetIndex===-1){const s=e.map.getPixelFromCoordinate(t.startCoord);if(tr(s,e.pixel)<this.pixelTolerance_)return}const i=VA(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(i.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;if(t.targetIndex!==i.index){if(t.targetIndex!==-1){const o=t.targets[t.targetIndex];this.removeTracedCoordinates_(o.startIndex,o.endIndex)}else for(const o of this.traceSegments_){const a=o[0],l=a.geometry,c=o[1],h=l.getCoordinates();ad(h,l.getType(),a.depth).splice(a.index+c,1),l.setCoordinates(h),c===0&&(a.index-=1)}const s=t.targets[i.index];this.addTracedCoordinates_(s,s.startIndex,i.endIndex)}else{const s=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(s,i.endIndex)}t.targetIndex=i.index;const r=t.targets[t.targetIndex];r.endIndex=i.endIndex}getTraceCandidates_(e){const t=this.getMap(),i=this.pixelTolerance_,r=t.getCoordinateFromPixel([e.pixel[0]-i,e.pixel[1]+i]),s=t.getCoordinateFromPixel([e.pixel[0]+i,e.pixel[1]-i]),o=mt([r,s]);return this.traceSource_.getFeaturesInExtent(o)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}const t=this.getTraceCandidates_(e);if(t.length===0)return;const i=WA(e.coordinate,t);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,r=e.startIndex<=t;i===r?i&&t>e.endIndex||!i&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(i&&t<e.endIndex||!i&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e<t){const r=Math.ceil(e);let s=Math.floor(t);s===t&&(s-=1),i=s-r+1}else{const r=Math.floor(e);let s=Math.ceil(t);s===t&&(s+=1),i=r-s+1}if(i>0)for(const r of this.traceSegments_){const s=r[0],o=s.geometry,a=r[1];let l=r[0].index+1;a===1&&(l-=i);const c=o.getCoordinates();ad(c,o.getType(),s.depth).splice(l,i),o.setCoordinates(c),a===1&&(s.index-=i)}}addTracedCoordinates_(e,t,i){if(t===i)return;const r=[];if(t<i){const s=Math.ceil(t);let o=Math.floor(i);o===i&&(o-=1);for(let a=s;a<=o;++a)r.push(Nn(e.coordinates,a))}else{const s=Math.floor(t);let o=Math.ceil(i);o===i&&(o+=1);for(let a=s;a>=o;--a)r.push(Nn(e.coordinates,a))}if(r.length)for(const s of this.traceSegments_){const o=s[0],a=o.geometry,l=s[1],c=o.index+1;l===0&&r.reverse();const h=a.getCoordinates();ad(h,a.getType(),o.depth).splice(c,0,...r),a.setCoordinates(h),l===1&&(o.index+=r.length)}}updateGeometry_(e,t){const i=t[0],r=i.depth;let s;const o=i.segment,a=i.geometry,l=t[1];for(;e.length<a.getStride();)e.push(o[l][e.length]);switch(a.getType()){case"Point":s=e,o[0]=e,o[1]=e;break;case"MultiPoint":s=a.getCoordinates(),s[i.index]=e,o[0]=e,o[1]=e;break;case"LineString":s=a.getCoordinates(),s[i.index+l]=e,o[l]=e;break;case"MultiLineString":s=a.getCoordinates(),s[r[0]][i.index+l]=e,o[l]=e;break;case"Polygon":s=a.getCoordinates(),s[r[0]][i.index+l]=e,o[l]=e;break;case"MultiPolygon":s=a.getCoordinates(),s[r[1]][r[0]][i.index+l]=e,o[l]=e;break;case"Circle":const c=a;if(o[0]=e,o[1]=e,i.index===YA)this.changingFeature_=!0,c.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0,this.getMap().getView().getProjection();let h=tr(je(c.getCenter()),je(e));c.setRadius(h),this.changingFeature_=!1}break}s&&this.setGeometryCoordinates_(a,s)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([o])=>o));const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],i=[],r=[],s=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(s){this.traceSegments_=[];for(const o of this.dragSegments_){const a=o[0];tr(dc(s,a.segment),s)/e.map.getView().getResolution()<1&&this.traceSegments_.push(o)}}for(let o=0,a=this.dragSegments_.length;o<a;++o){const l=this.dragSegments_[o],c=l[0],h=c.feature;i.includes(h)||i.push(h);const u=c.geometry;r.includes(u)||r.push(u),this.updateGeometry_(t,l)}this.updateTrace_(e),this.createOrUpdateVertexFeature_(t,i,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;const t=e.coordinate,i=this.findInsertVerticesAndUpdateDragSegments_(t);if(i!=null&&i.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,i),this.vertexFeature_)){const r=this.vertexFeature_.getGeometry().getCoordinates();for(let s=i.length-1;s>=0;--s)this.insertVertex_(i[s],r);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const i=this.dragSegments_[t][0],r=i.geometry;if(r.getType()==="Circle"){const s=r,o=s.getCenter(),a=i.featureSegments[0],l=i.featureSegments[1];a.segment[0]=o,a.segment[1]=o,l.segment[0]=o,l.segment[1]=o,this.rBush_.update(Ys(o),a);let c=s;this.rBush_.update(c.getExtent(),l)}else this.rBush_.update(mt(i.segment),i)}return this.featuresBeingModified_&&(this.toggleTraceState_(e),this.dispatchEvent(new ld(od.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){const t=this.getMap(),i=t.getPixelFromCoordinate(e);t.getView().getProjection();const r=function(a,l){return ZA(e,a)-ZA(e,l)};let s,o;if(this.hitDetection_){const a=typeof this.hitDetection_=="object"?l=>l===this.hitDetection_:void 0;t.forEachFeatureAtPixel(i,(l,c,h)=>{h&&h.getType()==="Point"&&(h=new It(sr(h.getCoordinates())));const u=h||l.getGeometry();if(u&&u.getType()==="Point"&&l instanceof Wt&&this.features_.getArray().includes(l)){o=u;const d=l.getGeometry().getFlatCoordinates().slice(0,2);s=[{feature:l,geometry:o,segment:[d,d]}]}return!0},{layerFilter:a})}if(!s){const a=ci(Ys(e,KA)),l=t.getView().getResolution()*this.pixelTolerance_,c=ma(ji(a,l,KA));s=this.rBush_.getInExtent(c)}if(s&&s.length>0){const a=s.sort(r)[0],l=a.segment;let c=qA(e,a);const h=t.getPixelFromCoordinate(c);let u=tr(i,h);if(o||u<=this.pixelTolerance_){const d={};if(d[Y(l)]=!0,this.snapToPointer_||(this.delta_[0]=c[0]-e[0],this.delta_[1]=c[1]-e[1]),a.geometry.getType()==="Circle"&&a.index===Xo)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(c,[a.feature],[a.geometry],this.snappedToVertex_);else{const g=t.getPixelFromCoordinate(l[0]),f=t.getPixelFromCoordinate(l[1]),p=Kr(h,g),A=Kr(h,f);if(u=Math.sqrt(Math.min(p,A)),this.snappedToVertex_=u<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);return}this.snappedToVertex_&&(c=p>A?l[1]:l[0]),this.createOrUpdateVertexFeature_(c,[a.feature],[a.geometry],this.snappedToVertex_);const m={};m[Y(a.geometry)]=!0;for(let y=1,E=s.length;y<E;++y){const x=s[y].segment;if(Et(l[0],x[0])&&Et(l[1],x[1])||Et(l[0],x[1])&&Et(l[1],x[0])){const _=Y(s[y].geometry);_ in m||(m[_]=!0,d[Y(x)]=!0)}else break}}this.vertexSegments_=d;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(e,t){const i=e.segment,r=e.feature,s=e.geometry,o=e.depth,a=e.index;let l;for(;t.length<s.getStride();)t.push(0);switch(s.getType()){case"MultiLineString":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"Polygon":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"MultiPolygon":l=s.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,t);break;case"LineString":l=s.getCoordinates(),l.splice(a+1,0,t);break;default:return!1}this.setGeometryCoordinates_(s,l);const c=this.rBush_;c.remove(e),this.updateSegmentIndices_(s,a,o,1);const h={segment:[i[0],t],feature:r,geometry:s,depth:o,index:a};c.insert(mt(h.segment),h),this.dragSegments_.push([h,1]);const u={segment:[t,i[1]],feature:r,geometry:s,depth:o,index:a+1};return c.insert(mt(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){var t;return e&&this.findInsertVerticesAndUpdateDragSegments_(e),(t=this.vertexFeature_)==null?void 0:t.getGeometry().getCoordinates()}getPoint(){var t;const e=(t=this.vertexFeature_)==null?void 0:t.getGeometry().getCoordinates();return e?sr(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(i=>i.getType()==="Circle"||i.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(mt([e])).some(({segment:i})=>Et(i[0],e)||Et(i[1],e))}removePoint(e){if(e&&(e=je(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=he.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([r])=>r));const i=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new ld(od.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,i}return!1}removeVertex_(){const e=this.dragSegments_,t={};let i=!1,r,s,o,a,l,c,h,u,d,g,f;for(l=e.length-1;l>=0;--l)o=e[l],g=o[0],f=Y(g.feature),g.depth&&(f+="-"+g.depth.join("-")),f in t||(t[f]={}),o[1]===0?(t[f].right=g,t[f].index=g.index):o[1]==1&&(t[f].left=g,t[f].index=g.index+1);for(f in t){switch(d=t[f].right,h=t[f].left,c=t[f].index,u=c-1,h!==void 0?g=h:g=d,u<0&&(u=0),a=g.geometry,s=a.getCoordinates(),r=s,i=!1,a.getType()){case"MultiLineString":s[g.depth[0]].length>2&&(s[g.depth[0]].splice(c,1),i=!0);break;case"LineString":s.length>2&&(s.splice(c,1),i=!0);break;case"MultiPolygon":r=r[g.depth[1]];case"Polygon":r=r[g.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),i=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1));break}if(i){this.setGeometryCoordinates_(a,s);const p=[];if(h!==void 0&&(this.rBush_.remove(h),p.push(h.segment[0])),d!==void 0&&(this.rBush_.remove(d),p.push(d.segment[1])),h!==void 0&&d!==void 0){const A={depth:g.depth,feature:g.feature,geometry:g.geometry,index:u,segment:p};this.rBush_.insert(mt(A.segment),A)}this.updateSegmentIndices_(a,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return i}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(i=>i.getType()==="Circle"||i.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(mt([e])).some(({segment:i})=>!(Et(i[0],e)||Et(i[1],e)))}insertPoint(e){var r;const t=e?je(e,this.getMap().getView().getProjection()):(r=this.vertexFeature_)==null?void 0:r.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((s,o)=>s||this.insertVertex_(o,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,i,r){this.rBush_.forEachInExtent(e.getExtent(),function(s){s.geometry===e&&(i===void 0||s.depth===void 0||Bi(s.depth,i))&&s.index>t&&(s.index+=r)})}}function BC(n,e){return n.index-e.index}function ZA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"){let s=i;if(e.index===Xo){const o=Kr(s.getCenter(),je(n)),a=Math.sqrt(o)-s.getRadius();return a*a}}const r=je(n);return Is[0]=je(e.segment[0]),Is[1]=je(e.segment[1]),gy(r,Is)}function qA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"&&e.index===Xo)return sr(i.getClosestPoint(je(n)));const r=je(n);return Is[0]=je(e.segment[0]),Is[1]=je(e.segment[1]),sr(dc(r,Is))}function NC(){const n=cg();return function(e,t){return n.Point}}const QA=new Vt({color:"rgba(255,255,255,0.4)"}),JA=new ti({color:"#3399CC",width:1.25}),$A=[new rt({image:new pr({fill:QA,stroke:JA,radius:5}),fill:QA,stroke:JA})],zC=`
112
+ <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="%23dc4b6f" viewBox="0 0 24 24">
113
+ <path fill-rule="evenodd" d="M11.906 1.994a8.002 8.002 0 0 1 8.09 8.421 7.996 7.996 0 0 1-1.297 3.957.996.996 0 0 1-.133.204l-.108.129c-.178.243-.37.477-.573.699l-5.112 6.224a1 1 0 0 1-1.545 0L5.982 15.26l-.002-.002a18.146 18.146 0 0 1-.309-.38l-.133-.163a.999.999 0 0 1-.13-.202 7.995 7.995 0 0 1 6.498-12.518ZM15 9.997a3 3 0 1 1-5.999 0 3 3 0 0 1 5.999 0Z" clip-rule="evenodd" />
114
+ </svg>
115
+ `,jC=new rt({image:new Ar({opacity:1,src:"data:image/svg+xml;utf8,"+zC,anchor:[.5,1]})});class UC extends En{constructor(t){super();ae(this,_i);ae(this,Pr,null);ae(this,ni,null);ae(this,yi,null);ae(this,Di);ae(this,jn,null);ae(this,Mr,new Set);Gt(this,"drawInteraction");Gt(this,"modifyInteraction");ae(this,Ji,null);ae(this,$i,!1);ae(this,en,null);pe(this,Pr,t.yioMap)}getEditLayer(){return M(this,ni)}clearModifiedFeatures(){const t=M(this,ni).getSource(),i=t.getFeatures().filter(r=>r.get("id")!==void 0);t.removeFeatures(i),M(this,Mr).clear()}clearCreatedFeatures(){const t=M(this,ni).getSource(),i=t.getFeatures().filter(r=>r.get("id")===void 0);t.removeFeatures(i)}async setActive(t){var r;if(t===this.getActive())return;const i=this.getMap();if(i){if(t){const s=await M(this,Pr)._getContentLayerPromise();if(!LA(s,"edits").length){console.warn('No edits source found in content layer. Please add a source with key "edits" and at least one layer that uses it.');const a=s.get("mapbox-style");a.sources.edits={type:"geojson",data:{type:"FeatureCollection",features:[]}};for(const l of a.layers)((r=a.sources[l.source])==null?void 0:r.type)!=="vector"&&(l.type!=="circle"||l.type!=="symbol")||await cC(s,{id:"edits-"+l.id,source:"edits","source-layer":l["source-layer"],type:"circle",paint:{"circle-radius":5,"circle-color":"#ff0000","circle-stroke-width":1}})}pe(this,ni,LA(s,"edits")[0]),pe(this,yi,M(this,Pr)._getContentLayer().getLayers().getArray().filter(a=>a instanceof Sr).pop()),M(this,Ji)||(pe(this,Ji,M(this,yi).getStyle()),M(this,yi).setStyle((a,l)=>{if(!M(this,Mr).has(a.get("id")))return M(this,Ji).call(this,a,l)})),M(this,en)||(pe(this,en,a=>{if(!this.modifyEnabled)return i.getTargetElement().style.cursor="",pe(this,$i,!1),null;pe(this,$i,!!le(this,_i,ud).call(this,a.pixel)),M(this,$i)?i.getTargetElement().classList.add("cursor-move"):i.getTargetElement().classList.remove("cursor-move")}),i.on("pointermove",M(this,en))),le(this,_i,lm).call(this)}else M(this,Ji)&&(M(this,yi).setStyle(M(this,Ji)),pe(this,Ji,null)),pe(this,Di,null),M(this,en)&&(i.un("pointermove",M(this,en)),pe(this,en,null)),le(this,_i,cm).call(this);super.setActive(t)}}get createEnabled(){return!!M(this,Di)}async setCreateEnabled(t){pe(this,Di,t||void 0),t||(this.clearCreatedFeatures(),M(this,yi).getSource().refresh()),await this.setActive(!!t||!!M(this,jn)),this.drawInteraction&&this.drawInteraction.setMap(t?this.getMap():null),this.modifyInteraction&&this.modifyInteraction.setMap(t||M(this,jn)?this.getMap():null)}get modifyEnabled(){return!!M(this,jn)||!!M(this,Di)}async setModifyEnabled(t){t&&t.length===0&&(t=null),t||(this.clearModifiedFeatures(),M(this,yi).getSource().refresh()),pe(this,jn,t),await this.setActive(!!t||!!M(this,Di)),this.modifyInteraction&&this.modifyInteraction.setMap(t||M(this,Di)?this.getMap():null)}handleEvent(t){let i=!0;if(t.type==="pointerdown"){const r=le(this,_i,ud).call(this,t.pixel);if(r&&r instanceof ht&&this.modifyEnabled){const s=r.get("id");M(this,Mr).has(s)||M(this,Mr).add(s),M(this,yi).changed();const o=bg(r);M(this,ni).getSource().addFeature(o)}}return i&&this.modifyEnabled&&(i=this.modifyInteraction.handleEvent(t)),i&&this.createEnabled&&(i=this.drawInteraction.handleEvent(t)),i&&t.type==="click"&&le(this,_i,am).call(this,t),i}}Pr=new WeakMap,ni=new WeakMap,yi=new WeakMap,Di=new WeakMap,jn=new WeakMap,Mr=new WeakMap,_i=new WeakSet,am=function(t){M(this,Pr)._handleClick(t.originalEvent)},Ji=new WeakMap,$i=new WeakMap,lm=function(){this.drawInteraction=new kC({source:M(this,ni).getSource(),condition:t=>Ra(t)?this.createEnabled&&!M(this,$i):!1,type:"Point",style:()=>M(this,$i)?null:$A}),this.getMap().addInteraction(this.drawInteraction),this.drawInteraction.on("drawend",t=>{t.feature.set("mvt:layer",M(this,Di))}),this.modifyInteraction=new GC({source:M(this,ni).getSource(),condition:t=>nh(t)?this.modifyEnabled:!1,style:()=>M(this,$i)?null:$A}),this.getMap().addInteraction(this.modifyInteraction)},cm=function(){this.drawInteraction&&(this.drawInteraction.setMap(null),this.drawInteraction=null),this.modifyInteraction&&(this.modifyInteraction.setMap(null),this.modifyInteraction=null)},en=new WeakMap,ud=function(t){const r=this.getMap().getFeaturesAtPixel(t,{layerFilter:s=>s===M(this,ni)||s==M(this,yi)}).filter(s=>{var o;return s.getGeometry().getType()==="Point"&&(M(this,ni).getSource().hasFeature(s)||((o=M(this,jn))==null?void 0:o.includes(s.get("id"))))});return r.length?r[0]:null};class VC extends En{constructor(t){super();ae(this,Lr);ae(this,Ms,null);ae(this,Fr,new Dn({source:new Mn}));pe(this,Ms,t.yioMap),this.setActive(!1)}setMap(t){const i=this.getMap();i&&i.removeLayer(M(this,Fr)),t&&(t.addLayer(M(this,Fr)),super.setMap(t))}setActive(t){t||M(this,Fr).getSource().clear(),super.setActive(t)}setPin(t){le(this,Lr,dd).call(this,t)}handleEvent(t){return t.type==="click"&&le(this,Lr,hm).call(this,t),!0}}Ms=new WeakMap,Fr=new WeakMap,Lr=new WeakSet,dd=function(t){const i=M(this,Fr).getSource();i.clear();const r=new Wt(new It(t));r.setStyle(jC),i.addFeature(r),M(this,Ms).dispatchEvent(new CustomEvent("pin",{composed:!0,bubbles:!0,detail:{coordinate:$s(t)}}))},hm=function(t){const i=this.getMap(),r=M(this,Ms)._getContentLayer();i.getFeaturesAtPixel(t.pixel,{layerFilter:o=>r.getLayers().getArray().includes(o)}).length===0&&le(this,Lr,dd).call(this,t.coordinate)};const WC="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20256%20256'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cg%20id='favicon'%3e%3crect%20x='0'%20y='0'%20width='256'%20height='256'%20style='fill:none;'/%3e%3cg%3e%3cpath%20d='M54.77,244.669C59.16,246.864%2071.078,250.001%2083.623,250.001C125.022,250.001%20142.585,223.029%20152.621,191.98L212.21,6L163.284,6L146.662,66.216C140.076,90.051%20135.999,112.005%20133.49,128L132.235,128C130.04,112.946%20123.14,86.288%20116.554,66.216L96.796,6L43.793,6L110.282,182.571C108.713,200.448%2098.677,210.17%2081.742,210.17C73.901,210.17%2067.315,208.288%2062.61,205.779L54.77,244.669Z'%20style='fill:rgb(223,72,110);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Kl=document.createElement("img");Kl.src=WC,Kl.alt="yio.at",Kl.style.height="1em";const HC=new Of({label:Kl,render:function(n){const e=this.element;if(!e||!n.frameState)return;const t=this.collectSourceAttributions_(n.frameState)??[],i=[];i.push(`
116
+ <a href="https://yio.at" target="_blank" rel="noopener">
117
+ <b>yio gmbh</b>
118
+ </a>
119
+ `);for(const o of t)i.push(o);const r=i.map((o,a)=>a===0?`<li>${o}</li>`:`<li><span style="margin: 0 4px 0 2px;">|</span>${o}</li>`).join("");let s=e.querySelector("ul");s||(s=document.createElement("ul"),e.appendChild(s)),s.innerHTML=r}}),XC=".address-search{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px}.search-container{position:relative;width:100%;flex-direction:column;display:flex}.search-input-wrapper{display:flex;align-items:center;background:#fff;border:1px solid #ccc;border-radius:4px;padding:0 10px}.search-icon{width:16px;height:16px;margin-right:8px;fill:#666;flex-shrink:0}.search-input{flex:1;border:none;outline:none;padding:10px 0;font-size:14px;background:transparent}.search-input::placeholder{color:#999}.loading-indicator{width:16px;height:16px;border:2px solid #e0e0e0;border-top-color:#666;border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.results-dropdown{display:none;margin-top:4px;background:#fff;border:1px solid #ccc;border-radius:4px}.search-container:focus-within .results-dropdown{display:block}.results-list{list-style:none;margin:0;padding:0;overflow-y:auto;max-height:300px}@container (width >= 10px){.results-list{max-height:70cqh}}.result-item{display:flex;align-items:stretch;padding:10px 12px;cursor:pointer;border-bottom:1px solid #eee;transition:background-color .15s}.result-item:last-child{border-bottom:none}.result-item:hover{background-color:#f5f5f5}.result-icon{width:20px;height:20px;margin-right:10px;flex-shrink:0;fill:#666}.result-icon.special{fill:#df486e}.result-content{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}.result-title{font-weight:500;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-subtitle{font-size:12px;color:#666;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-distance{font-size:12px;color:#999;margin-left:8px;flex-shrink:0;white-space:nowrap}.results-footer{padding:8px 12px;border-top:1px solid #eee;background:#fafafa;font-size:12px;color:#666}.prefer-close-label{display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.prefer-close-label input{margin-right:6px;margin-left:0}.no-results{padding:16px 12px;text-align:center;color:#666}.no-results.error{color:#c62828}.result-count-input{width:28px;padding:1px 2px;border:1px solid #ccc;border-radius:3px;font-size:12px;text-align:center;-moz-appearance:textfield}.result-count-input::-webkit-inner-spin-button,.result-count-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}",em="https://srv.doris.at/solr/searchservice/search/all2",tm=250;class cd extends Ur{constructor(){super();ae(this,de);ae(this,Yo,null);ae(this,Fs,null);this.placeholder="Search Address...",this.resultCount=10,this.sortByDistance=!1,this.minSearchLength=3,this.mapCenter=null,this._query="",this._results=[],this._loading=!1,this._showResults=!1,this._error=null,this._totalResults=0}render(){return Bt`
120
+ <div class="address-search">
121
+ <div class="search-container" tabindex="1">
122
+ <div class="search-input-wrapper">
123
+ ${le(this,de,_m).call(this)}
124
+ <input
125
+ type="text"
126
+ class="search-input"
127
+ .placeholder=${this.placeholder}
128
+ .value=${this._query}
129
+ @input=${le(this,de,um)}
130
+ />
131
+ ${this._loading?Bt`<div class="loading-indicator"></div>`:null}
132
+ </div>
133
+ ${le(this,de,vm).call(this)}
134
+ </div>
135
+ </div>
136
+ `}}Yo=new WeakMap,Fs=new WeakMap,de=new WeakSet,fd=function(t,i){clearTimeout(M(this,Yo)),pe(this,Yo,setTimeout(t,i))},um=function(t){this._query=t.target.value,le(this,de,fd).call(this,()=>le(this,de,Ql).call(this),tm)},Ql=async function(){var t;if(this._query.length<this.minSearchLength){this._results=[],this._showResults=!1;return}(t=M(this,Fs))==null||t.abort(),pe(this,Fs,new AbortController),this._loading=!0,this._showResults=!0,this._error=null;try{this._results=await le(this,de,dm).call(this,this._query)}catch(i){i.name!=="AbortError"&&(console.error("Search error:",i),this._results=[],this._error="Search failed. Please try again.")}finally{this._loading=!1}},dm=async function(t){var a;const i=new URLSearchParams({q:t,wt:"json2",rows:String(this.resultCount)});let r=`${em}/?${i}`;if(this.sortByDistance&&this.mapCenter){const[l,c]=this.mapCenter;i.set("pt",`${c},${l}`),r=`${em}/geo/?${i}`}const s=await fetch(r,{signal:M(this,Fs).signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);const o=await s.json();return this._totalResults=((a=o==null?void 0:o.response)==null?void 0:a.numFound)||0,le(this,de,fm).call(this,o)},fm=function(t){var r;return(((r=t==null?void 0:t.response)==null?void 0:r.docs)||[]).map(s=>{s.type;const o=le(this,de,gm).call(this,s);return{type:s.type==="GeonamAT"?"special":"address",title:s.textsuggest,subtitle:s.subtext,distance:s._dist_?le(this,de,pm).call(this,s._dist_):null,coordinates:o,raw:s}})},gm=function(t){if(t.x&&t.y)return[parseFloat(t.x),parseFloat(t.y)];if(Array.isArray(t.geo)){const i=t.geo[0].match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(i)return[parseFloat(i[1]),parseFloat(i[2])]}if(t.geo instanceof String){const i=t.geo.match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(i)return[parseFloat(i[1]),parseFloat(i[2])]}return null},pm=function(t){return t<1e3?`${Math.round(t)} m`:`${(t/1e3).toFixed(1)} km`},Am=function(t){var i;t.coordinates&&((i=document.activeElement)==null||i.blur(),this._query=t.title,this.dispatchEvent(new CustomEvent("select",{detail:{coordinates:t.coordinates,result:t},bubbles:!0,composed:!0})))},mm=function(t){this.sortByDistance=t.target.checked,this._query.length>=this.minSearchLength&&le(this,de,Ql).call(this)},ym=function(t){const i=parseInt(t.target.value,10);!i||i<1||(this.resultCount=Math.min(i,100),le(this,de,fd).call(this,()=>{this._query.length>=this.minSearchLength&&le(this,de,Ql).call(this)},tm))},_m=function(){return Bt`
137
+ <svg
138
+ class="search-icon"
139
+ viewBox="0 0 24 24"
140
+ xmlns="http://www.w3.org/2000/svg"
141
+ >
142
+ <path
143
+ d="M10 3a7 7 0 1 0 4.9 12l4.35 4.35a1 1 0 0 0 1.4-1.4L16.35 13.6A7 7 0 0 0 10 3Zm0 2a5 5 0 1 1 0 10 5 5 0 0 1 0-10Z"
144
+ />
145
+ </svg>
146
+ `},xm=function(){return Bt`
147
+ <svg
148
+ class="result-icon"
149
+ viewBox="0 0 24 24"
150
+ xmlns="http://www.w3.org/2000/svg"
151
+ >
152
+ <path
153
+ d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7Zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5Z"
154
+ />
155
+ </svg>
156
+ `},Em=function(){return Bt`
157
+ <svg
158
+ class="result-icon special"
159
+ viewBox="0 0 24 24"
160
+ xmlns="http://www.w3.org/2000/svg"
161
+ >
162
+ <path
163
+ d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17l-6.2 4.3 2.4-7.4L2 9.4h7.6L12 2Z"
164
+ />
165
+ </svg>
166
+ `},wm=function(){return Bt`
167
+ <div class="results-footer">
168
+ <span class="result-count-display">
169
+ Showing
170
+ <input
171
+ type="number"
172
+ class="result-count-input"
173
+ .value=${String(this.resultCount)}
174
+ @input=${le(this,de,ym)}
175
+ min="1"
176
+ max="100"
177
+ />
178
+ of ${this._totalResults} results
179
+ </span>
180
+ <label class="prefer-close-label">
181
+ <input
182
+ type="checkbox"
183
+ .checked=${this.sortByDistance}
184
+ @change=${le(this,de,mm)}
185
+ />
186
+ Prefer nearby
187
+ </label>
188
+ </div>
189
+ `},vm=function(){return this._showResults?Bt`
190
+ <div class="results-dropdown">
191
+ <ul class="results-list">
192
+ ${this._error?Bt`<div class="no-results error">${this._error}</div>`:null}
193
+ ${this._results.length===0&&!this._error?Bt`<div class="no-results">No results</div>`:null}
194
+ ${this._results.map(t=>Bt`
195
+ <li
196
+ class="result-item"
197
+ @click=${()=>le(this,de,Am).call(this,t)}
198
+ >
199
+ ${t.type==="special"?le(this,de,Em).call(this):le(this,de,xm).call(this)}
200
+ <div class="result-content">
201
+ <div class="result-title">${t.title}</div>
202
+ ${t.subtitle?Bt`<div class="result-subtitle">
203
+ ${t.subtitle}
204
+ </div>`:null}
205
+ </div>
206
+ ${t.distance?Bt`<span class="result-distance"
207
+ >${t.distance}</span
208
+ >`:null}
209
+ </li>
210
+ `)}
211
+ </ul>
212
+ ${le(this,de,wm).call(this)}
213
+ </div>
214
+ `:null},Gt(cd,"styles",[Qo(XC),yd`
215
+ :host {
216
+ display: block;
217
+ }
218
+ `]),Gt(cd,"properties",{placeholder:{type:String},resultCount:{type:Number},sortByDistance:{type:Boolean},minSearchLength:{type:Number},mapCenter:{type:Array},_query:{state:!0},_results:{state:!0},_loading:{state:!0},_showResults:{state:!0},_error:{state:!0},_totalResults:{state:!0}}),customElements.define("yio-address-search",cd);class YC extends so{constructor(t={}){const i=document.createElement("yio-address-search");i.className="ol-address-search ol-unselectable ol-control";super({element:i,target:t.target});Gt(this,"searchElement");this.searchElement=i,t.onSelect&&i.addEventListener("select",t.onSelect)}setMap(t){if(super.setMap(t),t){const i=t.getView(),r=i.getCenter();r&&(this.searchElement.mapCenter=$s(r)),i.on("change:center",()=>{this.searchElement.mapCenter=i.getCenter()})}}}class Zl extends Ur{constructor(){super();ae(this,Ct);Gt(this,"notifyNextChange",!1);ae(this,st,null);ae(this,Ko,"");ae(this,kr,new Si);ae(this,tn,null);ae(this,Dr,null);ae(this,Un,null);ae(this,ri,null);ae(this,Zo,null);ae(this,qo,null);ae(this,Or,!1);ae(this,Gr,!1);ae(this,Vn,null);ae(this,Wn,null);ae(this,Br,!1);ae(this,nn,null);ae(this,ql,t=>{const{coordinates:i}=t.detail,r=$s(i);i&&(this.center=r,this.zoom=18),this.enablePinning&&this.setPin(r)});this.center=[0,0],this.zoom=2,this.userSelect=[],pe(this,tn,new UC({yioMap:this})),pe(this,Dr,new LC({yioMap:this})),pe(this,Un,new VC({yioMap:this}))}_getContentLayer(){return M(this,kr)}_getContentLayerPromise(){return M(this,ri)}_handleClick(t){t instanceof PointerEvent&&(this.lastClickCoordinate=$s(M(this,st).getEventCoordinate(t))),this.dispatchEvent(new PointerEvent("click",t))}get contentMap(){return M(this,Ko)}set contentMap(t){pe(this,Ko,t),le(this,Ct,Cm).call(this)}get editCreate(){return M(this,Zo)}set editCreate(t){pe(this,Zo,t),M(this,tn).setCreateEnabled(t)}set editModify(t){pe(this,qo,t),M(this,tn).setModifyEnabled(t)}get editModify(){return M(this,qo)}get enableSelect(){return M(this,Or)}set enableSelect(t){pe(this,Or,t),M(this,Dr).setActive(!!M(this,Or))}get enablePinning(){return M(this,Gr)}set enablePinning(t){pe(this,Gr,t),M(this,Un).setActive(!!M(this,Gr))}get geojsonSources(){return M(this,Vn)}set geojsonSources(t){pe(this,Vn,t)}get sourceLayerVisibility(){return M(this,Wn)}set sourceLayerVisibility(t){pe(this,Wn,t)}get enableSearch(){return M(this,Br)}set enableSearch(t){pe(this,Br,t),le(this,Ct,Ad).call(this)}get editFeatures(){var r,s;const t=(s=(r=M(this,tn).getEditLayer())==null?void 0:r.getSource())==null?void 0:s.getFeatures();return t?new Fh().writeFeaturesObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}):null}firstUpdated(t){super.firstUpdated(t),le(this,Ct,bm).call(this);const i=this.shadowRoot.querySelector(".map");this.shadowRoot.addEventListener("click",r=>r.stopPropagation()),M(this,st).setTarget(i)}updated(t){super.updated(t),t.has("sourceLayerVisibility")&&!t.has("contentMap")&&M(this,ri)&&le(this,Ct,pd).call(this),t.has("geojsonSources")&&!t.has("contentMap")&&M(this,ri)&&le(this,Ct,gd).call(this),!this.notifyNextChange&&(t.has("center")||t.has("zoom"))&&M(this,st).getView().animate({center:Js(this.center),zoom:this.zoom,duration:500}),this.notifyNextChange&&(this.notifyNextChange=!1,this.dispatchEvent(new CustomEvent("change",{composed:!0,bubbles:!0,detail:{changedProperties:t}})))}setPin(t){M(this,Un).setPin(Js(t))}render(){return Bt`<div class="map"></div>`}}return st=new WeakMap,Ko=new WeakMap,kr=new WeakMap,tn=new WeakMap,Dr=new WeakMap,Un=new WeakMap,ri=new WeakMap,Zo=new WeakMap,qo=new WeakMap,Or=new WeakMap,Gr=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,Br=new WeakMap,nn=new WeakMap,Ct=new WeakSet,Cm=async function(){await M(this,ri),M(this,kr).getLayers().clear(),pe(this,ri,null),this.contentMap&&(pe(this,ri,FA(M(this,kr),this.contentMap).catch(t=>{console.error("Error applying content to yiomap:",t)})),await M(this,ri),await le(this,Ct,pd).call(this),await le(this,Ct,gd).call(this))},gd=async function(){if(!M(this,Vn))return;const t=await M(this,ri);if(!t)return;const i=Object.keys(M(this,Vn));try{await Promise.all(i.map(r=>{const s=M(this,Vn)[r];if(!kA(t,r))throw new Error("Geojson source '"+r+"' does not exist.");return uC(t,r,{type:"geojson",data:s})}))}catch(r){console.error("Error updating GeoJSON sources:",r)}},pd=async function(){if(!M(this,Wn))return;const t=await M(this,ri);if(!t)return;const i=t.get("mapbox-style"),r=Object.keys(i.layers);try{await Promise.all(r.map(s=>{const o=i.layers[s],a=o["source-layer"];if(!a||!(a in M(this,Wn)))return;const l=M(this,Wn)[a]?"visible":"none";hC(t,{...o,layout:{...o.layout,visibility:l}})}))}catch(s){console.error("Error updating source layer visibility:",s)}},bm=function(){pe(this,st,new To({controls:Gf({attribution:!1})})),M(this,st).addControl(HC),M(this,st).addControl(new FC({map:M(this,st)})),le(this,Ct,Ad).call(this),M(this,st).addLayer(M(this,kr)),M(this,st).addInteraction(M(this,Dr)),M(this,Dr).setActive(M(this,Or)),M(this,st).addInteraction(M(this,Un)),M(this,Un).setActive(M(this,Gr)),M(this,st).addInteraction(M(this,tn)),M(this,tn).setActive(!!this.editCreate||!!this.editModify);let t=!0;M(this,st).on("moveend",()=>{if(t){t=!1;return}const i=M(this,st).getView();this.notifyNextChange=!0,this.center=$s(i.getCenter()),this.zoom=i.getZoom()})},ql=new WeakMap,Ad=function(){M(this,st)&&(M(this,Br)&&!M(this,nn)?(pe(this,nn,new YC({onSelect:M(this,ql)})),M(this,st).addControl(M(this,nn))):!M(this,Br)&&M(this,nn)&&(M(this,st).removeControl(M(this,nn)),pe(this,nn,null)))},Gt(Zl,"styles",[Qo(Wm),Qo(Hm),yd`
219
+ :host {
220
+ display: block;
221
+ height: 200px;
222
+ container-type: size;
223
+ }
224
+
225
+ .map {
226
+ width: 100%;
227
+ height: 100%;
228
+ }
229
+
230
+ .cursor-pointer {
231
+ cursor: pointer;
232
+ }
233
+
234
+ .cursor-move {
235
+ cursor: move;
236
+ }
237
+
238
+ .cursor-pointer.cursor-move {
239
+ cursor: grab;
240
+ }
241
+
242
+ .ol-address-search {
243
+ top: 0.5em;
244
+ left: 2.5em;
245
+ max-height: 50%;
246
+ max-width: 300px;
247
+ background-color: transparent;
248
+ }
249
+ `]),Gt(Zl,"properties",{center:{type:Array,reflect:!0},zoom:{type:Number,reflect:!0},contentMap:{type:String},editCreate:{type:String},editModify:{type:Array},enablePinning:{type:Boolean},enableSelect:{type:Boolean},enableSearch:{type:Boolean},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}}),window.customElements.define("yio-map",Zl),Zl})();