yio-map 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/YioMap.d.ts.map +1 -1
- package/dist/controls/AddressSearch.d.ts.map +1 -1
- package/dist/controls/AddressSearchControl.d.ts +3 -1
- package/dist/controls/AddressSearchControl.d.ts.map +1 -1
- package/dist/controls/LayerControl.d.ts +1 -0
- package/dist/controls/LayerControl.d.ts.map +1 -1
- package/dist/controls/UserEditInteraction.d.ts +11 -3
- package/dist/controls/UserEditInteraction.d.ts.map +1 -1
- package/dist/controls/UserPinInteraction.d.ts.map +1 -1
- package/dist/controls/UserSelectInteraction.d.ts.map +1 -1
- package/dist/controls/YioAttribution.d.ts +6 -1
- package/dist/controls/YioAttribution.d.ts.map +1 -1
- package/dist/yio-map.iife.js +48 -48
- package/dist/yio-map.js +253 -162
- package/dist/yio-map.umd.cjs +48 -48
- package/package.json +24 -23
- package/dist/tiles/14/8901/5667.pbf +0 -0
- package/dist/tiles/14/8902/5667.pbf +0 -0
package/dist/yio-map.iife.js
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,h=globalThis,g=h.trustedTypes,_=g?g.emptyScript:``,v=h.reactiveElementPolyfillSupport,y=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?_:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},x=(e,t)=>!l(e,t),S={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol(`metadata`),h.litPropertyMetadata??=new WeakMap;var C=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=S){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){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??S}static _$Ei(){if(this.hasOwnProperty(y(`elementProperties`)))return;let e=m(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n: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(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?b:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?b:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??x)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),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.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};C.elementStyles=[],C.shadowRootOptions={mode:`open`},C[y(`elementProperties`)]=new Map,C[y(`finalized`)]=new Map,v?.({ReactiveElement:C}),(h.reactiveElementVersions??=[]).push(`2.1.2`);var w=globalThis,T=e=>e,E=w.trustedTypes,D=E?E.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,O=`$lit$`,k=`lit$${Math.random().toFixed(9).slice(2)}$`,A=`?`+k,ee=`<${A}>`,j=document,
|
|
2
|
-
\f\r]`,oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,se=/-->/g,ce=/>/g,le=RegExp(`>|${ae}(?:([^\\s"'>=/]+)(${ae}*=${ae}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ue=/'/g,de=/"/g,fe=/^(?:script|style|textarea|title)$/i,pe=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),me=Symbol.for(`lit-noChange`),he=Symbol.for(`lit-nothing`),ge=new WeakMap,_e=j.createTreeWalker(j,129);function ve(e,t){if(!re(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return D===void 0?t:D.createHTML(t)}var ye=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=oe;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===oe?c[1]===`!--`?o=se:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=le):(fe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=le):o=ce:o===le?c[0]===`>`?(o=i??oe,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?le:c[3]===`"`?de:ue):o===de||o===ue?o=le:o===se||o===ce?o=oe:(o=le,i=void 0);let d=o===le&&e[t+1].startsWith(`/>`)?` `:``;a+=o===oe?n+ee:l>=0?(r.push(s),n.slice(0,l)+O+n.slice(l)+k+d):n+k+(l===-2?t:d)}return[ve(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},be=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=ye(t,n);if(this.el=e.createElement(l,r),_e.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=_e.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(O)){let t=u[o++],n=i.getAttribute(e).split(k),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Te:r[1]===`?`?Ee:r[1]===`@`?De:we}),i.removeAttribute(e)}else e.startsWith(k)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(fe.test(i.tagName)){let e=i.textContent.split(k),t=e.length-1;if(t>0){i.textContent=E?E.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],te()),_e.nextNode(),c.push({type:2,index:++a});i.append(e[t],te())}}}else if(i.nodeType===8)if(i.data===A)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(k,e+1))!==-1;)c.push({type:7,index:a}),e+=k.length-1}a++}}static createElement(e,t){let n=j.createElement(`template`);return n.innerHTML=e,n}};function xe(e,t,n=e,r){if(t===me)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ne(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=xe(e,i._$AS(e,t.values),i,r)),t}var Se=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){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);_e.currentNode=r;let i=_e.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Ce(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Oe(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=_e.nextNode(),a++)}return _e.currentNode=j,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Ce=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=he,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=xe(this,e,t),ne(e)?e===he||e==null||e===``?(this._$AH!==he&&this._$AR(),this._$AH=he):e!==this._$AH&&e!==me&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ie(e)?this.k(e):this._(e):this.T(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!==he&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=be.createElement(ve(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Se(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=ge.get(e.strings);return t===void 0&&ge.set(e.strings,t=new be(e)),t}k(t){re(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(te()),this.O(te()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=T(e).nextSibling;T(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},we=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=he,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=he}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=xe(this,e,t,0),a=!ne(e)||e!==this._$AH&&e!==me,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=xe(this,r[n+o],t,o),s===me&&(s=this._$AH[o]),a||=!ne(s)||s!==this._$AH[o],s===he?e=he:e!==he&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===he?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Te=class extends we{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===he?void 0:e}},Ee=class extends we{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==he)}},De=class extends we{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=xe(this,e,t,0)??he)===me)return;let n=this._$AH,r=e===he&&n!==he||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==he&&(n===he||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Oe=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){xe(this,e)}},ke=w.litHtmlPolyfillSupport;ke?.(be,Ce),(w.litHtmlVersions??=[]).push(`3.3.2`);var Ae=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Ce(t.insertBefore(te(),e),e,void 0,n??{})}return i._$AI(e),i},je=globalThis,Me=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ae(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return me}};Me._$litElement$=!0,Me.finalized=!0,je.litElementHydrateSupport?.({LitElement:Me});var Ne=je.litElementPolyfillSupport;Ne?.({LitElement:Me}),(je.litElementVersions??=[]).push(`4.2.2`);var Pe=`:root,:host{--ol-background-color:white;--ol-accent-background-color:#f5f5f5;--ol-subtle-background-color:#80808040;--ol-partial-background-color:#ffffffbf;--ol-foreground-color:#333;--ol-subtle-foreground-color:#666;--ol-brand-color:#0af}.ol-box{box-sizing:border-box;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color);border-radius:2px}.ol-mouse-position{position:absolute;top:8px;right:8px}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;padding:2px;position:absolute;bottom:8px;left:8px}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-align:center;will-change:contents, width;border-top:none;margin:1px;font-size:10px;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{background-color:var(--ol-foreground-color);float:right;z-index:10;width:1px;height:15px}.ol-scale-step-text{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);font-size:10px;position:absolute;bottom:-5px}.ol-scale-text{text-align:center;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);font-size:12px;position:absolute;bottom:25px}.ol-scale-singlebar{z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color);height:10px;position:relative}.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;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;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{background-color:var(--ol-subtle-background-color);border-radius:4px;position:absolute}.ol-zoom{top:.5em;left:.5em}.ol-rotate{transition:opacity .25s linear,visibility linear;top:.5em;right:.5em}.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{top:.5em;right:.5em}.ol-control button{color:var(--ol-subtle-foreground-color);font-weight:700;font-size:inherit;text-align:center;background-color:var(--ol-background-color);border:none;border-radius:2px;width:1.375em;height:1.375em;margin:1px;padding:0;line-height:.4em;text-decoration:none;display:block}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{will-change:transform;font-weight:400;display:block}.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{outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-decoration:none}.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;flex-flow:row-reverse;align-items:center;max-width:calc(100% - 1.3em);display:flex;bottom:.5em;right:.5em}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);margin:0;padding:1px .5em;font-size:12px}.ol-attribution li{list-style:none;display:inline}.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{border-radius:4px 0 0;bottom:0;right:0}.ol-attribution.ol-uncollapsible img{max-height:1.6em;margin-top:-.2em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{height:200px;top:4.5em;left:.5em}.ol-zoomslider button{height:10px;position:relative}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{bottom:.5em;left:.5em}.ol-overviewmap.ol-uncollapsible{border-radius:0 4px 0 0;bottom:0;left:0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);width:150px;height:150px}.ol-overviewmap:not(.ol-collapsed) button{position:absolute;bottom:0;left:0}.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}`,Fe=`.layer-control{bottom:.5em;left:.5em}.layer-control>button{cursor:pointer;justify-content:center;align-items:center;display:flex}.svgContainer{width:22px;height:22px;scale:.8}.ol-touch .ol-control button>.svgContainer{scale:1.2}.layer-selection{z-index:10;background-color:#fff;border:1px solid #ccc;border-radius:4px;align-items:center;padding:10px 0 10px 10px;display:flex;position:absolute;bottom:0}.layer-selection.fade-out{opacity:0;transition:opacity .15s ease-out}.layer-selection.hidden{display:none}.image-box{cursor:pointer;text-align:center;border:2px solid #bdbdbd;border-radius:4px;width:100px;height:100px;margin-right:10px}.image-box.selected{border:2px solid #474747}.image-box:hover{box-shadow:0 0 6px #949494}.image-box img{pointer-events:none;object-fit:cover;border-radius:4px;width:100px;height:100px}`,Ie={ADD:`add`,REMOVE:`remove`},Le={PROPERTYCHANGE:`propertychange`},M={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},Re=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function ze(e,t,n){let r,i;n||=Be;let a=0,o=e.length,s=!1;for(;a<o;)r=a+(o-a>>1),i=+n(e[r],t),i<0?a=r+1:(o=r,s=!i);return s?a:~a}function Be(e,t){return e>t?1:e<t?-1:0}function Ve(e,t){return e<t?1:e>t?-1:0}function He(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Ue(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function We(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function Ge(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Ke(e,t,n){let r=t||Be;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function qe(){return!0}function Je(){return!1}function Ye(){}function Xe(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return(!n||this!==r||!Ge(i,n))&&(r=this,n=i,t=e.apply(this,arguments)),t}}function Ze(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return t instanceof Promise?t:Promise.resolve(t)}return t()}function Qe(e){for(let t in e)delete e[t]}function $e(e){let t;for(t in e)return!1;return!t}var et=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},tt=class extends Re{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new et(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,Ye);delete a[n]}return s}disposeInternal(){this.listeners_&&Qe(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;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=Ye,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}};function N(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function nt(e,t,n,r){return N(e,t,n,r,!0)}function rt(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Qe(e))}var it=class extends tt{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(M.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=N(this,e[i],t);return r}return N(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=nt(this,e[i],t)}else n=nt(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)at(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};it.prototype.on,it.prototype.once,it.prototype.un;function at(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)rt(e[t]);else rt(e)}function P(){throw Error(`Unimplemented abstract method.`)}var ot=0;function F(e){return e.ol_uid||=String(++ot)}var st=class extends et{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},ct=class extends it{constructor(e){super(),this.on,this.once,this.un,F(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 n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new st(n,e,t)),n=Le.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new st(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],$e(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},lt={LENGTH:`length`},ut=class extends et{constructor(e,t,n){super(e),this.element=t,this.index=n}},dt=class extends ct{constructor(e,t){if(super(),this.on,this.once,this.un,t||={},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let e=1,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(lt.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new ut(Ie.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ut(Ie.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new ut(Ie.REMOVE,n,e)),this.dispatchEvent(new ut(Ie.ADD,t,e))}updateLength_(){this.set(lt.LENGTH,this.array_.length)}assertUnique_(e,t){let n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e&&r!==t)throw Error(`Duplicate item added to a unique collection`)}},ft=class extends et{constructor(e,t,n){super(e),this.map=t,this.frameState=n===void 0?null:n}},pt=class extends ft{constructor(e,t,n,r,i,a){super(e,t,i),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=r===void 0?!1:r,this.activePointers=a}get pixel(){return this.pixel_||=this.map.getEventPixel(this.originalEvent),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return 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()}},I={SINGLECLICK:`singleclick`,CLICK:M.CLICK,DBLCLICK:M.DBLCLICK,POINTERDRAG:`pointerdrag`,POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},mt=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``;mt.includes(`safari`)&&!mt.includes(`chrom`)&&(mt.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(mt));var ht=mt.includes(`webkit`)&&!mt.includes(`edge`),gt=mt.includes(`macintosh`),_t=typeof devicePixelRatio<`u`?devicePixelRatio:1,vt=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,yt=typeof Image<`u`&&Image.prototype.decode,bt=typeof createImageBitmap==`function`,xt=(function(){let e=!1;try{let t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})(),St={POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},Ct=class extends tt{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;let n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=N(n,St.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=N(n,St.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(M.TOUCHMOVE,this.boundHandleTouchMove_,xt?{passive:!1}:!1)}emulateClick_(e){let t=new pt(I.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_===void 0?this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let t=new pt(I.SINGLECLICK,this.map_,e);this.dispatchEvent(t)},250):(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new pt(I.DBLCLICK,this.map_,e),this.dispatchEvent(t))}updateActivePointers_(e){let t=e,n=t.pointerId;if(t.type==I.POINTERUP||t.type==I.POINTERCANCEL){delete this.trackedTouches_[n];for(let e in this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else (t.type==I.POINTERDOWN||t.type==I.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new pt(I.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(rt),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);let t=new pt(I.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){let e=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(e,I.POINTERMOVE,this.handlePointerMove_,this),N(e,I.POINTERUP,this.handlePointerUp_,this),N(this.element_,I.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==e&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),I.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new pt(I.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new pt(I.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let 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_&&=(rt(this.relayedListenerKey_),null),this.element_.removeEventListener(M.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&=(rt(this.pointerdownListenerKey_),null),this.dragListenerKeys_.forEach(rt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},wt={POSTRENDER:`postrender`,MOVESTART:`movestart`,MOVEEND:`moveend`,LOADSTART:`loadstart`,LOADEND:`loadend`},Tt={LAYERGROUP:`layergroup`,SIZE:`size`,TARGET:`target`,VIEW:`view`},L={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function R(e,t){if(!e)throw Error(t)}var Et=1/0,Dt=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Qe(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let r=this.keyFunction_(n);return delete this.queuedElements_[r],n}enqueue(e){R(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let t=this.priorityFunction_(e);return t==1/0?!1:(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}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){let t=this.elements_,n=this.priorities_,r=t.length,i=t[e],a=n[e],o=e;for(;e<r>>1;){let i=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),o=a<r&&n[a]<n[i]?a:i;t[e]=t[o],n[e]=n[o],e=o}t[e]=i,n[e]=a,this.siftDown_(o,e)}siftDown_(e,t){let n=this.elements_,r=this.priorities_,i=n[t],a=r[t];for(;t>e;){let e=this.getParentIndex_(t);if(r[e]>a)n[t]=n[e],r[t]=r[e],t=e;else break}n[t]=i,r[t]=a}reprioritize(){let e=this.priorityFunction_,t=this.elements_,n=this.priorities_,r=0,i=t.length,a,o,s;for(o=0;o<i;++o)a=t[o],s=e(a),s==1/0?delete this.queuedElements_[this.keyFunction_(a)]:(n[r]=s,t[r++]=a);t.length=r,n.length=r,this.heapify_()}},Ot=class extends Dt{constructor(e,t){super(t=>e.apply(null,t),e=>e[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);return t&&e[0].addEventListener(M.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,n=t.getState();if(n===L.LOADED||n===L.ERROR||n===L.EMPTY){n!==L.ERROR&&t.removeEventListener(M.CHANGE,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0;for(;this.tilesLoading_<e&&n<t&&this.getCount()>0;){let e=this.dequeue()[0],t=e.getKey();e.getState()===L.IDLE&&!(t in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[t]=!0,++this.tilesLoading_,++n,e.load())}}};function kt(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return Et;let a=e.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}var At={ANIMATING:0,INTERACTING:1},jt={CENTER:`center`,RESOLUTION:`resolution`,ROTATION:`rotation`};function Mt(e,t,n){return Math.min(Math.max(e,t),n)}function Nt(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return Pt(e,t,n,r)}function Pt(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function Ft(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function It(e){return e*180/Math.PI}function Lt(e){return e*Math.PI/180}function Rt(e,t){let n=e%t;return n*t<0?n+t:n}function zt(e,t,n){return e+n*(t-e)}function Bt(e,t){let n=10**t;return Math.round(e*n)/n}function Vt(e,t){return Math.floor(Bt(e,t))}function Ht(e,t){return Math.ceil(Bt(e,t))}function Ut(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}function Wt(e,t,n){return(function(r,i,a,o,s){if(!r)return;if(!i&&!t)return r;let c=t?0:a[0]*i,l=t?0:a[1]*i,u=s?s[0]:0,d=s?s[1]:0,f=e[0]+c/2+u,p=e[2]-c/2+u,m=e[1]+l/2+d,h=e[3]-l/2+d;f>p&&(f=(p+f)/2,p=f),m>h&&(m=(h+m)/2,h=m);let g=Mt(r[0],f,p),_=Mt(r[1],m,h);if(o&&n&&i){let e=30*i;g+=-e*Math.log(1+Math.max(0,f-r[0])/e)+e*Math.log(1+Math.max(0,r[0]-p)/e),_+=-e*Math.log(1+Math.max(0,m-r[1])/e)+e*Math.log(1+Math.max(0,r[1]-h)/e)}return[g,_]})}function Gt(e){return e}var Kt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function qt(e){let t=nn();for(let n=0,r=e.length;n<r;++n)un(t,e[n]);return t}function Jt(e,t,n){return rn(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}function Yt(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Xt(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function Zt(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function Qt(e,t){return en(e,t[0],t[1])}function $t(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function en(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function tn(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=Kt.UNKNOWN;return o<n?c|=Kt.LEFT:o>i&&(c|=Kt.RIGHT),s<r?c|=Kt.BELOW:s>a&&(c|=Kt.ABOVE),c===Kt.UNKNOWN&&(c=Kt.INTERSECTING),c}function nn(){return[1/0,1/0,-1/0,-1/0]}function rn(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function an(e){return rn(1/0,1/0,-1/0,-1/0,e)}function on(e,t){let n=e[0],r=e[1];return rn(n,r,n,r,t)}function sn(e,t,n,r,i){return dn(an(i),e,t,n,r)}function cn(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function ln(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function un(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function dn(e,t,n,r,i){for(;n<r;n+=i)fn(e,t[n],t[n+1]);return e}function fn(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function pn(e,t){let n;return n=t(hn(e)),n||(n=t(gn(e)),n)||(n=t(wn(e)),n)||(n=t(Cn(e)),n)?n:!1}function mn(e){let t=0;return En(e)||(t=z(e)*xn(e)),t}function hn(e){return[e[0],e[1]]}function gn(e){return[e[2],e[1]]}function _n(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function vn(e,t){let n;if(t===`bottom-left`)n=hn(e);else if(t===`bottom-right`)n=gn(e);else if(t===`top-left`)n=Cn(e);else if(t===`top-right`)n=wn(e);else throw Error(`Invalid corner`);return n}function yn(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=bn(e,t,n,r);return rn(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function bn(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function xn(e){return e[3]-e[1]}function Sn(e,t,n){let r=n||nn();return Tn(e,t)?(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]):an(r),r}function Cn(e){return[e[0],e[3]]}function wn(e){return[e[2],e[3]]}function z(e){return e[2]-e[0]}function Tn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function En(e){return e[2]<e[0]||e[3]<e[1]}function Dn(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function On(e,t,n){let r=!1,i=tn(e,t),a=tn(e,n);if(i===Kt.INTERSECTING||a===Kt.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&Kt.ABOVE&&!(i&Kt.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&Kt.RIGHT&&!(i&Kt.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&Kt.BELOW&&!(i&Kt.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&Kt.LEFT&&!(i&Kt.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function kn(e,t,n,r){if(En(e))return an(n);let i=[];if(r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a<r;++a)i.push(e[0]+t*a/r,e[1],e[2],e[1]+n*a/r,e[2]-t*a/r,e[3],e[0],e[3]-n*a/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let a=[],o=[];for(let e=0,t=i.length;e<t;e+=2)a.push(i[e]),o.push(i[e+1]);return Jt(a,o,n)}function An(e,t){let n=t.getExtent(),r=_n(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=z(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function jn(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];An(e,t);let i=z(r);if(z(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function Mn(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function Nn(e,t){let n=e[0],r=e[1],i=t[0],a=t[1],o=i[0],s=i[1],c=a[0],l=a[1],u=c-o,d=l-s,f=u===0&&d===0?0:(u*(n-o)+d*(r-s))/(u*u+d*d||0),p,m;return f<=0?(p=o,m=s):f>=1?(p=c,m=l):(p=o+f*u,m=s+f*d),[p,m]}function Pn(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Fn(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function In(e,t){return e[0]*=t,e[1]*=t,e}function Ln(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Rn(e,t){return Math.sqrt(Ln(e,t))}function zn(e,t){return Ln(e,Nn(e,t))}function Bn(e,t){if(t.canWrapX()){let n=z(t.getExtent()),r=Vn(e,t,n);r&&(e[0]-=r*n)}return e}function Vn(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n||=z(r),i=Math.floor((e[0]-r[0])/n)),i}function Hn(e){return e**3}function Un(e){return 1-Hn(1-e)}function Wn(e){return 3*e*e-2*e*e*e}function Gn(e){return e}function Kn(e,t,n){n||=6371008.8;let r=Lt(e[1]),i=Lt(t[1]),a=(i-r)/2,o=Lt(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}var qn={info:1,warn:2,error:3,none:4},Jn=qn.info;function Yn(...e){Jn>qn.warn||console.warn(...e)}var Xn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},Zn=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global===void 0?!1:e.global,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_||Xn[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_}},Qn=6378137,$n=Math.PI*Qn,er=[-$n,-$n,$n,$n],tr=[-180,-85,180,85],nr=Qn*Math.log(Math.tan(Math.PI/2)),rr=class extends Zn{constructor(e){super({code:e,units:`m`,extent:er,global:!0,worldExtent:tr,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Qn)}})}},ir=[new rr(`EPSG:3857`),new rr(`EPSG:102100`),new rr(`EPSG:102113`),new rr(`EPSG:900913`),new rr(`http://www.opengis.net/def/crs/EPSG/0/3857`),new rr(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function ar(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=$n*e[n]/180;let r=Qn*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>nr?r=nr:r<-nr&&(r=-nr),t[n+1]=r}return t}function or(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/$n,t[n+1]=360*Math.atan(Math.exp(e[n+1]/Qn))/Math.PI-90;return t}var sr=6378137,cr=[-180,-90,180,90],lr=Math.PI*sr/180,ur=class extends Zn{constructor(e,t){super({code:e,units:`degrees`,extent:cr,axisOrientation:t,global:!0,metersPerUnit:lr,worldExtent:cr})}},dr=[new ur(`CRS:84`),new ur(`EPSG:4326`,`neu`),new ur(`urn:ogc:def:crs:OGC:1.3:CRS84`),new ur(`urn:ogc:def:crs:OGC:2:84`),new ur(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new ur(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new ur(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],fr={};function pr(e){return fr[e]||fr[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function mr(e,t){fr[e]=t}var hr={};function gr(e,t,n){let r=e.getCode(),i=t.getCode();r in hr||(hr[r]={}),hr[r][i]=n}function _r(e,t){return e in hr&&t in hr[e]?hr[e][t]:null}var vr=.9996,yr=.00669438,br=yr*yr,xr=br*yr,Sr=yr/(1-yr),Cr=Math.sqrt(1-yr),wr=(1-Cr)/(1+Cr),Tr=wr*wr,Er=Tr*wr,Dr=Er*wr,Or=Dr*wr,kr=1-yr/4-3*br/64-5*xr/256,Ar=3*yr/8+3*br/32+45*xr/1024,jr=15*br/256+45*xr/1024,Mr=35*xr/3072,Nr=3/2*wr-27/32*Er+269/512*Or,Pr=21/16*Tr-55/32*Dr,Fr=151/96*Er-417/128*Or,Ir=1097/512*Dr,Lr=6378137;function Rr(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/vr/(Lr*kr),a=i+Nr*Math.sin(2*i)+Pr*Math.sin(4*i)+Fr*Math.sin(6*i)+Ir*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-yr*s,p=Lr/Math.sqrt(1-yr*s),m=(1-yr)/f,h=Sr*c**2,g=h*h,_=r/(p*vr),v=_*_,y=v*_,b=y*_,x=b*_,S=x*_,C=a-l/m*(v/2-b/24*(5+3*u+10*h-4*g-9*Sr))+S/720*(61+90*u+298*h+45*d-252*Sr-3*g),w=(_-y/6*(1+2*u+h)+x/120*(5-2*h+28*u-3*g+8*Sr+24*d))/c;return w=Ut(w+Lt(Wr(n.number)),-Math.PI,Math.PI),[It(w),It(C)]}var zr=-80,Br=84,Vr=-180,Hr=180;function Ur(e,t,n){e=Ut(e,Vr,Hr),t<zr?t=zr:t>Br&&(t=Br);let r=Lt(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=Lt(e),u=Lt(Wr(n.number)),d=Lr/Math.sqrt(1-yr*i**2),f=Sr*a**2,p=a*Ut(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=Lr*(kr*r-Ar*Math.sin(2*r)+jr*Math.sin(4*r)-Mr*Math.sin(6*r)),b=vr*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*Sr))+5e5,x=vr*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*Sr)));return n.north||(x+=1e7),[b,x]}function Wr(e){return(e-1)*6-180+3}var Gr=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Kr(e){let t=0;for(let n of Gr){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function qr(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function Jr(e){return Kr(e)?new Zn({code:e,units:`m`}):null}function Yr(e){let t=Kr(e.getCode());return t?{forward:qr(Ur,t),inverse:qr(Rr,t)}:null}var Xr=[Yr],Zr=[Jr],Qr=!0;function $r(e){Qr=!(e===void 0||e)}function ei(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function ti(e){mr(e.getCode(),e),gr(e,e,ei)}function ni(e){e.forEach(ti)}function B(e){if(typeof e!=`string`)return e;let t=pr(e);if(t)return t;for(let t of Zr){let n=t(e);if(n)return n}return null}function ri(e,t,n,r){e=B(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/Xn[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=di(e,B(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(Kn(e.slice(0,2),e.slice(2,4))+Kn(e.slice(4,6),e.slice(6,8)))/2}let s=r?Xn[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function ii(e){ni(e),e.forEach(function(t){e.forEach(function(e){t!==e&&gr(t,e,ei)})})}function ai(e,t,n,r){e.forEach(function(e){t.forEach(function(t){gr(e,t,n),gr(t,e,r)})})}function oi(e,t){return e?typeof e==`string`?B(e):e:B(t)}function si(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function ci(e,t){return $r(),mi(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function li(e,t){let n=mi(e,t===void 0?`EPSG:3857`:t,`EPSG:4326`),r=n[0];return(r<-180||r>180)&&(n[0]=Rt(r+180,360)-180),n}function ui(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||di(e,t)===ei)&&n}function di(e,t){let n=e.getCode(),r=t.getCode(),i=_r(n,r);if(i)return i;let a=null,o=null;for(let n of Xr)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=_r(s,r);e&&(i=fi(a.inverse,e))}else if(a)i=fi(a.inverse,o.forward);else{let e=_r(n,s);e&&(i=fi(e,o.forward))}return i&&(ti(e),ti(t),gr(e,t,i)),i}function fi(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function pi(e,t){return di(B(e),B(t))}function mi(e,t,n){let r=pi(t,n);if(!r){let e=B(t).getCode(),r=B(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function hi(e,t,n,r){return kn(e,pi(t,n),void 0,r)}var gi=null;function _i(){return gi}function vi(e,t){return gi?mi(e,t,gi):e}function yi(e,t){return gi?mi(e,gi,t):(Qr&&!Pn(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Qr=!1,Yn(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e)}function bi(e,t){return gi?hi(e,t,gi):e}function xi(e,t){return gi?hi(e,gi,t):e}function Si(e,t){if(!gi)return e;let n=B(t).getMetersPerUnit(),r=gi.getMetersPerUnit();return n&&r?e*n/r:e}function Ci(){ii(ir),ii(dr),ai(dr,ir,ar,or)}Ci();var wi=[,,,,,,];function Ti(){return[1,0,0,1,0,0]}function Ei(e){return Oi(e,1,0,0,1,0,0)}function Di(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return e[0]=n*c+i*l,e[1]=r*c+a*l,e[2]=n*u+i*d,e[3]=r*u+a*d,e[4]=n*f+i*p+o,e[5]=r*f+a*p+s,e}function Oi(e,t,n,r,i,a,o){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e}function ki(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ai(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function ji(e,t,n){return Di(e,Oi(wi,t,0,0,n,0,0))}function Mi(e,t,n){return Di(e,Oi(wi,1,0,0,1,t,n))}function Ni(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function Pi(e,t){let n=Fi(t);R(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function Fi(e){return e[0]*e[3]-e[1]*e[2]}var Ii=[1e5,1e5,1e5,1e5,2,2];function Li(e){return`matrix(`+e.join(`, `)+`)`}function Ri(e){return e.substring(7,e.length-1).split(`,`).map(parseFloat)}function zi(e,t){let n=Ri(e),r=Ri(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*Ii[e])!==0)return!1;return!0}function Bi(e,t,n,r,i,a,o){a||=[],o||=2;let s=0;for(let c=t;c<n;c+=r){let t=e[c],n=e[c+1];a[s++]=i[0]*t+i[2]*n+i[4],a[s++]=i[1]*t+i[3]*n+i[5];for(let t=2;t<o;t++)a[s++]=e[c+t]}return a&&a.length!=s&&(a.length=s),a}function Vi(e,t,n,r,i,a,o){o||=[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function Hi(e,t,n,r,i,a,o,s){s||=[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function Ui(e,t,n,r,i,a,o){o||=[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}var Wi=Ti(),Gi=[NaN,NaN],Ki=class extends ct{constructor(){super(),this.extent_=nn(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Xe((e,t,n)=>{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return P()}closestPointXY(e,t,n,r){return P()}containsXY(e,t){return this.closestPointXY(e,t,Gi,Number.MIN_VALUE)===0}getClosestPoint(e,t){return 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 P()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&an(e),this.extentRevision_=this.getRevision()}return Dn(this.extent_,e)}rotate(e,t){P()}scale(e,t,n){P()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return P()}getType(){return P()}applyTransform(e){P()}intersectsExtent(e){return P()}translate(e,t){P()}transform(e,t){let n=B(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=xn(o)/xn(a);Ni(Wi,o[0],o[3],s,-s,0,0,0);let c=Bi(e,0,e.length,i,Wi,r),l=pi(n,t);return l?l(c,c,i):c}:pi(n,t);return this.applyTransform(r),this}},qi=class extends Ki{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return sn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return P()}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;let 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=Yi(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){P()}setLayout(e,t,n){let r;if(e)r=Yi(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=Ji(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){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Vi(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||=_n(this.getExtent());let r=this.getFlatCoordinates();if(r){let i=this.getStride();Hi(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Ui(n,0,n.length,r,e,t,n),this.changed()}}};function Ji(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function Yi(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function Xi(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return Bi(r,0,r.length,i,t,n)}function Zi(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1],s=0,c=0;for(;t<n;t+=r){let n=e[t]-a,r=e[t+1]-o;i+=c*n-s*r,s=n,c=r}return i/2}function Qi(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Zi(e,t,o,r),t=o}return i}function $i(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Qi(e,t,o,r),t=o[o.length-1]}return i}function ea(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=zt(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function ta(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=Pt(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function na(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=ta(e,t,o,r,i),t=o}return i}function ra(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=na(e,t,o,r,i),t=o[o.length-1]}return i}function ia(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=Pt(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u||=[NaN,NaN];let p=t+r;for(;p<n;)if(ea(e,p-r,p,r,o,s,u),f=Pt(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(ea(e,n-r,t,r,o,s,u),f=Pt(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}function aa(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=ia(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function oa(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=aa(e,t,f,r,i,a,o,s,c,l,u),t=f[f.length-1]}return l}function sa(e,t,n,r){for(let r=0,i=n.length;r<i;++r)e[t++]=n[r];return t}function ca(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function la(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=ca(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function ua(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=la(e,t,n[o],r,i[a]);s.length===0&&(s[0]=t),i[a++]=s,t=s[s.length-1]}return i.length=a,i}function da(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function fa(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=da(e,t,s,r,i[a]),t=s}return i.length=a,i}function pa(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:fa(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function ma(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=e[t],r=e[t+1],i=Nt(n,r,s,d,f,p);i>o&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function ha(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=ma(e,t,l,r,i,a,o),s.push(o),t=l}return o}function ga(e,t){return t*Math.round(e/t)}function _a(e,t,n,r,i,a,o){if(t==n)return o;let s=ga(e[t],i),c=ga(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=ga(e[t],i),u=ga(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=ga(e[t],i),d=ga(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;if(f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function va(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=_a(e,t,l,r,i,a,o),s.push(o),t=l}return o}function ya(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c],u=[];o=va(e,t,l,r,i,a,o,u),s.push(u),t=l[l.length-1]}return o}var ba=class e extends qi{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 e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return Zi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ca(this.flatCoordinates,0,e,this.stride),this.changed()}},xa=class e extends qi{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=Pt(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return on(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return en(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||=[],this.flatCoordinates.length=sa(this.flatCoordinates,0,e,this.stride),this.changed()}};function Sa(e,t,n,r,i){return!pn(i,function(i){return!Ca(e,t,n,r,i[0],i[1])})}function Ca(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function wa(e,t,n,r,i,a){if(n.length===0||!Ca(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(Ca(e,n[t-1],n[t],r,i,a))return!1;return!0}function Ta(e,t,n,r,i,a){if(n.length===0)return!1;for(let o=0,s=n.length;o<s;++o){let s=n[o];if(wa(e,t,s,r,i,a))return!0;t=s[s.length-1]}return!1}function Ea(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m=i[a+1],h=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(u=e[a-r],f=e[a-r+1],s=t;s<a;s+=r)d=e[s],p=e[s+1],(m<=f&&p<=m||f<=m&&m<=p)&&(l=(m-f)/(p-f)*(d-u)+u,h.push(l)),u=d,f=p}let g=NaN,_=-1/0;for(h.sort(Be),u=h[0],s=1,c=h.length;s<c;++s){d=h[s];let i=Math.abs(d-u);i>_&&(l=(u+d)/2,wa(e,t,n,r,l,m)&&(g=l,_=i)),u=d}return isNaN(g)&&(g=i[a]),o?(o.push(g,m,_),o):[g,m,_]}function Da(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=Ea(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function Oa(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function ka(e,t,n,r,i,a){return a??=dn(nn(),e,t,n,r),Tn(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:Oa(e,t,n,r,function(e,t){return On(i,e,t)}):!1}function Aa(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){if(ka(e,t,n[a],r,i))return!0;t=n[a]}return!1}function ja(e,t,n,r,i){return!!(ka(e,t,n,r,i)||Ca(e,t,n,r,i[0],i[1])||Ca(e,t,n,r,i[0],i[3])||Ca(e,t,n,r,i[2],i[1])||Ca(e,t,n,r,i[2],i[3]))}function Ma(e,t,n,r,i){if(!ja(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(Sa(e,n[t-1],n[t],r,i)&&!ka(e,n[t-1],n[t],r,i))return!1;return!0}function Na(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(Ma(e,t,o,r,i))return!0;t=o[o.length-1]}return!1}function Pa(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function Fa(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function Ia(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=Fa(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function La(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(!Ia(e,t,o,r,i))return!1;o.length&&(t=o[o.length-1])}return!0}function Ra(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=Fa(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&Pa(e,t,o,r),t=o}return t}function za(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=Ra(e,t,n[a],r,i);return t}function Ba(e,t){let n=[],r=0,i=0,a;for(let o=0,s=t.length;o<s;++o){let s=t[o],c=Fa(e,r,s,2);if(a===void 0&&(a=c),c===a)n.push(t.slice(i,o+1));else{if(n.length===0)continue;n[n.length-1].push(t[i])}i=o+1,r=s}return n}var Va=class e extends qi{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?We(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return wa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Qi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),Ra(t,0,this.ends_,this.stride,e)),fa(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=_n(this.getExtent());this.flatInteriorPoint_=Ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new xa(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new ba(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new ba(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;Ia(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Ra(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=va(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return Ma(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=la(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function Ha(e){if(En(e))throw Error(`Cannot create polygon from empty extent`);let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new Va(a,`XY`,[a.length])}function Ua(e,t,n){t||=32;let r=e.getStride(),i=e.getLayout(),a=e.getCenter(),o=r*(t+1),s=Array(o);for(let e=0;e<o;e+=r){s[e]=0,s[e+1]=0;for(let t=2;t<r;t++)s[e+t]=a[t]}let c=new Va(s,i,[s.length]);return Wa(c,a,e.getRadius(),n),c}function Wa(e,t,n,r){let i=e.getFlatCoordinates(),a=e.getStride(),o=i.length/a-1,s=r||0;for(let e=0;e<=o;++e){let r=e*a,c=s+Rt(e,o)*2*Math.PI/o;i[r]=t[0]+n*Math.cos(c),i[r+1]=t[1]+n*Math.sin(c)}e.changed()}function Ga(e,t,n,r){let i=z(t)/n[0],a=xn(t)/n[1];return r?Math.min(e,Math.max(i,a)):Math.min(e,Math.min(i,a))}function Ka(e,t,n){let r=Math.min(e,t);return r*=Math.log(1+50*Math.max(0,e/t-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/e-1))/50+1),Mt(r,n/2,t*2)}function qa(e,t,n,r){return t=t===void 0?!0:t,(function(i,a,o,s){if(i!==void 0){let c=e[0],l=e[e.length-1],u=n?Ga(c,n,o,r):c;if(s)return t?Ka(i,u,l):Mt(i,l,u);let d=Math.floor(He(e,Math.min(u,i),a));return e[d]>u&&d<e.length-1?e[d+1]:e[d]}})}function Ja(e,t,n,r,i,a){return r=r===void 0?!0:r,n=n===void 0?0:n,(function(o,s,c,l){if(o!==void 0){let u=i?Ga(t,i,c,a):t;if(l)return r?Ka(o,u,n):Mt(o,n,u);let d=1e-9,f=Math.ceil(Math.log(t/u)/Math.log(e)-d),p=-s*(.5-d)+.5,m=Math.floor(Math.log(t/Math.min(u,o))/Math.log(e)+p);return Mt(t/e**+Math.max(f,m),n,u)}})}function Ya(e,t,n,r,i){return n=n===void 0?!0:n,(function(a,o,s,c){if(a!==void 0){let o=r?Ga(e,r,s,i):e;return!n||!c?Mt(a,t,o):Ka(a,o,t)}})}function Xa(e){if(e!==void 0)return 0}function Za(e){if(e!==void 0)return e}function Qa(e){let t=2*Math.PI/e;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function $a(e){let t=e===void 0?Lt(5):e;return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}var eo=0,to=class extends ct{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=oi(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&&$r(),e.center&&=yi(e.center,this.projection_),e.extent&&=xi(e.extent,this.projection_),this.applyOptions_(e)}applyOptions_(e){let t=Object.assign({},e);for(let e in jt)delete t[e];this.setProperties(t,!0);let n=io(e);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=n.minZoom,this.constraints_={center:ro(e),resolution:n.constraint,rotation:ao(e)},this.setRotation(e.rotation===void 0?0:e.rotation),this.setCenterInternal(e.center===void 0?null:e.center),e.resolution===void 0?e.zoom!==void 0&&this.setZoom(e.zoom):this.setResolution(e.resolution)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;let n=this.getCenterInternal();if(n){let r=e||[0,0,0,0];t||=[0,0,0,0];let i=this.getResolution(),a=i/2*(r[3]-t[3]+t[1]-r[1]),o=i/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([n[0]+a,n[1]-o])}}getUpdatedOptions_(e){let t=this.getProperties();return t.resolution===void 0?t.zoom=this.getZoom():t.resolution=this.getResolution(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let t=Array(arguments.length);for(let e=0;e<t.length;++e){let n=arguments[e];n.center&&(n=Object.assign({},n),n.center=yi(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=yi(n.anchor,this.getProjection())),t[e]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,n;t>1&&typeof arguments[t-1]==`function`&&(n=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){let e=arguments[r];e.center&&this.setCenterInternal(e.center),e.zoom===void 0?e.resolution&&this.setResolution(e.resolution):this.setZoom(e.zoom),e.rotation!==void 0&&this.setRotation(e.rotation)}if(r===t){n&&no(n,!0);return}let i=Date.now(),a=this.targetCenter_.slice(),o=this.targetResolution_,s=this.targetRotation_,c=[];for(;r<t;++r){let e=arguments[r],t={start:i,complete:!1,anchor:e.anchor,duration:e.duration===void 0?1e3:e.duration,easing:e.easing||Wn,callback:n};if(e.center&&(t.sourceCenter=a,t.targetCenter=e.center.slice(),a=t.targetCenter),e.zoom===void 0?e.resolution&&(t.sourceResolution=o,t.targetResolution=e.resolution,o=t.targetResolution):(t.sourceResolution=o,t.targetResolution=this.getResolutionForZoom(e.zoom),o=t.targetResolution),e.rotation!==void 0){t.sourceRotation=s;let n=Rt(e.rotation-s+Math.PI,2*Math.PI)-Math.PI;t.targetRotation=s+n,s=t.targetRotation}oo(t)?t.complete=!0:i+=t.duration,c.push(t)}this.animations_.push(c),this.setHint(At.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[At.ANIMATING]>0}getInteracting(){return this.hints_[At.INTERACTING]>0}cancelAnimations(){this.setHint(At.ANIMATING,-this.hints_[At.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t<n;++t){let n=this.animations_[t];if(n[0].callback&&no(n[0].callback,!1),!e)for(let t=0,r=n.length;t<r;++t){let r=n[t];if(!r.complete){e=r.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;let e=Date.now(),t=!1;for(let n=this.animations_.length-1;n>=0;--n){let r=this.animations_[n],i=!0;for(let n=0,a=r.length;n<a;++n){let a=r[n];if(a.complete)continue;let o=e-a.start,s=a.duration>0?o/a.duration:1;s>=1?(a.complete=!0,s=1):i=!1;let c=a.easing(s);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],n=a.targetCenter[0],r=a.targetCenter[1];this.nextCenter_=a.targetCenter,this.targetCenter_=[e+c*(n-e),t+c*(r-t)]}if(a.sourceResolution&&a.targetResolution){let e=c===1?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(n,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(a.sourceRotation!==void 0&&a.targetRotation!==void 0){let e=c===1?Rt(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(i){this.animations_[n]=null,this.setHint(At.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=r[0].callback;e&&no(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n,r=this.getCenterInternal();return r!==void 0&&(n=[r[0]-t[0],r[1]-t[1]],Fn(n,e-this.getRotation()),Mn(n,t)),n}calculateCenterZoom(e,t){let n,r=this.getCenterInternal(),i=this.getResolution();return r!==void 0&&i!==void 0&&(n=[t[0]-e*(t[0]-r[0])/i,t[1]-e*(t[1]-r[1])/i]),n}getViewportSize_(e){let t=this.viewportSize_;if(e){let n=t[0],r=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(n*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(){let e=this.getCenterInternal();return e&&vi(e,this.getProjection())}getCenterInternal(){return this.get(jt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get(`constrainResolution`)}getHints(e){return e===void 0?this.hints_.slice():(e[0]=this.hints_[0],e[1]=this.hints_[1],e)}calculateExtent(e){return bi(this.calculateExtentInternal(e),this.getProjection())}calculateExtentInternal(e){e||=this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();R(t,`The view center is not defined`);let n=this.getResolution();R(n!==void 0,`The view resolution is not defined`);let r=this.getRotation();return R(r!==void 0,`The view rotation is not defined`),yn(t,n,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(jt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(xi(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t||=this.getViewportSizeMinusPadding_();let n=z(e)/t[0],r=xn(e)/t[1];return Math.max(n,r)}getResolutionForValueFunction(e){e||=2;let t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(t/n)/Math.log(e);return(function(n){return t/e**+(n*r)})}getRotation(){return this.get(jt.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/t;return(function(e){return Math.log(n/e)/t/i})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){let e=this.getViewportSizeMinusPadding_();r=so(r,this.getViewportSize_(),[e[0]/2+i[3],e[1]/2+i[0]],t,n)}return{center:r.slice(0),projection:e===void 0?null:e,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,r;if(this.resolutions_){let i=He(this.resolutions_,e,1);t=i,n=this.resolutions_[i],r=i==this.resolutions_.length-1?2:n/this.resolutions_[i+1]}else n=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(n/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];let t=Mt(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/n**+Mt(e-t,0,1)}return this.maxResolution_/this.zoomFactor_**+(e-this.minZoom_)}fit(e,t){let n;if(R(Array.isArray(e)||typeof e.getSimplifiedGeometry==`function`,"Invalid extent or geometry provided as `geometry`"),Array.isArray(e))R(!En(e),"Cannot fit empty extent provided as `geometry`"),n=Ha(xi(e,this.getProjection()));else if(e.getType()===`Circle`){let t=xi(e.getExtent(),this.getProjection());n=Ha(t),n.rotate(this.getRotation(),_n(t))}else{let t=_i();n=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(n,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),n=Math.cos(t),r=Math.sin(-t),i=e.getFlatCoordinates(),a=e.getStride(),o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=a){let t=i[e]*n-i[e+1]*r,a=i[e]*r+i[e+1]*n;o=Math.min(o,t),s=Math.min(s,a),c=Math.max(c,t),l=Math.max(l,a)}return[o,s,c,l]}fitInternal(e,t){t||={};let n=t.size;n||=this.getViewportSizeMinusPadding_();let r=t.padding===void 0?[0,0,0,0]:t.padding,i=t.nearest===void 0?!1:t.nearest,a;a=t.minResolution===void 0?t.maxZoom===void 0?0:this.getResolutionForZoom(t.maxZoom):t.minResolution;let o=this.rotatedExtentForGeometry(e),s=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);s=isNaN(s)?a:Math.max(s,a),s=this.getConstrainedResolution(s,i?0:1);let c=this.getRotation(),l=Math.sin(c),u=Math.cos(c),d=_n(o);d[0]+=(r[1]-r[3])/2*s,d[1]+=(r[0]-r[2])/2*s;let f=d[0]*u-d[1]*l,p=d[1]*u+d[0]*l,m=this.getConstrainedCenter([f,p],s),h=t.callback?t.callback:Ye;t.duration===void 0?(this.targetResolution_=s,this.targetCenter_=m,this.applyTargetState_(!1,!0),no(h,!0)):this.animateInternal({resolution:s,center:m,duration:t.duration,easing:t.easing},h)}centerOn(e,t,n){this.centerOnInternal(yi(e,this.getProjection()),t,n)}centerOnInternal(e,t,n){this.setCenterInternal(so(e,t,n,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,n,r){let i,a=this.padding_;if(a&&e){let o=this.getViewportSizeMinusPadding_(-n),s=so(e,r,[o[0]/2+a[3],o[1]/2+a[0]],t,n);i=[e[0]-s[0],e[1]-s[1]]}return i}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){let t=vi(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){let t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t&&=yi(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*e,0,r,n);t&&(this.targetCenter_=this.calculateCenterZoom(i,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(this.zoomFactor_**+-e,t)}adjustRotation(e,t){t&&=yi(t,this.getProjection()),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,n);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&yi(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){let n=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,0,i,n),o=this.constraints_.center(this.targetCenter_,a,i,n,this.calculateCenterShift(this.targetCenter_,a,r,i));this.get(jt.ROTATION)!==r&&this.set(jt.ROTATION,r),this.get(jt.RESOLUTION)!==a&&(this.set(jt.RESOLUTION,a),this.set(`zoom`,this.getZoom(),!0)),(!o||!this.get(jt.CENTER)||!Pn(this.get(jt.CENTER),o))&&this.set(jt.CENTER,o),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,n){e=e===void 0?200:e;let r=t||0,i=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,r,a),s=this.constraints_.center(this.targetCenter_,o,a,!1,this.calculateCenterShift(this.targetCenter_,o,i,a));if(e===0&&!this.cancelAnchor_){this.targetResolution_=o,this.targetRotation_=i,this.targetCenter_=s,this.applyTargetState_();return}n||=e===0?this.cancelAnchor_:void 0,this.cancelAnchor_=void 0,(this.getResolution()!==o||this.getRotation()!==i||!this.getCenterInternal()||!Pn(this.getCenterInternal(),s))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:i,center:s,resolution:o,duration:e,easing:Un,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(At.INTERACTING,1)}endInteraction(e,t,n){n&&=yi(n,this.getProjection()),this.endInteractionInternal(e,t,n)}endInteractionInternal(e,t,n){this.getInteracting()&&(this.setHint(At.INTERACTING,-1),this.resolveConstraints(e,t,n))}getConstrainedCenter(e,t){let n=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),n)}getConstrainedZoom(e,t){let n=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(n,t))}getConstrainedResolution(e,t){t||=0;let n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,n)}};function no(e,t){setTimeout(function(){e(t)},0)}function ro(e){if(e.extent!==void 0){let t=e.smoothExtentConstraint===void 0?!0:e.smoothExtentConstraint;return Wt(e.extent,e.constrainOnlyCenter,t)}let t=oi(e.projection,`EPSG:3857`);if(e.multiWorld!==!0&&t.isGlobal()){let e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Wt(e,!1,!1)}return Gt}function io(e){let t,n,r,i=e.minZoom===void 0?eo:e.minZoom,a=e.maxZoom===void 0?28:e.maxZoom,o=e.zoomFactor===void 0?2:e.zoomFactor,s=e.multiWorld===void 0?!1:e.multiWorld,c=e.smoothResolutionConstraint===void 0?!0:e.smoothResolutionConstraint,l=e.showFullExtent===void 0?!1:e.showFullExtent,u=oi(e.projection,`EPSG:3857`),d=u.getExtent(),f=e.constrainOnlyCenter,p=e.extent;if(!s&&!p&&u.isGlobal()&&(f=!1,p=d),e.resolutions!==void 0){let o=e.resolutions;n=o[i],r=o[a]===void 0?o[o.length-1]:o[a],t=e.constrainResolution?qa(o,c,!f&&p,l):Ya(n,r,c,!f&&p,l)}else{let s=(d?Math.max(z(d),xn(d)):360*Xn.degrees/u.getMetersPerUnit())/256/2**eo,m=s/2**(28-eo);n=e.maxResolution,n===void 0?n=s/o**+i:i=0,r=e.minResolution,r===void 0&&(r=e.maxZoom===void 0?m:e.maxResolution===void 0?s/o**+a:n/o**+a),a=i+Math.floor(Math.log(n/r)/Math.log(o)),r=n/o**+(a-i),t=e.constrainResolution?Ja(o,n,r,c,!f&&p,l):Ya(n,r,c,!f&&p,l)}return{constraint:t,maxResolution:n,minResolution:r,minZoom:i,zoomFactor:o}}function ao(e){if(e.enableRotation===void 0||e.enableRotation){let t=e.constrainRotation;return t===void 0||t===!0?$a():t===!1?Za:typeof t==`number`?Qa(t):Za}return Xa}function oo(e){return!(e.sourceCenter&&e.targetCenter&&!Pn(e.sourceCenter,e.targetCenter)||e.sourceResolution!==e.targetResolution||e.sourceRotation!==e.targetRotation)}function so(e,t,n,r,i){let a=Math.cos(-i),o=Math.sin(-i),s=e[0]*a-e[1]*o,c=e[1]*a+e[0]*o;return s+=(t[0]/2-n[0])*r,c+=(n[1]-t[1]/2)*r,o=-o,[s*a-c*o,c*a+s*o]}var co=`ol-hidden`,lo=`ol-unselectable`,uo=`ol-control`,fo=`ol-collapsed`,po=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`),mo=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],ho={normal:400,bold:700},go=function(e){let t=e.match(po);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=mo.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[mo[e]]=typeof r==`string`?r.trim():r)}return isNaN(Number(n.weight))&&n.weight in ho&&(n.weight=ho[n.weight]),n.families=n.family.split(/,\s?/).map(e=>e.trim().replace(/^['"]|['"]$/g,``)),n};function _o(e,t,n,r){let i;return i=n&&n.length?n.shift():vt?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}var vo;function yo(){return vo||=_o(1,1),vo}function bo(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function xo(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function So(e){for(;e.lastChild;)e.lastChild.remove()}function Co(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;if(i!==a){if(!i){e.appendChild(a);continue}if(!a){e.removeChild(i),--r;continue}e.insertBefore(a,i)}}}function wo(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){let t=this.childNodes.indexOf(e);if(t===-1)throw Error(`Node to remove was not found`);return this.childNodes.splice(t,1),e},insertBefore:function(e,t){let n=this.childNodes.indexOf(t);if(n===-1)throw Error(`Reference node not found`);return this.childNodes.splice(n,0,e),e},style:{}},{get(e,t,n){return t===`firstElementChild`?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,n)}})}function To(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas}var Eo=class extends ct{constructor(e){super();let 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(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let e=0,t=this.listenerKeys.length;e<t;++e)rt(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=e,e){let t=this.target_??e.getOverlayContainerStopEvent();this.element&&t.appendChild(this.element),this.render!==Ye&&this.listenerKeys.push(N(e,wt.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e==`string`?document.getElementById(e):e}},Do=class extends Eo{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.ulElement_=document.createElement(`ul`),this.collapsed_=e.collapsed===void 0?!0:e.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible===void 0?!0:e.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;let t=e.className===void 0?`ol-attribution`:e.className,n=e.tipLabel===void 0?`Attributions`:e.tipLabel,r=e.expandClassName===void 0?t+`-expand`:e.expandClassName,i=e.collapseLabel===void 0?`›`:e.collapseLabel,a=e.collapseClassName===void 0?t+`-collapse`:e.collapseClassName;typeof i==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=i,this.collapseLabel_.className=a):this.collapseLabel_=i;let o=e.label===void 0?`i`:e.label;typeof o==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=o,this.label_.className=r):this.label_=o;let s=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=n,this.toggleButton_.appendChild(s),this.toggleButton_.addEventListener(M.CLICK,this.handleClick_.bind(this),!1);let c=t+` `+lo+` `+uo+(this.collapsed_&&this.collapsible_?` `+fo:``)+(this.collapsible_?``:` ol-uncollapsible`),l=this.element;l.className=c,l.appendChild(this.toggleButton_),l.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){let t=this.getMap().getAllLayers(),n=new Set(t.flatMap(t=>t.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(e=>n.add(e)):n.add(this.attributions_)),!this.overrideCollapsible_){let e=!t.some(e=>e.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(e)}return Array.from(n)}async updateElement_(e){if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=await Promise.all(this.collectSourceAttributions_(e).map(e=>Ze(()=>e))),n=t.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?``:`none`,this.renderedVisible_=n),!Ge(t,this.renderedAttributions_)){So(this.ulElement_);for(let e=0,n=t.length;e<n;++e){let n=document.createElement(`li`);n.innerHTML=t[e],this.ulElement_.appendChild(n)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(fo),this.collapsed_?xo(this.collapseLabel_,this.label_):xo(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)}},Oo=class extends Eo{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target});let t=e.className===void 0?`ol-rotate`:e.className,n=e.label===void 0?`⇧`:e.label,r=e.compassClassName===void 0?`ol-compass`:e.compassClassName;this.label_=null,typeof n==`string`?(this.label_=document.createElement(`span`),this.label_.className=r,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(r));let i=e.tipLabel?e.tipLabel:`Reset rotation`,a=document.createElement(`button`);a.className=t+`-reset`,a.setAttribute(`type`,`button`),a.title=i,a.appendChild(this.label_),a.addEventListener(M.CLICK,this.handleClick_.bind(this),!1);let o=t+` `+lo+` `+uo,s=this.element;s.className=o,s.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration===void 0?250:e.duration,this.autoHide_=e.autoHide===void 0?!0:e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(co)}handleClick_(e){e.preventDefault(),this.callResetNorth_===void 0?this.resetNorth_():this.callResetNorth_()}resetNorth_(){let e=this.getMap().getView();if(!e)return;let t=e.getRotation();t!==void 0&&(this.duration_>0&&t%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:Un}):e.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let n=t.viewState.rotation;if(n!=this.rotation_){let e=`rotate(`+n+`rad)`;if(this.autoHide_){let e=this.element.classList.contains(co);!e&&n===0?this.element.classList.add(co):e&&n!==0&&this.element.classList.remove(co)}this.label_.style.transform=e}this.rotation_=n}},ko=class extends Eo{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target});let t=e.className===void 0?`ol-zoom`:e.className,n=e.delta===void 0?1:e.delta,r=e.zoomInClassName===void 0?t+`-in`:e.zoomInClassName,i=e.zoomOutClassName===void 0?t+`-out`:e.zoomOutClassName,a=e.zoomInLabel===void 0?`+`:e.zoomInLabel,o=e.zoomOutLabel===void 0?`–`:e.zoomOutLabel,s=e.zoomInTipLabel===void 0?`Zoom in`:e.zoomInTipLabel,c=e.zoomOutTipLabel===void 0?`Zoom out`:e.zoomOutTipLabel,l=document.createElement(`button`);l.className=r,l.setAttribute(`type`,`button`),l.title=s,l.appendChild(typeof a==`string`?document.createTextNode(a):a),l.addEventListener(M.CLICK,this.handleClick_.bind(this,n),!1);let u=document.createElement(`button`);u.className=i,u.setAttribute(`type`,`button`),u.title=c,u.appendChild(typeof o==`string`?document.createTextNode(o):o),u.addEventListener(M.CLICK,this.handleClick_.bind(this,-n),!1);let d=t+` `+lo+` `+uo,f=this.element;f.className=d,f.appendChild(l),f.appendChild(u),this.duration_=e.duration===void 0?250:e.duration}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap().getView();if(!t)return;let n=t.getZoom();if(n!==void 0){let r=t.getConstrainedZoom(n+e);this.duration_>0?(t.getAnimating()&&t.cancelAnimations(),t.animate({zoom:r,duration:this.duration_,easing:Un})):t.setZoom(r)}}};function Ao(e){e||={};let t=new dt;return(e.zoom===void 0||e.zoom)&&t.push(new ko(e.zoomOptions)),(e.rotate===void 0||e.rotate)&&t.push(new Oo(e.rotateOptions)),(e.attribution===void 0||e.attribution)&&t.push(new Do(e.attributionOptions)),t}var jo=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,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;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Mo={ACTIVE:`active`},No=class extends ct{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(Mo.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Mo.ACTIVE,e)}setMap(e){this.map_=e}};function Po(e,t,n){let r=e.getCenterInternal();if(r){let i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n===void 0?250:n,easing:Gn,center:e.getConstrainedCenter(i)})}}function Fo(e,t,n,r){let i=e.getZoom();if(i===void 0)return;let a=e.getConstrainedZoom(i+t),o=e.getResolutionForZoom(a);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:n,duration:r===void 0?250:r,easing:Un})}var Io=class extends No{constructor(e){super(),e||={},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?250:e.duration}handleEvent(e){let t=!1;if(e.type==I.DBLCLICK){let n=e.originalEvent,r=e.map,i=e.coordinate,a=n.shiftKey?-this.delta_:this.delta_;Fo(r.getView(),a,i,this.duration_),n.preventDefault(),t=!0}return!t}};function Lo(e){let t=arguments;return function(e){let n=!0;for(let r=0,i=t.length;r<i&&(n&&=t[r](e),n);++r);return n}}var Ro=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},zo=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Bo=function(e){let t=e.map.getTargetElement(),n=t.getRootNode(),r=e.map.getOwnerDocument().activeElement;return n instanceof ShadowRoot?n.host.contains(r):t.contains(r)},Vo=function(e){let t=e.map.getTargetElement(),n=t.getRootNode();return(n instanceof ShadowRoot?n.host:t).hasAttribute(`tabindex`)?Bo(e):!0},Ho=qe,Uo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.button==0&&!(ht&>&&t.ctrlKey)},Wo=Je,Go=function(e){return e.type==I.SINGLECLICK},Ko=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},qo=function(e){let t=e.originalEvent;return gt?t.metaKey:t.ctrlKey},Jo=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Yo=function(e){let t=e.originalEvent,n=t.target.tagName;return n!==`INPUT`&&n!==`SELECT`&&n!==`TEXTAREA`&&!t.target.isContentEditable},Xo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.pointerType==`mouse`},Zo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.isPrimary&&t.button===0},Qo=class extends No{constructor(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)e.type==I.POINTERDRAG?(this.handleDragEvent(e),e.originalEvent.preventDefault()):e.type==I.POINTERUP&&(this.handlingDownUpSequence=this.handleUpEvent(e)&&this.targetPointers.length>0);else if(e.type==I.POINTERDOWN){let n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==I.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 $o(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++)n+=e[i].clientX,r+=e[i].clientY;return{clientX:n/t,clientY:r/t}}var es=class extends Qo{constructor(e){super({stopDown:Je}),e||={},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;let t=e.condition?e.condition:Lo(Ko,Zo);this.condition_=e.onFocusOnly?Lo(Vo,t):t,this.noKinetic_=!1}handleDragEvent(e){let t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());let n=this.targetPointers,r=t.getEventPixel($o(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){let t=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],n=e.map.getView();In(t,n.getResolution()),Fn(t,n.getRotation()),n.adjustCenterInternal(t)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()}handleUpEvent(e){let t=e.map,n=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let e=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),i=n.getCenterInternal(),a=t.getPixelFromCoordinateInternal(i),o=t.getCoordinateFromPixelInternal([a[0]-e*Math.cos(r),a[1]-e*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:Un})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){let t=e.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},ts=class extends Qo{constructor(e){e||={},super({stopDown:Je}),this.condition_=e.condition?e.condition:zo,this.lastAngle_=void 0,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){if(!Xo(e))return;let t=e.map,n=t.getView();if(n.getConstraints().rotation===Xa)return;let r=t.getSize(),i=e.pixel,a=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){let e=a-this.lastAngle_;n.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){return Xo(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Xo(e)&&Uo(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},ns=class extends Re{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_(){let e=this.startPixel_,t=this.endPixel_,n=this.element_.style;n.left=Math.min(e[0],t[0])+`px`,n.top=Math.min(e[1],t[1])+`px`,n.width=Math.abs(t[0]-e[0])+`px`,n.height=Math.abs(t[1]-e[1])+`px`}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left=`inherit`,e.top=`inherit`,e.width=`inherit`,e.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;let e=this.startPixel_,t=this.endPixel_,n=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Va([n])}getGeometry(){return this.geometry_}},rs={BOXSTART:`boxstart`,BOXDRAG:`boxdrag`,BOXEND:`boxend`,BOXCANCEL:`boxcancel`},is=class extends et{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}},as=class extends Qo{constructor(e){super(),this.on,this.once,this.un,e??={},this.box_=new ns(e.className||`ol-dragbox`),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Uo,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];return r*r+i*i>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new is(rs.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new is(t?rs.BOXEND:rs.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 is(rs.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&=(this.dispatchEvent(new is(rs.BOXCANCEL,this.startPixel_,null)),null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&=(this.dispatchEvent(new is(rs.BOXCANCEL,this.startPixel_,null)),null)),super.setMap(e)}},os=class extends as{constructor(e){e||={};let t=e.condition?e.condition:Jo;super({condition:t,className:e.className||`ol-dragzoom`,minArea:e.minArea}),this.duration_=e.duration===void 0?200:e.duration,this.out_=e.out===void 0?!1:e.out}onBoxEnd(e){let t=this.getMap().getView(),n=this.getGeometry();if(this.out_){let e=t.rotatedExtentForGeometry(n),r=t.getResolutionForExtentInternal(e),i=t.getResolution()/r;n=n.clone(),n.scale(i*i)}t.fitInternal(n,{duration:this.duration_,easing:Un})}},ss={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,DOWN:`ArrowDown`},cs=class extends No{constructor(e){super(),e||={},this.defaultCondition_=function(e){return Ko(e)&&Yo(e)},this.condition_=e.condition===void 0?this.defaultCondition_:e.condition,this.duration_=e.duration===void 0?100:e.duration,this.pixelDelta_=e.pixelDelta===void 0?128:e.pixelDelta}handleEvent(e){let t=!1;if(e.type==M.KEYDOWN){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r==ss.DOWN||r==ss.LEFT||r==ss.RIGHT||r==ss.UP)){let i=e.map.getView(),a=i.getResolution()*this.pixelDelta_,o=0,s=0;r==ss.DOWN?s=-a:r==ss.LEFT?o=-a:r==ss.RIGHT?o=a:s=a;let c=[o,s];Fn(c,i.getRotation()),Po(i,c,this.duration_),n.preventDefault(),t=!0}}return!t}},ls=class extends No{constructor(e){super(),e||={},this.condition_=e.condition?e.condition:function(e){return!qo(e)&&Yo(e)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?100:e.duration}handleEvent(e){let t=!1;if(e.type==M.KEYDOWN||e.type==M.KEYPRESS){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r===`+`||r===`-`)){let i=e.map,a=r===`+`?this.delta_:-this.delta_;Fo(i.getView(),a,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}},us=40,ds=300,fs=class extends No{constructor(e){e||={},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta===void 0?1:e.maxDelta,this.duration_=e.duration===void 0?250:e.duration,this.timeout_=e.timeout===void 0?80:e.timeout,this.useAnchor_=e.useAnchor===void 0?!0:e.useAnchor,this.constrainResolution_=e.constrainResolution===void 0?!1:e.constrainResolution;let t=e.condition?e.condition:Ho;this.condition_=e.onFocusOnly?Lo(Vo,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;let e=this.getMap();e&&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!==M.WHEEL)return!0;let t=e.map,n=e.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let r=n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_LINE:r*=us;break;case WheelEvent.DOM_DELTA_PAGE:r*=ds;break;default:}if(r===0)return!1;this.lastDelta_=r;let i=Date.now();this.startTime_===void 0&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?`trackpad`:`wheel`);let a=t.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(-r/this.deltaPerZoom_,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=i,!1;this.totalDelta_+=r;let o=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,t),o),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-Mt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Fo(t,n,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)}},ps=class extends Qo{constructor(e){e||={};let t=e;t.stopDown||=Je,super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold===void 0?.3:e.threshold,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){let t=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(this.lastAngle_!==void 0){let e=i-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=i;let a=e.map,o=a.getView();o.getConstraints().rotation!==Xa&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel($o(this.targetPointers))),this.rotating_&&(a.render(),o.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){let 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}},ms=class extends Qo{constructor(e){e||={};let t=e;t.stopDown||=Je,super(t),this.anchor_=null,this.duration_=e.duration===void 0?400:e.duration,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,a=n.clientY-r.clientY,o=Math.sqrt(i*i+a*a);this.lastDistance_!==void 0&&(t=this.lastDistance_/o),this.lastDistance_=o;let s=e.map,c=s.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel($o(this.targetPointers))),s.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}};function hs(e){e||={};let t=new dt,n=new jo(-.005,.05,100);return(e.altShiftDragRotate===void 0||e.altShiftDragRotate)&&t.push(new ts),(e.doubleClickZoom===void 0||e.doubleClickZoom)&&t.push(new Io({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan===void 0||e.dragPan)&&t.push(new es({onFocusOnly:e.onFocusOnly,kinetic:n})),(e.pinchRotate===void 0||e.pinchRotate)&&t.push(new ps),(e.pinchZoom===void 0||e.pinchZoom)&&t.push(new ms({duration:e.zoomDuration})),(e.keyboard===void 0||e.keyboard)&&(t.push(new cs),t.push(new ls({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom===void 0||e.mouseWheelZoom)&&t.push(new fs({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom===void 0||e.shiftDragZoom)&&t.push(new os({duration:e.zoomDuration})),t}var gs={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`},_s=class extends ct{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;let t=Object.assign({},e);typeof e.properties==`object`&&(delete t.properties,Object.assign(t,e.properties)),t[gs.OPACITY]=e.opacity===void 0?1:e.opacity,R(typeof t[gs.OPACITY]==`number`,`Layer opacity must be a number`),t[gs.VISIBLE]=e.visible===void 0?!0:e.visible,t[gs.Z_INDEX]=e.zIndex,t[gs.MAX_RESOLUTION]=e.maxResolution===void 0?1/0:e.maxResolution,t[gs.MIN_RESOLUTION]=e.minResolution===void 0?0:e.minResolution,t[gs.MIN_ZOOM]=e.minZoom===void 0?-1/0:e.minZoom,t[gs.MAX_ZOOM]=e.maxZoom===void 0?1/0:e.maxZoom,this.className_=t.className===void 0?`ol-layer`:t.className,delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){let t=this.state_||{layer:this,managed:e===void 0?!0:e},n=this.getZIndex();return t.opacity=Mt(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=n===void 0&&!t.managed?1/0:n,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 P()}getLayerStatesArray(e){return P()}getExtent(){return this.get(gs.EXTENT)}getMaxResolution(){return this.get(gs.MAX_RESOLUTION)}getMinResolution(){return this.get(gs.MIN_RESOLUTION)}getMinZoom(){return this.get(gs.MIN_ZOOM)}getMaxZoom(){return this.get(gs.MAX_ZOOM)}getOpacity(){return this.get(gs.OPACITY)}getSourceState(){return P()}getVisible(){return this.get(gs.VISIBLE)}getZIndex(){return this.get(gs.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(gs.EXTENT,e)}setMaxResolution(e){this.set(gs.MAX_RESOLUTION,e)}setMinResolution(e){this.set(gs.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(gs.MAX_ZOOM,e)}setMinZoom(e){this.set(gs.MIN_ZOOM,e)}setOpacity(e){R(typeof e==`number`,`Layer opacity must be a number`),this.set(gs.OPACITY,e)}setVisible(e){this.set(gs.VISIBLE,e)}setZIndex(e){this.set(gs.Z_INDEX,e)}disposeInternal(){this.state_&&=(this.state_.layer=null,null),super.disposeInternal()}},vs={ADDLAYER:`addlayer`,REMOVELAYER:`removelayer`},ys=class extends et{constructor(e,t){super(e),this.layer=t}},bs={LAYERS:`layers`},xs=class e extends _s{constructor(e){e||={};let t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(bs.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new dt(n.slice(),{unique:!0}):R(typeof n.getArray==`function`,"Expected `layers` to be an array or a `Collection`"):n=new dt(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(rt),this.layersListenerKeys_.length=0;let e=this.getLayers();this.layersListenerKeys_.push(N(e,Ie.ADD,this.handleLayersAdd_,this),N(e,Ie.REMOVE,this.handleLayersRemove_,this));for(let e in this.listenerKeys_)this.listenerKeys_[e].forEach(rt);Qe(this.listenerKeys_);let t=e.getArray();for(let e=0,n=t.length;e<n;e++){let n=t[e];this.registerLayerListeners_(n),this.dispatchEvent(new ys(vs.ADDLAYER,n))}this.changed()}registerLayerListeners_(t){let n=[N(t,Le.PROPERTYCHANGE,this.handleLayerChange_,this),N(t,M.CHANGE,this.handleLayerChange_,this)];t instanceof e&&n.push(N(t,vs.ADDLAYER,this.handleLayerGroupAdd_,this),N(t,vs.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[F(t)]=n}handleLayerGroupAdd_(e){this.dispatchEvent(new ys(vs.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new ys(vs.REMOVELAYER,e.layer))}handleLayersAdd_(e){let t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new ys(vs.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){let t=e.element,n=F(t);this.listenerKeys_[n].forEach(rt),delete this.listenerKeys_[n],this.dispatchEvent(new ys(vs.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(bs.LAYERS)}setLayers(e){let t=this.getLayers();if(t){let e=t.getArray();for(let t=0,n=e.length;t<n;++t)this.dispatchEvent(new ys(vs.REMOVELAYER,e[t]))}this.set(bs.LAYERS,e)}getLayersArray(e){return e=e===void 0?[]:e,this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){let t=e===void 0?[]:e,n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});let r=this.getLayerState(),i=r.zIndex;!e&&r.zIndex===void 0&&(i=0);for(let e=n,a=t.length;e<a;e++){let n=t[e];n.opacity*=r.opacity,n.visible=n.visible&&r.visible,n.maxResolution=Math.min(n.maxResolution,r.maxResolution),n.minResolution=Math.max(n.minResolution,r.minResolution),n.minZoom=Math.max(n.minZoom,r.minZoom),n.maxZoom=Math.min(n.maxZoom,r.maxZoom),r.extent!==void 0&&(n.extent===void 0?n.extent=r.extent:n.extent=Sn(n.extent,r.extent)),n.zIndex===void 0&&(n.zIndex=i)}return t}getSourceState(){return`ready`}},Ss={PRERENDER:`prerender`,POSTRENDER:`postrender`,PRECOMPOSE:`precompose`,POSTCOMPOSE:`postcompose`,RENDERCOMPLETE:`rendercomplete`},Cs=class extends _s{constructor(e){let 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(gs.SOURCE,this.handleSourcePropertyChange_);let n=e.source?e.source:null;this.setSource(n)}getLayersArray(e){return e||=[],e.push(this),e}getLayerStatesArray(e){return e||=[],e.push(this.getLayerState()),e}getSource(){return this.get(gs.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){let 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_&&=(rt(this.sourceChangeKey_),null),this.sourceReady_=!1;let e=this.getSource();e&&(this.sourceChangeKey_=N(e,M.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,n=this.getMapInternal();!e&&n&&(e=n.getView()),t=e instanceof to?{viewState:e.getState(),extent:e.calculateExtent()}:e,!t.layerStatesArray&&n&&(t.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(e=>e.layer===this),!r)return!1}else r=this.getLayerState();let i=this.getExtent();return ws(r,t.viewState)&&(!i||Tn(i,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];let t=this.getSource()?.getAttributions();if(!t)return[];let n=t(e instanceof to?e.getViewStateAndExtent():e);return Array.isArray(n)||(n=[n]),n}render(e,t){let n=this.getRenderer();return n.prepareFrame(e)?(this.rendered=!0,n.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){let t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(gs.MAP,e)}getMapInternal(){return this.get(gs.MAP)}setMap(e){this.mapPrecomposeKey_&&=(rt(this.mapPrecomposeKey_),null),e||this.changed(),this.mapRenderKey_&&=(rt(this.mapRenderKey_),null),e&&(this.mapPrecomposeKey_=N(e,Ss.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=N(this,M.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){let t=e.frameState.layerStatesArray,n=this.getLayerState(!1);R(!t.some(e=>e.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(n)}setSource(e){this.set(gs.SOURCE,e)}getRenderer(){return 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 ws(e,t){if(!e.visible)return!1;let n=t.resolution;if(n<e.minResolution||n>=e.maxResolution)return!1;let r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}function Ts(e,t,n=0,r=e.length-1,i=Ds){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Ts(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(Es(e,n,t),i(e[r],a)>0&&Es(e,n,r);o<s;){for(Es(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?Es(e,n,s):(s++,Es(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function Es(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Ds(e,t){return e<t?-1:e>t?1:0}var Os=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,n=[];if(!Bs(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;Bs(e,s)&&(t.leaf?n.push(o):zs(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!Bs(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(Bs(e,a)){if(t.leaf||zs(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);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){let e=this.data;this.data=t,t=e}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=Vs([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=ks(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&zs(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=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){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=Vs(e.slice(t,n+1)),As(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=Vs([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));Hs(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);Hs(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return As(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Fs(o),c=Ls(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),Ms(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=Vs(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,As(n,this.toBBox),As(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=Vs([e,t]),this.data.height=e.height+1,this.data.leaf=!1,As(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=js(e,0,o,this.toBBox),s=js(e,o,n,this.toBBox),c=Rs(t,s),l=Fs(t)+Fs(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Ns,i=e.leaf?this.compareMinY:Ps;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=js(e,0,t,i),o=js(e,n-t,n,i),s=Is(a)+Is(o);for(let r=t;r<n-t;r++){let t=e.children[r];Ms(a,e.leaf?i(t):t),s+=Is(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];Ms(o,e.leaf?i(t):t),s+=Is(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Ms(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():As(e[t],this.toBBox)}};function ks(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function As(e,t){js(e,0,e.children.length,t,e)}function js(e,t,n,r,i){i||=Vs(null),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];Ms(i,e.leaf?r(t):t)}return i}function Ms(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Ns(e,t){return e.minX-t.minX}function Ps(e,t){return e.minY-t.minY}function Fs(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Is(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ls(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Rs(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function zs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Bs(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Vs(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Hs(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Ts(e,o,t,n,i),a.push(t,o,o,n)}}var Us=[NaN,NaN,NaN,0],Ws;function Gs(){return Ws||=_o(1,1,void 0,{willReadFrequently:!0,desynchronized:!0}),Ws}var Ks=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,qs=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Js=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Ys=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Xs(e,t){return e.endsWith(`%`)?Number(e.substring(0,e.length-1))/t:Number(e)}function Zs(e){throw Error(`failed to parse "`+e+`" as color`)}function Qs(e){if(e.toLowerCase().startsWith(`rgb`)){let t=e.match(qs)||e.match(Ks)||e.match(Js);if(t){let e=t[4],n=100/255;return[Mt(Xs(t[1],n)+.5|0,0,255),Mt(Xs(t[2],n)+.5|0,0,255),Mt(Xs(t[3],n)+.5|0,0,255),e===void 0?1:Mt(Xs(e,100),0,1)]}Zs(e)}if(e.startsWith(`#`)){if(Ys.test(e)){let t=e.substring(1),n=t.length<=4?1:2,r=[0,0,0,255];for(let e=0,i=t.length;e<i;e+=n){let i=parseInt(t.substring(e,e+n),16);n===1&&(i+=i<<4),r[e/n]=i}return r[3]/=255,r}Zs(e)}let t=Gs();t.fillStyle=`#abcdef`;let n=t.fillStyle;t.fillStyle=e,t.fillStyle===n&&(t.fillStyle=`#fedcba`,n=t.fillStyle,t.fillStyle=e,t.fillStyle===n&&Zs(e));let r=t.fillStyle;if(r.startsWith(`#`)||r.startsWith(`rgba`))return Qs(r);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let i=Array.from(t.getImageData(0,0,1,1).data);return i[3]=Bt(i[3]/255,3),i}function $s(e){return typeof e==`string`?e:fc(e)}var ec=1024,tc={},nc=0;function rc(e){if(e.length===4)return e;let t=e.slice();return t[3]=1,t}function ic(e){return e>.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function ac(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function oc(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function sc(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function cc(e){let t=oc(e[0]),n=oc(e[1]),r=oc(e[2]),i=sc(t*.222488403+n*.716873169+r*.06060791),a=500*(sc(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-sc(t*.016863605+n*.117638439+r*.865350722)),s=180/Math.PI*Math.atan2(o,a);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function lc(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=ac(t),a=ac(t+n/500*Math.cos(r)),o=ac(t-n/200*Math.sin(r)),s=ic(a*3.021973625-i*1.617392459-o*.404875592),c=ic(a*-.943766287+i*1.916279586+o*.027607165),l=ic(a*.069407491-i*.22898585+o*1.159737864);return[Mt(s+.5|0,0,255),Mt(c+.5|0,0,255),Mt(l+.5|0,0,255),e[3]]}function uc(e){if(e===`none`)return Us;if(tc.hasOwnProperty(e))return tc[e];if(nc>=ec){let e=0;for(let t in tc)e++&3||(delete tc[t],--nc)}let t=Qs(e);t.length!==4&&Zs(e);for(let n of t)isNaN(n)&&Zs(e);return tc[e]=t,++nc,t}function dc(e){return Array.isArray(e)?e:uc(e)}function fc(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}function pc(e){return e[0]>0&&e[1]>0}function mc(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function hc(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var gc=0,_c=1<<gc++,V=1<<gc++,vc=1<<gc++,yc=1<<gc++,bc=1<<gc++,xc=1<<gc++,Sc=2**gc-1,Cc={[_c]:`boolean`,[V]:`number`,[vc]:`string`,[yc]:`color`,[bc]:`number[]`,[xc]:`size`},wc=Object.keys(Cc).map(Number).sort(Be);function Tc(e){return e in Cc}function Ec(e){let t=[];for(let n of wc)Dc(e,n)&&t.push(Cc[n]);return t.length===0?`untyped`:t.length<3?t.join(` or `):t.slice(0,-1).join(`, `)+`, or `+t[t.length-1]}function Dc(e,t){return(e&t)===t}function Oc(e,t){return e===t}var kc=class{constructor(e,t){if(!Tc(e))throw Error(`literal expressions must have a specific type, got ${Ec(e)}`);this.type=e,this.value=t}},Ac=class{constructor(e,t,...n){this.type=e,this.operator=t,this.args=n}};function jc(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function Mc(e,t,n){switch(typeof e){case`boolean`:if(Oc(t,vc))return new kc(vc,e?`true`:`false`);if(!Dc(t,_c))throw Error(`got a boolean, but expected ${Ec(t)}`);return new kc(_c,e);case`number`:if(Oc(t,xc))return new kc(xc,hc(e));if(Oc(t,_c))return new kc(_c,!!e);if(Oc(t,vc))return new kc(vc,e.toString());if(!Dc(t,V))throw Error(`got a number, but expected ${Ec(t)}`);return new kc(V,e);case`string`:if(Oc(t,yc))return new kc(yc,uc(e));if(Oc(t,_c))return new kc(_c,!!e);if(!Dc(t,vc))throw Error(`got a string, but expected ${Ec(t)}`);return new kc(vc,e);default:}if(!Array.isArray(e))throw Error(`expression must be an array or a primitive value`);if(e.length===0)throw Error(`empty expression`);if(typeof e[0]==`string`)return Yc(e,t,n);for(let t of e)if(typeof t!=`number`)throw Error(`expected an array of numbers`);if(Oc(t,xc)){if(e.length!==2)throw Error(`expected an array of two values for a size, got ${e.length}`);return new kc(xc,e)}if(Oc(t,yc)){if(e.length===3)return new kc(yc,[...e,1]);if(e.length===4)return new kc(yc,e);throw Error(`expected an array of 3 or 4 values for a color, got ${e.length}`)}if(!Dc(t,bc))throw Error(`got an array of numbers, but expected ${Ec(t)}`);return new kc(bc,e)}var H={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`},Nc={[H.Get]:W(U(1,1/0),Pc),[H.Var]:W(U(1,1),Fc),[H.Has]:W(U(1,1/0),Pc),[H.Id]:W(Ic,zc),[H.Concat]:W(U(2,1/0),Vc(vc)),[H.GeometryType]:W(Lc,zc),[H.LineMetric]:W(zc),[H.Resolution]:W(Rc,zc),[H.Zoom]:W(Rc,zc),[H.Time]:W(Rc,zc),[H.Any]:W(U(2,1/0),Vc(_c)),[H.All]:W(U(2,1/0),Vc(_c)),[H.Not]:W(U(1,1),Vc(_c)),[H.Equal]:W(U(2,2),Vc(Sc)),[H.NotEqual]:W(U(2,2),Vc(Sc)),[H.GreaterThan]:W(U(2,2),Vc(V)),[H.GreaterThanOrEqualTo]:W(U(2,2),Vc(V)),[H.LessThan]:W(U(2,2),Vc(V)),[H.LessThanOrEqualTo]:W(U(2,2),Vc(V)),[H.Multiply]:W(U(2,1/0),Bc),[H.Coalesce]:W(U(2,1/0),Bc),[H.Divide]:W(U(2,2),Vc(V)),[H.Add]:W(U(2,1/0),Vc(V)),[H.Subtract]:W(U(2,2),Vc(V)),[H.Clamp]:W(U(3,3),Vc(V)),[H.Mod]:W(U(2,2),Vc(V)),[H.Pow]:W(U(2,2),Vc(V)),[H.Abs]:W(U(1,1),Vc(V)),[H.Floor]:W(U(1,1),Vc(V)),[H.Ceil]:W(U(1,1),Vc(V)),[H.Round]:W(U(1,1),Vc(V)),[H.Sin]:W(U(1,1),Vc(V)),[H.Cos]:W(U(1,1),Vc(V)),[H.Atan]:W(U(1,2),Vc(V)),[H.Sqrt]:W(U(1,1),Vc(V)),[H.Match]:W(U(4,1/0),Uc,Wc),[H.Between]:W(U(3,3),Vc(V)),[H.Interpolate]:W(U(6,1/0),Uc,Gc),[H.Case]:W(U(3,1/0),Hc,Kc),[H.In]:W(U(2,2),qc),[H.Number]:W(U(1,1/0),Vc(Sc)),[H.String]:W(U(1,1/0),Vc(Sc)),[H.Array]:W(U(1,1/0),Vc(V)),[H.Color]:W(U(1,4),Vc(V)),[H.Band]:W(U(1,3),Vc(V)),[H.Palette]:W(U(2,2),Jc),[H.ToString]:W(U(1,1),Vc(_c|V|vc|yc))};function Pc(e,t,n){let r=e.length-1,i=Array(r);for(let t=0;t<r;++t){let r=e[t+1];switch(typeof r){case`number`:i[t]=new kc(V,r);break;case`string`:i[t]=new kc(vc,r);break;default:throw Error(`expected a string key or numeric array index for a get operation, got ${r}`)}t===0&&n.properties.add(String(r))}return i}function Fc(e,t,n){let r=e[1];if(typeof r!=`string`)throw Error(`expected a string argument for var operation`);return n.variables.add(r),[new kc(vc,r)]}function Ic(e,t,n){n.featureId=!0}function Lc(e,t,n){n.geometryType=!0}function Rc(e,t,n){n.mapState=!0}function zc(e,t,n){let r=e[0];if(e.length!==1)throw Error(`expected no arguments for ${r} operation`);return[]}function U(e,t){return function(n,r,i){let a=n[0],o=n.length-1;if(e===t){if(o!==e)throw Error(`expected ${e} argument${e===1?``:`s`} for ${a}, got ${o}`)}else if(o<e||o>t){let n=t===1/0?`${e} or more`:`${e} to ${t}`;throw Error(`expected ${n} arguments for ${a}, got ${o}`)}}}function Bc(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;a<r;++a)i[a]=Mc(e[a+1],t,n);return i}function Vc(e){return function(t,n,r){let i=t.length-1,a=Array(i);for(let n=0;n<i;++n)a[n]=Mc(t[n+1],e,r);return a}}function Hc(e,t,n){let r=e[0],i=e.length-1;if(i%2==0)throw Error(`expected an odd number of arguments for ${r}, got ${i} instead`)}function Uc(e,t,n){let r=e[0],i=e.length-1;if(i%2==1)throw Error(`expected an even number of arguments for operation ${r}, got ${i} instead`)}function Wc(e,t,n){let r=e.length-1,i=vc|V|_c,a=Mc(e[1],i,n),o=Mc(e[e.length-1],t,n),s=Array(r-2);for(let t=0;t<r-2;t+=2){try{s[t]=Mc(e[t+2],a.type,n)}catch(e){throw Error(`failed to parse argument ${t+1} of match expression: ${e.message}`)}try{let r=Mc(e[t+3],o.type,n);s[t+1]=r}catch(e){throw Error(`failed to parse argument ${t+2} of match expression: ${e.message}`)}}return[a,...s,o]}function Gc(e,t,n){let r=e[1],i;switch(r[0]){case`linear`:i=1;break;case`exponential`:let e=r[1];if(typeof e!=`number`||e<=0)throw Error(`expected a number base for exponential interpolation, got ${JSON.stringify(e)} instead`);i=e;break;default:throw Error(`invalid interpolation type: ${JSON.stringify(r)}`)}let a=new kc(V,i),o;try{o=Mc(e[2],V,n)}catch(e){throw Error(`failed to parse argument 1 in interpolate expression: ${e.message}`)}let s=Array(e.length-3);for(let r=0;r<s.length;r+=2){try{s[r]=Mc(e[r+3],V,n)}catch(e){throw Error(`failed to parse argument ${r+2} for interpolate expression: ${e.message}`)}try{let i=Mc(e[r+4],t,n);s[r+1]=i}catch(e){throw Error(`failed to parse argument ${r+3} for interpolate expression: ${e.message}`)}}return[a,o,...s]}function Kc(e,t,n){let r=Mc(e[e.length-1],t,n),i=Array(e.length-1);for(let t=0;t<i.length-1;t+=2){try{i[t]=Mc(e[t+1],_c,n)}catch(e){throw Error(`failed to parse argument ${t} of case expression: ${e.message}`)}try{let a=Mc(e[t+2],r.type,n);i[t+1]=a}catch(e){throw Error(`failed to parse argument ${t+1} of case expression: ${e.message}`)}}return i[i.length-1]=r,i}function qc(e,t,n){let r=e[2];if(!Array.isArray(r))throw Error(`the second argument for the "in" operator must be an array`);let i;if(typeof r[0]==`string`){if(r[0]!==`literal`)throw Error(`for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions`);if(!Array.isArray(r[1]))throw Error(`failed to parse "in" expression: the literal operator must be followed by an array`);r=r[1],i=vc}else i=V;let a=Array(r.length);for(let e=0;e<a.length;e++)try{a[e]=Mc(r[e],i,n)}catch(t){throw Error(`failed to parse haystack item ${e} for "in" expression: ${t.message}`)}return[Mc(e[1],i,n),...a]}function Jc(e,t,n){let r;try{r=Mc(e[1],V,n)}catch(e){throw Error(`failed to parse first argument in palette expression: ${e.message}`)}let i=e[2];if(!Array.isArray(i))throw Error(`the second argument of palette must be an array`);let a=Array(i.length);for(let e=0;e<a.length;e++){let t;try{t=Mc(i[e],yc,n)}catch(t){throw Error(`failed to parse color at index ${e} in palette expression: ${t.message}`)}if(!(t instanceof kc))throw Error(`the palette color at index ${e} must be a literal value`);a[e]=t}return[r,...a]}function W(...e){return function(t,n,r){let i=t[0],a;for(let i=0;i<e.length;i++){let o=e[i](t,n,r);if(i==e.length-1){if(!o)throw Error(`expected last argument validator to return the parsed args`);a=o}}return new Ac(n,i,...a)}}function Yc(e,t,n){let r=e[0],i=Nc[r];if(!i)throw Error(`unknown operator: ${r}`);return i(e,t,n)}function Xc(e){if(!e)return``;let t=e.getType();switch(t){case`Point`:case`LineString`:case`Polygon`:return t;case`MultiPoint`:case`MultiLineString`:case`MultiPolygon`:return t.substring(5);case`Circle`:return`Polygon`;case`GeometryCollection`:return Xc(e.getGeometries()[0]);default:return``}}function Zc(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:``}}function Qc(e,t,n){return $c(Mc(e,t,n),n)}function $c(e,t){if(e instanceof kc){if(e.type===yc&&typeof e.value==`string`){let t=uc(e.value);return function(){return t}}return function(){return e.value}}let n=e.operator;switch(n){case H.Number:case H.String:case H.Coalesce:return el(e,t);case H.Get:case H.Var:case H.Has:return tl(e,t);case H.Id:return e=>e.featureId;case H.GeometryType:return e=>e.geometryType;case H.Concat:{let n=e.args.map(e=>$c(e,t));return e=>``.concat(...n.map(t=>t(e).toString()))}case H.Resolution:return e=>e.resolution;case H.Any:case H.All:case H.Between:case H.In:case H.Not:return rl(e,t);case H.Equal:case H.NotEqual:case H.LessThan:case H.LessThanOrEqualTo:case H.GreaterThan:case H.GreaterThanOrEqualTo:return nl(e,t);case H.Multiply:case H.Divide:case H.Add:case H.Subtract:case H.Clamp:case H.Mod:case H.Pow:case H.Abs:case H.Floor:case H.Ceil:case H.Round:case H.Sin:case H.Cos:case H.Atan:case H.Sqrt:return il(e,t);case H.Case:return al(e,t);case H.Match:return ol(e,t);case H.Interpolate:return sl(e,t);case H.ToString:return cl(e,t);default:throw Error(`Unsupported operator ${n}`)}}function el(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.Coalesce:return e=>{for(let t=0;t<r;++t){let n=i[t](e);if(n!=null)return n}throw Error(`Expected one of the values to be non-null`)};case H.Number:case H.String:return e=>{for(let t=0;t<r;++t){let r=i[t](e);if(typeof r===n)return r}throw Error(`Expected one of the values to be a ${n}`)};default:throw Error(`Unsupported assertion operator ${n}`)}}function tl(e,t){let n=e.args[0].value;switch(e.operator){case H.Get:return t=>{let r=e.args,i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;i=i[t]}return i};case H.Var:return e=>e.variables[n];case H.Has:return t=>{let r=e.args;if(!(n in t.properties))return!1;let i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;if(!i||!Object.hasOwn(i,t))return!1;i=i[t]}return!0};default:throw Error(`Unsupported accessor operator ${e.operator}`)}}function nl(e,t){let n=e.operator,r=$c(e.args[0],t),i=$c(e.args[1],t);switch(n){case H.Equal:return e=>r(e)===i(e);case H.NotEqual:return e=>r(e)!==i(e);case H.LessThan:return e=>r(e)<i(e);case H.LessThanOrEqualTo:return e=>r(e)<=i(e);case H.GreaterThan:return e=>r(e)>i(e);case H.GreaterThanOrEqualTo:return e=>r(e)>=i(e);default:throw Error(`Unsupported comparison operator ${n}`)}}function rl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.Any:return e=>{for(let t=0;t<r;++t)if(i[t](e))return!0;return!1};case H.All:return e=>{for(let t=0;t<r;++t)if(!i[t](e))return!1;return!0};case H.Between:return e=>{let t=i[0](e),n=i[1](e),r=i[2](e);return t>=n&&t<=r};case H.In:return e=>{let t=i[0](e);for(let n=1;n<r;++n)if(t===i[n](e))return!0;return!1};case H.Not:return e=>!i[0](e);default:throw Error(`Unsupported logical operator ${n}`)}}function il(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.Multiply:return e=>{let t=1;for(let n=0;n<r;++n)t*=i[n](e);return t};case H.Divide:return e=>i[0](e)/i[1](e);case H.Add:return e=>{let t=0;for(let n=0;n<r;++n)t+=i[n](e);return t};case H.Subtract:return e=>i[0](e)-i[1](e);case H.Clamp:return e=>{let t=i[0](e),n=i[1](e);if(t<n)return n;let r=i[2](e);return t>r?r:t};case H.Mod:return e=>i[0](e)%i[1](e);case H.Pow:return e=>i[0](e)**+i[1](e);case H.Abs:return e=>Math.abs(i[0](e));case H.Floor:return e=>Math.floor(i[0](e));case H.Ceil:return e=>Math.ceil(i[0](e));case H.Round:return e=>Math.round(i[0](e));case H.Sin:return e=>Math.sin(i[0](e));case H.Cos:return e=>Math.cos(i[0](e));case H.Atan:return r===2?e=>Math.atan2(i[0](e),i[1](e)):e=>Math.atan(i[0](e));case H.Sqrt:return e=>Math.sqrt(i[0](e));default:throw Error(`Unsupported numeric operator ${n}`)}}function al(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=$c(e.args[i],t);return e=>{for(let t=0;t<n-1;t+=2)if(r[t](e))return r[t+1](e);return r[n-1](e)}}function ol(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=$c(e.args[i],t);return e=>{let t=r[0](e);for(let i=1;i<n-1;i+=2)if(t===r[i](e))return r[i+1](e);return r[n-1](e)}}function sl(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=$c(e.args[i],t);return e=>{let t=r[0](e),i=r[1](e),a,o;for(let s=2;s<n;s+=2){let n=r[s](e),c=r[s+1](e),l=Array.isArray(c);if(l&&(c=rc(c)),n>=i)return s===2?c:l?ul(t,i,a,o,n,c):ll(t,i,a,o,n,c);a=n,o=c}return o}}function cl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.ToString:return t=>{let n=i[0](t);return e.args[0].type===yc?fc(n):n.toString()};default:throw Error(`Unsupported convert operator ${n}`)}}function ll(e,t,n,r,i,a){let o=i-n;if(o===0)return r;let s=t-n;return r+(e===1?s/o:(e**+s-1)/(e**+o-1))*(a-r)}function ul(e,t,n,r,i,a){if(i-n===0)return r;let o=cc(r),s=cc(a),c=s[2]-o[2];return c>180?c-=360:c<-180&&(c+=360),lc([ll(e,t,n,o[0],i,s[0]),ll(e,t,n,o[1],i,s[1]),o[2]+ll(e,t,n,0,i,c),ll(e,t,n,r[3],i,a[3])])}var G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},dl=class extends tt{constructor(e,t,n,r){super(),this.extent=e,this.pixelRatio_=n,this.resolution=t,this.state=typeof r==`function`?G.IDLE:r,this.image_=null,this.loader=typeof r==`function`?r:null}changed(){this.dispatchEvent(M.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==G.IDLE&&this.loader){this.state=G.LOADING,this.changed();let e=this.getResolution(),t=Array.isArray(e)?e[0]:e;Ze(()=>this.loader(this.getExtent(),t,this.getPixelRatio())).then(e=>{`image`in e&&(this.image_=e.image),`extent`in e&&(this.extent=e.extent),`resolution`in e&&(this.resolution=e.resolution),`pixelRatio`in e&&(this.pixelRatio_=e.pixelRatio),(e instanceof HTMLImageElement||bt&&e instanceof ImageBitmap||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement)&&(this.image_=e),this.state=G.LOADED}).catch(e=>{this.state=G.ERROR,console.error(e)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}};function fl(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[nt(r,M.LOAD,function(){o=!0,a||t()})];return r.src&&yt?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(nt(r,M.ERROR,n)),function(){i=!1,s.forEach(rt)}}function pl(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function ml(e,t){return t&&(e.src=t),e.src&&yt?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):pl(e)}var hl=class{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(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,n){let r=gl(e,t,n);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,n){let r=gl(e,t,n);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,n,r,i){let a=gl(e,t,n),o=a in this.cache_;this.cache_[a]=r,i&&(r.getImageState()===G.IDLE&&r.load(),r.getImageState()===G.LOADING?r.ready().then(()=>{this.patternCache_[a]=yo().createPattern(r.getImage(1),`repeat`)}):this.patternCache_[a]=yo().createPattern(r.getImage(1),`repeat`)),o||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function gl(e,t,n){let r=n?dc(n):`null`;return t+`:`+e+`:`+r}var _l=new hl,vl=null,yl=class extends tt{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n,this.canvas_={},this.color_=i,this.imageState_=r===void 0?G.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_===G.LOADED){vl||=_o(1,1,void 0,{willReadFrequently:!0}),vl.drawImage(this.image_,0,0);try{vl.getImageData(0,0,1,1),this.tainted_=!1}catch{vl=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(M.CHANGE)}handleImageError_(){this.imageState_=G.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=G.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_()){let e=this.size_[0],t=this.size_[1],n=_o(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===G.IDLE){this.image_||this.initializeImage_(),this.imageState_=G.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&ml(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_!==G.LOADED)return;let t=this.image_,n=_o(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=$s(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||=new Promise(e=>{if(this.imageState_===G.LOADED||this.imageState_===G.ERROR)e();else{let t=()=>{(this.imageState_===G.LOADED||this.imageState_===G.ERROR)&&(this.removeEventListener(M.CHANGE,t),e())};this.addEventListener(M.CHANGE,t)}}),this.ready_}};function bl(e,t,n,r,i,a){let o=t===void 0?void 0:_l.get(t,n,i);return o||(o=new yl(e,e&&`src`in e?e.src||void 0:t,n,r,i),_l.set(t,n,i,o,a)),a&&o&&!_l.getPattern(t,n,i)&&_l.set(t,n,i,o,a),o}function xl(e){return e?Array.isArray(e)?fc(e):typeof e==`object`&&`src`in e?Sl(e):e:null}function Sl(e){if(!e.offset||!e.size)return _l.getPattern(e.src,`anonymous`,e.color);let t=e.src+`:`+e.offset,n=_l.getPattern(t,void 0,e.color);if(n)return n;let r=_l.get(e.src,`anonymous`,null);if(r.getImageState()!==G.LOADED)return null;let i=_o(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),bl(i.canvas,t,void 0,G.LOADED,e.color,!0),_l.getPattern(t,void 0,e.color)}var Cl=`10px sans-serif`,wl=`#000`,Tl=`round`,El=[],Dl=`round`,Ol=`#000`,kl=`center`,Al=`middle`,jl=[0,0,0,0],Ml=new ct,Nl=null,Pl,Fl={},Il=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function Ll(e,t,n){return`${e} ${t} 16px "${n}"`}var Rl=(function(){let e,t;async function n(e){await t.ready;let n=await t.load(e);if(n.length===0)return!1;let r=go(e),i=r.families[0].toLowerCase(),a=r.weight;return n.some(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),n=ho[e.weight]||e.weight;return t===i&&e.style===r.style&&n==a})}async function r(){await t.ready;let i=!0,a=Ml.getProperties(),o=Object.keys(a).filter(e=>a[e]<100);for(let e=o.length-1;e>=0;--e){let t=o[e],r=a[t];r<100&&(await n(t)?(Qe(Fl),Ml.set(t,100)):(r+=10,Ml.set(t,r,!0),r<100&&(i=!1)))}e=void 0,i||(e=setTimeout(r,100))}return async function(n){t||=vt?self.fonts:document.fonts;let i=go(n);if(!i)return;let a=i.families,o=!1;for(let e of a){if(Il.has(e))continue;let t=Ll(i.style,i.weight,e);Ml.get(t)===void 0&&(Ml.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}})(),zl=(function(){let e;return function(t){let n=Fl[t];if(n==null){if(vt){let e=go(t),r=Bl(t,`Žg`);n=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);Fl[t]=n}return n}})();function Bl(e,t){return Nl||=_o(1,1),e!=Pl&&(Nl.font=e,Pl=Nl.font),Nl.measureText(t)}function Vl(e,t){return Bl(e,t).width}function Hl(e,t,n){if(t in n)return n[t];let r=t.split(`
|
|
3
|
-
`).reduce((t,n)=>Math.max(t,
|
|
4
|
-
`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=Vl(f,d);n.push(p),o+=p;let m=zl(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function Wl(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),Gl(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function Gl(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var Kl=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=hc(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return P()}getImage(e){return P()}getHitDetectionImage(){return P()}getPixelRatio(e){return 1}getImageState(){return P()}getImageSize(){return P()}getOrigin(){return P()}getSize(){return P()}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_=hc(e)}listenImageChange(e){P()}load(){P()}unlistenImageChange(e){P()}ready(){return Promise.resolve()}},ql=class e extends Kl{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView===void 0?!1:e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?G.LOADING:G.LOADED,this.imageState_===G.LOADING&&this.ready().then(()=>this.imageState_=G.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=_l.get(n,null,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=_o(i,i);this.draw_(t,a,e),r=a.canvas,_l.set(n,null,null,new yl(r,void 0,null,G.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,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m*2}createRenderOptions(){let e=Tl,t=Dl,n=0,r=null,i=0,a,o=0;this.stroke_&&(a=xl(this.stroke_.getColor()??`#000`),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??`round`,e=this.stroke_.getLineCap()??`round`,n=this.stroke_.getMiterLimit()??10);let s=this.calculateLineJoinSize_(t,o,n),c=Math.max(this.radius,this.radius2_||0),l=Math.ceil(2*c+s);return{strokeStyle:a,strokeWidth:o,size:l,lineCap:e,lineDash:r,lineDashOffset:i,lineJoin:t,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,n){if(t.scale(n,n),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();e===null&&(e=wl),t.fillStyle=xl(e),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 n=this.fill_.getColor(),r=0;typeof n==`string`&&(n=dc(n)),n===null?r=1:Array.isArray(n)&&(r=n.length===4?n[3]:1),r===0&&(t=_o(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_,n=this.radius;if(t===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(t*=2);let i=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let o=0;o<t;o++){let t=i+o*a,s=o%2==0?n:r;e.lineTo(s*Math.cos(t),s*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=wl,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()}},Jl=class e extends ql{constructor(e){e||={radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale===void 0?1:e.scale,rotation:e.rotation===void 0?0:e.rotation,rotateWithView:e.rotateWithView===void 0?!1:e.rotateWithView,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode})}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}setRadius(e){this.radius=e,this.render()}},Yl=class e{constructor(e){e||={},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){if(typeof e==`object`&&e&&`src`in e){let t=bl(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()===G.IDLE&&t.load(),t.getImageState()===G.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?F(e):typeof e==`object`&&`src`in e?e.src+`:`+e.offset:dc(e).toString():``}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}};function Xl(e,t,n,r){return n!==void 0&&r!==void 0?[n/e,r/t]:n===void 0?r===void 0?1:r/t:n/e}var Zl=class e extends Kl{constructor(e){e||={};let t=e.opacity===void 0?1:e.opacity,n=e.rotation===void 0?0:e.rotation,r=e.scale===void 0?1:e.scale,i=e.rotateWithView===void 0?!1:e.rotateWithView;super({opacity:t,rotation:n,scale:r,displacement:e.displacement===void 0?[0,0]:e.displacement,rotateWithView:i,declutterMode:e.declutterMode}),this.anchor_=e.anchor===void 0?[.5,.5]:e.anchor,this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin===void 0?`top-left`:e.anchorOrigin,this.anchorXUnits_=e.anchorXUnits===void 0?`fraction`:e.anchorXUnits,this.anchorYUnits_=e.anchorYUnits===void 0?`fraction`:e.anchorYUnits,this.crossOrigin_=e.crossOrigin===void 0?null:e.crossOrigin;let a=e.img===void 0?null:e.img,o=e.src;R(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||F(a)),R(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),R(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let s;if(e.src===void 0?a!==void 0&&(s=`complete`in a?a.complete?a.src?G.LOADED:G.IDLE:G.LOADING:G.LOADED):s=G.IDLE,this.color_=e.color===void 0?null:dc(e.color),this.iconImage_=bl(a,o,this.crossOrigin_,s,this.color_),this.offset_=e.offset===void 0?[0,0]:e.offset,this.offsetOrigin_=e.offsetOrigin===void 0?`top-left`:e.offsetOrigin,this.origin_=null,this.size_=e.size===void 0?null:e.size,this.initialOptions_,e.width!==void 0||e.height!==void 0){let t,n;if(e.size)[t,n]=e.size;else{let r=this.getImage(1);if(r.width&&r.height)t=r.width,n=r.height;else if(r instanceof HTMLImageElement){this.initialOptions_=e;let t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;let n=this.iconImage_.getSize();this.setScale(Xl(n[0],n[1],e.width,e.height))};this.listenImageChange(t);return}}t!==void 0&&this.setScale(Xl(t,n,e.width,e.height))}}clone(){let t,n,r;return this.initialOptions_?(n=this.initialOptions_.width,r=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new e({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:t,width:n,height:r,size:this.size_===null?void 0:this.size_.slice(),src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if(this.anchorXUnits_==`fraction`||this.anchorYUnits_==`fraction`){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==`fraction`&&(e[0]*=t[0]),this.anchorYUnits_==`fraction`&&(e[1]*=t[1])}if(this.anchorOrigin_!=`top-left`){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==`top-right`||this.anchorOrigin_==`bottom-right`)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==`bottom-left`||this.anchorOrigin_==`bottom-right`)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]-t[0]/n[0],e[1]+t[1]/n[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`){let t=this.getSize(),n=this.iconImage_.getSize();if(!t||!n)return null;e=e.slice(),(this.offsetOrigin_==`top-right`||this.offsetOrigin_==`bottom-right`)&&(e[0]=n[0]-t[0]-e[0]),(this.offsetOrigin_==`bottom-left`||this.offsetOrigin_==`bottom-right`)&&(e[1]=n[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=bl(null,e,this.crossOrigin_,G.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==G.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){let e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==G.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(M.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(M.CHANGE,e)}ready(){return this.iconImage_.ready()}},Ql=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(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}},$l=class e{constructor(e){e||={},this.geometry_=null,this.geometryFunction_=iu,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill===void 0?null:e.fill,this.image_=e.image===void 0?null:e.image,this.renderer_=e.renderer===void 0?null:e.renderer,this.hitDetectionRenderer_=e.hitDetectionRenderer===void 0?null:e.hitDetectionRenderer,this.stroke_=e.stroke===void 0?null:e.stroke,this.text_=e.text===void 0?null:e.text,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&typeof t==`object`&&(t=t.clone()),new e({geometry:t??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_=iu,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function eu(e){let t;if(typeof e==`function`)t=e;else{let n;Array.isArray(e)?n=e:(R(typeof e.getZIndex==`function`,"Expected an `Style` or an array of `Style`"),n=[e]),t=function(){return n}}return t}var tu=null;function nu(e,t){if(!tu){let e=new Yl({color:`rgba(255,255,255,0.4)`}),t=new Ql({color:`#3399CC`,width:1.25});tu=[new $l({image:new Jl({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return tu}function ru(){let e={},t=[255,255,255,1],n=[0,153,255,1];return e.Polygon=[new $l({fill:new Yl({color:[255,255,255,.5]})})],e.MultiPolygon=e.Polygon,e.LineString=[new $l({stroke:new Ql({color:t,width:5})}),new $l({stroke:new Ql({color:n,width:3})})],e.MultiLineString=e.LineString,e.Circle=e.Polygon.concat(e.LineString),e.Point=[new $l({image:new Jl({radius:6,fill:new Yl({color:n}),stroke:new Ql({color:t,width:3/2})}),zIndex:1/0})],e.MultiPoint=e.Point,e.GeometryCollection=e.Polygon.concat(e.LineString,e.Point),e}function iu(e){return e.getGeometry()}var au=`#333`,ou=class e{constructor(e){e||={},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=hc(e.scale===void 0?1:e.scale),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?new Yl({color:au}):e.fill,this.maxAngle_=e.maxAngle===void 0?Math.PI/4:e.maxAngle,this.placement_=e.placement===void 0?`point`:e.placement,this.overflow_=!!e.overflow,this.stroke_=e.stroke===void 0?null:e.stroke,this.offsetX_=e.offsetX===void 0?0:e.offsetX,this.offsetY_=e.offsetY===void 0?0:e.offsetY,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(){let t=this.getScale();return new e({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(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof Yl?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_=hc(e===void 0?1:e)}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 su(e){return!0}function cu(e){let t=jc(),n=uu(e,t),r=Zc();return function(e,i){if(r.properties=e.getPropertiesInternal(),r.resolution=i,t.featureId){let t=e.getId();t===void 0?r.featureId=null:r.featureId=t}return t.geometryType&&(r.geometryType=Xc(e.getGeometry())),n(r)}}function lu(e){let t=jc(),n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=du(e[i],t);let i=Zc(),a=Array(n);return function(e,o){if(i.properties=e.getPropertiesInternal(),i.resolution=o,t.featureId){let t=e.getId();t===void 0?i.featureId=null:i.featureId=t}let s=0;for(let e=0;e<n;++e){let t=r[e](i);t&&(a[s]=t,s+=1)}return a.length=s,a}}function uu(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i){let n=e[i],a=`filter`in n?Qc(n.filter,_c,t):su,o;if(Array.isArray(n.style)){let e=n.style.length;o=Array(e);for(let r=0;r<e;++r)o[r]=du(n.style[r],t)}else o=[du(n.style,t)];r[i]={filter:a,styles:o}}return function(t){let i=[],a=!1;for(let o=0;o<n;++o){let n=r[o].filter;if(n(t)&&!(e[o].else&&a)){a=!0;for(let e of r[o].styles){let n=e(t);n&&i.push(n)}}}return i}}function du(e,t){let n=fu(e,``,t),r=pu(e,``,t),i=mu(e,t),a=hu(e,t),o=yu(e,`z-index`,t);if(!n&&!r&&!i&&!a&&!$e(e))throw Error(`No fill, stroke, point, or text symbolizer properties in style: `+JSON.stringify(e));let s=new $l;return function(e){let t=!0;if(n){let r=n(e);r&&(t=!1),s.setFill(r)}if(r){let n=r(e);n&&(t=!1),s.setStroke(n)}if(i){let n=i(e);n&&(t=!1),s.setText(n)}if(a){let n=a(e);n&&(t=!1),s.setImage(n)}return o&&s.setZIndex(o(e)),t?null:s}}function fu(e,t,n){let r;if(t+`fill-pattern-src`in e)r=xu(e,t+`fill-`,n);else{if(e[t+`fill-color`]===`none`)return e=>null;r=Cu(e,t+`fill-color`,n)}if(!r)return null;let i=new Yl;return function(e){let t=r(e);return t===Us?null:(i.setColor(t),i)}}function pu(e,t,n){let r=yu(e,t+`stroke-width`,n),i=Cu(e,t+`stroke-color`,n);if(!r&&!i)return null;let a=bu(e,t+`stroke-line-cap`,n),o=bu(e,t+`stroke-line-join`,n),s=wu(e,t+`stroke-line-dash`,n),c=yu(e,t+`stroke-line-dash-offset`,n),l=yu(e,t+`stroke-miter-limit`,n),u=new Ql;return function(e){if(i){let t=i(e);if(t===Us)return null;u.setColor(t)}if(r&&u.setWidth(r(e)),a){let t=a(e);if(t!==`butt`&&t!==`round`&&t!==`square`)throw Error(`Expected butt, round, or square line cap`);u.setLineCap(t)}if(o){let t=o(e);if(t!==`bevel`&&t!==`round`&&t!==`miter`)throw Error(`Expected bevel, round, or miter line join`);u.setLineJoin(t)}return s&&u.setLineDash(s(e)),c&&u.setLineDashOffset(c(e)),l&&u.setMiterLimit(l(e)),u}}function mu(e,t){let n=`text-`,r=bu(e,n+`value`,t);if(!r)return null;let i=fu(e,n,t),a=fu(e,n+`background-`,t),o=pu(e,n,t),s=pu(e,n+`background-`,t),c=bu(e,n+`font`,t),l=yu(e,n+`max-angle`,t),u=yu(e,n+`offset-x`,t),d=yu(e,n+`offset-y`,t),f=Su(e,n+`overflow`,t),p=bu(e,n+`placement`,t),m=yu(e,n+`repeat`,t),h=Du(e,n+`scale`,t),g=Su(e,n+`rotate-with-view`,t),_=yu(e,n+`rotation`,t),v=bu(e,n+`align`,t),y=bu(e,n+`justify`,t),b=bu(e,n+`baseline`,t),x=Su(e,n+`keep-upright`,t),S=wu(e,n+`padding`,t),C=new ou({declutterMode:Pu(e,n+`declutter-mode`)});return function(e){if(C.setText(r(e)),i&&C.setFill(i(e)),a&&C.setBackgroundFill(a(e)),o&&C.setStroke(o(e)),s&&C.setBackgroundStroke(s(e)),c&&C.setFont(c(e)),l&&C.setMaxAngle(l(e)),u&&C.setOffsetX(u(e)),d&&C.setOffsetY(d(e)),f&&C.setOverflow(f(e)),p){let t=p(e);if(t!==`point`&&t!==`line`)throw Error(`Expected point or line for text-placement`);C.setPlacement(t)}if(m&&C.setRepeat(m(e)),h&&C.setScale(h(e)),g&&C.setRotateWithView(g(e)),_&&C.setRotation(_(e)),v){let t=v(e);if(t!==`left`&&t!==`center`&&t!==`right`&&t!==`end`&&t!==`start`)throw Error(`Expected left, right, center, start, or end for text-align`);C.setTextAlign(t)}if(y){let t=y(e);if(t!==`left`&&t!==`right`&&t!==`center`)throw Error(`Expected left, right, or center for text-justify`);C.setJustify(t)}if(b){let t=b(e);if(t!==`bottom`&&t!==`top`&&t!==`middle`&&t!==`alphabetic`&&t!==`hanging`)throw Error(`Expected bottom, top, middle, alphabetic, or hanging for text-baseline`);C.setTextBaseline(t)}return S&&C.setPadding(S(e)),x&&C.setKeepUpright(x(e)),C}}function hu(e,t){return`icon-src`in e?gu(e,t):`shape-points`in e?_u(e,t):`circle-radius`in e?vu(e,t):null}function gu(e,t){let n=`icon-`,r=n+`src`,i=Lu(e[r],r),a=Tu(e,n+`anchor`,t),o=Du(e,n+`scale`,t),s=yu(e,n+`opacity`,t),c=Tu(e,n+`displacement`,t),l=yu(e,n+`rotation`,t),u=Su(e,n+`rotate-with-view`,t),d=ju(e,n+`anchor-origin`),f=Mu(e,n+`anchor-x-units`),p=Mu(e,n+`anchor-y-units`),m=Fu(e,n+`color`),h=Au(e,n+`cross-origin`),g=Nu(e,n+`offset`),_=ju(e,n+`offset-origin`),v=Ou(e,n+`width`),y=new Zl({src:i,anchorOrigin:d,anchorXUnits:f,anchorYUnits:p,color:m,crossOrigin:h,offset:g,offsetOrigin:_,height:Ou(e,n+`height`),width:v,size:ku(e,n+`size`),declutterMode:Pu(e,n+`declutter-mode`)});return function(e){return s&&y.setOpacity(s(e)),c&&y.setDisplacement(c(e)),l&&y.setRotation(l(e)),u&&y.setRotateWithView(u(e)),o&&y.setScale(o(e)),a&&y.setAnchor(a(e)),y}}function _u(e,t){let n=`shape-`,r=n+`points`,i=n+`radius`,a=Ru(e[r],r),o=Ru(e[i],i),s=fu(e,n,t),c=pu(e,n,t),l=Du(e,n+`scale`,t),u=Tu(e,n+`displacement`,t),d=yu(e,n+`rotation`,t),f=Su(e,n+`rotate-with-view`,t),p=new ql({points:a,radius:o,radius2:Ou(e,n+`radius2`),angle:Ou(e,n+`angle`),declutterMode:Pu(e,n+`declutter-mode`)});return function(e){return s&&p.setFill(s(e)),c&&p.setStroke(c(e)),u&&p.setDisplacement(u(e)),d&&p.setRotation(d(e)),f&&p.setRotateWithView(f(e)),l&&p.setScale(l(e)),p}}function vu(e,t){let n=`circle-`,r=fu(e,n,t),i=pu(e,n,t),a=yu(e,n+`radius`,t),o=Du(e,n+`scale`,t),s=Tu(e,n+`displacement`,t),c=yu(e,n+`rotation`,t),l=Su(e,n+`rotate-with-view`,t),u=new Jl({radius:5,declutterMode:Pu(e,n+`declutter-mode`)});return function(e){return a&&u.setRadius(a(e)),r&&u.setFill(r(e)),i&&u.setStroke(i(e)),s&&u.setDisplacement(s(e)),c&&u.setRotation(c(e)),l&&u.setRotateWithView(l(e)),o&&u.setScale(o(e)),u}}function yu(e,t,n){if(!(t in e))return;let r=Qc(e[t],V,n);return function(e){return Ru(r(e),t)}}function bu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],vc,n);return function(e){return Lu(r(e),t)}}function xu(e,t,n){let r=bu(e,t+`pattern-src`,n),i=Eu(e,t+`pattern-offset`,n),a=Eu(e,t+`pattern-size`,n),o=Cu(e,t+`color`,n);return function(e){return{src:r(e),offset:i&&i(e),size:a&&a(e),color:o&&o(e)}}}function Su(e,t,n){if(!(t in e))return null;let r=Qc(e[t],_c,n);return function(e){let n=r(e);if(typeof n!=`boolean`)throw Error(`Expected a boolean for ${t}`);return n}}function Cu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],yc,n);return function(e){return zu(r(e),t)}}function wu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc,n);return function(e){return Iu(r(e),t)}}function Tu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc,n);return function(e){let n=Iu(r(e),t);if(n.length!==2)throw Error(`Expected two numbers for ${t}`);return n}}function Eu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc,n);return function(e){return Bu(r(e),t)}}function Du(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc|V,n);return function(e){return Vu(r(e),t)}}function Ou(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`number`)throw Error(`Expected a number for ${t}`);return n}}function ku(e,t){let n=e[t];if(n!==void 0){if(typeof n==`number`)return hc(n);if(!Array.isArray(n)||n.length!==2||typeof n[0]!=`number`||typeof n[1]!=`number`)throw Error(`Expected a number or size array for ${t}`);return n}}function Au(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);return n}}function ju(e,t){let n=e[t];if(n!==void 0){if(n!==`bottom-left`&&n!==`bottom-right`&&n!==`top-left`&&n!==`top-right`)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return n}}function Mu(e,t){let n=e[t];if(n!==void 0){if(n!==`pixels`&&n!==`fraction`)throw Error(`Expected pixels or fraction for ${t}`);return n}}function Nu(e,t){let n=e[t];if(n!==void 0)return Iu(n,t)}function Pu(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);if(n!==`declutter`&&n!==`obstacle`&&n!==`none`)throw Error(`Expected declutter, obstacle, or none for ${t}`);return n}}function Fu(e,t){let n=e[t];if(n!==void 0)return zu(n,t)}function Iu(e,t){if(!Array.isArray(e))throw Error(`Expected an array for ${t}`);let n=e.length;for(let r=0;r<n;++r)if(typeof e[r]!=`number`)throw Error(`Expected an array of numbers for ${t}`);return e}function Lu(e,t){if(typeof e!=`string`)throw Error(`Expected a string for ${t}`);return e}function Ru(e,t){if(typeof e!=`number`)throw Error(`Expected a number for ${t}`);return e}function zu(e,t){if(typeof e==`string`)return e;let n=Iu(e,t),r=n.length;if(r<3||r>4)throw Error(`Expected a color with 3 or 4 values for ${t}`);return n}function Bu(e,t){let n=Iu(e,t);if(n.length!==2)throw Error(`Expected an array of two numbers for ${t}`);return n}function Vu(e,t){return typeof e==`number`?e:Bu(e,t)}var Hu={RENDER_ORDER:`renderOrder`},Uu=class extends Cs{constructor(e){e||={};let 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?100:e.renderBuffer,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating===void 0?!1:e.updateWhileAnimating,this.updateWhileInteracting_=e.updateWhileInteracting===void 0?!1:e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Hu.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){let n=this.getDeclutter();n in e.declutter||(e.declutter[n]=new Os(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(Hu.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?nu:e;let t=Wu(e);this.styleFunction_=e===null?void 0:eu(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}};function Wu(e){if(e===void 0)return nu;if(!e)return null;if(typeof e==`function`||e instanceof $l)return e;if(!Array.isArray(e))return lu([e]);if(e.length===0)return[];let t=e.length,n=e[0];if(n instanceof $l){let n=Array(t);for(let r=0;r<t;++r){let t=e[r];if(!(t instanceof $l))throw Error(`Expected a list of style instances`);n[r]=t}return n}if(`style`in n){let n=Array(t);for(let r=0;r<t;++r){let t=e[r];if(!(`style`in t))throw Error(`Expected a list of rules with a style property`);n[r]=t}return cu(n)}return lu(e)}var Gu=class extends et{constructor(e,t,n,r){super(e),this.inversePixelTransform=t,this.frameState=n,this.context=r}},Ku=class extends Re{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){P()}calculateMatrices2D(e){let t=e.viewState,n=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Ni(n,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Pi(r,n)}forEachFeatureAtCoordinate(e,t,n,r,i,a,o,s){let c,l=t.viewState;function u(e,t,n,r){return i.call(a,t,e?n:null,r)}let d=l.projection,f=Bn(e.slice(),d),p=[[0,0]];if(d.canWrapX()&&r){let e=z(d.getExtent());p.push([-e,0],[e,0])}let m=t.layerStatesArray,h=m.length,g=[],_=[];for(let r=0;r<p.length;r++)for(let i=h-1;i>=0;--i){let a=m[i],d=a.layer;if(d.hasRenderer()&&ws(a,l)&&o.call(s,d)){let i=d.getRenderer(),o=d.getSource();if(i&&o){let s=o.getWrapX()?f:e,l=u.bind(null,a.managed);_[0]=s[0]+p[r][0],_[1]=s[1]+p[r][1],c=i.forEachFeatureAtCoordinate(_,t,n,l,g)}if(c)return c}}if(g.length===0)return;let v=1/g.length;return g.forEach((e,t)=>e.distanceSq+=t*v),g.sort((e,t)=>e.distanceSq-t.distanceSq),g.some(e=>c=e.callback(e.feature,e.layer,e.geometry)),c}hasFeatureAtCoordinate(e,t,n,r,i,a){return this.forEachFeatureAtCoordinate(e,t,n,r,qe,this,i,a)!==void 0}getMap(){return this.map_}renderFrame(e){P()}scheduleExpireIconCache(e){_l.canExpireCache()&&e.postRenderFunctions.push(qu)}};function qu(e,t){_l.expire()}var Ju=class extends Ku{constructor(e){super(e),this.fontChangeListenerKey_=N(Ml,Le.PROPERTYCHANGE,e.redrawText,e),this.element_=vt?wo():document.createElement(`div`);let t=this.element_.style;t.position=`absolute`,t.width=`100%`,t.height=`100%`,t.zIndex=`0`,this.element_.className=lo+` ol-layers`;let n=e.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let n=this.getMap();if(n.hasListener(e)){let r=new Gu(e,void 0,t);n.dispatchEvent(r)}}disposeInternal(){rt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&=(this.element_.style.display=`none`,!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Ss.PRECOMPOSE,e);let t=e.layerStatesArray.sort((e,t)=>e.zIndex-t.zIndex);t.some(e=>e.layer instanceof Uu&&e.layer.getDeclutter())&&(e.declutter={});let n=e.viewState;this.children_.length=0;let r=[],i=null;for(let a=0,o=t.length;a<o;++a){let o=t[a];e.layerIndex=a;let s=o.layer,c=s.getSourceState();if(!ws(o,n)||c!=`ready`&&c!=`undefined`){s.unrender();continue}let l=s.render(e,i);l&&(l!==i&&(this.children_.push(l),i=l),r.push(o))}this.declutter(e,r),Co(this.element_,this.children_);let a=this.getMap().getTargetElement();if(To(a)){let e=a.getContext(`2d`);for(let t of this.children_){let n=t.firstElementChild||t,r=t.style.backgroundColor;if(r&&(!To(n)||n.width>0)&&(e.fillStyle=r,e.fillRect(0,0,a.width,a.height)),To(n)&&n.width>0){let r=t.style.opacity||n.style.opacity;e.globalAlpha=r===``?1:Number(r);let i=n.style.transform;if(i)e.setTransform(...Ri(i));else{let t=parseFloat(n.style.width)/n.width,r=parseFloat(n.style.height)/n.height;e.setTransform(t,0,0,r,0,0)}e.drawImage(n,0,0)}}e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent(Ss.POSTCOMPOSE,e),this.renderedVisible_||=(this.element_.style.display=``,!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let n=t.length-1;n>=0;--n){let r=t[n],i=r.layer;i.getDeclutter()&&i.renderDeclutter(e,r)}t.forEach(t=>t.layer.renderDeferred(e))}}};function Yu(e){if(e instanceof Cs){e.setMapInternal(null);return}e instanceof xs&&e.getLayers().forEach(Yu)}function Xu(e,t){if(e instanceof Cs){e.setMapInternal(t);return}if(e instanceof xs){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)Xu(n[e],t)}}var Zu=class extends ct{constructor(e){super(),e||={},this.on,this.once,this.un;let t=Qu(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading===void 0?16:e.maxTilesLoading,this.pixelRatio_=e.pixelRatio===void 0?_t:e.pixelRatio,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Ti(),this.pixelToCoordinateTransform_=Ti(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,vt||(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,vt||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(vt?new dt:Ao()),this.interactions=t.interactions||(vt?new dt:hs({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Ot(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Tt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Tt.VIEW,this.handleViewChanged_),this.addChangeListener(Tt.SIZE,this.handleSizeChanged_),this.addChangeListener(Tt.TARGET,this.handleTargetChanged_),this.setProperties(t.values);let n=this;e.view&&!(e.view instanceof to)&&e.view.then(function(e){n.setView(new to(e))}),this.controls.addEventListener(Ie.ADD,e=>{e.element.setMap(this)}),this.controls.addEventListener(Ie.REMOVE,e=>{e.element.setMap(null)}),this.interactions.addEventListener(Ie.ADD,e=>{e.element.setMap(this)}),this.interactions.addEventListener(Ie.REMOVE,e=>{e.element.setMap(null)}),this.overlays_.addEventListener(Ie.ADD,e=>{this.addOverlayInternal_(e.element)}),this.overlays_.addEventListener(Ie.REMOVE,e=>{let t=e.element.getId();t!==void 0&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}),this.controls.forEach(e=>{e.setMap(this)}),this.interactions.forEach(e=>{e.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){Xu(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,n){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(e);n=n===void 0?{}:n;let i=n.hitTolerance===void 0?0:n.hitTolerance,a=n.layerFilter===void 0?qe:n.layerFilter,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,o,t,null,a,null)}getFeaturesAtPixel(e,t){let n=[];return this.forEachFeatureAtPixel(e,function(e){n.push(e)},t),n}getAllLayers(){let e=[];function t(n){n.forEach(function(n){n instanceof xs?t(n.getLayers()):e.push(n)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let n=this.getCoordinateFromPixelInternal(e);t=t===void 0?{}:t;let r=t.layerFilter===void 0?qe:t.layerFilter,i=t.hitTolerance===void 0?0:t.hitTolerance,a=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_.getBoundingClientRect(),n=this.getSize(),r=t.width/n[0],i=t.height/n[1],a=`changedTouches`in e?e.changedTouches[0]:e;return[(a.clientX-t.left)/r,(a.clientY-t.top)/i]}getTarget(){return this.get(Tt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return vi(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?Ai(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return t===void 0?null:t}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Tt.LAYERGROUP)}setLayers(e){let t=this.getLayerGroup();if(e instanceof dt){t.setLayers(e);return}let n=t.getLayers();n.clear(),n.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){let n=e[t];if(!n.visible)continue;let r=n.layer.getRenderer();if(r&&!r.ready)return!0;let i=n.layer.getSource();if(i&&i.loading)return!0}return!1}getPixelFromCoordinate(e){let t=yi(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){let t=this.frameState_;return t?Ai(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Tt.SIZE)}getView(){return this.get(Tt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,n,r){return kt(this.frameState_,e,t,n,r)}handleBrowserEvent(e,t){t||=e.type;let n=new pt(t,this,e);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(e){if(!this.frameState_)return;let t=e.originalEvent,n=t.type;if(n===St.POINTERDOWN||n===M.WHEEL||n===M.KEYDOWN){let e=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():e,r=t.target,i=n instanceof ShadowRoot?n.host===r?n.host.ownerDocument:n:n===e?e.documentElement:n;if(this.overlayContainerStopEvent_.contains(r)||!i.contains(r))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){let t=this.getInteractions().getArray().slice();for(let n=t.length-1;n>=0;n--){let r=t[n];if(!(r.getMap()!==this||!r.getActive()||!this.getTargetElement())&&(!r.handleEvent(e)||e.propagationStopped))break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let n=this.maxTilesLoading_,r=n;if(e){let t=e.viewHints;if(t[At.ANIMATING]||t[At.INTERACTING]){let t=Date.now()-e.time>8;n=t?0:8,r=t?0:2}}t.getTilesLoading()<n&&(t.reprioritize(),t.loadMoreTiles(n,r))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Ss.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Ss.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new ft(wt.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new ft(wt.LOADSTART,this,e))));let n=this.postRenderFunctions_;if(e)for(let t=0,r=n.length;t<r;++t)n[t](this,e);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let e=0,t=this.targetChangeHandlerKeys_.length;e<t;++e)rt(this.targetChangeHandlerKeys_[e]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(M.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(M.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!To(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);let e=this.targetElement_.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.unobserve(e.host),this.setSize(void 0)}let 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(),null),this.animationDelayKey_&&=(cancelAnimationFrame(this.animationDelayKey_),void 0);else{if(To(t)||t.appendChild(this.viewport_),this.renderer_||=new Ju(this),!To(t)){this.mapBrowserEventHandler_=new Ct(this,this.moveTolerance_);for(let e in I)this.mapBrowserEventHandler_.addEventListener(I[e],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(M.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(M.WHEEL,this.boundHandleBrowserEvent_,xt?{passive:!1}:!1);let e;if(this.keyboardEventTarget_)e=this.keyboardEventTarget_;else{let n=t.getRootNode();e=n instanceof ShadowRoot?n.host:t}if(this.targetChangeHandlerKeys_=[N(e,M.KEYDOWN,this.handleBrowserEvent,this),N(e,M.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){let e=t.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.observe(e.host),this.resizeObserver_?.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&=(rt(this.viewPropertyListenerKey_),null),this.viewChangeListenerKey_&&=(rt(this.viewChangeListenerKey_),null);let e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=N(e,Le.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(e,M.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&=(this.layerGroupPropertyListenerKeys_.forEach(rt),null);let e=this.getLayerGroup();e&&(this.handleLayerAdd_(new ys(`addlayer`,e)),this.layerGroupPropertyListenerKeys_=[N(e,Le.PROPERTYCHANGE,this.render,this),N(e,M.CHANGE,this.render,this),N(e,`addlayer`,this.handleLayerAdd_,this),N(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;let e=this.frameState_.layerStatesArray;for(let t=0,n=e.length;t<n;++t){let n=e[t].layer;n.hasRenderer()&&n.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){Yu(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){let t=this.getSize(),n=this.getView(),r=this.frameState_,i=null;if(t!==void 0&&pc(t)&&n&&n.isDef()){let r=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:yn(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:r,wantedTiles:{},mapId:F(this),renderTargets:{}},a.nextCenter&&a.nextResolution){let e=isNaN(a.nextRotation)?a.rotation:a.nextRotation;i.nextExtent=yn(a.nextCenter,a.nextResolution,e,t)}}this.frameState_=i,this.renderer_.renderFrame(i),i&&(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),r&&(!this.previousExtent_||!En(this.previousExtent_)&&!cn(i.extent,this.previousExtent_))&&(this.dispatchEvent(new ft(wt.MOVESTART,this,r)),this.previousExtent_=an(this.previousExtent_)),this.previousExtent_&&!i.viewHints[At.ANIMATING]&&!i.viewHints[At.INTERACTING]&&!cn(i.extent,this.previousExtent_)&&(this.dispatchEvent(new ft(wt.MOVEEND,this,i)),Xt(i.extent,this.previousExtent_))),this.dispatchEvent(new ft(wt.POSTRENDER,this,i)),this.renderComplete_=(this.hasListener(wt.LOADSTART)||this.hasListener(wt.LOADEND)||this.hasListener(Ss.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0)}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new ys(`removelayer`,t)),this.set(Tt.LAYERGROUP,e)}setSize(e){this.set(Tt.SIZE,e)}setTarget(e){this.set(Tt.TARGET,e)}setView(e){if(!e||e instanceof to){this.set(Tt.VIEW,e);return}this.set(Tt.VIEW,new to);let t=this;e.then(function(e){t.setView(new to(e))})}updateSize(){let e=this.getTargetElement(),t;if(e){let n,r;if(To(e))n=e.width,r=e.height;else{let t=getComputedStyle(e);n=e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),r=e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)}!isNaN(n)&&!isNaN(r)&&(t=[Math.max(0,n),Math.max(0,r)],!pc(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&Yn(`No map visible because the map container's width or height are 0.`))}let n=this.getSize();t&&(!n||!Ge(t,n))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){let t=this.getView();t&&t.setViewportSize(e)}};function Qu(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget==`string`?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let n={},r=e.layers&&typeof e.layers.getLayers==`function`?e.layers:new xs({layers:e.layers});n[Tt.LAYERGROUP]=r,n[Tt.TARGET]=e.target,n[Tt.VIEW]=e.view instanceof to?e.view:new to;let i;e.controls!==void 0&&(Array.isArray(e.controls)?i=new dt(e.controls.slice()):(R(typeof e.controls.getArray==`function`,"Expected `controls` to be an array or an `ol/Collection.js`"),i=e.controls));let a;e.interactions!==void 0&&(Array.isArray(e.interactions)?a=new dt(e.interactions.slice()):(R(typeof e.interactions.getArray==`function`,"Expected `interactions` to be an array or an `ol/Collection.js`"),a=e.interactions));let o;return e.overlays===void 0?o=new dt:Array.isArray(e.overlays)?o=new dt(e.overlays.slice()):(R(typeof e.overlays.getArray==`function`,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=e.overlays),{controls:i,interactions:a,keyboardEventTarget:t,overlays:o,values:n}}var $u=class e extends ct{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`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}clone(){let t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let n=this.getGeometry();n&&t.setGeometry(n.clone());let r=this.getStyle();return r&&t.setStyle(r),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&=(rt(this.geometryChangeKey_),null);let e=this.getGeometry();e&&(this.geometryChangeKey_=N(e,M.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?ed(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 ed(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(R(typeof e.getZIndex==`function`,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}function td(e,t,n,r){let i=[],a=nn();for(let o=0,s=n.length;o<s;++o){let s=n[o];a=sn(e,t,s[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=s[s.length-1]}return i}function nd(e,t,n,r,i,a,o){let s,c,l=(n-t)/r;if(l===1)s=t;else if(l===2)s=t,c=i;else if(l!==0){let a=e[t],o=e[t+1],l=0,u=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];l+=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),u.push(l),a=t,o=n}let d=i*l,f=ze(u,d);f<0?(c=(d-u[-f-2])/(u[-f-1]-u[-f-2]),s=t+(-f-2)*r):s=t+f*r}o=o>1?o:2,a||=Array(o);for(let t=0;t<o;++t)a[t]=s===void 0?NaN:c===void 0?e[s+t]:zt(e[s+t],e[s+r+t],c);return a}function rd(e,t,n,r,i,a){if(n==t)return null;let o;if(i<e[t+r-1])return a?(o=e.slice(t,t+r),o[r-1]=i,o):null;if(e[n-1]<i)return a?(o=e.slice(n-r,n),o[r-1]=i,o):null;if(i==e[t+r-1])return e.slice(t,t+r);let s=t/r,c=n/r;for(;s<c;){let t=s+c>>1;i<e[(t+1)*r-1]?c=t:s=t+1}let l=e[s*r-1];if(i==l)return e.slice((s-1)*r,(s-1)*r+r);let u=e[(s+1)*r-1],d=(i-l)/(u-l);o=[];for(let t=0;t<r-1;++t)o.push(zt(e[(s-1)*r+t],e[s*r+t],d));return o.push(i),o}function id(e,t,n,r,i,a,o){if(o)return rd(e,t,n[n.length-1],r,i,a);let s;if(i<e[r-1])return a?(s=e.slice(0,r),s[r-1]=i,s):null;if(e[e.length-1]<i)return a?(s=e.slice(e.length-r),s[r-1]=i,s):null;for(let a=0,o=n.length;a<o;++a){let o=n[a];if(t!=o){if(i<e[t+r-1])return null;if(i<=e[o-1])return rd(e,t,o,r,i,!1);t=o}}return null}var ad=class e extends qi{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return rn(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let 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){if(Tn(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]?!0:pn(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=sa(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(Vi(n,0,n.length,r,e,t,n)),this.changed()}};ad.prototype.transform;var od=class e extends Ki{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(rt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(N(e[t],M.CHANGE,this.changed,this))}clone(){let t=new e(sd(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Zt(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){an(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)ln(e,t[n].getExtent());return e}getGeometries(){return sd(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=_n(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(sd(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function sd(e){return e.map(e=>e.clone())}function cd(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}var ld=class e extends qi{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){We(this.flatCoordinates,e),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,n,r))}forEachSegment(e){return Oa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!=`XYM`&&this.layout!=`XYZM`?null:(t=t===void 0?!1:t,rd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return nd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return cd(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(t){let n=[];return n.length=ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LineString`}intersectsExtent(e){return ka(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ca(this.flatCoordinates,0,e,this.stride),this.changed()}},ud=class e extends qi{constructor(e,t,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&n)this.setFlatCoordinates(t,e),this.ends_=n;else{let t=e,n=[],r=[];for(let e=0,i=t.length;e<i;++e){let i=t[e];We(n,i.getFlatCoordinates()),r.push(n.length)}let i=t.length===0?this.getLayout():t[0].getLayout();this.setFlatCoordinates(i,n),this.ends_=r}}appendLineString(e){We(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,n,r))}getCoordinateAtM(e,t,n){return this.layout!=`XYM`&&this.layout!=`XYZM`||this.flatCoordinates.length===0?null:(t=t===void 0?!1:t,n=n===void 0?!1:n,id(this.flatCoordinates,0,this.ends_,this.stride,e,t,n))}getCoordinates(){return fa(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new ld(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){let e=this.flatCoordinates,t=this.ends_,n=this.layout,r=[],i=0;for(let a=0,o=t.length;a<o;++a){let o=t[a],s=new ld(e.slice(i,o),n);r.push(s),i=o}return r}getLength(){let e=this.ends_,t=0,n=0;for(let r=0,i=e.length;r<i;++r)n+=cd(this.flatCoordinates,t,e[r],this.stride),t=e[r];return n}getFlatMidpoints(){let e=[],t=this.flatCoordinates,n=0,r=this.ends_,i=this.stride;for(let a=0,o=r.length;a<o;++a){let o=r[a];We(e,nd(t,n,o,i,.5)),n=o}return e}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=ha(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,`XY`,r)}getType(){return`MultiLineString`}intersectsExtent(e){return Aa(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=la(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},dd=class e extends qi{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){We(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Zt(this.getExtent(),e,t))return r;let i=this.flatCoordinates,a=this.stride;for(let o=0,s=i.length;o<s;o+=a){let s=Pt(e,t,i[o],i[o+1]);if(s<r){r=s;for(let e=0;e<a;++e)n[e]=i[o+e];n.length=a}}return r}getCoordinates(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){let t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new xa(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){let e=this.flatCoordinates,t=this.layout,n=this.stride,r=[];for(let i=0,a=e.length;i<a;i+=n){let a=new xa(e.slice(i,i+n),t);r.push(a)}return r}getType(){return`MultiPoint`}intersectsExtent(e){let t=this.flatCoordinates,n=this.stride;for(let r=0,i=t.length;r<i;r+=n){let n=t[r],i=t[r+1];if(en(e,n,i))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ca(this.flatCoordinates,0,e,this.stride),this.changed()}},fd=class e extends qi{constructor(e,t,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){let r=e,i=[],a=[];for(let e=0,t=r.length;e<t;++e){let t=r[e],n=i.length,o=t.getEnds();for(let e=0,t=o.length;e<t;++e)o[e]+=n;We(i,t.getFlatCoordinates()),a.push(o)}t=r.length===0?this.getLayout():r[0].getLayout(),e=i,n=a}t!==void 0&&n?(this.setFlatCoordinates(t,e),this.endss_=n):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{let n=this.flatCoordinates.length;We(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let e=0,r=t.length;e<r;++e)t[e]+=n}this.endss_.push(t),this.changed()}clone(){let t=this.endss_.length,n=Array(t);for(let e=0;e<t;++e)n[e]=this.endss_[e].slice();let r=new e(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return Ta(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return $i(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),za(t,0,this.endss_,this.stride,e)),pa(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let e=td(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Da(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new dd(this.getFlatInteriorPoints().slice(),`XYM`)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;La(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=za(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=ya(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{let n=this.endss_[e-1];t=n[n.length-1]}let n=this.endss_[e].slice(),r=n[n.length-1];if(t!==0)for(let e=0,r=n.length;e<r;++e)n[e]-=t;return new Va(this.flatCoordinates.slice(t,r),this.layout,n)}getPolygons(){let e=this.layout,t=this.flatCoordinates,n=this.endss_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a].slice(),s=o[o.length-1];if(i!==0)for(let e=0,t=o.length;e<t;++e)o[e]-=i;let c=new Va(t.slice(i,s),e,o);r.push(c),i=s}return r}getType(){return`MultiPolygon`}intersectsExtent(e){return Na(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||=[];let n=ua(this.flatCoordinates,0,e,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{let e=n[n.length-1];this.flatCoordinates.length=e.length===0?0:e[e.length-1]}this.changed()}},pd=Ti(),md=class e{constructor(e,t,n,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=i,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||=this.type_===`Point`?on(this.flatCoordinates_):sn(this.flatCoordinates_,0,this.flatCoordinates_.length,2),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let e=_n(this.getExtent());this.flatInteriorPoints_=Ea(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let e=Ba(this.flatCoordinates_,this.ends_),t=td(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=Da(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||=nd(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let e=this.flatCoordinates_,t=0,n=this.ends_;for(let r=0,i=n.length;r<i;++r){let i=n[r],a=nd(e,t,i,2,.5);We(this.flatMidpoints_,a),t=i}}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=B(e);let t=e.getExtent(),n=e.getWorldExtent();if(t&&n){let e=xn(n)/xn(t);Ni(pd,n[0],n[3],e,-e,0,0,0),Bi(this.flatCoordinates_,0,this.flatCoordinates_.length,2,pd,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new e(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=Xe((t,n)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);let r=this.simplifiedGeometry_.getFlatCoordinates(),i;switch(this.type_){case`LineString`:r.length=ma(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,r,0),i=[r.length];break;case`MultiLineString`:i=[],r.length=ha(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,r,0,i);break;case`Polygon`:i=[],r.length=va(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),r,0,i);break;default:}return i&&(this.simplifiedGeometry_=new e(this.type_,r,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};md.prototype.getFlatCoordinates=md.prototype.getOrientedFlatCoordinates;function hd(e){let t=e.getType();switch(t){case`Point`:return new xa(e.getFlatCoordinates());case`MultiPoint`:return new dd(e.getFlatCoordinates(),`XY`);case`LineString`:return new ld(e.getFlatCoordinates(),`XY`);case`MultiLineString`:return new ud(e.getFlatCoordinates(),`XY`,e.getEnds());case`Polygon`:let n=e.getFlatCoordinates(),r=e.getEnds(),i=Ba(n,r);return i.length>1?new fd(n,`XY`,i):new Va(n,`XY`,r);default:throw Error(`Invalid geometry type:`+t)}}function gd(e,t){let n=e.getId(),r=hd(e),i=e.getProperties(),a=new $u;return t!==void 0&&a.setGeometryName(t),a.setGeometry(r),n!==void 0&&a.setId(n),a.setProperties(i,!0),a}var _d=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=$u,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?B(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=B(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return P()}readFeature(e,t){return P()}readFeatures(e,t){return P()}readGeometry(e,t){return P()}readProjection(e){return P()}writeFeature(e,t){return P()}writeFeatures(e,t){return P()}writeGeometry(e,t){return P()}};function vd(e,t,n){let r=n?B(n.featureProjection):null,i=n?B(n.dataProjection):null,a=e;if(r&&i&&!ui(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(pi(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}var yd={Point:xa,LineString:ld,Polygon:Va,MultiPoint:dd,MultiLineString:ud,MultiPolygon:fd};function bd(e,t,n){return Array.isArray(t[0])?(La(e,0,t,n)||(e=e.slice(),za(e,0,t,n)),e):(Ia(e,0,t,n)||(e=e.slice(),Ra(e,0,t,n)),e)}function xd(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>xd({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return vd(new md(r,r===`Polygon`?bd(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function Sd(e,t){if(!e)return null;if(Array.isArray(e))return new od(e.map(e=>Sd(e,t)));let n=yd[e.type];return vd(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var Cd=class extends _d{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(wd(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(wd(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return P()}readFeaturesFromObject(e,t){return P()}readGeometry(e,t){return this.readGeometryFromObject(wd(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return P()}readProjection(e){return this.readProjectionFromObject(wd(e))}readProjectionFromObject(e){return P()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return P()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return P()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return P()}};function wd(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var Td=class extends Cd{constructor(e){e||={},super(),this.dataProjection=B(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=B(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 n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=Ed(n.geometry,t);if(this.featureClass===md)return xd({geometry:r,id:n.id,properties:n.properties},t);let i=new $u;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&i.setGeometryName(n.geometry_name),i.setGeometry(Sd(r,t)),`id`in n&&i.setId(n.id),n.properties&&i.setProperties(n.properties,!0),i}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return Dd(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t)if(t.type==`name`)n=B(t.properties.name);else if(t.type===`EPSG`)n=B(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`);else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=Fd(a,t),delete i[e.getGeometryName()]),$e(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return Fd(e,this.adaptOptions(t))}};function Ed(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=kd(e);break;case`LineString`:n=Ad(e);break;case`Polygon`:n=Pd(e);break;case`MultiPoint`:n=Md(e);break;case`MultiLineString`:n=jd(e);break;case`MultiPolygon`:n=Nd(e);break;case`GeometryCollection`:n=Od(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function Dd(e,t){return Sd(Ed(e,t),t)}function Od(e,t){return e.geometries.map(function(e){return Ed(e,t)})}function kd(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:Ji(t.length)}}function Ad(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:Ji(t[0]?.length||2)}}function jd(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:la(r,0,t,n),layout:Ji(n)}}function Md(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:Ji(t[0]?.length||2)}}function Nd(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:ua(n,0,t,r),layout:Ji(r)}}function Pd(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:la(n,0,t,r),layout:Ji(r)}}function Fd(e,t){e=vd(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=Vd(e,t);break;case`LineString`:r=Ld(e,t);break;case`Polygon`:r=Hd(e,t);break;case`MultiPoint`:r=zd(e,t);break;case`MultiLineString`:r=Rd(e,t);break;case`MultiPolygon`:r=Bd(e,t);break;case`GeometryCollection`:r=Id(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function Id(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return Fd(e,t)})}}function Ld(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function Rd(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function zd(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function Bd(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function Vd(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function Hd(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}var Ud=8,Wd={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`}},Gd={"*":{type:`source`}},Kd=[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],qd={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:`*`}},Jd={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:`*`}},Yd={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:`*`}},Xd={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`}},Zd={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`}}},Qd={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`}}},$d={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`}},ef=[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_color-relief`,`layout_background`],tf={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},nf={"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`}},rf={"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`}},af={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},of={"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`}},sf={"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`}},cf={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},lf={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},uf={type:`array`,value:`*`},df={type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},ff={type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},pf={type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},mf={type:`array`,value:`*`,minimum:1},hf={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}},gf={"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}},_f={source:{type:`string`,required:!0},exaggeration:{type:`number`,minimum:0,default:1}},vf={type:{type:`projectionDefinition`,default:`mercator`,"property-type":`data-constant`,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]}}},yf=[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_color-relief`,`paint_background`],bf={"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`}},xf={"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`}},Sf={"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`}},Cf={"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`}},wf={"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`}},Tf={"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`}},Ef={"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`}},Df={"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`}},Of={duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},kf={"*":{type:`string`}},Af={$version:Ud,$root:Wd,sources:Gd,source:Kd,source_vector:qd,source_raster:Jd,source_raster_dem:Yd,source_geojson:Xd,source_video:Zd,source_image:Qd,layer:$d,layout:ef,layout_background:tf,layout_fill:nf,layout_circle:rf,layout_heatmap:af,"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_line:of,layout_symbol:sf,layout_raster:cf,layout_hillshade:lf,"layout_color-relief":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},filter:uf,filter_operator:df,geometry_type:ff,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:pf,expression:mf,light:hf,sky:gf,terrain:_f,projection:vf,paint:yf,paint_fill:bf,"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:xf,paint_circle:Sf,paint_heatmap:Cf,paint_symbol:wf,paint_raster:Tf,paint_hillshade:Ef,"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:Df,transition:Of,"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:kf},jf=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function Mf(e,t){let n={};for(let t in e)t!==`ref`&&(n[t]=e[t]);return jf.forEach(e=>{e in t&&(n[e]=t[e])}),n}function Nf(e){e=e.slice();let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)`ref`in e[n]&&(e[n]=Mf(e[n],t[e[n].ref]));return e}var K=class{constructor(e,t,n,r){this.message=(e?`${e}: `:``)+n,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)}};function Pf(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}var Ff=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},If=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,n]of t)this.bindings[e]=n}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},Lf={kind:`null`},q={kind:`number`},J={kind:`string`},Y={kind:`boolean`},Rf={kind:`color`},zf={kind:`projectionDefinition`},Bf={kind:`object`},X={kind:`value`},Vf={kind:`error`},Hf={kind:`collator`},Uf={kind:`formatted`},Wf={kind:`padding`},Gf={kind:`colorArray`},Kf={kind:`numberArray`},qf={kind:`resolvedImage`},Jf={kind:`variableAnchorOffsetCollection`};function Yf(e,t){return{kind:`array`,itemType:e,N:t}}function Xf(e){if(e.kind===`array`){let t=Xf(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}else return e.kind}var Zf=[Lf,q,J,Y,Rf,zf,Uf,Bf,Yf(X),Wf,Kf,Gf,qf,Jf];function Qf(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!Qf(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if(e.kind===`value`){for(let e of Zf)if(!Qf(e,t))return null}return`Expected ${Xf(e)} but found ${Xf(t)} instead.`}function $f(e,t){return t.some(t=>t.kind===e.kind)}function ep(e,t){return t.some(t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e)}function tp(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}var np=.96422,rp=1,ip=.82521,ap=4/29,op=6/29,sp=3*op*op,cp=op*op*op,lp=Math.PI/180,up=180/Math.PI;function dp(e){return e%=360,e<0&&(e+=360),e}function fp([e,t,n,r]){e=pp(e),t=pp(t),n=pp(n);let i,a,o=mp((.2225045*e+.7168786*t+.0606169*n)/rp);e===t&&t===n?i=a=o:(i=mp((.4360747*e+.3850649*t+.1430804*n)/np),a=mp((.0139322*e+.0971045*t+.7141733*n)/ip));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),r]}function pp(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function mp(e){return e>cp?e**(1/3):e/sp+ap}function hp([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=rp*_p(i),a=np*_p(a),o=ip*_p(o),[gp(3.1338561*a-1.6168667*i-.4906146*o),gp(-.9787684*a+1.9161415*i+.033454*o),gp(.0719453*a-.2289914*i+1.4052427*o),r]}function gp(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function _p(e){return e>op?e*e*e:sp*(e-ap)}function vp(e){let[t,n,r,i]=fp(e),a=Math.sqrt(n*n+r*r);return[Math.round(a*1e4)?dp(Math.atan2(r,n)*up):NaN,a,t,i]}function yp([e,t,n,r]){return e=isNaN(e)?0:e*lp,hp([n,Math.cos(e)*t,Math.sin(e)*t,r])}function bp([e,t,n,r]){e=dp(e),t/=100,n/=100;function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4),r]}var xp=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Sp(e,t){return xp(e,t)?e[t]:void 0}function Cp(e){if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t=Sp(Op,e);if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[wp(e.slice(n,n+=t)),wp(e.slice(n,n+=t)),wp(e.slice(n,n+=t)),wp(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===` `||p===` /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[Ep(+n/t,0,1),Ep(+a/t,0,1),Ep(+c/t,0,1),d?Tp(+d,f):1];if(Dp(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===` `||u===` /`||u===`,,`||u===`,,,`){let e=[+t,Ep(+i,0,100),Ep(+o,0,100),c?Tp(+c,l):1];if(Dp(e))return bp(e)}}}function wp(e){return parseInt(e.padEnd(2,e),16)/255}function Tp(e,t){return Ep(t?e/100:e,0,1)}function Ep(e,t,n){return Math.min(Math.max(t,e),n)}function Dp(e){return!e.some(Number.isNaN)}var Op={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 kp(e,t,n){return e+n*(t-e)}function Ap(e,t,n){return e.map((e,r)=>kp(e,t[r],n))}var jp=class e{constructor(e,t,n,r=1,i=!0){this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static parse(t){if(t instanceof e)return t;if(typeof t!=`string`)return;let n=Cp(t);if(n)return new e(...n,!1)}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,vp(this.rgb))}get lab(){return this.overwriteGetter(`lab`,fp(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map(e=>Math.round(e*255)).join(`,`)},${r})`}static interpolate(t,n,r,i=`rgb`){switch(i){case`rgb`:{let[i,a,o,s]=Ap(t.rgb,n.rgb,r);return new e(i,a,o,s,!1)}case`hcl`:{let[i,a,o,s]=t.hcl,[c,l,u,d]=n.hcl,f,p;if(!isNaN(i)&&!isNaN(c)){let e=c-i;c>i&&e>180?e-=360:c<i&&i-c>180&&(e+=360),f=i+r*e}else isNaN(i)?isNaN(c)?f=NaN:(f=c,(o===1||o===0)&&(p=l)):(f=i,(u===1||u===0)&&(p=a));let[m,h,g,_]=yp([f,p??kp(a,l,r),kp(o,u,r),kp(s,d,r)]);return new e(m,h,g,_,!1)}case`lab`:{let[i,a,o,s]=hp(Ap(t.lab,n.lab,r));return new e(i,a,o,s,!1)}}}};jp.black=new jp(0,0,0,1),jp.white=new jp(1,1,1,1),jp.transparent=new jp(0,0,0,0),jp.red=new jp(1,0,0,1);var Mp=class{constructor(e,t,n){e?this.sensitivity=t?`variant`:`case`:this.sensitivity=t?`accent`:`base`,this.locale=n,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}},Np=[`bottom`,`center`,`top`],Pp=class{constructor(e,t,n,r,i,a){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i,this.verticalAlign=a}},Fp=class e{constructor(e){this.sections=e}static fromString(t){return new e([new Pp(t,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(t){return t instanceof e?t:e.fromString(t)}toString(){return this.sections.length===0?``:this.sections.map(e=>e.text).join(``)}},Ip=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if(typeof e!=`number`)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]];break}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(Ap(t.values,n.values,r))}},Lp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t]);if(Array.isArray(t)){for(let e of t)if(typeof e!=`number`)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(Ap(t.values,n.values,r))}},Rp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`string`){let n=jp.parse(t);return n?new e([n]):void 0}if(!Array.isArray(t))return;let n=[];for(let e of t){if(typeof e!=`string`)return;let t=jp.parse(e);if(!t)return;n.push(t)}return new e(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i=`rgb`){let a=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(jp.interpolate(t.values[e],n.values[e],r,i));return new e(a)}},zp=class extends Error{constructor(e){super(e),this.name=`RuntimeError`}toJSON(){return this.message}},Bp=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),Vp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let n=t[e],r=t[e+1];if(typeof n!=`string`||!Bp.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){let i=t.values,a=n.values;if(i.length!==a.length)throw new zp(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`);let o=[];for(let e=0;e<i.length;e+=2){if(i[e]!==a[e])throw new zp(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${i[e]}, to[${e}]: ${a[e]}`);o.push(i[e]);let[t,n]=i[e+1],[s,c]=a[e+1];o.push([kp(t,s,r),kp(n,c,r)])}return new e(o)}},Hp=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},Up=class e{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}static interpolate(t,n,r){return new e(t,n,r)}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`number`)return new e(t[0],t[1],t[2]);if(typeof t==`object`&&typeof t.from==`string`&&typeof t.to==`string`&&typeof t.transition==`number`)return new e(t.from,t.to,t.transition);if(typeof t==`string`)return new e(t,t,1)}};function Wp(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Gp(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof Up||e instanceof jp||e instanceof Mp||e instanceof Fp||e instanceof Ip||e instanceof Lp||e instanceof Rp||e instanceof Vp||e instanceof Hp)return!0;if(Array.isArray(e)){for(let t of e)if(!Gp(t))return!1;return!0}else if(typeof e==`object`){for(let t in e)if(!Gp(e[t]))return!1;return!0}else return!1}function Kp(e){if(e===null)return Lf;if(typeof e==`string`)return J;if(typeof e==`boolean`)return Y;if(typeof e==`number`)return q;if(e instanceof jp)return Rf;if(e instanceof Up)return zf;if(e instanceof Mp)return Hf;if(e instanceof Fp)return Uf;if(e instanceof Ip)return Wf;if(e instanceof Lp)return Kf;if(e instanceof Rp)return Gf;if(e instanceof Vp)return Jf;if(e instanceof Hp)return qf;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=Kp(t);if(!n)n=e;else if(n===e)continue;else{n=X;break}}return Yf(n||X,t)}else return Bf}function qp(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof jp||e instanceof Up||e instanceof Fp||e instanceof Ip||e instanceof Lp||e instanceof Rp||e instanceof Vp||e instanceof Hp?e.toString():JSON.stringify(e)}var Jp=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Gp(t[1]))return n.error(`invalid value`);let r=t[1],i=Kp(r),a=n.expectedType;return i.kind===`array`&&i.N===0&&a&&a.kind===`array`&&(typeof a.N!=`number`||a.N===0)&&(i=a),new e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},Yp={string:J,number:q,boolean:Y,object:Bf},Xp=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=1,i,a=t[0];if(a===`array`){let e;if(t.length>2){let i=t[1];if(typeof i!=`string`||!(i in Yp)||i===`object`)return n.error(`The item type argument of "array" must be one of string, number, boolean`,1);e=Yp[i],r++}else e=X;let a;if(t.length>3){if(t[2]!==null&&(typeof t[2]!=`number`||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(`The length argument to "array" must be a positive integer literal`,2);a=t[2],r++}i=Yf(e,a)}else{if(!Yp[a])throw Error(`Types doesn't contain name = ${a}`);i=Yp[a]}let o=[];for(;r<t.length;r++){let e=n.parse(t[r],r,X);if(!e)return null;o.push(e)}return new e(i,o)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!Qf(this.type,Kp(n)))return n;if(t===this.args.length-1)throw new zp(`Expected value to be of type ${Xf(this.type)}, but found ${Xf(Kp(n))} instead.`)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Zp={"to-boolean":Y,"to-color":Rf,"to-number":q,"to-string":J},Qp=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[0];if(!Zp[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r===`to-boolean`||r===`to-string`)&&t.length!==2)return n.error(`Expected one argument.`);let i=Zp[r],a=[];for(let e=1;e<t.length;e++){let r=n.parse(t[e],e,X);if(!r)return null;a.push(r)}return new e(i,a)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof jp)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Wp(t[0],t[1],t[2],t[3]),!n))return new jp(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new zp(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Ip.parse(t);if(r)return r}throw new zp(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`numberArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Lp.parse(t);if(r)return r}throw new zp(`Could not parse numberArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`colorArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Rp.parse(t);if(r)return r}throw new zp(`Could not parse colorArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Vp.parse(t);if(r)return r}throw new zp(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new zp(`Could not convert ${JSON.stringify(t)} to number.`)}case`formatted`:return Fp.fromString(qp(this.args[0].evaluate(e)));case`resolvedImage`:return Hp.fromString(qp(this.args[0].evaluate(e)));case`projectionDefinition`:return this.args[0].evaluate(e);default:return qp(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},$p=[`Unknown`,`Point`,`LineString`,`Polygon`],em=class{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`?$p[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=jp.parse(e),this._parseColorCache.set(e,t)),t}},tm=class e{constructor(e,t,n=[],r,i=new If,a=[]){this.registry=e,this.path=n,this.key=n.map(e=>`[${e}]`).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`)&&(e=[`literal`,e]);function n(e,t,n){return n===`assert`?new Xp(t,[e]):n===`coerce`?new Qp(t,[e]):e}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", []].`);let 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;let i=this.registry[r];if(i){let r=i.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,i=r.type;if((e.kind===`string`||e.kind===`number`||e.kind===`boolean`||e.kind===`object`||e.kind===`array`)&&i.kind===`value`)r=n(r,e,t.typeAnnotation||`assert`);else if(e.kind===`projectionDefinition`&&[`string`,`array`].includes(i.kind)||[`color`,`formatted`,`resolvedImage`].includes(e.kind)&&[`value`,`string`].includes(i.kind)||[`padding`,`numberArray`].includes(e.kind)&&[`value`,`number`,`array`].includes(i.kind)||e.kind===`colorArray`&&[`value`,`string`,`array`].includes(i.kind)||e.kind===`variableAnchorOffsetCollection`&&[`value`,`array`].includes(i.kind))r=n(r,e,t.typeAnnotation||`coerce`);else if(this.checkSubtype(e,i))return null}if(!(r instanceof Jp)&&r.type.kind!==`resolvedImage`&&this._isConstant(r)){let e=new em;try{r=new Jp(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else if(e===void 0)return this.error(`'undefined' value invalid. Use null instead.`);else if(typeof e==`object`)return this.error(`Bare objects invalid. Use ["literal", {...}] instead.`);else return this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,n,r){let i=typeof t==`number`?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new e(this.registry,this._isConstant,i,n||null,a,this.errors)}error(e,...t){let n=`${this.key}${t.map(e=>`[${e}]`).join(``)}`;this.errors.push(new Ff(n,e))}checkSubtype(e,t){let n=Qf(e,t);return n&&this.error(n),n}},nm=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if(typeof i!=`string`)return n.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return n.error(`Variable names must contain only alphanumeric characters or '_'.`,e);let a=n.parse(t[e+1],e+1);if(!a)return null;r.push([i,a])}let i=n.parse(t[t.length-1],t.length-1,n.expectedType,r);return i?new e(r,i):null}outputDefined(){return this.result.outputDefined()}},rm=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,n){if(t.length!==2||typeof t[1]!=`string`)return n.error(`'var' expression requires exactly one string literal argument.`);let r=t[1];return n.scope.has(r)?new e(r,n.scope.get(r)):n.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},im=class e{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,q),i=n.parse(t[2],2,Yf(n.expectedType||X));if(!r||!i)return null;let a=i.type;return new e(a.itemType,r,i)}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new zp(`Array index out of bounds: ${t} < 0.`);if(t>=n.length)throw new zp(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new zp(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},am=class e{constructor(e,t){this.type=Y,this.needle=e,this.haystack=t}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,X);return!r||!i?null:$f(r.type,[Y,J,q,Lf,X])?new e(r,i):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(r.type)} instead`)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!ep(t,[`boolean`,`string`,`number`,`null`]))throw new zp(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(Kp(t))} instead.`);if(!ep(n,[`string`,`array`]))throw new zp(`Expected second argument to be of type array or string, but found ${Xf(Kp(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},om=class e{constructor(e,t,n){this.type=q,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,X);if(!r||!i)return null;if(!$f(r.type,[Y,J,q,Lf,X]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,q);return a?new e(r,i,a):null}else return new e(r,i)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!ep(t,[`boolean`,`string`,`number`,`null`]))throw new zp(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(Kp(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),ep(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}else if(ep(n,[`array`]))return n.indexOf(t,r);else throw new zp(`Expected second argument to be of type array or string, but found ${Xf(Kp(n))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},sm=class e{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error(`Expected an even number of arguments.`);let r,i;n.expectedType&&n.expectedType.kind!==`value`&&(i=n.expectedType);let a={},o=[];for(let e=2;e<t.length-1;e+=2){let s=t[e],c=t[e+1];Array.isArray(s)||(s=[s]);let l=n.concat(e);if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(!r)r=Kp(e);else if(l.checkSubtype(r,Kp(e)))return null;if(a[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);a[String(e)]=o.length}let u=n.parse(c,e,i);if(!u)return null;i||=u.type,o.push(u)}let s=n.parse(t[1],1,X);if(!s)return null;let c=n.parse(t[t.length-1],t.length-1,i);return!c||s.type.kind!==`value`&&n.concat(1).checkSubtype(r,s.type)?null:new e(r,i,s,a,o,c)}evaluate(e){let t=this.input.evaluate(e);return(Kp(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()}},cm=class e{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error(`Expected an odd number of arguments.`);let r;n.expectedType&&n.expectedType.kind!==`value`&&(r=n.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let a=n.parse(t[e],e,Y);if(!a)return null;let o=n.parse(t[e+1],e+1,r);if(!o)return null;i.push([a,o]),r||=o.type}let a=n.parse(t[t.length-1],t.length-1,r);if(!a)return null;if(!r)throw Error(`Can't infer output type`);return new e(r,i,a)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},lm=class e{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,q);if(!r||!i)return null;if(!$f(r.type,[Yf(X),J,X]))return n.error(`Expected first argument to be of type array or string, but found ${Xf(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,q);return a?new e(r.type,r,i,a):null}else return new e(r.type,r,i)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),ep(t,[`string`]))return[...t].slice(n,r).join(``);if(ep(t,[`array`]))return t.slice(n,r);throw new zp(`Expected first argument to be of type array or string, but found ${Xf(Kp(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function um(e,t){let n=e.length-1,r=0,i=n,a=0,o,s;for(;r<=i;)if(a=Math.floor((r+i)/2),o=e[a],s=e[a+1],o<=t){if(a===n||t<s)return a;r=a+1}else if(o>t)i=a-1;else throw new zp(`Input is not a number.`);return 0}var dm=class e{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);let r=n.parse(t[1],1,q);if(!r)return null;let i=[],a=null;n.expectedType&&n.expectedType.kind!==`value`&&(a=n.expectedType);for(let e=1;e<t.length;e+=2){let r=e===1?-1/0:t[e],o=t[e+1],s=e,c=e+1;if(typeof r!=`number`)return n.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,s);if(i.length&&i[i.length-1][0]>=r)return n.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=n.parse(o,c,a);if(!l)return null;a||=l.type,i.push([r,l])}return new e(a,r,i)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[um(t,r)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function fm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var pm,mm;function hm(){if(mm)return pm;mm=1,pm=e;function e(e,t,n,r){this.cx=3*e,this.bx=3*(n-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=n,this.p2y=r}return e.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 n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=i/a}var o=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?o=n:s=n,n=(s-o)*.5+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},pm}var gm=fm(hm()),_m=class e{constructor(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=vm(t,e.base,n,r);else if(e.name===`linear`)i=vm(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=new gm(a[0],a[1],a[2],a[3]).solve(vm(t,1,n,r))}return i}static parse(t,n){let[r,i,a,...o]=t;if(!Array.isArray(i)||i.length===0)return n.error(`Expected an interpolation type expression.`,1);if(i[0]===`linear`)i={name:`linear`};else if(i[0]===`exponential`){let e=i[1];if(typeof e!=`number`)return n.error(`Exponential interpolation requires a numeric base.`,1,1);i={name:`exponential`,base:e}}else if(i[0]===`cubic-bezier`){let e=i.slice(1);if(e.length!==4||e.some(e=>typeof e!=`number`||e<0||e>1))return n.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);i={name:`cubic-bezier`,controlPoints:e}}else return n.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);if(a=n.parse(a,2,q),!a)return null;let s=[],c=null;(r===`interpolate-hcl`||r===`interpolate-lab`)&&n.expectedType!=Gf?c=Rf:n.expectedType&&n.expectedType.kind!==`value`&&(c=n.expectedType);for(let e=0;e<o.length;e+=2){let t=o[e],r=o[e+1],i=e+3,a=e+4;if(typeof t!=`number`)return n.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(s.length&&s[s.length-1][0]>=t)return n.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=n.parse(r,a,c);if(!l)return null;c||=l.type,s.push([t,l])}return!tp(c,q)&&!tp(c,zf)&&!tp(c,Rf)&&!tp(c,Wf)&&!tp(c,Kf)&&!tp(c,Gf)&&!tp(c,Jf)&&!tp(c,Yf(q))?n.error(`Type ${Xf(c)} is not interpolatable.`):new e(c,r,i,a,s)}evaluate(t){let n=this.labels,r=this.outputs;if(n.length===1)return r[0].evaluate(t);let i=this.input.evaluate(t);if(i<=n[0])return r[0].evaluate(t);let a=n.length;if(i>=n[a-1])return r[a-1].evaluate(t);let o=um(n,i),s=n[o],c=n[o+1],l=e.interpolationFactor(this.interpolation,i,s,c),u=r[o].evaluate(t),d=r[o+1].evaluate(t);switch(this.operator){case`interpolate`:switch(this.type.kind){case`number`:return kp(u,d,l);case`color`:return jp.interpolate(u,d,l);case`padding`:return Ip.interpolate(u,d,l);case`colorArray`:return Rp.interpolate(u,d,l);case`numberArray`:return Lp.interpolate(u,d,l);case`variableAnchorOffsetCollection`:return Vp.interpolate(u,d,l);case`array`:return Ap(u,d,l);case`projectionDefinition`:return Up.interpolate(u,d,l)}case`interpolate-hcl`:switch(this.type.kind){case`color`:return jp.interpolate(u,d,l,`hcl`);case`colorArray`:return Rp.interpolate(u,d,l,`hcl`)}case`interpolate-lab`:switch(this.type.kind){case`color`:return jp.interpolate(u,d,l,`lab`);case`colorArray`:return Rp.interpolate(u,d,l,`lab`)}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function vm(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}jp.interpolate,Ip.interpolate,Lp.interpolate,Rp.interpolate,Vp.interpolate;var ym=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=null,i=n.expectedType;i&&i.kind!==`value`&&(r=i);let a=[];for(let e of t.slice(1)){let t=n.parse(e,1+a.length,r,void 0,{typeAnnotation:`omit`});if(!t)return null;r||=t.type,a.push(t)}if(!r)throw Error(`No output type`);return i&&a.some(e=>Qf(i,e.type))?new e(X,a):new e(r,a)}evaluate(e){let t=null,n=0,r;for(let i of this.args)if(n++,t=i.evaluate(e),t&&t instanceof Hp&&!t.available&&(r||=t.name,t=null,n===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 bm(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function xm(e,t,n){return t===n}function Sm(e,t,n){return t!==n}function Cm(e,t,n){return t<n}function wm(e,t,n){return t>n}function Tm(e,t,n){return t<=n}function Em(e,t,n){return t>=n}function Dm(e,t,n,r){return r.compare(t,n)===0}function Om(e,t,n,r){return!Dm(e,t,n,r)}function km(e,t,n,r){return r.compare(t,n)<0}function Am(e,t,n,r){return r.compare(t,n)>0}function jm(e,t,n,r){return r.compare(t,n)<=0}function Mm(e,t,n,r){return r.compare(t,n)>=0}function Nm(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n){this.type=Y,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,X);if(!a)return null;if(!bm(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${Xf(a.type)}'.`);let o=t.parse(e[2],2,X);if(!o)return null;if(!bm(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${Xf(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${Xf(a.type)}' and '${Xf(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new Xp(o.type,[a]):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new Xp(a.type,[o])));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,Hf),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=Kp(a),n=Kp(o);if(t.kind!==n.kind||!(t.kind===`string`||t.kind===`number`))throw new zp(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let e=Kp(a),n=Kp(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}var Pm=Nm(`==`,xm,Dm),Fm=Nm(`!=`,Sm,Om),Im=Nm(`<`,Cm,km),Lm=Nm(`>`,wm,Am),Rm=Nm(`<=`,Tm,jm),zm=Nm(`>=`,Em,Mm),Bm=class e{constructor(e,t,n){this.type=Hf,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,n){if(t.length!==2)return n.error(`Expected one argument.`);let r=t[1];if(typeof r!=`object`||Array.isArray(r))return n.error(`Collator options argument must be an object.`);let i=n.parse(r[`case-sensitive`]===void 0?!1:r[`case-sensitive`],1,Y);if(!i)return null;let a=n.parse(r[`diacritic-sensitive`]===void 0?!1:r[`diacritic-sensitive`],1,Y);if(!a)return null;let o=null;return r.locale&&(o=n.parse(r.locale,1,J),!o)?null:new e(i,a,o)}evaluate(e){return new Mp(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}},Vm=class e{constructor(e,t,n,r,i){this.type=J,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i}static parse(t,n){if(t.length!==3)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,q);if(!r)return null;let i=t[2];if(typeof i!=`object`||Array.isArray(i))return n.error(`NumberFormat options argument must be an object.`);let a=null;if(i.locale&&(a=n.parse(i.locale,1,J),!a))return null;let o=null;if(i.currency&&(o=n.parse(i.currency,1,J),!o))return null;let s=null;if(i[`min-fraction-digits`]&&(s=n.parse(i[`min-fraction-digits`],1,q),!s))return null;let c=null;return i[`max-fraction-digits`]&&(c=n.parse(i[`max-fraction-digits`],1,q),!c)?null:new e(r,a,o,s,c)}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}},Hm=class e{constructor(e){this.type=Uf,this.sections=e}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[1];if(!Array.isArray(r)&&typeof r==`object`)return n.error(`First argument must be an image or text section.`);let i=[],a=!1;for(let e=1;e<=t.length-1;++e){let r=t[e];if(a&&typeof r==`object`&&!Array.isArray(r)){a=!1;let e=null;if(r[`font-scale`]&&(e=n.parse(r[`font-scale`],1,q),!e))return null;let t=null;if(r[`text-font`]&&(t=n.parse(r[`text-font`],1,Yf(J)),!t))return null;let o=null;if(r[`text-color`]&&(o=n.parse(r[`text-color`],1,Rf),!o))return null;let s=null;if(r[`vertical-align`]){if(typeof r[`vertical-align`]==`string`&&!Np.includes(r[`vertical-align`]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${r[`vertical-align`]}' instead.`);if(s=n.parse(r[`vertical-align`],1,J),!s)return null}let c=i[i.length-1];c.scale=e,c.font=t,c.textColor=o,c.verticalAlign=s}else{let r=n.parse(t[e],1,X);if(!r)return null;let o=r.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return n.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);a=!0,i.push({content:r,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new Fp(this.sections.map(t=>{let n=t.content.evaluate(e);return Kp(n)===qf?new Pp(``,n,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Pp(qp(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let 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}},Um=class e{constructor(e){this.type=qf,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,J);return r?new e(r):n.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=Hp.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},Wm=class e{constructor(e){this.type=q,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=n.parse(t[1],1);return r?r.type.kind!==`array`&&r.type.kind!==`string`&&r.type.kind!==`value`?n.error(`Expected argument of type string or array, but found ${Xf(r.type)} instead.`):new e(r):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new zp(`Expected value to be of type string or array, but found ${Xf(Kp(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Gm=8192;function Km(e,t){let n=Jm(e[0]),r=Xm(e[1]),i=2**t.z;return[Math.round(n*i*Gm),Math.round(r*i*Gm)]}function qm(e,t){let n=2**t.z,r=(e[0]/Gm+t.x)/n,i=(e[1]/Gm+t.y)/n;return[Ym(r),Zm(i)]}function Jm(e){return(180+e)/360}function Ym(e){return e*360-180}function Xm(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Zm(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function Qm(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function $m(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function eh(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function th(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i===0&&r*a<=0&&i*o<=0}function nh(e,t,n,r){let i=[t[0]-e[0],t[1]-e[1]];return ch([r[0]-n[0],r[1]-n[1]],i)===0?!1:!!(lh(e,t,n,r)&&lh(n,r,e,t))}function rh(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(nh(e,t,r[n],r[n+1]))return!0;return!1}function ih(e,t,n=!1){let r=!1;for(let i of t)for(let t=0;t<i.length-1;t++){if(th(e,i[t],i[t+1]))return n;eh(e,i[t],i[t+1])&&(r=!r)}return r}function ah(e,t){for(let n of t)if(ih(e,n))return!0;return!1}function oh(e,t){for(let n of e)if(!ih(n,t))return!1;for(let n=0;n<e.length-1;++n)if(rh(e[n],e[n+1],t))return!1;return!0}function sh(e,t){for(let n of t)if(oh(e,n))return!0;return!1}function ch(e,t){return e[0]*t[1]-e[1]*t[0]}function lh(e,t,n,r){let i=e[0]-n[0],a=e[1]-n[1],o=t[0]-n[0],s=t[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*a,d=o*l-c*s;return u>0&&d<0||u<0&&d>0}function uh(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=Km(e[i][r],n);Qm(t,o),a.push(o)}r.push(a)}return r}function dh(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=uh(e[i],t,n);r.push(a)}return r}function fh(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=r*.5,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}Qm(t,e)}function ph(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function mh(e,t,n,r){let i=2**r.z*Gm,a=[r.x*Gm,r.y*Gm],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];fh(r,t,n,i),o.push(r)}return o}function hh(e,t,n,r){let i=2**r.z*Gm,a=[r.x*Gm,r.y*Gm],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];Qm(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){ph(t);for(let e of o)for(let r of e)fh(r,t,n,i)}return o}function gh(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=uh(t.coordinates,r,i),o=mh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!ih(e,a))return!1}if(t.type===`MultiPolygon`){let a=dh(t.coordinates,r,i),o=mh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!ah(e,a))return!1}return!0}function _h(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=uh(t.coordinates,r,i),o=hh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!oh(e,a))return!1}if(t.type===`MultiPolygon`){let a=dh(t.coordinates,r,i),o=hh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!sh(e,a))return!1}return!0}var vh=class e{constructor(e,t){this.type=Y,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Gp(t[1])){let n=t[1];if(n.type===`FeatureCollection`){let t=[];for(let e of n.features){let{type:n,coordinates:r}=e.geometry;n===`Polygon`&&t.push(r),n===`MultiPolygon`&&t.push(...r)}if(t.length)return new e(n,{type:`MultiPolygon`,coordinates:t})}else if(n.type===`Feature`){let t=n.geometry.type;if(t===`Polygon`||t===`MultiPolygon`)return new e(n,n.geometry)}else if(n.type===`Polygon`||n.type===`MultiPolygon`)return new e(n,n)}return n.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 gh(e,this.geometries);if(e.geometryType()===`LineString`)return _h(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},yh=class{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let 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){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function bh(e,t,n=0,r=e.length-1,i=Sh){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);bh(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(xh(e,n,t),i(e[r],a)>0&&xh(e,n,r);o<s;){for(xh(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?xh(e,n,s):(s++,xh(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function xh(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Sh(e,t){return e<t?-1:e>t?1:0}function Ch(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=Th(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(bh(n[e],t,1,n[e].length-1,wh),n[e]=n[e].slice(0,t));return n}function wh(e,t){return t.area-e.area}function Th(e){let t=0;for(let n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var Eh=6378.137,Dh=1/298.257223563,Oh=Dh*(2-Dh),kh=Math.PI/180,Ah=class{constructor(e){let t=kh*Eh*1e3,n=Math.cos(e*kh),r=1/(1-Oh*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*(1-Oh)}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n=1/0,r,i,a,o;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;(u!==0||d!==0)&&(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<n&&(n=p,r=c,i=l,a=s,o=f)}return{point:[r,i],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},jh=100,Mh=50;function Nh(e,t){return t[0]-e[0]}function Ph(e){return e[1]-e[0]+1}function Fh(e,t){return e[1]>=e[0]&&e[1]<t}function Ih(e,t){if(e[0]>e[1])return[null,null];let n=Ph(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function Lh(e,t){if(!Fh(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)Qm(n,e[r]);return n}function Rh(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)Qm(t,e);return t}function zh(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Bh(e,t,n){if(!zh(e)||!zh(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function Vh(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function Hh(e,t,n,r,i){let a=Math.min(Vh(e,[n,r],i),Vh(t,[n,r],i)),o=Math.min(Vh(n,[e,t],i),Vh(r,[e,t],i));return Math.min(a,o)}function Uh(e,t,n,r,i){if(!(Fh(t,e.length)&&Fh(r,n.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(nh(t,s,r,o))return 0;a=Math.min(a,Hh(t,s,r,o,i))}}return a}function Wh(e,t,n,r,i){if(!(Fh(t,e.length)&&Fh(r,n.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function Gh(e,t,n){if(ih(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,Vh(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function Kh(e,t,n,r){if(!Fh(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(ih(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(nh(t,o,a,c))return 0;i=Math.min(i,Hh(t,o,a,c,r))}}return i}function qh(e,t){for(let n of e)for(let e of n)if(ih(e,t,!0))return!0;return!1}function Jh(e,t,n,r=1/0){let i=Rh(e),a=Rh(t);if(r!==1/0&&Bh(i,a,n)>=r)return r;if($m(i,a)){if(qh(e,t))return 0}else if(qh(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(nh(i,s,r,c))return 0;o=Math.min(o,Hh(i,s,r,c,n))}}return o}function Yh(e,t,n,r,i,a){if(!a)return;let o=Bh(Lh(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function Xh(e,t,n,r,i,a,o){if(!a||!o)return;let s=Bh(Lh(r,a),Lh(i,o),n);s<t&&e.push([s,a,o])}function Zh(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new yh([[0,[0,e.length-1],[0,0]]],Nh),s=Rh(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?Mh:jh;if(Ph(c)<=l){if(!Fh(c,e.length))return NaN;if(t){let t=Kh(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=Gh(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=Ih(c,t);Yh(o,a,r,e,s,n[0]),Yh(o,a,r,e,s,n[1])}}return a}function Qh(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new yh([[0,[0,e.length-1],[0,n.length-1]]],Nh);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?Mh:jh,d=r?Mh:jh;if(Ph(c)<=u&&Ph(l)<=d){if(!Fh(c,e.length)&&Fh(l,n.length))return NaN;let a;if(t&&r)a=Uh(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=Vh(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=Vh(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=Wh(e,c,n,l,i),o=Math.min(o,a)}else{let a=Ih(c,t),u=Ih(l,r);Xh(s,o,i,e,n,a[0],u[0]),Xh(s,o,i,e,n,a[0],u[1]),Xh(s,o,i,e,n,a[1],u[0]),Xh(s,o,i,e,n,a[1],u[1])}}return o}function $h(e,t){let n=e.geometry(),r=n.flat().map(t=>qm([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new Ah(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Qh(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Qh(r,!1,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Zh(r,!1,e.coordinates,i,a));break}if(a===0)return a}return a}function eg(e,t){let n=e.geometry(),r=n.flat().map(t=>qm([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new Ah(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Qh(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Qh(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Zh(r,!0,e.coordinates,i,a));break}if(a===0)return a}return a}function tg(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=Ch(n,0).map(t=>t.map(t=>t.map(t=>qm([t.x,t.y],e.canonical)))),i=new Ah(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,Zh([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,Zh(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,Jh(t,e.coordinates,i,a));break}if(a===0)return a}return a}function ng(e){return e.type===`MultiPolygon`?e.coordinates.map(e=>({type:`Polygon`,coordinates:e})):e.type===`MultiLineString`?e.coordinates.map(e=>({type:`LineString`,coordinates:e})):e.type===`MultiPoint`?e.coordinates.map(e=>({type:`Point`,coordinates:e})):[e]}var rg=class e{constructor(e,t){this.type=q,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Gp(t[1])){let n=t[1];if(n.type===`FeatureCollection`)return new e(n,n.features.map(e=>ng(e.geometry)).flat());if(n.type===`Feature`)return new e(n,ng(n.geometry));if(`type`in n&&`coordinates`in n)return new e(n,ng(n))}return n.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 $h(e,this.geometries);if(e.geometryType()===`LineString`)return eg(e,this.geometries);if(e.geometryType()===`Polygon`)return tg(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},ig=class e{constructor(e){this.type=X,this.key=e}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return r==null?n.error(`Global state property must be defined.`):typeof r==`string`?new e(r):n.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:Sp(t,this.key)}eachChild(){}outputDefined(){return!1}},ag={"==":Pm,"!=":Fm,">":Lm,"<":Im,">=":zm,"<=":Rm,array:Xp,at:im,boolean:Xp,case:cm,coalesce:ym,collator:Bm,format:Hm,image:Um,in:am,"index-of":om,interpolate:_m,"interpolate-hcl":_m,"interpolate-lab":_m,length:Wm,let:nm,literal:Jp,match:sm,number:Xp,"number-format":Vm,object:Xp,slice:lm,step:dm,string:Xp,"to-boolean":Qp,"to-color":Qp,"to-number":Qp,"to-string":Qp,var:rm,within:vh,distance:rg,"global-state":ig},og=class e{constructor(e,t,n,r){this.name=e,this.type=t,this._evaluate=n,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,n){let r=t[0],i=e.definitions[r];if(!i)return n.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),c=null;for(let[i,o]of s){c=new tm(n.registry,pg,n.path,null,n.scope);let s=[],l=!1;for(let e=1;e<t.length;e++){let n=t[e],r=Array.isArray(i)?i[e-1]:i.type,a=c.parse(n,1+s.length,r);if(!a){l=!0;break}s.push(a)}if(!l){if(Array.isArray(i)&&i.length!==s.length){c.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);continue}for(let e=0;e<s.length;e++){let t=Array.isArray(i)?i[e]:i.type,n=s[e];c.concat(e+1).checkSubtype(t,n.type)}if(c.errors.length===0)return new e(r,a,o,s)}}if(s.length===1)n.errors.push(...c.errors);else{let e=(s.length?s:o).map(([e])=>fg(e)).join(` | `),r=[];for(let e=1;e<t.length;e++){let i=n.parse(t[e],1+r.length);if(!i)return null;r.push(Xf(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(`, `)}) instead.`)}return null}static register(t,n){e.definitions=n;for(let r in n)t[r]=e}};function sg(e,[t,n,r,i]){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);let a=i?i.evaluate(e):1,o=Wp(t,n,r,a);if(o)throw new zp(o);return new jp(t/255,n/255,r/255,a,!1)}function cg(e,t){return e in t}function lg(e,t){let n=t[e];return n===void 0?null:n}function ug(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}function dg(e){return{type:e}}og.register(ag,{error:[Vf,[J],(e,[t])=>{throw new zp(t.evaluate(e))}],typeof:[J,[X],(e,[t])=>Xf(Kp(t.evaluate(e)))],"to-rgba":[Yf(q,4),[Rf],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[n*255,r*255,i*255,a]}],rgb:[Rf,[q,q,q],sg],rgba:[Rf,[q,q,q,q],sg],has:{type:Y,overloads:[[[J],(e,[t])=>cg(t.evaluate(e),e.properties())],[[J,Bf],(e,[t,n])=>cg(t.evaluate(e),n.evaluate(e))]]},get:{type:X,overloads:[[[J],(e,[t])=>lg(t.evaluate(e),e.properties())],[[J,Bf],(e,[t,n])=>lg(t.evaluate(e),n.evaluate(e))]]},"feature-state":[X,[J],(e,[t])=>lg(t.evaluate(e),e.featureState||{})],properties:[Bf,[],e=>e.properties()],"geometry-type":[J,[],e=>e.geometryType()],id:[X,[],e=>e.id()],zoom:[q,[],e=>e.globals.zoom],"heatmap-density":[q,[],e=>e.globals.heatmapDensity||0],elevation:[q,[],e=>e.globals.elevation||0],"line-progress":[q,[],e=>e.globals.lineProgress||0],accumulated:[X,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[q,dg(q),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[q,dg(q),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:q,overloads:[[[q,q],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[q],(e,[t])=>-t.evaluate(e)]]},"/":[q,[q,q],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[q,[q,q],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[q,[],()=>Math.LN2],pi:[q,[],()=>Math.PI],e:[q,[],()=>Math.E],"^":[q,[q,q],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[q,[q],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[q,[q],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[q,[q],(e,[t])=>Math.log(t.evaluate(e))],log2:[q,[q],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[q,[q],(e,[t])=>Math.sin(t.evaluate(e))],cos:[q,[q],(e,[t])=>Math.cos(t.evaluate(e))],tan:[q,[q],(e,[t])=>Math.tan(t.evaluate(e))],asin:[q,[q],(e,[t])=>Math.asin(t.evaluate(e))],acos:[q,[q],(e,[t])=>Math.acos(t.evaluate(e))],atan:[q,[q],(e,[t])=>Math.atan(t.evaluate(e))],min:[q,dg(q),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[q,dg(q),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[q,[q],(e,[t])=>Math.abs(t.evaluate(e))],round:[q,[q],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[q,[q],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[q,[q],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Y,[J,X],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[Y,[X],(e,[t])=>e.id()===t.value],"filter-type-==":[Y,[J],(e,[t])=>e.geometryType()===t.value],"filter-<":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[Y,[X],(e,[t])=>t.value in e.properties()],"filter-has-id":[Y,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[Y,[Yf(J)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Y,[Yf(X)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Y,[J,Yf(X)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Y,[J,Yf(X)],(e,[t,n])=>ug(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:Y,overloads:[[[Y,Y],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[dg(Y),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:Y,overloads:[[[Y,Y],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[dg(Y),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[Y,[Y],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Y,[J],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return n?n(t.evaluate(e)):!0}],upcase:[J,[J],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[J,[J],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[J,dg(X),(e,t)=>t.map(t=>qp(t.evaluate(e))).join(``)],"resolved-locale":[J,[Hf],(e,[t])=>t.evaluate(e).resolvedLocale()]});function fg(e){return Array.isArray(e)?`(${e.map(Xf).join(`, `)})`:`(${Xf(e.type)}...)`}function pg(e){if(e instanceof rm)return pg(e.boundExpression);if(e instanceof og&&e.name===`error`||e instanceof Bm||e instanceof vh||e instanceof rg||e instanceof ig)return!1;let t=e instanceof Qp||e instanceof Xp,n=!0;return e.eachChild(e=>{t?n&&=pg(e):n&&=e instanceof Jp}),n?mg(e)&&gg(e,[`zoom`,`heatmap-density`,`elevation`,`line-progress`,`accumulated`,`is-supported-script`]):!1}function mg(e){if(e instanceof og&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof vh||e instanceof rg)return!1;let t=!0;return e.eachChild(e=>{t&&!mg(e)&&(t=!1)}),t}function hg(e){if(e instanceof og&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild(e=>{t&&!hg(e)&&(t=!1)}),t}function gg(e,t){if(e instanceof og&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild(e=>{n&&!gg(e,t)&&(n=!1)}),n}function _g(e){return{result:`success`,value:e}}function vg(e){return{result:`error`,value:e}}function yg(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function bg(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function xg(e){return!!e.expression&&e.expression.interpolated}function Z(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function Sg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Kp(e)===Bf}var Cg=class{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new em,this._defaultValue=t?Mg(t):null,this._enumValues=t&&t.type===`enum`?t.values:null}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!==e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new zp(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(`, `)}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<`u`&&console.warn(e.message)),this._defaultValue}}};function wg(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in ag}function Tg(e,t){let n=new tm(ag,pg,[],t?jg(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&t.type===`string`?{typeAnnotation:`coerce`}:void 0);return r?_g(new Cg(r,t)):vg(n.errors)}var Eg=class{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!hg(t.expression),this.globalStateRefs=Ag(t.expression)}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}},Dg=class{constructor(e,t,n,r){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!hg(t.expression),this.globalStateRefs=Ag(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?_m.interpolationFactor(this.interpolationType,e,t,n):0}};function Og(e,t){let n=Tg(e,t);if(n.result===`error`)return n;let r=n.value.expression,i=mg(r);if(!i&&!yg(t))return vg([new Ff(``,`data expressions not supported`)]);let a=gg(r,[`zoom`]);if(!a&&!bg(t))return vg([new Ff(``,`zoom expressions not supported`)]);let o=kg(r);if(!o&&!a)return vg([new Ff(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)]);if(o instanceof Ff)return vg([o]);if(o instanceof _m&&!xg(t))return vg([new Ff(``,`"interpolate" expressions cannot be used with this property`)]);if(!o)return _g(i?new Eg(`constant`,n.value):new Eg(`source`,n.value));let s=o instanceof _m?o.interpolation:void 0;return _g(i?new Dg(`camera`,n.value,o.labels,s):new Dg(`composite`,n.value,o.labels,s))}function kg(e){let t=null;if(e instanceof nm)t=kg(e.result);else if(e instanceof ym){for(let n of e.args)if(t=kg(n),t)break}else (e instanceof dm||e instanceof _m)&&e.input instanceof og&&e.input.name===`zoom`&&(t=e);return t instanceof Ff||e.eachChild(e=>{let n=kg(e);n instanceof Ff?t=n:!t&&n?t=new Ff(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new Ff(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t}function Ag(e,t=new Set){return e instanceof ig&&t.add(e.key),e.eachChild(e=>{Ag(e,t)}),t}function jg(e){let t={color:Rf,string:J,number:q,enum:J,boolean:Y,formatted:Uf,padding:Wf,numberArray:Kf,colorArray:Gf,projectionDefinition:zf,resolvedImage:qf,variableAnchorOffsetCollection:Jf};return e.type===`array`?Yf(t[e.value]||X,e.length):t[e.type]}function Mg(e){if(e.type===`color`&&Sg(e.default))return new jp(0,0,0,0);switch(e.type){case`color`:return jp.parse(e.default)||null;case`padding`:return Ip.parse(e.default)||null;case`numberArray`:return Lp.parse(e.default)||null;case`colorArray`:return Rp.parse(e.default)||null;case`variableAnchorOffsetCollection`:return Vp.parse(e.default)||null;case`projectionDefinition`:return Up.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function Ng(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case`has`:return e.length>=2&&e[1]!==`$id`&&e[1]!==`$type`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]));case`!in`:case`!has`:case`none`:return!1;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case`any`:case`all`:for(let t of e.slice(1))if(!Ng(t)&&typeof t!=`boolean`)return!1;return!0;default:return!0}}var Pg={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]}};function Fg(e){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Ng(e)||(e=Rg(e));let t=Tg(e,Pg);if(t.result===`error`)throw Error(t.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return{filter:(e,n,r)=>t.value.evaluate(e,n,{},r),needGeometry:Lg(e),getGlobalStateRefs:()=>Ag(t.value.expression)}}function Ig(e,t){return e<t?-1:e>t?1:0}function Lg(e){if(!Array.isArray(e))return!1;if(e[0]===`within`||e[0]===`distance`)return!0;for(let t=1;t<e.length;t++)if(Lg(e[t]))return!0;return!1}function Rg(e){if(!e)return!0;let t=e[0];return e.length<=1?t!==`any`:t===`==`?zg(e[1],e[2],`==`):t===`!=`?Ug(zg(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?zg(e[1],e[2],t):t===`any`?Bg(e.slice(1)):t===`all`?[`all`].concat(e.slice(1).map(Rg)):t===`none`?[`all`].concat(e.slice(1).map(Rg).map(Ug)):t===`in`?Vg(e[1],e.slice(2)):t===`!in`?Ug(Vg(e[1],e.slice(2))):t===`has`?Hg(e[1]):t===`!has`?Ug(Hg(e[1])):!0}function zg(e,t,n){switch(e){case`$type`:return[`filter-type-${n}`,t];case`$id`:return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function Bg(e){return[`any`].concat(e.map(Rg))}function Vg(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?[`filter-in-large`,e,[`literal`,t.sort(Ig)]]:[`filter-in-small`,e,[`literal`,t]]}}function Hg(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function Ug(e){return[`!`,e]}function Wg(e){return typeof e==`object`?[`literal`,e]:e}function Gg(e,t){let n=e.stops;if(!n)return Kg(e,t);let r=n&&typeof n[0][0]==`object`,i=r||e.property!==void 0,a=r||!i;return n=n.map(e=>!i&&t.tokens&&typeof e[1]==`string`?[e[0],n_(e[1])]:[e[0],Wg(e[1])]),r?Jg(e,t,n):a?Qg(e,t,n):Zg(e,t,n)}function Kg(e,t){let n=[`get`,e.property];if(e.default===void 0)return t.type===`string`?[`string`,n]:n;if(t.type===`enum`)return[`match`,n,Object.keys(t.values),n,e.default];{let r=[t.type===`color`?`to-color`:t.type,n,Wg(e.default)];return t.type===`array`&&r.splice(1,0,t.value,t.length||null),r}}function qg(e){switch(e.colorSpace){case`hcl`:return`interpolate-hcl`;case`lab`:return`interpolate-lab`;default:return`interpolate`}}function Jg(e,t,n){let r={},i={},a=[];for(let t=0;t<n.length;t++){let o=n[t],s=o[0].zoom;r[s]===void 0&&(r[s]={zoom:s,type:e.type,property:e.property,default:e.default},i[s]=[],a.push(s)),i[s].push([o[0].value,o[1]])}if(t_({},t)===`exponential`){let n=[qg(e),[`linear`],[`zoom`]];for(let e of a)e_(n,e,Zg(r[e],t,i[e]),!1);return n}else{let e=[`step`,[`zoom`]];for(let n of a)e_(e,n,Zg(r[n],t,i[n]),!0);return $g(e),e}}function Yg(e,t){if(e!==void 0)return e;if(t!==void 0)return t}function Xg(e,t){let n=Wg(Yg(e.default,t.default));return n===void 0&&t.type===`resolvedImage`?``:n}function Zg(e,t,n){let r=t_(e,t),i=[`get`,e.property];if(r===`categorical`&&typeof n[0][0]==`boolean`){let r=[`case`];for(let e of n)r.push([`==`,i,e[0]],e[1]);return r.push(Xg(e,t)),r}else if(r===`categorical`){let r=[`match`,i];for(let e of n)e_(r,e[0],e[1],!1);return r.push(Xg(e,t)),r}else if(r===`interval`){let t=[`step`,[`number`,i]];for(let e of n)e_(t,e[0],e[1],!0);return $g(t),e.default===void 0?t:[`case`,[`==`,[`typeof`,i],`number`],t,Wg(e.default)]}else if(r===`exponential`){let t=e.base===void 0?1:e.base,r=[qg(e),t===1?[`linear`]:[`exponential`,t],[`number`,i]];for(let e of n)e_(r,e[0],e[1],!1);return e.default===void 0?r:[`case`,[`==`,[`typeof`,i],`number`],r,Wg(e.default)]}else throw Error(`Unknown property function type ${r}`)}function Qg(e,t,n,r=[`zoom`]){let i=t_(e,t),a,o=!1;if(i===`interval`)a=[`step`,r],o=!0;else if(i===`exponential`){let t=e.base===void 0?1:e.base;a=[qg(e),t===1?[`linear`]:[`exponential`,t],r]}else throw Error(`Unknown zoom function type "${i}"`);for(let e of n)e_(a,e[0],e[1],o);return $g(a),a}function $g(e){e[0]===`step`&&e.length===3&&(e.push(0),e.push(e[3]))}function e_(e,t,n,r){e.length>3&&t===e[e.length-2]||(r&&e.length===2||e.push(t),e.push(n))}function t_(e,t){return e.type?e.type:t.expression.interpolated?`exponential`:`interval`}function n_(e){let t=[`concat`],n=/{([^{}]+)}/g,r=0;for(let i=n.exec(e);i!==null;i=n.exec(e)){let a=e.slice(r,n.lastIndex-i[0].length);r=n.lastIndex,a.length>0&&t.push(a),t.push([`get`,i[1]])}if(t.length===1)return e;if(r<e.length)t.push(e.slice(r));else if(t.length===2)return[`to-string`,t[1]];return t}function r_(e){let t=e.key,n=e.value;return n?[new K(t,n,`constants have been deprecated as of v8`)]:[]}function i_(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function a_(e){if(Array.isArray(e))return e.map(a_);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let n in e)t[n]=a_(e[n]);return t}return i_(e)}function o_(e){let t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,c=[],l=Z(n);if(l!==`object`)return[new K(t,n,`object expected, ${l} found`)];for(let e in n){let l=e.split(`.`)[0],u=Sp(r,l)||r[`*`],d;if(Sp(i,l))d=i[l];else if(Sp(r,l))d=s;else if(i[`*`])d=i[`*`];else if(r[`*`])d=s;else{c.push(new K(t,n[e],`unknown property "${e}"`));continue}c=c.concat(d({key:(t&&`${t}.`)+e,value:n[e],valueSpec:u,style:a,styleSpec:o,object:n,objectKey:e,validateSpec:s},n))}for(let e in r)i[e]||r[e].required&&r[e].default===void 0&&n[e]===void 0&&c.push(new K(t,n,`missing required property "${e}"`));return c}function s_(e){let t=e.value,n=e.valueSpec,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||r;if(Z(t)!==`array`)return[new K(o,t,`array expected, ${Z(t)} found`)];if(n.length&&t.length!==n.length)return[new K(o,t,`array length ${n.length} expected, length ${t.length} found`)];if(n[`min-length`]&&t.length<n[`min-length`])return[new K(o,t,`array length at least ${n[`min-length`]} expected, length ${t.length} found`)];let c={type:n.value,values:n.values};a.$version<7&&(c.function=n.function),Z(n.value)===`object`&&(c=n.value);let l=[];for(let n=0;n<t.length;n++)l=l.concat(s({array:t,arrayIndex:n,value:t[n],valueSpec:c,validateSpec:e.validateSpec,style:i,styleSpec:a,key:`${o}[${n}]`}));return l}function c_(e){let t=e.key,n=e.value,r=e.valueSpec,i=Z(n);return i===`number`&&n!==n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new K(t,n,`${n} is less than the minimum value ${r.minimum}`)]:`maximum`in r&&n>r.maximum?[new K(t,n,`${n} is greater than the maximum value ${r.maximum}`)]:[]:[new K(t,n,`number expected, ${i} found`)]}function l_(e){let t=e.valueSpec,n=i_(e.value.type),r,i={},a,o,s=n!==`categorical`&&e.value.property===void 0,c=!s,l=Z(e.value.stops)===`array`&&Z(e.value.stops[0])===`array`&&Z(e.value.stops[0][0])===`object`,u=o_({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:d,default:m}});return n===`identity`&&s&&u.push(new K(e.key,e.value,`missing required property "property"`)),n!==`identity`&&!e.value.stops&&u.push(new K(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!xg(e.valueSpec)&&u.push(new K(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!yg(e.valueSpec)?u.push(new K(e.key,e.value,`property functions not supported`)):s&&!bg(e.valueSpec)&&u.push(new K(e.key,e.value,`zoom functions not supported`))),(n===`categorical`||l)&&e.value.property===void 0&&u.push(new K(e.key,e.value,`"property" property is required`)),u;function d(e){if(n===`identity`)return[new K(e.key,e.value,`identity function may not have a "stops" property`)];let t=[],r=e.value;return t=t.concat(s_({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),Z(r)===`array`&&r.length===0&&t.push(new K(e.key,r,`array must have at least one stop`)),t}function f(e){let n=[],r=e.value,s=e.key;if(Z(r)!==`array`)return[new K(s,r,`array expected, ${Z(r)} found`)];if(r.length!==2)return[new K(s,r,`array length 2 expected, length ${r.length} found`)];if(l){if(Z(r[0])!==`object`)return[new K(s,r,`object expected, ${Z(r[0])} found`)];if(r[0].zoom===void 0)return[new K(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new K(s,r,`object stop key must have value`)];if(o&&o>i_(r[0].zoom))return[new K(s,r[0].zoom,`stop zoom values must appear in ascending order`)];i_(r[0].zoom)!==o&&(o=i_(r[0].zoom),a=void 0,i={}),n=n.concat(o_({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:c_,value:p}}))}else n=n.concat(p({key:`${s}[0]`,value:r[0],validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return wg(a_(r[1]))?n.concat([new K(`${s}[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(e.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){let s=Z(e.value),c=i_(e.value),l=e.value===null?o:e.value;if(!r)r=s;else if(s!==r)return[new K(e.key,l,`${s} stop domain type must match previous stop domain type ${r}`)];if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new K(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){let r=`number expected, ${s} found`;return yg(t)&&n===void 0&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new K(e.key,l,r)]}return n===`categorical`&&s===`number`&&(!isFinite(c)||Math.floor(c)!==c)?[new K(e.key,l,`integer expected, found ${c}`)]:n!==`categorical`&&s===`number`&&a!==void 0&&c<a?[new K(e.key,l,`stop domain values must appear in ascending order`)]:(a=c,n===`categorical`&&c in i?[new K(e.key,l,`stop domain values must be unique`)]:(i[c]=!0,[]))}function m(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}function u_(e){let t=(e.expressionContext===`property`?Og:Tg)(a_(e.value),e.valueSpec);if(t.result===`error`)return t.value.map(t=>new K(`${e.key}${t.key}`,e.value,t.message));let n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new K(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!hg(n))return[new K(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!hg(n))return[new K(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!gg(n,[`zoom`,`feature-state`]))return[new K(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!mg(n))return[new K(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function d_(e){let t=e.value,n=e.key,r=Z(t);return r===`boolean`?[]:[new K(n,t,`boolean expected, ${r} found`)]}function f_(e){let t=e.key,n=e.value,r=Z(n);return r===`string`?jp.parse(String(n))?[]:[new K(t,n,`color expected, "${n}" found`)]:[new K(t,n,`color expected, ${r} found`)]}function p_(e){let t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(i_(n))===-1&&i.push(new K(t,n,`expected one of [${r.values.join(`, `)}], ${JSON.stringify(n)} found`)):Object.keys(r.values).indexOf(i_(n))===-1&&i.push(new K(t,n,`expected one of [${Object.keys(r.values).join(`, `)}], ${JSON.stringify(n)} found`)),i}function m_(e){return Ng(a_(e.value))?u_(Pf({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}})):h_(e)}function h_(e){let t=e.value,n=e.key;if(Z(t)!==`array`)return[new K(n,t,`array expected, ${Z(t)} found`)];let r=e.styleSpec,i,a=[];if(t.length<1)return[new K(n,t,`filter array must have at least 1 element`)];switch(a=a.concat(p_({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),i_(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&i_(t[1])===`$type`&&a.push(new K(n,t,`"$type" cannot be use with operator "${t[0]}"`));case`==`:case`!=`:t.length!==3&&a.push(new K(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=Z(t[1]),i!==`string`&&a.push(new K(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=Z(t[o]),i_(t[1])===`$type`?a=a.concat(p_({key:`${n}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new K(`${n}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case`any`:case`all`:case`none`:for(let r=1;r<t.length;r++)a=a.concat(h_({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=Z(t[1]),t.length===2?i!==`string`&&a.push(new K(`${n}[1]`,t[1],`string expected, ${i} found`)):a.push(new K(n,t,`filter array for "${t[0]}" operator must have 2 elements`));break}return a}function g_(e,t){let n=e.key,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,c=a[`${t}_${e.layerType}`];if(!c)return[];let l=s.match(/^(.*)-transition$/);if(t===`paint`&&l&&c[l[1]]&&c[l[1]].transition)return r({key:n,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u=e.valueSpec||c[s];if(!u)return[new K(n,o,`unknown property "${s}"`)];let d;if(Z(o)===`string`&&yg(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new K(n,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];let f=[];return e.layerType===`symbol`&&(s===`text-field`&&i&&!i.glyphs&&f.push(new K(n,o,`use of "text-field" requires a style "glyphs" property`)),s===`text-font`&&Sg(a_(o))&&i_(o.type)===`identity`&&f.push(new K(n,o,`"text-font" does not support identity functions`))),f.concat(r({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:`property`,propertyType:t,propertyKey:s}))}function __(e){return g_(e,`paint`)}function v_(e){return g_(e,`layout`)}function y_(e){let t=[],n=e.value,r=e.key,i=e.style,a=e.styleSpec;if(Z(n)!==`object`)return[new K(r,n,`object expected, ${Z(n)} found`)];!n.type&&!n.ref&&t.push(new K(r,n,`either "type" or "ref" is required`));let o=i_(n.type),s=i_(n.ref);if(n.id){let a=i_(n.id);for(let o=0;o<e.arrayIndex;o++){let e=i.layers[o];i_(e.id)===a&&t.push(new K(r,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if(`ref`in n){[`type`,`source`,`source-layer`,`filter`,`layout`].forEach(e=>{e in n&&t.push(new K(r,n[e],`"${e}" is prohibited for ref layers`))});let e;i.layers.forEach(t=>{i_(t.id)===s&&(e=t)}),e?e.ref?t.push(new K(r,n.ref,`ref cannot reference another ref layer`)):o=i_(e.type):t.push(new K(r,n.ref,`ref layer "${s}" not found`))}else if(o!==`background`)if(!n.source)t.push(new K(r,n,`missing required property "source"`));else{let e=i.sources&&i.sources[n.source],a=e&&i_(e.type);e?a===`vector`&&o===`raster`?t.push(new K(r,n.source,`layer "${n.id}" requires a raster source`)):a!==`raster-dem`&&o===`hillshade`||a!==`raster-dem`&&o===`color-relief`?t.push(new K(r,n.source,`layer "${n.id}" requires a raster-dem source`)):a===`raster`&&o!==`raster`?t.push(new K(r,n.source,`layer "${n.id}" requires a vector source`)):a===`vector`&&!n[`source-layer`]?t.push(new K(r,n,`layer "${n.id}" must specify a "source-layer"`)):a===`raster-dem`&&o!==`hillshade`&&o!==`color-relief`?t.push(new K(r,n.source,`raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.`)):o===`line`&&n.paint&&n.paint[`line-gradient`]&&(a!==`geojson`||!e.lineMetrics)&&t.push(new K(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new K(r,n.source,`source "${n.source}" not found`))}return t=t.concat(o_({key:r,value:n,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${r}.type`,value:n.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:`type`})},filter:m_,layout(e){return o_({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return v_(Pf({layerType:o},e))}}})},paint(e){return o_({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return __(Pf({layerType:o},e))}}})}}})),t}function b_(e){let t=e.value,n=e.key,r=Z(t);return r===`string`?[]:[new K(n,t,`string expected, ${r} found`)]}function x_(e){let t=e.sourceName??``,n=e.value,r=e.styleSpec,i=r.source_raster_dem,a=e.style,o=[],s=Z(n);if(n===void 0)return o;if(s!==`object`)return o.push(new K(`source_raster_dem`,n,`object expected, ${s} found`)),o;let c=i_(n.encoding)===`custom`,l=[`redFactor`,`greenFactor`,`blueFactor`,`baseShift`],u=e.value.encoding?`"${e.value.encoding}"`:`Default`;for(let s in n)!c&&l.includes(s)?o.push(new K(s,n[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):i[s]?o=o.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:a,styleSpec:r})):o.push(new K(s,n[s],`unknown property "${s}"`));return o}var S_={promoteId:w_};function C_(e){let t=e.value,n=e.key,r=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new K(n,t,`"type" is required`)];let o=i_(t.type),s;switch(o){case`vector`:case`raster`:return s=o_({key:n,value:t,valueSpec:r[`source_${o.replace(`-`,`_`)}`],style:e.style,styleSpec:r,objectElementValidators:S_,validateSpec:a}),s;case`raster-dem`:return s=x_({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:a}),s;case`geojson`:if(s=o_({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:a,objectElementValidators:S_}),t.cluster)for(let e in t.clusterProperties){let[r,i]=t.clusterProperties[e],a=typeof r==`string`?[r,[`accumulated`],[`get`,e]]:r;s.push(...u_({key:`${n}.${e}.map`,value:i,expressionContext:`cluster-map`})),s.push(...u_({key:`${n}.${e}.reduce`,value:a,expressionContext:`cluster-reduce`}))}return s;case`video`:return o_({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:a,styleSpec:r});case`image`:return o_({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:a,styleSpec:r});case`canvas`:return[new K(n,null,`Please use runtime APIs to add canvas sources, rather than including them in stylesheets.`,`source.canvas`)];default:return p_({key:`${n}.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]}})}}function w_({key:e,value:t}){if(Z(t)===`string`)return b_({key:e,value:t});{let n=[];for(let r in t)n.push(...b_({key:`${e}.${r}`,value:t[r]}));return n}}function T_(e){let t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=Z(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new K(`light`,t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=s&&r[s[1]]&&r[s[1]].transition?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n})):r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new K(o,t[o],`unknown property "${o}"`)])}return a}function E_(e){let t=e.value,n=e.styleSpec,r=n.sky,i=e.style,a=Z(t);if(t===void 0)return[];if(a!==`object`)return[new K(`sky`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new K(a,t[a],`unknown property "${a}"`)]);return o}function D_(e){let t=e.value,n=e.styleSpec,r=n.terrain,i=e.style,a=[],o=Z(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new K(`terrain`,t,`object expected, ${o} found`)]),a;for(let o in t)a=r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new K(o,t[o],`unknown property "${o}"`)]);return a}function O_(e){return b_(e).length===0?[]:u_(e)}function k_(e){return b_(e).length===0?[]:u_(e)}function A_(e){let t=e.key,n=e.value;if(Z(n)===`array`){if(n.length<1||n.length>4)return[new K(t,n,`padding requires 1 to 4 values; ${n.length} values found`)];let r={type:`number`},i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}else return c_({key:t,value:n,valueSpec:{}})}function j_(e){let t=e.key,n=e.value;if(Z(n)===`array`){let r={type:`number`};if(n.length<1)return[new K(t,n,`array length at least 1 expected, length 0 found`)];let i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}else return c_({key:t,value:n,valueSpec:{}})}function M_(e){let t=e.key,n=e.value;if(Z(n)===`array`){if(n.length<1)return[new K(t,n,`array length at least 1 expected, length 0 found`)];let e=[];for(let r=0;r<n.length;r++)e=e.concat(f_({key:`${t}[${r}]`,value:n[r]}));return e}else return f_({key:t,value:n})}function N_(e){let t=e.key,n=e.value,r=Z(n),i=e.styleSpec;if(r!==`array`||n.length<1||n.length%2!=0)return[new K(t,n,`variableAnchorOffsetCollection requires a non-empty array of even length`)];let a=[];for(let r=0;r<n.length;r+=2)a=a.concat(p_({key:`${t}[${r}]`,value:n[r],valueSpec:i.layout_symbol[`text-anchor`]})),a=a.concat(s_({key:`${t}[${r+1}]`,value:n[r+1],valueSpec:{length:2,value:`number`},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a}function P_(e){let t=[],n=e.value,r=e.key;if(Array.isArray(n)){let i=[],a=[];for(let o in n)n[o].id&&i.includes(n[o].id)&&t.push(new K(r,n,`all the sprites' ids must be unique, but ${n[o].id} is duplicated`)),i.push(n[o].id),n[o].url&&a.includes(n[o].url)&&t.push(new K(r,n,`all the sprites' URLs must be unique, but ${n[o].url} is duplicated`)),a.push(n[o].url),t=t.concat(o_({key:`${r}[${o}]`,value:n[o],valueSpec:{id:{type:`string`,required:!0},url:{type:`string`,required:!0}},validateSpec:e.validateSpec}));return t}else return b_({key:r,value:n})}function F_(e){let t=e.value,n=e.styleSpec,r=n.projection,i=e.style,a=Z(t);if(t===void 0)return[];if(a!==`object`)return[new K(`projection`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new K(a,t[a],`unknown property "${a}"`)]);return o}function I_(e){let t=e.key,n=e.value;n=n instanceof String?n.valueOf():n;let r=Z(n);return r===`array`&&!R_(n)&&!L_(n)?[new K(t,n,`projection expected, invalid array ${JSON.stringify(n)} found`)]:[`array`,`string`].includes(r)?[]:[new K(t,n,`projection expected, invalid type "${r}" found`)]}function L_(e){return!![`interpolate`,`step`,`literal`].includes(e[0])}function R_(e){return Array.isArray(e)&&e.length===3&&typeof e[0]==`string`&&typeof e[1]==`string`&&typeof e[2]==`number`}function z_(e){return!!e&&e.constructor===Object}function B_(e){return z_(e.value)?[]:[new K(e.key,e.value,`object expected, ${Z(e.value)} found`)]}var V_={"*"(){return[]},array:s_,boolean:d_,number:c_,color:f_,constants:r_,enum:p_,filter:m_,function:l_,layer:y_,object:o_,source:C_,light:T_,sky:E_,terrain:D_,projection:F_,projectionDefinition:I_,string:b_,formatted:O_,resolvedImage:k_,padding:A_,numberArray:j_,colorArray:M_,variableAnchorOffsetCollection:N_,sprite:P_,state:B_};function H_(e){let t=e.value,n=e.valueSpec,r=e.styleSpec;return e.validateSpec=H_,n.expression&&Sg(i_(t))?l_(e):n.expression&&wg(a_(t))?u_(e):n.type&&V_[n.type]?V_[n.type](e):o_(Pf({},e,{valueSpec:n.type?r[n.type]:n}))}function U_(e){let t=e.value,n=e.key,r=b_(e);return r.length?r:(t.indexOf(`{fontstack}`)===-1&&r.push(new K(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new K(n,t,`"glyphs" url must include a "{range}" token`)),r)}function W_(e,t=Af){let n=[];return n=n.concat(H_({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:H_,objectElementValidators:{glyphs:U_,"*"(){return[]}}})),e.constants&&(n=n.concat(r_({key:`constants`,value:e.constants}))),K_(n)}W_.source=q_(G_(C_)),W_.sprite=q_(G_(P_)),W_.glyphs=q_(G_(U_)),W_.light=q_(G_(T_)),W_.sky=q_(G_(E_)),W_.terrain=q_(G_(D_)),W_.state=q_(G_(B_)),W_.layer=q_(G_(y_)),W_.filter=q_(G_(m_)),W_.paintProperty=q_(G_(__)),W_.layoutProperty=q_(G_(v_));function G_(e){return function(t){return e({...t,validateSpec:H_})}}function K_(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function q_(e){return function(...t){return K_(e.apply(this,t))}}var J_=Af,Y_={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},X_=` `,Z_=/(italic|oblique)$/i,Q_={};function $_(e,t,n){var r=Q_[e];if(!r){Array.isArray(e)||(e=[e]);for(var i=400,a=`normal`,o=[],s,c,l=0,u=e.length;l<u;++l){var d=e[l].split(` `),f=d[d.length-1].toLowerCase();for(var p in f==`normal`||f==`italic`||f==`oblique`?(a=c?a:f,c=!0,d.pop(),f=d[d.length-1].toLowerCase()):Z_.test(f)&&(f=f.replace(Z_,``),a=c?a:d[d.length-1].replace(f,``),c=!0),Y_){var m=d.length>1?d[d.length-2].toLowerCase():``;if(f==p||f==p.replace(`-`,``)||m+`-`+f==p){i=s?i:Y_[p],d.pop(),m&&p.startsWith(m)&&d.pop();break}}!s&&typeof f==`number`&&(i=f,s=!0);var h=d.join(X_).replace(`Klokantech Noto Sans`,`Noto Sans`).replace(`DIN Pro`,`Barlow`).replace(`Arial Unicode MS`,`Arial`);h.indexOf(X_)!==-1&&(h=`"`+h+`"`),o.push(h)}r=Q_[e]=[a,i,o]}return r[0]+X_+r[1]+X_+t+`px`+(n?`/`+n:``)+X_+r[2]}var ev=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},tv=class extends ev{constructor(e,t,n,r,i,a,o){super(),this.context_=e,this.pixelRatio_=t,this.extent_=n,this.transform_=r,this.transformRotation_=r?Bt(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=i,this.squaredTolerance_=a,this.userTransform_=o,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_=Ti()}drawImages_(e,t,n,r){if(!this.image_)return;let i=Bi(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,s=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=s*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let e=0,t=i.length;e<t;e+=2){let t=i[e]-this.imageAnchorX_,n=i[e+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){let e=t+this.imageAnchorX_,r=n+this.imageAnchorY_;Ni(o,e,r,1,1,c,-e,-r),a.save(),a.transform.apply(a,o),a.translate(e,r),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,n,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=s)}drawText_(e,t,n,r){if(!this.textState_||this.text_===``)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let i=Bi(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);t<n;t+=r){let e=i[t]+this.textOffsetX_,n=i[t+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(e-this.textOffsetX_,n-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,e,n),this.textFillState_&&a.fillText(this.text_,e,n))}}moveToLineTo_(e,t,n,r,i){let a=this.context_,o=Bi(e,t,n,r,this.transform_,this.pixelCoordinates_);a.moveTo(o[0],o[1]);let s=o.length;i&&(s-=2);for(let e=2;e<s;e+=2)a.lineTo(o[e],o[e+1]);return i&&a.closePath(),n}drawRings_(e,t,n,r){for(let i=0,a=n.length;i<a;++i)t=this.moveToLineTo_(e,t,n[i],r,!0);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=Xi(e,this.transform_,this.pixelCoordinates_),n=t[2]-t[0],r=t[3]-t[1],i=Math.sqrt(n*n+r*r),a=this.context_;a.beginPath(),a.arc(t[0],t[1],i,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.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;default:}}drawFeature(e,t){let n=t.getGeometryFunction()(e);n&&(this.setStyle(t),this.drawGeometry(n))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,n=t.length;e<n;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(n,0,n.length,e.getStride(),!1),t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(Tn(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates(),r=0,i=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e)r=this.moveToLineTo_(n,r,i[e],a,!1);t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let 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_!==``){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getOrientedFlatCoordinates(),r=0,i=e.getEndss(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e){let t=i[e];r=this.drawRings_(n,r,t,a)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,n=this.contextFillState_;n?n.fillStyle!=e.fillStyle&&(n.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=e.lineCap&&(n.lineCap=e.lineCap,t.lineCap=e.lineCap),Ge(n.lineDash,e.lineDash)||t.setLineDash(n.lineDash=e.lineDash),n.lineDashOffset!=e.lineDashOffset&&(n.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),n.lineJoin!=e.lineJoin&&(n.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),n.lineWidth!=e.lineWidth&&(n.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),n.miterLimit!=e.miterLimit&&(n.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),n.strokeStyle!=e.strokeStyle&&(n.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){let t=this.context_,n=this.contextTextState_,r=e.textAlign?e.textAlign:kl;n?(n.font!=e.font&&(n.font=e.font,t.font=e.font),n.textAlign!=r&&(n.textAlign=r,t.textAlign=r),n.textBaseline!=e.textBaseline&&(n.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_={fillStyle:xl(e.getColor()||wl)}:this.fillState_=null,!t)this.strokeState_=null;else{let e=t.getColor(),n=t.getLineCap(),r=t.getLineDash(),i=t.getLineDashOffset(),a=t.getLineJoin(),o=t.getWidth(),s=t.getMiterLimit(),c=r||El;this.strokeState_={lineCap:n===void 0?Tl:n,lineDash:this.pixelRatio_===1?c:c.map(e=>e*this.pixelRatio_),lineDashOffset:(i||0)*this.pixelRatio_,lineJoin:a===void 0?Dl:a,lineWidth:(o===void 0?1:o)*this.pixelRatio_,miterLimit:s===void 0?10:s,strokeStyle:xl(e||Ol)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();t?this.textFillState_={fillStyle:xl(t.getColor()||wl)}:this.textFillState_=null;let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?Tl:t,lineDash:r||El,lineDashOffset:i||0,lineJoin:a===void 0?Dl:a,lineWidth:o===void 0?1:o,miterLimit:s===void 0?10:s,strokeStyle:xl(e||Ol)}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?Cl:r,textAlign:u===void 0?kl:u,textBaseline:d===void 0?Al:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o===void 0?!1:o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}},nv=.5,rv={Point:hv,LineString:fv,Polygon:_v,MultiPoint:gv,MultiLineString:pv,MultiPolygon:mv,GeometryCollection:dv,Circle:sv};function iv(e,t){return parseInt(F(e),10)-parseInt(F(t),10)}function av(e,t){let n=ov(e,t);return n*n}function ov(e,t){return nv*e/t}function sv(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Circle`);s.setFillStrokeStyle(a,o),s.drawCircle(t,r,i)}let s=n.getText();if(s&&s.getText()){let i=e.getBuilder(n.getZIndex(),`Text`);i.setTextStyle(s),i.drawText(t,r)}}function cv(e,t,n,r,i,a,o,s){let c=[],l=n.getImage();if(l){let e=!0,t=l.getImageState();t==G.LOADED||t==G.ERROR?e=!1:t==G.IDLE&&l.load(),e&&c.push(l.ready())}let u=n.getFill();u&&u.loading()&&c.push(u.ready());let d=c.length>0;return d&&Promise.all(c).then(()=>i(null)),lv(e,t,n,r,a,o,s),d}function lv(e,t,n,r,i,a,o){let s=n.getGeometryFunction()(t);if(!s)return;let c=s.simplifyTransformed(r,i);if(n.getRenderer())uv(e,c,n,t,o);else{let r=rv[c.getType()];r(e,c,n,t,o,a)}}function uv(e,t,n,r,i){if(t.getType()==`GeometryCollection`){let a=t.getGeometries();for(let t=0,o=a.length;t<o;++t)uv(e,a[t],n,r,i);return}e.getBuilder(n.getZIndex(),`Default`).drawCustom(t,r,n.getRenderer(),n.getHitDetectionRenderer(),i)}function dv(e,t,n,r,i,a){let o=t.getGeometriesArray(),s,c;for(s=0,c=o.length;s<c;++s){let t=rv[o[s].getType()];t(e,o[s],n,r,i,a)}}function fv(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function pv(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawMultiLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function mv(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(o||a){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawMultiPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function hv(e,t,n,r,i,a){let o=n.getImage(),s=n.getText(),c=s&&s.getText(),l=a&&o&&c?{}:void 0;if(o){if(o.getImageState()!=G.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,l),a.drawPoint(t,r,i)}if(c){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s,l),a.drawText(t,r,i)}}function gv(e,t,n,r,i,a){let o=n.getImage(),s=o&&o.getOpacity()!==0,c=n.getText(),l=c&&c.getText(),u=a&&s&&l?{}:void 0;if(s){if(o.getImageState()!=G.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,u),a.drawMultiPoint(t,r,i)}if(l){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(c,u),a.drawText(t,r,i)}}function _v(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}var vv=!1;function yv(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=vv,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.getType();try{let r;e==`text`||e==`json`?r=s.responseText:e==`xml`?r=s.responseXML||s.responseText:e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}catch{o()}}else o()},s.onerror=o,s.send()}function bv(e,t){return function(n,r,i,a,o){yv(e,t,n,r,i,(e,t)=>{this.addFeatures(e),a!==void 0&&a(e)},()=>{this.changed(),o!==void 0&&o()})}}function xv(e,t){return[[-1/0,-1/0,1/0,1/0]]}function Sv(e,t){return[e]}var Cv=class{constructor(e){this.rbush_=new Os(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[F(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=e[r],a=t[r],o={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:a};n[r]=o,this.items_[F(a)]=o}this.rbush_.load(n)}remove(e){let t=F(e),n=this.items_[t];return delete this.items_[t],this.rbush_.remove(n)!==null}update(e,t){let n=this.items_[F(t)];cn([n.minX,n.minY,n.maxX,n.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(e){return e.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let n;for(let r=0,i=e.length;r<i;r++)if(n=t(e[r]),n)return n;return n}isEmpty(){return $e(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return rn(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}},wv=class extends ct{constructor(e){super(),this.projection=B(e.projection),this.attributions_=Tv(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX===void 0?!1:e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}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_=Tv(e),this.changed()}setState(e){this.state_=e,this.changed()}};function Tv(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}var Ev={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`},Dv=class extends et{constructor(e,t,n){super(e),this.feature=t,this.features=n}},Ov=class extends wv{constructor(e){e||={},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0?!0:e.wrapX}),this.on,this.once,this.un,this.loader_=Ye,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(R(this.format_,"`format` must be set when `url` is set"),this.loader_=bv(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?xv:e.strategy;let t=e.useSpatialIndex===void 0?!0:e.useSpatialIndex;this.featuresRtree_=t?new Cv:null,this.loadedExtentsRtree_=new Cv,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new dt(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=F(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new Dv(Ev.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof md||(this.featureChangeKeys_[e]=[N(t,M.CHANGE,this.handleFeatureChange_,this),N(t,Le.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let n=!0;if(t.getId()!==void 0){let e=String(t.getId());if(!(e in this.idIndex_))this.idIndex_[e]=t;else if(t instanceof md){let r=this.idIndex_[e];r instanceof md?Array.isArray(r)?r.push(t):this.idIndex_[e]=[r,t]:n=!1}else n=!1}return n&&(R(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=F(r);this.addToIndex_(i,r)&&n.push(r)}for(let e=0,i=n.length;e<i;e++){let i=n[e],a=F(i);this.setupChangeEvents_(a,i);let o=i.getGeometry();if(o){let e=o.getExtent();t.push(e),r.push(i)}else this.nullGeometryFeatures_[a]=i}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(Ev.ADDFEATURE))for(let e=0,t=n.length;e<t;e++)this.dispatchEvent(new Dv(Ev.ADDFEATURE,n[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(Ev.ADDFEATURE,function(n){t||=(t=!0,e.push(n.feature),!1)}),this.addEventListener(Ev.REMOVEFEATURE,function(n){t||=(t=!0,e.remove(n.feature),!1)}),e.addEventListener(Ie.ADD,e=>{t||=(t=!0,this.addFeature(e.element),!1)}),e.addEventListener(Ie.REMOVE,e=>{t||=(t=!0,this.removeFeature(e.element),!1)}),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(rt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)});for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new Dv(Ev.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){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){let r=n.getGeometry();if(r instanceof md||r.intersectsCoordinate(e))return t(n)})}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(n){let r=n.getGeometry();if(r instanceof md||r.intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),$e(this.nullGeometryFeatures_)||We(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let n=jn(e,t);return[].concat(...n.map(e=>this.featuresRtree_.getInExtent(e)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];return t||=qe,this.featuresRtree_.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry(),c=o;if(o=t instanceof md?0:t.closestPointXY(n,r,a,o),o<c){i=e;let t=Math.sqrt(o);s[0]=n-t,s[1]=r-t,s[2]=n+t,s[3]=r+t}}}),i}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){let t=this.idIndex_[e.toString()];return t===void 0?null:t}getFeatureByUid(e){let t=this.uidIndex_[e];return t===void 0?null:t}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,n=F(t),r=t.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[n]=t);else{let e=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}let i=t.getId();if(i!==void 0){let e=i.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[n]=t;this.changed(),this.dispatchEvent(new Dv(Ev.CHANGEFEATURE,t))}hasFeature(e){let t=e.getId();return t===void 0?F(e)in this.uidIndex_:t in this.idIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&$e(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,n){let r=this.loadedExtentsRtree_,i=this.strategy_(e,t,n);for(let e=0,a=i.length;e<a;++e){let a=i[e];r.forEachInExtent(a,function(e){return $t(e.extent,a)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Dv(Ev.FEATURESLOADSTART)),this.loader_.call(this,a,t,n,e=>{--this.loadingExtentsCount_,this.dispatchEvent(new Dv(Ev.FEATURESLOADEND,void 0,e))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Dv(Ev.FEATURESLOADERROR))}),r.insert(a,{extent:a.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n=t.forEachInExtent(e,function(t){if(cn(t.extent,e))return t});n&&t.remove(n)}removeFeatures(e){let t=!1;for(let n=0,r=e.length;n<r;++n)t=this.removeFeatureInternal(e[n])||t;t&&this.changed()}removeFeature(e){e&&this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=F(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[t]?.forEach(rt),delete this.featureChangeKeys_[t];let n=e.getId();if(n!==void 0){let t=n.toString(),r=this.idIndex_[t];r===e?delete this.idIndex_[t]:Array.isArray(r)&&(r.splice(r.indexOf(e),1),r.length===1&&(this.idIndex_[t]=r[0]))}return delete this.uidIndex_[t],this.hasListener(Ev.REMOVEFEATURE)&&this.dispatchEvent(new Dv(Ev.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(let t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){R(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(bv(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}},Q={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},kv=[Q.FILL],Av=[Q.STROKE],jv=[Q.BEGIN_PATH],Mv=[Q.CLOSE_PATH],Nv=class extends ev{constructor(e,t,n,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return t==1?e:e.map(function(e){return e*t})}appendFlatPointCoordinates(e,t){let n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,a=i.length;for(let o=0,s=e.length;o<s;o+=t)r[0]=e[o],r[1]=e[o+1],Qt(n,r)&&(i[a++]=r[0],i[a++]=r[1]);return a}appendFlatLineCoordinates(e,t,n,r,i,a){let o=this.coordinates,s=o.length,c=this.getBufferedMaxExtent();a&&(t+=r);let l=e[t],u=e[t+1],d=this.tmpCoordinate_,f=!0,p,m,h;for(p=t+r;p<n;p+=r)d[0]=e[p],d[1]=e[p+1],h=tn(c,d),h===m?h===Kt.INTERSECTING?(o[s++]=d[0],o[s++]=d[1],f=!1):f=!0:(f&&=(o[s++]=l,o[s++]=u,!1),o[s++]=d[0],o[s++]=d[1]),l=d[0],u=d[1],m=h;return(i&&f||p===t+r)&&(o[s++]=l,o[s++]=u),s}drawCustomCoordinates_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a],s=this.appendFlatLineCoordinates(e,t,o,r,!1,!1);i.push(s),t=o}return t}drawCustom(e,t,n,r,i){this.beginGeometry(e,t,i);let a=e.getType(),o=e.getStride(),s=this.coordinates.length,c,l,u,d,f;switch(a){case`MultiPolygon`:c=e.getOrientedFlatCoordinates(),d=[];let t=e.getEndss();f=0;for(let e=0,n=t.length;e<n;++e){let n=[];f=this.drawCustomCoordinates_(c,f,t[e],o,n),d.push(n)}this.instructions.push([Q.CUSTOM,s,d,e,n,pa,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,d,e,r||n,pa,i]);break;case`Polygon`:case`MultiLineString`:u=[],c=a==`Polygon`?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),f=this.drawCustomCoordinates_(c,0,e.getEnds(),o,u),this.instructions.push([Q.CUSTOM,s,u,e,n,fa,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,u,e,r||n,fa,i]);break;case`LineString`:case`Circle`:c=e.getFlatCoordinates(),l=this.appendFlatLineCoordinates(c,0,c.length,o,!1,!1),this.instructions.push([Q.CUSTOM,s,l,e,n,da,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,da,i]);break;case`MultiPoint`:c=e.getFlatCoordinates(),l=this.appendFlatPointCoordinates(c,o),l>s&&(this.instructions.push([Q.CUSTOM,s,l,e,n,da,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,da,i]));break;case`Point`:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([Q.CUSTOM,s,l,e,n,void 0,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,void 0,i]);break;default:}this.endGeometry(t)}beginGeometry(e,t,n){this.beginGeometryInstruction1_=[Q.BEGIN_GEOMETRY,t,0,e,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Q.BEGIN_GEOMETRY,t,0,e,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==Q.END_GEOMETRY?a=t:i==Q.BEGIN_GEOMETRY&&(r[2]=t,Ue(this.hitDetectionInstructions,a,t),a=-1)}fillStyleToState(e,t={}){if(e){let n=e.getColor();t.fillPatternScale=n&&typeof n==`object`&&`src`in n?this.pixelRatio:1,t.fillStyle=xl(n||wl)}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){t.strokeStyle=xl(e.getColor()||Ol);let n=e.getLineCap();t.lineCap=n===void 0?Tl:n;let r=e.getLineDash();t.lineDash=r?r.slice():El,t.lineDashOffset=e.getLineDashOffset()||0;let i=e.getLineJoin();t.lineJoin=i===void 0?Dl:i;let a=e.getWidth();t.lineWidth=a===void 0?1:a;let o=e.getMiterLimit();t.miterLimit=o===void 0?10:o,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){let n=this.state;this.fillStyleToState(e,n),this.strokeStyleToState(t,n)}createFill(e){let t=e.fillStyle,n=[Q.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(e.fillPatternScale),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Q.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){let n=e.fillStyle;(typeof n!=`string`||e.currentFillStyle!=n)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=n||e.currentLineCap!=r||i!=e.currentLineDash&&!Ge(e.currentLineDash,i)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=c)&&(t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[Q.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xt(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;Yt(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},Pv=class extends Nv{constructor(e,t,n,r){super(e,t,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,n){if(!this.image_||this.maxExtent&&!Qt(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,i);this.instructions.push([Q.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,n){if(!this.image_)return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=[];for(let t=0,n=r.length;t<n;t+=e.getStride())(!this.maxExtent||Qt(this.maxExtent,r.slice(t,t+2)))&&i.push(r[t],r[t+1]);let a=this.coordinates.length,o=this.appendFlatPointCoordinates(i,2);this.instructions.push([Q.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(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){let n=e.getAnchor(),r=e.getSize(),i=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},Fv=class extends Nv{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinates_(e,t,n,r){let i=this.coordinates.length,a=this.appendFlatLineCoordinates(e,t,n,r,!1,!1),o=[Q.MOVE_TO_LINE_TO,i,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),n}drawLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0],jv);let o=e.getFlatCoordinates(),s=e.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Av),this.endGeometry(t)}drawMultiLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0],jv);let o=e.getEnds(),s=e.getFlatCoordinates(),c=e.getStride(),l=0;for(let e=0,t=o.length;e<t;++e)l=this.drawFlatCoordinates_(s,l,o[e],c);this.hitDetectionInstructions.push(Av),this.endGeometry(t)}finish(){let e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Av),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Av),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(jv)}},Iv=class extends Nv{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinatess_(e,t,n,r){let i=this.state,a=i.fillStyle!==void 0,o=i.strokeStyle!==void 0,s=n.length;this.instructions.push(jv),this.hitDetectionInstructions.push(jv);for(let i=0;i<s;++i){let a=n[i],s=this.coordinates.length,c=this.appendFlatLineCoordinates(e,t,a,r,!0,!o),l=[Q.MOVE_TO_LINE_TO,s,c];this.instructions.push(l),this.hitDetectionInstructions.push(l),o&&(this.instructions.push(Mv),this.hitDetectionInstructions.push(Mv)),t=a}return a&&(this.instructions.push(kv),this.hitDetectionInstructions.push(kv)),o&&(this.instructions.push(Av),this.hitDetectionInstructions.push(Av)),t}drawCircle(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle;if(i===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,wl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0]);let o=e.getFlatCoordinates(),s=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);let l=[Q.CIRCLE,c];this.instructions.push(jv,l),this.hitDetectionInstructions.push(jv,l),r.fillStyle!==void 0&&(this.instructions.push(kv),this.hitDetectionInstructions.push(kv)),r.strokeStyle!==void 0&&(this.instructions.push(Av),this.hitDetectionInstructions.push(Av)),this.endGeometry(t)}drawPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle;if(i===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,wl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0]);let o=e.getEnds(),s=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(s,0,o,c),this.endGeometry(t)}drawMultiPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle;if(i===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,wl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0]);let o=e.getEndss(),s=e.getOrientedFlatCoordinates(),c=e.getStride(),l=0;for(let e=0,t=o.length;e<t;++e)l=this.drawFlatCoordinatess_(s,l,o[e],c);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(e!==0){let t=this.coordinates;for(let n=0,r=t.length;n<r;++n)t[n]=ga(t[n],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}};function Lv(e,t,n,r,i){let a=[],o=n,s=0,c=t.slice(n,2);for(;s<e&&o+i<r;){let[n,r]=c.slice(-2),l=t[o+i],u=t[o+i+1],d=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r));if(s+=d,s>=e){let t=(e-s+d)/d,f=zt(n,l,t),p=zt(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s<e)c.push(t[o+i],t[o+i+1]),o+=i;else{let e=d-s,t=zt(n,l,e/d),f=zt(r,u,e/d);c.push(t,f),a.push(c),c=[t,f],s=0,o+=i}}return s>0&&a.push(c),a}function Rv(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;d<r;d+=i){let n=t[d],r=t[d+1];m!==void 0&&(v=n-m,y=r-h,p=Math.sqrt(v*v+y*y),g!==void 0&&(c+=f,u=Math.acos((g*v+_*y)/(f*p)),u>e&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p,c>s?[l,d]:[a,o]}var zv={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Bv={Circle:Iv,Default:Nv,Image:Pv,LineString:Fv,Polygon:Iv,Text:class extends Nv{constructor(e,t,n,r){super(e,t,n,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[wl]={fillStyle:wl},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,n){let r=this.textFillState_,i=this.textStrokeState_,a=this.textState_;if(this.text_===``||!a||!r&&!i)return;let o=this.coordinates,s=o.length,c=e.getType(),l=null,u=e.getStride();if(a.placement===`line`&&(c==`LineString`||c==`MultiLineString`||c==`Polygon`||c==`MultiPolygon`)){if(!Tn(this.maxExtent,e.getExtent()))return;let r;if(l=e.getFlatCoordinates(),c==`LineString`)r=[l.length];else if(c==`MultiLineString`)r=e.getEnds();else if(c==`Polygon`)r=e.getEnds().slice(0,1);else if(c==`MultiPolygon`){let t=e.getEndss();r=[];for(let e=0,n=t.length;e<n;++e)r.push(t[e][0])}this.beginGeometry(e,t,n);let i=a.repeat,d=i?void 0:a.textAlign,f=0;for(let e=0,t=r.length;e<t;++e){let t;t=i?Lv(i*this.resolution,l,f,r[e],u):[l.slice(f,r[e])];for(let n=0,i=t.length;n<i;++n){let i=t[n],c=0,l=i.length;if(d==null){let e=Rv(a.maxAngle,i,0,i.length,2);c=e[0],l=e[1]}for(let e=c;e<l;e+=u)o.push(i[e],i[e+1]);let p=o.length;f=r[e],this.drawChars_(s,p),s=p}}this.endGeometry(t)}else{let r=a.overflow?null:[];switch(c){case`Point`:case`MultiPoint`:l=e.getFlatCoordinates();break;case`LineString`:l=e.getFlatMidpoint();break;case`Circle`:l=e.getCenter();break;case`MultiLineString`:l=e.getFlatMidpoints(),u=2;break;case`Polygon`:l=e.getFlatInteriorPoint(),a.overflow||r.push(l[2]/this.resolution),u=3;break;case`MultiPolygon`:let t=e.getFlatInteriorPoints();l=[];for(let e=0,n=t.length;e<n;e+=3)a.overflow||r.push(t[e+2]/this.resolution),l.push(t[e],t[e+1]);if(l.length===0)return;u=2;break;default:}let i=this.appendFlatPointCoordinates(l,u);if(i===s)return;if(r&&(i-s)/2!==l.length/u){let e=s/2;r=r.filter((t,n)=>{let r=o[(e+n)*2]===l[n*u]&&o[(e+n)*2+1]===l[n*u+1];return r||--e,r})}this.saveTextStates_();let d=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,f=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,n);let p=a.padding;if(p!=jl&&(a.scale[0]<0||a.scale[1]<0)){let e=a.padding[0],t=a.padding[1],n=a.padding[2],r=a.padding[3];a.scale[0]<0&&(t=-t,r=-r),a.scale[1]<0&&(e=-e,n=-n),p=[e,t,n,r]}let m=this.pixelRatio;this.instructions.push([Q.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==jl?jl:p.map(function(e){return e*m}),d,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);let h=1/m,g=d?d.slice(0):null;g&&(g[1]=wl),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[h,h],NaN,this.declutterMode_,this.declutterImageWithText_,p,g,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?wl:this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=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}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||`center`,justify:t.justify,textBaseline:t.textBaseline||`middle`,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=zv[r.textBaseline],l=this.textOffsetY_*s,u=this.text_,d=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Q.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,l,i,d*s,u,a,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([Q.DRAW_CHARS,e,t,c,r.overflow,o&&wl,r.maxAngle,s,l,i,d*s,u,a,1/s,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=xl(t.getColor()||`#000`)):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||`round`,i.lineDash=e?e.slice():El,i.lineDashOffset=t===void 0?0:t,i.lineJoin=a.getLineJoin()||`round`,i.lineWidth=n===void 0?1:n,i.miterLimit=r===void 0?10:r,i.strokeStyle=xl(a.getColor()||`#000`)}n=this.textState_;let o=e.getFont()||`10px sans-serif`;Rl(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||`middle`,n.backgroundFill=e.getBackgroundFill(),n.backgroundStroke=e.getBackgroundStroke(),n.padding=e.getPadding()||jl,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u===void 0?!1:u,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:F(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle==`string`?r.fillStyle:`|`+F(r.fillStyle):``}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}},Vv=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];if(i===void 0){let e=Bv[t];i=new e(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i}return i}};function Hv(e,t,n,r,i,a,o,s,c,l,u,d,f=!0){let p=e[t],m=e[t+1],h=0,g=0,_=0,v=0;function y(){h=p,g=m,t+=r,p=e[t],m=e[t+1],v+=_,_=Math.sqrt((p-h)*(p-h)+(m-g)*(m-g))}do y();while(t<n-r&&v+_<a);let b=_===0?0:(a-v)/_,x=zt(h,p,b),S=zt(g,m,b),C=t-r,w=v,T=a+s*c(l,i,u);for(;t<n-r&&v+_<T;)y();b=_===0?0:(T-v)/_;let E=zt(h,p,b),D=zt(g,m,b),O=!1;if(f)if(d){let e=[x,S,E,D];Vi(e,0,4,2,d,e,e),O=e[0]>e[2]}else O=x>E;let k=Math.PI,A=[],ee=C+r===t;t=C,_=0,v=w,p=e[t],m=e[t+1];let j;if(ee)return y(),j=Math.atan2(m-g,p-h),O&&(j+=j>0?-k:k),A[0]=[(E+x)/2,(D+S)/2,(T-a)/2,j,i],A;i=i.replace(/\n/g,` `);for(let e=0,d=i.length;e<d;){y();let f=Math.atan2(m-g,p-h);if(O&&(f+=f>0?-k:k),j!==void 0){let e=f-j;if(e+=e>k?-2*k:e<-k?2*k:0,Math.abs(e)>o)return null}j=f;let x=e,S=0;for(;e<d;++e){let o=O?d-e-1:e,f=s*c(l,i[o],u);if(t+r<n&&v+_<a+S+f/2)break;S+=f}if(e===x)continue;let C=O?i.substring(d-x,d-e):i.substring(x,e);b=_===0?0:(a+S/2-v)/_;let w=zt(h,p,b),T=zt(g,m,b);A.push([w,T,S/2,f,C]),a+=S}return A}var Uv=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(yo(),{get:(e,t)=>{if(typeof yo()[t]==`function`)return this.push_(t),this.pushMethodArgs_},set:(e,t,n)=>(this.push_(t,n),!0)})}push_(...e){let t=this.instructions_,n=this.zIndex+this.offset_;t[n]||(t[n]=[]),t[n].push(...e)}pushMethodArgs_=(...e)=>(this.push_(e),this);pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let n=0,r=t.length;n<r;++n){let r=t[n];if(typeof r==`function`){r(e);continue}let i=t[++n];if(typeof e[r]==`function`)e[r](...i);else{if(typeof i==`function`){e[r]=i(e);continue}e[r]=i}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},Wv=nn(),Gv=[],Kv=[],qv=[],Jv=[];function Yv(e){return e[3].declutterBox}var Xv=RegExp(`[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]`);function Zv(e,t){return t===`start`?t=Xv.test(e)?`right`:`left`:t===`end`&&(t=Xv.test(e)?`left`:`right`),zv[t]}function Qv(e,t,n){return n>0&&e.push(`
|
|
5
|
-
`,``),e.push(t,``),e}function
|
|
6
|
-
`).reduce(
|
|
7
|
-
`){O+=D,D=0,w=u*v+C*d,++A;continue}let i=f[e+1]||s.font;i!==ee&&(r&&T.push(`font`,i),n&&E.push(`font`,i),ee=i),D=Math.max(D,g[k]);let a=[t,w+C*h[k]+u*(h[k]-_[A]),.5*(d+D)+O];w+=h[k],r&&T.push(`strokeText`,a),n&&E.push(`fillText`,a),++k}return Array.prototype.push.apply(y,T),Array.prototype.push.apply(y,E),this.labels_[i]=S,S}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(Gv[0]=S,Jv[0]=S,Gv[1]=C,Kv[1]=C,Kv[0]=S+b,qv[0]=Kv[0],qv[1]=C+x,Jv[1]=qv[1]);let w;return u===0?rn(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),Wv):(w=Ni(Ti(),n,r,1,1,u,-n,-r),Ai(w,Gv),Ai(w,Kv),Ai(w,qv),Ai(w,Jv),rn(Math.min(Gv[0],Kv[0],qv[0],Jv[0]),Math.min(Gv[1],Kv[1],qv[1],Jv[1]),Math.max(Gv[0],Kv[0],qv[0],Jv[0]),Math.max(Gv[1],Kv[1],qv[1],Jv[1]),Wv)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:Wv[0],minY:Wv[1],maxX:Wv[2],maxY:Wv[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0;return c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0&&(s&&this.replayTextBackground_(e,Gv,Kv,qv,Jv,a,o),Wl(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=Ai(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[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,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=Zv(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=zv[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&Ge(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||=[],l=Bi(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),ki(this.renderedTransform_,n));let u=0,d=r.length,f=0,p,m,h,g,_,v,y,b,x,S,C,w,T,E=0,D=0,O=this.coordinateCache_,k=this.viewRotation_,A=Math.round(Math.atan2(-n[1],n[0])*0xe8d4a51000)/0xe8d4a51000,ee={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},j=this.instructions!=r||this.overlaps?0:200,te,ne,re,ie;for(;u<d;){let n=r[u];switch(n[0]){case Q.BEGIN_GEOMETRY:te=n[1],ie=n[3],te.getGeometry()?o!==void 0&&!Tn(o,ie.getExtent())?u=n[2]+1:++u:u=n[2],c&&(c.zIndex=n[4]);break;case Q.BEGIN_PATH:E>j&&(this.fill_(e),E=0),D>j&&(e.stroke(),D=0),!E&&!D&&(e.beginPath(),_=NaN,v=NaN),++u;break;case Q.CIRCLE:f=n[1];let r=l[f],d=l[f+1],ae=l[f+2],oe=l[f+3],se=ae-r,ce=oe-d,le=Math.sqrt(se*se+ce*ce);e.moveTo(r+le,d),e.arc(r,d,le,0,2*Math.PI,!0),++u;break;case Q.CLOSE_PATH:e.closePath(),++u;break;case Q.CUSTOM:f=n[1],p=n[2];let ue=n[3],de=n[4],fe=n[5];ee.geometry=ue,ee.feature=te,u in O||(O[u]=[]);let pe=O[u];fe?fe(l,f,p,2,pe):(pe[0]=l[f],pe[1]=l[f+1],pe.length=2),c&&(c.zIndex=n[6]),de(pe,ee),++u;break;case Q.DRAW_IMAGE:f=n[1],p=n[2],x=n[3],m=n[4],h=n[5];let me=n[6],he=n[7],ge=n[8],_e=n[9],ve=n[10],ye=n[11],be=n[12],xe=n[13];g=n[14]||`declutter`;let Se=n[15];if(!x&&n.length>=20){S=n[19],C=n[20],w=n[21],T=n[22];let e=this.drawLabelWithPointPlacement_(S,C,w,T);x=e.label,n[3]=x;let t=n[23];m=(e.anchorX-t)*this.pixelRatio,n[4]=m;let r=n[24];h=(e.anchorY-r)*this.pixelRatio,n[5]=h,me=x.height,n[6]=me,xe=x.width,n[13]=xe}let Ce;n.length>25&&(Ce=n[25]);let we,Te,Ee;n.length>17?(we=n[16],Te=n[17],Ee=n[18]):(we=jl,Te=null,Ee=null),ve&&A?ye+=k:!ve&&!A&&(ye-=k);let De=0;for(;f<p;f+=2){if(Ce&&Ce[De++]<xe/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(x.width,x.height,l[f],l[f+1],xe,me,m,h,ge,_e,ye,be,i,we,!!Te||!!Ee,te),r=[e,t,x,n,he,Te,Ee];if(s){let e,t,i;if(Se){let n=p-f;if(!Se[n]){Se[n]={args:r,declutterMode:g};continue}let a=Se[n];e=a.args,t=a.declutterMode,delete Se[n],i=Yv(e)}let a,o;if(e&&(t!==`declutter`||!s.collides(i))&&(a=!0),(g!==`declutter`||!s.collides(n.declutterBox))&&(o=!0),t===`declutter`&&g===`declutter`){let e=a&&o;a=e,o=e}a&&(t!==`none`&&s.insert(i),this.replayImageOrLabel_.apply(this,e)),o&&(g!==`none`&&s.insert(n.declutterBox),this.replayImageOrLabel_.apply(this,r))}else this.replayImageOrLabel_.apply(this,r)}++u;break;case Q.DRAW_CHARS:let Oe=n[1],ke=n[2],Ae=n[3],je=n[4];T=n[5];let Me=n[6],Ne=n[7],Pe=n[8];w=n[9];let Fe=n[10];S=n[11],Array.isArray(S)&&(S=S.reduce($v,``)),C=n[12];let Ie=[n[13],n[13]];g=n[14]||`declutter`;let Le=n[15],M=this.textStates[C],Re=M.font,ze=[M.scale[0]*Ne,M.scale[1]*Ne],Be;Re in this.widths_?Be=this.widths_[Re]:(Be={},this.widths_[Re]=Be);let Ve=cd(l,Oe,ke,2),He=Math.abs(ze[0])*Hl(Re,S,Be);if(je||He<=Ve){let n=this.textStates[C].textAlign,r=(Ve-He)*Zv(S,n),i=Hv(l,Oe,ke,2,S,r,Me,Math.abs(ze[0]),Hl,Re,Be,A?0:this.viewRotation_,Le);drawChars:if(i){let n=[],r,a,o,c,l;if(w)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,C,``,w),m=l[2]+(ze[0]<0?-Fe:Fe),h=Ae*c.height+(.5-Ae)*2*Fe*ze[1]/ze[0]-Pe;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,m,h,0,0,l[3],Ie,!1,jl,!1,te);if(s&&g===`declutter`&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}if(T)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,C,T,``),m=l[2],h=Ae*c.height-Pe;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,m,h,0,0,l[3],Ie,!1,jl,!1,te);if(s&&g===`declutter`&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}s&&g!==`none`&&s.load(n.map(Yv));for(let e=0,t=n.length;e<t;++e)this.replayImageOrLabel_.apply(this,n[e])}}++u;break;case Q.END_GEOMETRY:if(a!==void 0){te=n[1];let e=a(te,ie,g);if(e)return e}++u;break;case Q.FILL:j?E++:this.fill_(e),++u;break;case Q.MOVE_TO_LINE_TO:for(f=n[1],p=n[2],ne=l[f],re=l[f+1],e.moveTo(ne,re),_=ne+.5|0,v=re+.5|0,f+=2;f<p;f+=2)ne=l[f],re=l[f+1],y=ne+.5|0,b=re+.5|0,(f==p-2||y!==_||b!==v)&&(e.lineTo(ne,re),_=y,v=b);++u;break;case Q.SET_FILL_STYLE:this.alignAndScaleFill_=n[2],E&&(this.fill_(e),E=0,D&&=(e.stroke(),0)),e.fillStyle=n[1],++u;break;case Q.SET_STROKE_STYLE:D&&=(e.stroke(),0),this.setStrokeStyle_(e,n),++u;break;case Q.STROKE:j?D++:e.stroke(),++u;break;default:++u;break}}E&&this.fill_(e),D&&e.stroke()}execute(e,t,n,r,i,a){this.viewRotation_=r,this.execute_(e,t,n,this.instructions,i,void 0,void 0,a)}executeHitDetection(e,t,n,r,i){return this.viewRotation_=n,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,i)}},ty=[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`],ny=[`Image`,`Text`],ry=ty.filter(e=>!ny.includes(e)),iy=class{constructor(e,t,n,r,i,a,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ti(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(i,o)}clip(e,t){let n=this.getClipCoords(t);e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(n[2],n[3]),e.lineTo(n[4],n[5]),e.lineTo(n[6],n[7]),e.clip()}createExecutors_(e,t){for(let n in e){let r=this.executorsByZIndex_[n];r===void 0&&(r={},this.executorsByZIndex_[n]=r);let i=e[n];for(let e in i){let n=i[e];r[e]=new ey(this.resolution_,this.pixelRatio_,this.overlaps_,n,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let n=this.executorsByZIndex_[t];for(let t=0,r=e.length;t<r;++t)if(e[t]in n)return!0}return!1}forEachFeatureAtCoordinate(e,t,n,r,i,a){r=Math.round(r);let o=r*2+1,s=Ni(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-n,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=_o(o,o));let l=this.hitDetectionContext_;l.canvas.width!==o||l.canvas.height!==o?(l.canvas.width=o,l.canvas.height=o):c||l.clearRect(0,0,o,o);let u;this.renderBuffer_!==void 0&&(u=nn(),un(u,e),Yt(u,t*(this.renderBuffer_+r),u));let d=oy(r),f;function p(e,t,n){let s=l.getImageData(0,0,o,o).data;for(let c=0,u=d.length;c<u;c++)if(s[d[c]]>0){if(!a||n===`none`||f!==`Image`&&f!==`Text`||a.includes(e)){let n=(d[c]-3)/4,a=r-n%o,s=r-(n/o|0),l=i(e,t,a*a+s*s);if(l)return l}l.clearRect(0,0,o,o);break}}let m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Be);let h,g,_,v,y;for(h=m.length-1;h>=0;--h){let e=m[h].toString();for(_=this.executorsByZIndex_[e],g=ty.length-1;g>=0;--g)if(f=ty[g],v=_[f],v!==void 0&&(y=v.executeHitDetection(l,s,n,p,u),y))return y}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let n=t[0],r=t[1],i=t[2],a=t[3],o=[n,r,n,a,i,a,i,r];return Bi(o,0,8,2,e,o),o}isEmpty(){return $e(this.executorsByZIndex_)}execute(e,t,n,r,i,a,o){let s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(o?Ve:Be),a||=ty;let c=ty.length;for(let l=0,u=s.length;l<u;++l){let u=s[l].toString(),d=this.executorsByZIndex_[u];for(let u=0,f=a.length;u<f;++u){let f=a[u],p=d[f];if(p!==void 0){let a=o===null?void 0:p.getZIndexContext(),u=a?a.getContext():e,d=this.maxExtent_&&f!==`Image`&&f!==`Text`;if(d&&(u.save(),this.clip(u,n)),!a||f===`Text`||f===`Image`?p.execute(u,t,n,r,i,o):a.pushFunction(e=>p.execute(e,t,n,r,i,o)),d&&u.restore(),a){a.offset();let e=s[l]*c+ty.indexOf(f);this.deferredZIndexContexts_[e]||(this.deferredZIndexContexts_[e]=[]),this.deferredZIndexContexts_[e].push(a)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Be);for(let n=0,r=t.length;n<r;++n)e[t[n]].forEach(e=>{e.draw(this.renderedContext_),e.clear()}),e[t[n]].length=0}},ay={};function oy(e){if(ay[e]!==void 0)return ay[e];let t=e*2+1,n=e*e,r=Array(n+1);for(let i=0;i<=e;++i)for(let a=0;a<=e;++a){let o=i*i+a*a;if(o>n)break;let s=r[o];s||(s=[],r[o]=s),s.push(((e+i)*t+(e+a))*4+3),i>0&&s.push(((e-i)*t+(e+a))*4+3),a>0&&(s.push(((e+i)*t+(e-a))*4+3),i>0&&s.push(((e-i)*t+(e-a))*4+3))}let i=[];for(let e=0,t=r.length;e<t;++e)r[e]&&i.push(...r[e]);return ay[e]=i,i}var sy=.5;function cy(e,t,n,r,i,a,o,s,c){let l=c?bi(i,c):i,u=_o(e[0]*sy,e[1]*sy);u.imageSmoothingEnabled=!1;let d=u.canvas,f=new tv(u,sy,i,null,o,s,c?di(_i(),c):null),p=n.length,m=Math.floor((256*256*256-1)/p),h={};for(let e=1;e<=p;++e){let t=n[e-1],i=t.getStyleFunction()||r;if(!i)continue;let o=i(t,a);if(!o)continue;Array.isArray(o)||(o=[o]);let s=(e*m).toString(16).padStart(7,`#00000`);for(let e=0,n=o.length;e<n;++e){let n=o[e],r=n.getGeometryFunction()(t);if(!r||!Tn(l,r.getExtent()))continue;let i=n.clone(),a=i.getFill();a&&a.setColor(s);let c=i.getStroke();c&&(c.setColor(s),c.setLineDash(null)),i.setText(void 0);let u=n.getImage();if(u){let e=u.getImageSize();if(!e)continue;let t=_o(e[0],e[1],void 0,{alpha:!1}),n=t.canvas;t.fillStyle=s,t.fillRect(0,0,n.width,n.height),i.setImage(new Zl({img:n,anchor:u.getAnchor(),anchorXUnits:`pixels`,anchorYUnits:`pixels`,offset:u.getOrigin(),opacity:1,size:u.getSize(),scale:u.getScale(),rotation:u.getRotation(),rotateWithView:u.getRotateWithView()}))}let d=i.getZIndex()||0,f=h[d];f||(f={},h[d]=f,f.Polygon=[],f.Circle=[],f.LineString=[],f.Point=[]);let p=r.getType();if(p===`GeometryCollection`){let e=r.getGeometriesArrayRecursive();for(let t=0,n=e.length;t<n;++t){let n=e[t];f[n.getType().replace(`Multi`,``)].push(n,i)}}else f[p.replace(`Multi`,``)].push(r,i)}}let g=Object.keys(h).map(Number).sort(Be);for(let e=0,n=g.length;e<n;++e){let n=h[g[e]];for(let e in n){let r=n[e];for(let e=0,n=r.length;e<n;e+=2){f.setStyle(r[e+1]);for(let n=0,i=t.length;n<i;++n)f.setTransform(t[n]),f.drawGeometry(r[e])}}}return u.getImageData(0,0,d.width,d.height)}function ly(e,t,n){let r=[];if(n){let i=Math.floor(Math.round(e[0])*sy),a=Math.floor(Math.round(e[1])*sy),o=(Mt(i,0,n.width-1)+Mt(a,0,n.height-1)*n.width)*4,s=n.data[o],c=n.data[o+1],l=n.data[o+2]+256*(c+256*s),u=Math.floor((256*256*256-1)/t.length);l&&l%u===0&&r.push(t[l/u-1])}return r}var uy=5,dy=class extends it{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=[],this.maxStaleKeys=uy}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return P()}getData(e){return null}prepareFrame(e){return P()}renderFrame(e,t){return P()}forEachFeatureAtCoordinate(e,t,n,r,i){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){let t=e.target;(t.getState()===G.LOADED||t.getState()===G.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=G.LOADED&&t!=G.ERROR&&e.addEventListener(M.CHANGE,this.boundHandleImageChange_),t==G.IDLE&&(e.load(),t=e.getState()),t==G.LOADED}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&e.getSourceState()===`ready`&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}},fy=[],py=null;function my(){py=_o(1,1,void 0,{willReadFrequently:!0})}var hy=class extends dy{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Ti(),this.pixelTransform=Ti(),this.inversePixelTransform=Ti(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,n){py||my(),py.clearRect(0,0,1,1);let r;try{py.drawImage(e,t,n,1,1,0,0,1,1),r=py.getImageData(0,0,1,1).data}catch{return py=null,null}return r}getBackground(e){let t=this.getLayer().getBackground();return typeof t==`function`&&(t=t(e.viewState.resolution)),t||void 0}useContainer(e,t,n){let r=this.getLayer().getClassName(),i,a;if(e&&e.className===r&&(!n||e&&e.style.backgroundColor&&Ge(dc(e.style.backgroundColor),dc(n)))){let t=e.firstElementChild;To(t)&&(a=t.getContext(`2d`))}if(a&&zi(a.canvas.style.transform,t)?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){i=vt?wo():document.createElement(`div`),i.className=r;let e=i.style;e.position=`absolute`,e.width=`100%`,e.height=`100%`,a=_o();let t=a.canvas;i.appendChild(t),e=t.style,e.position=`absolute`,e.left=`0`,e.transformOrigin=`top left`,this.container=i,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){let r=Cn(n),i=wn(n),a=gn(n),o=hn(n);Ai(t.coordinateToPixelTransform,r),Ai(t.coordinateToPixelTransform,i),Ai(t.coordinateToPixelTransform,a),Ai(t.coordinateToPixelTransform,o);let s=this.inversePixelTransform;Ai(s,r),Ai(s,i),Ai(s,a),Ai(s,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}prepareContainer(e,t){let n=e.extent,r=e.viewState.resolution,i=e.viewState.rotation,a=e.pixelRatio,o=Math.round(z(n)/r*a),s=Math.round(xn(n)/r*a);Ni(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/a,1/a,i,-o/2,-s/2),Pi(this.inversePixelTransform,this.pixelTransform);let c=Li(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){let e=this.context.canvas;e.width!=o||e.height!=s?(e.width=o,e.height=s):this.context.clearRect(0,0,o,s),c!==e.style.transform&&(e.style.transform=c)}}dispatchRenderEvent_(e,t,n){let r=this.getLayer();if(r.hasListener(e)){let i=new Gu(e,this.inversePixelTransform,n,t);r.dispatchEvent(i)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(Ss.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Ss.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Uv),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Ss.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Ss.POSTRENDER,this.context,e))}getRenderTransform(e,t,n,r,i,a,o){let s=i/2,c=a/2,l=r/t,u=-l,d=-e[0]+o,f=-e[1];return Ni(this.tempTransform,s,c,l,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}},gy=class extends hy{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_=nn(),this.wrappedRenderedExtent_=nn(),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,n){let r=t.extent,i=t.viewState,a=i.center,o=i.resolution,s=i.projection,c=i.rotation,l=s.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=t.pixelRatio,p=t.viewHints,m=!(p[At.ANIMATING]||p[At.INTERACTING]),h=this.context,g=Math.round(z(r)/o*f),_=Math.round(xn(r)/o*f),v=u.getWrapX()&&s.canWrapX(),y=v?z(l):null,b=v?Math.ceil((r[2]-l[2])/y)+1:1,x=v?Math.floor((r[0]-l[0])/y):0;do{let r=this.getRenderTransform(a,o,0,f,g,_,x*y);t.declutter&&(r=r.slice(0)),e.execute(h,[h.canvas.width,h.canvas.height],r,c,m,n===void 0?ty:n?ny:ry,n?d&&t.declutter[d]:void 0)}while(++x<b)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=_o(this.context.canvas.width,this.context.canvas.height,fy))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){let e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,bo(this.context),fy.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){let n=e.layerStatesArray[e.layerIndex];this.opacity_=n.opacity;let r=e.viewState;this.prepareContainer(e,t);let i=this.context,a=this.replayGroup_,o=a&&!a.isEmpty();if(!o&&!(this.getLayer().hasListener(Ss.PRERENDER)||this.getLayer().hasListener(Ss.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(i,e);let s=r.projection;if(this.clipped_=!1,o&&n.extent&&this.clipping){let t=xi(n.extent,s);o=Tn(t,e.extent),this.clipped_=o&&!$t(t,e.extent),this.clipped_&&this.clipUnrotated(i,e,t)}return o&&this.renderWorlds(a,e,this.getLayer().getDeclutter()?!1:void 0),!e.declutter&&this.clipped_&&i.restore(),this.postRender(i,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_){let e=this.frameState.size.slice(),t=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,i=this.renderedProjection_,a=this.wrappedRenderedExtent_,o=this.getLayer(),s=[],c=e[0]*sy,l=e[1]*sy;s.push(this.getRenderTransform(t,n,r,sy,c,l,0).slice());let u=o.getSource(),d=i.getExtent();if(u.getWrapX()&&i.canWrapX()&&!$t(d,a)){let e=a[0],i=z(d),o=0,u;for(;e<d[0];)--o,u=i*o,s.push(this.getRenderTransform(t,n,r,sy,c,l,u).slice()),e+=i;for(o=0,e=a[2];e>d[2];)++o,u=i*o,s.push(this.getRenderTransform(t,n,r,sy,c,l,u).slice()),e-=i}let f=_i();this.hitDetectionImageData_=cy(e,s,this.renderedFeatures_,o.getStyleFunction(),a,n,r,av(n,this.renderedPixelRatio_),f?i:null)}t(ly(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,n,r,i){if(!this.replayGroup_)return;let a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),c={},l=function(e,t,n){let a=F(e),o=c[a];if(!o){if(n===0)return c[a]=!0,r(e,s,t);i.push(c[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return c[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,n,l,u?t.declutter?.[u]?.all().map(e=>e.value):null)}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),n=t.getSource();if(!n)return!1;let r=e.viewHints[At.ANIMATING],i=e.viewHints[At.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let s=e.extent,c=e.viewState,l=c.projection,u=c.resolution,d=e.pixelRatio,f=t.getRevision(),p=t.getRenderBuffer(),m=t.getRenderOrder();m===void 0&&(m=iv);let h=c.center.slice(),g=Yt(s,p*u),_=g.slice(),v=[g.slice()],y=l.getExtent();if(n.getWrapX()&&l.canWrapX()&&!$t(y,e.extent)){let e=z(y),t=Math.max(z(g)/2,e);g[0]=y[0]-t,g[2]=y[2]+t,Bn(h,l);let n=An(v[0],l);n[0]<y[0]&&n[2]<y[2]?v.push([n[0]+e,n[1],n[2]+e,n[3]]):n[0]>y[0]&&n[2]>y[2]&&v.push([n[0]-e,n[1],n[2]-e,n[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!e.declutter&&$t(this.wrappedRenderedExtent_,g))return Ge(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=h,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let b=new Vv(ov(u,d),g,u,d),x=_i(),S;if(x){for(let e=0,t=v.length;e<t;++e){let t=v[e],r=bi(t,l);n.loadFeatures(r,Si(u,l),x)}S=di(x,l)}else for(let e=0,t=v.length;e<t;++e)n.loadFeatures(v[e],u,l);let C=av(u,d),w=!0,T=(e,n)=>{let r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,u)),r){let t=this.renderFeature(e,C,r,b,S,this.getLayer().getDeclutter(),n);w&&=!t}},E=bi(g,l),D=n.getFeaturesInExtent(E);m&&D.sort(m);for(let e=0,t=D.length;e<t;++e)T(D[e],e);this.renderedFeatures_=D,this.ready=w;let O=b.finish(),k=new iy(g,u,d,n.getOverlaps(),O,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=m,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=g,this.renderedCenter_=h,this.renderedProjection_=l,this.renderedPixelRatio_=d,this.replayGroup_=k,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,n,r,i,a,o){if(!n)return!1;let s=!1;if(Array.isArray(n))for(let c=0,l=n.length;c<l;++c)s=cv(r,e,n[c],t,this.boundHandleStyleImageChange_,i,a,o)||s;else s=cv(r,e,n,t,this.boundHandleStyleImageChange_,i,a,o);return s}},_y=class extends Uu{constructor(e){super(e)}createRenderer(){return new gy(this)}},vy=class extends dl{constructor(e,t,n,r,i){let a=i===void 0?G.LOADED:G.IDLE;super(e,t,n,a),this.loader_=i===void 0?null:i,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=G.ERROR):this.state=G.LOADED,this.changed()}load(){this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}},yy=class extends tt{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(M.CHANGE)}release(){this.setState(L.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==L.EMPTY){if(this.state!==L.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){P()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Hn(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()}},by=class extends yy{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r,this.src_=n,this.key=n,this.image_,vt?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,r!==null&&(this.image_.crossOrigin=r)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=L.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=L.ERROR,this.unlistenImage_(),this.image_=xy(),this.changed()}handleImageLoad_(){if(vt)this.state=L.LOADED;else{let e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=L.LOADED:this.state=L.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==L.ERROR&&(this.state=L.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==L.IDLE&&(this.state=L.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=fl(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function xy(){let e=_o(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var Sy=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,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 Cy(e,t,n,r,i){return i===void 0?new Sy(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}var wy=[],Ty=class extends yy{constructor(e,t,n,r,i){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_=i,this.wrappedTileCoord=n}getContext(){return this.context_||=_o(1,1,wy),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){let t=F(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_&&=(bo(this.context_),wy.push(this.context_.canvas),null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}},Ey=class extends yy{constructor(e,t,n,r,i,a){super(e,t,a),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=i,this.url_=n,this.key=n}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==L.IDLE&&(this.setState(L.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(L.ERROR)}setFeatures(e){this.features_=e,this.setState(L.LOADED)}setLoader(e){this.loader_=e}},Dy=`https://api.mapbox.com`;function Oy(e){return e.indexOf(`mapbox://`)===0?e.slice(9):``}function ky(e,t,n){if(typeof e==`string`)return[{id:`default`,url:Ay(e,t,n)}];for(let r of e)r.url=Ay(r.url,t,n);return e}function Ay(e,t,n){let r=Oy(e);if(!r)return decodeURI(new URL(e,n).href);if(r.indexOf(`sprites/`)!==0)throw Error(`unexpected sprites url: ${e}`);return`${Dy}/styles/v1/${r.slice(8)}/sprite?access_token=${t}`}function jy(e,t){let n=Oy(e);if(!n)return decodeURI(new URL(e,location.href).href);if(n.indexOf(`styles/`)!==0)throw Error(`unexpected style url: ${e}`);return`${Dy}/styles/v1/${n.slice(7)}?&access_token=${t}`}var My=[`a`,`b`,`c`,`d`];function Ny(e,t,n,r){let i=new URL(e,r||location.href),a=Oy(e);return a?a===`mapbox.satellite`?[`https://api.mapbox.com/v4/${a}/{z}/{x}/{y}${window.devicePixelRatio>=1.5?`@2x`:``}.webp?access_token=${t}`]:My.map(e=>`https://${e}.tiles.mapbox.com/v4/${a}/{z}/{x}/{y}.vector.pbf?access_token=${t}`):(t&&(i.searchParams.has(n)||i.searchParams.set(n,t)),[decodeURI(i.href)])}var Py=Object.freeze({}),Fy={},Iy={},Ly=0;function Ry(e){return e.id||=Ly++,e.id}function zy(e,t){return Ry(e)+`.`+F(t)}function By(e){let t=Fy[e.id];return t||(t={},Fy[Ry(e)]=t),t}function Vy(e){let t=Iy[e.id];return t||(t={},Iy[Ry(e)]=t),t}function Hy(e){return e*Math.PI/180}var Uy=(function(){let e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e})();function Wy(e,t){if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<`u`)return new OffscreenCanvas(e,t);let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}function Gy(e,t){let n=0,r=t.length;for(;n<r;++n)if(t[n]<e&&n+1<r){let r=t[n]/t[n+1];return n+Math.log(t[n]/e)/Math.log(r)}return r-1}function Ky(e,t){let n=Math.floor(e),r=2**(e-n);return t[n]/r}var qy={};function Jy(e,t,n={},r){if(t in qy)return r&&(r.url=qy[t][0].url),qy[t][1];let i=n.transformRequest&&n.transformRequest(t,e)||t,a=function(e){return delete qy[t],Promise.reject(Error(`Error fetching source `+t))},o=function(e){return delete qy[t],e.ok?e.json():Promise.reject(Error(`Error fetching source `+t))},s=Ze(()=>i).then(e=>e instanceof Response?(r&&(r.url=e.url),o(e)):(e instanceof Request||(e=new Request(e)),e.headers.get(`Accept`)||e.headers.set(`Accept`,`application/json`),r&&(r.url=e.url),fetch(e).then(o).catch(a))).catch(a);return qy[t]=[i,s],s}function Yy(e,t){if(typeof e==`string`)if(e.trim().startsWith(`{`))try{let t=JSON.parse(e);return Promise.resolve(t)}catch(e){return Promise.reject(e)}else return e=jy(e,t.accessToken),Jy(`Style`,e,t);else return Promise.resolve(e)}var Xy={};function Zy(e,t,n={}){let r=[t,JSON.stringify(e)].toString(),i=Xy[r];if(!i||n.transformRequest){let a;n.transformRequest&&(a=(e,t)=>{let r=n.transformRequest&&n.transformRequest(t,`Tiles`)||t;if(e instanceof Ey)e.setLoader((t,n,i)=>{let a=function(n){n.arrayBuffer().then(n=>{let r=e.getFormat().readFeatures(n,{extent:t,featureProjection:i});e.setFeatures(r)})};Ze(()=>r).then(t=>{if(t instanceof Response)return a(t);fetch(t).then(a).catch(t=>e.setState(L.ERROR))}).catch(t=>e.setState(L.ERROR))});else{let t=e.getImage();Ze(()=>r).then(n=>{if(typeof n==`string`){t.src=n;return}let r=e=>e.blob().then(e=>{let n=URL.createObjectURL(e);t.addEventListener(`load`,()=>URL.revokeObjectURL(n)),t.addEventListener(`error`,()=>URL.revokeObjectURL(n)),t.src=n});if(n instanceof Response)return r(n);fetch(n).then(r).catch(t=>e.setState(L.ERROR))}).catch(t=>e.setState(L.ERROR))}});let o=e.url;if(o&&!e.tiles){let r=Ny(o,n.accessToken,n.accessTokenParam||`access_token`,t||location.href);if(o.startsWith(`mapbox://`))i=Promise.resolve({tileJson:Object.assign({},e,{url:void 0,tiles:r}),tileLoadFunction:a});else{let e={};i=Jy(`Source`,r[0],n,e).then(function(t){return t.tiles=t.tiles.map(function(r){return t.scheme===`tms`&&(r=r.replace(`{y}`,`{-y}`)),Ny(r,n.accessToken,n.accessTokenParam||`access_token`,e.url)[0]}),Promise.resolve({tileJson:t,tileLoadFunction:a})})}}else e.tiles?(e=Object.assign({},e,{tiles:e.tiles.map(function(r){return e.scheme===`tms`&&(r=r.replace(`{y}`,`{-y}`)),Ny(r,n.accessToken,n.accessTokenParam||`access_token`,t||location.href)[0]})}),i=Promise.resolve({tileJson:Object.assign({},e),tileLoadFunction:a})):i=Promise.reject(Error("source has no `tiles` nor `url`"));Xy[r]=i}return i}function Qy(e,t,n,r){let i=[2*n*t.pixelRatio+t.width,2*n*t.pixelRatio+t.height],a=Wy(i[0],i[1]),o=a.getContext(`2d`);o.drawImage(e,t.x,t.y,t.width,t.height,n*t.pixelRatio,n*t.pixelRatio,t.width,t.height);let s=o.getImageData(0,0,i[0],i[1]);o.globalCompositeOperation=`destination-over`,o.fillStyle=`rgba(${r.r*255},${r.g*255},${r.b*255},${r.a})`;let c=s.data;for(let e=0,r=s.width;e<r;++e)for(let i=0,a=s.height;i<a;++i)c[(i*r+e)*4+3]>0&&o.arc(e,i,n*t.pixelRatio,0,2*Math.PI);return o.fill(),a}function $y(e,t,n){let r=Math.max(0,Math.min(1,(n-e)/(t-e)));return r*r*(3-2*r)}function eb(e,t,n){let r=Wy(t.width,t.height),i=r.getContext(`2d`);i.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);let a=i.getImageData(0,0,t.width,t.height),o=a.data;for(let e=0,t=a.width;e<t;++e)for(let r=0,i=a.height;r<i;++r){let i=(r*t+e)*4,a=o[i+3]/255,s=.75,c=.1,l=$y(s-c,s+c,a);l>0?(o[i+0]=Math.round(255*n.r*l),o[i+1]=Math.round(255*n.g*l),o[i+2]=Math.round(255*n.b*l),o[i+3]=Math.round(255*l)):o[i+3]=0}return i.putImageData(a,0,0),r}var tb=Array(256).join(` `);function nb(e,t){if(t>=.05){let n=``,r=e.split(`
|
|
8
|
-
`),i=tb.slice(0,Math.round(t/.1));for(let e=0,t=r.length;e<t;++e)e>0&&(n+=`
|
|
9
|
-
`),n+=r[e].split(``).join(i);return n}return e}var rb;function ib(){return rb||=Wy(1,1).getContext(`2d`),rb}function ab(e,t){return ib().measureText(e).width+(e.length-1)*t}var ob={};Ml.on(`propertychange`,()=>{for(let e in ob)delete ob[e]});function sb(e,t,n,r){if(e.indexOf(`
|
|
10
|
-
`)!==-1){let i=e.split(`
|
|
11
|
-
`),a=[];for(let e=0,o=i.length;e<o;++e)a.push(sb(i[e],t,n,r));return a.join(`
|
|
12
|
-
`)}let i=n+`,`+t+`,`+e+`,`+r,a=ob[i];if(!a){let o=e.split(` `);if(o.length>1){let e=ib();e.font=t;let i=e.measureText(`M`).width*n,s=``,c=[];for(let e=0,t=o.length;e<t;++e){let t=o[e],n=s+(s?` `:``)+t;ab(n,r)<=i?s=n:(s&&c.push(s),s=t)}s&&c.push(s);for(let e=0,t=c.length;e<t&&t>1;++e){let n=c[e];if(ab(n,r)<i*.35){let i=e>0?ab(c[e-1],r):1/0,a=e<t-1?ab(c[e+1],r):1/0;c.splice(e,1),--t,i<a?(c[e-1]+=` `+n,--e):c[e]=n+` `+c[e]}}for(let e=0,t=c.length-1;e<t;++e){let n=c[e],a=c[e+1];if(ab(n,r)>i*.7&&ab(a,r)<i*.6){let o=n.split(` `),s=o.pop();ab(s,r)<i*.2&&(c[e]=o.join(` `),c[e+1]=s+` `+a),--t}}a=c.join(`
|
|
13
|
-
`)}else a=e;a=nb(a,r),ob[i]=a}return a}var cb=[`Arial`,`Courier New`,`Times New Roman`,`Verdana`,`sans-serif`,`serif`,`monospace`,`cursive`,`fantasy`],lb={};function ub(e,t=`https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css`){if(vt)return e;let n;for(let t=0,r=e.length;t<r;++t){let r=e[t];if(r in lb)continue;lb[r]=!0;let i=$_(r,16).split(` `);n||=[],n.push([i.slice(3).join(` `).replace(/"/g,``),i[1],i[0]])}return n&&(async()=>{await document.fonts.ready;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r[0];if(cb.includes(i))continue;let a=r[1],o=r[2];if(!(await document.fonts.load(`${o} ${a} 16px "${i}"`)).some(e=>e.family.replace(/^['"]|['"]$/g,``).toLowerCase()===i.toLowerCase()&&e.weight==a&&e.style===o)){let e=t.replace(`{font-family}`,i.replace(/ /g,`-`).toLowerCase()).replace(`{Font+Family}`,i.replace(/ /g,`+`)).replace(`{fontweight}`,a).replace(`{-fontstyle}`,o.replace(`normal`,``).replace(/(.+)/,`-$1`)).replace(`{fontstyle}`,o);if(!document.querySelector(`link[href="`+e+`"]`)){let t=document.createElement(`link`);t.href=e,t.rel=`stylesheet`,document.head.appendChild(t)}}}})(),e}var db={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},fb={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]},pb=function(e,t){let n=Og(e,t);if(n.result===`error`)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return n.value},mb={zoom:0,distanceFromCenter:0};og.register(ag,{...og.definitions,pitch:[{kind:`number`},[],e=>mb.pitch||90],"distance-from-center":[{kind:`number`},[],e=>mb.distanceFromCenter||0]});var hb,gb;function $(e,t,n,r,i,a){let o=e.id;i||(i={},console.warn(`No functionCache provided to getValue()`)),i[o]||(i[o]={});let s=i[o];if(!s[n]){let r=(e[t]||Py)[n],i=J_[`${t}_${e.type}`][n];r===void 0&&(r=i.default);let a=wg(r);if(!a&&Sg(r)&&(r=Gg(r,i),a=!0),a){let e=pb(r,i);s[n]=e.evaluate.bind(e)}else{let e=i.type;(e===`color`||e===`colorArray`)&&(r=jp.parse(r)),s[n]=function(){return r}}}return s[n](mb,r,a)}function _b(e,t,n,r){return $(e,`layout`,`${n}-allow-overlap`,t,r)?$(e,`layout`,`${n}-ignore-placement`,t,r)?`none`:`obstacle`:`declutter`}function vb(e,t,n,r){if(r||console.warn(`No filterCache provided to evaluateFilter()`),!(e in r))try{r[e]=Fg(t).filter}catch(t){console.warn(`Filter will evaluate to false: `+t.message),r[e]=function(){return!1}}return r[e](mb,n)}var yb=!1;function bb(e,t){if(e){if(!yb&&(e.a===0||t===0))return;let n=e.a;return t=t===void 0?1:t,n===0?`transparent`:`rgba(`+Math.round(e.r*255/n)+`,`+Math.round(e.g*255/n)+`,`+Math.round(e.b*255/n)+`,`+n*t+`)`}return e}var xb=/\{[^{}}]*\}/g;function Sb(e,t){return e.replace(xb,function(e){return t[e.slice(1,-1)]||``})}function Cb(e,t){let n=e.split(`:`)[0];return n===e&&(n=`default`),t[n]}var wb=!1,Tb={};function Eb(e,t,n,r=Uy,i=void 0,a=void 0,o=void 0,s=void 0){if(typeof t==`string`&&(t=JSON.parse(t)),t.version!=8)throw Error(`glStyle version 8 required.`);Tb[zy(t,e)]=Array.from(arguments);let c={};(typeof a==`string`||a instanceof Request||a instanceof Response||a instanceof Promise)&&(a={default:a});for(let t in a){let n=a[t];Ze(()=>n).then(async n=>{let r;if(typeof Image<`u`){let i=new Image;if(typeof n==`string`)i.crossOrigin=`anonymous`,i.src=n;else{let e;n instanceof Request?e=await fetch(n):n instanceof Response&&(e=n);let t=await e.blob();r=URL.createObjectURL(t),i.src=r}i.addEventListener(`load`,function n(){i.removeEventListener(`load`,n),c[t]={image:i,size:[i.width,i.height]},e.changed(),r&&URL.revokeObjectURL(r)}),i.addEventListener(`error`,function e(){URL.revokeObjectURL(r),i.removeEventListener(`error`,e)})}else if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=self;e.postMessage({action:`loadImage`,src:n}),e.addEventListener(`message`,function(e){e.data.action===`imageLoaded`&&e.data.src===n&&(c[t]={image:e.data.image,size:[e.data.image.width,e.data.image.height]})})}})}let l=Nf(t.layers),u={},d=[],f={},p={},m=By(t),h=Vy(t),g;for(let e=0,r=l.length;e<r;++e){let r=l[e],i=r.id;if(typeof n==`string`&&r.source==n||Array.isArray(n)&&n.indexOf(i)!==-1){let n=r[`source-layer`];if(!g){g=r.source;let e=t.sources[g];if(!e)throw Error(`Source "${g}" is not defined`);let n=e.type;if(n!==`vector`&&n!==`geojson`)throw Error(`Source "${g}" is not of type "vector" or "geojson", but "${n}"`)}else if(r.source!==g)throw Error(`Layer "${i}" does not use source "${g}`);let a=u[n];a||(a=[],u[n]=a),a.push({layer:r,index:e}),d.push(i)}}let _=new Ql,v=new Yl,y=[],b=function(n,a,l){let d=e.getSource?.()?.format_?.layerName_??`mvt:layer`,g=n.getProperties(),b=u[g[d]];if(!b)return;let x=r.indexOf(a);x==-1&&(x=Gy(a,r)),mb.zoom=x,mb.distanceFromCenter=0;let S=n.getGeometry(),C=db[S.getType()],w=e.get(`map`);if(w&&w instanceof Zu&&C===1){let e=w.getSize();e&&(mb.distanceFromCenter=Rn(w.getView().getCenter(),_n(S.getExtent()))/a/e[1])}let T={id:n.getId(),properties:g,type:C},E=e.get(`mapbox-featurestate`)[n.getId()],D=-1,O;for(let r=0,u=b.length;r<u;++r){let u=b[r],d=u.layer,S=d.id;if(l!==void 0&&l!==S)continue;let w=d.layout||Py,k=d.paint||Py;if(w.visibility===`none`||`minzoom`in d&&x<d.minzoom||`maxzoom`in d&&x>=d.maxzoom)continue;let A=d.filter;if(!A||vb(S,A,T,h)){O=d;let r,l,h,b,x,S,A=u.index;if(C==3&&(d.type==`fill`||d.type==`fill-extrusion`))if(l=$(d,`paint`,d.type+`-opacity`,T,m,E),d.type+`-pattern`in k){let e=$(d,`paint`,d.type+`-pattern`,T,m,E);if(e){let t=typeof e==`string`?Sb(e,g):e.toString(),n=Cb(t,c);if(i&&i[t]&&n){++D,S=y[D],(!S||!S.getFill()||S.getStroke()||S.getText())&&(S=new $l({fill:new Yl}),y[D]=S),h=S.getFill(),S.setZIndex(A);let e=t+`.`+l,r=p[e];if(!r){let a=i[t],o=Wy(a.width,a.height),s=o.getContext(`2d`);s.globalAlpha=l,s.drawImage(n.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=s.createPattern(o,`repeat`),p[e]=r}h.setColor(r)}}}else r=bb($(d,`paint`,d.type+`-color`,T,m,E),l),d.type+`-outline-color`in k&&(x=bb($(d,`paint`,d.type+`-outline-color`,T,m,E),l)),x||=r,(r||x)&&(++D,S=y[D],(!S||r&&!S.getFill()||!r&&S.getFill()||x&&!S.getStroke()||!x&&S.getStroke()||S.getText())&&(S=new $l({fill:r?new Yl:void 0,stroke:x?new Ql:void 0}),y[D]=S),r&&(h=S.getFill(),h.setColor(r)),x&&(b=S.getStroke(),b.setColor(x),b.setWidth(.5)),S.setZIndex(A));if(C!=1&&d.type==`line`){r=`line-pattern`in k?void 0:bb($(d,`paint`,`line-color`,T,m,E),$(d,`paint`,`line-opacity`,T,m,E));let e=$(d,`paint`,`line-width`,T,m,E);r&&e>0&&(++D,S=y[D],(!S||!S.getStroke()||S.getFill()||S.getText())&&(S=new $l({stroke:new Ql}),y[D]=S),b=S.getStroke(),b.setLineCap($(d,`layout`,`line-cap`,T,m,E)),b.setLineJoin($(d,`layout`,`line-join`,T,m,E)),b.setMiterLimit($(d,`layout`,`line-miter-limit`,T,m,E)),b.setColor(r),b.setWidth(e),b.setLineDash(k[`line-dasharray`]?$(d,`paint`,`line-dasharray`,T,m,E).map(function(t){return t*e}):null),S.setZIndex(A))}let ee=!1,j=null,te=0,ne,re,ie;if((C==1||C==2)&&`icon-image`in w){let t=$(d,`layout`,`icon-image`,T,m,E);if(t){ne=typeof t==`string`?Sb(t,g):t.toString();let r,o=s?s(e,ne):void 0,l=Cb(ne,c);if(i&&i[ne]&&l||o){let e=$(d,`layout`,`icon-rotation-alignment`,T,m,E);if(C==2){let t=n.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){let n=t.getExtent();if(Math.sqrt(Math.max(((n[2]-n[0])/a)**2,((n[3]-n[1])/a)**2))>150){let n=t.getType()===`MultiLineString`?t.getFlatMidpoints():t.getFlatMidpoint();if(gb||=(hb=[NaN,NaN],new md(`Point`,hb,[],2,{},void 0)),r=gb,hb[0]=n[0],hb[1]=n[1],$(d,`layout`,`symbol-placement`,T,m,E)===`line`&&e===`map`){let e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,i=r.length-e;t<i;t+=e){let i=r[t],a=r[t+1],o=r[t+e],s=r[t+e+1],c=Math.min(i,o),l=Math.max(i,o),u=n[0],d=n[1],f=(s-a)*(u-i)-(o-i)*(d-a);if(Math.abs(f)<.001&&u<=l&&u>=c){te=Math.atan2(a-s,o-i);break}}}}}}if(C!==2||r){let t=$(d,`layout`,`icon-size`,T,m,E),n=k[`icon-color`]===void 0?null:$(d,`paint`,`icon-color`,T,m,E);if(!n||n.a!==0){let r=$(d,`paint`,`icon-halo-color`,T,m,E),a=$(d,`paint`,`icon-halo-width`,T,m,E),s=`${ne}.${t}.${a}.${r}`;if(n!==null&&(s+=`.${n}`),re=f[s],!re){let c=_b(d,T,`icon`,m),u;`icon-offset`in w&&(u=$(d,`layout`,`icon-offset`,T,m,E).slice(0),u[0]*=t,u[1]*=-t);let p=n?[n.r*255,n.g*255,n.b*255,n.a]:void 0;if(o){let n={color:p,rotateWithView:e===`map`,displacement:u,declutterMode:c,scale:t};typeof o==`string`?n.src=o:(n.img=o,n.imgSize=[o.width,o.height]),re=new Zl(n)}else{let o=i[ne],s,d,f;a?o.sdf?(s=Qy(eb(l.image,o,n||[0,0,0,1]),{x:0,y:0,width:o.width,height:o.height,pixelRatio:o.pixelRatio},a,r),p=void 0):s=Qy(l.image,o,a,r):(o.sdf&&(l.unSDFed||=(l.image=eb(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1,a:1}),!0)),s=l.image,d=[o.width,o.height],f=[o.x,o.y]),re=new Zl({color:p,img:s,imgSize:l.size,size:d,offset:f,rotateWithView:e===`map`,scale:t/o.pixelRatio,displacement:u,declutterMode:c})}f[s]=re}}re&&(++D,S=y[D],(!S||!S.getImage()||S.getFill()||S.getStroke())&&(S=new $l,y[D]=S),S.setGeometry(r),re.setRotation(te+Hy($(d,`layout`,`icon-rotate`,T,m,E))),re.setOpacity($(d,`paint`,`icon-opacity`,T,m,E)),re.setAnchor(fb[$(d,`layout`,`icon-anchor`,T,m,E)]),S.setImage(re),j=S.getText(),S.setText(void 0),S.setZIndex(A),ee=!0,ie=!1)}else ie=!0}}}if(C==1&&d.type===`circle`){++D,S=y[D],(!S||!S.getImage()||S.getFill()||S.getStroke())&&(S=new $l,y[D]=S);let e=`circle-radius`in k?$(d,`paint`,`circle-radius`,T,m,E):5,t=bb($(d,`paint`,`circle-stroke-color`,T,m,E),$(d,`paint`,`circle-stroke-opacity`,T,m,E)),n=$(d,`paint`,`circle-translate`,T,m,E),r=bb($(d,`paint`,`circle-color`,T,m,E),$(d,`paint`,`circle-opacity`,T,m,E)),i=$(d,`paint`,`circle-stroke-width`,T,m,E),a=e+`.`+t+`.`+r+`.`+i+`.`+n[0]+`.`+n[1];re=f[a],re||(re=new Jl({radius:e,displacement:[n[0],-n[1]],stroke:t&&i>0?new Ql({width:i,color:t}):void 0,fill:r?new Yl({color:r}):void 0,declutterMode:`none`}),f[a]=re),S.setImage(re),j=S.getText(),S.setText(void 0),S.setGeometry(void 0),S.setZIndex(A),ee=!0}let ae,oe,se,ce,le,ue;if(`text-field`in w){ce=Math.round($(d,`layout`,`text-size`,T,m,E));let e=$(d,`layout`,`text-font`,T,m,E);se=$(d,`layout`,`text-line-height`,T,m,E),oe=$_(o?o(e,t.metadata?t.metadata[`ol:webfonts`]:void 0):e,ce,se),oe.includes(`sans-serif`)||(oe+=`,sans-serif`),le=$(d,`layout`,`text-letter-spacing`,T,m,E),ue=$(d,`layout`,`text-max-width`,T,m,E);let n=$(d,`layout`,`text-field`,T,m,E);ae=typeof n==`object`&&n.sections?n.sections.length===1?n.toString():n.sections.reduce((t,n,r)=>{let i=n.fontStack?n.fontStack.split(`,`):e,a=$_(o?o(i):i,ce*(n.scale||1),se),s=n.text;if(s===`
|
|
14
|
-
`)return t.push(`
|
|
15
|
-
`,``),t;if(C==2)return t.push(nb(s,le),a),t;s=sb(s,a,ue,le).split(`
|
|
16
|
-
`);for(let e=0,n=s.length;e<n;++e)e>0&&t.push(`
|
|
17
|
-
`,``),t.push(s[e],a);return t},[]):Sb(n,g).trim(),l=$(d,`paint`,`text-opacity`,T,m,E)}if(ae&&l&&!ie){ee||(++D,S=y[D],(!S||!S.getText()||S.getFill()||S.getStroke())&&(S=new $l,y[D]=S),S.setImage(void 0),S.setGeometry(void 0));let e=_b(d,T,`text`,m);S.getText()||S.setText(j),j=S.getText(),(!j||`getDeclutterMode`in j&&j.getDeclutterMode()!==e)&&(j=new ou({padding:[2,2,2,2],declutterMode:e}),S.setText(j));let t=$(d,`layout`,`text-transform`,T,m,E);t==`uppercase`?ae=Array.isArray(ae)?ae.map((e,t)=>t%2?e:e.toUpperCase()):ae.toUpperCase():t==`lowercase`&&(ae=Array.isArray(ae)?ae.map((e,t)=>t%2?e:e.toLowerCase()):ae.toLowerCase());let n=Array.isArray(ae)?ae:C==2?nb(ae,le):sb(ae,oe,ue,le);if(j.setText(n),j.setFont(oe),j.setRotation(Hy($(d,`layout`,`text-rotate`,T,m,E))),typeof j.setKeepUpright==`function`){let e=$(d,`layout`,`text-keep-upright`,T,m,E);j.setKeepUpright(e)}let r=$(d,`layout`,`text-anchor`,T,m,E),i=ee||C==1?`point`:$(d,`layout`,`symbol-placement`,T,m,E),a;if(i===`line-center`?(j.setPlacement(`line`),a=`center`):j.setPlacement(i),i===`line`&&typeof j.setRepeat==`function`){let e=$(d,`layout`,`symbol-spacing`,T,m,E);j.setRepeat(e*2)}j.setOverflow(i===`point`);let o=$(d,`paint`,`text-halo-width`,T,m,E),s=$(d,`layout`,`text-offset`,T,m,E),c=$(d,`paint`,`text-translate`,T,m,E),u=0,f=0;if(i==`point`){a=`center`,r.indexOf(`left`)===-1?r.indexOf(`right`)!==-1&&(a=`right`,f=-o):(a=`left`,f=o);let e=$(d,`layout`,`text-rotation-alignment`,T,m,E);j.setRotateWithView(e==`map`)}else j.setMaxAngle(Hy($(d,`layout`,`text-max-angle`,T,m,E))*ae.length/n.length),j.setRotateWithView(!1);j.setTextAlign(a);let p=`middle`;r.indexOf(`bottom`)==0?(p=`bottom`,u=-o-.5*(se-1)*ce):r.indexOf(`top`)==0&&(p=`top`,u=o+.5*(se-1)*ce),j.setTextBaseline(p);let h=$(d,`layout`,`text-justify`,T,m,E);j.setJustify(h===`auto`?void 0:h),j.setOffsetX(s[0]*ce+f+c[0]),j.setOffsetY(s[1]*ce+u+c[1]),v.setColor(bb($(d,`paint`,`text-color`,T,m,E),l)),j.setFill(v);let g=bb($(d,`paint`,`text-halo-color`,T,m,E),l);if(g&&o>0){_.setColor(g),o*=2;let e=.5*ce;_.setWidth(o<=e?o:e),j.setStroke(_)}else j.setStroke(void 0);let b=$(d,`layout`,`text-padding`,T,m,E),x=j.getPadding();b!==x[0]&&(x[0]=b,x[1]=b,x[2]=b,x[3]=b),S.setZIndex(A)}}}if(D>-1)return y.length=D+1,wb&&(`set`in n?n.set(`mapbox-layer`,O):n.getProperties()[`mapbox-layer`]=O),y};return e.setStyle(b),e.set(`mapbox-layers`,d),e.set(`mapbox-source`,g),e.set(`mapbox-featurestate`,e.get(`mapbox-featurestate`)||{}),b}var Db=65536*65536,Ob=1/Db,kb=12,Ab=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`),jb=0,Mb=1,Nb=2,Pb=5,Fb=class{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,n=this.length){for(;this.pos<n;){let n=this.readVarint(),r=n>>3,i=this.pos;this.type=n&7,e(r,t,this),this.pos===i&&this.skip(n)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Db;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Db;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,n,r;return r=t[this.pos++],n=r&127,r<128||(r=t[this.pos++],n|=(r&127)<<7,r<128)||(r=t[this.pos++],n|=(r&127)<<14,r<128)||(r=t[this.pos++],n|=(r&127)<<21,r<128)?n:(r=t[this.pos],n|=(r&15)<<28,Ib(n,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=kb&&Ab?Ab.decode(this.buf.subarray(t,e)):Zb(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===Nb?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===jb)for(;this.buf[this.pos++]>127;);else if(t===Nb)this.pos=this.readVarint()+this.pos;else if(t===Pb)this.pos+=4;else if(t===Mb)this.pos+=8;else throw 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){let e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.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*Ob),!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*Ob),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Rb(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++;let t=this.pos;this.pos=Qb(this.buf,e,this.pos);let n=this.pos-t;n>=128&&Vb(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n}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){let t=e.length;this.writeVarint(t),this.realloc(t);for(let n=0;n<t;n++)this.buf[this.pos++]=e[n]}writeRawMessage(e,t){this.pos++;let n=this.pos;e(t,this);let r=this.pos-n;r>=128&&Vb(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,n){this.writeTag(e,Nb),this.writeRawMessage(t,n)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Hb,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Ub,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Kb,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Wb,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Gb,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,qb,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Jb,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Yb,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Xb,t)}writeBytesField(e,t){this.writeTag(e,Nb),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,Pb),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,Pb),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Mb),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Mb),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,jb),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,jb),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,Nb),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,Pb),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Mb),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function Ib(e,t,n){let r=n.buf,i,a;if(a=r[n.pos++],i=(a&112)>>4,a<128||(a=r[n.pos++],i|=(a&127)<<3,a<128)||(a=r[n.pos++],i|=(a&127)<<10,a<128)||(a=r[n.pos++],i|=(a&127)<<17,a<128)||(a=r[n.pos++],i|=(a&127)<<24,a<128)||(a=r[n.pos++],i|=(a&1)<<31,a<128))return Lb(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}function Lb(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Rb(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),zb(n,r,t),Bb(r,t)}function zb(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function Bb(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Vb(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(let t=n.pos-1;t>=e;t--)n.buf[t+r]=n.buf[t]}function Hb(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function Ub(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Wb(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Gb(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Kb(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function qb(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Jb(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Yb(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Xb(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Zb(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o>n)break;let s,c,l;o===1?t<128&&(a=t):o===2?(s=e[i+1],(s&192)==128&&(a=(t&31)<<6|s&63,a<=127&&(a=null))):o===3?(s=e[i+1],c=e[i+2],(s&192)==128&&(c&192)==128&&(a=(t&15)<<12|(s&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):o===4&&(s=e[i+1],c=e[i+2],l=e[i+3],(s&192)==128&&(c&192)==128&&(l&192)==128&&(a=(t&15)<<18|(s&63)<<12|(c&63)<<6|l&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,o=1):a>65535&&(a-=65536,r+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),r+=String.fromCharCode(a),i+=o}return r}function Qb(e,t,n){for(let r=0,i,a;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(a)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):a=i;continue}else a&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var $b=class extends _d{constructor(e){super(),e||={},this.dataProjection=new Zn({code:``,units:`tile-pixels`}),this.featureClass=e.featureClass?e.featureClass:md,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,n,r){e.pos=t.geometry;let i=e.readVarint()+e.pos,a=1,o=0,s=0,c=0,l=0,u=0;for(;e.pos<i;){if(!o){let t=e.readVarint();a=t&7,o=t>>3}if(o--,a===1||a===2)s+=e.readSVarint(),c+=e.readSVarint(),a===1&&l>u&&(r.push(l),u=l),n.push(s,c),l+=2;else if(a===7)l>u&&(n.push(n[u],n[u+1]),l+=2);else throw Error(`Invalid command found in the PBF`)}l>u&&(r.push(l),u=l)}createFeature_(e,t,n){let r=t.type;if(r===0)return null;let i,a=t.properties,o;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=t.id,a[this.layerName_]=t.layer.name;let s=[],c=[];this.readRawGeometry_(e,t,s,c);let l=ix(r,c.length);if(this.featureClass===md)i=new this.featureClass(l,s,c,2,a,o),i.transform(n.dataProjection);else{let e;if(l==`Polygon`){let t=Ba(s,c);e=t.length>1?new fd(s,`XY`,t):new Va(s,`XY`,c)}else e=l===`Point`?new xa(s,`XY`):l===`LineString`?new ld(s,`XY`):l===`MultiPoint`?new dd(s,`XY`):l===`MultiLineString`?new ud(s,`XY`,c):null;let t=this.featureClass;i=new t,this.geometryName_&&i.setGeometryName(this.geometryName_);let r=vd(e,!1,n);i.setGeometry(r),o!==void 0&&i.setId(o),i.setProperties(a,!0)}return i}getType(){return`arraybuffer`}readFeatures(e,t){let n=this.layers_;t=this.adaptOptions(t);let r=B(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;let i=new Fb(e),a=i.readFields(ex,{}),o=[];for(let e in a){if(n&&!n.includes(e))continue;let s=a[e],c=s?[0,0,s.extent,s.extent]:null;r.setExtent(c);for(let e=0,n=s.length;e<n;++e){let n=rx(i,s,e),r=this.createFeature_(i,n,t);r!==null&&o.push(r)}}return o}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}};function ex(e,t,n){if(e===3){let e={keys:[],values:[],features:[]},r=n.readVarint()+n.pos;n.readFields(tx,e,r),e.length=e.features.length,e.length&&(t[e.name]=e)}}function tx(e,t,n){if(e===15)t.version=n.readVarint();else if(e===1)t.name=n.readString();else if(e===5)t.extent=n.readVarint();else if(e===2)t.features.push(n.pos);else if(e===3)t.keys.push(n.readString());else if(e===4){let r=null,i=n.readVarint()+n.pos;for(;n.pos<i;)e=n.readVarint()>>3,r=e===1?n.readString():e===2?n.readFloat():e===3?n.readDouble():e===4?n.readVarint64():e===5?n.readVarint():e===6?n.readSVarint():e===7?n.readBoolean():null;t.values.push(r)}}function nx(e,t,n){if(e==1)t.id=n.readVarint();else if(e==2){let e=n.readVarint()+n.pos;for(;n.pos<e;){let e=t.layer.keys[n.readVarint()],r=t.layer.values[n.readVarint()];t.properties[e]=r}}else e==3?t.type=n.readVarint():e==4&&(t.geometry=n.pos)}function rx(e,t,n){e.pos=t.features[n];let r=e.readVarint()+e.pos,i={layer:t,type:0,properties:{}};return e.readFields(nx,i,r),i}function ix(e,t){let n;return e===1?n=t===1?`Point`:`MultiPoint`:e===2?n=t===1?`LineString`:`MultiLineString`:e===3&&(n=`Polygon`),n}var ax=class extends hy{constructor(e){super(e),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(e){let t=e.layerStatesArray[e.layerIndex],n=e.pixelRatio,r=e.viewState,i=r.resolution,a=this.getLayer().getSource(),o=e.viewHints,s=e.extent;if(t.extent!==void 0&&(s=Sn(s,xi(t.extent,r.projection))),!o[At.ANIMATING]&&!o[At.INTERACTING]&&!En(s))if(a){let e=r.projection,t=a.getImage(s,i,n,e);t&&(this.loadImage(t)?this.image=t:t.getState()===G.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=Ai(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Qt(i,r))return null;let a=this.image.getExtent(),o=this.image.getImage(),s=z(a),c=Math.floor(o.width*((r[0]-a[0])/s));if(c<0||c>=o.width)return null;let l=xn(a),u=Math.floor(o.height*((a[3]-r[1])/l));return u<0||u>=o.height?null:this.getImageData(o,c,u)}renderFrame(e,t){let n=this.image,r=n.getExtent(),i=n.getResolution(),[a,o]=Array.isArray(i)?i:[i,i],s=n.getPixelRatio(),c=e.layerStatesArray[e.layerIndex],l=e.pixelRatio,u=e.viewState,d=u.center,f=u.resolution,p=l*a/(f*s),m=l*o/(f*s);this.prepareContainer(e,t);let h=this.context.canvas.width,g=this.context.canvas.height,_=this.getRenderContext(e),v=!1,y=!0;if(c.extent){let t=xi(c.extent,u.projection);y=Tn(t,e.extent),v=y&&!$t(t,e.extent),v&&this.clipUnrotated(_,e,t)}let b=n.getImage(),x=Ni(this.tempTransform,h/2,g/2,p,m,0,s*(r[0]-d[0])/a,s*(d[1]-r[3])/o);this.renderedResolution=o*l/s;let S=b.width*x[0],C=b.height*x[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,e),y&&S>=.5&&C>=.5){let e=x[4],t=x[5],n=c.opacity;n!==1&&(_.save(),_.globalAlpha=n),_.drawImage(b,0,0,+b.width,+b.height,e,t,S,C),n!==1&&_.restore()}return this.postRender(this.context,e),v&&_.restore(),_.imageSmoothingEnabled=!0,this.container}},ox=class extends Cs{constructor(e){e||={},super(e)}},sx=class extends ox{constructor(e){super(e)}createRenderer(){return new ax(this)}getData(e){return super.getData(e)}};function cx(e){return e instanceof Image||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageBitmap?e:null}function lx(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e instanceof DataView?e:null}var ux=Error(`disposed`),dx=null;function fx(e){dx||=_o(e.width,e.height,void 0,{willReadFrequently:!0});let t=dx.canvas,n=e.width;t.width!==n&&(t.width=n);let r=e.height;return t.height!==r&&(t.height=r),dx.clearRect(0,0,n,r),dx.drawImage(e,0,0),dx.getImageData(0,0,n,r).data}var px=[256,256],mx=class extends yy{constructor(e){let t=L.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_;let e=cx(this.data_);return e?[e.width,e.height]:px}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==L.IDLE&&this.state!==L.ERROR)return;this.state=L.LOADING,this.changed();let e=this;this.loader_().then(function(t){e.data_=t,e.state=L.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=L.ERROR,e.changed()})}disposeInternal(){this.controller_&&=(this.controller_.abort(ux),null),super.disposeInternal()}},hx,gx=[];function _x(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function vx(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function yx(){if(hx===void 0){let e=_o(6,6,gx);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,_x(e,4,5,4,0),_x(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;hx=vx(t,0)||vx(t,4)||vx(t,8),bo(e),gx.push(e.canvas)}return hx}function bx(e,t,n,r){let i=mi(n,t,e),a=ri(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||Qt(c,i)){let t=ri(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function xx(e,t,n,r){let i=bx(e,t,_n(n),r);return(!isFinite(i)||i<=0)&&pn(n,function(n){return i=bx(e,t,n,r),isFinite(i)&&i>0}),i}function Sx(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=_o(Math.round(n*e),Math.round(n*t),gx);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=nn();c.forEach(function(e,t,n){ln(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){if(_=_o(Math.round(z(g)*v),Math.round(xn(g)*v),gx),d||(_.imageSmoothingEnabled=!1),i&&p){let e=(i[0]-g[0])*v,t=-(i[3]-g[3])*v,n=z(i)*v,r=xn(i)*v;_.rect(e,t,n,r),_.clip()}c.forEach(function(e,t,n){if(e.image.width>0&&e.image.height>0){if(e.clipExtent){_.save();let t=(e.clipExtent[0]-g[0])*v,n=-(e.clipExtent[3]-g[3])*v,r=z(e.clipExtent)*v,i=xn(e.clipExtent)*v;_.rect(d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),_.clip()}let t=(e.extent[0]-g[0])*v,n=-(e.extent[3]-g[3])*v,r=z(e.extent)*v,i=xn(e.extent)*v;_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),e.clipExtent&&_.restore()}})}let b=Cn(o);return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),E=o,D=s;o=0,s=0,l-=E,u-=D,f-=E,p-=D;let O=Ft([[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]]);if(!O)return;if(m.save(),m.beginPath(),yx()||!d){m.moveTo(S,C);let e=v-S,t=x-C;for(let n=0;n<4;n++)m.lineTo(S+h((n+1)*e/4),C+h(n*t/3)),n!=3&&m.lineTo(S+h((n+1)*e/4),C+h((n+1)*t/3));m.lineTo(w,T)}else m.moveTo(S,C),m.lineTo(v,x),m.lineTo(w,T);m.clip(),m.transform(O[0],O[2],O[1],O[3],v,x),m.translate(g[0]-E,g[3]-D);let k;if(_)k=_.canvas,m.scale(y,-y);else{let e=c[0],t=e.extent;k=e.image,m.scale(z(t)/k.width,-xn(t)/k.height)}m.drawImage(k,0,0),m.restore()}),_&&(bo(_),gx.push(_.canvas)),u&&(m.save(),m.globalCompositeOperation=`source-over`,m.strokeStyle=`black`,m.lineWidth=1,s.getTriangles().forEach(function(e,t,n){let r=e.target,i=(r[0][0]-b[0])/a,o=-(r[0][1]-b[1])/a,s=(r[1][0]-b[0])/a,c=-(r[1][1]-b[1])/a,l=(r[2][0]-b[0])/a,u=-(r[2][1]-b[1])/a;m.beginPath(),m.moveTo(s,c),m.lineTo(i,o),m.lineTo(l,u),m.closePath(),m.stroke()}),m.restore()),m.canvas}var Cx=10,wx=.25,Tx=class{constructor(e,t,n,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;let s={},c=o?si(e=>Ai(o,mi(e,this.targetProj_,this.sourceProj_))):pi(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&z(r)>=z(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?z(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?z(this.targetProj_.getExtent()):null;let l=Cn(n),u=wn(n),d=gn(n),f=hn(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=Cx+(a?Math.max(0,Math.ceil(Math.log2(mn(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-r<this.sourceWorldWidth_/2&&(t.source=n)}})}s={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=qt([i,a,o,s]),u=this.sourceWorldWidth_?z(l)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=z(qt([e,t,n,r]))/this.targetWorldWidth_>wx||p),!f&&this.sourceProj_.isGlobal()&&u&&(p=u>wx||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!Tn(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(s[0])||!isFinite(s[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;a=f?(Rt(i[0],d)+Rt(o[0],d))/2-Rt(r[0],d):(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=nn();return this.triangles_.forEach(function(t,n,r){let i=t.source;un(e,i[0]),un(e,i[1]),un(e,i[2])}),e}getTriangles(){return this.triangles_}},Ex=.5,Dx=class extends yy{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,L.IDLE,d),this.renderEdges_=u===void 0?!1:u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?Sn(f,p):f;if(mn(h)===0){this.state=L.EMPTY;return}let g=e.getExtent();g&&(m=m?Sn(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=xx(e,n,h,_);if(!isFinite(v)||v<=0){this.state=L.EMPTY;return}if(this.triangulation_=new Tx(e,n,h,m,v*(l===void 0?Ex:l),_),this.triangulation_.getTriangles().length===0){this.state=L.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let y=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(y[1]=Mt(y[1],m[1],m[3]),y[3]=Mt(y[3],m[1],m[3])):y=Sn(y,m)),!mn(y))this.state=L.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=z(g),r=Math.floor((y[0]-g[0])/n)),jn(y.slice(),e,!0).forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=c(this.sourceZ_,e,t,o);if(i){let e=r*n;this.sourceTiles_.push({tile:i,offset:e})}}++r}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==L.LOADED){let r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=t.offset,r[2]+=t.offset;let i=this.clipExtent_?.slice();i&&(i[0]+=t.offset,i[2]+=t.offset),e.push({extent:r,clipExtent:i,image:n.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=L.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Sx(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=L.LOADED}this.changed()}load(){if(this.state==L.IDLE){this.state=L.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n==L.IDLE||n==L.LOADING){e++;let n=N(t,M.CHANGE,r=>{let i=t.getState();(i==L.LOADED||i==L.ERROR||i==L.EMPTY)&&(rt(n),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},t,n){e.getState()==L.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(rt),this.sourcesListenerKeys_=null}release(){this.canvas_&&=(bo(this.canvas_.getContext(`2d`)),gx.push(this.canvas_),null),super.release()}},Ox=class{constructor(e){this.highWaterMark=e===void 0?2048:e,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let e=this.pop();e instanceof Re&&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){let n=this.entries_[e];return R(n!==void 0,`Tried to get a value for a key that does not exist in the cache`),n===this.newest_?n.value_:(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n,n.value_)}remove(e){let t=this.entries_[e];return R(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(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){let 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){R(!(e in this.entries_),`Tried to set a value for a key that is used already`);let n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}};function kx(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function Ax(e,t,n){return e+`/`+t+`/`+n}function jx(e,t,n,r,i){return`${F(e)},${t},${Ax(n,r,i)}`}function Mx(e){return Nx(e[0],e[1],e[2])}function Nx(e,t,n){return(t<<e)+n}function Px(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return a?a.containsXY(r,i):!0}function Fx(e,t,n){if(!(n in e))return e[n]=new Set([t]),!0;let r=e[n],i=r.has(t);return i||r.add(t),!i}function Ix(e,t,n){let r=e[n];return r?r.delete(t):!1}function Lx(e,t){let n=e.layerStatesArray[e.layerIndex];n.extent&&(t=Sn(t,xi(n.extent,e.viewState.projection)));let r=n.layer.getRenderSource();if(!r.getWrapX()){let n=r.getTileGridForProjection(e.viewState.projection).getExtent();n&&(t=Sn(t,n))}return t}var Rx=class extends hy{constructor(e,t){super(e),t||={},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=nn(),this.tempTileRange_=new Sy(0,0,0,0),this.tempTileCoord_=kx(0,0,0);let n=t.cacheSize===void 0?512:t.cacheSize;this.tileCache_=new Ox(n),this.sourceTileCache_=null,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||=new Ox(512),this.sourceTileCache_}getOrCreateTile(e,t,n,r){let i=this.tileCache_,a=this.getLayer().getSource(),o=jx(a,a.getKey(),e,t,n),s;if(i.containsKey(o))s=i.get(o);else{let c=r.viewState.projection,l=a.getProjection();if(s=a.getTile(e,t,n,r.pixelRatio,c,!l||ui(l,c)?void 0:this.getSourceTileCache()),!s)return null;i.set(o,s)}return s}getTile(e,t,n,r){return this.getOrCreateTile(e,t,n,r)||null}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=Ai(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Qt(i,r))return null;let a=t.viewState,o=n.getRenderSource(),s=o.getTileGridForProjection(a.projection),c=o.getTilePixelRatio(t.pixelRatio);for(let e=s.getZForResolution(a.resolution);e>=s.getMinZoom();--e){let n=s.getTileCoordForCoordAndZ(r,e),i=this.getTile(e,n[1],n[2],t);if(!i||i.getState()!==L.LOADED)continue;let l=s.getOrigin(e),u=hc(s.getTileSize(e)),d=s.getResolution(e),f;if(i instanceof by||i instanceof Dx)f=i.getImage();else if(i instanceof mx){if(f=cx(i.getData()),!f)continue}else continue;let p=Math.floor(c*((r[0]-l[0])/d-n[1]*u[0])),m=Math.floor(c*((l[1]-r[1])/d-n[2]*u[1])),h=Math.round(c*o.getGutterForProjection(a.projection));return this.getImageData(f,p+h,m+h)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;let t=this.getLayer().getSource();if(!t)return!1;let n=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=n,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(e,t,n,r,i){let a=e.viewState,o=this.getLayer(),s=o.getRenderSource(),c=s.getTileGridForProjection(a.projection),l=F(s);l in e.wantedTiles||(e.wantedTiles[l]={});let u=e.wantedTiles[l],d=o.getMapInternal(),f=Math.max(n-i,c.getMinZoom(),c.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):c.getResolution(0)),s.zDirection)),p=a.rotation,m=p?bn(a.center,a.resolution,p,e.size):void 0;for(let i=n;i>=f;--i){let n=c.getTileRangeForExtentAndZ(t,i,this.tempTileRange_),a=c.getResolution(i);for(let t=n.minX;t<=n.maxX;++t)for(let o=n.minY;o<=n.maxY;++o){if(p&&!c.tileCoordIntersectsViewport([i,t,o],m))continue;let n=this.getTile(i,t,o,e);if(!n||!Fx(r,n,i))continue;let s=n.getKey();if(u[s]=!0,n.getState()===L.IDLE&&!e.tileQueue.isKeyQueued(s)){let r=kx(i,t,o,this.tempTileCoord_);e.tileQueue.enqueue([n,l,c.getTileCoordCenter(r),a])}}}}findStaleTile_(e,t){let n=this.tileCache_,r=e[0],i=e[1],a=e[2],o=this.getStaleKeys();for(let e=0;e<o.length;++e){let s=jx(this.getLayer().getSource(),o[e],r,i,a);if(n.containsKey(s)){let e=n.peek(s);if(e.getState()===L.LOADED)return e.endTransition(F(this)),Fx(t,e,r),!0}}return!1}findAltTiles_(e,t,n,r){let i=e.getTileRangeForTileCoordAndZ(t,n,this.tempTileRange_);if(!i)return!1;let a=!0,o=this.tileCache_,s=this.getLayer().getRenderSource(),c=s.getKey();for(let e=i.minX;e<=i.maxX;++e)for(let t=i.minY;t<=i.maxY;++t){let i=jx(s,c,n,e,t),l=!1;if(o.containsKey(i)){let e=o.peek(i);e.getState()===L.LOADED&&(Fx(r,e,n),l=!0)}l||(a=!1)}return a}renderFrame(e,t){this.renderComplete=!0;let n=e.layerStatesArray[e.layerIndex],r=e.viewState,i=r.projection,a=r.resolution,o=r.center,s=e.pixelRatio,c=this.getLayer(),l=c.getSource(),u=l.getTileGridForProjection(i),d=u.getZForResolution(a,l.zDirection),f=u.getResolution(d),p=l.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==p&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=p):this.renderedSourceKey_=p;let m=e.extent,h=l.getTilePixelRatio(s);this.prepareContainer(e,t);let g=this.context.canvas.width,_=this.context.canvas.height,v=n.extent&&xi(n.extent,i);v&&(m=Sn(m,xi(n.extent,i)));let y=f*g/2/h,b=f*_/2/h,x=[o[0]-y,o[1]-b,o[0]+y,o[1]+b],S={};this.renderedTiles.length=0;let C=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){let t=u.getZForResolution(r.nextResolution,l.zDirection),n=Lx(e,e.nextExtent);this.enqueueTiles(e,n,t,S,C)}let w=Lx(e,m);if(this.enqueueTiles(e,w,d,S,0),C>0&&setTimeout(()=>{this.enqueueTiles(e,w,d-1,S,C-1)},0),!(d in S))return this.container;let T=F(this),E=e.time;for(let t of S[d]){let n=t.getState();if(n===L.EMPTY)continue;let r=t.tileCoord;if(n===L.LOADED&&t.getAlpha(T,E)===1){t.endTransition(T);continue}if(n!==L.ERROR&&(this.renderComplete=!1),this.findStaleTile_(r,S)){Ix(S,t,d),e.animate=!0;continue}if(this.findAltTiles_(u,r,d+1,S))continue;let i=u.getMinZoom();for(let e=d-1;e>=i&&!this.findAltTiles_(u,r,e,S);--e);}let D=f/a*s/h,O=this.getRenderContext(e);Ni(this.tempTransform,g/2,_/2,D,D,0,-g/2,-_/2),n.extent&&this.clipUnrotated(O,e,v),l.getInterpolate()||(O.imageSmoothingEnabled=!1),this.preRender(O,e);let k=Object.keys(S).map(Number);k.sort(Be);let A,ee=[],j=[];for(let t=k.length-1;t>=0;--t){let n=k[t],r=l.getTilePixelSize(n,s,i),a=u.getResolution(n)/f,o=r[0]*a*D,c=r[1]*a*D,d=u.getTileCoordForCoordAndZ(Cn(x),n),p=u.getTileCoordExtent(d),m=Ai(this.tempTransform,[h*(p[0]-x[0])/f,h*(x[3]-p[3])/f]),g=h*l.getGutterForProjection(i);for(let t of S[n]){if(t.getState()!==L.LOADED)continue;let r=t.tileCoord,i=d[1]-r[1],a=Math.round(m[0]-(i-1)*o),s=d[2]-r[2],u=Math.round(m[1]-(s-1)*c),f=Math.round(m[0]-i*o),p=Math.round(m[1]-s*c),h=a-f,_=u-p,v=k.length===1,y=!1;A=[f,p,f+h,p,f+h,p+_,f,p+_];for(let e=0,t=ee.length;e<t;++e)if(!v&&n<j[e]){let t=ee[e];Tn([f,p,f+h,p+_],[t[0],t[3],t[4],t[7]])&&(y||=(O.save(),!0),O.beginPath(),O.moveTo(A[0],A[1]),O.lineTo(A[2],A[3]),O.lineTo(A[4],A[5]),O.lineTo(A[6],A[7]),O.moveTo(t[6],t[7]),O.lineTo(t[4],t[5]),O.lineTo(t[2],t[3]),O.lineTo(t[0],t[1]),O.clip())}ee.push(A),j.push(n),this.drawTile(t,e,f,p,h,_,g,v),y&&O.restore(),this.renderedTiles.unshift(t),this.updateUsedTiles(e.usedTiles,l,t)}}return this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!cn(this.renderedExtent_,x),this.renderedExtent_=x,this.renderedPixelRatio=s,this.postRender(this.context,e),n.extent&&O.restore(),O.imageSmoothingEnabled=!0,this.renderComplete&&e.postRenderFunctions.push((e,t)=>{let n=F(l),r=t.wantedTiles[n],i=r?Object.keys(r).length:0;this.updateCacheSize(i),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()}),this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,n,r,i,a,o,s){let c;if(e instanceof mx){if(c=cx(e.getData()),!c)throw Error(`Rendering array data is not yet supported`)}else c=this.getTileImage(e);if(!c)return;let l=this.getRenderContext(t),u=F(this),d=t.layerStatesArray[t.layerIndex],f=d.opacity*(s?e.getAlpha(u,t.time):1),p=f!==l.globalAlpha;p&&(l.save(),l.globalAlpha=f),l.drawImage(c,o,o,c.width-2*o,c.height-2*o,n,r,i,a),p&&l.restore(),f===d.opacity?s&&e.endTransition(u):t.animate=!0}getImage(){let e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,n){let r=F(t);r in e||(e[r]={}),e[r][n.getKey()]=!0}},zx={PRELOAD:`preload`,USE_INTERIM_TILES_ON_ERROR:`useInterimTilesOnError`},Bx=class extends Cs{constructor(e){e||={};let t=Object.assign({},e),n=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(e.preload===void 0?0:e.preload),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0?!0:e.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(zx.PRELOAD)}setPreload(e){this.set(zx.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(zx.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(zx.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}},Vx=class extends Bx{constructor(e){super(e)}createRenderer(){return new Rx(this,{cacheSize:this.getCacheSize()})}},Hx={image:[`Polygon`,`Circle`,`LineString`,`Image`,`Text`],hybrid:[`Polygon`,`LineString`],vector:[]},Ux={hybrid:[`Image`,`Text`,`Default`],vector:[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`]},Wx=class extends Rx{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=Ti(),this.tileClipContexts_=null}enqueueTilesForNextExtent(){return this.getLayer().getRenderMode()!==`vector`}drawTile(e,t,n,r,i,a,o,s){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,n,r,i,a,o,s)}getTile(e,t,n,r){let i=this.getOrCreateTile(e,t,n,r);if(!i)return null;let a=r.viewState,o=a.resolution,s=r.viewHints,c=this.getLayer().getSource(),l=c.getTileGridForProjection(a.projection),u=!(s[At.ANIMATING]||s[At.INTERACTING]),d=l.getZForResolution(o,c.zDirection)===e;return u&&d?i.wantedResolution=o:i.wantedResolution||=l.getResolution(e),i}prepareFrame(e){let t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,n){let r=this.getLayer(),i=r.getRevision(),a=r.getRenderOrder()||null,o=e.wantedResolution,s=e.getReplayState(r);if(!s.dirty&&s.renderedResolution===o&&s.renderedRevision==i&&s.renderedRenderOrder==a)return;let c=r.getSource(),l=!!r.getDeclutter(),u=c.getTileGrid(),d=c.getTileGridForProjection(n).getTileCoordExtent(e.wrappedTileCoord),f=c.getSourceTiles(t,n,e),p=F(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],s.dirty=!1;for(let i=0,m=f.length;i<m;++i){let m=f[i];if(m.getState()!=L.LOADED)continue;let h=c.getProjection(),g=m.tileCoord,_=u.getTileCoordExtent(g);n&&h&&!ui(n,h)&&(_=hi(_,h,n,32));let v=Sn(d,_),y=Yt(v,r.getRenderBuffer()*o,this.tempExtent),b=cn(_,v)?null:y,x=new Vv(0,v,o,t),S=av(o,t),C=function(e,t){let n,i=e.getStyleFunction()||r.getStyleFunction();if(i&&(n=i(e,o)),n){let r=this.renderFeature(e,S,n,x,l,t);s.dirty=s.dirty||r}},w=m.getFeatures();a&&a!==s.renderedRenderOrder&&w.sort(a);for(let e=0,t=w.length;e<t;++e){let t=w[e];n&&m.projection&&!ui(n,m.projection)&&(t=t.clone(),t.getGeometry().applyTransform(pi(m.projection,n))),(!b||Tn(b,t.getGeometry().getExtent()))&&C.call(this,t,e)}let T=x.finish(),E=new iy(r.getRenderMode()!==`vector`&&l&&f.length===1?null:v,o,t,c.getOverlaps(),T,r.getRenderBuffer(),!0);e.executorGroups[p].push(E)}s.renderedRevision=i,s.renderedRenderOrder=a,s.renderedResolution=o}forEachFeatureAtCoordinate(e,t,n,r,i){let a=t.viewState.resolution,o=t.viewState.rotation;n??=0;let s=this.getLayer(),c=s.getSource().getTileGridForProjection(t.viewState.projection),l=qt([e]);Yt(l,a*n,l);let u={},d=function(e,t,n){let a=e.getId();a===void 0&&(a=F(e));let o=u[a];if(!o){if(n===0)return u[a]=!0,r(e,s,t);i.push(u[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return u[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},f=this.renderedTiles,p=F(s),m=s.getDeclutter(),h=m?t.declutter?.[m]?.all().map(e=>e.value):null,g;foundFeature:for(let t=0,r=f.length;t<r;++t){let r=f[t];if(!Tn(c.getTileCoordExtent(r.wrappedTileCoord),l))continue;let i=r.executorGroups[p];for(let t=0,r=i.length;t<r;++t)if(g=i[t].forEachFeatureAtCoordinate(e,a,o,n,d,h),g)break foundFeature}return g}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,n)=>{let r=this.getLayer(),i=r.getSource(),a=this.renderedProjection,o=a.getExtent(),s=this.renderedResolution,c=i.getTileGridForProjection(a),l=Ai(this.renderedPixelToCoordinateTransform_,e.slice()),u=c.getTileCoordForCoordAndResolution(l,s).toString(),d=this.renderedTiles.find(e=>e.tileCoord.toString()===u&&e.getState()===L.LOADED);if(!d||d.loadingSourceTiles>0){t([]);return}i.getWrapX()&&a.canWrapX()&&!$t(o,c.getTileCoordExtent(d.tileCoord))&&Bn(l,a);let f=F(r),p=Cn(c.getTileCoordExtent(d.wrappedTileCoord)),m=[(l[0]-p[0])/s,(p[1]-l[1])/s],h=d.getSourceTiles().reduce((e,t)=>e.concat(t.getFeatures()),[]),g=d.hitDetectionImageData[f];if(!g){let e=hc(c.getTileSize(c.getZForResolution(s,i.zDirection))),t=this.renderedRotation_;g=cy(e,[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),s,0,sy,e[0]*sy,e[1]*sy,0)],h,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,t),d.hitDetectionImageData[f]=g}t(ly(m,h,g))})}getFeaturesInExtent(e){let t=[],n=this.getTileCache();if(n.getCount()===0)return t;let r=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),i=r.getZForResolution(this.renderedResolution),a={};return n.forEach(n=>{if(n.tileCoord[0]!==i||n.getState()!==L.LOADED)return;let o=n.getSourceTiles();for(let n=0,i=o.length;n<i;++n){let i=o[n],s=i.getKey();if(s in a)continue;a[s]=!0;let c=i.tileCoord;if(Tn(e,r.getTileCoordExtent(c))){let n=i.getFeatures();if(n)for(let r=0,i=n.length;r<i;++r){let i=n[r];Tn(e,i.getGeometry().getExtent())&&t.push(i)}}}}),t}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){let n=this.context,r=n.globalAlpha;n.globalAlpha=t.opacity;let i=e.viewHints,a=!(i[At.ANIMATING]||i[At.INTERACTING]),o=[this.context.canvas.width,this.context.canvas.height],s=this.getLayer().getDeclutter(),c=s?e.declutter?.[s]:void 0,l=F(this.getLayer()),u=this.renderedTiles;for(let t=0,n=u.length;t<n;++t){let n=u[t],r=n.executorGroups[l];if(r)for(let t=r.length-1;t>=0;--t)r[t].execute(this.context,o,this.getTileRenderTransform(n,e),e.viewState.rotation,a,ny,c)}n.globalAlpha=r}renderDeferredInternal(e){let t=this.renderedTiles,n=F(this.getLayer()),r=t.reduce((e,t,r)=>(t.executorGroups[n].forEach(t=>e.push({executorGroup:t,index:r})),e),[]),i=r.map(({executorGroup:e})=>e.getDeferredZIndexContexts()),a={};for(let e=0,t=r.length;e<t;++e){let t=r[e].executorGroup.getDeferredZIndexContexts();for(let e in t)a[e]=!0}Object.keys(a).map(Number).sort(Be).forEach(e=>{i.forEach((t,n)=>{t[e]&&(t[e].forEach(e=>{let{executorGroup:t,index:i}=r[n],a=t.getRenderedContext(),o=a.globalAlpha;a.globalAlpha=this.renderedOpacity_;let s=this.tileClipContexts_[i];s&&s.draw(a),e.draw(a),s&&a.restore(),a.globalAlpha=o,e.clear()}),t[e].length=0)})})}getTileRenderTransform(e,t){let n=t.pixelRatio,r=t.viewState,i=r.center,a=r.resolution,o=r.rotation,s=t.size,c=Math.round(s[0]*n),l=Math.round(s[1]*n),u=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),d=e.tileCoord,f=u.getTileCoordExtent(e.wrappedTileCoord),p=u.getTileCoordExtent(d,this.tempExtent)[0]-f[0];return Di(ji(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(i,a,o,n,c,l,p))}postRender(e,t){let n=t.viewHints,r=!(n[At.ANIMATING]||n[At.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;let i=this.getLayer(),a=i.getRenderMode(),o=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;let s=i.getDeclutter(),c=s?Ux[a].filter(e=>!ny.includes(e)):Ux[a],l=t.viewState,u=l.rotation,d=i.getSource(),f=d.getTileGridForProjection(l.projection).getZForResolution(l.resolution,d.zDirection),p=this.renderedTiles,m=[],h=[],g=[],_=F(i),v=!0;for(let n=p.length-1;n>=0;--n){let a=p[n];v&&=!a.getReplayState(i).dirty;let o=a.executorGroups[_].filter(e=>e.hasExecutors(c));if(o.length===0)continue;let l=this.getTileRenderTransform(a,t),d=a.tileCoord[0],y=!1,b=o[0].getClipCoords(l),x=e,S;if(b){S=new Uv,x=S.getContext();for(let e=0,t=m.length;e<t;++e)if(f!==d&&d<h[e]){let t=m[e];Tn([b[0],b[3],b[4],b[7]],[t[0],t[3],t[4],t[7]])&&(y||=(x.save(),!0),x.beginPath(),x.moveTo(b[0],b[1]),x.lineTo(b[2],b[3]),x.lineTo(b[4],b[5]),x.lineTo(b[6],b[7]),x.moveTo(t[6],t[7]),x.lineTo(t[4],t[5]),x.lineTo(t[2],t[3]),x.lineTo(t[0],t[1]),x.clip())}m.push(b),h.push(d)}for(let n=0,i=o.length;n<i;++n)o[n].execute(e,[e.canvas.width,e.canvas.height],l,u,r,c,t.declutter?.[s]);y&&(x===e?x.restore():g[n]=S)}e.globalAlpha=o,this.ready=v,this.tileClipContexts_=g,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,n,r,i,a){if(!n)return!1;let o=!1;if(Array.isArray(n))for(let s=0,c=n.length;s<c;++s)o=cv(r,e,n[s],t,this.boundHandleStyleImageChange_,void 0,i,a)||o;else o=cv(r,e,n,t,this.boundHandleStyleImageChange_,void 0,i,a);return o}tileImageNeedsRender_(e){let t=this.getLayer();if(t.getRenderMode()===`vector`)return!1;let n=e.getReplayState(t),r=t.getRevision(),i=e.wantedResolution;return n.renderedTileResolution!==i||n.renderedTileRevision!==r}renderTileImage_(e,t){let n=this.getLayer(),r=e.getReplayState(n),i=n.getRevision(),a=e.executorGroups[F(n)];r.renderedTileRevision=i;let o=e.wrappedTileCoord,s=o[0],c=n.getSource(),l=t.pixelRatio,u=t.viewState.projection,d=c.getTileGridForProjection(u),f=d.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*f,m=d.getResolution(s),h=e.getContext();l=Math.round(Math.max(l,p/l));let g=c.getTilePixelSize(s,l,u);h.canvas.width=g[0],h.canvas.height=g[1];let _=l/p;if(_!==1){let e=Ei(this.tmpTransform_);ji(e,_,_),h.setTransform.apply(h,e)}let v=d.getTileCoordExtent(o,this.tempExtent),y=p/m,b=Ei(this.tmpTransform_);ji(b,y,-y),Mi(b,-v[0],-v[3]);for(let e=0,t=a.length;e<t;++e)a[e].execute(h,[h.canvas.width*_,h.canvas.height*_],b,0,!0,Hx[n.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}},Gx=class extends Uu{constructor(e){e||={};let t=Object.assign({},e);delete t.preload;let n=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n;let r=e.renderMode||`hybrid`;R(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?!0:e.useInterimTilesOnError),this.getBackground,this.setBackground}createRenderer(){return new Wx(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(zx.PRELOAD)}getUseInterimTilesOnError(){return this.get(zx.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(zx.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(zx.USE_INTERIM_TILES_ON_ERROR,e)}};function Kx(e){return Array.isArray(e)?Math.min(...e):e}var qx=class extends dl{constructor(e,t,n,r,i,a,o){let s=e.getExtent();s&&e.canWrapX()&&(s=s.slice(),s[0]=-1/0,s[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);let l=c?Sn(n,c):n,u=bx(e,t,_n(l),r),d=new Tx(e,t,l,s,u*Ex,r),f=d.calculateSourceExtent(),p=En(f)?null:a(f,u,i),m=p?G.IDLE:G.EMPTY,h=p?p.getPixelRatio():1;super(n,r,h,m),this.targetProj_=t,this.maxSourceExtent_=s,this.triangulation_=d,this.targetResolution_=r,this.targetExtent_=n,this.sourceImage_=p,this.sourcePixelRatio_=h,this.interpolate_=o,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==G.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){let e=this.sourceImage_.getState();e==G.LOADED&&(this.canvas_=Sx(z(this.targetExtent_)/this.targetResolution_,xn(this.targetExtent_)/this.targetResolution_,this.sourcePixelRatio_,Kx(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==G.IDLE){this.state=G.LOADING,this.changed();let e=this.sourceImage_.getState();e==G.LOADED||e==G.ERROR?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,M.CHANGE,e=>{let t=this.sourceImage_.getState();(t==G.LOADED||t==G.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){rt(this.sourceListenerKey_),this.sourceListenerKey_=null}},Jx={IMAGELOADSTART:`imageloadstart`,IMAGELOADEND:`imageloadend`,IMAGELOADERROR:`imageloaderror`},Yx=class extends et{constructor(e,t){super(e),this.image=t}},Xx=class extends wv{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate===void 0?!0:e.interpolate}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions===void 0?null:e.resolutions,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){let t=this.getResolutions();return t&&(e=t[He(t,e,0)]),e}getImage(e,t,n,r){let i=this.getProjection();if(!i||!r||ui(i,r))return i&&(r=i),this.getImageInternal(e,t,n,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ui(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&cn(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new qx(i,r,e,t,n,(e,t,n)=>this.getImageInternal(e,t,n,i),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,n,r){if(this.loader){let i=Zx(e,t,n,1),a=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&$t(this.wantedExtent_,i)||$t(this.image.getExtent(),i))&&(this.wantedResolution_&&Kx(this.wantedResolution_)===a||Kx(this.image.getResolution())===a)))return this.image;this.wantedProjection_=r,this.wantedExtent_=i,this.wantedResolution_=a,this.image=new dl(i,a,n,this.loader),this.image.addEventListener(M.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){let t=e.target,n;switch(t.getState()){case G.LOADING:this.loading=!0,n=Jx.IMAGELOADSTART;break;case G.LOADED:this.loading=!1,n=Jx.IMAGELOADEND;break;case G.ERROR:this.loading=!1,n=Jx.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new Yx(n,t))}};function Zx(e,t,n,r){let i=t/n,a=_n(e),o=Ht(z(e)/i,4),s=Ht(xn(e)/i,4);return yn(a,i,0,[o+2*Ht((r-1)*o/2,4),s+2*Ht((r-1)*s/2,4)])}var Qx=[0,0,0],$x=5,eS=class{constructor(e){this.minZoom=e.minZoom===void 0?0:e.minZoom,this.resolutions_=e.resolutions,R(Ke(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let e=0,n=this.resolutions_.length-1;e<n;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,R(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));let n=e.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Cn(n)),R(!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,R(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,R(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n===void 0?null:n,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes===void 0?n&&this.calculateTileRanges_(n):this.fullTileRanges_=e.sizes.map((e,t)=>{let r=new Sy(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(n){let e=this.getTileRangeForExtentAndZ(n,t);r.minX=Math.max(e.minX,r.minX),r.maxX=Math.min(e.maxX,r.maxX),r.minY=Math.max(e.minY,r.minY),r.maxY=Math.min(e.maxY,r.maxY)}return r})}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=Cy(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))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,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return Cy(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return Cy(i,a,i,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?Cy(o,o,s,s,n):Cy(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Qx);let r=Qx[1],i=Qx[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Qx);let a=Qx[1],o=Qx[2];return Cy(r,a,i,o,n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=hc(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=hc(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return rn(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=hc(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=Ht(l,$x)-1,u=Ht(u,$x)-1):(l=Vt(l,$x),u=Vt(u,$x)),kx(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=hc(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];return r?(c=Ht(c,$x)-1,l=Ht(l,$x)-1):(c=Vt(c,$x),l=Vt(l,$x)),kx(n,c,l,i)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}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){return Mt(He(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return ja(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function tS(e){let t=e.getDefaultTileGrid();return t||(t=oS(e),e.setDefaultTileGrid(t)),t}function nS(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=sS(n);if(!Qt(a,i)){let t=z(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function rS(e,t,n,r){r=r===void 0?`top-left`:r;let i=aS(e,t,n);return new eS({extent:e,origin:vn(e,r),resolutions:i,tileSize:n})}function iS(e){let t=e||{},n=t.extent||B(`EPSG:3857`).getExtent();return new eS({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:aS(n,t.maxZoom,t.tileSize,t.maxResolution)})}function aS(e,t,n,r){t=t===void 0?42:t,n=hc(n===void 0?256:n);let i=xn(e),a=z(e);r=r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function oS(e,t,n,r){return rS(sS(e),t,n,r)}function sS(e){e=B(e);let t=e.getExtent();if(!t){let n=180*Xn.degrees/e.getMetersPerUnit();t=rn(-n,-n,n,n)}return t}var cS=class extends wv{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?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&hc(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=e.key||F(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){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i,a){return P()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:tS(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=hc(r.getTileSize(e),this.tmpSize);return i==1?a:mc(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){let n=t===void 0?this.getProjection():t,r=t===void 0&&this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(e=nS(r,e,n)),Px(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}},lS=class extends et{constructor(e,t){super(e),this.tile=t}};function uS(e){return function(t){let n=t.buffers,r=t.meta,i=t.imageOps,a=t.width,o=t.height,s=n.length,c=n[0].byteLength;if(i){let t=Array(s);for(let e=0;e<s;++e)t[e]=new ImageData(new Uint8ClampedArray(n[e]),a,o);return e(t,r).data.buffer}let l=new Uint8ClampedArray(c),u=Array(s),d=Array(s);for(let e=0;e<s;++e)u[e]=new Uint8ClampedArray(n[e]),d[e]=[0,0,0,0];for(let t=0;t<c;t+=4){for(let e=0;e<s;++e){let n=u[e];d[e][0]=n[t],d[e][1]=n[t+1],d[e][2]=n[t+2],d[e][3]=n[t+3]}let n=e(d,r);l[t]=n[0],l[t+1]=n[1],l[t+2]=n[2],l[t+3]=n[3]}return l.buffer}}function dS(e,t){let n=Object.keys(e.lib||{}).map(function(t){return`const `+t+` = `+e.lib[t].toString()+`;`}).concat([`const __minion__ = (`+uS.toString()+`)(`,e.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(n.join(`
|
|
18
|
-
`),`binary`).toString(`base64`):URL.createObjectURL(new Blob(n,{type:`text/javascript`})));return r.addEventListener(`message`,t),r}function fS(e,t){let n=uS(e.operation),r=!1;return{postMessage:function(e){setTimeout(function(){r||t({data:{buffer:n(e),meta:e.meta}})},0)},terminate:function(){r=!0}}}var pS=class extends Re{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;t=e.threads===0?0:this.imageOps_?1:e.threads||1;let n=Array(t);if(t)for(let r=0;r<t;++r)n[r]=dS(e,this.onWorkerMessage_.bind(this,r));else n[0]=fS(e,this.onWorkerMessage_.bind(this,0));this.workers_=n,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,n){this.enqueue_({inputs:e,meta:t,callback:n}),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;let e=this.queue_.shift();this.job_=e;let t=e.inputs[0].width,n=e.inputs[0].height,r=e.inputs.map(function(e){return e.data.buffer}),i=this.workers_.length;if(this.running_=i,i===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},r);return}let a=e.inputs[0].data.length,o=4*Math.ceil(a/4/i);for(let a=0;a<i;++a){let i=a*o,s=[];for(let e=0,t=r.length;e<t;++e)s.push(r[e].slice(i,i+o));this.workers_[a].postMessage({buffers:s,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},s)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){let e=this.job_,t=this.workers_.length,n,r;if(t===1)n=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{let i=e.inputs[0].data.length;n=new Uint8ClampedArray(i),r=Array(t);let a=4*Math.ceil(i/4/t);for(let e=0;e<t;++e){let t=this.dataLookup_[e].buffer,i=e*a;n.set(new Uint8ClampedArray(t),i),r[e]=this.dataLookup_[e].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(n,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}},mS={BEFOREOPERATIONS:`beforeoperations`,AFTEROPERATIONS:`afteroperations`},hS=class extends et{constructor(e,t,n){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=n}},gS=class extends Xx{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType===void 0?`pixel`:e.operationType,this.threads_=e.threads===void 0?1:e.threads,this.layers_=bS(e.sources);let t=this.changed.bind(this);for(let e=0,n=this.layers_.length;e<n;++e)this.layers_[e].addEventListener(M.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new Ot(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:Ti(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:yS(this.layers_),pixelRatio:1,pixelToCoordinateTransform:Ti(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:F(this),renderTargets:{}},this.setAttributions(function(t){let n=[];for(let r=0,i=e.sources.length;r<i;++r){let i=e.sources[r],a=i instanceof wv?i:i.getSource();if(!a)continue;let o=a.getAttributions()?.(t);typeof o==`string`?n.push(o):o!==void 0&&n.push(...o)}return n}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new pS({operation:e,imageOps:this.operationType_===`image`,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,n){let r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);let i=_n(e);r.size[0]=Math.ceil(z(e)/t),r.size[1]=Math.ceil(xn(e)/t),r.extent=[i[0]-r.size[0]*t/2,i[1]-r.size[1]*t/2,i[0]+r.size[0]*t/2,i[1]+r.size[1]*t/2],r.time=Date.now();let a=r.viewState;return a.center=i,a.projection=n,a.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let n=0,r=this.layers_.length;n<r;++n)if(t=this.layers_[n].getSource(),!t||t.getState()!==`ready`){e=!1;break}return e}getImage(e,t,n,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);let i=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=i,this.renderedImageCanvas_){let e=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();(t!==e||!cn(i.extent,n))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){let e=this.requestedFrameState_,t=this.layers_.length,n=Array(t);for(let r=0;r<t;++r){e.layerIndex=r,e.renderTargets={};let t=vS(this.layers_[r],e);if(t)n[r]=t;else return}let r={};this.dispatchEvent(new hS(mS.BEFOREOPERATIONS,e,r)),this.processor_.process(n,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,n,r){if(t||!n)return;let i=e.extent,a=e.viewState.resolution;if(a!==this.requestedFrameState_.viewState.resolution||!cn(i,this.requestedFrameState_.extent))return;let o;this.renderedImageCanvas_?o=this.renderedImageCanvas_.getImage().getContext(`2d`):(o=_o(Math.round(z(i)/a),Math.round(xn(i)/a)),this.renderedImageCanvas_=new vy(i,a,1,o.canvas)),o.putImageData(n,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new hS(mS.AFTEROPERATIONS,e,r))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let n=0,r=this.layers_.length;n<r&&(t=this.layers_[n].getSource().getResolutions(e),!t);++n);return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}};gS.prototype.dispose;var _S=null;function vS(e,t){let n=e.getRenderer();if(!n)throw Error(`Unsupported layer type: `+e);if(!n.prepareFrame(t))return null;let r=t.size[0],i=t.size[1];if(r===0||i===0)return null;let a=n.renderFrame(t,null),o;if(a instanceof HTMLCanvasElement)o=a;else{if(a&&(o=a.firstElementChild),!(o instanceof HTMLCanvasElement))throw Error(`Unsupported rendered element: `+o);if(o.width===r&&o.height===i)return o.getContext(`2d`).getImageData(0,0,r,i)}if(!_S)_S=_o(r,i,void 0,{willReadFrequently:!0});else{let e=_S.canvas;e.width!==r||e.height!==i?_S=_o(r,i,void 0,{willReadFrequently:!0}):_S.clearRect(0,0,r,i)}return _S.drawImage(o,0,0,r,i),_S.getImageData(0,0,r,i)}function yS(e){return e.map(function(e){return e.getLayerState()})}function bS(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=xS(e[r]);return n}function xS(e){let t;return e instanceof wv?e instanceof cS?t=new Vx({source:e}):e instanceof Xx&&(t=new sx({source:e})):t=e,t}function SS(e,t,n,r){let i=document.createElement(`script`),a=`olc_`+F(t);function o(){delete window[a],i.parentNode.removeChild(i)}i.async=!0,i.src=e+(e.includes(`?`)?`&`:`?`)+(r||`callback`)+`=`+a;let s=setTimeout(function(){o(),n&&n()},1e4);window[a]=function(e){clearTimeout(s),o(),t(e)},document.head.appendChild(i)}var CS=/\{z\}/g,wS=/\{x\}/g,TS=/\{y\}/g,ES=/\{-y\}/g;function DS(e,t,n,r,i){return e.replace(CS,t.toString()).replace(wS,n.toString()).replace(TS,r.toString()).replace(ES,function(){if(i===void 0)throw Error(`If the URL template has a {-y} placeholder, the grid extent must be known`);return(i-r).toString()})}function OS(e,t,n,r){return e[Rt(Nx(t,n,r),e.length)]}function kS(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function AS(e,t){return(function(n,r,i){if(!n)return;let a,o=n[0];if(t){let e=t.getFullTileRange(o);e&&(a=e.getHeight()-1)}return DS(e,o,n[1],n[2],a)})}function jS(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=AS(e[i],t);return MS(r)}function MS(e){return e.length===1?e[0]:(function(t,n,r){if(t)return e[Rt(Mx(t),e.length)](t,n,r)})}var NS={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},PS=class e extends cS{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===e.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.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){let t=e.target,n=F(t),r=t.getState(),i;r==L.LOADING?(this.tileLoadingKeys_[n]=!0,i=NS.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==L.ERROR?NS.TILELOADERROR:r==L.LOADED?NS.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new lS(i,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=kS(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(`
|
|
19
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(jS(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},FS=class extends PS{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:IS,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0?!0:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.tileClass=e.tileClass===void 0?by:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!ui(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||ui(t,e)))return this.tileGrid;let n=F(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=tS(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?L.EMPTY:L.IDLE,c===void 0?``:c,this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(M.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||ui(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new Dx(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=jx(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=B(e);if(n){let e=F(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function IS(e,t){if(vt){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`),fetch(t,{mode:r,credentials:i}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var LS=class extends FS{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:B(`EPSG:3857`),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:`loading`,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)SS(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{let 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 Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){let t=e.target;if(!t.status||t.status>=200&&t.status<300){let e;try{e=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(e)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){let t=B(`EPSG:4326`),n=this.getProjection(),r;if(e.bounds!==void 0){let i=di(t,n);r=kn(e.bounds,i)}let i=sS(n),a=e.minzoom||0,o=iS({extent:i,maxZoom:e.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=jS(e.tiles,o),e.attribution&&!this.getAttributions()){let t=r===void 0?i:r;this.setAttributions(function(n){return Tn(t,n.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(`ready`)}handleTileJSONError(){this.setState(`error`)}},RS=class extends PS{constructor(e){let t=e.projection||`EPSG:3857`,n=e.extent||sS(t),r=e.tileGrid||iS({extent:n,maxResolution:e.maxResolution,maxZoom:e.maxZoom===void 0?22:e.maxZoom,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:zS,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:Ey,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,n){if(n.getState()===L.IDLE){n.setState(L.LOADING);let r=n.wrappedTileCoord,i=this.getTileGridForProjection(t),a=i.getTileCoordExtent(r),o=r[0],s=i.getResolution(o);Yt(a,-s,a);let c=this.projection;t&&this.projection&&!ui(t,c)&&(a=hi(a,t,c));let l=this.tileGrid,u=l.getExtent();u&&Sn(a,u,a);let d=s;t&&c&&!ui(t,c)&&(d=s/c.getMetersPerUnit()/t.getMetersPerUnit());let f=l.getZForResolution(d,this.zDirection);l.forEachTileCoord(a,f,r=>{let i=this.tileUrlFunction(r,e,t);this.sourceTiles_[i]||(this.sourceTiles_[i]=new this.tileClass(r,i?L.IDLE:L.EMPTY,i,this.format_,this.tileLoadFunction));let a=this.sourceTiles_[i];n.sourceTiles.push(a),this.tileKeysBySourceTileUrl_[i]||(this.tileKeysBySourceTileUrl_[i]=[]),this.tileKeysBySourceTileUrl_[i].push(n.getKey());let o=a.getState();if(o<L.LOADED){let e=t=>{this.handleTileChange(t);let r=a.getState();if(r===L.LOADED||r===L.ERROR){let t=a.getKey();t in n.errorTileKeys?a.getState()===L.LOADED&&delete n.errorTileKeys[t]:n.loadingSourceTiles--,r===L.ERROR?n.errorTileKeys[t]=!0:a.removeEventListener(M.CHANGE,e),n.loadingSourceTiles===0&&n.setState($e(n.errorTileKeys)?L.LOADED:L.ERROR)}};a.addEventListener(M.CHANGE,e),n.loadingSourceTiles++}o===L.IDLE&&(a.extent=l.getTileCoordExtent(r),a.projection=this.projection,a.resolution=l.getResolution(r[0]),a.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(e=>e.getState()===L.ERROR)?L.ERROR:L.LOADED)}return n.sourceTiles}removeSourceTiles(e){let t=e.getKey(),n=e.sourceTiles;for(let e=0,r=n.length;e<r;++e){let r=n[e].getTileUrl();if(!this.tileKeysBySourceTileUrl_[r])return;let i=this.tileKeysBySourceTileUrl_[r].indexOf(t);i!==-1&&(this.tileKeysBySourceTileUrl_[r].splice(i,1),this.tileKeysBySourceTileUrl_[r].length===0&&(delete this.tileKeysBySourceTileUrl_[r],delete this.sourceTiles_[r]))}}getTile(e,t,n,r,i){let a=[e,t,n],o=this.getTileCoordForTileUrlFunction(a,i),s=this.getTileGrid().getExtent(),c=this.projection,l=this.getTileGridForProjection(i);if(o&&s){let t=l.getTileCoordExtent(o);Yt(t,-l.getResolution(e),t),Tn(s,!i||!c||ui(i,c)?t:hi(t,i,c))||(o=null)}let u=!0;if(o!==null){let t=this.tileGrid,n=l.getResolution(e),a=n;i&&c&&!ui(i,c)&&(a=n/c.getMetersPerUnit()/i.getMetersPerUnit());let s=t.getZForResolution(a,1),d=l.getTileCoordExtent(o);Yt(d,-n,d),t.forEachTileCoord(!i||!c||ui(i,c)?d:hi(d,i,c),s,e=>{u&&=!this.tileUrlFunction(e,r,c)})}let d=new Ty(a,u?L.EMPTY:L.IDLE,o,this.getSourceTiles.bind(this,r,i),this.removeSourceTiles.bind(this));return d.key=this.getKey(),d}getTileGridForProjection(e){let t=e.getCode(),n=this.tileGrids_[t];if(!n){let r=this.projection;if(r!==null&&!ui(r,e))return tS(e);let i=this.tileGrid,a=i.getResolutions().slice(),o=a.map(function(e,t){return i.getOrigin(t)}),s=a.map(function(e,t){return i.getTileSize(t)});for(let e=a.length;e<43;++e)a.push(a[e-1]/2),o.push(o[e-1]),s.push(s[e-1]);n=new eS({extent:i.getExtent(),origins:o,resolutions:a,tileSizes:s}),this.tileGrids_[t]=n}return n}getTilePixelRatio(e){return e}getTilePixelSize(e,t,n){let r=hc(this.getTileGridForProjection(n).getTileSize(e),this.tmpSize);return[Math.round(r[0]*t),Math.round(r[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}};function zS(e,t){e.setLoader(function(n,r,i){yv(t,e.getFormat(),n,r,i,e.onLoad.bind(e),e.onError.bind(e))})}function BS(e,t){let n=e[0],r=n.width,i=n.height,a=n.data,o=new Uint8ClampedArray(a.length),s=t.resolution*2,c=r-1,l=i-1,u=[0,0,0,0],d=2*Math.PI,f=Math.PI/2,p=Math.PI*t.sunEl/180,m=Math.PI*t.sunAz/180,h=Math.cos(p),g=Math.sin(p),_=t.highlightColor,v=t.shadowColor,y=t.accentColor,b=t.encoding,x,S,C,w,T,E,D,O,k,A,ee,j,te,ne,re,ie,ae,oe,se,ce,le,ue;function de(e,t=`mapbox`){if(t===`mapbox`)return(e[0]*256*256+e[1]*256+e[2])*.1-1e4;if(t===`terrarium`)return e[0]*256+e[1]+e[2]/256-32768}for(S=0;S<=l;++S)for(T=S===0?0:S-1,E=S===l?l:S+1,x=0;x<=c;++x)C=x===0?0:x-1,w=x===c?c:x+1,D=(S*r+C)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],O=t.vert*de(u,b),D=(S*r+w)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],k=t.vert*de(u,b),A=(k-O)/s,D=(T*r+x)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],O=t.vert*de(u,b),D=(E*r+x)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],k=t.vert*de(u,b),ee=(k-O)/s,te=Math.atan2(ee,-A),te=te<0?f-te:te>f?d-te+f:f-te,j=Math.atan(Math.sqrt(A*A+ee*ee)),ue=g*Math.cos(j)+h*Math.sin(j)*Math.cos(m-te),ne=Math.cos(j),re=255*ue,se=Math.min(Math.max(2*t.sunEl,0),1),ce=1.875-t.opacity*1.75,le=t.opacity===.5?j:f*((ce**+j-1)/(ce**+f-1)),ae={r:(1-ne)*y.r*se*255,g:(1-ne)*y.g*se*255,b:(1-ne)*y.b*se*255,a:(1-ne)*y.a*se*255},ie=Math.abs(((te+m)/Math.PI+.5)%2-1),oe={r:(_.r*(1-ie)+v.r*ie)*re,g:(_.g*(1-ie)+v.g*ie)*re,b:(_.b*(1-ie)+v.b*ie)*re,a:(_.a*(1-ie)+v.a*ie)*re},D=(S*r+x)*4,o[D]=ae.r*(1-ie)+oe.r,o[D+1]=ae.g*(1-ie)+oe.g,o[D+2]=ae.b*(1-ie)+oe.b,o[D+3]=a[D+3]*t.opacity*se*Math.sin(le);return new ImageData(o,r,i)}function VS(e,t){let n=e[0],r=n.width,i=n.height,a=n.data,o=new Uint8ClampedArray(a.length),s=r-1,c=i-1,l=[0,0,0,0],u,d,f;function p(e){return e>0?1/(1-e):1+e}function m(e){return e>0?1-1/(1.001-e):-e}function h(e){e*=Math.PI/180;let t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let g=m(t.saturation),_=p(t.contrast),v=h(t.hueRotate),y=v,b=[v[2],v[0],v[1]],x=[v[1],v[2],v[0]],S=t.brightnessLow,C=t.brightnessHigh;for(d=0;d<=c;++d)for(u=0;u<=s;++u){f=(d*r+u)*4,l[0]=a[f],l[1]=a[f+1],l[2]=a[f+2],l[3]=a[f+3];let e=l[0],t=l[1],n=l[2],i=(e,t)=>{let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n},s=i([e,t,n],y),c=i([e,t,n],b),p=i([e,t,n],x),m=(s+c+p)/3;s+=(m-s)*g,c+=(m-c)*g,p+=(m-p)*g,s=(s-.5)*_+.5,c=(c-.5)*_+.5,p=(p-.5)*_+.5,s=S*(255-s)+C*s,c=S*(255-c)+C*c,p=S*(255-p)+C*p,o[f]=s,o[f+1]=c,o[f+2]=p,o[f+3]=l[3]}return new ImageData(o,r,i)}function HS(e,t=512){return e.getExtent()?iS({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():Uy}function US(e,t){return t.accessToken||(t=Object.assign({},t),new URL(e).searchParams.forEach((e,n)=>{t.accessToken=e,t.accessTokenParam=n})),t}function WS(e,t,n=``,r={},i=void 0){let a,o,s,c,l=!0;return typeof n!=`string`&&!Array.isArray(n)?(s=n,c=s.source||s.layers,r=s):c=n,typeof r==`string`?(a=r,s={}):(a=r.styleUrl,s=r),s.updateSource===!1&&(l=!1),i||=s.resolutions,!a&&typeof t==`string`&&!t.trim().startsWith(`{`)&&(a=t),a&&(a=a.startsWith(`data:`)?location.href:jy(a,s.accessToken),s=US(a,s)),new Promise(function(n,r){Yy(t,s).then(function(t){if(t.version!=8)return r(Error(`glStyle version 8 required.`));if(!(e instanceof _y||e instanceof Gx))return r(Error(`Can only apply to VectorLayer or VectorTileLayer`));let u=e instanceof Gx?`vector`:`geojson`;if(c?o=Array.isArray(c)?t.layers.find(function(e){return e.id===c[0]}).source:c:(o=t.layers.find(function(e){return e.source&&t.sources[e.source].type===u}).source,c=o),!o)return r(Error(`No ${u} source found in the glStyle.`));function d(){if(!l)return Promise.resolve();if(e instanceof Gx)return XS(t.sources[o],a,s).then(function(t){let n=e.getSource();n?t!==n&&(n.setTileUrlFunction(t.getTileUrlFunction()),typeof n.setUrls==`function`&&typeof t.getUrls==`function`&&n.setUrls(t.getUrls()),n.format_||=t.format_,n.getAttributions()||n.setAttributions(t.getAttributions()),n.getTileLoadFunction()===zS&&n.setTileLoadFunction(t.getTileLoadFunction()),ui(n.getProjection(),t.getProjection())&&(n.tileGrid=t.getTileGrid())):e.setSource(t);let r=e.getSource().getTileGrid();!isFinite(e.getMaxResolution())&&!isFinite(e.getMinZoom())&&r.getMinZoom()>0&&e.setMaxResolution(Ky(Math.max(0,r.getMinZoom()-1e-12),r.getResolutions()))});let n=t.sources[o],r=e.getSource();(!r||r.get(`mapbox-source`)!==n)&&(r=rC(n,a,s));let i=e.getSource();return i?r!==i&&(i.getAttributions()||i.setAttributions(r.getAttributions()),i.format_||=r.getFormat(),i.url_=r.getUrl()):e.setSource(r),Promise.resolve()}let f,p,m={},h={};function g(){if(!p&&(!t.sprite||m)){if(s.projection&&!i){let e=B(s.projection).getUnits();e!==`m`&&(i=Uy.map(t=>t/Xn[e]))}let a,l=e.getSource();l instanceof RS&&l.format_ instanceof $b&&(a=l.format_.layerName_),p=Eb(e,t,c,i,m,h,(e,t=s.webfonts)=>ub(e,t),s.getImage,a),e.getStyle()?d().then(n).catch(r):r(Error(`Nothing to show for source [${o}]`))}else p?(e.setStyle(p),d().then(n).catch(r)):r(Error(`Something went wrong trying to apply style.`))}if(t.sprite){let e=ky(t.sprite,s.accessToken,a||location.href);f=vt?1:window.devicePixelRatio>=1.5?.5:1;let n=f==.5?`@2x`:``;Promise.all(e.map(function(e){let t=new URL(e.url),i=t.origin+t.pathname+n+`.json`+t.search;return new Promise(function(e,n){Jy(`Sprite`,i,s).then(e).catch(function(r){i=t.origin+t.pathname+`.json`+t.search,Jy(`Sprite`,i,s).then(e).catch(n)})}).then(function(i){i===void 0&&r(Error(`No sprites found.`));let a;if(a=t.origin+t.pathname+n+`.png`+t.search,s.transformRequest){let e=s.transformRequest(a,`SpriteImage`)||a;(e instanceof Request||e instanceof Promise)&&(a=e)}h[e.id]=a;for(let t in i){let n=e.id==`default`?t:`${e.id}:${t}`;m[n]=i[t]}}).catch(function(e){r(Error(`Sprites cannot be loaded: ${i}: ${e.message}`))})})).then(g).catch(r)}else g()}).catch(r)})}function GS(e,t){let n;return e.some(function(e){if(e.id==t)return n=e.source,!0}),n}function KS(e,t){let n=e.bounds;if(n){let e=ci([n[0],n[1]],t),r=ci([n[2],n[3]],t);return[e[0],e[1],r[0],r[1]]}return B(t).getExtent()}function qS(e,t,n){let r=new LS({tileJSON:t,tileSize:e.tileSize||t.tileSize||512}),i=r.getTileJSON(),a=r.getTileGrid(),o=B(n.projection||`EPSG:3857`),s=KS(i,o),c=o.getExtent(),l=i.minzoom||0,u=i.maxzoom||22,d={attributions:r.getAttributions(),projection:o,tileGrid:new eS({origin:c?Cn(c):a.getOrigin(0),extent:s||a.getExtent(),minZoom:l,resolutions:HS(o,t.tileSize).slice(0,u+1),tileSize:a.getTileSize(0)})};return Array.isArray(i.tiles)?d.urls=i.tiles:d.url=i.tiles,d}function JS(e,t,n,r){let i={id:e.id,type:e.type},a=e.layout||{},o=e.paint||{};i.paint=o,mb.zoom=Gy(t,n.resolutions||Uy),mb.distanceFromCenter=0;let s,c=$(i,`paint`,`background-color`,Py,r);return o[`background-opacity`]!==void 0&&(s=$(i,`paint`,`background-opacity`,Py,r)),a.visibility==`none`?void 0:bb(c,s)}function YS(e,t,n){let r=vt?{style:{}}:document.createElement(`div`);return r.className=`ol-mapbox-style-background`,r.style.position=`absolute`,r.style.width=`100%`,r.style.height=`100%`,new Cs({source:new wv({}),render(i){let a=JS(e,i.viewState.resolution,t,n);return r.style.backgroundColor=a,r}})}function XS(e,t,n){return new Promise(function(r,i){Zy(e,t,n).then(function({tileJson:t,tileLoadFunction:i}){let a=qS(e,t,n);a.tileLoadFunction=i,a.format=new $b({layerName:`mvt:layer`});let o=new RS(a);o.set(`mapbox-source`,e),r(o)}).catch(i)})}function ZS(e,t,n){let r=new Gx({declutter:!0,visible:!1});return XS(e,t,n).then(function(e){r.setSource(e)}).catch(function(e){r.setSource(void 0)}),r}function QS(e){return`{bbox-${(e?e.getCode():`EPSG:3857`).toLowerCase().replace(/[^a-z0-9]/g,`-`)}}`}function $S(e,t,n){return new Promise(function(r,i){Zy(e,t,n).then(function({tileJson:t,tileLoadFunction:i}){let a=new LS({interpolate:n.interpolate===void 0?!0:n.interpolate,transition:0,crossOrigin:`anonymous`,tileJSON:t});a.tileGrid=qS(e,t,n).tileGrid,n.projection&&(a.projection=B(n.projection));let o=a.getTileUrlFunction();i&&a.setTileLoadFunction(i),a.setTileUrlFunction(function(e,t,n){let r=QS(n),i=o(e,t,n);if(i.indexOf(r)!=-1){let t=a.getTileGrid().getTileCoordExtent(e);i=i.replace(r,t.toString())}return i}),a.set(`mapbox-source`,e),r(a)}).catch(function(e){i(e)})})}function eC(e,t,n){let r=new Vx;return $S(e,t,n).then(function(e){r.setSource(e)}).catch(function(){r.setSource(void 0)}),r}function tC(e,t,n){return new sx({source:new gS({operationType:`image`,operation:VS,sources:[eC(e,t,n)]})})}function nC(e,t,n){return new sx({source:new gS({operationType:`image`,operation:BS,sources:[eC(e,t,n)]})})}function rC(e,t,n){let r=n.projection?new Td({dataProjection:n.projection}):new Td,i=e.data,a={};if(typeof i==`string`){let[a]=Ny(i,n.accessToken,n.accessTokenParam||`access_token`,t||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){let t=(e,t,n)=>{let r=QS(n);return a.replace(r,`${e.join(`,`)}`)},i=new Ov({attributions:e.attribution,format:r,loader:(e,r,a,o,s)=>{Jy(`GeoJSON`,typeof t==`function`?t(e,r,a):t,n).then(e=>{let t=i.getFormat().readFeatures(e,{featureProjection:a});i.addFeatures(t),o(t)}).catch(t=>{i.removeLoadedExtent(e),s()})},strategy:Sv});return i.set(`mapbox-source`,e),i}let o=new Ov({attributions:e.attribution,format:r,url:a,loader:(e,t,r,i,s)=>{Jy(`GeoJSON`,a,n).then(e=>{let t=o.getFormat().readFeatures(e,{featureProjection:r});o.addFeatures(t),i(t)}).catch(t=>{o.removeLoadedExtent(e),s()})}});return o}a.features=r.readFeatures(i,{featureProjection:_i()||`EPSG:3857`});let o=new Ov(Object.assign({attributions:e.attribution,format:r},a));return o.set(`mapbox-source`,e),o}function iC(e,t,n){return new _y({declutter:!0,source:rC(e,t,n),visible:!1})}function aC(e,t,n){let r=null;return function(i){e.paint&&`raster-opacity`in e.paint&&i.frameState.viewState.zoom!==r&&(r=i.frameState.viewState.zoom,delete n[e.id],oC(e,t,r,n))}}function oC(e,t,n,r){mb.zoom=n,mb.distanceFromCenter=0;let i=$(e,`paint`,`raster-opacity`,Py,r);t.setOpacity(i)}function sC(e,t){function n(){let n=t.get(`mapbox-style`);if(!n)return;let r=Nf(n.layers),i=e.get(`mapbox-layers`),a=r.filter(function(e){return i.includes(e.id)}).some(function(e){return!e.layout||!e.layout.visibility||e.layout.visibility===`visible`});e.get(`visible`)!==a&&e.setVisible(a)}e.on(`change`,n),n()}function cC(e,t,n,r){let i=By(e),a=e.layers,o=n.type,s=n.source||GS(a,n.ref),c=e.sources[s],l;if(o==`background`)l=YS(n,r,i);else if(c.type==`vector`)l=ZS(c,t,r);else if(c.type==`raster`){let e=[`raster-saturation`,`raster-contrast`,`raster-brightness-max`,`raster-brightness-min`,`raster-hue-rotate`];Object.keys(n.paint||{}).find(t=>e.includes(t))?(l=tC(c,t,r),l.getSource().on(`beforeoperations`,function(e){mb.zoom=Gy(e.resolution,r.resolutions||Uy),mb.distanceFromCenter=0;let t=e.data;t.saturation=$(n,`paint`,`raster-saturation`,Py,i),t.contrast=$(n,`paint`,`raster-contrast`,Py,i),t.brightnessHigh=$(n,`paint`,`raster-brightness-max`,Py,i),t.brightnessLow=$(n,`paint`,`raster-brightness-min`,Py,i),t.hueRotate=$(n,`paint`,`raster-hue-rotate`,Py,i)})):l=eC(c,t,r),l.setVisible(n.layout?n.layout.visibility!==`none`:!0),l.on(`prerender`,aC(n,l,i))}else if(c.type==`geojson`)l=iC(c,t,r);else if(c.type==`raster-dem`&&n.type==`hillshade`){let e=nC(c,t,r);l=e,e.getSource().on(`beforeoperations`,function(e){let t=e.data;t.resolution=ri(r.projection||`EPSG:3857`,e.resolution,_n(e.extent),`m`),mb.zoom=Gy(e.resolution,r.resolutions||Uy),mb.distanceFromCenter=0,t.encoding=c.encoding,t.vert=5*$(n,`paint`,`hillshade-exaggeration`,Py,i),t.sunAz=$(n,`paint`,`hillshade-illumination-direction`,Py,i),t.sunEl=35,t.opacity=.3,t.highlightColor=$(n,`paint`,`hillshade-highlight-color`,Py,i),t.shadowColor=$(n,`paint`,`hillshade-shadow-color`,Py,i),t.accentColor=$(n,`paint`,`hillshade-accent-color`,Py,i)}),l.setVisible(n.layout?n.layout.visibility!==`none`:!0)}let u=s;return l&&l.set(`mapbox-source`,u),l}function lC(e,t,n,r){let i=[],a=null;if(t instanceof Zu){if(a=t.getView(),!a.isDef()&&!a.getRotation()&&!a.getResolutions()){let e=r.projection?B(r.projection):a.getProjection();a=new to(Object.assign(a.getProperties(),{maxResolution:Uy[0]/Xn[e.getUnits()],projection:r.projection||a.getProjection()})),t.setView(a)}`center`in e&&!a.getCenter()&&a.setCenter(ci(e.center,a.getProjection())),`zoom`in e&&a.getZoom()===void 0&&a.setResolution(Uy[0]/Xn[a.getProjection().getUnits()]/2**e.zoom),(!a.getCenter()||a.getZoom()===void 0)&&a.fit(a.getProjection().getExtent(),{nearest:!0,size:t.getSize()})}t.set(`mapbox-style`,e),t.set(`mapbox-metadata`,{styleUrl:n,options:r});let o=e.layers,s=[],c,l,u;for(let a=0,d=o.length;a<d;++a){let d=o[a],f=d.type;if(f==`heatmap`){console.debug(`layers[${a}].type "${f}" not supported`);continue}else u=d.source||GS(o,d.ref),(!u||u!=l)&&(s.length&&(i.push(dC(c,s,e,n,t,r)),s=[]),c=cC(e,n,d,r),c instanceof _y||c instanceof Gx||(s=[]),l=c.get(`mapbox-source`)),s.push(d.id)}return i.push(dC(c,s,e,n,t,r)),Promise.all(i)}function uC(e,t,n={}){let r,i;if(vt){if(!(e instanceof Zu)&&!(e instanceof xs))throw Error(`ol-mapbox-style in a web worker requires a Map or a LayerGroup as first argument`);i=e}else i=typeof e==`string`||e instanceof HTMLElement?new Zu({target:e}):e;if(typeof t==`string`){let e=t.startsWith(`data:`)?location.href:jy(t,n.accessToken);n=US(e,n),r=new Promise(function(r,a){Yy(t,n).then(function(t){lC(t,i,e,n).then(function(){r(i)}).catch(a)}).catch(function(e){a(Error(`Could not load ${t}: ${e.message}`))})})}else r=new Promise(function(e,r){lC(t,i,!n.styleUrl||n.styleUrl.startsWith(`data:`)?location.href:jy(n.styleUrl,n.accessToken),n).then(function(){e(i)}).catch(r)});return r}function dC(e,t,n,r,i,a={}){let o=24,s=0,c=n.layers;for(let e=0,n=c.length;e<n;++e){let n=c[e];t.indexOf(n.id)!==-1&&(o=Math.min(`minzoom`in n?n.minzoom:0,o),s=Math.max(`maxzoom`in n?n.maxzoom:24,s))}return new Promise(function(c,l){let u=function(){let u=e.getSource();if(!u||u.getState()===`error`){l(Error(`Error accessing data for source `+e.get(`mapbox-source`)));return}if(`getTileGrid`in u){let t=u.getTileGrid();if(t){let n=t.getMinZoom();(o>0||n>0)&&e.setMaxResolution(Math.min(Ky(Math.max(0,o-1e-12),Uy),Ky(Math.max(0,n-1e-12),t.getResolutions()))),s<24&&e.setMinResolution(Ky(s,Uy))}}else o>0&&e.setMaxResolution(Ky(Math.max(0,o-1e-12),Uy));u instanceof Ov||u instanceof RS?WS(e,n,t,Object.assign({styleUrl:r},a)).then(function(){sC(e,i),c()}).catch(l):c()};e.set(`mapbox-layers`,t);let d=i.getLayers();d.getArray().indexOf(e)===-1&&d.push(e),e.getSource()?u():e.once(`change:source`,u)})}function fC(e,t){return e.get(`mapbox-style`).layers.find(function(e){return e.id===t})}function pC(e,t,n){let r=e.get(`mapbox-style`),i=r.layers,a,o=-1;if(n!==void 0){let t=fC(e,n);if(t===void 0)throw Error(`Layer with id "${n}" not found.`);a=i.indexOf(t)}else a=i.length;let s;if(a>0&&i[a-1].source===t.source?(o=a-1,s=-1):a<i.length&&i[a].source===t.source&&(o=a,s=0),o===-1){let{options:o,styleUrl:s}=e.get(`mapbox-metadata`),c=cC(r,s,t,o);if(n){let t=gC(e,n),r=e.getLayers().getArray().indexOf(t);e.getLayers().insertAt(r,c)}return i.splice(a,0,t),dC(c,[t.id],r,s,e,o)}if(i.some(e=>e.id===t.id))throw Error(`Layer with id "${t.id}" already exists.`);let c=i[o].id,l=Tb[zy(e.get(`mapbox-style`),gC(e,c))];if(i.splice(a,0,t),l){let[e,n,r,i,a,o,u,d]=l;if(Array.isArray(r)){let e=r.indexOf(c)+s;r.splice(e,0,t.id)}Eb(e,n,r,i,a,o,u,d)}else gC(e,i[o].id).changed();return Promise.resolve()}function mC(e,t){let n=e.get(`mapbox-style`),r=n.layers,i=r.findIndex(function(e){return e.id===t.id});if(i===-1)throw Error(`Layer with id "${t.id}" not found.`);if(r[i].source!==t.source)throw Error(`Updated layer and previous version must use the same source.`);delete By(n)[t.id],delete Vy(n)[t.id],r[i]=t;let a=Tb[zy(e.get(`mapbox-style`),gC(e,t.id))];if(a)return Eb.apply(void 0,a),Promise.resolve();let o=gC(e,t.id),{options:s,styleUrl:c}=e.get(`mapbox-metadata`);return dC(o,[t.id],n,c,e,s)}function hC(e,t,n){let r=vC(e,t),i=e.getLayers().getArray().filter(function(e){return(e instanceof _y||e instanceof Vx||e instanceof Gx)&&e.getSource()===r}),a=e.get(`mapbox-metadata`),o;switch(n.type){case`vector`:o=XS(n,a.styleUrl,a.options);break;case`geojson`:o=Promise.resolve(rC(n,a.styleUrl,a.options));break;case`raster`:case`raster-dem`:o=$S(n,a.styleUrl,a.options);break;default:return Promise.reject(Error(`Unsupported source type `+n.type))}return o.then(function(e){i.forEach(function(t){t.setSource(e)})}),o}function gC(e,t){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e){let r=n[e].get(`mapbox-layers`);if(r&&r.indexOf(t)!==-1)return n[e]}}function _C(e,t){let n=[],r=e.getLayers().getArray();for(let e=0,i=r.length;e<i;++e)r[e].get(`mapbox-source`)===t&&n.push(r[e]);return n}function vC(e,t){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e){let r=n[e].getSource();if(n[e].get(`mapbox-source`)===t)return r}}function yC(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function bC(e,t,n,r,i,a,o){o??=yC();let s=1/(e-t),c=1/(n-r),l=1/(i-a);return o[0]=-2*s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(e+t)*s,o[13]=(r+n)*c,o[14]=(a+i)*l,o[15]=1,o}function xC(e,t,n,r,i){return i??=yC(),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*n,i[5]=e[5]*n,i[6]=e[6]*n,i[7]=e[7]*n,i[8]=e[8]*r,i[9]=e[9]*r,i[10]=e[10]*r,i[11]=e[11]*r,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function SC(e,t,n,r,i){i??=yC();let a,o,s,c,l,u,d,f,p,m,h,g;return e===i?(i[12]=e[0]*t+e[4]*n+e[8]*r+e[12],i[13]=e[1]*t+e[5]*n+e[9]*r+e[13],i[14]=e[2]*t+e[6]*n+e[10]*r+e[14],i[15]=e[3]*t+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],s=e[2],c=e[3],l=e[4],u=e[5],d=e[6],f=e[7],p=e[8],m=e[9],h=e[10],g=e[11],i[0]=a,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=g,i[12]=a*t+l*n+p*r+e[12],i[13]=o*t+u*n+m*r+e[13],i[14]=s*t+d*n+h*r+e[14],i[15]=c*t+f*n+g*r+e[15]),i}function CC(e,t,n,r){return r??=yC(),r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e,r[13]=t,r[14]=n,r[15]=1,r}var wC=`
|
|
1
|
+
var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,h=globalThis,g=h.trustedTypes,_=g?g.emptyScript:``,v=h.reactiveElementPolyfillSupport,y=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?_:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},x=(e,t)=>!l(e,t),S={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol(`metadata`),h.litPropertyMetadata??=new WeakMap;var C=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=S){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){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??S}static _$Ei(){if(this.hasOwnProperty(y(`elementProperties`)))return;let e=m(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n: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(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?b:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?b:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??x)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),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.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};C.elementStyles=[],C.shadowRootOptions={mode:`open`},C[y(`elementProperties`)]=new Map,C[y(`finalized`)]=new Map,v?.({ReactiveElement:C}),(h.reactiveElementVersions??=[]).push(`2.1.2`);var w=globalThis,T=e=>e,E=w.trustedTypes,D=E?E.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,O=`$lit$`,k=`lit$${Math.random().toFixed(9).slice(2)}$`,A=`?`+k,ee=`<${A}>`,j=document,M=()=>j.createComment(``),te=e=>e===null||typeof e!=`object`&&typeof e!=`function`,ne=Array.isArray,re=e=>ne(e)||typeof e?.[Symbol.iterator]==`function`,ie=`[
|
|
2
|
+
\f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ae=/-->/g,oe=/>/g,se=RegExp(`>|${ie}(?:([^\\s"'>=/]+)(${ie}*=${ie}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ce=/'/g,le=/"/g,ue=/^(?:script|style|textarea|title)$/i,de=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),fe=Symbol.for(`lit-noChange`),pe=Symbol.for(`lit-nothing`),me=new WeakMap,he=j.createTreeWalker(j,129);function ge(e,t){if(!ne(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return D===void 0?t:D.createHTML(t)}var _e=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=N;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===N?c[1]===`!--`?o=ae:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=se):(ue.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=se):o=oe:o===se?c[0]===`>`?(o=i??N,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?se:c[3]===`"`?le:ce):o===le||o===ce?o=se:o===ae||o===oe?o=N:(o=se,i=void 0);let d=o===se&&e[t+1].startsWith(`/>`)?` `:``;a+=o===N?n+ee:l>=0?(r.push(s),n.slice(0,l)+O+n.slice(l)+k+d):n+k+(l===-2?t:d)}return[ge(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},ve=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=_e(t,n);if(this.el=e.createElement(l,r),he.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=he.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(O)){let t=u[o++],n=i.getAttribute(e).split(k),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ce:r[1]===`?`?we:r[1]===`@`?Te:Se}),i.removeAttribute(e)}else e.startsWith(k)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ue.test(i.tagName)){let e=i.textContent.split(k),t=e.length-1;if(t>0){i.textContent=E?E.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],M()),he.nextNode(),c.push({type:2,index:++a});i.append(e[t],M())}}}else if(i.nodeType===8){if(i.data===A)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(k,e+1))!==-1;)c.push({type:7,index:a}),e+=k.length-1}}a++}}static createElement(e,t){let n=j.createElement(`template`);return n.innerHTML=e,n}};function ye(e,t,n=e,r){if(t===fe)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=te(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=ye(e,i._$AS(e,t.values),i,r)),t}var be=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){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);he.currentNode=r;let i=he.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new xe(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Ee(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=he.nextNode(),a++)}return he.currentNode=j,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},xe=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=pe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ye(this,e,t),te(e)?e===pe||e==null||e===``?(this._$AH!==pe&&this._$AR(),this._$AH=pe):e!==this._$AH&&e!==fe&&this._(e):e._$litType$===void 0?e.nodeType===void 0?re(e)?this.k(e):this._(e):this.T(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!==pe&&te(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=ve.createElement(ge(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new be(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=me.get(e.strings);return t===void 0&&me.set(e.strings,t=new ve(e)),t}k(t){ne(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(M()),this.O(M()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=T(e).nextSibling;T(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Se=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=pe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=pe}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=ye(this,e,t,0),a=!te(e)||e!==this._$AH&&e!==fe,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=ye(this,r[n+o],t,o),s===fe&&(s=this._$AH[o]),a||=!te(s)||s!==this._$AH[o],s===pe?e=pe:e!==pe&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===pe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ce=class extends Se{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===pe?void 0:e}},we=class extends Se{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==pe)}},Te=class extends Se{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=ye(this,e,t,0)??pe)===fe)return;let n=this._$AH,r=e===pe&&n!==pe||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==pe&&(n===pe||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ee=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ye(this,e)}};(0,w.litHtmlPolyfillSupport)?.(ve,xe),(w.litHtmlVersions??=[]).push(`3.3.2`);var De=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new xe(t.insertBefore(M(),e),e,void 0,n??{})}return i._$AI(e),i},Oe=globalThis,ke=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=De(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return fe}};ke._$litElement$=!0,ke.finalized=!0,Oe.litElementHydrateSupport?.({LitElement:ke}),(0,Oe.litElementPolyfillSupport)?.({LitElement:ke}),(Oe.litElementVersions??=[]).push(`4.2.2`);var Ae=`:root,:host{--ol-background-color:white;--ol-accent-background-color:#f5f5f5;--ol-subtle-background-color:#80808040;--ol-partial-background-color:#ffffffbf;--ol-foreground-color:#333;--ol-subtle-foreground-color:#666;--ol-brand-color:#0af}.ol-box{box-sizing:border-box;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color);border-radius:2px}.ol-mouse-position{position:absolute;top:8px;right:8px}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;padding:2px;position:absolute;bottom:8px;left:8px}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-align:center;will-change:contents, width;border-top:none;margin:1px;font-size:10px;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{background-color:var(--ol-foreground-color);float:right;z-index:10;width:1px;height:15px}.ol-scale-step-text{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);font-size:10px;position:absolute;bottom:-5px}.ol-scale-text{text-align:center;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);font-size:12px;position:absolute;bottom:25px}.ol-scale-singlebar{z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color);height:10px;position:relative}.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;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;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{background-color:var(--ol-subtle-background-color);border-radius:4px;position:absolute}.ol-zoom{top:.5em;left:.5em}.ol-rotate{transition:opacity .25s linear,visibility linear;top:.5em;right:.5em}.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{top:.5em;right:.5em}.ol-control button{color:var(--ol-subtle-foreground-color);font-weight:700;font-size:inherit;text-align:center;background-color:var(--ol-background-color);border:none;border-radius:2px;width:1.375em;height:1.375em;margin:1px;padding:0;line-height:.4em;text-decoration:none;display:block}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{will-change:transform;font-weight:400;display:block}.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{outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-decoration:none}.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;flex-flow:row-reverse;align-items:center;max-width:calc(100% - 1.3em);display:flex;bottom:.5em;right:.5em}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);margin:0;padding:1px .5em;font-size:12px}.ol-attribution li{list-style:none;display:inline}.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{border-radius:4px 0 0;bottom:0;right:0}.ol-attribution.ol-uncollapsible img{max-height:1.6em;margin-top:-.2em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{height:200px;top:4.5em;left:.5em}.ol-zoomslider button{height:10px;position:relative}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{bottom:.5em;left:.5em}.ol-overviewmap.ol-uncollapsible{border-radius:0 4px 0 0;bottom:0;left:0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);width:150px;height:150px}.ol-overviewmap:not(.ol-collapsed) button{position:absolute;bottom:0;left:0}.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}`,je=`.layer-control{bottom:.5em;left:.5em}.layer-control>button{cursor:pointer;justify-content:center;align-items:center;display:flex}.svgContainer{width:22px;height:22px;scale:.8}.ol-touch .ol-control button>.svgContainer{scale:1.2}.layer-selection{z-index:10;background-color:#fff;border:1px solid #ccc;border-radius:4px;align-items:center;padding:10px 0 10px 10px;display:flex;position:absolute;bottom:0}.layer-selection.fade-out{opacity:0;transition:opacity .15s ease-out}.layer-selection.hidden{display:none}.image-box{cursor:pointer;text-align:center;border:2px solid #bdbdbd;border-radius:4px;width:100px;height:100px;margin-right:10px}.image-box.selected{border:2px solid #474747}.image-box:hover{box-shadow:0 0 6px #949494}.image-box img{pointer-events:none;object-fit:cover;border-radius:4px;width:100px;height:100px}`,Me={ADD:`add`,REMOVE:`remove`},Ne={PROPERTYCHANGE:`propertychange`};function Pe(e){for(let t in e)delete e[t]}function Fe(e){let t;for(t in e)return!1;return!t}function P(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function Ie(e,t,n,r){return P(e,t,n,r,!0)}function Le(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Pe(e))}var F={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,KEYUP:`keyup`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},Re=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function ze(e,t,n){let r,i;n||=Be;let a=0,o=e.length,s=!1;for(;a<o;)r=a+(o-a>>1),i=+n(e[r],t),i<0?a=r+1:(o=r,s=!i);return s?a:~a}function Be(e,t){return e>t?1:e<t?-1:0}function Ve(e,t){return e<t?1:e>t?-1:0}function He(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Ue(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function We(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function Ge(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Ke(e,t,n){let r=t||Be;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function I(){throw Error(`Unimplemented abstract method.`)}var qe=0;function L(e){let t=e;return t.ol_uid||=String(++qe)}function Je(e){return!!e&&typeof e.then==`function`&&typeof e.catch==`function`}function Ye(){return!0}function Xe(){return!1}function Ze(){}function Qe(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return n&&this===r&&Ge(i,n)||(r=this,n=i,t=e.apply(this,i)),t}}function $e(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return Je(t)?t:Promise.resolve(t)}return t()}var et=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},tt=class extends Re{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new et(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,Ze);delete a[n]}return s}disposeInternal(){this.listeners_&&Pe(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;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=Ze,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},nt=class extends tt{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(F.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=P(this,e[i],t);return r}return P(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=Ie(this,e[i],t)}else n=Ie(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)rt(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};nt.prototype.on,nt.prototype.once,nt.prototype.un;function rt(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)Le(e[t]);else Le(e)}var it=class extends et{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},at=class extends nt{constructor(e){super(),this.on,this.once,this.un,L(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 n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new it(n,e,t)),n=Ne.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new it(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],Fe(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},ot={LENGTH:`length`},st=class extends et{constructor(e,t,n){super(e),this.element=t,this.index=n}},ct=class extends at{constructor(e,t){if(super(),this.on,this.once,this.un,t||={},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let e=1,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(ot.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new st(Me.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new st(Me.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new st(Me.REMOVE,n,e)),this.dispatchEvent(new st(Me.ADD,t,e))}updateLength_(){this.set(ot.LENGTH,this.array_.length)}assertUnique_(e,t){let n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e&&r!==t)throw Error(`Duplicate item added to a unique collection`)}},lt=class extends et{constructor(e,t,n){super(e),this.map=t,this.frameState=n===void 0?null:n}},ut=class extends lt{constructor(e,t,n,r,i,a){super(e,t,i),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0&&r,this.activePointers=a,this.ctrlKey=!1}get pixel(){return this.pixel_||=this.map.getEventPixel(this.originalEvent),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return 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()}},R={SINGLECLICK:`singleclick`,CLICK:F.CLICK,DBLCLICK:F.DBLCLICK,POINTERDRAG:`pointerdrag`,POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},dt=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``;dt.includes(`safari`)&&!dt.includes(`chrom`)&&(dt.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(dt));var ft=dt.includes(`webkit`)&&!dt.includes(`edge`),pt=dt.includes(`macintosh`),mt=typeof devicePixelRatio<`u`?devicePixelRatio:1,ht=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,gt=typeof Image<`u`&&Image.prototype.decode,_t=typeof createImageBitmap==`function`,vt=(function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})(),yt={POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},bt=class extends tt{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;let n=this.map_.getViewport();if(!n)throw Error(`Map viewport is required`);this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=P(n,yt.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=P(n,yt.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(F.TOUCHMOVE,this.boundHandleTouchMove_,vt?{passive:!1}:!1)}emulateClick_(e){let t=new ut(R.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_===void 0?this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let t=new ut(R.SINGLECLICK,this.map_,e);this.dispatchEvent(t)},250):(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new ut(R.DBLCLICK,this.map_,e),this.dispatchEvent(t))}updateActivePointers_(e){let t=e,n=t.pointerId;if(t.type==R.POINTERUP||t.type==R.POINTERCANCEL){delete this.trackedTouches_[n];for(let e in this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else(t.type==R.POINTERDOWN||t.type==R.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new ut(R.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.down_&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Le),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);let t=new ut(R.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){let e=this.map_.getOwnerDocument(),t=this.element_;if(!t)return;if(this.dragListenerKeys_.push(P(e,R.POINTERMOVE,this.handlePointerMove_,this),P(e,R.POINTERUP,this.handlePointerUp_,this),P(t,R.POINTERCANCEL,this.handlePointerUp_,this)),t.getRootNode&&t.getRootNode()!==e){let e=t.getRootNode();this.dragListenerKeys_.push(P(e,R.POINTERUP,this.handlePointerUp_,this))}}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new ut(R.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new ut(R.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let t=this.originalPointerMoveEvent_;t&&!t.defaultPrevented||typeof e.cancelable==`boolean`&&e.cancelable!==!0||e.preventDefault()}isMoving_(e){let t=this.down_;return this.dragging_||t!==null&&(Math.abs(e.clientX-t.clientX)>this.moveTolerance_||Math.abs(e.clientY-t.clientY)>this.moveTolerance_)}disposeInternal(){let e=this.element_;this.relayedListenerKey_&&=(Le(this.relayedListenerKey_),void 0),e&&e.removeEventListener(F.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&=(Le(this.pointerdownListenerKey_),void 0),this.dragListenerKeys_.forEach(Le),this.dragListenerKeys_.length=0,this.element_=void 0,super.disposeInternal()}},xt={POSTRENDER:`postrender`,MOVESTART:`movestart`,MOVEEND:`moveend`,LOADSTART:`loadstart`,LOADEND:`loadend`},St={LAYERGROUP:`layergroup`,SIZE:`size`,TARGET:`target`,VIEW:`view`},z={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function B(e,t){if(!e)throw Error(t)}var Ct=1/0,wt=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Pe(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let r=this.keyFunction_(n);return delete this.queuedElements_[r],n}enqueue(e){B(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let t=this.priorityFunction_(e);return t!=1/0&&(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}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){let t=this.elements_,n=this.priorities_,r=t.length,i=t[e],a=n[e],o=e;for(;e<r>>1;){let i=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),o=a<r&&n[a]<n[i]?a:i;t[e]=t[o],n[e]=n[o],e=o}t[e]=i,n[e]=a,this.siftDown_(o,e)}siftDown_(e,t){let n=this.elements_,r=this.priorities_,i=n[t],a=r[t];for(;t>e;){let e=this.getParentIndex_(t);if(r[e]>a)n[t]=n[e],r[t]=r[e],t=e;else break}n[t]=i,r[t]=a}reprioritize(){let e=this.priorityFunction_,t=this.elements_,n=this.priorities_,r=0,i=t.length,a,o,s;for(o=0;o<i;++o)a=t[o],s=e(a),s==1/0?delete this.queuedElements_[this.keyFunction_(a)]:(n[r]=s,t[r++]=a);t.length=r,n.length=r,this.heapify_()}},Tt=class extends wt{constructor(e,t){super(t=>e.apply(null,t),e=>e[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);return t&&e[0].addEventListener(F.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,n=t.getState();if(n===z.LOADED||n===z.ERROR||n===z.EMPTY){n!==z.ERROR&&t.removeEventListener(F.CHANGE,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0;for(;this.tilesLoading_<e&&n<t&&this.getCount()>0;){let e=this.dequeue()[0],t=e.getKey();e.getState()===z.IDLE&&!(t in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[t]=!0,++this.tilesLoading_,++n,e.load())}}};function Et(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return Ct;let a=e.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}var Dt={ANIMATING:0,INTERACTING:1},Ot={CENTER:`center`,RESOLUTION:`resolution`,ROTATION:`rotation`};function kt(e,t,n){return Math.min(Math.max(e,t),n)}function At(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return jt(e,t,n,r)}function jt(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function Mt(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function Nt(e){return e*180/Math.PI}function Pt(e){return e*Math.PI/180}function Ft(e,t){let n=e%t;return n*t<0?n+t:n}function It(e,t,n){return e+n*(t-e)}function Lt(e,t){let n=10**t;return Math.round(e*n)/n}function Rt(e,t){return Math.floor(Lt(e,t))}function zt(e,t){return Math.ceil(Lt(e,t))}function Bt(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}function Vt(e,t,n){return(function(r,i,a,o,s){if(!r)return;if(!i&&!t)return r;let c=t?0:a[0]*(i??0),l=t?0:a[1]*(i??0),u=s?s[0]:0,d=s?s[1]:0,f=e[0]+c/2+u,p=e[2]-c/2+u,m=e[1]+l/2+d,h=e[3]-l/2+d;f>p&&(f=(p+f)/2,p=f),m>h&&(m=(h+m)/2,h=m);let g=kt(r[0],f,p),_=kt(r[1],m,h);if(o&&n&&i){let e=30*i;g+=-e*Math.log(1+Math.max(0,f-r[0])/e)+e*Math.log(1+Math.max(0,r[0]-p)/e),_+=-e*Math.log(1+Math.max(0,m-r[1])/e)+e*Math.log(1+Math.max(0,r[1]-h)/e)}return[g,_]})}function Ht(e){return e}var Ut={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Wt(e){let t=$t();for(let n=0,r=e.length;n<r;++n)sn(t,e[n]);return t}function Gt(e,t,n){return en(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}function Kt(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function qt(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function Jt(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function Yt(e,t){return Zt(e,t[0],t[1])}function Xt(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function Zt(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function Qt(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=Ut.UNKNOWN;return o<n?c|=Ut.LEFT:o>i&&(c|=Ut.RIGHT),s<r?c|=Ut.BELOW:s>a&&(c|=Ut.ABOVE),c===Ut.UNKNOWN&&(c=Ut.INTERSECTING),c}function $t(){return[1/0,1/0,-1/0,-1/0]}function en(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function tn(e){return en(1/0,1/0,-1/0,-1/0,e)}function nn(e,t){let n=e[0],r=e[1];return en(n,r,n,r,t)}function rn(e,t,n,r,i){return cn(tn(i),e,t,n,r)}function an(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function on(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function sn(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function cn(e,t,n,r,i){for(;n<r;n+=i)ln(e,t[n],t[n+1]);return e}function ln(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function un(e,t){let n;return n=t(fn(e)),n||(n=t(pn(e)),n)||(n=t(Sn(e)),n)||(n=t(xn(e)),n)?n:!1}function dn(e){let t=0;return wn(e)||(t=V(e)*vn(e)),t}function fn(e){return[e[0],e[1]]}function pn(e){return[e[2],e[1]]}function mn(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function hn(e,t){let n;if(t===`bottom-left`)n=fn(e);else if(t===`bottom-right`)n=pn(e);else if(t===`top-left`)n=xn(e);else if(t===`top-right`)n=Sn(e);else throw Error(`Invalid corner`);return n}function gn(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=_n(e,t,n,r);return en(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function _n(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function vn(e){return e[3]-e[1]}function yn(e,t,n){let r=n||$t();return Cn(e,t)?(r[0]=e[0]>t[0]?e[0]:t[0],r[1]=e[1]>t[1]?e[1]:t[1],r[2]=e[2]<t[2]?e[2]:t[2],r[3]=e[3]<t[3]?e[3]:t[3]):tn(r),r}function bn(e,t){if(!Cn(e,t))return[e.slice()];if(Xt(t,e))return[];let[n,r,i,a]=e,o=Math.max(n,t[0]),s=Math.max(r,t[1]),c=Math.min(i,t[2]),l=Math.min(a,t[3]),u=[];return o>n&&u.push([n,r,o,a]),c<i&&u.push([c,r,i,a]),s>r&&u.push([o,r,c,s]),l<a&&u.push([o,l,c,a]),u}function xn(e){return[e[0],e[3]]}function Sn(e){return[e[2],e[3]]}function V(e){return e[2]-e[0]}function Cn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function wn(e){return e[2]<e[0]||e[3]<e[1]}function Tn(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function En(e,t,n){let r=!1,i=Qt(e,t),a=Qt(e,n);if(i===Ut.INTERSECTING||a===Ut.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&Ut.ABOVE&&!(i&Ut.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&Ut.RIGHT&&!(i&Ut.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&Ut.BELOW&&!(i&Ut.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&Ut.LEFT&&!(i&Ut.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function Dn(e,t,n,r){if(wn(e))return tn(n);let i=[];if(r!==void 0&&r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a<r;++a)i.push(e[0]+t*a/r,e[1],e[2],e[1]+n*a/r,e[2]-t*a/r,e[3],e[0],e[3]-n*a/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let a=[],o=[];for(let e=0,t=i.length;e<t;e+=2)a.push(i[e]),o.push(i[e+1]);return Gt(a,o,n)}function On(e,t){let n=t.getExtent(),r=mn(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=V(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function kn(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];On(e,t);let i=V(r);if(V(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function An(e,t){let n=[e];for(let e=0,r=t.length;e<r&&n.length>0;++e){let r=[];for(let i=0,a=n.length;i<a;++i)r.push(...bn(n[i],t[e]));n=r}return n}function jn(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function Mn(e,t){let n=e[0],r=e[1],i=t[0],a=t[1],o=i[0],s=i[1],c=a[0],l=a[1],u=c-o,d=l-s,f=u===0&&d===0?0:(u*(n-o)+d*(r-s))/(u*u+d*d||0),p,m;return f<=0?(p=o,m=s):f>=1?(p=c,m=l):(p=o+f*u,m=s+f*d),[p,m]}function Nn(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Pn(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function Fn(e,t){return e[0]*=t,e[1]*=t,e}function In(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Ln(e,t){return Math.sqrt(In(e,t))}function Rn(e,t){return In(e,Mn(e,t))}function zn(e,t){if(t.canWrapX()){let n=V(t.getExtent()),r=Vn(e,t,n);r&&(e[0]-=r*n)}return e}function Bn(e,t,n){if(t.canWrapX()){let r=V(t.getExtent()),i=Math.round((n-e[0])/r);i!==0&&(e[0]+=i*r)}return e}function Vn(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n||=V(r),i=Math.floor((e[0]-r[0])/n)),i}function Hn(e,t,n){let r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=[(t[0]-e[0])/r,(t[1]-e[1])/r],a=[-i[1],i[0]],o=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),s=[(n[0]-e[0])/o,(n[1]-e[1])/o],c=r===0||o===0?0:Math.acos(kt(s[0]*i[0]+s[1]*i[1],-1,1));return c=Math.max(c,1e-5),s[0]*a[0]+s[1]*a[1]>0?c:Math.PI*2-c}function Un(e){return e**3}function Wn(e){return 1-Un(1-e)}function Gn(e){return 3*e*e-2*e*e*e}function Kn(e){return e}function qn(e,t,n){n||=6371008.8;let r=Pt(e[1]),i=Pt(t[1]),a=(i-r)/2,o=Pt(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}var Jn={info:1,warn:2,error:3,none:4},Yn=Jn.info;function Xn(...e){Yn>Jn.warn||console.warn(...e)}var Zn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},Qn=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global!==void 0&&e.global,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_||Zn[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_}},$n=6378137,er=Math.PI*$n,tr=[-er,-er,er,er],nr=[-180,-85,180,85],rr=$n*Math.log(Math.tan(Math.PI/2)),ir=class extends Qn{constructor(e){super({code:e,units:`m`,extent:tr,global:!0,worldExtent:nr,getPointResolution:function(e,t){return e/Math.cosh(t[1]/$n)}})}},ar=[new ir(`EPSG:3857`),new ir(`EPSG:102100`),new ir(`EPSG:102113`),new ir(`EPSG:900913`),new ir(`http://www.opengis.net/def/crs/EPSG/0/3857`),new ir(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function or(e,t,n,r){let i=e.length;n=n!==void 0&&n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=er*e[n]/180;let r=$n*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>rr?r=rr:r<-rr&&(r=-rr),t[n+1]=r}return t}function sr(e,t,n,r){let i=e.length;n=n!==void 0&&n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/er,t[n+1]=360*Math.atan(Math.exp(e[n+1]/$n))/Math.PI-90;return t}var cr=6378137,lr=[-180,-90,180,90],ur=Math.PI*cr/180,dr=class extends Qn{constructor(e,t){super({code:e,units:`degrees`,extent:lr,axisOrientation:t,global:!0,metersPerUnit:ur,worldExtent:lr})}},fr=[new dr(`CRS:84`),new dr(`EPSG:4326`,`neu`),new dr(`urn:ogc:def:crs:OGC:1.3:CRS84`),new dr(`urn:ogc:def:crs:OGC:2:84`),new dr(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new dr(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new dr(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],pr={};function mr(e){return pr[e]||pr[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function hr(e,t){pr[e]=t}var gr={};function _r(e,t,n){let r=e.getCode(),i=t.getCode();r in gr||(gr[r]={}),gr[r][i]=n}function vr(e,t){return e in gr&&t in gr[e]?gr[e][t]:null}var yr=.9996,br=.00669438,xr=br*br,Sr=xr*br,Cr=br/.99330562,wr=Math.sqrt(.99330562),Tr=(1-wr)/(1+wr),Er=Tr*Tr,Dr=Er*Tr,Or=Dr*Tr,kr=Or*Tr,Ar=1-br/4-3*xr/64-5*Sr/256,jr=.002514607064228144,Mr=26390466021299826e-22,Nr=35*Sr/3072,Pr=1.5*Tr-27/32*Dr+269/512*kr,Fr=21/16*Er-55/32*Or,Ir=151/96*Dr-417/128*kr,Lr=1097/512*Or,Rr=6378137;function zr(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/yr/(Rr*Ar),a=i+Pr*Math.sin(2*i)+Fr*Math.sin(4*i)+Ir*Math.sin(6*i)+Lr*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-br*s,p=Rr/Math.sqrt(1-br*s),m=.99330562/f,h=Cr*c**2,g=h*h,_=r/(p*yr),v=_*_,y=v*_,b=y*_,x=b*_,S=x*_,C=a-l/m*(v/2-b/24*(5+3*u+10*h-4*g-9*Cr))+S/720*(61+90*u+298*h+45*d-252*Cr-3*g),w=(_-y/6*(1+2*u+h)+x/120*(5-2*h+28*u-3*g+8*Cr+24*d))/c;return w=Bt(w+Pt(Gr(n.number)),-Math.PI,Math.PI),[Nt(w),Nt(C)]}var Br=-80,Vr=84,Hr=-180,Ur=180;function Wr(e,t,n){e=Bt(e,Hr,Ur),t<Br?t=Br:t>Vr&&(t=Vr);let r=Pt(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=Pt(e),u=Pt(Gr(n.number)),d=Rr/Math.sqrt(1-br*i**2),f=Cr*a**2,p=a*Bt(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=Rr*(Ar*r-jr*Math.sin(2*r)+Mr*Math.sin(4*r)-Nr*Math.sin(6*r)),b=yr*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*Cr))+5e5,x=yr*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*Cr)));return n.north||(x+=1e7),[b,x]}function Gr(e){return(e-1)*6-180+3}var Kr=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function qr(e){let t=0;for(let n of Kr){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function Jr(e,t){return function(n,r,i,a){let o=n.length;i=i!==void 0&&i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=e(n[i],n[i+1],t);r[i]=a[0],r[i+1]=a[1]}return r}}function Yr(e){return qr(e)?new Qn({code:e,units:`m`}):null}function Xr(e){let t=qr(e.getCode());return t?{forward:Jr(Wr,t),inverse:Jr(zr,t)}:null}var Zr=[Xr],Qr=[Yr],$r=!0;function ei(e){$r=!(e===void 0||e)}function ti(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function ni(e){hr(e.getCode(),e),_r(e,e,ti)}function ri(e){e.forEach(ni)}function H(e){if(typeof e!=`string`)return e===void 0?null:e;let t=mr(e);if(t)return t;for(let t of Qr){let n=t(e);if(n)return n}return null}function ii(e,t,n,r){let i=H(e);if(!i)return t;let a,o=i.getPointResolutionFunc();if(o){if(a=o(t,n),r&&r!==i.getUnits()){let e=i.getMetersPerUnit();e&&(a=a*e/Zn[r])}}else{let e=i.getUnits();if(e==`degrees`&&!r||r==`degrees`)a=t;else{let o=fi(i,H(`EPSG:4326`));if(!o&&e!==`degrees`)a=t*(i.getMetersPerUnit()??1);else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];o&&(e=o(e,e,2)),a=(qn(e.slice(0,2),e.slice(2,4))+qn(e.slice(4,6),e.slice(6,8)))/2}let s=r?Zn[r]:i.getMetersPerUnit();s!==void 0&&(a/=s)}}return a}function ai(e){ri(e),e.forEach(function(t){e.forEach(function(e){t!==e&&_r(t,e,ti)})})}function oi(e,t,n,r){e.forEach(function(e){t.forEach(function(t){_r(e,t,n),_r(t,e,r)})})}function si(e,t){return e?typeof e==`string`?H(e):e:H(t)}function ci(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function li(e,t){return ei(),hi(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function ui(e,t){let n=hi(e,t===void 0?`EPSG:3857`:t,`EPSG:4326`),r=n[0];return(r<-180||r>180)&&(n[0]=Ft(r+180,360)-180),n}function di(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||fi(e,t)===ti)&&n}function fi(e,t){if(!e||!t)return null;let n=e.getCode(),r=t.getCode(),i=vr(n,r);if(i)return i;let a=null,o=null;for(let n of Zr)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o&&a){let e=vr(s,r);e&&(i=pi(a.inverse,e))}else if(!a&&o){let e=vr(n,s);e&&(i=pi(e,o.forward))}else a&&o&&(i=pi(a.inverse,o.forward));return i&&(ni(e),ni(t),_r(e,t,i)),i}function pi(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function mi(e,t){return fi(H(e),H(t))}function hi(e,t,n){let r=mi(t,n);if(!r){let e=H(t)?.getCode()??String(t),r=H(n)?.getCode()??String(n);throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function gi(e,t,n,r){let i=mi(t,n);return i?Dn(e,i,void 0,r):e.slice()}var _i=null;function vi(){return _i}function yi(e,t){return e}function bi(e,t){return $r&&!Nn(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&($r=!1,Xn(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e}function xi(e,t){return e}function Si(e,t){return e}function Ci(e,t){return e}function wi(){ai(ar),ai(fr),oi(fr,ar,or,sr)}wi();var Ti=[1,0,0,1,0,0],Ei=[,,,,,,];function Di(){return Ti.slice(0)}function Oi(e){return Ai(e,1,0,0,1,0,0)}function ki(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return e[0]=n*c+i*l,e[1]=r*c+a*l,e[2]=n*u+i*d,e[3]=r*u+a*d,e[4]=n*f+i*p+o,e[5]=r*f+a*p+s,e}function Ai(e,t,n,r,i,a,o){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e}function ji(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Mi(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function Ni(e,t,n){return ki(e,Ai(Ei,t,0,0,n,0,0))}function Pi(e,t,n){return ki(e,Ai(Ei,1,0,0,1,t,n))}function Fi(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function Ii(e,t){let n=Li(t);B(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function Li(e){return e[0]*e[3]-e[1]*e[2]}var Ri=[1e5,1e5,1e5,1e5,2,2];function zi(e){return`matrix(`+e.join(`, `)+`)`}function Bi(e){return e.substring(7,e.length-1).split(`,`).map(parseFloat)}function Vi(e,t){let n=Bi(e),r=Bi(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*Ri[e])!==0)return!1;return!0}function Hi(e,t,n,r,i,a,o){a||=[],o||=2;let s=0;for(let c=t;c<n;c+=r){let t=e[c],n=e[c+1];a[s++]=i[0]*t+i[2]*n+i[4],a[s++]=i[1]*t+i[3]*n+i[5];for(let t=2;t<o;t++)a[s++]=e[c+t]}return a&&a.length!=s&&(a.length=s),a}function Ui(e,t,n,r,i,a,o){o||=[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function Wi(e,t,n,r,i,a,o,s){s||=[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function Gi(e,t,n,r,i,a,o){o||=[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}var Ki=Di(),qi=[NaN,NaN],Ji=class extends at{constructor(){super(),this.extent_=$t(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Qe((e,t,n)=>{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return I()}closestPointXY(e,t,n,r){return I()}containsXY(e,t){return this.closestPointXY(e,t,qi,Number.MIN_VALUE)===0}getClosestPoint(e,t){return 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 I()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&tn(e),this.extentRevision_=this.getRevision()}return Tn(this.extent_,e)}rotate(e,t){I()}scale(e,t,n){I()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return I()}getType(){return I()}applyTransform(e){I()}intersectsExtent(e){return I()}translate(e,t){I()}transform(e,t){let n=H(e);if(!n)return this;let r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=vn(o)/vn(a);Fi(Ki,o[0],o[3],s,-s,0,0,0);let c=Hi(e,0,e.length,i,Ki,r),l=mi(n,t);return l?l(c,c,i):c}:mi(n,t);return r&&this.applyTransform(r),this}},Yi=class extends Ji{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return rn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return I()}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;let 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=Zi(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){I()}setLayout(e,t,n){let r;if(e)r=Zi(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=Xi(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){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Ui(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||=mn(this.getExtent());let r=this.getFlatCoordinates();if(r){let i=this.getStride();Wi(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Gi(n,0,n.length,r,e,t,n),this.changed()}}};function Xi(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function Zi(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function Qi(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return Hi(r,0,r.length,i,t,n)}function $i(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1],s=0,c=0;for(;t<n;t+=r){let n=e[t]-a,r=e[t+1]-o;i+=c*n-s*r,s=n,c=r}return i/2}function ea(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=$i(e,t,o,r),t=o}return i}function ta(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=ea(e,t,o,r),t=o[o.length-1]}return i}function na(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=It(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function ra(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=jt(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function ia(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=ra(e,t,o,r,i),t=o}return i}function aa(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=ia(e,t,o,r,i),t=o[o.length-1]}return i}function oa(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=jt(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u||=[NaN,NaN];let p=t+r;for(;p<n;)if(na(e,p-r,p,r,o,s,u),f=jt(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(na(e,n-r,t,r,o,s,u),f=jt(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}function sa(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=oa(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function ca(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=sa(e,t,f,r,i,a,o,s,c,l,u),t=f[f.length-1]}return l}function la(e,t,n,r){for(let i=0;i<r;++i)e[t++]=n[i];return t}function ua(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function da(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=ua(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function fa(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=da(e,t,n[o],r,i[a]);s.length===0&&(s[0]=t),i[a++]=s,t=s[s.length-1]}return i.length=a,i}function pa(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function ma(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=pa(e,t,s,r,i[a]),t=s}return i.length=a,i}function ha(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:ma(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function ga(e,t,n,r,i){return!un(i,function(i){return!_a(e,t,n,r,i[0],i[1])})}function _a(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function va(e,t,n,r,i,a){if(n.length===0||!_a(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(_a(e,n[t-1],n[t],r,i,a))return!1;return!0}function ya(e,t,n,r,i,a){if(n.length===0)return!1;for(let o=0,s=n.length;o<s;++o){let s=n[o];if(va(e,t,s,r,i,a))return!0;t=s[s.length-1]}return!1}function ba(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function xa(e,t,n,r,i,a){return a??=cn($t(),e,t,n,r),Cn(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]||ba(e,t,n,r,function(e,t){return En(i,e,t)}):!1}function Sa(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){if(xa(e,t,n[a],r,i))return!0;t=n[a]}return!1}function Ca(e,t,n,r,i){return!!(xa(e,t,n,r,i)||_a(e,t,n,r,i[0],i[1])||_a(e,t,n,r,i[0],i[3])||_a(e,t,n,r,i[2],i[1])||_a(e,t,n,r,i[2],i[3]))}function wa(e,t,n,r,i){if(!Ca(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(ga(e,n[t-1],n[t],r,i)&&!xa(e,n[t-1],n[t],r,i))return!1;return!0}function Ta(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(wa(e,t,o,r,i))return!0;t=o[o.length-1]}return!1}function Ea(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=At(e[t],e[t+1],s,d,f,p);n>o&&(u=t,o=n)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function Da(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=Ea(e,t,l,r,i,a,o),s.push(o),t=l}return o}function Oa(e,t){return t*Math.round(e/t)}function ka(e,t,n,r,i,a,o){if(t==n)return o;let s=Oa(e[t],i),c=Oa(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=Oa(e[t],i),u=Oa(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=Oa(e[t],i),d=Oa(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)?(l=n,u=d):(a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d)}return a[o++]=l,a[o++]=u,o}function Aa(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=ka(e,t,l,r,i,a,o),s.push(o),t=l}return o}function ja(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c],u=[];o=Aa(e,t,l,r,i,a,o,u),s.push(u),t=l[l.length-1]}return o}var Ma=class e extends Yi{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 e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<Jt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return $i(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return pa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=Ea(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ua(this.flatCoordinates,0,e,this.stride),this.changed()}},Na=class e extends Yi{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=jt(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return nn(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return Zt(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||=[],this.flatCoordinates.length=la(this.flatCoordinates,0,e,this.stride),this.changed()}};function Pa(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m=i[a+1],h=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(u=e[a-r],f=e[a-r+1],s=t;s<a;s+=r)d=e[s],p=e[s+1],(m<=f&&p<=m||f<=m&&m<=p)&&(l=(m-f)/(p-f)*(d-u)+u,h.push(l)),u=d,f=p}let g=NaN,_=-1/0;for(h.sort(Be),u=h[0],s=1,c=h.length;s<c;++s){d=h[s];let i=Math.abs(d-u);i>_&&(l=(u+d)/2,va(e,t,n,r,l,m)&&(g=l,_=i)),u=d}return isNaN(g)&&(g=i[a]),o?(o.push(g,m,_),o):[g,m,_]}function Fa(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=Pa(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function Ia(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function La(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function Ra(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=La(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function za(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(!Ra(e,t,o,r,i))return!1;o.length&&(t=o[o.length-1])}return!0}function Ba(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=La(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&Ia(e,t,o,r),t=o}return t}function Va(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=Ba(e,t,n[a],r,i);return t}function Ha(e,t){let n=[],r=0,i=0,a;for(let o=0,s=t.length;o<s;++o){let s=t[o],c=La(e,r,s,2);if(a===void 0&&(a=c),c===a)n.push(t.slice(i,o+1));else{if(n.length===0)continue;n[n.length-1].push(t[i])}i=o+1,r=s}return n}var Ua=class e extends Yi{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?We(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Jt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ia(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return va(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),Ba(t,0,this.ends_,this.stride,e)),ma(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=mn(this.getExtent());this.flatInteriorPoint_=Pa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Na(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new Ma(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new Ma(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;Ra(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Ba(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=Aa(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return wa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=da(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function Wa(e){if(wn(e))throw Error(`Cannot create polygon from empty extent`);let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new Ua(a,`XY`,[a.length])}function Ga(e,t,n){t||=32;let r=e.getStride(),i=e.getLayout(),a=e.getCenter(),o=r*(t+1),s=Array(o);for(let e=0;e<o;e+=r){s[e]=0,s[e+1]=0;for(let t=2;t<r;t++)s[e+t]=a[t]}let c=new Ua(s,i,[s.length]);return Ka(c,a,e.getRadius(),n),c}function Ka(e,t,n,r){let i=e.getFlatCoordinates(),a=e.getStride(),o=i.length/a-1,s=r||0;for(let e=0;e<=o;++e){let r=e*a,c=s+Ft(e,o)*2*Math.PI/o;i[r]=t[0]+n*Math.cos(c),i[r+1]=t[1]+n*Math.sin(c)}e.changed()}function qa(e,t,n,r){let i=V(t)/n[0],a=vn(t)/n[1];return r?Math.min(e,Math.max(i,a)):Math.min(e,Math.min(i,a))}function Ja(e,t,n){let r=Math.min(e,t);return r*=Math.log(1+50*Math.max(0,e/t-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/e-1))/50+1),kt(r,n/2,t*2)}function Ya(e,t,n,r){return t=t===void 0||t,(function(i,a,o,s){if(i!==void 0){let c=e[0],l=e[e.length-1],u=n?qa(c,n,o,!!r):c;if(s)return t?Ja(i,u,l):kt(i,l,u);let d=Math.floor(He(e,Math.min(u,i),a));return e[d]>u&&d<e.length-1?e[d+1]:e[d]}})}function Xa(e,t,n,r,i,a){return r=r===void 0||r,n=n===void 0?0:n,(function(o,s,c,l){if(o!==void 0){let u=i?qa(t,i,c,!!a):t;if(l)return r?Ja(o,u,n):kt(o,n,u);let d=Math.ceil(Math.log(t/u)/Math.log(e)-1e-9),f=-s*.499999999+.5,p=Math.floor(Math.log(t/Math.min(u,o))/Math.log(e)+f);return kt(t/e**+Math.max(d,p),n,u)}})}function Za(e,t,n,r,i){return n=n===void 0||n,(function(a,o,s,c){if(a!==void 0){let o=r?qa(e,r,s,!!i):e;return!n||!c?kt(a,t,o):Ja(a,o,t)}})}function Qa(e){if(e!==void 0)return 0}function $a(e){if(e!==void 0)return e}function eo(e){let t=2*Math.PI/e;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function to(e){let t=e===void 0?Pt(5):e;return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}var no=0,ro=class extends at{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=si(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&&ei(),e.center&&(e.center=bi(e.center,this.projection_)),e.extent&&(e.extent=Si(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){let t=Object.assign({},e);for(let e in Ot)delete t[e];this.setProperties(t,!0);let n=oo(e);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=n.minZoom;let r=ao(e),i=n.constraint,a=so(e);this.constraints_={center:r,resolution:i,rotation:a},this.setRotation(e.rotation===void 0?0:e.rotation),this.setCenterInternal(e.center===void 0?null:e.center),e.resolution===void 0?e.zoom!==void 0&&this.setZoom(e.zoom):this.setResolution(e.resolution)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;let n=this.getCenterInternal();if(n){let r=e||[0,0,0,0];t||=[0,0,0,0];let i=this.getResolution(),a=i/2*(r[3]-t[3]+t[1]-r[1]),o=i/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([n[0]+a,n[1]-o])}}getUpdatedOptions_(e){let t=this.getProperties();return t.resolution===void 0?t.zoom=this.getZoom():t.resolution=this.getResolution(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let t=Array(arguments.length);for(let e=0;e<t.length;++e){let n=arguments[e];n.center&&(n=Object.assign({},n),n.center=bi(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=bi(n.anchor,this.getProjection())),t[e]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,n;t>1&&typeof arguments[t-1]==`function`&&(n=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){let e=arguments[r];e.center&&this.setCenterInternal(e.center),e.zoom===void 0?e.resolution&&this.setResolution(e.resolution):this.setZoom(e.zoom),e.rotation!==void 0&&this.setRotation(e.rotation)}if(r===t){n&&io(n,!0);return}let i=Date.now(),a=this.targetCenter_.slice(),o=this.targetResolution_,s=this.targetRotation_,c=[];for(;r<t;++r){let e=arguments[r],t={start:i,complete:!1,anchor:e.anchor,duration:e.duration===void 0?1e3:e.duration,easing:e.easing||Gn,callback:n};if(e.center&&(t.sourceCenter=a,t.targetCenter=e.center.slice(),a=t.targetCenter),e.zoom===void 0?e.resolution&&(t.sourceResolution=o,t.targetResolution=e.resolution,o=t.targetResolution):(t.sourceResolution=o,t.targetResolution=this.getResolutionForZoom(e.zoom),o=t.targetResolution),e.rotation!==void 0){t.sourceRotation=s;let n=Ft(e.rotation-s+Math.PI,2*Math.PI)-Math.PI;t.targetRotation=s+n,s=t.targetRotation}co(t)?t.complete=!0:i+=t.duration,c.push(t)}this.animations_.push(c),this.setHint(Dt.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Dt.ANIMATING]>0}getInteracting(){return this.hints_[Dt.INTERACTING]>0}cancelAnimations(){this.setHint(Dt.ANIMATING,-this.hints_[Dt.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t<n;++t){let n=this.animations_[t];if(n[0].callback&&io(n[0].callback,!1),!e)for(let t=0,r=n.length;t<r;++t){let r=n[t];if(!r.complete){e=r.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;let e=Date.now(),t=!1;for(let n=this.animations_.length-1;n>=0;--n){let r=this.animations_[n],i=!0;for(let n=0,a=r.length;n<a;++n){let a=r[n];if(a.complete)continue;let o=e-a.start,s=a.duration>0?o/a.duration:1;s>=1?(a.complete=!0,s=1):i=!1;let c=a.easing(s);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],n=a.targetCenter[0],r=a.targetCenter[1];this.nextCenter_=a.targetCenter;let i=e+c*(n-e),o=t+c*(r-t);this.targetCenter_=[i,o]}if(a.sourceResolution&&a.targetResolution){let e=c===1?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(n,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(a.sourceRotation!==void 0&&a.targetRotation!==void 0){let e=c===1?Ft(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(i){this.animations_[n]=null,this.setHint(Dt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=r[0].callback;e&&io(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n,r=this.getCenterInternal();return r!==void 0&&(n=[r[0]-t[0],r[1]-t[1]],Pn(n,e-this.getRotation()),jn(n,t)),n}calculateCenterZoom(e,t){let n,r=this.getCenterInternal(),i=this.getResolution();return r!==void 0&&i!==void 0&&(n=[t[0]-e*(t[0]-r[0])/i,t[1]-e*(t[1]-r[1])/i]),n}getViewportSize_(e){let t=this.viewportSize_;if(e){let n=t[0],r=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(n*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(){let e=this.getCenterInternal();return e&&yi(e,this.getProjection())}getCenterInternal(){return this.get(Ot.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get(`constrainResolution`)}getHints(e){return e===void 0?this.hints_.slice():(e[0]=this.hints_[0],e[1]=this.hints_[1],e)}calculateExtent(e){return xi(this.calculateExtentInternal(e),this.getProjection())}calculateExtentInternal(e){e||=this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();B(t,`The view center is not defined`);let n=this.getResolution();B(n!==void 0,`The view resolution is not defined`);let r=this.getRotation();return B(r!==void 0,`The view rotation is not defined`),gn(t,n,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(Ot.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(Si(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t||=this.getViewportSizeMinusPadding_();let n=V(e)/t[0],r=vn(e)/t[1];return Math.max(n,r)}getResolutionForValueFunction(e){e||=2;let t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(t/n)/Math.log(e);return(function(n){return t/e**+(n*r)})}getRotation(){return this.get(Ot.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/t;return(function(e){return Math.log(n/e)/t/i})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){let e=this.getViewportSizeMinusPadding_();r=lo(r,this.getViewportSize_(),[e[0]/2+i[3],e[1]/2+i[0]],t,n)}return{center:r.slice(0),projection:e===void 0?null:e,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,r;if(this.resolutions_){let i=He(this.resolutions_,e,1);t=i,n=this.resolutions_[i],r=i==this.resolutions_.length-1?2:n/this.resolutions_[i+1]}else n=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(n/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];let t=kt(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/n**+kt(e-t,0,1)}return this.maxResolution_/this.zoomFactor_**+(e-this.minZoom_)}fit(e,t){let n;if(B(Array.isArray(e)||typeof e.getSimplifiedGeometry==`function`,"Invalid extent or geometry provided as `geometry`"),Array.isArray(e))B(!wn(e),"Cannot fit empty extent provided as `geometry`"),n=Wa(Si(e,this.getProjection()));else if(e.getType()===`Circle`){let t=Si(e.getExtent(),this.getProjection());n=Wa(t),n.rotate(this.getRotation(),mn(t))}else{let t=vi();n=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(n,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),n=Math.cos(t),r=Math.sin(-t),i=e.getFlatCoordinates(),a=e.getStride(),o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=a){let t=i[e]*n-i[e+1]*r,a=i[e]*r+i[e+1]*n;o=Math.min(o,t),s=Math.min(s,a),c=Math.max(c,t),l=Math.max(l,a)}return[o,s,c,l]}fitInternal(e,t){t||={};let n=t.size;n||=this.getViewportSizeMinusPadding_();let r=t.padding===void 0?[0,0,0,0]:t.padding,i=t.nearest!==void 0&&t.nearest,a;a=t.minResolution===void 0?t.maxZoom===void 0?0:this.getResolutionForZoom(t.maxZoom):t.minResolution;let o=this.rotatedExtentForGeometry(e),s=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);s=isNaN(s)?a:Math.max(s,a),s=this.getConstrainedResolution(s,+!i);let c=this.getRotation(),l=Math.sin(c),u=Math.cos(c),d=mn(o);d[0]+=(r[1]-r[3])/2*s,d[1]+=(r[0]-r[2])/2*s;let f=d[0]*u-d[1]*l,p=d[1]*u+d[0]*l,m=this.getConstrainedCenter([f,p],s),h=t.callback?t.callback:Ze;t.duration===void 0?(this.targetResolution_=s,this.targetCenter_=m,this.applyTargetState_(!1,!0),io(h,!0)):this.animateInternal({resolution:s,center:m,duration:t.duration,easing:t.easing},h)}centerOn(e,t,n){this.centerOnInternal(bi(e,this.getProjection()),t,n)}centerOnInternal(e,t,n){this.setCenterInternal(lo(e,t,n,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,n,r){let i,a=this.padding_;if(a&&e){let o=this.getViewportSizeMinusPadding_(-n),s=lo(e,r,[o[0]/2+a[3],o[1]/2+a[0]],t,n);i=[e[0]-s[0],e[1]-s[1]]}return i}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){let t=yi(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){let t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t&&=bi(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*e,0,r,n);t&&(this.targetCenter_=this.calculateCenterZoom(i,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(this.zoomFactor_**+-e,t)}adjustRotation(e,t){t&&=bi(t,this.getProjection()),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,n);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&bi(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){let n=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,0,i,n),o=this.constraints_.center(this.targetCenter_,a,i,n,this.calculateCenterShift(this.targetCenter_,a,r,i));this.get(Ot.ROTATION)!==r&&this.set(Ot.ROTATION,r),this.get(Ot.RESOLUTION)!==a&&(this.set(Ot.RESOLUTION,a),this.set(`zoom`,this.getZoom(),!0)),o&&this.get(Ot.CENTER)&&Nn(this.get(Ot.CENTER),o)||this.set(Ot.CENTER,o),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,n){e=e===void 0?200:e;let r=t||0,i=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,r,a),s=this.constraints_.center(this.targetCenter_,o,a,!1,this.calculateCenterShift(this.targetCenter_,o,i,a));e===0&&!this.cancelAnchor_?(this.targetResolution_=o,this.targetRotation_=i,this.targetCenter_=s,this.applyTargetState_()):(n||=e===0?this.cancelAnchor_:void 0,this.cancelAnchor_=void 0,this.getResolution()===o&&this.getRotation()===i&&this.getCenterInternal()&&Nn(this.getCenterInternal(),s)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:i,center:s,resolution:o,duration:e,easing:Wn,anchor:n})))}beginInteraction(){this.resolveConstraints(0),this.setHint(Dt.INTERACTING,1)}endInteraction(e,t,n){n&&=bi(n,this.getProjection()),this.endInteractionInternal(e,t,n)}endInteractionInternal(e,t,n){this.getInteracting()&&(this.setHint(Dt.INTERACTING,-1),this.resolveConstraints(e,t,n))}getConstrainedCenter(e,t){let n=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),n)}getConstrainedZoom(e,t){let n=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(n,t))}getConstrainedResolution(e,t){t||=0;let n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,n)}};function io(e,t){setTimeout(function(){e(t)},0)}function ao(e){if(e.extent!==void 0){let t=e.smoothExtentConstraint===void 0||e.smoothExtentConstraint;return Vt(e.extent,e.constrainOnlyCenter,t)}let t=si(e.projection,`EPSG:3857`);if(e.multiWorld!==!0&&t.isGlobal()){let e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Vt(e,!1,!1)}return Ht}function oo(e){let t,n,r,i=e.minZoom===void 0?no:e.minZoom,a=e.maxZoom===void 0?28:e.maxZoom,o=e.zoomFactor===void 0?2:e.zoomFactor,s=e.multiWorld!==void 0&&e.multiWorld,c=e.smoothResolutionConstraint===void 0||e.smoothResolutionConstraint,l=e.showFullExtent!==void 0&&e.showFullExtent,u=si(e.projection,`EPSG:3857`),d=u.getExtent(),f=e.constrainOnlyCenter,p=e.extent;if(!s&&!p&&u.isGlobal()&&(f=!1,p=d),e.resolutions!==void 0){let o=e.resolutions;n=o[i],r=o[a]===void 0?o[o.length-1]:o[a],t=e.constrainResolution?Ya(o,c,!f&&p,l):Za(n,r,c,!f&&p,l)}else{let s=(d?Math.max(V(d),vn(d)):360*Zn.degrees/u.getMetersPerUnit())/256/2**no,m=s/2**28;n=e.maxResolution,n===void 0?n=s/o**+i:i=0,r=e.minResolution,r===void 0&&(r=e.maxZoom===void 0?m:e.maxResolution===void 0?s/o**+a:n/o**+a),a=i+Math.floor(Math.log(n/r)/Math.log(o)),r=n/o**+(a-i),t=e.constrainResolution?Xa(o,n,r,c,!f&&p,l):Za(n,r,c,!f&&p,l)}return{constraint:t,maxResolution:n,minResolution:r,minZoom:i,zoomFactor:o}}function so(e){if(e.enableRotation===void 0||e.enableRotation){let t=e.constrainRotation;return t===void 0||t===!0?to():t===!1?$a:typeof t==`number`?eo(t):$a}return Qa}function co(e){return!(e.sourceCenter&&e.targetCenter&&!Nn(e.sourceCenter,e.targetCenter)||e.sourceResolution!==e.targetResolution||e.sourceRotation!==e.targetRotation)}function lo(e,t,n,r,i){let a=Math.cos(-i),o=Math.sin(-i),s=e[0]*a-e[1]*o,c=e[1]*a+e[0]*o;return s+=(t[0]/2-n[0])*r,c+=(n[1]-t[1]/2)*r,o=-o,[s*a-c*o,c*a+s*o]}var uo=`ol-hidden`,fo=`ol-unselectable`,po=`ol-control`,mo=`ol-collapsed`,ho=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*$`,`i`),go=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],_o={normal:400,bold:700},vo=function(e){let t=e.match(ho);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=go.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[go[e]]=typeof r==`string`?r.trim():r)}return isNaN(Number(n.weight))&&n.weight in _o&&(n.weight=_o[n.weight]),n.families=n.family.split(/,\s?/).map(e=>e.trim().replace(/^['"]|['"]$/g,``)),n};function yo(e,t,n,r){let i;return i=n&&n.length?n.shift():ht?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}var bo;function xo(){return bo||=yo(1,1),bo}function So(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function Co(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function wo(e){for(;e.lastChild;)e.lastChild.remove()}function To(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;i!==a&&(i?a?e.insertBefore(a,i):(e.removeChild(i),--r):e.appendChild(a))}}function Eo(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){let t=this.childNodes.indexOf(e);if(t===-1)throw Error(`Node to remove was not found`);return this.childNodes.splice(t,1),e},insertBefore:function(e,t){let n=this.childNodes.indexOf(t);if(n===-1)throw Error(`Reference node not found`);return this.childNodes.splice(n,0,e),e},style:{}},{get(e,t,n){return t===`firstElementChild`?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,n)}})}function Do(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas}var Oo=class extends at{constructor(e){super();let 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(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let e=0,t=this.listenerKeys.length;e<t;++e)Le(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=e,e){let t=this.target_??e.getOverlayContainerStopEvent();this.element&&t&&t.appendChild(this.element),this.render!==Ze&&this.listenerKeys.push(P(e,xt.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e==`string`?document.getElementById(e):e}},ko=class extends Oo{constructor(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,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible===void 0||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;let t=e.className===void 0?`ol-attribution`:e.className,n=e.tipLabel===void 0?`Attributions`:e.tipLabel,r=e.expandClassName===void 0?t+`-expand`:e.expandClassName,i=e.collapseLabel===void 0?`›`:e.collapseLabel,a=e.collapseClassName===void 0?t+`-collapse`:e.collapseClassName;typeof i==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=i,this.collapseLabel_.className=a):this.collapseLabel_=i;let o=e.label===void 0?`i`:e.label;typeof o==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=o,this.label_.className=r):this.label_=o;let s=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=n,this.toggleButton_.appendChild(s),this.toggleButton_.addEventListener(F.CLICK,this.handleClick_.bind(this),!1);let c=t+` `+fo+` `+po+(this.collapsed_&&this.collapsible_?` `+mo:``)+(this.collapsible_?``:` ol-uncollapsible`),l=this.element;l.className=c,l.appendChild(this.toggleButton_),l.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){let t=this.getMap();if(!t)return[];let n=t.getAllLayers(),r=new Set(n.flatMap(t=>t.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(e=>r.add(e)):r.add(this.attributions_)),!this.overrideCollapsible_){let e=!n.some(e=>e.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(e)}return Array.from(r)}async updateElement_(e){let t=this.element;if(!t)return;if(!e){this.renderedVisible_&&=(t.style.display=`none`,!1);return}let n=await Promise.all(this.collectSourceAttributions_(e).map(e=>$e(()=>e))),r=n.length>0;if(this.renderedVisible_!=r&&(t.style.display=r?``:`none`,this.renderedVisible_=r),!Ge(n,this.renderedAttributions_)){wo(this.ulElement_);for(let e=0,t=n.length;e<t;++e){let t=document.createElement(`li`);t.innerHTML=n[e],this.ulElement_.appendChild(t)}this.renderedAttributions_=n}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){let e=this.element;e&&(e.classList.toggle(mo),this.collapsed_?Co(this.collapseLabel_,this.label_):Co(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_)))}getCollapsible(){return this.collapsible_}setCollapsible(e){if(this.collapsible_===e)return;this.collapsible_=e;let t=this.element;t&&(t.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)}},Ao=class extends Oo{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target});let t=e.className===void 0?`ol-rotate`:e.className,n=e.label===void 0?`⇧`:e.label,r=e.compassClassName===void 0?`ol-compass`:e.compassClassName;this.label_,typeof n==`string`?(this.label_=document.createElement(`span`),this.label_.className=r,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(r));let i=e.tipLabel?e.tipLabel:`Reset rotation`,a=document.createElement(`button`);a.className=t+`-reset`,a.setAttribute(`type`,`button`),a.title=i,a.appendChild(this.label_),a.addEventListener(F.CLICK,this.handleClick_.bind(this),!1);let o=t+` `+fo+` `+po,s=this.element;s.className=o,s.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration===void 0?250:e.duration,this.autoHide_=e.autoHide===void 0||e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(uo)}handleClick_(e){e.preventDefault(),this.callResetNorth_===void 0?this.resetNorth_():this.callResetNorth_()}resetNorth_(){let e=this.getMap();if(!e)return;let t=e.getView();if(!t)return;let n=t.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Wn}):t.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let n=t.viewState.rotation;if(n!=this.rotation_){let e=`rotate(`+n+`rad)`,t=this.element;if(this.autoHide_&&t){let e=t.classList.contains(uo);!e&&n===0?t.classList.add(uo):e&&n!==0&&t.classList.remove(uo)}this.label_.style.transform=e}this.rotation_=n}},jo=class extends Oo{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target});let t=e.className===void 0?`ol-zoom`:e.className,n=e.delta===void 0?1:e.delta,r=e.zoomInClassName===void 0?t+`-in`:e.zoomInClassName,i=e.zoomOutClassName===void 0?t+`-out`:e.zoomOutClassName,a=e.zoomInLabel===void 0?`+`:e.zoomInLabel,o=e.zoomOutLabel===void 0?`–`:e.zoomOutLabel,s=e.zoomInTipLabel===void 0?`Zoom in`:e.zoomInTipLabel,c=e.zoomOutTipLabel===void 0?`Zoom out`:e.zoomOutTipLabel,l=document.createElement(`button`);l.className=r,l.setAttribute(`type`,`button`),l.title=s,l.appendChild(typeof a==`string`?document.createTextNode(a):a),l.addEventListener(F.CLICK,this.handleClick_.bind(this,n),!1);let u=document.createElement(`button`);u.className=i,u.setAttribute(`type`,`button`),u.title=c,u.appendChild(typeof o==`string`?document.createTextNode(o):o),u.addEventListener(F.CLICK,this.handleClick_.bind(this,-n),!1);let d=t+` `+fo+` `+po,f=this.element;f.className=d,f.appendChild(l),f.appendChild(u),this.duration_=e.duration===void 0?250:e.duration}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap();if(!t)return;let n=t.getView();if(!n)return;let r=n.getZoom();if(r!==void 0){let t=n.getConstrainedZoom(r+e);if(t===void 0)return;this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:t,duration:this.duration_,easing:Wn})):n.setZoom(t)}}};function Mo(e){e||={};let t=new ct;return(e.zoom===void 0||e.zoom)&&t.push(new jo(e.zoomOptions)),(e.rotate===void 0||e.rotate)&&t.push(new Ao(e.rotateOptions)),(e.attribution===void 0||e.attribution)&&t.push(new ko(e.attributionOptions)),t}var No=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,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;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Po={ACTIVE:`active`},Fo=class extends at{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(Po.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Po.ACTIVE,e)}setMap(e){this.map_=e}};function Io(e,t,n){let r=e.getCenterInternal();if(r){let i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n===void 0?250:n,easing:Kn,center:e.getConstrainedCenter(i)})}}function Lo(e,t,n,r){let i=e.getZoom();if(i===void 0)return;let a=e.getConstrainedZoom(i+t);if(a===void 0)return;let o=e.getResolutionForZoom(a);o!==void 0&&(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:n,duration:r===void 0?250:r,easing:Wn}))}var Ro=class extends Fo{constructor(e){super(),e||={},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?250:e.duration}handleEvent(e){let t=!1;if(e.type==R.DBLCLICK){let n=e.originalEvent,r=e.map,i=e.coordinate,a=n.shiftKey?-this.delta_:this.delta_;Lo(r.getView(),a,i,this.duration_),n.preventDefault(),t=!0}return!t}};function zo(e){let t=arguments;return function(e){let n=!0;for(let r=0,i=t.length;r<i&&(n&&=t[r](e),n);++r);return n}}var Bo=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Vo=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Ho=function(e){let t=e.map.getTargetElement();if(!t)return!1;let n=t.getRootNode(),r=e.map.getOwnerDocument().activeElement;return n instanceof ShadowRoot?n.host.contains(r):t.contains(r)},Uo=function(e){let t=e.map.getTargetElement();if(!t)return!0;let n=t.getRootNode();return!(n instanceof ShadowRoot?n.host:t).hasAttribute(`tabindex`)||Ho(e)},Wo=Ye,Go=function(e){let t=e.originalEvent;return`pointerId`in t&&t.button==0&&!(ft&&pt&&t.ctrlKey)},Ko=Xe,qo=function(e){return e.type==R.SINGLECLICK},Jo=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Yo=function(e){let t=e.originalEvent;return pt?t.metaKey:t.ctrlKey},Xo=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Zo=function(e){let t=e.originalEvent,n=t.target.tagName;return n!==`INPUT`&&n!==`SELECT`&&n!==`TEXTAREA`&&!t.target.isContentEditable},Qo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.pointerType==`mouse`},$o=function(e){let t=e.originalEvent;return`pointerId`in t&&t.isPrimary&&t.button===0},es=class extends Fo{constructor(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==R.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==R.POINTERUP){let t=this.handleUpEvent(e);this.handlingDownUpSequence=t&&this.targetPointers.length>0}}else if(e.type==R.POINTERDOWN){let n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==R.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 ts(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++)n+=e[i].clientX,r+=e[i].clientY;return{clientX:n/t,clientY:r/t}}var ns=class extends es{constructor(e){super({stopDown:Xe}),e||={},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;let t=e.condition?e.condition:zo(Jo,$o);this.condition_=e.onFocusOnly?zo(Uo,t):t,this.noKinetic_=!1}handleDragEvent(e){let t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());let n=this.targetPointers,r=t.getEventPixel(ts(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){let t=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],n=e.map.getView(),i=n.getResolution();i!==void 0&&(Fn(t,i),Pn(t,n.getRotation()),n.adjustCenterInternal(t))}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()}handleUpEvent(e){let t=e.map,n=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let e=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),i=n.getCenterInternal();if(i){let a=t.getPixelFromCoordinateInternal(i),o=t.getCoordinateFromPixelInternal([a[0]-e*Math.cos(r),a[1]-e*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:Wn})}}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){let t=e.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},rs=class extends es{constructor(e){e||={},super({stopDown:Xe}),this.condition_=e.condition?e.condition:Vo,this.lastAngle_=void 0,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){if(!Qo(e))return;let t=e.map,n=t.getView();if(n.getConstraints().rotation===Qa)return;let r=t.getSize();if(!r)return;let i=e.pixel,a=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){let e=a-this.lastAngle_;n.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){return!Qo(e)||(e.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(e){return Qo(e)&&Go(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},is=class extends Re{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_(){let e=this.startPixel_,t=this.endPixel_;if(!e||!t)return;let n=this.element_.style;n.left=Math.min(e[0],t[0])+`px`,n.top=Math.min(e[1],t[1])+`px`,n.width=Math.abs(t[0]-e[0])+`px`,n.height=Math.abs(t[1]-e[1])+`px`}setMap(e){if(this.map_){let e=this.map_.getOverlayContainer();e&&e.removeChild(this.element_);let t=this.element_.style;t.left=`inherit`,t.top=`inherit`,t.width=`inherit`,t.height=`inherit`}if(this.map_=e,this.map_){let e=this.map_.getOverlayContainer();e&&e.appendChild(this.element_)}}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;let e=this.startPixel_,t=this.endPixel_;if(!e||!t)return;let n=[e,[e[0],t[1]],t,[t[0],e[1]]],r=this.map_,i=n.map(e=>r.getCoordinateFromPixelInternal(e)),a=i[0];if(!a)return;i[4]=a.slice();let o=i;this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Ua([o])}getGeometry(){return this.geometry_}},as={BOXSTART:`boxstart`,BOXDRAG:`boxdrag`,BOXEND:`boxend`,BOXCANCEL:`boxcancel`},os=class extends et{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}},ss=class extends es{constructor(e){super(),this.on,this.once,this.un,e??={},this.box_=new is(e.className||`ol-dragbox`),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Go,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];return r*r+i*i>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new os(as.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new os(t?as.BOXEND:as.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 os(as.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&=(this.dispatchEvent(new os(as.BOXCANCEL,this.startPixel_,null)),null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&=(this.dispatchEvent(new os(as.BOXCANCEL,this.startPixel_,null)),null)),super.setMap(e)}},cs=class extends ss{constructor(e){e||={};let t=e.condition?e.condition:Xo;super({condition:t,className:e.className||`ol-dragzoom`,minArea:e.minArea}),this.duration_=e.duration===void 0?200:e.duration,this.out_=e.out!==void 0&&e.out}onBoxEnd(e){let t=this.getMap();if(!t)return;let n=t.getView(),r=this.getGeometry();if(this.out_){let e=n.rotatedExtentForGeometry(r),t=n.getResolutionForExtentInternal(e),i=n.getResolution();if(t===void 0||i===void 0)return;let a=i/t;r=r.clone(),r.scale(a*a)}n.fitInternal(r,{duration:this.duration_,easing:Wn})}},ls={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,DOWN:`ArrowDown`},us=class extends Fo{constructor(e){super(),e||={},this.defaultCondition_=function(e){return Jo(e)&&Zo(e)},this.condition_=e.condition===void 0?this.defaultCondition_:e.condition,this.duration_=e.duration===void 0?100:e.duration,this.pixelDelta_=e.pixelDelta===void 0?128:e.pixelDelta}handleEvent(e){let t=!1;if(e.type==F.KEYDOWN){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r==ls.DOWN||r==ls.LEFT||r==ls.RIGHT||r==ls.UP)){let i=e.map.getView(),a=i.getResolution();if(a===void 0)return!0;let o=a*this.pixelDelta_,s=0,c=0;r==ls.DOWN?c=-o:r==ls.LEFT?s=-o:r==ls.RIGHT?s=o:c=o;let l=[s,c];Pn(l,i.getRotation()),Io(i,l,this.duration_),n.preventDefault(),t=!0}}return!t}},ds=class extends Fo{constructor(e){super(),e||={},this.condition_=e.condition?e.condition:function(e){return!Yo(e)&&Zo(e)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?100:e.duration}handleEvent(e){let t=!1;if(e.type==F.KEYDOWN||e.type==F.KEYPRESS){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r===`+`||r===`-`)){let i=e.map,a=r===`+`?this.delta_:-this.delta_;Lo(i.getView(),a,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}},fs=40,ps=300,ms=3,hs=class extends Fo{constructor(e){e||={},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta===void 0?1:e.maxDelta,this.duration_=e.duration===void 0?250:e.duration,this.timeout_=e.timeout===void 0?80:e.timeout,this.useAnchor_=e.useAnchor===void 0||e.useAnchor,this.constrainResolution_=e.constrainResolution!==void 0&&e.constrainResolution;let t=e.condition?e.condition:Wo;this.condition_=e.onFocusOnly?zo(Uo,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;let e=this.getMap();if(!e)return;let t=e.getView(),n=this.lastDelta_?this.lastDelta_>0?1:-1:0;t.endInteraction(this.constrainResolution_||t.getConstrainResolution()?100:void 0,n,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):void 0)}handleEvent(e){if(!this.condition_(e)||e.type!==F.WHEEL)return!0;let t=e.map,n=e.originalEvent;n.preventDefault();let r=n.ctrlKey&&!e.ctrlKey;this.useAnchor_&&(this.lastAnchor_=e.pixel);let i=n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_LINE:i*=fs;break;case WheelEvent.DOM_DELTA_PAGE:i*=ps}if(i===0)return!1;this.lastDelta_=i;let a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?`trackpad`:`wheel`);let o=t.getView();if(this.mode_===`trackpad`)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r&&(i*=ms),o.adjustZoom(-i/this.deltaPerZoom_,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):void 0),this.startTime_=a,!1;this.totalDelta_+=i;let s=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,t),s),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-kt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Lo(t,n,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):void 0,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)}},gs=class extends es{constructor(e){e||={};let t=e;t.stopDown||=Xe,super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold===void 0?.3:e.threshold,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){let t=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(this.lastAngle_!==void 0){let e=i-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=i;let a=e.map,o=a.getView();o.getConstraints().rotation!==Qa&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(ts(this.targetPointers)))??null,this.rotating_&&(a.render(),o.adjustRotationInternal(t,this.anchor_??void 0)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){let 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}},_s=class extends es{constructor(e){e||={};let t=e;t.stopDown||=Xe,super(t),this.anchor_=null,this.duration_=e.duration===void 0?400:e.duration,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,a=n.clientY-r.clientY,o=Math.sqrt(i*i+a*a);this.lastDistance_!==void 0&&(t=this.lastDistance_/o),this.lastDistance_=o;let s=e.map,c=s.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(ts(this.targetPointers)))??null,s.render(),c.adjustResolutionInternal(t,this.anchor_??void 0)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}};function vs(e){e||={};let t=new ct,n=new No(-.005,.05,100);return(e.altShiftDragRotate===void 0||e.altShiftDragRotate)&&t.push(new rs),(e.doubleClickZoom===void 0||e.doubleClickZoom)&&t.push(new Ro({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan===void 0||e.dragPan)&&t.push(new ns({onFocusOnly:e.onFocusOnly,kinetic:n})),(e.pinchRotate===void 0||e.pinchRotate)&&t.push(new gs),(e.pinchZoom===void 0||e.pinchZoom)&&t.push(new _s({duration:e.zoomDuration})),(e.keyboard===void 0||e.keyboard)&&(t.push(new us),t.push(new ds({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom===void 0||e.mouseWheelZoom)&&t.push(new hs({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom===void 0||e.shiftDragZoom)&&t.push(new cs({duration:e.zoomDuration})),t}var ys={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`},bs=class extends at{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;let t=Object.assign({},e);typeof e.properties==`object`&&(delete t.properties,Object.assign(t,e.properties)),t[ys.OPACITY]=e.opacity===void 0?1:e.opacity,B(typeof t[ys.OPACITY]==`number`,`Layer opacity must be a number`),t[ys.VISIBLE]=e.visible===void 0||e.visible,t[ys.Z_INDEX]=e.zIndex,t[ys.MAX_RESOLUTION]=e.maxResolution===void 0?1/0:e.maxResolution,t[ys.MIN_RESOLUTION]=e.minResolution===void 0?0:e.minResolution,t[ys.MIN_ZOOM]=e.minZoom===void 0?-1/0:e.minZoom,t[ys.MAX_ZOOM]=e.maxZoom===void 0?1/0:e.maxZoom,this.className_=t.className===void 0?`ol-layer`:t.className,delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){let t=this.state_||{layer:this,managed:e===void 0||e},n=this.getZIndex();return t.opacity=kt(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=n===void 0&&!t.managed?1/0:n,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 I()}getLayerStatesArray(e){return I()}getExtent(){return this.get(ys.EXTENT)}getMaxResolution(){return this.get(ys.MAX_RESOLUTION)}getMinResolution(){return this.get(ys.MIN_RESOLUTION)}getMinZoom(){return this.get(ys.MIN_ZOOM)}getMaxZoom(){return this.get(ys.MAX_ZOOM)}getOpacity(){return this.get(ys.OPACITY)}getSourceState(){return I()}getVisible(){return this.get(ys.VISIBLE)}getZIndex(){return this.get(ys.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(ys.EXTENT,e)}setMaxResolution(e){this.set(ys.MAX_RESOLUTION,e)}setMinResolution(e){this.set(ys.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(ys.MAX_ZOOM,e)}setMinZoom(e){this.set(ys.MIN_ZOOM,e)}setOpacity(e){B(typeof e==`number`,`Layer opacity must be a number`),this.set(ys.OPACITY,e)}setVisible(e){this.set(ys.VISIBLE,e)}setZIndex(e){this.set(ys.Z_INDEX,e)}disposeInternal(){this.state_&&=(this.state_.layer=null,null),super.disposeInternal()}},xs={ADDLAYER:`addlayer`,REMOVELAYER:`removelayer`},Ss=class extends et{constructor(e,t){super(e),this.layer=t}},Cs={LAYERS:`layers`},ws=class e extends bs{constructor(e){e||={};let t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Cs.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new ct(n.slice(),{unique:!0}):B(typeof n.getArray==`function`,"Expected `layers` to be an array or a `Collection`"):n=new ct(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Le),this.layersListenerKeys_.length=0;let e=this.getLayers();this.layersListenerKeys_.push(P(e,Me.ADD,this.handleLayersAdd_,this),P(e,Me.REMOVE,this.handleLayersRemove_,this));for(let e in this.listenerKeys_)this.listenerKeys_[e].forEach(Le);Pe(this.listenerKeys_);let t=e.getArray();for(let e=0,n=t.length;e<n;e++){let n=t[e];this.registerLayerListeners_(n),this.dispatchEvent(new Ss(xs.ADDLAYER,n))}this.changed()}registerLayerListeners_(t){let n=[P(t,Ne.PROPERTYCHANGE,this.handleLayerChange_,this),P(t,F.CHANGE,this.handleLayerChange_,this)];t instanceof e&&n.push(P(t,xs.ADDLAYER,this.handleLayerGroupAdd_,this),P(t,xs.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[L(t)]=n}handleLayerGroupAdd_(e){this.dispatchEvent(new Ss(xs.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new Ss(xs.REMOVELAYER,e.layer))}handleLayersAdd_(e){let t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new Ss(xs.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){let t=e.element,n=L(t);this.listenerKeys_[n].forEach(Le),delete this.listenerKeys_[n],this.dispatchEvent(new Ss(xs.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(Cs.LAYERS)}setLayers(e){let t=this.getLayers();if(t){let e=t.getArray();for(let t=0,n=e.length;t<n;++t)this.dispatchEvent(new Ss(xs.REMOVELAYER,e[t]))}this.set(Cs.LAYERS,e)}getLayersArray(e){return e=e===void 0?[]:e,this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){let t=e===void 0?[]:e,n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});let r=this.getLayerState(),i=r.zIndex;!e&&r.zIndex===void 0&&(i=0);for(let e=n,a=t.length;e<a;e++){let n=t[e];n.opacity*=r.opacity,n.visible=n.visible&&r.visible,n.maxResolution=Math.min(n.maxResolution,r.maxResolution),n.minResolution=Math.max(n.minResolution,r.minResolution),n.minZoom=Math.max(n.minZoom,r.minZoom),n.maxZoom=Math.min(n.maxZoom,r.maxZoom),r.extent!==void 0&&(n.extent=n.extent===void 0?r.extent:yn(n.extent,r.extent)),n.zIndex===void 0&&(n.zIndex=i)}return t}getSourceState(){return`ready`}},Ts={PRERENDER:`prerender`,POSTRENDER:`postrender`,PRECOMPOSE:`precompose`,POSTCOMPOSE:`postcompose`,RENDERCOMPLETE:`rendercomplete`},Es=class extends bs{constructor(e){let 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(ys.SOURCE,this.handleSourcePropertyChange_);let n=e.source?e.source:null;this.setSource(n)}getLayersArray(e){return e||=[],e.push(this),e}getLayerStatesArray(e){return e||=[],e.push(this.getLayerState()),e}getSource(){return this.get(ys.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){let e=this.getSource();return e?e.getState():`undefined`}handleSourceChange_(){this.changed();let e=this.getSource();e&&!this.sourceReady_&&e.getState()===`ready`&&(this.sourceReady_=!0,this.dispatchEvent(`sourceready`))}handleSourcePropertyChange_(){this.sourceChangeKey_&&=(Le(this.sourceChangeKey_),null),this.sourceReady_=!1;let e=this.getSource();e&&(this.sourceChangeKey_=P(e,F.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,n=this.getMapInternal();!e&&n&&(e=n.getView()),t=e instanceof ro?{viewState:e.getState(),extent:e.calculateExtent()}:e;let r=t;!r.layerStatesArray&&n&&(r.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let i;if(r.layerStatesArray){if(i=r.layerStatesArray.find(e=>e.layer===this),!i)return!1}else i=this.getLayerState();let a=this.getExtent();return Ds(i,r.viewState)&&(!a||Cn(a,r.extent))}getAttributions(e){if(!this.isVisible(e))return[];let t=this.getSource()?.getAttributions();if(!t)return[];let n=t(e instanceof ro?e.getViewStateAndExtent():e);return Array.isArray(n)||(n=[n]),n}render(e,t){let n=this.getRenderer();return n.prepareFrame(e)?(this.rendered=!0,n.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){let t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(ys.MAP,e)}getMapInternal(){return this.get(ys.MAP)}setMap(e){this.mapPrecomposeKey_&&=(Le(this.mapPrecomposeKey_),null),e||this.changed(),this.mapRenderKey_&&=(Le(this.mapRenderKey_),null),e&&(this.mapPrecomposeKey_=P(e,Ts.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=P(this,F.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){let t=e.frameState?.layerStatesArray;if(!t)return;let n=this.getLayerState(!1);B(!t.some(e=>e.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(n)}setSource(e){this.set(ys.SOURCE,e)}getRenderer(){return 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 Ds(e,t){if(!e.visible)return!1;let n=t.resolution;if(n<e.minResolution||n>=e.maxResolution)return!1;let r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}function Os(e,t,n=0,r=e.length-1,i=As){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Os(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(ks(e,n,t),i(e[r],a)>0&&ks(e,n,r);o<s;){for(ks(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?ks(e,n,s):(s++,ks(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function ks(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function As(e,t){return e<t?-1:+(e>t)}var js=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,n=[];if(!Us(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;Us(e,s)&&(t.leaf?n.push(o):Hs(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!Us(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(Us(e,a)){if(t.leaf||Hs(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);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){let e=this.data;this.data=t,t=e}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=Ws([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=Ms(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&Hs(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=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){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=Ws(e.slice(t,n+1)),Ns(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=Ws([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));Gs(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);Gs(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return Ns(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Rs(o),c=Bs(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),Fs(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=Ws(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,Ns(n,this.toBBox),Ns(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=Ws([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ns(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=Ps(e,0,o,this.toBBox),s=Ps(e,o,n,this.toBBox),c=Vs(t,s),l=Rs(t)+Rs(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Is,i=e.leaf?this.compareMinY:Ls;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=Ps(e,0,t,i),o=Ps(e,n-t,n,i),s=zs(a)+zs(o);for(let r=t;r<n-t;r++){let t=e.children[r];Fs(a,e.leaf?i(t):t),s+=zs(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];Fs(o,e.leaf?i(t):t),s+=zs(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Fs(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():Ns(e[t],this.toBBox)}};function Ms(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Ns(e,t){Ps(e,0,e.children.length,t,e)}function Ps(e,t,n,r,i){i||=Ws(null),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];Fs(i,e.leaf?r(t):t)}return i}function Fs(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Is(e,t){return e.minX-t.minX}function Ls(e,t){return e.minY-t.minY}function Rs(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function zs(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Bs(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Vs(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function Hs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Us(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Ws(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gs(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Os(e,o,t,n,i),a.push(t,o,o,n)}}var Ks=[NaN,NaN,NaN,0],qs;function Js(){return qs||=yo(1,1,void 0,{willReadFrequently:!0,desynchronized:!0}),qs}var Ys=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Xs=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Zs=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Qs=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function $s(e,t){return e.endsWith(`%`)?Number(e.substring(0,e.length-1))/t:Number(e)}function ec(e){throw Error(`failed to parse "`+e+`" as color`)}function tc(e){if(e.toLowerCase().startsWith(`rgb`)){let t=e.match(Xs)||e.match(Ys)||e.match(Zs);if(t){let e=t[4],n=100/255;return[kt($s(t[1],n)+.5|0,0,255),kt($s(t[2],n)+.5|0,0,255),kt($s(t[3],n)+.5|0,0,255),e===void 0?1:kt($s(e,100),0,1)]}ec(e)}if(e.startsWith(`#`)){if(Qs.test(e)){let t=e.substring(1),n=t.length<=4?1:2,r=[0,0,0,255];for(let e=0,i=t.length;e<i;e+=n){let i=parseInt(t.substring(e,e+n),16);n===1&&(i+=i<<4),r[e/n]=i}return r[3]/=255,r}ec(e)}let t=Js();t.fillStyle=`#abcdef`;let n=t.fillStyle;t.fillStyle=e,t.fillStyle===n&&(t.fillStyle=`#fedcba`,n=t.fillStyle,t.fillStyle=e,t.fillStyle===n&&ec(e));let r=t.fillStyle;if(r.startsWith(`#`)||r.startsWith(`rgba`))return tc(r);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let i=Array.from(t.getImageData(0,0,1,1).data);return i[3]=Lt(i[3]/255,3),i}function nc(e){return typeof e==`string`?e:hc(e)}var rc=1024,ic={},ac=0;function oc(e){if(e.length===4)return e;let t=e.slice();return t[3]=1,t}function sc(e){return e>.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function cc(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function lc(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function uc(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function dc(e){let t=lc(e[0]),n=lc(e[1]),r=lc(e[2]),i=uc(t*.222488403+n*.716873169+r*.06060791),a=500*(uc(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-uc(t*.016863605+n*.117638439+r*.865350722)),s=180/Math.PI*Math.atan2(o,a);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function fc(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=cc(t),a=cc(t+n/500*Math.cos(r)),o=cc(t-n/200*Math.sin(r)),s=sc(a*3.021973625-i*1.617392459-o*.404875592),c=sc(a*-.943766287+i*1.916279586+o*.027607165),l=sc(a*.069407491-i*.22898585+o*1.159737864);return[kt(s+.5|0,0,255),kt(c+.5|0,0,255),kt(l+.5|0,0,255),e[3]]}function pc(e){if(e===`none`)return Ks;if(ic.hasOwnProperty(e))return ic[e];if(ac>=rc){let e=0;for(let t in ic)e++&3||(delete ic[t],--ac)}let t=tc(e);t.length!==4&&ec(e);for(let n of t)isNaN(n)&&ec(e);return ic[e]=t,++ac,t}function mc(e){return Array.isArray(e)?e:pc(e)}function hc(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}function gc(e){return e[0]>0&&e[1]>0}function _c(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function vc(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var yc=0,bc=1<<yc++,U=1<<yc++,xc=1<<yc++,Sc=1<<yc++,Cc=1<<yc++,wc=1<<yc++,Tc=2**yc-1,Ec={[bc]:`boolean`,[U]:`number`,[xc]:`string`,[Sc]:`color`,[Cc]:`number[]`,[wc]:`size`},Dc=Object.keys(Ec).map(Number).sort(Be);function Oc(e){return e in Ec}function kc(e){let t=[];for(let n of Dc)Ac(e,n)&&t.push(Ec[n]);return t.length===0?`untyped`:t.length<3?t.join(` or `):t.slice(0,-1).join(`, `)+`, or `+t[t.length-1]}function Ac(e,t){return(e&t)===t}function jc(e,t){return!!(e&t)}function Mc(e,t){return e===t}function Nc(e){return e instanceof Error?e.message:String(e)}var Pc=class{constructor(e,t){if(!Oc(e))throw Error(`literal expressions must have a specific type, got ${kc(e)}`);this.type=e,this.value=t}},Fc=class{constructor(e,t,...n){this.type=e,this.operator=t,this.args=n}};function Ic(e){return{variables:new Map,properties:new Map,featureId:!1,geometryType:!1,mCoordinate:!1,mapState:!1,inputVariables:e}}function Lc(e,t,n){switch(typeof e){case`boolean`:if(Mc(t,xc))return new Pc(xc,e?`true`:`false`);if(!Ac(t,bc))throw Error(`got a boolean, but expected ${kc(t)}`);return new Pc(bc,e);case`number`:if(Mc(t,wc))return new Pc(wc,vc(e));if(Mc(t,bc))return new Pc(bc,!!e);if(Mc(t,xc))return new Pc(xc,e.toString());if(!Ac(t,U))throw Error(`got a number, but expected ${kc(t)}`);return new Pc(U,e);case`string`:if(Mc(t,Sc))return new Pc(Sc,pc(e));if(Mc(t,bc))return new Pc(bc,!!e);if(!Ac(t,xc))throw Error(`got a string, but expected ${kc(t)}`);return new Pc(xc,e)}if(!Array.isArray(e))throw Error(`expression must be an array or a primitive value`);if(e.length===0)throw Error(`empty expression`);if(typeof e[0]==`string`)return rl(e,t,n);for(let t of e)if(typeof t!=`number`)throw Error(`expected an array of numbers`);if(Mc(t,wc)){if(e.length!==2)throw Error(`expected an array of two values for a size, got ${e.length}`);return new Pc(wc,e)}if(Mc(t,Sc)){if(e.length===3)return new Pc(Sc,[...e,1]);if(e.length===4)return new Pc(Sc,e);throw Error(`expected an array of 3 or 4 values for a color, got ${e.length}`)}if(!Ac(t,Cc))throw Error(`got an array of numbers, but expected ${kc(t)}`);return new Pc(Cc,e)}var W={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`,InterpolateHcl:`interpolate-hcl`,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`},Rc={[W.Get]:K(G(1,1/0),zc),[W.Var]:Bc(),[W.Has]:K(G(1,1/0),zc),[W.Id]:K(Vc,Gc),[W.Concat]:K(G(2,1/0),qc(xc)),[W.GeometryType]:K(Hc,Gc),[W.LineMetric]:K(Uc,Gc),[W.Resolution]:K(Wc,Gc),[W.Zoom]:K(Wc,Gc),[W.Time]:K(Wc,Gc),[W.Any]:K(G(2,1/0),qc(bc)),[W.All]:K(G(2,1/0),qc(bc)),[W.Not]:K(G(1,1),qc(bc)),[W.Equal]:K(G(2,2),Jc()),[W.NotEqual]:K(G(2,2),Jc()),[W.GreaterThan]:K(G(2,2),qc(U)),[W.GreaterThanOrEqualTo]:K(G(2,2),qc(U)),[W.LessThan]:K(G(2,2),qc(U)),[W.LessThanOrEqualTo]:K(G(2,2),qc(U)),[W.Multiply]:K(G(2,1/0),Kc),[W.Coalesce]:K(G(2,1/0),Kc),[W.Divide]:K(G(2,2),qc(U)),[W.Add]:K(G(2,1/0),qc(U)),[W.Subtract]:K(G(2,2),qc(U)),[W.Clamp]:K(G(3,3),qc(U)),[W.Mod]:K(G(2,2),qc(U)),[W.Pow]:K(G(2,2),qc(U)),[W.Abs]:K(G(1,1),qc(U)),[W.Floor]:K(G(1,1),qc(U)),[W.Ceil]:K(G(1,1),qc(U)),[W.Round]:K(G(1,1),qc(U)),[W.Sin]:K(G(1,1),qc(U)),[W.Cos]:K(G(1,1),qc(U)),[W.Atan]:K(G(1,2),qc(U)),[W.Sqrt]:K(G(1,1),qc(U)),[W.Match]:K(G(4,1/0),Xc,Zc),[W.Between]:K(G(3,3),qc(U)),[W.Interpolate]:K(G(6,1/0),Xc,$c),[W.InterpolateHcl]:K(G(6,1/0),Xc,Qc,$c),[W.Case]:K(G(3,1/0),Yc,el),[W.In]:K(G(2,2),tl),[W.Number]:K(G(1,1/0),qc(Tc)),[W.String]:K(G(1,1/0),qc(Tc)),[W.Array]:K(G(1,1/0),qc(U)),[W.Color]:K(G(1,4),qc(U)),[W.Band]:K(G(1,3),qc(U)),[W.Palette]:K(G(2,2),nl),[W.ToString]:K(G(1,1),qc(bc|U|xc|Sc))};function zc(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;a<r;++a){let r=e[a+1];switch(typeof r){case`number`:i[a]=new Pc(U,r);break;case`string`:i[a]=new Pc(xc,r);break;default:throw Error(`expected a string key or numeric array index for a get operation, got ${r}`)}a===0&&n.properties.set(String(r),t)}return i}function Bc(){return function(e,t,n){let r=e[1];if(typeof r!=`string`)throw Error(`expected a string argument for var operation`);let i=t,a=n.inputVariables?.[r];if(a!==void 0){let e=Lc(a,Tc,n);if(!(e instanceof Pc))throw Error(`style variables should only be literal values (no expressions!), variable name: ${r}`);let o=e.type;if(typeof a==`string`&&jc(i,Sc)&&!jc(i,xc)?o=Sc:Array.isArray(a)&&a.length===2&&jc(i,wc)&&!jc(i,Cc)&&(o=wc),i&=o,i===0)throw Error(`the type expected from the var operator (${kc(t)}) did not have any overlap with the type of the corresponding style variables (${kc(o)}), variable name: ${r}`)}if(n.variables.has(r)){let e=n.variables.get(r);if(i&=e,i===0)throw Error(`a new type expected from the var operator (${kc(t)}) did not have any overlap with the previous type expected for it (${kc(e)}), variable name: ${r}`)}return n.variables.set(r,i),new Fc(i,`var`,new Pc(xc,r))}}function Vc(e,t,n){n.featureId=!0}function Hc(e,t,n){n.geometryType=!0}function Uc(e,t,n){n.mCoordinate=!0}function Wc(e,t,n){n.mapState=!0}function Gc(e,t,n){let r=e[0];if(e.length!==1)throw Error(`expected no arguments for ${r} operation`);return[]}function G(e,t){return function(n,r,i){let a=n[0],o=n.length-1;if(e===t){if(o!==e)throw Error(`expected ${e} argument${e===1?``:`s`} for ${a}, got ${o}`)}else if(o<e||o>t){let n=t===1/0?`${e} or more`:`${e} to ${t}`;throw Error(`expected ${n} arguments for ${a}, got ${o}`)}}}function Kc(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;a<r;++a){let r=Lc(e[a+1],t,n);i[a]=r}return i}function qc(e){return function(t,n,r){let i=t.length-1,a=Array(i);for(let n=0;n<i;++n){let i=Lc(t[n+1],e,r);a[n]=i}return a}}function Jc(){return function(e,t,n){let r=e[0],i=e.length-1,a=Array(i),o=Tc;for(let t=0;t<i;++t){let r=Lc(e[t+1],o,n);o&=r.type}if(o===0)throw Error(`no common type was found among the arguments of ${r}`);for(let t=0;t<i;++t){let r=Lc(e[t+1],o,n);a[t]=r}return a}}function Yc(e,t,n){let r=e[0],i=e.length-1;if(i%2==0)throw Error(`expected an odd number of arguments for ${r}, got ${i} instead`)}function Xc(e,t,n){let r=e[0],i=e.length-1;if(i%2==1)throw Error(`expected an even number of arguments for operation ${r}, got ${i} instead`)}function Zc(e,t,n){let r=e.length-1,i=Lc(e[e.length-1],t,n),a=xc|U|bc,o=Array(r-2);for(let t=0;t<r-2;t+=2){try{let r=Lc(e[t+2],a,n);a&=r.type}catch(e){let n=Nc(e);throw Error(`failed to parse argument ${t+1} of match expression: ${n}`)}if(a===0)throw Error(`no common type was found among the arguments of match expression`)}for(let t=0;t<r-2;t+=2){try{let r=Lc(e[t+2],a,n);o[t]=r}catch(e){let n=Nc(e);throw Error(`failed to parse argument ${t+1} of match expression: ${n}`)}try{let r=Lc(e[t+3],i.type,n);o[t+1]=r}catch(e){throw Error(`failed to parse argument ${t+2} of match expression: ${Nc(e)}`)}}return[Lc(e[1],a,n),...o,i]}function Qc(e,t,n){if(!Ac(t,Sc))throw Error(`the ${e[0]} operator can only return a color, got ${kc(t)}`)}function $c(e,t,n){let r=e[1],i;switch(r[0]){case`linear`:i=1;break;case`exponential`:let e=r[1];if(typeof e!=`number`||e<=0)throw Error(`expected a number base for exponential interpolation, got ${JSON.stringify(e)} instead`);i=e;break;default:throw Error(`invalid interpolation type: ${JSON.stringify(r)}`)}let a=new Pc(U,i),o;try{o=Lc(e[2],U,n)}catch(e){throw Error(`failed to parse argument 1 in interpolate expression: ${Nc(e)}`)}let s=Array(e.length-3);for(let r=0;r<s.length;r+=2){try{let t=Lc(e[r+3],U,n);s[r]=t}catch(e){throw Error(`failed to parse argument ${r+2} for interpolate expression: ${Nc(e)}`)}try{let i=Lc(e[r+4],t,n);s[r+1]=i}catch(e){throw Error(`failed to parse argument ${r+3} for interpolate expression: ${Nc(e)}`)}}return[a,o,...s]}function el(e,t,n){let r=Lc(e[e.length-1],t,n),i=Array(e.length-1);for(let t=0;t<i.length-1;t+=2){try{let r=Lc(e[t+1],bc,n);i[t]=r}catch(e){throw Error(`failed to parse argument ${t} of case expression: ${Nc(e)}`)}try{let a=Lc(e[t+2],r.type,n);i[t+1]=a}catch(e){throw Error(`failed to parse argument ${t+1} of case expression: ${Nc(e)}`)}}return i[i.length-1]=r,i}function tl(e,t,n){let r=e[2];if(!Array.isArray(r))throw Error(`the second argument for the "in" operator must be an array`);let i;if(r[0]===`literal`){if(r=r[1],!Array.isArray(r))throw Error(`failed to parse "in" expression: the literal operator must be followed by an array`)}else if(typeof r[0]==`string`)throw Error(`for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions`);i=typeof r[0]==`string`?xc:U;let a=Array(r.length);for(let e=0;e<a.length;e++)try{let t=Lc(r[e],i,n);a[e]=t}catch(t){throw Error(`failed to parse haystack item ${e} for "in" expression: ${Nc(t)}`)}return[Lc(e[1],i,n),...a]}function nl(e,t,n){let r;try{r=Lc(e[1],U,n)}catch(e){throw Error(`failed to parse first argument in palette expression: ${Nc(e)}`)}let i=e[2];if(!Array.isArray(i))throw Error(`the second argument of palette must be an array`);let a=Array(i.length);for(let e=0;e<a.length;e++){let t;try{t=Lc(i[e],Sc,n)}catch(t){throw Error(`failed to parse color at index ${e} in palette expression: ${Nc(t)}`)}if(!(t instanceof Pc))throw Error(`the palette color at index ${e} must be a literal value`);a[e]=t}return[r,...a]}function K(...e){return function(t,n,r){let i=t[0],a=[];for(let i=0;i<e.length;i++){let o=e[i](t,n,r);if(i==e.length-1){if(!o)throw Error(`expected last argument validator to return the parsed args`);a=o}}return new Fc(n,i,...a)}}function rl(e,t,n){let r=e[0],i=Rc[r];if(!i)throw Error(`unknown operator: ${r}`);return i(e,t,n)}function il(e){if(!e)return``;let t=e.getType();switch(t){case`Point`:case`LineString`:case`Polygon`:return t;case`MultiPoint`:case`MultiLineString`:case`MultiPolygon`:return t.substring(5);case`Circle`:return`Polygon`;case`GeometryCollection`:return il(e.getGeometries()[0]);default:return``}}function al(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:``}}function ol(e,t,n){return sl(Lc(e,t,n),n)}function sl(e,t){if(e instanceof Pc){if(e.type===Sc&&typeof e.value==`string`){let t=pc(e.value);return function(){return t}}return function(){return e.value}}let n=e.operator;switch(n){case W.Number:case W.String:case W.Coalesce:return ul(e,t);case W.Get:case W.Var:case W.Has:return dl(e,t);case W.Id:return e=>e.featureId??``;case W.GeometryType:return e=>e.geometryType;case W.Concat:{let n=e.args.map(e=>sl(e,t));return e=>``.concat(...n.map(t=>(t(e)??``).toString()))}case W.Resolution:return e=>e.resolution;case W.Any:case W.All:case W.Between:case W.In:case W.Not:return pl(e,t);case W.Equal:case W.NotEqual:case W.LessThan:case W.LessThanOrEqualTo:case W.GreaterThan:case W.GreaterThanOrEqualTo:return fl(e,t);case W.Multiply:case W.Divide:case W.Add:case W.Subtract:case W.Clamp:case W.Mod:case W.Pow:case W.Abs:case W.Floor:case W.Ceil:case W.Round:case W.Sin:case W.Cos:case W.Atan:case W.Sqrt:return ml(e,t);case W.Case:return hl(e,t);case W.Match:return gl(e,t);case W.Interpolate:case W.InterpolateHcl:return _l(e,t);case W.ToString:return vl(e,t);case W.Array:return cl(e,t);case W.Color:return ll(e,t);default:throw Error(`Unsupported operator ${n}`)}}function cl(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=sl(e.args[i],t);if(e.type===Sc&&(n===3||n===4)){let e=n===4?r[3]:null;return t=>[r[0](t)*255,r[1](t)*255,r[2](t)*255,e?e(t):1]}return e=>{let t=Array(n);for(let i=0;i<n;++i)t[i]=r[i](e);return t}}function ll(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=sl(e.args[i],t);if(n<3){let e=n===2?r[1]:null;return t=>{let n=r[0](t);return[n,n,n,e?e(t):1]}}let i=n===4?r[3]:null;return e=>[r[0](e),r[1](e),r[2](e),i?i(e):1]}function ul(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=sl(e.args[n],t);switch(n){case W.Coalesce:return e=>{for(let t=0;t<r;++t){let n=i[t](e);if(n!=null)return n}throw Error(`Expected one of the values to be non-null`)};case W.Number:case W.String:return e=>{for(let t=0;t<r;++t){let r=i[t](e);if(typeof r===n)return r}throw Error(`Expected one of the values to be a ${n}`)};default:throw Error(`Unsupported assertion operator ${n}`)}}function dl(e,t){let n=e.args[0].value;switch(e.operator){case W.Get:return t=>{let r=e.args,i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;i=i[t]}return i};case W.Var:return e=>e.variables[n];case W.Has:return t=>{let r=e.args;if(!(n in t.properties))return!1;let i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;if(!i||!Object.hasOwn(i,t))return!1;i=i[t]}return!0};default:throw Error(`Unsupported accessor operator ${e.operator}`)}}function fl(e,t){let n=e.operator,r=sl(e.args[0],t),i=sl(e.args[1],t);switch(n){case W.Equal:return e=>r(e)===i(e);case W.NotEqual:return e=>r(e)!==i(e);case W.LessThan:return e=>r(e)<i(e);case W.LessThanOrEqualTo:return e=>r(e)<=i(e);case W.GreaterThan:return e=>r(e)>i(e);case W.GreaterThanOrEqualTo:return e=>r(e)>=i(e);default:throw Error(`Unsupported comparison operator ${n}`)}}function pl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=sl(e.args[n],t);switch(n){case W.Any:return e=>{for(let t=0;t<r;++t)if(i[t](e))return!0;return!1};case W.All:return e=>{for(let t=0;t<r;++t)if(!i[t](e))return!1;return!0};case W.Between:return e=>{let t=i[0](e),n=i[1](e),r=i[2](e);return t>=n&&t<=r};case W.In:return e=>{let t=i[0](e);for(let n=1;n<r;++n)if(t===i[n](e))return!0;return!1};case W.Not:return e=>!i[0](e);default:throw Error(`Unsupported logical operator ${n}`)}}function ml(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=sl(e.args[n],t);switch(n){case W.Multiply:return e=>{let t=1;for(let n=0;n<r;++n)t*=i[n](e);return t};case W.Divide:return e=>i[0](e)/i[1](e);case W.Add:return e=>{let t=0;for(let n=0;n<r;++n)t+=i[n](e);return t};case W.Subtract:return e=>i[0](e)-i[1](e);case W.Clamp:return e=>{let t=i[0](e),n=i[1](e);if(t<n)return n;let r=i[2](e);return t>r?r:t};case W.Mod:return e=>i[0](e)%i[1](e);case W.Pow:return e=>i[0](e)**+i[1](e);case W.Abs:return e=>Math.abs(i[0](e));case W.Floor:return e=>Math.floor(i[0](e));case W.Ceil:return e=>Math.ceil(i[0](e));case W.Round:return e=>Math.round(i[0](e));case W.Sin:return e=>Math.sin(i[0](e));case W.Cos:return e=>Math.cos(i[0](e));case W.Atan:return r===2?e=>Math.atan2(i[0](e),i[1](e)):e=>Math.atan(i[0](e));case W.Sqrt:return e=>Math.sqrt(i[0](e));default:throw Error(`Unsupported numeric operator ${n}`)}}function hl(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=sl(e.args[i],t);return e=>{for(let t=0;t<n-1;t+=2)if(r[t](e))return r[t+1](e);return r[n-1](e)}}function gl(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=sl(e.args[i],t);return e=>{let t=r[0](e);for(let i=1;i<n-1;i+=2)if(t===r[i](e))return r[i+1](e);return r[n-1](e)}}function _l(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=sl(e.args[i],t);let i=e.operator===W.InterpolateHcl?xl:bl;return e=>{let t=r[0](e),a=r[1](e),o,s;for(let c=2;c<n;c+=2){let n=r[c](e),l=r[c+1](e),u=Array.isArray(l);if(u&&(l=oc(l)),n>=a)return c===2?l:u?i(t,a,o,s,n,l):yl(t,a,o,s,n,l);o=n,s=l}return s}}function vl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=sl(e.args[n],t);if(n===W.ToString)return t=>{let n=i[0](t);return e.args[0].type===Sc?hc(n):n.toString()};throw Error(`Unsupported convert operator ${n}`)}function yl(e,t,n,r,i,a){let o=i-n;if(o===0)return r;let s=t-n;return r+(e===1?s/o:(e**+s-1)/(e**+o-1))*(a-r)}function bl(e,t,n,r,i,a){return i-n===0?r:[yl(e,t,n,r[0],i,a[0]),yl(e,t,n,r[1],i,a[1]),yl(e,t,n,r[2],i,a[2]),yl(e,t,n,r[3],i,a[3])]}function xl(e,t,n,r,i,a){if(i-n===0)return r;let o=dc(r),s=dc(a),c=s[2]-o[2];return c>180?c-=360:c<-180&&(c+=360),fc([yl(e,t,n,o[0],i,s[0]),yl(e,t,n,o[1],i,s[1]),o[2]+yl(e,t,n,0,i,c),yl(e,t,n,r[3],i,a[3])])}var q={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Sl=class extends tt{constructor(e,t,n,r){super(),this.extent=e,this.pixelRatio_=n,this.resolution=t,this.state=typeof r==`function`?q.IDLE:r,this.image_=null,this.loader=typeof r==`function`?r:null}changed(){this.dispatchEvent(F.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==q.IDLE){let e=this.loader;if(e){this.state=q.LOADING,this.changed();let t=this.getResolution(),n=Array.isArray(t)?t[0]:t;$e(()=>e(this.getExtent(),n,this.getPixelRatio())).then(e=>{`image`in e&&(this.image_=e.image),`extent`in e&&e.extent&&(this.extent=e.extent),`resolution`in e&&e.resolution!==void 0&&(this.resolution=e.resolution),`pixelRatio`in e&&e.pixelRatio!==void 0&&(this.pixelRatio_=e.pixelRatio),(e instanceof HTMLImageElement||_t&&e instanceof ImageBitmap||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement)&&(this.image_=e),this.state=q.LOADED}).catch(e=>{this.state=q.ERROR,console.error(e)}).finally(()=>this.changed())}}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}};function Cl(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[Ie(r,F.LOAD,function(){o=!0,a||t()})];return r.src&>?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(Ie(r,F.ERROR,n)),function(){i=!1,s.forEach(Le)}}function wl(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function Tl(e,t){return t&&(e.src=t),e.src&>?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):wl(e)}var El=class{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(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t){let n=Dl(e,t);return n in this.cache_?this.cache_[n]:null}getPattern(e,t){let n=Dl(e,t);return n in this.patternCache_?this.patternCache_[n]:null}set(e,t,n,r){let i=Dl(e,t),a=i in this.cache_;if(n&&(this.cache_[i]=n),r&&n){if(n.getImageState()===q.IDLE&&n.load(),n.getImageState()===q.LOADING)n.ready().then(()=>{let e=xo().createPattern(n.getImage(1),`repeat`);e&&(this.patternCache_[i]=e)});else{let e=xo().createPattern(n.getImage(1),`repeat`);e&&(this.patternCache_[i]=e)}}a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function Dl(e,t){let n=t?mc(t):`null`;return e+`:`+n}var Ol=new El,kl=null,Al=class extends tt{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n?.crossOrigin??null,this.referrerPolicy_=n?.referrerPolicy,this.canvas_={},this.color_=i,this.imageState_=r===void 0?q.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_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===q.LOADED){let e=this.image_;if(!e)return!1;kl||=yo(1,1,void 0,{willReadFrequently:!0}),kl.drawImage(e,0,0);try{kl.getImageData(0,0,1,1),this.tainted_=!1}catch{kl=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(F.CHANGE)}handleImageError_(){this.imageState_=q.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=q.LOADED;let e=this.image_;e&&`width`in e&&`height`in e&&(this.size_=[e.width,e.height]),this.dispatchChangeEvent_()}getImage(e){this.image_||this.initializeImage_(),this.replaceColor_(e);let t=this.image_;return this.canvas_[e]?this.canvas_[e]:t}setImage(e){this.image_=e}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_()){let e=this.size_;if(!e)return this.image_;let t=e[0],n=e[1],r=yo(t,n);r.fillRect(0,0,t,n),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_}return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===q.IDLE){this.image_||this.initializeImage_(),this.imageState_=q.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Tl(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_!==q.LOADED)return;let t=this.image_;if(!t)return;let n=yo(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=nc(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||=new Promise(e=>{if(this.imageState_===q.LOADED||this.imageState_===q.ERROR)e();else{let t=()=>{(this.imageState_===q.LOADED||this.imageState_===q.ERROR)&&(this.removeEventListener(F.CHANGE,t),e())};this.addEventListener(F.CHANGE,t)}}),this.ready_}};function jl(e,t,n,r,i,a){let o=t===void 0?void 0:Ol.get(t,i);return o||(o=new Al(e,e&&`src`in e?e.src||void 0:t,n,r,i),t!==void 0&&Ol.set(t,i,o,a)),a&&o&&t!==void 0&&!Ol.getPattern(t,i)&&Ol.set(t,i,o,a),o}function Ml(e){return e?Array.isArray(e)?hc(e):typeof e==`object`&&`src`in e?Nl(e):e:null}function Nl(e){if(!e.offset||!e.size)return Ol.getPattern(e.src,e.color??null);let t=e.src+`:`+e.offset,n=Ol.getPattern(t,e.color??null);if(n)return n;let r=Ol.get(e.src,null);if(!r||r.getImageState()!==q.LOADED)return null;let i=yo(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),jl(i.canvas,t,{},q.LOADED,e.color??null,!0),Ol.getPattern(t,e.color??null)}var Pl=`10px sans-serif`,Fl=`#000`,Il=`round`,Ll=[],Rl=`round`,zl=`#000`,Bl=`center`,Vl=`middle`,Hl=[0,0,0,0],Ul=new at,Wl=null,Gl,Kl={},ql=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function Jl(e,t,n){return`${e} ${t} 16px "${n}"`}var Yl=(function(){let e,t;async function n(e){await t.ready;let n=vo(e);if(!n)return!1;let r=n.families[0].toLowerCase(),i=n.weight,a=[];return t.forEach(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),o=_o[e.weight]||e.weight;t===r&&e.style===n.style&&o==i&&a.push(e)}),a.length!==0&&(await Promise.all(a.map(e=>e.load().then(()=>!0,()=>!1)))).some(e=>e)}async function r(){await t.ready;let i=!0,a=Ul.getProperties(),o=Object.keys(a).filter(e=>a[e]<100);for(let e=o.length-1;e>=0;--e){let t=o[e],r=a[t];r<100&&(await n(t)?(Pe(Kl),Ul.set(t,100)):(r+=10,Ul.set(t,r,!0),r<100&&(i=!1)))}e=void 0,i||(e=setTimeout(r,100))}return async function(n){t||=ht?self.fonts:document.fonts;let i=vo(n);if(!i)return;let a=i.families,o=!1;for(let e of a){if(ql.has(e))continue;let t=Jl(i.style,i.weight,e);Ul.get(t)===void 0&&(Ul.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}})(),Xl=(function(){let e;return function(t){let n=Kl[t];if(n==null){if(ht){let e=vo(t),r=Zl(t,`Žg`);n=(!e||isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);Kl[t]=n}return n}})();function Zl(e,t){return Wl||=yo(1,1),e!=Gl&&(Wl.font=e,Gl=Wl.font),Wl.measureText(t)}function Ql(e,t){return Zl(e,t).width}function $l(e,t,n){if(t in n)return n[t];let r=t.split(`
|
|
3
|
+
`).reduce((t,n)=>Math.max(t,Ql(e,n)),0);return n[t]=r,r}function eu(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===`
|
|
4
|
+
`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=Ql(f,d);n.push(p),o+=p;let m=Xl(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function tu(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=function(e){return e.globalAlpha*=n}:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),nu(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function nu(e,t){let n=t,r=e.contextInstructions;for(let e=0,t=r.length;e<t;e+=2)if(Array.isArray(r[e+1]))n[r[e]].apply(n,r[e+1]);else{let t=r[e];n[t]=r[e+1]}}var ru=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=vc(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return I()}getImage(e){return I()}getHitDetectionImage(){return I()}getPixelRatio(e){return 1}getImageState(){return I()}getImageSize(){return I()}getOrigin(){return I()}getSize(){return I()}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_=vc(e)}listenImageChange(e){I()}load(){I()}unlistenImageChange(e){I()}ready(){return Promise.resolve()}},iu=class e extends ru{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?q.LOADING:q.LOADED,this.imageState_===q.LOADING&&this.ready().then(()=>this.imageState_=q.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?.clone(),points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?.clone(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=Ol.get(n,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=yo(i,i);this.draw_(t,a,e),r=a.canvas;let o=new Al(r,void 0,{},q.LOADED,null);Ol.set(n,null,o),createImageBitmap(r).then(e=>{o.setImage(e)})}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}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m*2}createRenderOptions(){let e=Il,t=Rl,n=0,r=null,i=0,a,o=0;this.stroke_&&(a=Ml(this.stroke_.getColor()??`#000`),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??`round`,e=this.stroke_.getLineCap()??`round`,n=this.stroke_.getMiterLimit()??10);let s=this.calculateLineJoinSize_(t,o,n),c=Math.max(this.radius,this.radius2_||0),l=Math.ceil(2*c+s);return{strokeStyle:a,strokeWidth:o,size:l,lineCap:e,lineDash:r,lineDashOffset:i,lineJoin:t,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,n){if(t.scale(n,n),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();e===null&&(e=Fl),t.fillStyle=Ml(e),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 n=this.fill_.getColor(),r=0;typeof n==`string`&&(n=mc(n)),n===null?r=1:Array.isArray(n)&&(r=n.length===4?n[3]:1),r===0&&(t=yo(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_,n=this.radius;if(t===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(t*=2);let i=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let o=0;o<t;o++){let t=i+o*a,s=o%2==0?n:r;e.lineTo(s*Math.cos(t),s*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=Fl,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()}},au=class e extends iu{constructor(e){e||={radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale===void 0?1:e.scale,rotation:e.rotation===void 0?0:e.rotation,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode})}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?.clone(),stroke:this.getStroke()?.clone(),radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}},ou=class e{constructor(e){e||={},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){if(typeof e==`object`&&e&&`src`in e){let t=jl(null,e.src,{crossOrigin:`anonymous`},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===q.IDLE&&t.load(),t.getImageState()===q.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?L(e):typeof e==`object`&&`src`in e?e.src+`:`+e.offset:mc(e).toString():``}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}};function su(e,t,n,r){return n!==void 0&&r!==void 0?[n/e,r/t]:n===void 0?r===void 0?1:r/t:n/e}var cu=class e extends ru{constructor(e){e||={};let t=e.opacity===void 0?1:e.opacity,n=e.rotation===void 0?0:e.rotation,r=e.scale===void 0?1:e.scale,i=e.rotateWithView!==void 0&&e.rotateWithView;super({opacity:t,rotation:n,scale:r,displacement:e.displacement===void 0?[0,0]:e.displacement,rotateWithView:i,declutterMode:e.declutterMode}),this.anchor_=e.anchor===void 0?[.5,.5]:e.anchor,this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin===void 0?`top-left`:e.anchorOrigin,this.anchorXUnits_=e.anchorXUnits===void 0?`fraction`:e.anchorXUnits,this.anchorYUnits_=e.anchorYUnits===void 0?`fraction`:e.anchorYUnits,this.crossOrigin_=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy_=e.referrerPolicy;let a=e.img===void 0?null:e.img,o=e.src;B(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||L(a)),B(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),B(e.width===void 0&&e.height===void 0||e.scale===void 0,"`width` or `height` cannot be provided together with `scale`");let s;if(e.src===void 0?a!==void 0&&(s=`complete`in a?a.complete?a.src?q.LOADED:q.IDLE:q.LOADING:q.LOADED):s=q.IDLE,this.color_=e.color===void 0?null:mc(e.color),this.iconImage_=jl(a,o,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},s,this.color_),this.offset_=e.offset===void 0?[0,0]:e.offset,this.offsetOrigin_=e.offsetOrigin===void 0?`top-left`:e.offsetOrigin,this.origin_=null,this.size_=e.size===void 0?null:e.size,this.initialOptions_,e.width!==void 0||e.height!==void 0){let t,n;if(e.size)[t,n]=e.size;else{let r=this.getImage(1);if(r.width&&r.height)t=r.width,n=r.height;else if(r instanceof HTMLImageElement){this.initialOptions_=e;let t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;let n=this.iconImage_.getSize();n&&this.setScale(su(n[0],n[1],e.width,e.height))};this.listenImageChange(t);return}}t!==void 0&&this.setScale(su(t,n,e.width,e.height))}}clone(){let t,n,r;return this.initialOptions_?(n=this.initialOptions_.width,r=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new e({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_,referrerPolicy:this.referrerPolicy_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:n,height:r,size:this.size_===null?void 0:this.size_.slice(),src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if(this.anchorXUnits_==`fraction`||this.anchorYUnits_==`fraction`){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==`fraction`&&(e[0]*=t[0]),this.anchorYUnits_==`fraction`&&(e[1]*=t[1])}if(this.anchorOrigin_!=`top-left`){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==`top-right`||this.anchorOrigin_==`bottom-right`)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==`bottom-left`||this.anchorOrigin_==`bottom-right`)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]-t[0]/n[0],e[1]+t[1]/n[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}setColor(e){let t=e?mc(e):null;if(this.color_===t||this.color_&&t&&this.color_.length===t.length&&this.color_.every((e,n)=>e===t[n]))return;this.color_=t;let n=this.getSrc(),r=n===void 0?this.getHitDetectionImage():null,i=n===void 0?this.iconImage_.getImageState():q.IDLE;this.iconImage_=jl(r,n,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},i,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`){let t=this.getSize(),n=this.iconImage_.getSize();if(!t||!n)return null;e=e.slice(),(this.offsetOrigin_==`top-right`||this.offsetOrigin_==`bottom-right`)&&(e[0]=n[0]-t[0]-e[0]),(this.offsetOrigin_==`bottom-left`||this.offsetOrigin_==`bottom-right`)&&(e[1]=n[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=jl(null,e,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},q.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==q.LOADED){let t=this.iconImage_.getSize();if(t)return t[0]*e[0]}}getHeight(){let e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==q.LOADED){let t=this.iconImage_.getSize();if(t)return t[1]*e[1]}}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(F.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(F.CHANGE,e)}ready(){return this.iconImage_.ready()}},lu=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.offset_=e.offset,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?.slice(),lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),offset:this.getOffset(),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_}getOffset(){return this.offset_}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}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}},uu=class e{constructor(e){e||={},this.geometry_=null,this.geometryFunction_=hu,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill===void 0?null:e.fill,this.image_=e.image===void 0?null:e.image,this.renderer_=e.renderer===void 0?null:e.renderer,this.hitDetectionRenderer_=e.hitDetectionRenderer===void 0?null:e.hitDetectionRenderer,this.stroke_=e.stroke===void 0?null:e.stroke,this.text_=e.text===void 0?null:e.text,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&typeof t==`object`&&(t=t.clone()),new e({geometry:t??void 0,fill:this.getFill()?.clone(),image:this.getImage()?.clone(),renderer:this.getRenderer()??void 0,stroke:this.getStroke()?.clone(),text:this.getText()?.clone(),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_=hu,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function du(e){let t;if(typeof e==`function`)t=e;else{let n;Array.isArray(e)?n=e:(B(typeof e.getZIndex==`function`,"Expected an `Style` or an array of `Style`"),n=[e]),t=function(){return n}}return t}var fu=null;function pu(e,t){if(!fu){let e=new ou({color:`rgba(255,255,255,0.4)`}),t=new lu({color:`#3399CC`,width:1.25});fu=[new uu({image:new au({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return fu}function mu(){let e={},t=[255,255,255,1],n=[0,153,255,1];return e.Polygon=[new uu({fill:new ou({color:[255,255,255,.5]})})],e.MultiPolygon=e.Polygon,e.LineString=[new uu({stroke:new lu({color:t,width:5})}),new uu({stroke:new lu({color:n,width:3})})],e.MultiLineString=e.LineString,e.Circle=e.Polygon.concat(e.LineString),e.Point=[new uu({image:new au({radius:6,fill:new ou({color:n}),stroke:new lu({color:t,width:1.5})}),zIndex:1/0})],e.MultiPoint=e.Point,e.GeometryCollection=e.Polygon.concat(e.LineString,e.Point),e}function hu(e){return e.getGeometry()}var gu=`#333`,_u=class e{constructor(e){e||={},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=vc(e.scale===void 0?1:e.scale),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?new ou({color:gu}):e.fill,this.maxAngle_=e.maxAngle===void 0?Math.PI/4:e.maxAngle,this.placement_=e.placement===void 0?`point`:e.placement,this.overflow_=!!e.overflow,this.stroke_=e.stroke===void 0?null:e.stroke,this.offsetX_=e.offsetX===void 0?0:e.offsetX,this.offsetY_=e.offsetY===void 0?0:e.offsetY,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(){let t=this.getScale();return new e({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(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof ou?this.getFill().clone():this.getFill(),stroke:this.getStroke()?.clone(),offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?.clone(),backgroundStroke:this.getBackgroundStroke()?.clone(),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_=vc(e===void 0?1:e)}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 vu(e){return!0}function yu(e,t){t??=Ic();let n=Su(e,t),r=al();return function(e,i){if(r.properties=e.getPropertiesInternal()??{},r.resolution=i,t.featureId){let t=e.getId();t===void 0?r.featureId=null:r.featureId=t}if(t.geometryType){let t=e.getGeometry();t&&(r.geometryType=il(t))}return n(r)}}function bu(e,t){t??=Ic();let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=Cu(e[i],t);let i=al(),a=Array(n);return function(e,o){if(i.properties=e.getPropertiesInternal()??{},i.resolution=o,t.featureId){let t=e.getId();t===void 0?i.featureId=null:i.featureId=t}if(t.geometryType){let t=e.getGeometry();t&&(i.geometryType=il(t))}let s=0;for(let e=0;e<n;++e){let t=r[e](i);t&&(a[s]=t,s+=1)}return a.length=s,a}}function xu(e,t){if(t??=Ic(),!Array.isArray(e))return bu([e],t);let n=e.length;if(`style`in e[0]){let r=Array(n);for(let t=0;t<n;++t){let n=e[t];if(!(`style`in n))throw Error(`Expected a list of rules with a style property`);r[t]=n}return yu(r,t)}return bu(e,t)}function Su(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i){let n=e[i],a=`filter`in n&&n.filter!==void 0?ol(n.filter,bc,t):vu,o;if(Array.isArray(n.style)){let e=n.style.length;o=Array(e);for(let r=0;r<e;++r)o[r]=Cu(n.style[r],t)}else o=[Cu(n.style,t)];r[i]={filter:a,styles:o}}return function(t){let i=[],a=!1;for(let o=0;o<n;++o)if((0,r[o].filter)(t)&&!(e[o].else&&a)){a=!0;for(let e of r[o].styles){let n=e(t);n&&i.push(n)}}return i}}function Cu(e,t){let n=wu(e,``,t),r=Tu(e,``,t),i=Eu(e,t),a=Du(e,t),o=Mu(e,`z-index`,t);if(!n&&!r&&!i&&!a&&!Fe(e))throw Error(`No fill, stroke, point, or text symbolizer properties in style: `+JSON.stringify(e));let s=new uu;return function(e){let t=!0;if(n){let r=n(e);r&&(t=!1),s.setFill(r)}if(r){let n=r(e);n&&(t=!1),s.setStroke(n)}if(i){let n=i(e);n&&(t=!1),s.setText(n)}if(a){let n=a(e);n&&(t=!1),s.setImage(n)}return o&&s.setZIndex(o(e)),t?null:s}}function wu(e,t,n){let r;if(t+`fill-pattern-src`in e)r=Pu(e,t+`fill-`,n);else{if(ju(e,t+`fill-color`)===`none`)return e=>null;r=Iu(e,t+`fill-color`,n)}if(!r)return null;let i=new ou;return function(e){let t=r(e);return t===Ks?null:(i.setColor(t),i)}}function Tu(e,t,n){let r=Mu(e,t+`stroke-width`,n),i=Iu(e,t+`stroke-color`,n);if(!r&&!i)return null;let a=Nu(e,t+`stroke-line-cap`,n),o=Nu(e,t+`stroke-line-join`,n),s=Lu(e,t+`stroke-line-dash`,n),c=Mu(e,t+`stroke-line-dash-offset`,n),l=Mu(e,t+`stroke-miter-limit`,n),u=Mu(e,t+`stroke-offset`,n),d=new lu;return function(e){if(i){let t=i(e);if(t===Ks)return null;d.setColor(t)}if(r&&d.setWidth(r(e)),a){let t=a(e);if(t!==`butt`&&t!==`round`&&t!==`square`)throw Error(`Expected butt, round, or square line cap`);d.setLineCap(t)}if(o){let t=o(e);if(t!==`bevel`&&t!==`round`&&t!==`miter`)throw Error(`Expected bevel, round, or miter line join`);d.setLineJoin(t)}return s&&d.setLineDash(s(e)),c&&d.setLineDashOffset(c(e)),l&&d.setMiterLimit(l(e)),u&&d.setOffset(u(e)),d}}function Eu(e,t){let n=`text-`,r=Nu(e,`text-value`,t);if(!r)return null;let i=wu(e,n,t),a=wu(e,`text-background-`,t),o=Tu(e,n,t),s=Tu(e,`text-background-`,t),c=Nu(e,`text-font`,t),l=Mu(e,`text-max-angle`,t),u=Mu(e,`text-offset-x`,t),d=Mu(e,`text-offset-y`,t),f=Fu(e,`text-overflow`,t),p=Nu(e,`text-placement`,t),m=Mu(e,`text-repeat`,t),h=Bu(e,`text-scale`,t),g=Fu(e,`text-rotate-with-view`,t),_=Mu(e,`text-rotation`,t),v=Nu(e,`text-align`,t),y=Nu(e,`text-justify`,t),b=Nu(e,`text-baseline`,t),x=Fu(e,`text-keep-upright`,t),S=Lu(e,`text-padding`,t),C=new _u({declutterMode:qu(e,`text-declutter-mode`)});return function(e){if(C.setText(r(e)),i&&C.setFill(i(e)),a&&C.setBackgroundFill(a(e)),o&&C.setStroke(o(e)),s&&C.setBackgroundStroke(s(e)),c&&C.setFont(c(e)),l&&C.setMaxAngle(l(e)),u&&C.setOffsetX(u(e)),d&&C.setOffsetY(d(e)),f&&C.setOverflow(f(e)),p){let t=p(e);if(t!==`point`&&t!==`line`)throw Error(`Expected point or line for text-placement`);C.setPlacement(t)}if(m&&C.setRepeat(m(e)),h&&C.setScale(h(e)),g&&C.setRotateWithView(g(e)),_&&C.setRotation(_(e)),v){let t=v(e);if(t!==`left`&&t!==`center`&&t!==`right`&&t!==`end`&&t!==`start`)throw Error(`Expected left, right, center, start, or end for text-align`);C.setTextAlign(t)}if(y){let t=y(e);if(t!==`left`&&t!==`right`&&t!==`center`)throw Error(`Expected left, right, or center for text-justify`);C.setJustify(t)}if(b){let t=b(e);if(t!==`bottom`&&t!==`top`&&t!==`middle`&&t!==`alphabetic`&&t!==`hanging`)throw Error(`Expected bottom, top, middle, alphabetic, or hanging for text-baseline`);C.setTextBaseline(t)}return S&&C.setPadding(S(e)),x&&C.setKeepUpright(x(e)),C}}function Du(e,t){return`icon-src`in e?Ou(e,t):`shape-points`in e?ku(e,t):`circle-radius`in e?Au(e,t):null}function Ou(e,t){let n=`icon-src`,r=Yu(ju(e,n),n),i=Ru(e,`icon-anchor`,t),a=Bu(e,`icon-scale`,t),o=Mu(e,`icon-opacity`,t),s=Ru(e,`icon-displacement`,t),c=Mu(e,`icon-rotation`,t),l=Fu(e,`icon-rotate-with-view`,t),u=Wu(e,`icon-anchor-origin`),d=Gu(e,`icon-anchor-x-units`),f=Gu(e,`icon-anchor-y-units`),p=ju(e,`icon-color`),m,h=null;p!==void 0&&(Array.isArray(p)&&p.length>0&&typeof p[0]==`string`?h=Iu(e,`icon-color`,t):m=Zu(p,`icon-color`));let g=Uu(e,`icon-cross-origin`),_=Ku(e,`icon-offset`),v=Wu(e,`icon-offset-origin`),y=Vu(e,`icon-width`),b={src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,crossOrigin:g,offset:_,offsetOrigin:v,height:Vu(e,`icon-height`),width:y,size:Hu(e,`icon-size`),declutterMode:qu(e,`icon-declutter-mode`)},x=null;return function(e){if(x)h&&x.setColor(h(e));else{let t=h?h(e):m;x=new cu(t===void 0?Object.assign({},b):Object.assign({},b,{color:t}))}return o&&x.setOpacity(o(e)),s&&x.setDisplacement(s(e)),c&&x.setRotation(c(e)),l&&x.setRotateWithView(l(e)),a&&x.setScale(a(e)),i&&x.setAnchor(i(e)),x}}function ku(e,t){let n=`shape-`,r=`shape-points`,i=`shape-radius`,a=Xu(ju(e,r),r);if(!(i in e))throw Error(`Expected a number for ${i}`);let o=Mu(e,i,t),s=ju(e,i),c=typeof s==`number`?s:5,l=`shape-radius2`,u=Mu(e,l,t),d=ju(e,l),f=typeof d==`number`?d:void 0,p=wu(e,n,t),m=Tu(e,n,t),h=Bu(e,`shape-scale`,t),g=Ru(e,`shape-displacement`,t),_=Mu(e,`shape-rotation`,t),v=Fu(e,`shape-rotate-with-view`,t),y=new iu({points:a,radius:c,radius2:f,angle:Vu(e,`shape-angle`),declutterMode:qu(e,`shape-declutter-mode`)});return function(e){return o&&y.setRadius(o(e)),u&&y.setRadius2(u(e)),p&&y.setFill(p(e)),m&&y.setStroke(m(e)),g&&y.setDisplacement(g(e)),_&&y.setRotation(_(e)),v&&y.setRotateWithView(v(e)),h&&y.setScale(h(e)),y}}function Au(e,t){let n=`circle-`,r=wu(e,n,t),i=Tu(e,n,t),a=Mu(e,`circle-radius`,t),o=Bu(e,`circle-scale`,t),s=Ru(e,`circle-displacement`,t),c=Mu(e,`circle-rotation`,t),l=Fu(e,`circle-rotate-with-view`,t),u=new au({radius:5,declutterMode:qu(e,`circle-declutter-mode`)});return function(e){return a&&u.setRadius(a(e)),r&&u.setFill(r(e)),i&&u.setStroke(i(e)),s&&u.setDisplacement(s(e)),c&&u.setRotation(c(e)),l&&u.setRotateWithView(l(e)),o&&u.setScale(o(e)),u}}function ju(e,t){if(!(t in e))return;let n=e[t];return n===void 0?void 0:n}function Mu(e,t,n){let r=ju(e,t);if(r===void 0)return;let i=ol(r,U,n);return function(e){return Xu(i(e),t)}}function Nu(e,t,n){let r=ju(e,t);if(r===void 0)return null;let i=ol(r,xc,n);return function(e){return Yu(i(e),t)}}function Pu(e,t,n){let r=Nu(e,t+`pattern-src`,n),i=zu(e,t+`pattern-offset`,n),a=zu(e,t+`pattern-size`,n),o=Iu(e,t+`color`,n);return function(e){return r?{src:r(e),offset:i?i(e):null,size:a?a(e):null,color:o?o(e):null}:null}}function Fu(e,t,n){let r=ju(e,t);if(r===void 0)return null;let i=ol(r,bc,n);return function(e){let n=i(e);if(typeof n!=`boolean`)throw Error(`Expected a boolean for ${t}`);return n}}function Iu(e,t,n){let r=ju(e,t);if(r===void 0)return null;let i=ol(r,Sc,n);return function(e){return Zu(i(e),t)}}function Lu(e,t,n){let r=ju(e,t);if(r===void 0)return null;if(Array.isArray(r)&&(r.length===0||typeof r[0]!=`string`)){let e=r.map((e,r)=>{if(typeof e==`number`)return()=>e;let i=ol(e,U,n);return function(e){return Xu(i(e),`${t}[${r}]`)}});return function(t){let n=Array(e.length);for(let r=0;r<e.length;++r)n[r]=e[r](t);return n}}let i=ol(r,Cc,n);return function(e){return Ju(i(e),t)}}function Ru(e,t,n){let r=ju(e,t);if(r===void 0)return null;let i=ol(r,Cc,n);return function(e){let n=Ju(i(e),t);if(n.length!==2)throw Error(`Expected two numbers for ${t}`);return n}}function zu(e,t,n){let r=ju(e,t);if(r===void 0)return null;let i=ol(r,Cc,n);return function(e){return Qu(i(e),t)}}function Bu(e,t,n){let r=ju(e,t);if(r===void 0)return null;let i=ol(r,Cc|U,n);return function(e){return $u(i(e),t)}}function Vu(e,t){let n=ju(e,t);if(n!==void 0){if(typeof n!=`number`)throw Error(`Expected a number for ${t}`);return n}}function Hu(e,t){let n=ju(e,t);if(n!==void 0){if(typeof n==`number`)return vc(n);if(!Array.isArray(n)||n.length!==2||typeof n[0]!=`number`||typeof n[1]!=`number`)throw Error(`Expected a number or size array for ${t}`);return n}}function Uu(e,t){let n=ju(e,t);if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);return n}}function Wu(e,t){let n=ju(e,t);if(n!==void 0){if(n!==`bottom-left`&&n!==`bottom-right`&&n!==`top-left`&&n!==`top-right`)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return n}}function Gu(e,t){let n=ju(e,t);if(n!==void 0){if(n!==`pixels`&&n!==`fraction`)throw Error(`Expected pixels or fraction for ${t}`);return n}}function Ku(e,t){let n=ju(e,t);if(n!==void 0)return Ju(n,t)}function qu(e,t){let n=ju(e,t);if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);if(n!==`declutter`&&n!==`obstacle`&&n!==`none`)throw Error(`Expected declutter, obstacle, or none for ${t}`);return n}}function Ju(e,t){if(!Array.isArray(e))throw Error(`Expected an array for ${t}`);let n=e.length;for(let r=0;r<n;++r)if(typeof e[r]!=`number`)throw Error(`Expected an array of numbers for ${t}`);return e}function Yu(e,t){if(typeof e!=`string`)throw Error(`Expected a string for ${t}`);return e}function Xu(e,t){if(typeof e!=`number`)throw Error(`Expected a number for ${t}`);return e}function Zu(e,t){if(typeof e==`string`)return e;let n=Ju(e,t),r=n.length;if(r<3||r>4)throw Error(`Expected a color with 3 or 4 values for ${t}`);return n}function Qu(e,t){let n=Ju(e,t);if(n.length!==2)throw Error(`Expected an array of two numbers for ${t}`);return n}function $u(e,t){return typeof e==`number`?e:Qu(e,t)}var ed={RENDER_ORDER:`renderOrder`},td=class extends Es{constructor(e){e||={};let 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?100:e.renderBuffer,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0&&e.updateWhileAnimating,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0&&e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(ed.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){let n=this.getDeclutter();if(!n)return;e.declutter||={},n in e.declutter||(e.declutter[n]=new js(9));let r=this.getRenderer();r&&r.renderDeclutter(e,t)}setRenderOrder(e){this.set(ed.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?pu:e??null;let t=nd(e);this.styleFunction_=e===null||t===null?void 0:du(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}};function nd(e){if(e===void 0)return pu;if(!e)return null;if(typeof e==`function`||e instanceof uu)return e;if(Array.isArray(e)&&e.length===0)return[];if(Array.isArray(e)&&e[0]instanceof uu){let t=e.length,n=Array(t);for(let r=0;r<t;++r){let t=e[r];if(!(t instanceof uu))throw Error(`Expected a list of style instances`);n[r]=t}return n}return xu(e)}var rd=class extends et{constructor(e,t,n,r){super(e),this.inversePixelTransform=t,this.frameState=n,this.context=r??void 0}},id=class extends Re{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){I()}calculateMatrices2D(e){let t=e.viewState,n=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Fi(n,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Ii(r,n)}forEachFeatureAtCoordinate(e,t,n,r,i,a,o,s){let c,l=t.viewState;function u(e,t,n,r){return i.call(a,t,e?n:null,r)}let d=l.projection,f=zn(e.slice(),d),p=[[0,0]];if(d.canWrapX()&&r){let e=V(d.getExtent());p.push([-e,0],[e,0])}let m=t.layerStatesArray,h=m.length,g=[],_=[];for(let r=0;r<p.length;r++)for(let i=h-1;i>=0;--i){let a=m[i],d=a.layer;if(d.hasRenderer()&&Ds(a,l)&&o.call(s,d)){let i=d.getRenderer(),o=d.getSource();if(i&&o){let s=o.getWrapX()?f:e,l=u.bind(null,a.managed);_[0]=s[0]+p[r][0],_[1]=s[1]+p[r][1],c=i.forEachFeatureAtCoordinate(_,t,n,l,g)}if(c)return c}}if(g.length===0)return;let v=1/g.length;return g.forEach((e,t)=>e.distanceSq+=t*v),g.sort((e,t)=>e.distanceSq-t.distanceSq),g.some(e=>c=e.callback(e.feature,e.layer,e.geometry)),c}hasFeatureAtCoordinate(e,t,n,r,i,a){return this.forEachFeatureAtCoordinate(e,t,n,r,Ye,this,i,a)!==void 0}getMap(){return this.map_}renderFrame(e){I()}scheduleExpireIconCache(e){Ol.canExpireCache()&&e.postRenderFunctions.push(ad)}};function ad(e,t){Ol.expire()}var od=class extends id{constructor(e){super(e),this.fontChangeListenerKey_=P(Ul,Ne.PROPERTYCHANGE,e.redrawText,e),this.element_=ht?Eo():document.createElement(`div`);let t=this.element_.style;t.position=`absolute`,t.width=`100%`,t.height=`100%`,t.zIndex=`0`,this.element_.className=fo+` ol-layers`;let n=e.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let n=this.getMap();if(n.hasListener(e)){let r=new rd(e,void 0,t);n.dispatchEvent(r)}}disposeInternal(){Le(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&=(this.element_.style.display=`none`,!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Ts.PRECOMPOSE,e);let t=e.layerStatesArray.sort((e,t)=>e.zIndex-t.zIndex);t.some(e=>e.layer instanceof td&&e.layer.getDeclutter())&&(e.declutter={});let n=e.viewState;this.children_.length=0;let r=this.getMap().getTargetElement(),i;Do(r)&&(i=r.getContext(`2d`),i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,r.width,r.height));let a=[],o=i?r:null;for(let r=0,i=t.length;r<i;++r){let i=t[r];e.layerIndex=r;let s=i.layer,c=s.getSourceState();if(!Ds(i,n)||c!=`ready`&&c!=`undefined`){s.unrender();continue}let l=s.render(e,o);l&&(l!==o&&(this.children_.push(l),o=l),a.push(i))}if(this.declutter(e,a),To(this.element_,this.children_),i)for(let e of this.children_){let t=e.firstElementChild||e,n=e.style.backgroundColor;if(n&&(!Do(t)||t.width>0)&&(i.fillStyle=n,i.fillRect(0,0,i.canvas.width,i.canvas.height)),!Do(t)||t.width===0)continue;i.save();let r=e.style.opacity||t.style.opacity;i.globalAlpha=r===``?1:Number(r);let a=t.style.transform;if(a)i.transform(...Bi(a));else{let e=parseFloat(t.style.width)/t.width,n=parseFloat(t.style.height)/t.height;i.transform(e,0,0,n,0,0)}i.drawImage(t,0,0),i.restore()}this.dispatchRenderEvent(Ts.POSTCOMPOSE,e),this.renderedVisible_||=(this.element_.style.display=``,!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let n=t.length-1;n>=0;--n){let r=t[n],i=r.layer;i.getDeclutter()&&i.renderDeclutter(e,r)}t.forEach(t=>t.layer?.renderDeferred(e))}}};function sd(e){e instanceof Es?e.setMapInternal(null):e instanceof ws&&e.getLayers().forEach(sd)}function cd(e,t){if(e instanceof Es)e.setMapInternal(t);else if(e instanceof ws){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)cd(n[e],t)}}var ld=class extends at{constructor(e){super(),e||={},this.on,this.once,this.un;let t=ud(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.ctrlKey_=!1,this.boundHandleCtrlKey_=this.handleCtrlKey_.bind(this),this.maxTilesLoading_=e.maxTilesLoading===void 0?16:e.maxTilesLoading,this.pixelRatio_=e.pixelRatio===void 0?mt:e.pixelRatio,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Di(),this.pixelToCoordinateTransform_=Di(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_,this.overlayContainer_,this.overlayContainerStopEvent_,ht||(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,ht||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(ht?new ct:Mo()),this.interactions=t.interactions||(ht?new ct:vs({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Tt(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(St.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(St.VIEW,this.handleViewChanged_),this.addChangeListener(St.SIZE,this.handleSizeChanged_),this.addChangeListener(St.TARGET,this.handleTargetChanged_),this.setProperties(t.values);let n=this;e.view&&!(e.view instanceof ro)&&e.view.then(function(e){n.setView(new ro(e))}),this.controls.addEventListener(Me.ADD,(e=>{e.element.setMap(this)})),this.controls.addEventListener(Me.REMOVE,(e=>{e.element.setMap(null)})),this.interactions.addEventListener(Me.ADD,(e=>{e.element.setMap(this)})),this.interactions.addEventListener(Me.REMOVE,(e=>{e.element.setMap(null)})),this.overlays_.addEventListener(Me.ADD,(e=>{this.addOverlayInternal_(e.element)})),this.overlays_.addEventListener(Me.REMOVE,(e=>{let t=e.element.getId();t!==void 0&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)})),this.controls.forEach(e=>{e.setMap(this)}),this.interactions.forEach(e=>{e.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){cd(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,n){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(e);n=n===void 0?{}:n;let i=n.hitTolerance===void 0?0:n.hitTolerance,a=n.layerFilter===void 0?Ye:n.layerFilter,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,o,t,null,a,null)}getFeaturesAtPixel(e,t){let n=[];return this.forEachFeatureAtPixel(e,function(e){n.push(e)},t),n}getAllLayers(){let e=[];function t(n){n.forEach(function(n){n instanceof ws?t(n.getLayers()):e.push(n)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let n=this.getCoordinateFromPixelInternal(e);t=t===void 0?{}:t;let r=t.layerFilter===void 0?Ye:t.layerFilter,i=t.hitTolerance===void 0?0:t.hitTolerance,a=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_.getBoundingClientRect(),n=this.getSize(),r=t.width/n[0],i=t.height/n[1],a=`changedTouches`in e?e.changedTouches[0]:e;return[(a.clientX-t.left)/r,(a.clientY-t.top)/i]}getTarget(){return this.get(St.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e,t){let n=yi(this.getCoordinateFromPixelInternal(e),this.getView().getProjection());return t?.wrapX&&n&&zn(n,vi()||this.getView().getProjection()),n}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?Mi(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return t===void 0?null:t}getInteractions(){return this.interactions}getLayerGroup(){return this.get(St.LAYERGROUP)}setLayers(e){let t=this.getLayerGroup();if(e instanceof ct){t.setLayers(e);return}let n=t.getLayers();n.clear(),n.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}updateRenderComplete_(){this.renderComplete_=(this.hasListener(xt.LOADSTART)||this.hasListener(xt.LOADEND)||this.hasListener(Ts.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady()}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){let n=e[t];if(!n.visible)continue;let r=n.layer.getRenderer();if(r&&!r.ready)return!0;let i=n.layer.getSource();if(i&&i.loading)return!0}return!1}getPixelFromCoordinate(e,t){let n=this.getView().getProjection(),r=bi(e,n);return t?.wrapX&&this.frameState_&&(r=Bn(r.slice(),n,this.frameState_.viewState.center[0])),this.getPixelFromCoordinateInternal(r)}getPixelFromCoordinateInternal(e){let t=this.frameState_;return t?Mi(t.coordinateToPixelTransform,e.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(e){this.pixelRatio_!==e&&(this.pixelRatio_=e,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get(St.SIZE)}getView(){return this.get(St.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,n,r){return Et(this.frameState_,e,t,n,r)}handleBrowserEvent(e,t){t||=e.type;let n=new ut(t,this,e);this.handleMapBrowserEvent(n)}handleCtrlKey_(e){let t=e;this.ctrlKey_=t.key===`Control`?t.type===F.KEYDOWN:t.ctrlKey}handleMapBrowserEvent(e){if(e.originalEvent.ctrlKey===!1&&(this.ctrlKey_=!1),e.ctrlKey=this.ctrlKey_,!this.frameState_)return;let t=e.originalEvent,n=t.type;if(n===yt.POINTERDOWN||n===F.WHEEL||n===F.KEYDOWN){let e=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():e,r=t.target,i=n instanceof ShadowRoot?n.host===r?n.host.ownerDocument:n:n===e?e.documentElement:n;if(this.overlayContainerStopEvent_.contains(r)||!i.contains(r))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){let t=this.getInteractions().getArray().slice();for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.getMap()===this&&r.getActive()&&this.getTargetElement()&&(!r.handleEvent(e)||e.propagationStopped))break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let n=this.maxTilesLoading_,r=n,i=e?e.viewHints:void 0;if(i&&(i[Dt.ANIMATING]||i[Dt.INTERACTING])){let t=Date.now()-e.time>8;n=t?0:8,r=t?0:2}if(t.getTilesLoading()<n){let e=t.getCount();t.reprioritize(),t.getCount()<e&&this.updateRenderComplete_(),t.loadMoreTiles(n,r)}}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Ts.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Ts.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new lt(xt.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new lt(xt.LOADSTART,this,e))));let n=this.postRenderFunctions_;if(e)for(let t=0,r=n.length;t<r;++t)n[t](this,e);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){let e=this.targetChangeHandlerKeys_;for(let t=0,n=e.length;t<n;++t)Le(e[t]);this.targetChangeHandlerKeys_=null;let t=this.getOwnerDocument();t.removeEventListener(F.KEYDOWN,this.boundHandleCtrlKey_,!0),t.removeEventListener(F.KEYUP,this.boundHandleCtrlKey_,!0),this.ctrlKey_=!1,this.viewport_.removeEventListener(F.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(F.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!Do(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);let e=this.targetElement_.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.unobserve(e.host),this.setSize(void 0)}let 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(),null),this.animationDelayKey_&&=(cancelAnimationFrame(this.animationDelayKey_),void 0);else{if(Do(t)||t.appendChild(this.viewport_),this.renderer_||=new od(this),!Do(t)){this.mapBrowserEventHandler_=new bt(this,this.moveTolerance_);for(let e in R)this.mapBrowserEventHandler_.addEventListener(R[e],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(F.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(F.WHEEL,this.boundHandleBrowserEvent_,vt?{passive:!1}:!1);let e=this.getOwnerDocument();e.addEventListener(F.KEYDOWN,this.boundHandleCtrlKey_,!0),e.addEventListener(F.KEYUP,this.boundHandleCtrlKey_,!0);let n;if(this.keyboardEventTarget_)n=this.keyboardEventTarget_;else{let e=t.getRootNode();n=e instanceof ShadowRoot?e.host:t}if(this.targetChangeHandlerKeys_=[P(n,F.KEYDOWN,this.handleBrowserEvent,this),P(n,F.KEYPRESS,this.handleBrowserEvent,this)],!Do(t)){let e=t.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.observe(e.host),this.resizeObserver_?.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&=(Le(this.viewPropertyListenerKey_),null),this.viewChangeListenerKey_&&=(Le(this.viewChangeListenerKey_),null);let e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=P(e,Ne.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=P(e,F.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&=(this.layerGroupPropertyListenerKeys_.forEach(Le),null);let e=this.getLayerGroup();e&&(this.handleLayerAdd_(new Ss(`addlayer`,e)),this.layerGroupPropertyListenerKeys_=[P(e,Ne.PROPERTYCHANGE,this.render,this),P(e,F.CHANGE,this.render,this),P(e,`addlayer`,this.handleLayerAdd_,this),P(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;let e=this.frameState_.layerStatesArray;for(let t=0,n=e.length;t<n;++t){let n=e[t].layer;n.hasRenderer()&&n.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){sd(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){let t=this.getSize(),n=this.getView(),r=this.frameState_,i=null;if(t!==void 0&&gc(t)&&n&&n.isDef()){let r=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:gn(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:r,wantedTiles:{},mapId:L(this),renderTargets:{}},a.nextCenter&&a.nextResolution){let e=isNaN(a.nextRotation)?a.rotation:a.nextRotation;i.nextExtent=gn(a.nextCenter,a.nextResolution,e,t)}}this.frameState_=i,this.renderer_.renderFrame(i),i&&(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),r&&(this.previousExtent_&&(wn(this.previousExtent_)||an(i.extent,this.previousExtent_))||(this.dispatchEvent(new lt(xt.MOVESTART,this,r)),this.previousExtent_=tn(this.previousExtent_))),this.previousExtent_&&!i.viewHints[Dt.ANIMATING]&&!i.viewHints[Dt.INTERACTING]&&!an(i.extent,this.previousExtent_)&&(this.dispatchEvent(new lt(xt.MOVEEND,this,i)),qt(i.extent,this.previousExtent_))),this.dispatchEvent(new lt(xt.POSTRENDER,this,i)),this.updateRenderComplete_(),this.postRenderTimeoutHandle_||=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0)}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new Ss(`removelayer`,t)),this.set(St.LAYERGROUP,e)}setSize(e){this.set(St.SIZE,e)}setTarget(e){this.set(St.TARGET,e)}setView(e){if(!e||e instanceof ro){this.set(St.VIEW,e);return}this.set(St.VIEW,new ro);let t=this;e.then(function(e){t.setView(new ro(e))})}updateSize(){let e=this.getTargetElement(),t;if(e){let n,r;if(Do(e)){let t=e.getContext(`2d`).getTransform();n=e.width/t.a,r=e.height/t.d}else{let t=getComputedStyle(e);n=e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),r=e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)}!isNaN(n)&&!isNaN(r)&&(t=[Math.max(0,n),Math.max(0,r)],!gc(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&Xn(`No map visible because the map container's width or height are 0.`))}let n=this.getSize();!t||n&&Ge(t,n)||(this.updateViewportSize_(t),this.setSize(t))}updateViewportSize_(e){let t=this.getView();t&&t.setViewportSize(e)}};function ud(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget==`string`?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let n={},r=e.layers&&typeof e.layers.getLayers==`function`?e.layers:new ws({layers:e.layers});n[St.LAYERGROUP]=r,n[St.TARGET]=e.target,n[St.VIEW]=e.view instanceof ro?e.view:new ro;let i;e.controls!==void 0&&(Array.isArray(e.controls)?i=new ct(e.controls.slice()):(B(typeof e.controls.getArray==`function`,"Expected `controls` to be an array or an `ol/Collection.js`"),i=e.controls));let a;e.interactions!==void 0&&(Array.isArray(e.interactions)?a=new ct(e.interactions.slice()):(B(typeof e.interactions.getArray==`function`,"Expected `interactions` to be an array or an `ol/Collection.js`"),a=e.interactions));let o;return e.overlays===void 0?o=new ct:Array.isArray(e.overlays)?o=new ct(e.overlays.slice()):(B(typeof e.overlays.getArray==`function`,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=e.overlays),{controls:i,interactions:a,keyboardEventTarget:t,overlays:o,values:n}}var dd=class e extends at{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`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}}clone(){let t=new e,n=this.geometryName_;t.setGeometryName(n);let r=this.getPropertiesInternal();if(r){let e=this.getGeometry();for(let i in r)i===n&&e?t.set(i,e.clone()):t.set(i,r[i],!0)}let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&=(Le(this.geometryChangeKey_),null);let e=this.getGeometry();e&&(this.geometryChangeKey_=P(e,F.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e??null,this.styleFunction_=e?fd(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){e!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}};function fd(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(B(typeof e.getZIndex==`function`,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}function pd(e,t,n,r,i,a,o){let s,c,l=(n-t)/r;if(l===1)s=t;else if(l===2)s=t,c=i;else if(l!==0){let a=e[t],o=e[t+1],l=0,u=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];l+=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),u.push(l),a=t,o=n}let d=i*l,f=ze(u,d);f<0?(c=(d-u[-f-2])/(u[-f-1]-u[-f-2]),s=t+(-f-2)*r):s=t+f*r}o=o!==void 0&&o>1?o:2,a||=Array(o);for(let t=0;t<o;++t)a[t]=s===void 0?NaN:c===void 0?e[s+t]:It(e[s+t],e[s+r+t],c);return a}function md(e,t,n,r,i,a){if(n==t)return null;let o;if(i<e[t+r-1])return a?(o=e.slice(t,t+r),o[r-1]=i,o):null;if(e[n-1]<i)return a?(o=e.slice(n-r,n),o[r-1]=i,o):null;if(i==e[t+r-1])return e.slice(t,t+r);let s=t/r,c=n/r;for(;s<c;){let t=s+c>>1;i<e[(t+1)*r-1]?c=t:s=t+1}let l=e[s*r-1];if(i==l)return e.slice((s-1)*r,(s-1)*r+r);let u=e[(s+1)*r-1],d=(i-l)/(u-l);o=[];for(let t=0;t<r-1;++t)o.push(It(e[(s-1)*r+t],e[s*r+t],d));return o.push(i),o}function hd(e,t,n,r,i,a,o){if(o)return md(e,t,n[n.length-1],r,i,a);let s;if(i<e[r-1])return a?(s=e.slice(0,r),s[r-1]=i,s):null;if(e[e.length-1]<i)return a?(s=e.slice(e.length-r),s[r-1]=i,s):null;for(let a=0,o=n.length;a<o;++a){let o=n[a];if(t!=o){if(i<e[t+r-1])return null;if(i<=e[o-1])return md(e,t,o,r,i,!1);t=o}}return null}function gd(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}var _d=class e extends Yi{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){We(this.flatCoordinates,e),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Jt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,n,r))}forEachSegment(e){return ba(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,md(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return pa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return pd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return gd(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(t){let n=[];return n.length=Ea(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LineString`}intersectsExtent(e){return xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ua(this.flatCoordinates,0,e,this.stride),this.changed()}},vd=class e extends Yi{constructor(e,t,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&n)this.setFlatCoordinates(t,e),this.ends_=n;else{let t=e,n=[],r=[];for(let e=0,i=t.length;e<i;++e)We(n,t[e].getFlatCoordinates()),r.push(n.length);let i=t.length===0?this.getLayout():t[0].getLayout();this.setFlatCoordinates(i,n),this.ends_=r}}appendLineString(e){We(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Jt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ia(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,n,r))}getCoordinateAtM(e,t,n){return this.layout!=`XYM`&&this.layout!=`XYZM`||this.flatCoordinates.length===0?null:(t=t!==void 0&&t,n=n!==void 0&&n,hd(this.flatCoordinates,0,this.ends_,this.stride,e,t,n))}getCoordinates(){return ma(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new _d(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){let e=this.flatCoordinates,t=this.ends_,n=this.layout,r=[],i=0;for(let a=0,o=t.length;a<o;++a){let o=t[a],s=new _d(e.slice(i,o),n);r.push(s),i=o}return r}getLength(){let e=this.ends_,t=0,n=0;for(let r=0,i=e.length;r<i;++r)n+=gd(this.flatCoordinates,t,e[r],this.stride),t=e[r];return n}getFlatMidpoints(){let e=[],t=this.flatCoordinates,n=0,r=this.ends_,i=this.stride;for(let a=0,o=r.length;a<o;++a){let o=r[a];We(e,pd(t,n,o,i,.5)),n=o}return e}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=Da(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,`XY`,r)}getType(){return`MultiLineString`}intersectsExtent(e){return Sa(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=da(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},yd=class e extends Yi{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){We(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Jt(this.getExtent(),e,t))return r;let i=this.flatCoordinates,a=this.stride;for(let o=0,s=i.length;o<s;o+=a){let s=jt(e,t,i[o],i[o+1]);if(s<r){r=s;for(let e=0;e<a;++e)n[e]=i[o+e];n.length=a}}return r}getCoordinates(){return pa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){let t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new Na(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){let e=this.flatCoordinates,t=this.layout,n=this.stride,r=[];for(let i=0,a=e.length;i<a;i+=n){let a=new Na(e.slice(i,i+n),t);r.push(a)}return r}getType(){return`MultiPoint`}intersectsExtent(e){let t=this.flatCoordinates,n=this.stride;for(let r=0,i=t.length;r<i;r+=n)if(Zt(e,t[r],t[r+1]))return!0;return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ua(this.flatCoordinates,0,e,this.stride),this.changed()}};function bd(e,t,n,r){let i=[],a=$t();for(let o=0,s=n.length;o<s;++o){let s=n[o];a=rn(e,t,s[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=s[s.length-1]}return i}var xd=class e extends Yi{constructor(e,t,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){let r=e,i=[],a=[];for(let e=0,t=r.length;e<t;++e){let t=r[e],n=i.length,o=t.getEnds();for(let e=0,t=o.length;e<t;++e)o[e]+=n;We(i,t.getFlatCoordinates()),a.push(o)}t=r.length===0?this.getLayout():r[0].getLayout(),e=i,n=a}t!==void 0&&n?(this.setFlatCoordinates(t,e),this.endss_=n):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{let n=this.flatCoordinates.length;We(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let e=0,r=t.length;e<r;++e)t[e]+=n}this.endss_.push(t),this.changed()}clone(){let t=this.endss_.length,n=Array(t);for(let e=0;e<t;++e)n[e]=this.endss_[e].slice();let r=new e(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,t,n,r){return r<Jt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(aa(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ca(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return ya(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return ta(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),Va(t,0,this.endss_,this.stride,e)),ha(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let e=bd(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Fa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new yd(this.getFlatInteriorPoints().slice(),`XYM`)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;za(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Va(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=ja(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{let n=this.endss_[e-1];t=n[n.length-1]}let n=this.endss_[e].slice(),r=n[n.length-1];if(t!==0)for(let e=0,r=n.length;e<r;++e)n[e]-=t;return new Ua(this.flatCoordinates.slice(t,r),this.layout,n)}getPolygons(){let e=this.layout,t=this.flatCoordinates,n=this.endss_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a].slice(),s=o[o.length-1];if(i!==0)for(let e=0,t=o.length;e<t;++e)o[e]-=i;let c=new Ua(t.slice(i,s),e,o);r.push(c),i=s}return r}getType(){return`MultiPolygon`}intersectsExtent(e){return Ta(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||=[];let n=fa(this.flatCoordinates,0,e,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{let e=n[n.length-1];this.flatCoordinates.length=e.length===0?0:e[e.length-1]}this.changed()}},Sd=Di(),Cd=class e{constructor(e,t,n,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=i,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||=this.type_===`Point`?nn(this.flatCoordinates_):rn(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let e=mn(this.getExtent());this.flatInteriorPoints_=Pa(this.flatCoordinates_,0,this.ends_,this.stride_,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let e=Ha(this.flatCoordinates_,this.ends_),t=bd(this.flatCoordinates_,0,e,this.stride_);this.flatInteriorPoints_=Fa(this.flatCoordinates_,0,e,this.stride_,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||=pd(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,.5),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let e=this.flatCoordinates_,t=0,n=this.ends_;for(let r=0,i=n.length;r<i;++r){let i=n[r],a=pd(e,t,i,this.stride_,.5);We(this.flatMidpoints_,a),t=i}}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=H(e);let t=e.getExtent(),n=e.getWorldExtent();if(t&&n){let e=vn(n)/vn(t);Fi(Sd,n[0],n[3],e,-e,0,0,0),Hi(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,Sd,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new e(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=Qe((t,n)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);let r=this.simplifiedGeometry_.getFlatCoordinates(),i;switch(this.type_){case`LineString`:r.length=Ea(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,r,0),i=[r.length];break;case`MultiLineString`:i=[],r.length=Da(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,r,0,i);break;case`Polygon`:i=[],r.length=Aa(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),r,0,i)}return i&&(this.simplifiedGeometry_=new e(this.type_,r,i,this.stride_,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};Cd.prototype.getFlatCoordinates=Cd.prototype.getOrientedFlatCoordinates;function wd(e){let t=e.getType();switch(t){case`Point`:return new Na(e.getFlatCoordinates());case`MultiPoint`:return new yd(e.getFlatCoordinates(),`XY`);case`LineString`:return new _d(e.getFlatCoordinates(),`XY`);case`MultiLineString`:return new vd(e.getFlatCoordinates(),`XY`,e.getEnds());case`Polygon`:let n=e.getFlatCoordinates(),r=e.getEnds(),i=Ha(n,r);return i.length>1?new xd(n,`XY`,i):new Ua(n,`XY`,r);default:throw Error(`Invalid geometry type:`+t)}}function Td(e,t){let n=e.getId(),r=wd(e),i=e.getProperties(),a=new dd;return t!==void 0&&a.setGeometryName(t),a.setGeometry(r),n!==void 0&&a.setId(n),a.setProperties(i,!0),a}var Ed=class e extends Ji{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Le),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(P(e[t],F.CHANGE,this.changed,this))}clone(){let t=new e(Dd(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Jt(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){tn(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)on(e,t[n].getExtent());return e}getGeometries(){return Dd(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=mn(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(Dd(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function Dd(e){return e.map(e=>e.clone())}var Od=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=dd,this.supportedMediaTypes=void 0}getReadOptions(e,t){if(t){let n=t.dataProjection?H(t.dataProjection):this.readProjection(e);if(t.extent&&n&&n.getUnits()===`tile-pixels`){let e=H(n);e&&(e.setWorldExtent(t.extent),n=e)}t={dataProjection:n??void 0,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return I()}readFeature(e,t){return I()}readFeatures(e,t){return I()}readGeometry(e,t){return I()}readProjection(e){return I()}writeFeature(e,t){return I()}writeFeatures(e,t){return I()}writeGeometry(e,t){return I()}};function kd(e,t,n){let r=n?H(n.featureProjection):null,i=n?H(n.dataProjection):null,a=e;if(r&&i&&!di(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;if(n.getUnits()===`tile-pixels`)a.transform(n,o);else{let e=mi(n,o);e&&a.applyTransform(e)}}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}function Ad(e,t,n){if(Array.isArray(t[0])){let r=t;return za(e,0,r,n)||(e=e.slice(),Va(e,0,r,n)),e}let r=t;return Ra(e,0,r,n)||(e=e.slice(),Ba(e,0,r,n)),e}function jd(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>jd({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=(n.layout??`XY`).length;return kd(new Cd(r,r===`Polygon`?Ad(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat()??[],i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function Md(e,t){if(!e)return null;if(Array.isArray(e))return new Ed(e.map(e=>Md(e,t)));let n=e.type,r=e.layout||`XY`,i;switch(n){case`Point`:i=new Na(e.flatCoordinates,r);break;case`LineString`:i=new _d(e.flatCoordinates,r);break;case`Polygon`:i=new Ua(e.flatCoordinates,r,e.ends);break;case`MultiPoint`:i=new yd(e.flatCoordinates,r);break;case`MultiLineString`:i=new vd(e.flatCoordinates,r,e.ends);break;case`MultiPolygon`:i=new xd(e.flatCoordinates,r,e.ends);break;default:throw Error(`Unsupported geometry type: `+n)}return kd(i,!1,t)}var Nd=class extends Od{constructor(){super()}getType(){return`json`}readFeature(e,t){let n=Pd(e);return n?this.readFeatureFromObject(n,this.getReadOptions(e,t)):[]}readFeatures(e,t){let n=Pd(e);return n?this.readFeaturesFromObject(n,this.getReadOptions(e,t)):[]}readFeatureFromObject(e,t){return I()}readFeaturesFromObject(e,t){return I()}readGeometry(e,t){let n=Pd(e);if(!n)throw Error(`Expected a JSON object`);return this.readGeometryFromObject(n,this.getReadOptions(e,t))}readGeometryFromObject(e,t){return I()}readProjection(e){let t=Pd(e);if(!t)throw Error(`Expected a JSON object`);return this.readProjectionFromObject(t)}readProjectionFromObject(e){return I()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return I()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return I()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return I()}};function Pd(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var Fd=class extends Nd{constructor(e){e||={},super(),this.dataProjection=H(e.dataProjection?e.dataProjection:`EPSG:4326`)??void 0,e.featureProjection&&(this.defaultFeatureProjection=H(e.featureProjection)??void 0),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 n=e,r;r=n.type===`Feature`?n:{type:`Feature`,geometry:e,properties:null};let i=Id(r.geometry,t);if(this.featureClass===Cd)return jd({geometry:i??void 0,id:r.id,properties:r.properties??void 0},t);let a=new this.featureClass;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&`geometry_name`in r&&r.geometry_name&&a.setGeometryName(r.geometry_name),a.setGeometry(Md(i,t)),`id`in r&&a.setId(r.id),r.properties&&a.setProperties(r.properties,!0),a}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return Ld(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=H(t.properties.name);else if(t.type===`EPSG`)n=H(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`)}else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=Gd(a,t),delete i[e.getGeometryName()]),Fe(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return Gd(e,this.adaptOptions(t))}};function Id(e,t){if(!e||e.type!==`GeometryCollection`&&Array.isArray(e.coordinates)&&!e.coordinates.length)return null;let n;switch(e.type){case`Point`:n=zd(e);break;case`LineString`:n=Bd(e);break;case`Polygon`:n=Wd(e);break;case`MultiPoint`:n=Hd(e);break;case`MultiLineString`:n=Vd(e);break;case`MultiPolygon`:n=Ud(e);break;case`GeometryCollection`:n=Rd(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function Ld(e,t){let n=Id(e,t);return n?Md(n,t):null}function Rd(e,t){let n=e.geometries,r=[];for(let e of n){let n=Id(e,t);n&&r.push(n)}return r}function zd(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:Xi(t.length)}}function Bd(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:Xi(t[0]?.length||2)}}function Vd(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:da(r,0,t,n),layout:Xi(n)}}function Hd(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:Xi(t[0]?.length||2)}}function Ud(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:fa(n,0,t,r),layout:Xi(r)}}function Wd(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:da(n,0,t,r),layout:Xi(r)}}function Gd(e,t){e=kd(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=Zd(e,t);break;case`LineString`:r=qd(e,t);break;case`Polygon`:r=Qd(e,t);break;case`MultiPoint`:r=Yd(e,t);break;case`MultiLineString`:r=Jd(e,t);break;case`MultiPolygon`:r=Xd(e,t);break;case`GeometryCollection`:r=Kd(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function Kd(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return Gd(e,t)})}}function qd(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function Jd(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function Yd(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function Xd(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function Zd(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function Qd(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}var $d={$version:8,$root:{version:{required:!0,type:`enum`,values:[8]},name:{type:`string`},metadata:{type:`*`},center:{type:`array`,value:`number`,length:2},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`},"font-faces":{type:`fontFaces`},transition:{type:`transition`},layers:{required:!0,type:`array`,value:`layer`}},sources:{"*":{type:`source`}},source:[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],source_vector:{type:{required:!0,type:`enum`,values:{vector:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},sparse:{type:`boolean`,default:!1},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},attribution:{type:`string`},promoteId:{type:`promoteId`},volatile:{type:`boolean`,default:!1},encoding:{type:`enum`,values:{mvt:{},mlt:{}},default:`mvt`},"*":{type:`*`}},source_raster:{type:{required:!0,type:`enum`,values:{raster:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},attribution:{type:`string`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_raster_dem:{type:{required:!0,type:`enum`,values:{"raster-dem":{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},attribution:{type:`string`},encoding:{type:`enum`,values:{terrarium:{},mapbox:{},custom:{}},default:`mapbox`},redFactor:{type:`number`,default:1},blueFactor:{type:`number`,default:1},greenFactor:{type:`number`,default:1},baseShift:{type:`number`,default:0},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_geojson:{type:{required:!0,type:`enum`,values:{geojson:{}}},data:{required:!0,type:`*`},maxzoom:{type:`number`,default:18},attribution:{type:`string`},buffer:{type:`number`,default:128,maximum:512,minimum:0},filter:{type:`filter`},tolerance:{type:`number`,default:.375},cluster:{type:`boolean`,default:!1},clusterRadius:{type:`number`,default:50,minimum:0},clusterMaxZoom:{type:`number`},clusterMinPoints:{type:`number`},clusterProperties:{type:`*`},lineMetrics:{type:`boolean`,default:!1},generateId:{type:`boolean`,default:!1},promoteId:{type:`promoteId`}},source_video:{type:{required:!0,type:`enum`,values:{video:{}}},urls:{required:!0,type:`array`,value:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},source_image:{type:{required:!0,type:`enum`,values:{image:{}}},url:{type:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},layer:{id:{type:`string`,required:!0},type:{type:`enum`,values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"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`}},layout:[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_color-relief`,`layout_background`],layout_background:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_fill:{"fill-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_circle:{"circle-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_heatmap:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`},"fill-extrusion-rounded-corner-distance":{type:`number`,default:0,minimum:0,units:`meters`,"property-type":`constant`}},layout_line:{"line-cap":{type:`enum`,values:{butt:{},round:{},square:{}},default:`butt`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"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`,`feature`]},"property-type":`data-driven`},"line-round-limit":{type:`number`,default:1.05,requires:[{"line-join":`round`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_symbol:{"symbol-placement":{type:`enum`,values:{point:{},line:{},"line-center":{}},default:`point`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-spacing":{type:`number`,default:250,minimum:1,units:`pixels`,requires:[{"symbol-placement":`line`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-avoid-edges":{type:`boolean`,default:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-z-order":{type:`enum`,values:{auto:{},"viewport-y":{},source:{}},default:`auto`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-allow-overlap":{type:`boolean`,default:!1,requires:[`icon-image`,{"!":`icon-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-ignore-placement":{type:`boolean`,default:!1,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-optional":{type:`boolean`,default:!1,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"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`},"symbol-height-offset":{type:`number`,default:0,units:`meters`,requires:[{"symbol-placement":[`point`]}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-height-anchor":{type:`enum`,values:{ground:{},absolute:{}},default:`ground`,requires:[`symbol-height-offset`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_raster:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_hillshade:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},"layout_color-relief":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},filter:{type:`boolean`,expression:{interpolated:!1,parameters:[`zoom`,`feature`,`pitch`,`bearing`]},"property-type":`data-driven`},filter_operator:{type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:`expression`},stops:{type:`array`,value:`function_stop`},base:{type:`number`,default:1,minimum:0},property:{type:`string`,default:`$zoom`},type:{type:`enum`,values:{identity:{},exponential:{},interval:{},categorical:{}},default:`exponential`},colorSpace:{type:`enum`,values:{rgb:{},lab:{},hcl:{},oklch:{},oklab:{}},default:`rgb`},default:{type:`*`,required:!1}},function_stop:{type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},expression:{type:`array`,value:`expression_name`,minimum:1},light:{anchor:{type:`enum`,default:`viewport`,values:{map:{},viewport:{}},"property-type":`data-constant`,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]}},position:{type:`array`,default:[1.15,210,30],length:3,value:`number`,"property-type":`data-constant`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]}},color:{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},intensity:{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},sky:{"sky-color":{type:`color`,"property-type":`data-constant`,default:`#88C6FC`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"horizon-color":{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"fog-color":{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"fog-ground-blend":{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"horizon-fog-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"sky-horizon-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"atmosphere-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},terrain:{source:{type:`string`,required:!0},exaggeration:{type:`number`,minimum:0,default:1}},projection:{type:{type:`projectionDefinition`,default:`mercator`,"property-type":`data-constant`,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]}}},paint:[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_color-relief`,`paint_background`],paint_fill:{"fill-antialias":{type:`boolean`,default:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"property-type":`data-constant`},"fill-layer-blend":{type:`enum`,values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{},difference:{},exclusion:{},"soft-light":{},"hard-light":{},darken:{},lighten:{},"color-dodge":{},"color-burn":{},hue:{},saturation:{}},default:`normal`,"property-type":`constant`,transition:!1},"fill-color":{type:`color`,default:`#000000`,transition:!0,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`},"fill-rounded-corner-distance":{type:`number`,default:0,minimum:0,units:`meters`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"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`,`elevation`]},"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,units:`meters`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-base":{type:`number`,default:0,units:`meters`,transition:!0,requires:[`fill-extrusion-height`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-vertical-gradient":{type:`boolean`,default:!0,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_line:{"line-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"property-type":`data-constant`},"line-layer-blend":{type:`enum`,values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{},difference:{},exclusion:{},"soft-light":{},"hard-light":{},darken:{},lighten:{},"color-dodge":{},"color-burn":{},hue:{},saturation:{}},default:`normal`,"property-type":`constant`,transition:!1},"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`,`feature`]},"property-type":`cross-faded-data-driven`},"line-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"line-gradient":{type:`color`,transition:!1,requires:[{"!":`line-dasharray`},{"!":`line-pattern`},{source:`geojson`,has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[`line-progress`]},"property-type":`color-ramp`}},paint_circle:{"circle-radius":{type:`number`,default:5,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-blur":{type:`number`,default:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"circle-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`circle-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-scale":{type:`enum`,values:{map:{},viewport:{}},default:`map`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-alignment":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-stroke-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`}},paint_heatmap:{"heatmap-radius":{type:`number`,default:30,minimum:1,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-weight":{type:`number`,default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-intensity":{type:`number`,default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"heatmap-color":{type:`color`,default:[`interpolate`,[`linear`],[`heatmap-density`],0,`rgba(0, 0, 255, 0)`,.1,`royalblue`,.3,`cyan`,.5,`lime`,.7,`yellow`,1,`red`],transition:!1,expression:{interpolated:!0,parameters:[`heatmap-density`]},"property-type":`color-ramp`},"heatmap-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_symbol:{"icon-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-color":{type:`color`,default:`#000000`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`icon-image`,`icon-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-color":{type:`color`,default:`#000000`,transition:!0,overridable:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`text-field`,`text-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_raster:{"raster-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-layer-blend":{type:`enum`,values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{},difference:{},exclusion:{},"soft-light":{},"hard-light":{},darken:{},lighten:{},"color-dodge":{},"color-burn":{},hue:{},saturation:{}},default:`normal`,"property-type":`constant`,transition:!1},"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`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-resampling":{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-fade-duration":{type:`number`,default:300,minimum:0,transition:!1,units:`milliseconds`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_hillshade:{"hillshade-illumination-direction":{type:`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`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},"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`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_background:{"background-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`background-pattern`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"background-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"background-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},transition:{duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},"property-type":{"data-driven":{type:`property-type`},"cross-faded":{type:`property-type`},"cross-faded-data-driven":{type:`property-type`},"color-ramp":{type:`property-type`},"data-constant":{type:`property-type`},constant:{type:`property-type`}},promoteId:{"*":{type:`string`}},interpolation:{type:`array`,value:`interpolation_name`,minimum:1},interpolation_name:{type:`enum`,values:{linear:{syntax:{overloads:[{parameters:[],"output-type":`interpolation`}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[`base`],"output-type":`interpolation`}],parameters:[{name:`base`,type:`number literal`}]}},"cubic-bezier":{syntax:{overloads:[{parameters:[`x1`,`y1`,`x2`,`y2`],"output-type":`interpolation`}],parameters:[{name:`x1`,type:`number literal`},{name:`y1`,type:`number literal`},{name:`x2`,type:`number literal`},{name:`y2`,type:`number literal`}]}}}}},ef=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function tf(e,t){let n={};for(let t in e)t!==`ref`&&(n[t]=e[t]);return ef.forEach(e=>{e in t&&(n[e]=t[e])}),n}function nf(e){e=e.slice();let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)`ref`in e[n]&&(e[n]=tf(e[n],t[e[n].ref]));return e}var rf=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},af=class e{constructor(e,t=[]){this.parent=e,this.bindings=new Map(t)}concat(t){return new e(this,t)}get(e){if(this.bindings.has(e))return this.bindings.get(e);if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings.has(e)?!0:this.parent?this.parent.has(e):!1}},of={kind:`null`},J={kind:`number`},Y={kind:`string`},X={kind:`boolean`},sf={kind:`color`},cf={kind:`projectionDefinition`},lf={kind:`object`},Z={kind:`value`},uf={kind:`error`},df={kind:`collator`},ff={kind:`formatted`},pf={kind:`padding`},mf={kind:`colorArray`},hf={kind:`numberArray`},gf={kind:`resolvedImage`},_f={kind:`variableAnchorOffsetCollection`};function vf(e,t){return{kind:`array`,itemType:e,N:t}}function yf(e){if(e.kind===`array`){let t=yf(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}return e.kind}var bf=[of,J,Y,X,sf,cf,ff,lf,vf(Z),pf,hf,mf,gf,_f];function xf(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!xf(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if(e.kind===`value`){for(let e of bf)if(!xf(e,t))return null}return`Expected ${yf(e)} but found ${yf(t)} instead.`}function Sf(e,t){return t.some(t=>t.kind===e.kind)}function Cf(e,t){return t.some(t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e)}function wf(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}var Tf=.96422,Ef=1,Df=.82521,Of=4/29,kf=6/29,Af=3*kf*kf,jf=kf*kf*kf,Mf=Math.PI/180,Nf=180/Math.PI;function Pf(e){return e%=360,e<0&&(e+=360),e}function Ff([e,t,n,r]){e=If(e),t=If(t),n=If(n);let i,a,o=Lf((.2225045*e+.7168786*t+.0606169*n)/Ef);return e===t&&t===n?i=a=o:(i=Lf((.4360747*e+.3850649*t+.1430804*n)/Tf),a=Lf((.0139322*e+.0971045*t+.7141733*n)/Df)),[116*o-16,500*(i-o),200*(o-a),r]}function If(e){let t=Math.abs(e);return t<=.04045?e/12.92:Math.sign(e)*((t+.055)/1.055)**2.4}function Lf(e){return e>jf?e**(1/3):e/Af+Of}function Rf([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=Ef*Bf(i),a=Tf*Bf(a),o=Df*Bf(o),[zf(3.1338561*a-1.6168667*i-.4906146*o),zf(-.9787684*a+1.9161415*i+.033454*o),zf(.0719453*a-.2289914*i+1.4052427*o),r]}function zf(e){let t=Math.abs(e);return t<=.00304?12.92*e:Math.sign(e)*(1.055*t**(1/2.4)-.055)}function Bf(e){return e>kf?e*e*e:Af*(e-Of)}function Vf(e){let[t,n,r,i]=Ff(e),a=Math.sqrt(n*n+r*r);return[Math.round(a*1e4)?Pf(Math.atan2(r,n)*Nf):NaN,a,t,i]}function Hf([e,t,n,r]){return e=isNaN(e)?0:e*Mf,Rf([n,Math.cos(e)*t,Math.sin(e)*t,r])}function Uf([e,t,n,r]){e=Pf(e),t/=100,n/=100;function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4),r]}var Wf=[[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,0xf46cf/1053270]],Gf=[[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],Kf=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],qf=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Jf=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Yf=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]];function Xf(e,[t,n,r]){return[e[0][0]*t+e[0][1]*n+e[0][2]*r,e[1][0]*t+e[1][1]*n+e[1][2]*r,e[2][0]*t+e[2][1]*n+e[2][2]*r]}function Zf(e){let t=Math.abs(e);return t>.0031308?Math.sign(e)*(1.055*t**(1/2.4)-.055):12.92*e}function Qf([e,t,n]){let[r,i,a]=Xf(Kf,Xf(Wf,[If(e),If(t),If(n)]));return Xf(qf,[Math.cbrt(r),Math.cbrt(i),Math.cbrt(a)])}function $f(e){let[t,n,r]=Xf(Jf,e),[i,a,o]=Xf(Gf,Xf(Yf,[t*t*t,n*n*n,r*r*r]));return[Zf(i),Zf(a),Zf(o)]}function ep([e,t,n,r]){let[i,a,o]=Qf([e,t,n]);return[i,a,o,r]}function tp([e,t,n,r]){let[i,a,o]=Qf([e,t,n]),s=Math.sqrt(a*a+o*o);return s<=4e-6?[i,0,NaN,r]:[i,s,Pf(Math.atan2(o,a)*Nf),r]}var np=1e6;function rp([e,t,n,r]){let i=isNaN(n)?0:n*Mf,a=Math.min(t,np),[o,s,c]=$f([e,a*Math.cos(i),a*Math.sin(i)]);return[o,s,c,r]}function ip([e,t,n,r]){return rp([e,Math.hypot(t,n),Math.atan2(n,t)*Nf,r])}var ap=[[608311/1250200,189793/714400,198249/0xf42e0],[35783/156275,247089/357200,198249/2500400],[0,32229/714400,5220557/5000800]],op=[[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]],sp=1e6;function cp([e,t,n,r]){let[i,a,o]=[e,t,n].map(e=>If(Math.min(Math.max(e,-1e6),sp))),[s,c,l]=Xf(Gf,Xf(ap,[i,a,o])).map(Zf);return[s,c,l,r]}function lp([e,t,n,r]){let[i,a,o]=Xf(op,Xf(Wf,[If(e),If(t),If(n)])).map(e=>Math.min(Math.max(Zf(e),0),1));return[i,a,o,r]}var up=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function dp(e,t){return up(e,t)?e[t]:void 0}function fp(e){if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t=dp(Cp,e);if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[yp(e.slice(n,n+=t)),yp(e.slice(n,n+=t)),yp(e.slice(n,n+=t)),yp(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===` `||p===` /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[xp(+n/t,0,1),xp(+a/t,0,1),xp(+c/t,0,1),d?bp(+d,f):1];if(Sp(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===` `||u===` /`||u===`,,`||u===`,,,`){let e=[+t,xp(+i,0,100),xp(+o,0,100),c?bp(+c,l):1];if(Sp(e))return Uf(e)}}let r=e.match(mp);if(r){let[,e,t,n,i]=r,a=[vp(e,1),vp(t,.4),vp(n,1),i===void 0?1:vp(i,1)];if(a.every(Number.isFinite))return rp([xp(a[0],0,1),Math.max(a[1],0),a[2]%360,xp(a[3],0,1)])}let i=e.match(hp);if(i){let[,e,t,n,r]=i,a=[vp(e,1),vp(t,.4),vp(n,.4),r===void 0?1:vp(r,1)];if(a.every(Number.isFinite))return ip([xp(a[0],0,1),a[1],a[2],xp(a[3],0,1)])}let a=e.match(gp);if(a){let[,e,t,n,r]=a,i=[vp(e,1),vp(t,1),vp(n,1),r===void 0?1:vp(r,1)];if(i.every(Number.isFinite))return cp([i[0],i[1],i[2],xp(i[3],0,1)])}}var pp=`[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?`,mp=RegExp(`^oklch\\(\\s*(none|${pp}%?)\\s+(none|${pp}%?)\\s+(none|${pp}(?:deg|grad|rad|turn)?)\\s*(?:\\/\\s*(none|${pp}%?)\\s*)?\\)$`),hp=RegExp(`^oklab\\(\\s*(none|${pp}%?)\\s+(none|${pp}%?)\\s+(none|${pp}%?)\\s*(?:\\/\\s*(none|${pp}%?)\\s*)?\\)$`),gp=RegExp(`^color\\(\\s*display-p3\\s+(none|${pp}%?)\\s+(none|${pp}%?)\\s+(none|${pp}%?)\\s*(?:\\/\\s*(none|${pp}%?)\\s*)?\\)$`),_p={deg:1,grad:.9,rad:180/Math.PI,turn:360};function vp(e,t){if(e===`none`)return 0;let[,n,r]=e.match(/^(.+?)(%|[a-z]+)?$/);return r===`%`?n/100*t:r?+n%(360/_p[r])*_p[r]:+n}function yp(e){return parseInt(e.padEnd(2,e),16)/255}function bp(e,t){return xp(t?e/100:e,0,1)}function xp(e,t,n){return Math.min(Math.max(t,e),n)}function Sp(e){return!e.some(Number.isNaN)}var Cp={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 wp(e,t,n){return e+n*(t-e)}function Tp(e,t,n){return e.map((e,r)=>wp(e,t[r],n))}var Ep=class e{constructor(e,t,n,r=1,i=!0){!i&&(Math.min(e,t,n)<0||Math.max(e,t,n)>1)&&(this.overwriteGetter(`unclippedRgb`,[e,t,n,r]),e=Math.min(Math.max(e,0),1),t=Math.min(Math.max(t,0),1),n=Math.min(Math.max(n,0),1)),this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static{this.black=new e(0,0,0,1)}static{this.white=new e(1,1,1,1)}static{this.transparent=new e(0,0,0,0)}static{this.red=new e(1,0,0,1)}static parse(t){if(t instanceof e)return t;if(typeof t!=`string`)return;let n=fp(t);if(n)return new e(...n,!1)}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,Vf(this.unclippedRgb))}get lab(){return this.overwriteGetter(`lab`,Ff(this.unclippedRgb))}get oklch(){return this.overwriteGetter(`oklch`,tp(this.unclippedRgb))}get oklab(){return this.overwriteGetter(`oklab`,ep(this.unclippedRgb))}get displayP3(){return this.overwriteGetter(`displayP3`,lp(this.unclippedRgb))}get unclippedRgb(){return this.rgb}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map(e=>Math.round(e*255)).join(`,`)},${r})`}static interpolate(t,n,r,i=`rgb`){switch(i){case`rgb`:{let[i,a,o,s]=Tp(t.unclippedRgb,n.unclippedRgb,r);return new e(i,a,o,s,!1)}case`hcl`:{let[i,a,o,s]=t.hcl,[c,l,u,d]=n.hcl,f,p;if(!isNaN(i)&&!isNaN(c)){let e=c-i;c>i&&e>180?e-=360:c<i&&i-c>180&&(e+=360),f=i+r*e}else isNaN(i)?isNaN(c)?f=NaN:(f=c,(o===1||o===0)&&(p=l)):(f=i,(u===1||u===0)&&(p=a));let[m,h,g,_]=Hf([f,p??wp(a,l,r),wp(o,u,r),wp(s,d,r)]);return new e(m,h,g,_,!1)}case`lab`:{let[i,a,o,s]=Rf(Tp(t.lab,n.lab,r));return new e(i,a,o,s,!1)}case`oklch`:{let[i,a,o,s]=t.oklch,[c,l,u,d]=n.oklch,f=isNaN(o)?u:o,p=isNaN(u)?o:u;p-f>180?f+=360:p-f<-180&&(p+=360);let m=wp(s,d,r),h=m===0?1:m,[g,_,v]=rp([wp(i*s,c*d,r)/h,wp(a*s,l*d,r)/h,wp(f,p,r),m]);return new e(g,_,v,m,!1)}case`oklab`:{let[i,a,o,s]=t.oklab,[c,l,u,d]=n.oklab,f=wp(s,d,r),p=f===0?1:f,[m,h,g]=ip([wp(i*s,c*d,r)/p,wp(a*s,l*d,r)/p,wp(o*s,u*d,r)/p,f]);return new e(m,h,g,f,!1)}}}},Dp=class{constructor(e,t,n){this.sensitivity=e?t?`variant`:`case`:t?`accent`:`base`,this.locale=n,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}},Op=[`bottom`,`center`,`top`],kp=class{constructor(e,t,n,r,i,a){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i,this.verticalAlign=a}},Ap=class e{constructor(e){this.sections=e}static fromString(t){return new e([new kp(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return this.sections.length===0?``:this.sections.map(e=>e.text).join(``)}},jp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if(typeof e!=`number`)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(Tp(t.values,n.values,r))}},Mp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t]);if(Array.isArray(t)){for(let e of t)if(typeof e!=`number`)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(Tp(t.values,n.values,r))}},Np=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`string`){let n=Ep.parse(t);return n?new e([n]):void 0}if(!Array.isArray(t))return;let n=[];for(let e of t){if(typeof e!=`string`)return;let t=Ep.parse(e);if(!t)return;n.push(t)}return new e(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i=`rgb`){let a=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(Ep.interpolate(t.values[e],n.values[e],r,i));return new e(a)}},Pp=class extends Error{constructor(e,t){super(e),this.name=`RuntimeError`,this.path=t}toJSON(){return this.message}},Fp=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),Ip=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let n=t[e],r=t[e+1];if(typeof n!=`string`||!Fp.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i){let a=t.values,o=n.values;if(a.length!==o.length)throw new Pp(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`,i);let s=[];for(let e=0;e<a.length;e+=2){if(a[e]!==o[e])throw new Pp(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${a[e]}, to[${e}]: ${o[e]}`,i);s.push(a[e]);let[t,n]=a[e+1],[c,l]=o[e+1];s.push([wp(t,c,r),wp(n,l,r)])}return new e(s)}},Lp=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},Rp=class e{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,n,r){return new e(t,n,r)}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`number`)return new e(t[0],t[1],t[2]);if(typeof t==`object`&&typeof t.from==`string`&&typeof t.to==`string`&&typeof t.transition==`number`)return new e(t.from,t.to,t.transition);if(typeof t==`string`)return new e(t,t,1)}};function zp(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Bp(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof Rp||e instanceof Ep||e instanceof Dp||e instanceof Ap||e instanceof jp||e instanceof Mp||e instanceof Np||e instanceof Ip||e instanceof Lp)return!0;if(Array.isArray(e)){for(let t of e)if(!Bp(t))return!1;return!0}if(typeof e==`object`){for(let t in e)if(!Bp(e[t]))return!1;return!0}return!1}function Vp(e){if(e===null)return of;if(typeof e==`string`)return Y;if(typeof e==`boolean`)return X;if(typeof e==`number`)return J;if(e instanceof Ep)return sf;if(e instanceof Rp)return cf;if(e instanceof Dp)return df;if(e instanceof Ap)return ff;if(e instanceof jp)return pf;if(e instanceof Mp)return hf;if(e instanceof Np)return mf;if(e instanceof Ip)return _f;if(e instanceof Lp)return gf;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=Vp(t);if(!n)n=e;else if(n===e)continue;else{n=Z;break}}return vf(n||Z,t)}return lf}function Hp(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof Ep||e instanceof Rp||e instanceof Ap||e instanceof jp||e instanceof Mp||e instanceof Np||e instanceof Ip||e instanceof Lp?e.toString():JSON.stringify(e)}var Up=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Bp(t[1]))return n.error(`invalid value of type "${typeof t[1]}"`);let r=t[1],i=Vp(r),a=n.expectedType;return i.kind===`array`&&i.N===0&&a&&a.kind===`array`&&(typeof a.N!=`number`||a.N===0)&&(i=a),new e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},Wp={string:Y,number:J,boolean:X,object:lf},Gp=class e{constructor(e,t,n){this.type=e,this.args=t,this.key=n}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=1,i,a=t[0];if(a===`array`){let e;if(t.length>2){let i=t[1];if(typeof i!=`string`||!(i in Wp)||i===`object`)return n.error(`The item type argument of "array" must be one of string, number, boolean`,1);e=Wp[i],r++}else e=Z;let a;if(t.length>3){if(t[2]!==null&&(typeof t[2]!=`number`||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(`The length argument to "array" must be a positive integer literal`,2);a=t[2],r++}i=vf(e,a)}else{if(!Wp[a])throw Error(`Types doesn't contain name = ${a}`);i=Wp[a]}let o=[];for(;r<t.length;r++){let e=n.parse(t[r],r,Z);if(!e)return null;o.push(e)}return new e(i,o,n.key)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!xf(this.type,Vp(n)))return n;if(t===this.args.length-1)throw new Pp(`Expected value to be of type ${yf(this.type)}, but found ${yf(Vp(n))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Kp={"to-boolean":X,"to-color":sf,"to-number":J,"to-string":Y},qp=class e{constructor(e,t,n){this.type=e,this.args=t,this.key=n}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[0];if(!Kp[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r===`to-boolean`||r===`to-string`)&&t.length!==2)return n.error(`Expected one argument.`);let i=Kp[r],a=[];for(let e=1;e<t.length;e++){let r=n.parse(t[e],e,Z);if(!r)return null;a.push(r)}return new e(i,a,n.key)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof Ep)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:zp(t[0],t[1],t[2],t[3]),!n))return new Ep(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Pp(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=jp.parse(t);if(r)return r}throw new Pp(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`numberArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Mp.parse(t);if(r)return r}throw new Pp(`Could not parse numberArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`colorArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Np.parse(t);if(r)return r}throw new Pp(`Could not parse colorArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Ip.parse(t);if(r)return r}throw new Pp(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new Pp(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case`formatted`:return Ap.fromString(Hp(this.args[0].evaluate(e)));case`resolvedImage`:return Lp.fromString(Hp(this.args[0].evaluate(e)));case`projectionDefinition`:{let t=this.args[0].evaluate(e);if(Rp.parse(t))return t;throw new Pp(`Could not parse projectionDefinition from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}default:return Hp(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Jp=[`Unknown`,`Point`,`LineString`,`Polygon`],Yp=class{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`?Jp[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=Ep.parse(e),this._parseColorCache.set(e,t)),t}},Xp=class e{constructor(e,t,n=[],r,i=new af,a=[]){this.registry=e,this.path=n,this.key=n.map(e=>`[${e}]`).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t==null?this._parse(e,i):this.concat(t,n,r)._parse(e,i)}_parse(e,t){(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`)&&(e=[`literal`,e]);let n=this.key;function r(e,t,r){return r===`assert`?new Gp(t,[e],n):r===`coerce`?new qp(t,[e],n):e}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", []].`);let n=e[0];if(typeof n!=`string`)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=dp(this.registry,n);if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){let e=this.expectedType,i=n.type;if((e.kind===`string`||e.kind===`number`||e.kind===`boolean`||e.kind===`object`||e.kind===`array`)&&i.kind===`value`)n=r(n,e,t.typeAnnotation||`assert`);else if(e.kind===`projectionDefinition`&&[`string`,`array`,`value`].includes(i.kind)||[`color`,`formatted`,`resolvedImage`].includes(e.kind)&&[`value`,`string`].includes(i.kind)||[`padding`,`numberArray`].includes(e.kind)&&[`value`,`number`,`array`].includes(i.kind)||e.kind===`colorArray`&&[`value`,`string`,`array`].includes(i.kind)||e.kind===`variableAnchorOffsetCollection`&&[`value`,`array`].includes(i.kind))n=r(n,e,t.typeAnnotation||`coerce`);else if(this.checkSubtype(e,i))return null}if(!(n instanceof Up)&&n.type.kind!==`resolvedImage`&&this._isConstant(n)){let e=new Yp;try{n=new Up(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?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(t,n,r){let i=typeof t==`number`?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new e(this.registry,this._isConstant,i,n||null,a,this.errors)}error(e,...t){let n=`${this.key}${t.map(e=>`[${e}]`).join(``)}`;this.errors.push(new rf(n,e))}checkSubtype(e,t){let n=xf(e,t);return n&&this.error(n),n}},Zp=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if(typeof i!=`string`)return n.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return n.error(`Variable names must contain only alphanumeric characters or '_'.`,e);let a=n.parse(t[e+1],e+1);if(!a)return null;r.push([i,a])}let i=n.parse(t[t.length-1],t.length-1,n.expectedType,r);return i?new e(r,i):null}outputDefined(){return this.result.outputDefined()}},Qp=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,n){if(t.length!==2||typeof t[1]!=`string`)return n.error(`'var' expression requires exactly one string literal argument.`);let r=t[1];return n.scope.has(r)?new e(r,n.scope.get(r)):n.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},$p=class e{constructor(e,t,n,r){this.type=e,this.index=t,this.input=n,this.key=r}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,J),i=n.parse(t[2],2,vf(n.expectedType||Z));if(!r||!i)return null;let a=i.type;return new e(a.itemType,r,i,n.key)}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new Pp(`Array index out of bounds: ${t} < 0.`,this.key);if(t>=n.length)throw new Pp(`Array index out of bounds: ${t} > ${n.length-1}.`,this.key);if(t!==Math.floor(t))throw new Pp(`Array index must be an integer, but found ${t} instead.`,this.key);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},em=class e{constructor(e,t,n){this.needle=e,this.haystack=t,this.key=n,this.type=X}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,Z),i=n.parse(t[2],2,Z);return!r||!i?null:Sf(r.type,[X,Y,J,of,Z])?new e(r,i,n.key):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${yf(r.type)} instead`)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Cf(t,[`boolean`,`string`,`number`,`null`]))throw new Pp(`Expected first argument to be of type boolean, string, number or null, but found ${yf(Vp(t))} instead.`,this.key);if(!Cf(n,[`string`,`array`]))throw new Pp(`Expected second argument to be of type array or string, but found ${yf(Vp(n))} instead.`,this.key);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},tm=class e{constructor(e,t,n,r){this.needle=e,this.haystack=t,this.key=n,this.fromIndex=r,this.type=J}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,Z),i=n.parse(t[2],2,Z);if(!r||!i)return null;if(!Sf(r.type,[X,Y,J,of,Z]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${yf(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,J);return a?new e(r,i,n.key,a):null}return new e(r,i,n.key)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Cf(t,[`boolean`,`string`,`number`,`null`]))throw new Pp(`Expected first argument to be of type boolean, string, number or null, but found ${yf(Vp(t))} instead.`,this.key);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),Cf(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}if(Cf(n,[`array`]))return n.indexOf(t,r);throw new Pp(`Expected second argument to be of type array or string, but found ${yf(Vp(n))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},nm=class e{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error(`Expected an even number of arguments.`);let r,i;n.expectedType&&n.expectedType.kind!==`value`&&(i=n.expectedType);let a={},o=[];for(let e=2;e<t.length-1;e+=2){let s=t[e],c=t[e+1];Array.isArray(s)||(s=[s]);let l=n.concat(e);if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(!r)r=Vp(e);else if(l.checkSubtype(r,Vp(e)))return null;if(a[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);a[String(e)]=o.length}let u=n.parse(c,e,i);if(!u)return null;i||=u.type,o.push(u)}let s=n.parse(t[1],1,Z);if(!s)return null;let c=n.parse(t[t.length-1],t.length-1,i);return!c||s.type.kind!==`value`&&n.concat(1).checkSubtype(r,s.type)?null:new e(r,i,s,a,o,c)}evaluate(e){let t=this.input.evaluate(e);return(Vp(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()}},rm=class e{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error(`Expected an odd number of arguments.`);let r;n.expectedType&&n.expectedType.kind!==`value`&&(r=n.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let a=n.parse(t[e],e,X);if(!a)return null;let o=n.parse(t[e+1],e+1,r);if(!o)return null;i.push([a,o]),r||=o.type}let a=n.parse(t[t.length-1],t.length-1,r);if(!a)return null;if(!r)throw Error(`Can't infer output type`);return new e(r,i,a)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},im=class e{constructor(e,t,n,r,i){this.type=e,this.input=t,this.beginIndex=n,this.key=r,this.endIndex=i}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,Z),i=n.parse(t[2],2,J);if(!r||!i)return null;if(!Sf(r.type,[vf(Z),Y,Z]))return n.error(`Expected first argument to be of type array or string, but found ${yf(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,J);return a?new e(r.type,r,i,n.key,a):null}return new e(r.type,r,i,n.key)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),Cf(t,[`string`]))return[...t].slice(n,r).join(``);if(Cf(t,[`array`]))return t.slice(n,r);throw new Pp(`Expected first argument to be of type array or string, but found ${yf(Vp(t))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function am(e,t,n){let r=e.length-1,i=0,a=r,o=0,s,c;for(;i<=a;)if(o=Math.floor((i+a)/2),s=e[o],c=e[o+1],s<=t){if(o===r||t<c)return o;i=o+1}else if(s>t)a=o-1;else throw new Pp(`Input is not a number.`,n);return 0}var om=class e{constructor(e,t,n,r){this.type=e,this.input=t,this.key=r,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);let r=n.parse(t[1],1,J);if(!r)return null;let i=[],a=null;n.expectedType&&n.expectedType.kind!==`value`&&(a=n.expectedType);for(let e=1;e<t.length;e+=2){let r=e===1?-1/0:t[e],o=t[e+1],s=e,c=e+1;if(typeof r!=`number`)return n.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,s);if(i.length&&i[i.length-1][0]>=r)return n.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=n.parse(o,c,a);if(!l)return null;a||=l.type,i.push([r,l])}return new e(a,r,i,n.key)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[am(t,r,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function sm(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let n=e;for(let r=0;r<8;r++){let r=((o*n+a)*n+i)*n-e;if(Math.abs(r)<t)return((l*n+c)*n+s)*n;let u=(3*o*n+2*a)*n+i;if(Math.abs(u)<1e-6)break;n-=r/u}let r=0,u=1;n=e;for(let s=0;s<20;s++){let s=((o*n+a)*n+i)*n;if(Math.abs(s-e)<t)break;e>s?r=n:u=n,n=(r+u)*.5}return((l*n+c)*n+s)*n}}function cm(e,t){if(!(e instanceof t))return!1;try{return t.prototype.valueOf.call(e),!0}catch{return!1}}function lm(e){return cm(e,Number)||cm(e,String)||cm(e,Boolean)?e.valueOf():e}function um(e){let t=lm(e);return typeof t==`object`&&t?JSON.stringify(t):String(t)}var dm=class e{constructor(e,t,n,r,i,a){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.key=a,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=fm(t,e.base,n,r);else if(e.name===`linear`)i=fm(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=sm(a[0],a[1],a[2],a[3])(fm(t,1,n,r))}return i}static parse(t,n){let[r,i,a,...o]=t;if(!Array.isArray(i)||i.length===0)return n.error(`Expected an interpolation type expression.`,1);if(i[0]===`linear`)i={name:`linear`};else if(i[0]===`exponential`){let e=i[1];if(typeof e!=`number`)return n.error(`Exponential interpolation requires a numeric base.`,1,1);i={name:`exponential`,base:e}}else if(i[0]===`cubic-bezier`){let e=i.slice(1);if(e.length!==4||e.some(e=>typeof e!=`number`||e<0||e>1))return n.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);i={name:`cubic-bezier`,controlPoints:e}}else return n.error(`Unknown interpolation type ${um(i[0])}`,1,0);if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);if(a=n.parse(a,2,J),!a)return null;let s=[],c=null;(r===`interpolate-hcl`||r===`interpolate-lab`||r===`interpolate-oklch`||r===`interpolate-oklab`)&&n.expectedType!=mf?c=sf:n.expectedType&&n.expectedType.kind!==`value`&&(c=n.expectedType);for(let e=0;e<o.length;e+=2){let t=o[e],r=o[e+1],i=e+3,a=e+4;if(typeof t!=`number`)return n.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(s.length&&s[s.length-1][0]>=t)return n.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=n.parse(r,a,c);if(!l)return null;c||=l.type,s.push([t,l])}return!wf(c,J)&&!wf(c,cf)&&!wf(c,sf)&&!wf(c,pf)&&!wf(c,hf)&&!wf(c,mf)&&!wf(c,_f)&&!wf(c,vf(J))?n.error(`Type ${yf(c)} is not interpolatable.`):new e(c,r,i,a,s,n.key)}evaluate(t){let n=this.labels,r=this.outputs;if(n.length===1)return r[0].evaluate(t);let i=this.input.evaluate(t);if(i<=n[0])return r[0].evaluate(t);let a=n.length;if(i>=n[a-1])return r[a-1].evaluate(t);let o=am(n,i,this.key),s=n[o],c=n[o+1],l=e.interpolationFactor(this.interpolation,i,s,c),u=r[o].evaluate(t),d=r[o+1].evaluate(t);switch(this.operator){case`interpolate`:switch(this.type.kind){case`number`:return wp(u,d,l);case`color`:return Ep.interpolate(u,d,l);case`padding`:return jp.interpolate(u,d,l);case`colorArray`:return Np.interpolate(u,d,l);case`numberArray`:return Mp.interpolate(u,d,l);case`variableAnchorOffsetCollection`:return Ip.interpolate(u,d,l,this.key);case`array`:return Tp(u,d,l);case`projectionDefinition`:return Rp.interpolate(u,d,l)}case`interpolate-hcl`:switch(this.type.kind){case`color`:return Ep.interpolate(u,d,l,`hcl`);case`colorArray`:return Np.interpolate(u,d,l,`hcl`)}case`interpolate-lab`:switch(this.type.kind){case`color`:return Ep.interpolate(u,d,l,`lab`);case`colorArray`:return Np.interpolate(u,d,l,`lab`)}case`interpolate-oklch`:switch(this.type.kind){case`color`:return Ep.interpolate(u,d,l,`oklch`);case`colorArray`:return Np.interpolate(u,d,l,`oklch`)}case`interpolate-oklab`:switch(this.type.kind){case`color`:return Ep.interpolate(u,d,l,`oklab`);case`colorArray`:return Np.interpolate(u,d,l,`oklab`)}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function fm(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}Ep.interpolate,jp.interpolate,Mp.interpolate,Np.interpolate,Ip.interpolate;var pm=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=null,i=n.expectedType;i&&i.kind!==`value`&&(r=i);let a=[];for(let e of t.slice(1)){let t=n.parse(e,1+a.length,r,void 0,{typeAnnotation:`omit`});if(!t)return null;r||=t.type,a.push(t)}if(!r)throw Error(`No output type`);return i&&a.some(e=>xf(i,e.type))?new e(Z,a):new e(r,a)}evaluate(e){let t=null,n=0,r;for(let i of this.args)if(n++,t=i.evaluate(e),t&&t instanceof Lp&&!t.available&&(r||=t.name,t=null,n===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 mm(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function hm(e,t,n){return t===n}function gm(e,t,n){return t!==n}function _m(e,t,n){return t<n}function vm(e,t,n){return t>n}function ym(e,t,n){return t<=n}function bm(e,t,n){return t>=n}function xm(e,t,n,r){return r.compare(t,n)===0}function Sm(e,t,n,r){return!xm(e,t,n,r)}function Cm(e,t,n,r){return r.compare(t,n)<0}function wm(e,t,n,r){return r.compare(t,n)>0}function Tm(e,t,n,r){return r.compare(t,n)<=0}function Em(e,t,n,r){return r.compare(t,n)>=0}function Dm(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n,r){this.lhs=e,this.rhs=t,this.key=n,this.collator=r,this.type=X,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,Z);if(!a)return null;if(!mm(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${yf(a.type)}'.`);let o=t.parse(e[2],2,Z);if(!o)return null;if(!mm(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${yf(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${yf(a.type)}' and '${yf(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new Gp(o.type,[a],t.key):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new Gp(a.type,[o],t.key)));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,df),!s)return null}return new i(a,o,t.key,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=Vp(a),n=Vp(o);if(t.kind!==n.kind||t.kind!==`string`&&t.kind!==`number`)throw new Pp(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`,this.key)}if(this.collator&&!r&&this.hasUntypedArgument){let e=Vp(a),n=Vp(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}var Om=Dm(`==`,hm,xm),km=Dm(`!=`,gm,Sm),Am=Dm(`<`,_m,Cm),jm=Dm(`>`,vm,wm),Mm=Dm(`<=`,ym,Tm),Nm=Dm(`>=`,bm,Em),Pm=class e{constructor(e,t,n){this.type=df,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,n){if(t.length!==2)return n.error(`Expected one argument.`);let r=t[1];if(typeof r!=`object`||!r||Array.isArray(r))return n.error(`Collator options argument must be an object.`);let i=n.parse(r[`case-sensitive`]!==void 0&&r[`case-sensitive`],1,X);if(!i)return null;let a=n.parse(r[`diacritic-sensitive`]!==void 0&&r[`diacritic-sensitive`],1,X);if(!a)return null;let o=null;return r.locale&&(o=n.parse(r.locale,1,Y),!o)?null:new e(i,a,o)}evaluate(e){return new Dp(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}},Fm=class e{constructor(e,t,n,r,i,a){this.type=Y,this.number=e,this.locale=t,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=a}static parse(t,n){if(t.length!==3)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,J);if(!r)return null;let i=t[2];if(typeof i!=`object`||!i||Array.isArray(i))return n.error(`NumberFormat options argument must be an object.`);let a=null;if(i.locale&&(a=n.parse(i.locale,1,Y),!a))return null;let o=null;if(i.currency&&(o=n.parse(i.currency,1,Y),!o))return null;let s=null;if(i.unit&&(s=n.parse(i.unit,1,Y),!s))return null;if(o&&s)return n.error("NumberFormat options `currency` and `unit` are mutually exclusive");let c=null;if(i[`min-fraction-digits`]&&(c=n.parse(i[`min-fraction-digits`],1,J),!c))return null;let l=null;return i[`max-fraction-digits`]&&(l=n.parse(i[`max-fraction-digits`],1,J),!l)?null:new e(r,a,o,s,c,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:this.unit?`unit`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},Im=class e{constructor(e){this.type=ff,this.sections=e}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[1];if(!Array.isArray(r)&&typeof r==`object`)return n.error(`First argument must be an image or text section.`);let i=[],a=!1;for(let e=1;e<=t.length-1;++e){let r=t[e];if(a&&typeof r==`object`&&r&&!Array.isArray(r)){a=!1;let e=null;if(r[`font-scale`]&&(e=n.parse(r[`font-scale`],1,J),!e))return null;let t=null;if(r[`text-font`]&&(t=n.parse(r[`text-font`],1,vf(Y)),!t))return null;let o=null;if(r[`text-color`]&&(o=n.parse(r[`text-color`],1,sf),!o))return null;let s=null;if(r[`vertical-align`]){if(typeof r[`vertical-align`]==`string`&&!Op.includes(r[`vertical-align`]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${r[`vertical-align`]}' instead.`);if(s=n.parse(r[`vertical-align`],1,Y),!s)return null}let c=i[i.length-1];c.scale=e,c.font=t,c.textColor=o,c.verticalAlign=s}else{let r=n.parse(t[e],1,Z);if(!r)return null;let o=r.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return n.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);a=!0,i.push({content:r,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new Ap(this.sections.map(t=>{let n=t.content.evaluate(e);return Vp(n)===gf?new kp(``,n,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new kp(Hp(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let 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}},Lm=class e{constructor(e){this.type=gf,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,Y);return r?new e(r):n.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=Lp.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},Rm=class e{constructor(e,t){this.input=e,this.key=t,this.type=J}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=n.parse(t[1],1);return r?r.type.kind!==`array`&&r.type.kind!==`string`&&r.type.kind!==`value`?n.error(`Expected argument of type string or array, but found ${yf(r.type)} instead.`):new e(r,n.key):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new Pp(`Expected value to be of type string or array, but found ${yf(Vp(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},zm={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};function Bm(e,t){return Array.isArray(e)?t===0?e.length>=2&&e.every(e=>typeof e==`number`):e.every(e=>Bm(e,t-1)):!1}function Vm(e){if(typeof e!=`object`||!e)return!1;let{type:t,coordinates:n}=e;return typeof t==`string`&&Object.keys(zm).includes(t)&&Bm(n,zm[t])}function Hm(e){if(typeof e!=`object`||!e)return null;let{type:t,geometry:n,features:r}=e,i;if(t===`FeatureCollection`){if(!Array.isArray(r))return null;i=[];for(let e of r){if(typeof e!=`object`||!e)return null;e.geometry!==null&&i.push(e.geometry)}}else if(t===`Feature`)i=[n];else return Vm(e)?[e]:null;let a=[];for(let e of i)if(Vm(e))a.push(e);else if(e?.type!==`GeometryCollection`)return null;return a}var Um=8192;function Wm(e,t){let n=Km(e[0]),r=Jm(e[1]),i=2**t.z;return[Math.round(n*i*Um),Math.round(r*i*Um)]}function Gm(e,t){let n=2**t.z,r=(e[0]/Um+t.x)/n,i=(e[1]/Um+t.y)/n;return[qm(r),Ym(i)]}function Km(e){return(180+e)/360}function qm(e){return e*360-180}function Jm(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Ym(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function Xm(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Zm(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Qm(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function $m(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i===0&&r*a<=0&&i*o<=0}function eh(e,t,n,r){let i=[t[0]-e[0],t[1]-e[1]];return oh([r[0]-n[0],r[1]-n[1]],i)!==0&&!!(sh(e,t,n,r)&&sh(n,r,e,t))}function th(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(eh(e,t,r[n],r[n+1]))return!0;return!1}function nh(e,t,n=!1){let r=!1;for(let i of t)for(let t=0;t<i.length-1;t++){if($m(e,i[t],i[t+1]))return n;Qm(e,i[t],i[t+1])&&(r=!r)}return r}function rh(e,t){for(let n of t)if(nh(e,n))return!0;return!1}function ih(e,t){for(let n of e)if(!nh(n,t))return!1;for(let n=0;n<e.length-1;++n)if(th(e[n],e[n+1],t))return!1;return!0}function ah(e,t){for(let n of t)if(ih(e,n))return!0;return!1}function oh(e,t){return e[0]*t[1]-e[1]*t[0]}function sh(e,t,n,r){let i=e[0]-n[0],a=e[1]-n[1],o=t[0]-n[0],s=t[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*a,d=o*l-c*s;return u>0&&d<0||u<0&&d>0}function ch(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=Wm(e[i][r],n);Xm(t,o),a.push(o)}r.push(a)}return r}function lh(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=ch(e[i],t,n);r.push(a)}return r}function uh(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=r*.5,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}Xm(t,e)}function dh(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function fh(e,t,n,r){let i=2**r.z*Um,a=[r.x*Um,r.y*Um],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];uh(r,t,n,i),o.push(r)}return o}function ph(e,t,n,r){let i=2**r.z*Um,a=[r.x*Um,r.y*Um],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];Xm(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){dh(t);for(let e of o)for(let r of e)uh(r,t,n,i)}return o}function mh(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=ch(t.coordinates,r,i),o=fh(e.geometry(),n,r,i);if(!Zm(n,r))return!1;for(let e of o)if(!nh(e,a))return!1}if(t.type===`MultiPolygon`){let a=lh(t.coordinates,r,i),o=fh(e.geometry(),n,r,i);if(!Zm(n,r))return!1;for(let e of o)if(!rh(e,a))return!1}return!0}function hh(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=ch(t.coordinates,r,i),o=ph(e.geometry(),n,r,i);if(!Zm(n,r))return!1;for(let e of o)if(!ih(e,a))return!1}if(t.type===`MultiPolygon`){let a=lh(t.coordinates,r,i),o=ph(e.geometry(),n,r,i);if(!Zm(n,r))return!1;for(let e of o)if(!ah(e,a))return!1}return!0}var gh=class e{constructor(e,t){this.type=X,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);let r=Bp(t[1])?Hm(t[1]):null;if(r){let n=t[1];if(n.type===`FeatureCollection`){let t=[];for(let{type:e,coordinates:n}of r)e===`Polygon`&&t.push(n),e===`MultiPolygon`&&t.push(...n);if(t.length)return new e(n,{type:`MultiPolygon`,coordinates:t})}else{let t=r[0];if(t?.type===`Polygon`||t?.type===`MultiPolygon`)return new e(n,t)}}return n.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 mh(e,this.geometries);if(e.geometryType()===`LineString`)return hh(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},_h=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let 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){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function vh(e,t,n=0,r=e.length-1,i=bh){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);vh(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(yh(e,n,t),i(e[r],a)>0&&yh(e,n,r);o<s;){for(yh(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?yh(e,n,s):(s++,yh(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function yh(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function bh(e,t){return e<t?-1:+(e>t)}function xh(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=Ch(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(vh(n[e],t,1,n[e].length-1,Sh),n[e]=n[e].slice(0,t));return n}function Sh(e,t){return t.area-e.area}function Ch(e){let t=0;for(let n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var wh=6378.137,Th=.0066943799901413165,Eh=Math.PI/180,Dh=class{constructor(e){let t=Eh*wh*1e3,n=Math.cos(e*Eh),r=1/(1-Th*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*.9933056200098587}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n=1/0,r,i,a,o;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;(u!==0||d!==0)&&(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<n&&(n=p,r=c,i=l,a=s,o=f)}return{point:[r,i],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},Oh=100,kh=50;function Ah(e,t){return t[0]-e[0]}function jh(e){return e[1]-e[0]+1}function Mh(e,t){return e[1]>=e[0]&&e[1]<t}function Nh(e,t){if(e[0]>e[1])return[null,null];let n=jh(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function Ph(e,t){if(!Mh(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)Xm(n,e[r]);return n}function Fh(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)Xm(t,e);return t}function Ih(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Lh(e,t,n){if(!Ih(e)||!Ih(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function Rh(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function zh(e,t,n,r,i){let a=Math.min(Rh(e,[n,r],i),Rh(t,[n,r],i)),o=Math.min(Rh(n,[e,t],i),Rh(r,[e,t],i));return Math.min(a,o)}function Bh(e,t,n,r,i){if(!(Mh(t,e.length)&&Mh(r,n.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(eh(t,s,r,o))return 0;a=Math.min(a,zh(t,s,r,o,i))}}return a}function Vh(e,t,n,r,i){if(!(Mh(t,e.length)&&Mh(r,n.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function Hh(e,t,n){if(nh(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,Rh(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function Uh(e,t,n,r){if(!Mh(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(nh(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(eh(t,o,a,c))return 0;i=Math.min(i,zh(t,o,a,c,r))}}return i}function Wh(e,t){for(let n of e)for(let e of n)if(nh(e,t,!0))return!0;return!1}function Gh(e,t,n,r=1/0){let i=Fh(e),a=Fh(t);if(r!==1/0&&Lh(i,a,n)>=r)return r;if(Zm(i,a)){if(Wh(e,t))return 0}else if(Wh(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(eh(i,s,r,c))return 0;o=Math.min(o,zh(i,s,r,c,n))}}return o}function Kh(e,t,n,r,i,a){if(!a)return;let o=Lh(Ph(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function qh(e,t,n,r,i,a,o){if(!a||!o)return;let s=Lh(Ph(r,a),Ph(i,o),n);s<t&&e.push([s,a,o])}function Jh(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new _h([[0,[0,e.length-1],[0,0]]],Ah),s=Fh(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?kh:Oh;if(jh(c)<=l){if(!Mh(c,e.length))return NaN;if(t){let t=Uh(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=Hh(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=Nh(c,t);Kh(o,a,r,e,s,n[0]),Kh(o,a,r,e,s,n[1])}}return a}function Yh(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new _h([[0,[0,e.length-1],[0,n.length-1]]],Ah);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?kh:Oh,d=r?kh:Oh;if(jh(c)<=u&&jh(l)<=d){if(!Mh(c,e.length)&&Mh(l,n.length))return NaN;let a;if(t&&r)a=Bh(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=Rh(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=Rh(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=Vh(e,c,n,l,i),o=Math.min(o,a)}else{let a=Nh(c,t),u=Nh(l,r);qh(s,o,i,e,n,a[0],u[0]),qh(s,o,i,e,n,a[0],u[1]),qh(s,o,i,e,n,a[1],u[0]),qh(s,o,i,e,n,a[1],u[1])}}return o}function Xh(e,t){let n=e.geometry(),r=n.flat().map(t=>Gm([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new Dh(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Yh(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Yh(r,!1,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Jh(r,!1,e.coordinates,i,a))}if(a===0)return a}return a}function Zh(e,t){let n=e.geometry(),r=n.flat().map(t=>Gm([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new Dh(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Yh(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Yh(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Jh(r,!0,e.coordinates,i,a))}if(a===0)return a}return a}function Qh(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=xh(n,0).map(t=>t.map(t=>t.map(t=>Gm([t.x,t.y],e.canonical)))),i=new Dh(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,Jh([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,Jh(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,Gh(t,e.coordinates,i,a))}if(a===0)return a}return a}function $h(e){return e.type===`MultiPolygon`?e.coordinates.map(e=>({type:`Polygon`,coordinates:e})):e.type===`MultiLineString`?e.coordinates.map(e=>({type:`LineString`,coordinates:e})):e.type===`MultiPoint`?e.coordinates.map(e=>({type:`Point`,coordinates:e})):[e]}var eg=class e{constructor(e,t){this.type=J,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);let r=Bp(t[1])?Hm(t[1]):null;return r?new e(t[1],r.flatMap(e=>$h(e))):n.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 Xh(e,this.geometries);if(e.geometryType()===`LineString`)return Zh(e,this.geometries);if(e.geometryType()===`Polygon`)return Qh(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},tg=class e{constructor(e){let t=null;for(let n of e)if(!t)t=n.type;else if(t===n.type)continue;else{t=Z;break}this.type=vf(t??Z,e.length),this.arr=e}static parse(t,n){if(t.length!==2)return n.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Bp(t[1]))return n.error(`invalid value of type "${typeof t[1]}"`);let r=t[1],i=Vp(r);if(i.kind===`array`){let t=r,i=n.concat(1),a=[];for(let e=0;e<t.length;e++){let n=i.parse(t[e],e,Z);if(!n)return null;a.push(n)}return new e(a)}return new Up(i,r)}evaluate(e){return this.arr.map(t=>t.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},ng=class e{constructor(e){this.key=e,this.type=Z}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return r==null?n.error(`Global state property must be defined.`):typeof r==`string`?new e(r):n.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:dp(t,this.key)??null}eachChild(){}outputDefined(){return!1}},rg={"==":Om,"!=":km,">":jm,"<":Am,">=":Nm,"<=":Mm,array:Gp,at:$p,boolean:Gp,case:rm,coalesce:pm,collator:Pm,format:Im,image:Lm,in:em,"index-of":tm,interpolate:dm,"interpolate-hcl":dm,"interpolate-lab":dm,"interpolate-oklch":dm,"interpolate-oklab":dm,length:Rm,let:Zp,literal:Up,match:nm,number:Gp,"number-format":Fm,object:Gp,semiliteral:tg,slice:im,step:om,string:Gp,"to-boolean":qp,"to-color":qp,"to-number":qp,"to-string":qp,var:Qp,within:gh,distance:eg,"global-state":ng},ig=class e{constructor(e,t,n,r,i){this.name=e,this.type=t,this._evaluate=n,this.args=r,this.key=i}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,n){let r=t[0],i=e.definitions[r];if(!i)return n.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),c=null;for(let[i,o]of s){c=new Xp(n.registry,dg,n.path,null,n.scope);let s=[],l=!1;for(let e=1;e<t.length;e++){let n=t[e],r=Array.isArray(i)?i[e-1]:i.type,a=c.parse(n,1+s.length,r);if(!a){l=!0;break}s.push(a)}if(!l){if(Array.isArray(i)&&i.length!==s.length)c.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);else{for(let e=0;e<s.length;e++){let t=Array.isArray(i)?i[e]:i.type,n=s[e];c.concat(e+1).checkSubtype(t,n.type)}if(c.errors.length===0)return new e(r,a,o,s,n.key)}}}if(s.length===1)n.errors.push(...c.errors);else{let e=(s.length?s:o).map(([e])=>ug(e)).join(` | `),r=[];for(let e=1;e<t.length;e++){let i=n.parse(t[e],1+r.length);if(!i)return null;r.push(yf(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(`, `)}) instead.`)}return null}static register(t,n){e.definitions=n;for(let r in n)t[r]=e}};function ag(e,[t,n,r,i],a){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);let o=i?i.evaluate(e):1,s=zp(t,n,r,o);if(s)throw new Pp(s,a);return new Ep(t/255,n/255,r/255,o,!1)}function og(e,t){return e in t&&t[e]!==void 0}function sg(e,t){let n=t[e];return n===void 0?null:n}function cg(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}function lg(e){return{type:e}}ig.register(rg,{error:[uf,[Y],(e,[t],n)=>{throw new Pp(t.evaluate(e),n)}],typeof:[Y,[Z],(e,[t])=>yf(Vp(t.evaluate(e)))],"to-rgba":[vf(J,4),[sf],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[n*255,r*255,i*255,a]}],rgb:[sf,[J,J,J],ag],rgba:[sf,[J,J,J,J],ag],has:{type:X,overloads:[[[Y],(e,[t])=>og(t.evaluate(e),e.properties())],[[Y,lf],(e,[t,n])=>og(t.evaluate(e),n.evaluate(e))]]},get:{type:Z,overloads:[[[Y],(e,[t])=>sg(t.evaluate(e),e.properties())],[[Y,lf],(e,[t,n])=>sg(t.evaluate(e),n.evaluate(e))]]},"feature-state":[Z,[Y],(e,[t])=>sg(t.evaluate(e),e.featureState||{})],properties:[lf,[],e=>e.properties()],"geometry-type":[Y,[],e=>e.geometryType()],id:[Z,[],e=>e.id()],zoom:[J,[],e=>e.globals.zoom],pitch:[J,[],e=>e.globals.pitch||0],bearing:[J,[],e=>e.globals.bearing||0],"heatmap-density":[J,[],e=>e.globals.heatmapDensity||0],elevation:[J,[],e=>e.globals.elevation||0],"line-progress":[J,[],e=>e.globals.lineProgress||0],accumulated:[Z,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[J,lg(J),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[J,lg(J),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:J,overloads:[[[J,J],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[J],(e,[t])=>-t.evaluate(e)]]},"/":[J,[J,J],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[J,[J,J],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[J,[],()=>Math.LN2],pi:[J,[],()=>Math.PI],e:[J,[],()=>Math.E],"^":[J,[J,J],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[J,[J],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[J,[J],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[J,[J],(e,[t])=>Math.log(t.evaluate(e))],log2:[J,[J],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[J,[J],(e,[t])=>Math.sin(t.evaluate(e))],cos:[J,[J],(e,[t])=>Math.cos(t.evaluate(e))],tan:[J,[J],(e,[t])=>Math.tan(t.evaluate(e))],asin:[J,[J],(e,[t])=>Math.asin(t.evaluate(e))],acos:[J,[J],(e,[t])=>Math.acos(t.evaluate(e))],atan:[J,[J],(e,[t])=>Math.atan(t.evaluate(e))],min:[J,lg(J),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[J,lg(J),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[J,[J],(e,[t])=>Math.abs(t.evaluate(e))],round:[J,[J],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[J,[J],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[J,[J],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[X,[Y,Z],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[X,[Z],(e,[t])=>e.id()===t.value],"filter-type-==":[X,[Y],(e,[t])=>e.geometryType()===t.value],"filter-<":[X,[Y,Z],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[X,[Z],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[X,[Y,Z],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[X,[Z],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[X,[Y,Z],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[X,[Z],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[X,[Y,Z],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[X,[Z],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[X,[Z],(e,[t])=>{let n=t.value,r=e.properties();return n in r&&r[n]!==void 0}],"filter-has-id":[X,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[X,[vf(Y)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[X,[vf(Z)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[X,[Y,vf(Z)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[X,[Y,vf(Z)],(e,[t,n])=>cg(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:X,overloads:[[[X,X],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[lg(X),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:X,overloads:[[[X,X],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[lg(X),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[X,[X],(e,[t])=>!t.evaluate(e)],"is-supported-script":[X,[Y],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return!n||n(t.evaluate(e))}],upcase:[Y,[Y],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Y,[Y],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Y,lg(Z),(e,t)=>t.map(t=>Hp(t.evaluate(e))).join(``)],split:[vf(Y),[Y,Y],(e,[t,n])=>t.evaluate(e).split(n.evaluate(e))],join:[Y,[vf(Y),Y],(e,[t,n])=>t.evaluate(e).join(n.evaluate(e))],"resolved-locale":[Y,[df],(e,[t])=>t.evaluate(e).resolvedLocale()]});function ug(e){return Array.isArray(e)?`(${e.map(yf).join(`, `)})`:`(${yf(e.type)}...)`}function dg(e){if(e instanceof Qp)return dg(e.boundExpression);if(e instanceof ig&&e.name===`error`||e instanceof Pm||e instanceof gh||e instanceof eg||e instanceof ng)return!1;let t=e instanceof qp||e instanceof Gp,n=!0;return e.eachChild(e=>{n&&=t?dg(e):e instanceof Up}),n?fg(e)&&mg(e,[`zoom`,`pitch`,`bearing`,`heatmap-density`,`elevation`,`line-progress`,`accumulated`,`is-supported-script`]):!1}function fg(e){if(e instanceof ig&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof gh||e instanceof eg)return!1;let t=!0;return e.eachChild(e=>{t&&!fg(e)&&(t=!1)}),t}function pg(e){if(e instanceof ig&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild(e=>{t&&!pg(e)&&(t=!1)}),t}function mg(e,t){if(e instanceof ig&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild(e=>{n&&!mg(e,t)&&(n=!1)}),n}function hg(e){return{result:`success`,value:e}}function gg(e){return{result:`error`,value:e}}function _g(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function vg(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function yg(e){return!!e.expression&&e.expression.interpolated}function bg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Vp(e)===lf}var xg=class{constructor(e,t,n,r){this.expression=e,this._warningHistory={},this._evaluator=new Yp,this._defaultValue=n?Mg(n):null,this._enumValues=n&&n.type===`enum`?n.values:null,this._globalState=r,this._rootKey=t}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=Ng(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._globalState&&(e=Ng(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!==e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Pp(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(`, `)}, but found ${JSON.stringify(e)} instead.`,``);return e}catch(e){let t=e instanceof Pp?e.path:``,n=`${t}|${e.message}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<`u`&&console.warn(Sg(this._rootKey,t,e.message,this._defaultValue))),this._defaultValue}}};function Sg(e,t,n,r){return`${e}${t}: ${n}${r==null?``:` Falling back to ${String(r)}.`}`}function Cg(e){if(!e)throw Error(`rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".`)}function wg(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&dp(rg,e[0])!==void 0}function Tg(e,t,n,r){Cg(t);let i=new Xp(rg,dg,[],n?jg(n):void 0),a=i.parse(e,void 0,void 0,void 0,n&&n.type===`string`?{typeAnnotation:`coerce`}:void 0);return a?hg(new xg(a,t,n,r)):gg(i.errors)}var Eg=class{constructor(e,t,n){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!pg(t.expression),this.globalStateRefs=Ag(t.expression),this._globalState=n}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=Ng(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=Ng(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}},Dg=class{constructor(e,t,n,r,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!pg(t.expression),this.globalStateRefs=Ag(t.expression),this.interpolationType=r,this._globalState=i}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=Ng(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=Ng(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?dm.interpolationFactor(this.interpolationType,e,t,n):0}};function Og(e,t,n,r){let i=Tg(e,t,n,r);if(i.result===`error`)return i;let a=i.value.expression,o=fg(a);if(!o&&!_g(n))return gg([new rf(``,`data expressions not supported`)]);let s=mg(a,[`zoom`]);if(!s&&!vg(n))return gg([new rf(``,`zoom expressions not supported`)]);if(!mg(a,[`pitch`,`bearing`]))return gg([new rf(``,`"pitch" and "bearing" expressions are only supported in symbol layer filters.`)]);let c=kg(a);if(!c&&!s)return gg([new rf(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)]);if(c instanceof rf)return gg([c]);if(c instanceof dm&&!yg(n))return gg([new rf(``,`"interpolate" expressions cannot be used with this property`)]);if(!c)return hg(o?new Eg(`constant`,i.value,r):new Eg(`source`,i.value,r));let l=c instanceof dm?c.interpolation:void 0;return hg(o?new Dg(`camera`,i.value,c.labels,l,r):new Dg(`composite`,i.value,c.labels,l,r))}function kg(e,t=new Map){if(t.has(e))return t.get(e);let n=null;if(e instanceof Zp)n=kg(e.result,t);else if(e instanceof pm){for(let r of e.args)if(n=kg(r,t),n)break}else(e instanceof om||e instanceof dm)&&e.input instanceof ig&&e.input.name===`zoom`&&(n=e);return n instanceof rf?(t.set(e,n),n):(e.eachChild(e=>{let r=kg(e,t);r instanceof rf?n=r:!n&&r?n=new rf(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):n&&r&&n!==r&&(n=new rf(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t.set(e,n),n)}function Ag(e,t=new Set){return e instanceof ng&&t.add(e.key),e.eachChild(e=>{Ag(e,t)}),t}function jg(e){let t={color:sf,string:Y,number:J,enum:Y,boolean:X,formatted:ff,padding:pf,numberArray:hf,colorArray:mf,projectionDefinition:cf,resolvedImage:gf,variableAnchorOffsetCollection:_f};return e.type===`array`?vf(t[e.value]||Z,e.length):t[e.type]}function Mg(e){if(e.type===`color`&&bg(e.default))return new Ep(0,0,0,0);switch(e.type){case`color`:return Ep.parse(e.default)||null;case`padding`:return jp.parse(e.default)||null;case`numberArray`:return Mp.parse(e.default)||null;case`colorArray`:return Np.parse(e.default)||null;case`variableAnchorOffsetCollection`:return Ip.parse(e.default)||null;case`projectionDefinition`:return Rp.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function Ng(e,t){let{zoom:n,pitch:r,bearing:i,heatmapDensity:a,elevation:o,lineProgress:s,isSupportedScript:c,accumulated:l}=e??{};return{zoom:n,pitch:r,bearing:i,heatmapDensity:a,elevation:o,lineProgress:s,isSupportedScript:c,accumulated:l,globalState:t}}function Pg(e){let t=!1;for(let n of e){let e=Fg(n);if(e===`expression`)return`expression`;e===`legacy`&&(t=!0)}return t?`legacy`:`neutral`}function Fg(e){if(typeof e==`boolean`)return`neutral`;if(!Array.isArray(e)||e.length===0)return`legacy`;switch(e[0]){case`has`:return e.length<2||e[1]===`$id`||e[1]===`$type`?`legacy`:e.length===2?`neutral`:`expression`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]))?`expression`:`legacy`;case`!in`:case`!has`:return`legacy`;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?`expression`:`legacy`;case`none`:return`legacy`;case`any`:case`all`:return Pg(e.slice(1));default:return`expression`}}function Ig(e){return Fg(e)!==`legacy`}function Lg(e){return e===`$type`?[`geometry-type`]:e===`$id`?[`id`]:[`get`,e]}function Rg(e){switch(e[0]){case`==`:case`!=`:case`<`:case`<=`:case`>`:case`>=`:return e.length!==3||typeof e[1]!=`string`?null:[e[0],Lg(e[1]),e[2]];case`in`:case`!in`:{if(e.length<2||typeof e[1]!=`string`)return null;let t=[`in`,Lg(e[1]),[`literal`,e.slice(2)]];return e[0]===`!in`?[`!`,t]:t}case`has`:case`!has`:{if(e.length!==2||typeof e[1]!=`string`||e[1]===`$type`||e[1]===`$id`)return null;let t=[`has`,e[1]];return e[0]===`!has`?[`!`,t]:t}default:return null}}function zg(e){if((e[0]===`<`||e[0]===`<=`||e[0]===`>`||e[0]===`>=`)&&e[1]===`$type`)return`"$type" cannot be use with operator "${e[0]}"`;let t=Rg(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function Bg(e,t,n){let r=n[e];return Array.isArray(r)?Ig(r)?Vg(r,t.concat(e)):{path:t.concat(e),legacyFilter:r}:null}function Vg(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case`all`:case`any`:case`none`:for(let n=1;n<e.length;n++){let r=Bg(n,t,e);if(r)return r}break;case`!`:{let n=Bg(1,t,e);if(n)return n;break}case`case`:for(let n=1;n<e.length-1;n+=2){let r=Bg(n,t,e);if(r)return r}}return null}function Hg(e,t){let n=Vg(e);if(!n||typeof console>`u`)return;let r=n.path.map(e=>`[${e}]`).join(``);console.warn(`${t}${r}: ${zg(n.legacyFilter)}`)}var Ug={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`,`pitch`,`bearing`]}};function Wg(e,t,n){if(e==null)return{filter:()=>!0,needGeometry:!1,needCamera:!1,getGlobalStateRefs:()=>new Set};Ig(e)?Hg(e,t):e=qg(e);let r=Tg(e,t,Ug,n);if(r.result===`error`)throw Error(r.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:Kg(e),needCamera:!mg(r.value.expression,[`pitch`,`bearing`]),getGlobalStateRefs:()=>Ag(r.value.expression)}}function Gg(e,t){return e<t?-1:+(e>t)}function Kg(e){if(!Array.isArray(e))return!1;if(e[0]===`within`||e[0]===`distance`)return!0;for(let t=1;t<e.length;t++)if(Kg(e[t]))return!0;return!1}function qg(e){if(!e)return!0;let t=e[0];return e.length<=1?t!==`any`:t===`==`?Jg(e[1],e[2],`==`):t===`!=`?Qg(Jg(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?Jg(e[1],e[2],t):t===`any`?Yg(e.slice(1)):t===`all`?[`all`].concat(e.slice(1).map(qg)):t===`none`?[`all`].concat(e.slice(1).map(qg).map(Qg)):t===`in`?Xg(e[1],e.slice(2)):t===`!in`?Qg(Xg(e[1],e.slice(2))):t===`has`?Zg(e[1]):t!==`!has`||Qg(Zg(e[1]))}function Jg(e,t,n){switch(e){case`$type`:return[`filter-type-${n}`,t];case`$id`:return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function Yg(e){return[`any`].concat(e.map(qg))}function Xg(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?[`filter-in-large`,e,[`literal`,t.sort(Gg)]]:[`filter-in-small`,e,[`literal`,t]]}}function Zg(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function Qg(e){return[`!`,e]}function $g(e){return typeof e==`object`?[`literal`,e]:e}function e_(e,t){let n=e.stops;if(!n)return t_(e,t);let r=n&&typeof n[0][0]==`object`,i=r||e.property!==void 0,a=r||!i;return n=n.map(e=>!i&&t.tokens&&typeof e[1]==`string`?[e[0],d_(e[1])]:[e[0],$g(e[1])]),r?r_(e,t,n):a?s_(e,t,n):o_(e,t,n)}function t_(e,t){let n=[`get`,e.property];if(e.default===void 0)return t.type===`string`?[`string`,n]:n;if(t.type===`enum`)return[`match`,n,Object.keys(t.values),n,e.default];{let r=[t.type===`color`?`to-color`:t.type,n,$g(e.default)];return t.type===`array`&&r.splice(1,0,t.value,t.length||null),r}}function n_(e){switch(e.colorSpace){case`hcl`:return`interpolate-hcl`;case`lab`:return`interpolate-lab`;case`oklch`:return`interpolate-oklch`;case`oklab`:return`interpolate-oklab`;default:return`interpolate`}}function r_(e,t,n){let r={},i={},a=[];for(let t=0;t<n.length;t++){let o=n[t],s=o[0].zoom;r[s]===void 0&&(r[s]={zoom:s,type:e.type,property:e.property,default:e.default,colorSpace:e.colorSpace},i[s]=[],a.push(s)),i[s].push([o[0].value,o[1]])}if(u_({},t)===`exponential`){let n=[n_(e),[`linear`],[`zoom`]];for(let e of a)l_(n,e,o_(r[e],t,i[e]),!1);return n}{let e=[`step`,[`zoom`]];for(let n of a)l_(e,n,o_(r[n],t,i[n]),!0);return c_(e),e}}function i_(e,t){if(e!==void 0)return e;if(t!==void 0)return t}function a_(e,t){let n=$g(i_(e.default,t.default));return n===void 0&&t.type===`resolvedImage`?``:n}function o_(e,t,n){let r=u_(e,t),i=[`get`,e.property];if(r===`categorical`&&typeof n[0][0]==`boolean`){let r=[`case`];for(let e of n)r.push([`==`,i,e[0]],e[1]);return r.push(a_(e,t)),r}if(r===`categorical`){let r=[`match`,i];for(let e of n)l_(r,e[0],e[1],!1);return r.push(a_(e,t)),r}if(r===`interval`){let t=[`step`,[`number`,i]];for(let e of n)l_(t,e[0],e[1],!0);return c_(t),e.default===void 0?t:[`case`,[`==`,[`typeof`,i],`number`],t,$g(e.default)]}if(r===`exponential`){let t=e.base===void 0?1:e.base,r=[n_(e),t===1?[`linear`]:[`exponential`,t],[`number`,i]];for(let e of n)l_(r,e[0],e[1],!1);return e.default===void 0?r:[`case`,[`==`,[`typeof`,i],`number`],r,$g(e.default)]}throw Error(`Unknown property function type ${r}`)}function s_(e,t,n,r=[`zoom`]){let i=u_(e,t),a,o=!1;if(i===`interval`)a=[`step`,r],o=!0;else if(i===`exponential`){let t=e.base===void 0?1:e.base;a=[n_(e),t===1?[`linear`]:[`exponential`,t],r]}else throw Error(`Unknown zoom function type "${i}"`);for(let e of n)l_(a,e[0],e[1],o);return c_(a),a}function c_(e){e[0]===`step`&&e.length===3&&(e.push(0),e.push(e[2]))}function l_(e,t,n,r){e.length>3&&t===e[e.length-2]||(r&&e.length===2||e.push(t),e.push(n))}function u_(e,t){return e.type?e.type:t.expression.interpolated?`exponential`:`interval`}function d_(e){let t=[`concat`],n=/{([^{}]+)}/g,r=0;for(let i=n.exec(e);i!==null;i=n.exec(e)){let a=e.slice(r,n.lastIndex-i[0].length);r=n.lastIndex,a.length>0&&t.push(a),t.push([`get`,i[1]])}if(t.length===1)return e;if(r<e.length)t.push(e.slice(r));else if(t.length===2)return[`to-string`,t[1]];return t}var f_=4294967296,p_=12,m_=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`),h_=0,g_=1,__=2,v_=5,y_=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,n=this.length){let r;for(;r=this.nextField(n);)e(r,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*f_;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*f_;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,n=t[this.pos++];if(n<128)return n;let r=n&127,i;return i=t[this.pos++],r|=(i&127)<<7,i<128||(i=t[this.pos++],r|=(i&127)<<14,i<128)||(i=t[this.pos++],r|=(i&127)<<21,i<128)?r:(i=t[this.pos],r|=(i&15)<<28,b_(r,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=p_&&m_?m_.decode(this.buf.subarray(t,e)):S_(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===__?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=t&7,this._valueStart=this.pos,t>>>3}skip(e){let t=e&7;if(t===h_)for(;this.buf[this.pos++]>127;);else if(t===__)this.pos=this.readVarint()+this.pos;else if(t===v_)this.pos+=4;else if(t===g_)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}};function b_(e,t,n){let r=n.buf,i,a;if(a=r[n.pos++],i=(a&112)>>4,a<128||(a=r[n.pos++],i|=(a&127)<<3,a<128)||(a=r[n.pos++],i|=(a&127)<<10,a<128)||(a=r[n.pos++],i|=(a&127)<<17,a<128)||(a=r[n.pos++],i|=(a&127)<<24,a<128)||(a=r[n.pos++],i|=(a&1)<<31,a<128))return x_(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}function x_(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function S_(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o>n)break;let s,c,l;o===1?t<128&&(a=t):o===2?(s=e[i+1],(s&192)==128&&(a=(t&31)<<6|s&63,a<=127&&(a=null))):o===3?(s=e[i+1],c=e[i+2],(s&192)==128&&(c&192)==128&&(a=(t&15)<<12|(s&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):o===4&&(s=e[i+1],c=e[i+2],l=e[i+3],(s&192)==128&&(c&192)==128&&(l&192)==128&&(a=(t&15)<<18|(s&63)<<12|(c&63)<<6|l&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,o=1):a>65535&&(a-=65536,r+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),r+=String.fromCharCode(a),i+=o}return r}var C_=class extends Od{constructor(e){super(),e||={},this.dataProjection=new Qn({code:``,units:`tile-pixels`}),this.featureClass=e.featureClass?e.featureClass:Cd,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,n,r){if(t.geometry===void 0)return;e.pos=t.geometry;let i=e.readVarint()+e.pos,a=1,o=0,s=0,c=0,l=0,u=0;for(;e.pos<i;){if(!o){let t=e.readVarint();a=t&7,o=t>>3}if(o--,a===1||a===2)s+=e.readSVarint(),c+=e.readSVarint(),a===1&&l>u&&(r.push(l),u=l),n.push(s,c),l+=2;else if(a===7)l>u&&(n.push(n[u],n[u+1]),l+=2);else throw Error(`Invalid command found in the PBF`)}l>u&&(r.push(l),u=l)}createFeature_(e,t,n){let r=t.type;if(r===0)return null;let i,a=t.properties,o;this.idProperty_?(o=a[this.idProperty_],a[this.idProperty_]=void 0):o=t.id,a[this.layerName_]=t.layer.name;let s=[],c=[];this.readRawGeometry_(e,t,s,c);let l=O_(r,c.length);if(this.featureClass===Cd)i=new this.featureClass(l,s,c,2,a,o),i.transform(n.dataProjection);else{let e;if(l==`Polygon`){let t=Ha(s,c);e=t.length>1?new xd(s,`XY`,t):new Ua(s,`XY`,c)}else e=l===`Point`?new Na(s,`XY`):l===`LineString`?new _d(s,`XY`):l===`MultiPoint`?new yd(s,`XY`):l===`MultiLineString`?new vd(s,`XY`,c):null;if(!e)return null;i=new this.featureClass,this.geometryName_&&i.setGeometryName(this.geometryName_);let t=kd(e,!1,n);i.setGeometry(t),o!==void 0&&i.setId(o),i.setProperties(a,!0)}return i}getType(){return`arraybuffer`}readFeatures(e,t){let n=this.layers_,r=this.adaptOptions(t),i=H(r.dataProjection);if(!i)return[];r.extent&&i.setWorldExtent(r.extent),r.dataProjection=i;let a=new y_(e),o=a.readFields(w_,{}),s=[];for(let e in o){if(n&&!n.includes(e))continue;let t=o[e],c=t?[0,0,t.extent,t.extent]:null;c&&i.setExtent(c);for(let e=0,n=t.length??0;e<n;++e){let n=D_(a,t,e),i=this.createFeature_(a,n,r);i!==null&&s.push(i)}}return s}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}};function w_(e,t,n){if(e===3){let e={keys:[],values:[],features:[]},r=n.readVarint()+n.pos;n.readFields(T_,e,r),e.length=e.features.length,e.length&&e.name&&(t[e.name]=e)}}function T_(e,t,n){if(e===15)t.version=n.readVarint();else if(e===1)t.name=n.readString();else if(e===5)t.extent=n.readVarint();else if(e===2)t.features.push(n.pos);else if(e===3)t.keys.push(n.readString());else if(e===4){let r=null,i=n.readVarint()+n.pos;for(;n.pos<i;)e=n.readVarint()>>3,r=e===1?n.readString():e===2?n.readFloat():e===3?n.readDouble():e===4?n.readVarint(!0):e===5?n.readVarint():e===6?n.readSVarint():e===7?n.readBoolean():null;t.values.push(r)}}function E_(e,t,n){if(e==1)t.id=n.readVarint();else if(e==2){let e=n.readVarint()+n.pos;for(;n.pos<e;){let e=t.layer.keys[n.readVarint()],r=t.layer.values[n.readVarint()];t.properties[e]=r}}else e==3?t.type=n.readVarint():e==4&&(t.geometry=n.pos)}function D_(e,t,n){e.pos=t.features[n];let r=e.readVarint()+e.pos,i={layer:t,type:0,properties:{}};return e.readFields(E_,i,r),i}function O_(e,t){let n;return e===1?n=t===1?`Point`:`MultiPoint`:e===2?n=t===1?`LineString`:`MultiLineString`:e===3&&(n=`Polygon`),n}var k_=class extends tt{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(F.CHANGE)}release(){this.setState(z.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==z.EMPTY){if(this.state!==z.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){I()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Un(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()}};function A_(e){return e instanceof Image||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageBitmap?e:null}function j_(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e instanceof DataView?e:null}var M_=Error(`disposed`),N_=null;function P_(e){N_||=yo(e.width,e.height,void 0,{willReadFrequently:!0});let t=N_.canvas,n=e.width;t.width!==n&&(t.width=n);let r=e.height;return t.height!==r&&(t.height=r),N_.clearRect(0,0,n,r),N_.drawImage(e,0,0),N_.getImageData(0,0,n,r).data}var F_=[256,256],I_=class extends k_{constructor(e){let t=z.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_;let e=A_(this.data_);return e?[e.width,e.height]:F_}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==z.IDLE&&this.state!==z.ERROR)return;this.state=z.LOADING,this.changed();let e=this;this.loader_().then(function(t){e.data_=t,e.state=z.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=z.ERROR,e.changed()})}disposeInternal(){this.controller_&&=(this.controller_.abort(M_),null),super.disposeInternal()}},L_=class extends k_{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=n,this.key=n,this.image_,ht?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&this.crossOrigin_!==void 0&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=z.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_??null}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=z.ERROR,this.unlistenImage_(),this.image_=R_(),this.changed()}handleImageLoad_(){if(ht)this.state=z.LOADED;else{let e=this.image_;this.state=e.naturalWidth&&e.naturalHeight?z.LOADED:z.EMPTY}this.unlistenImage_(),this.changed()}load(){if(this.state==z.ERROR&&(this.state=z.IDLE,this.image_=new Image,this.crossOrigin_!==null&&this.crossOrigin_!==void 0&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==z.IDLE){this.state=z.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_);let e=this.image_;e&&(this.unlisten_=Cl(e,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function R_(){let e=yo(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var z_=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,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 B_(e,t,n,r,i){return i===void 0?new z_(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}var V_,H_=[];function U_(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function W_(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-191.25)>2}function G_(){if(V_===void 0){let e=yo(6,6,H_);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,U_(e,4,5,4,0),U_(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;V_=W_(t,0)||W_(t,4)||W_(t,8),So(e),H_.push(e.canvas)}return V_}function K_(e,t,n,r){let i=hi(n,t,e),a=ii(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||Yt(c,i)){let t=ii(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function q_(e,t,n,r){let i=K_(e,t,mn(n),r);return(!isFinite(i)||i<=0)&&un(n,function(n){return i=K_(e,t,n,r),isFinite(i)&&i>0}),i}function J_(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=yo(Math.round(n*e),Math.round(n*t),H_);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=$t();c.forEach(function(e,t,n){on(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){let e=yo(Math.round(V(g)*v),Math.round(vn(g)*v),H_);if(_=e,d||(e.imageSmoothingEnabled=!1),i&&p){let t=(i[0]-g[0])*v,n=-(i[3]-g[3])*v,r=V(i)*v,a=vn(i)*v;e.rect(t,n,r,a),e.clip()}c.forEach(function(t,n,r){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){e.save();let n=(t.clipExtent[0]-g[0])*v,r=-(t.clipExtent[3]-g[3])*v,i=V(t.clipExtent)*v,a=vn(t.clipExtent)*v;e.rect(d?n:Math.round(n),d?r:Math.round(r),d?i:Math.round(n+i)-Math.round(n),d?a:Math.round(r+a)-Math.round(r)),e.clip()}let n=(t.extent[0]-g[0])*v,r=-(t.extent[3]-g[3])*v,i=V(t.extent)*v,a=vn(t.extent)*v;e.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,d?n:Math.round(n),d?r:Math.round(r),d?i:Math.round(n+i)-Math.round(n),d?a:Math.round(r+a)-Math.round(r)),t.clipExtent&&e.restore()}})}let b=xn(o);return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),E=o,D=s;o=0,s=0,l-=E,u-=D,f-=E,p-=D;let O=Mt([[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]]);if(!O)return;if(m.save(),m.beginPath(),G_()||!d){m.moveTo(S,C);let e=v-S,t=x-C;for(let n=0;n<4;n++)m.lineTo(S+h((n+1)*e/4),C+h(n*t/3)),n!=3&&m.lineTo(S+h((n+1)*e/4),C+h((n+1)*t/3));m.lineTo(w,T)}else m.moveTo(S,C),m.lineTo(v,x),m.lineTo(w,T);m.clip(),m.transform(O[0],O[2],O[1],O[3],v,x),m.translate(g[0]-E,g[3]-D);let k;if(_)k=_.canvas,m.scale(y,-y);else{let e=c[0],t=e.extent;k=e.image,m.scale(V(t)/k.width,-vn(t)/k.height)}m.drawImage(k,0,0),m.restore()}),_&&(So(_),H_.push(_.canvas)),u&&(m.save(),m.globalCompositeOperation=`source-over`,m.strokeStyle=`black`,m.lineWidth=1,s.getTriangles().forEach(function(e,t,n){let r=e.target,i=(r[0][0]-b[0])/a,o=-(r[0][1]-b[1])/a,s=(r[1][0]-b[0])/a,c=-(r[1][1]-b[1])/a,l=(r[2][0]-b[0])/a,u=-(r[2][1]-b[1])/a;m.beginPath(),m.moveTo(s,c),m.lineTo(i,o),m.lineTo(l,u),m.closePath(),m.stroke()}),m.restore()),m.canvas}var Y_=10,X_=.25,Z_=class{constructor(e,t,n,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;let s={},c=o?ci(e=>Mi(o,hi(e,this.targetProj_,this.sourceProj_))):mi(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&V(r)>=V(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?V(this.sourceProj_.getExtent()):void 0,this.targetWorldWidth_=this.targetProj_.getExtent()?V(this.targetProj_.getExtent()):void 0;let l=xn(n),u=Sn(n),d=pn(n),f=fn(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=Y_+(a?Math.max(0,Math.ceil(Math.log2(dn(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=this.sourceWorldWidth_;if(!e)return;let t=1/0;this.triangles_.forEach(function(e,n,r){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])}),this.triangles_.forEach(n=>{if(Math.max(n.source[0][0],n.source[1][0],n.source[2][0])-t>e/2){let r=[[n.source[0][0],n.source[0][1]],[n.source[1][0],n.source[1][1]],[n.source[2][0],n.source[2][1]]];r[0][0]-t>e/2&&(r[0][0]-=e),r[1][0]-t>e/2&&(r[1][0]-=e),r[2][0]-t>e/2&&(r[2][0]-=e);let i=Math.min(r[0][0],r[1][0],r[2][0]);Math.max(r[0][0],r[1][0],r[2][0])-i<e/2&&(n.source=r)}})}s={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=Wt([i,a,o,s]),u=this.sourceWorldWidth_,d=u?V(l)/u:void 0,f=this.sourceProj_.canWrapX()&&d!==void 0&&d>.5&&d<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=V(Wt([e,t,n,r]))/this.targetWorldWidth_>X_||p),!f&&this.sourceProj_.isGlobal()&&d&&(p=d>X_||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!Cn(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+ +(!isFinite(s[0])||!isFinite(s[1])),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;if(f){let e=u;a=(Ft(i[0],e)+Ft(o[0],e))/2-Ft(r[0],e)}else a=(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=$t();return this.triangles_.forEach(function(t,n,r){let i=t.source;sn(e,i[0]),sn(e,i[1]),sn(e,i[2])}),e}getTriangles(){return this.triangles_}},Q_=.5,$_=class extends k_{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,z.IDLE,d),this.renderEdges_=u!==void 0&&u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()&&e.getExtent()||void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?yn(f,p):f;if(dn(h)===0){this.state=z.EMPTY;return}let g=e.getExtent();g&&(m=m?yn(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=q_(e,n,h,_);if(!isFinite(v)||v<=0){this.state=z.EMPTY;return}let y=l===void 0?Q_:l;if(this.triangulation_=new Z_(e,n,h,m||void 0,v*y,_),this.triangulation_.getTriangles().length===0){this.state=z.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(b[1]=kt(b[1],m[1],m[3]),b[3]=kt(b[3],m[1],m[3])):b=yn(b,m)),!dn(b))this.state=z.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=V(g),r=Math.floor((b[0]-g[0])/n)),kn(b.slice(),e,!0).forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=r*n;this.sourceTiles_.push({getTile:()=>c(this.sourceZ_,e,t,o),offset:i})}++r}),this.sourceTiles_.length===0&&(this.state=z.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==z.LOADED){let r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=t.offset,r[2]+=t.offset;let i=this.clipExtent_?.slice();i&&(i[0]+=t.offset,i[2]+=t.offset);let a=n.getImage();if(!a)return;e.push({extent:r,clipExtent:i,image:a})}}),this.sourceTiles_.length=0,e.length===0)this.state=z.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=J_(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent()??s,a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=z.LOADED}this.changed()}load(){for(let e of this.sourceTiles_)e.tile=e.getTile();if(this.state==z.IDLE){this.state=z.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(t=>{let n=t.tile;if(!n)return;let r=n.getState();if(r==z.IDLE||r==z.LOADING){e++;let t=P(n,F.CHANGE,()=>{let r=n.getState();(r==z.LOADED||r==z.ERROR||r==z.EMPTY)&&(Le(t),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(t)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e){let t=e.tile;t&&t.getState()==z.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_&&=(this.sourcesListenerKeys_.forEach(Le),null)}release(){this.canvas_&&=(So(this.canvas_.getContext(`2d`)),H_.push(this.canvas_),null),this.sourceTiles_.length=0,super.release()}},e1=class{constructor(e){this.highWaterMark=e===void 0?2048:e,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let e=this.pop();e instanceof Re&&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){let n=this.entries_[e];return B(n!==void 0,`Tried to get a value for a key that does not exist in the cache`),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(e){let t=this.entries_[e];return B(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(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){let 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){B(!(e in this.entries_),`Tried to set a value for a key that is used already`);let n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}};function t1(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function n1(e,t,n){return e+`/`+t+`/`+n}function r1(e,t,n,r,i){return`${L(e)},${t},${n1(n,r,i)}`}function i1(e){return a1(e[0],e[1],e[2])}function a1(e,t,n){return(t<<e)+n}function o1(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return!a||a.containsXY(r,i)}var s1=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.pendingMethod_,this.context_=new Proxy(xo(),{get:(e,t)=>{if(typeof e[t]==`function`)return this.pendingMethod_=t,this.pushMethodArgs_},set:(e,t,n)=>(this.push_(t,n),!0)})}push_(...e){let t=this.instructions_,n=this.zIndex+this.offset_;t[n]||(t[n]=[]),t[n].push(...e)}pushMethodArgs_=(...e)=>{this.push_(this.pendingMethod_,e)};pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let n=0,r=t.length;n<r;++n){let r=t[n];if(typeof r==`function`){r(e);continue}let i=t[++n];typeof e[r]==`function`?e[r](...i):e[r]=typeof i==`function`?i(e):i}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},c1=5,l1=class extends nt{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=[],this.maxStaleKeys=c1,this.renderedSourceKey_}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}updateStaleKeys(e){this.renderedSourceKey_?this.renderedSourceKey_!==e&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=e):this.renderedSourceKey_=e}getFeatures(e){return I()}getData(e){return null}prepareFrame(e){return I()}renderFrame(e,t){return I()}forEachFeatureAtCoordinate(e,t,n,r,i){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){let t=e.target;(t.getState()===q.LOADED||t.getState()===q.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=q.LOADED&&t!=q.ERROR&&e.addEventListener(F.CHANGE,this.boundHandleImageChange_),t==q.IDLE&&(e.load(),t=e.getState()),t==q.LOADED}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&e.getSourceState()===`ready`&&e.changed()}renderDeferred(e){}disposeInternal(){this.layer_=void 0,super.disposeInternal()}},u1=[],d1=null;function f1(){d1=yo(1,1,void 0,{willReadFrequently:!0})}var p1=class extends l1{constructor(e){super(e),this.wantRotation=!1,this.container=null,this.renderedResolution,this.tempTransform=Di(),this.pixelTransform=Di(),this.inversePixelTransform=Di(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,n){d1||f1();let r=d1;if(!r)return null;r.clearRect(0,0,1,1);let i;try{r.drawImage(e,t,n,1,1,0,0,1,1),i=r.getImageData(0,0,1,1).data}catch{return d1=null,null}return i}getBackground(e){let t=this.getLayer().getBackground();return typeof t==`function`&&(t=t(e.viewState.resolution)),t||void 0}useContainer(e,t,n,r,i){if(Do(e)&&this.pixelTransform[1]===0&&this.pixelTransform[2]===0&&this.pixelTransform[4]===0&&this.pixelTransform[5]===0&&e.width===r&&e.height===i){let t=e,r=t.getContext(`2d`);if(r){this.container=e,this.context=r,this.containerReused=!0,n&&(r.fillStyle=n,r.fillRect(0,0,t.width,t.height));return}}let a=this.getLayer().getClassName(),o,s;if(e&&e.className===a&&(!n||e&&e.style.backgroundColor&&Ge(mc(e.style.backgroundColor),mc(n)))){let t=e.firstElementChild;Do(t)&&(s=t.getContext(`2d`))}if(s&&Vi(s.canvas.style.transform,t)?(this.container=e,this.context=s,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){o=ht?Eo():document.createElement(`div`),o.className=a;let e=o.style;e.position=`absolute`,e.width=`100%`,e.height=`100%`,s=yo();let t=s.canvas;o.appendChild(t),e=t.style,e.position=`absolute`,e.left=`0`,e.transformOrigin=`top left`,this.container=o,this.context=s}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){let r=xn(n),i=Sn(n),a=pn(n),o=fn(n);Mi(t.coordinateToPixelTransform,r),Mi(t.coordinateToPixelTransform,i),Mi(t.coordinateToPixelTransform,a),Mi(t.coordinateToPixelTransform,o);let s=this.inversePixelTransform;Mi(s,r),Mi(s,i),Mi(s,a),Mi(s,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}prepareContainer(e,t){let n=e.extent,r=e.viewState.resolution,i=this.sourceRotates(),a=i?0:e.viewState.rotation,o=e.pixelRatio,s=Math.round(i?e.size[0]*o:V(n)/r*o),c=Math.round(i?e.size[1]*o:vn(n)/r*o);Fi(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,a,-s/2,-c/2),Ii(this.inversePixelTransform,this.pixelTransform);let l=zi(this.pixelTransform),u=this.getBackground(e);if(this.useContainer(t,l,u,s,c),!this.containerReused){let e=this.context.canvas;e.width!=s||e.height!=c?(e.width=s,e.height=c):this.context.clearRect(0,0,s,c),l!==e.style.transform&&(e.style.transform=l)}}dispatchRenderEvent_(e,t,n){let r=this.getLayer();if(r.hasListener(e)){let i=new rd(e,this.inversePixelTransform,n,t);r.dispatchEvent(i)}}preRender(e,t){this.frameState=t,t.declutter||this.dispatchRenderEvent_(Ts.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Ts.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new s1),e.declutter?this.deferredContext_.getContext():this.context}getCanvasContext(){let e=this.context;if(!e)throw Error(`Canvas context not initialized`);return e}getContainerElement(){let e=this.container;if(!e)throw Error(`Canvas container not initialized`);return e}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Ts.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Ts.POSTRENDER,this.context,e))}getRenderTransform(e,t,n,r,i,a,o){let s=i/2,c=a/2,l=r/t,u=-l,d=-e[0]+o,f=-e[1];return Fi(this.tempTransform,s,c,l,u,-n,d,f)}sourceRotates(){return this.wantRotation&&!!this.getLayer().getSource()?.canRotate}disposeInternal(){delete this.frameState,super.disposeInternal()}};function m1(e,t,n){if(!(n in e))return e[n]=new Set([t]),!0;let r=e[n],i=r.has(t);return i||r.add(t),!i}function h1(e,t,n){let r=e[n];return r?r.delete(t):!1}function g1(e,t){let n=e.layerStatesArray[e.layerIndex];if(n.extent&&(t=yn(t,Si(n.extent,e.viewState.projection))),!n.layer)return t;let r=n.layer.getRenderSource();if(!r.getWrapX()){let n=r.getTileGridForProjection(e.viewState.projection).getExtent();n&&(t=yn(t,n))}return t}var _1=class extends p1{constructor(e,t){super(e),t||={},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceRevision_,this.tempExtent=$t(),this.tempTileRange_=new z_(0,0,0,0),this.tempTileCoord_=t1(0,0,0);let n=t.cacheSize===void 0?512:t.cacheSize;this.tileCache_=new e1(n),this.sourceTileCache_=null,this.layerExtent=null,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||=new e1(512),this.sourceTileCache_}getOrCreateTile(e,t,n,r){let i=this.tileCache_,a=this.getLayer().getSource();if(!a)return null;let o=r1(a,a.getKey(),e,t,n),s;if(i.containsKey(o)){if(s=i.get(o),!s)return null}else{let c=r.viewState.projection,l=a.getProjection();if(s=a.getTile(e,t,n,r.pixelRatio,c,!l||di(l,c)?void 0:this.getSourceTileCache()),!s)return null;i.set(o,s)}return s}getTile(e,t,n,r){return this.getOrCreateTile(e,t,n,r)||null}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=Mi(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Yt(i,r))return null;let a=t.viewState,o=n.getRenderSource();if(!o)return null;let s=o.getTileGridForProjection(a.projection),c=o.getTilePixelRatio(t.pixelRatio);for(let e=s.getZForResolution(a.resolution);e>=s.getMinZoom();--e){let n=s.getTileCoordForCoordAndZ(r,e),i=this.getTile(e,n[1],n[2],t);if(!i||i.getState()!==z.LOADED)continue;let l=s.getOrigin(e),u=vc(s.getTileSize(e)),d=s.getResolution(e),f=null;if(i instanceof L_||i instanceof $_)f=i.getImage();else if(i instanceof I_){let e=i.getData();e&&(f=A_(e))}if(!f)continue;let p=Math.floor(c*((r[0]-l[0])/d-n[1]*u[0])),m=Math.floor(c*((l[1]-r[1])/d-n[2]*u[1])),h=Math.round(c*o.getGutterForProjection(a.projection));return this.getImageData(f,p+h,m+h)}return null}readData(e){let t=this.getLayer().getRenderSource();if(!t)return null;let n=e.viewState,r=n.projection;if(t.getGutterForProjection(r))throw Error(`readData() does not support sources with a gutter`);let i=t.getTileGridForProjection(r),a=n.resolution,o=e.extent,s=i.getZForResolution(a),c={};this.enqueueTiles(e,o,s,c,0);let l=c[s];if(!l)return null;let u=[],d=!0;if(l.forEach(e=>{let t=e,n=t.getState();n===z.LOADED?u.push(t):n!==z.ERROR&&n!==z.EMPTY&&(d=!1)}),!d||u.length===0)return null;let f=e.size[0],p=e.size[1],m=u[0],h=j_(m.getData());if(!h||h instanceof DataView)throw Error(`ol/renderer/canvas/TileLayer#readData only supports typed array tile data`);let g=m.getSize(),_=Math.round(h.length/(g[0]*g[1])),v=new h.constructor(f*p*_);for(let e of u){let t=i.getTileCoordExtent(e.tileCoord,this.tempExtent),n=e.getSize(),r=j_(e.getData()),s=(t[0]-o[0])/a-.5,c=(o[3]-t[3])/a-.5,l=V(t)/a,u=vn(t)/a,d=n[0]/l,m=n[1]/u,h=Math.max(0,Math.ceil(s)),g=Math.min(f,Math.ceil(s+l)),y=Math.max(0,Math.ceil(c)),b=Math.min(p,Math.ceil(c+u));for(let e=y;e<b;++e){let t=Math.min(Math.floor((e-c)*m),n[1]-1);for(let i=h;i<g;++i){let a=Math.min(Math.floor((i-s)*d),n[0]-1),o=(t*n[0]+a)*_,c=(e*f+i)*_;for(let e=0;e<_;++e)v[c+e]=r[o+e]}}}return this.updateCacheSize(l.size),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache(),{data:v,width:f,height:p,bandCount:_}}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;let t=this.getLayer().getSource();if(!t)return!1;let n=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=n,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(e,t,n,r,i){let a=e.viewState,o=this.getLayer(),s=o.getRenderSource();if(!s)return;let c=s.getTileGridForProjection(a.projection),l=L(s);l in e.wantedTiles||(e.wantedTiles[l]={});let u=e.wantedTiles[l],d=o.getMapInternal(),f=Math.max(n-i,c.getMinZoom(),c.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):c.getResolution(0)),s.zDirection)),p=a.rotation,m=p?_n(a.center,a.resolution,p,e.size):void 0;for(let i=n;i>=f;--i){let n=c.getTileRangeForExtentAndZ(t,i,this.tempTileRange_),a=c.getResolution(i);for(let t=n.minX;t<=n.maxX;++t)for(let o=n.minY;o<=n.maxY;++o){if(p&&m&&!c.tileCoordIntersectsViewport([i,t,o],m))continue;let n=this.getTile(i,t,o,e);if(!n||!m1(r,n,i))continue;let s=n.getKey();if(u[s]=!0,n.getState()===z.IDLE&&!e.tileQueue.isKeyQueued(s)){let r=t1(i,t,o,this.tempTileCoord_);e.tileQueue.enqueue([n,l,c.getTileCoordCenter(r),a])}}}}findStaleTile_(e,t){let n=this.tileCache_,r=e[0],i=e[1],a=e[2],o=this.getStaleKeys(),s=this.getLayer().getSource();if(!s)return!1;for(let e=0;e<o.length;++e){let c=r1(s,o[e],r,i,a);if(n.containsKey(c)){let e=n.peek(c);if(e&&e.getState()===z.LOADED)return e.endTransition(L(this)),m1(t,e,r),!0}}return!1}findAltTiles_(e,t,n,r){let i=e.getTileRangeForTileCoordAndZ(t,n,this.tempTileRange_);if(!i)return!1;let a=!0,o=this.tileCache_,s=this.getLayer().getRenderSource();if(!s)return!1;let c=s.getKey();for(let e=i.minX;e<=i.maxX;++e)for(let t=i.minY;t<=i.maxY;++t){let i=r1(s,c,n,e,t),l=!1;if(o.containsKey(i)){let e=o.peek(i);e&&e.getState()===z.LOADED&&(m1(r,e,n),l=!0)}l||(a=!1)}return a}renderFrame(e,t){this.renderComplete=!0;let n=e.layerStatesArray[e.layerIndex],r=e.viewState,i=r.projection,a=r.resolution,o=r.center,s=e.pixelRatio,c=this.getLayer(),l=c.getSource();if(!l)return this.getContainerElement();let u=l.getTileGridForProjection(i),d=u.getZForResolution(a,l.zDirection),f=u.getResolution(d);this.updateStaleKeys(l.getKey());let p=e.extent,m=l.getTilePixelRatio(s);this.prepareContainer(e,t);let h=this.getCanvasContext().canvas.width,g=this.getCanvasContext().canvas.height;this.layerExtent=n.extent?Si(n.extent,i):null,this.layerExtent&&(p=yn(p,this.layerExtent));let _=f*h/2/m,v=f*g/2/m,y=[o[0]-_,o[1]-v,o[0]+_,o[1]+v],b={};this.renderedTiles.length=0;let x=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){let t=u.getZForResolution(r.nextResolution??a,l.zDirection),n=g1(e,e.nextExtent);this.enqueueTiles(e,n,t,b,x)}let S=g1(e,p);if(this.enqueueTiles(e,S,d,b,0),x>0&&setTimeout(()=>{this.enqueueTiles(e,S,d-1,b,x-1)},0),!(d in b))return this.getContainerElement();let C=L(this),w=e.time;for(let t of b[d]){let n=t.getState();if(n===z.EMPTY)continue;let r=t.tileCoord;if(n===z.LOADED&&t.getAlpha(C,w)===1){t.endTransition(C);continue}if(n!==z.ERROR&&(this.renderComplete=!1),this.findStaleTile_(r,b)){h1(b,t,d),e.animate=!0;continue}if(this.findAltTiles_(u,r,d+1,b))continue;let i=u.getMinZoom();for(let e=d-1;e>=i&&!this.findAltTiles_(u,r,e,b);--e);}let T=f/a*s/m,E=this.getRenderContext(e);Fi(this.tempTransform,h/2,g/2,T,T,0,-h/2,-g/2),this.layerExtent&&this.clipUnrotated(E,e,this.layerExtent),l.getInterpolate()||(E.imageSmoothingEnabled=!1),this.preRender(E,e);let D=Object.keys(b).map(Number);D.sort(Be);let O=[],k=[],A=[];for(let t=D.length-1;t>=0;--t){let n=D[t],r=l.getTilePixelSize(n,s,i),a=u.getResolution(n)/f,o=r[0]*a*T,c=r[1]*a*T,p=u.getTileCoordForCoordAndZ(xn(y),n),h=u.getTileCoordExtent(p),g=Mi(this.tempTransform,[m*(h[0]-y[0])/f,m*(y[3]-h[3])/f]),_=m*l.getGutterForProjection(i);for(let t of b[n]){if(t.getState()!==z.LOADED)continue;let r=t.tileCoord,i=p[1]-r[1],a=Math.round(g[0]-(i-1)*o),s=p[2]-r[2],u=Math.round(g[1]-(s-1)*c),f=Math.round(g[0]-i*o),m=Math.round(g[1]-s*c),h=a-f,v=u-m,y=n===d;if(y&&t.inTransition(C)){A.push({tile:t,x:f,y:m,w:h,h:v,gutter:_}),this.renderedTiles.unshift(t),this.updateUsedTiles(e.usedTiles,l,t);continue}let b=[f,m,f+h,m+v],x=[];for(let e=0,t=O.length;e<t;++e)n<k[e]&&Cn(b,O[e])&&x.push(O[e]);let S;x.length>0&&(S=An(b,x)),O.push(b),k.push(n),this.drawTile(t,e,f,m,h,v,_,y,S),this.renderedTiles.unshift(t),this.updateUsedTiles(e.usedTiles,l,t)}}for(let t=0,n=A.length;t<n;++t){let{tile:n,x:r,y:i,w:a,h:o,gutter:s}=A[t];this.drawTile(n,e,r,i,a,o,s,!0,void 0)}return this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!an(this.renderedExtent_,y),this.renderedExtent_=y,this.renderedPixelRatio=s,this.postRender(this.getCanvasContext(),e),this.layerExtent&&E.restore(),E.imageSmoothingEnabled=!0,this.renderComplete&&e.postRenderFunctions.push((e,t)=>{let n=L(l),r=t.wantedTiles[n],i=r?Object.keys(r).length:0;this.updateCacheSize(i),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()}),this.getContainerElement()}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,n,r,i,a,o,s,c){let l;if(e instanceof I_){let t=e.getData();if(!t)return;if(l=A_(t),!l)throw Error(`Rendering array data is not yet supported`)}else l=this.getTileImage(e);if(!l)return;let u=this.getRenderContext(t),d=L(this),f=t.layerStatesArray[t.layerIndex],p=f.opacity*(s?e.getAlpha(d,t.time):1),m=p!==u.globalAlpha;m&&(u.save(),u.globalAlpha=p);let h=l.width-2*o,g=l.height-2*o;if(c){let e=h/i,t=g/a;for(let i=0,a=c.length;i<a;++i){let a=c[i],s=a[0],d=a[1],f=a[2]-a[0],p=a[3]-a[1];u.drawImage(l,o+(s-n)*e,o+(d-r)*t,f*e,p*t,s,d,f,p)}}else u.drawImage(l,o,o,h,g,n,r,i,a);m&&u.restore(),p===f.opacity?s&&e.endTransition(d):t.animate=!0}getImage(){let e=this.getCanvasContext();return e?e.canvas:null}getTileImage(e){return e.getImage()??null}updateUsedTiles(e,t,n){let r=L(t);r in e||(e[r]={}),e[r][n.getKey()]=!0}},v1={PRELOAD:`preload`,USE_INTERIM_TILES_ON_ERROR:`useInterimTilesOnError`},y1=class extends Es{constructor(e){e||={};let t=Object.assign({},e),n=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(e.preload===void 0?0:e.preload),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0||e.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(v1.PRELOAD)}setPreload(e){this.set(v1.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(v1.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(v1.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}},b1=class extends y1{constructor(e){super(e)}createRenderer(){return new _1(this,{cacheSize:this.getCacheSize()})}},x1=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},Q={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},S1=[Q.FILL],C1=[Q.STROKE],w1=[Q.BEGIN_PATH],T1=[Q.CLOSE_PATH],E1=class extends x1{constructor(e,t,n,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return t==1?e:e.map(function(e){return e*t})}appendFlatPointCoordinates(e,t){let n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,a=i.length;for(let o=0,s=e.length;o<s;o+=t)r[0]=e[o],r[1]=e[o+1],Yt(n,r)&&(i[a++]=r[0],i[a++]=r[1]);return a}appendFlatLineCoordinates(e,t,n,r,i,a){let o=this.coordinates,s=o.length,c=this.getBufferedMaxExtent();a&&(t+=r);let l=e[t],u=e[t+1],d=this.tmpCoordinate_,f=!0,p,m,h;for(p=t+r;p<n;p+=r)d[0]=e[p],d[1]=e[p+1],h=Qt(c,d),h===m?h===Ut.INTERSECTING?(o[s++]=d[0],o[s++]=d[1],f=!1):f=!0:(f&&=(o[s++]=l,o[s++]=u,!1),o[s++]=d[0],o[s++]=d[1]),l=d[0],u=d[1],m=h;return(i&&f||p===t+r)&&(o[s++]=l,o[s++]=u),s}drawCustomCoordinates_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a],s=this.appendFlatLineCoordinates(e,t,o,r,!1,!1);i.push(s),t=o}return t}drawCustom(e,t,n,r,i){this.beginGeometry(e,t,i);let a=e.getType(),o=e.getStride(),s=this.coordinates.length,c,l,u,d,f;switch(a){case`MultiPolygon`:c=e.getOrientedFlatCoordinates(),u=[];let t=e.getEndss();f=0;for(let e=0,n=t.length;e<n;++e){let n=[];f=this.drawCustomCoordinates_(c,f,t[e],o,n),u.push(n)}this.instructions.push([Q.CUSTOM,s,u,e,n,ha,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,u,e,r||n,ha,i]);break;case`Polygon`:case`MultiLineString`:d=[],c=a==`Polygon`?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),f=this.drawCustomCoordinates_(c,0,e.getEnds(),o,d),this.instructions.push([Q.CUSTOM,s,d,e,n,ma,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,d,e,r||n,ma,i]);break;case`LineString`:case`Circle`:c=e.getFlatCoordinates(),l=this.appendFlatLineCoordinates(c,0,c.length,o,!1,!1),this.instructions.push([Q.CUSTOM,s,l,e,n,pa,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,pa,i]);break;case`MultiPoint`:c=e.getFlatCoordinates(),l=this.appendFlatPointCoordinates(c,o),l>s&&(this.instructions.push([Q.CUSTOM,s,l,e,n,pa,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,pa,i]));break;case`Point`:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([Q.CUSTOM,s,l,e,n,void 0,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,void 0,i])}this.endGeometry(t)}beginGeometry(e,t,n){this.beginGeometryInstruction1_=[Q.BEGIN_GEOMETRY,t,0,e,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Q.BEGIN_GEOMETRY,t,0,e,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==Q.END_GEOMETRY?a=t:i==Q.BEGIN_GEOMETRY&&(r[2]=t,Ue(this.hitDetectionInstructions,a,t),a=-1)}fillStyleToState(e,t={}){if(e){let n=e.getColor();t.fillPatternScale=n&&typeof n==`object`&&`src`in n?this.pixelRatio:1,t.fillStyle=Ml(n||`#000`)??void 0}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){t.strokeStyle=Ml(e.getColor()||`#000`)??void 0;let n=e.getLineCap();t.lineCap=n===void 0?Il:n;let r=e.getLineDash();t.lineDash=r?r.slice():Ll,t.lineDashOffset=e.getLineDashOffset()||0;let i=e.getLineJoin();t.lineJoin=i===void 0?Rl:i;let a=e.getWidth();t.lineWidth=a===void 0?1:a;let o=e.getMiterLimit();t.miterLimit=o===void 0?10:o,t.strokeOffset=e.getOffset()??0,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,t.strokeOffset=void 0;return t}setFillStrokeStyle(e,t){let n=this.state;this.fillStyleToState(e,n),this.strokeStyleToState(t,n)}createFill(e){let t=e.fillStyle,n=[Q.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(e.fillPatternScale),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Q.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){let n=e.fillStyle;(n!==void 0&&typeof n!=`string`||e.currentFillStyle!=n)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit,l=e.strokeOffset;e.currentStrokeStyle==n&&e.currentLineCap==r&&(i==e.currentLineDash||i&&e.currentLineDash&&Ge(e.currentLineDash,i))&&e.currentLineDashOffset==a&&e.currentLineJoin==o&&e.currentLineWidth==s&&e.currentMiterLimit==c&&e.currentStrokeOffset==l||(t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c,e.currentStrokeOffset=l)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[Q.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=qt(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;Kt(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},D1=class extends E1{constructor(e,t,n,r){super(e,t,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,n){if(!this.image_||this.maxExtent&&!Yt(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,n??0);let r=e.getFlatCoordinates(),i=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,i),s=this.imagePixelRatio_??1,c=this.anchorX_??0,l=this.anchorY_??0,u=this.height_??0,d=this.originX_??0,f=this.originY_??0,p=this.scale_??[1,1],m=this.width_??0;this.instructions.push([Q.DRAW_IMAGE,a,o,this.image_,c*s,l*s,Math.ceil(u*s),this.opacity_,d*s,f*s,this.rotateWithView_,this.rotation_,[p[0]*this.pixelRatio/s,p[1]*this.pixelRatio/s],Math.ceil(m*s),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,n){if(!this.image_)return;this.beginGeometry(e,t,n??0);let r=e.getFlatCoordinates(),i=[];for(let t=0,n=r.length;t<n;t+=e.getStride())(!this.maxExtent||Yt(this.maxExtent,r.slice(t,t+2)))&&i.push(r[t],r[t+1]);let a=this.coordinates.length,o=this.appendFlatPointCoordinates(i,2),s=this.imagePixelRatio_??1,c=this.anchorX_??0,l=this.anchorY_??0,u=this.height_??0,d=this.originX_??0,f=this.originY_??0,p=this.scale_??[1,1],m=this.width_??0;this.instructions.push([Q.DRAW_IMAGE,a,o,this.image_,c*s,l*s,Math.ceil(u*s),this.opacity_,d*s,f*s,this.rotateWithView_,this.rotation_,[p[0]*this.pixelRatio/s,p[1]*this.pixelRatio/s],Math.ceil(m*s),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(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){let n=e.getAnchor(),r=e.getSize(),i=e.getOrigin();n&&r&&i&&(this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t)}},O1=class extends E1{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinates_(e,t,n,r,i){let a=(i??0)*this.pixelRatio,o=this.coordinates.length,s=this.appendFlatLineCoordinates(e,t,n,r,!1,!1);return this.instructions.push([Q.MOVE_TO_LINE_TO,o,s,a]),this.hitDetectionInstructions.push([Q.MOVE_TO_LINE_TO,o,s,i??0]),n}drawLineString(e,t,n){let r=this.state;if(!r)return;let i=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n??0),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,zl,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Ll,0],w1);let s=e.getFlatCoordinates(),c=e.getStride();this.drawFlatCoordinates_(s,0,s.length,c,o),this.hitDetectionInstructions.push(C1),this.endGeometry(t)}drawMultiLineString(e,t,n){let r=this.state;if(!r)return;let i=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n??0),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,zl,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Ll,0],w1);let s=e.getEnds()??[],c=e.getFlatCoordinates(),l=e.getStride(),u=0;for(let e=0,t=s.length;e<t;++e)u=this.drawFlatCoordinates_(c,u,s[e],l,o);this.hitDetectionInstructions.push(C1),this.endGeometry(t)}finish(){let e=this.state;return e&&e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(C1),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(C1),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(w1)}},k1=class extends E1{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinatess_(e,t,n,r,i){let a=this.state,o=i??0,s=a.fillStyle!==void 0,c=a.strokeStyle!==void 0,l=n.length;this.instructions.push(w1),this.hitDetectionInstructions.push(w1);for(let i=0;i<l;++i){let a=n[i],s=this.coordinates.length,l=this.appendFlatLineCoordinates(e,t,a,r,!0,!c);this.instructions.push([Q.MOVE_TO_LINE_TO,s,l,o*this.pixelRatio,!0]),this.hitDetectionInstructions.push([Q.MOVE_TO_LINE_TO,s,l,o,!0]),c&&(this.instructions.push(T1),this.hitDetectionInstructions.push(T1)),t=a}return s&&(this.instructions.push(S1),this.hitDetectionInstructions.push(S1)),c&&(this.instructions.push(C1),this.hitDetectionInstructions.push(C1)),t}drawCircle(e,t,n){let r=this.state;if(!r)return;let i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawCircle(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n??0),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,Fl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,zl,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Ll,0]);let s=e.getFlatCoordinates(),c=e.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,c,!1,!1);let u=[Q.CIRCLE,l,o];this.instructions.push(w1,u),this.hitDetectionInstructions.push(w1,u),r.fillStyle!==void 0&&(this.instructions.push(S1),this.hitDetectionInstructions.push(S1)),r.strokeStyle!==void 0&&(this.instructions.push(C1),this.hitDetectionInstructions.push(C1)),this.endGeometry(t)}drawPolygon(e,t,n){let r=this.state;if(!r)return;let i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawPolygon(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n??0),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,Fl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,zl,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Ll,0]);let s=e.getEnds(),c=e.getOrientedFlatCoordinates(),l=e.getStride();this.drawFlatCoordinatess_(c,0,s,l,o),this.endGeometry(t)}drawMultiPolygon(e,t,n){let r=this.state;if(!r)return;let i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawMultiPolygon(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n??0),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,Fl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,zl,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Ll,0]);let s=e.getEndss(),c=e.getOrientedFlatCoordinates(),l=e.getStride(),u=0;for(let e=0,t=s.length;e<t;++e)u=this.drawFlatCoordinatess_(c,u,s[e],l,o);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(e!==0){let t=this.coordinates;for(let n=0,r=t.length;n<r;++n)t[n]=Oa(t[n],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;e&&(this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke))}handleStrokeOffset_(e){let t=this.state,n=t.fillStyle,r=t.strokeStyle,i=t.strokeOffset??0;return Math.abs(i)>0&&n!==void 0&&r!==void 0&&(t.strokeStyle=void 0,t.strokeOffset=0,e(),t.fillStyle=void 0,t.strokeStyle=r,t.strokeOffset=i,e(),t.fillStyle=n,!0)}},A1=0,j1=1;function M1(e,t,n,r,i,a,o,s){let c=o-i,l=s-a,u=0,d=1;if(c===0){if(i<e||i>n)return!1}else{let t=(e-i)/c,r=(n-i)/c;if(t>r){let e=t;t=r,r=e}if(t>u&&(u=t),r<d&&(d=r),u>d)return!1}if(l===0){if(a<t||a>r)return!1}else{let e=(t-a)/l,n=(r-a)/l;if(e>n){let t=e;e=n,n=t}if(e>u&&(u=e),n<d&&(d=n),u>d)return!1}return A1=u,j1=d,!0}function N1(e,t,n,r){let i=r[0],a=r[1],o=r[2],s=r[3],c=[],l=[],u=!1,d,f,p=0;for(let r=0,m=t.length;r<m;++r){let m=t[r],h=e[p],g=e[p+1],_=!1;for(let t=p+n;t<m;t+=n){let n=e[t],r=e[t+1];if(M1(i,a,o,s,h,g,n,r)){let e=n-h,t=r-g,i=h+A1*e,a=g+A1*t,o=h+j1*e,s=g+j1*t;u&&_&&i===d&&a===f?c.push(o,s):(u&&l.push(c.length),c.push(i,a,o,s),u=!0),d=o,f=s,_=!0}h=n,g=r}p=m}return u&&l.push(c.length),{flatCoordinates:c,ends:l}}function P1(e,t,n,r,i){let a=[],o=n,s=0,c=t.slice(n,2);for(;s<e&&o+i<r;){let[n,r]=c.slice(-2),l=t[o+i],u=t[o+i+1],d=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r));if(s+=d,s>=e){let t=(e-s+d)/d,f=It(n,l,t),p=It(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s<e)c.push(t[o+i],t[o+i+1]),o+=i;else{let e=d-s,t=It(n,l,e/d),f=It(r,u,e/d);c.push(t,f),a.push(c),c=[t,f],s=0,o+=i}}return s>0&&a.push(c),a}function F1(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;d<r;d+=i){let n=t[d],r=t[d+1];m!==void 0&&h!==void 0&&(v=n-m,y=r-h,p=Math.sqrt(v*v+y*y),g!==void 0&&_!==void 0&&f!==void 0&&(c+=f,u=Math.acos((g*v+_*y)/(f*p)),u>e&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p||0,c>s?[l,d]:[a,o]}var I1={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},L1={Circle:k1,Default:E1,Image:D1,LineString:O1,Polygon:k1,Text:class extends E1{constructor(e,t,n,r){super(e,t,n,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[Fl]={fillStyle:Fl},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,n){let r=this.textFillState_,i=this.textStrokeState_,a=this.textState_;if(this.text_===``||!a||!r&&!i)return;let o=this.coordinates,s=o.length,c=e.getType(),l=null,u=e.getStride();if(a.placement===`line`&&(c==`LineString`||c==`MultiLineString`||c==`Polygon`||c==`MultiPolygon`)){let r=e.getExtent();if(!Cn(this.maxExtent,r))return;let i=[];if(l=e.getFlatCoordinates(),c==`LineString`)i=[l.length];else if(c==`MultiLineString`)i=e.getEnds();else if(c==`Polygon`)i=e.getEnds().slice(0,1);else if(c==`MultiPolygon`){let t=e.getEndss();i=[];for(let e=0,n=t.length;e<n;++e)i.push(t[e][0])}if(a.textAlign===void 0&&(c==`LineString`||c==`MultiLineString`)&&!Xt(this.getBufferedMaxExtent(),r)){let e=N1(l,i,u,this.getBufferedMaxExtent());if(l=e.flatCoordinates,i=e.ends,u=2,i.length===0)return}this.beginGeometry(e,t,n??0);let d=a.repeat,f=d?void 0:a.textAlign,p=0;for(let e=0,t=i.length;e<t;++e){let t;t=d?P1(d*this.resolution,l,p,i[e],u):[l.slice(p,i[e])];for(let n=0,r=t.length;n<r;++n){let r=t[n],c=0,l=r.length;if(f==null){let e=F1(a.maxAngle??Math.PI/4,r,0,r.length,2);c=e[0],l=e[1]}for(let e=c;e<l;e+=u)o.push(r[e],r[e+1]);let d=o.length;p=i[e],this.drawChars_(s,d),s=d}}this.endGeometry(t)}else{let r=a.overflow?null:[];switch(c){case`Point`:case`MultiPoint`:l=e.getFlatCoordinates();break;case`LineString`:l=e.getFlatMidpoint();break;case`Circle`:l=e.getCenter();break;case`MultiLineString`:l=e.getFlatMidpoints(),u=2;break;case`Polygon`:l=e.getFlatInteriorPoint(),!a.overflow&&r&&r.push(l[2]/this.resolution),u=3;break;case`MultiPolygon`:let t=e.getFlatInteriorPoints();l=[];for(let e=0,n=t.length;e<n;e+=3)!a.overflow&&r&&r.push(t[e+2]/this.resolution),l.push(t[e],t[e+1]);if(l.length===0)return;u=2;break;default:return}if(!l)return;let i=this.appendFlatPointCoordinates(l,u);if(i===s)return;if(r&&(i-s)/2!==l.length/u){let e=l,t=s/2;r=r.filter((n,r)=>{let i=o[(t+r)*2]===e[r*u]&&o[(t+r)*2+1]===e[r*u+1];return i||--t,i})}this.saveTextStates_();let d=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,f=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,n??0);let p=a.scale??[1,1],m=a.padding??Hl;if(m!=Hl&&(p[0]<0||p[1]<0)){let e=m[0],t=m[1],n=m[2],r=m[3];p[0]<0&&(t=-t,r=-r),p[1]<0&&(e=-e,n=-n),m=[e,t,n,r]}let h=this.pixelRatio;this.instructions.push([Q.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==Hl?Hl:m.map(function(e){return e*h}),d,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);let g=1/h,_=d?d.slice(0):null;_&&(_[1]=Fl),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[g,g],NaN,this.declutterMode_,this.declutterImageWithText_,m,_,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Fl:this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=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}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||`center`,justify:t.justify,textBaseline:t.textBaseline||`middle`,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=I1[r.textBaseline||`middle`],l=this.textOffsetX_*s,u=this.textOffsetY_*s,d=this.text_,f=r.scale??[1,1],p=n?n.lineWidth*Math.abs(f[0])/2:0;this.instructions.push([Q.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,u,i,p*s,d,a,1,this.declutterMode_,this.textKeepUpright_,l]),this.hitDetectionInstructions.push([Q.DRAW_CHARS,e,t,c,r.overflow,o&&Fl,r.maxAngle,s,u,i,p*s,d,a,1/s,this.declutterMode_,this.textKeepUpright_,l])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Ml(t.getColor()||`#000`)||`#000`):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||`round`,i.lineDash=e?e.slice():Ll,i.lineDashOffset=t===void 0?0:t,i.lineJoin=a.getLineJoin()||`round`,i.lineWidth=n===void 0?1:n,i.miterLimit=r===void 0?10:r,i.strokeStyle=Ml(a.getColor()||`#000`)||`#000`}n=this.textState_;let o=e.getFont()||`10px sans-serif`;Yl(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||`middle`,n.backgroundFill=e.getBackgroundFill()??void 0,n.backgroundStroke=e.getBackgroundStroke()??void 0,n.padding=e.getPadding()||Hl,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u!==void 0&&u,this.textKeepUpright_=d===void 0||d,this.textRotation_=f===void 0?0:f,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:L(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle==`string`?r.fillStyle:`|`+L(r.fillStyle):``}this.declutterMode_=e?e.getDeclutterMode():void 0,this.declutterImageWithText_=t}}},R1=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];return i===void 0&&(i=new L1[t](this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i),i}};function z1(e,t,n,r,i,a,o,s){o??=[],s??=r;let c=e[t+r],l=e[t+r+1],u=e[n-2*r],d=e[n-2*r+1],f,p,m,h,g,_,v,y,b=0;for(let x=t;x<n;x+=r){m=f,h=p,g=void 0,_=void 0,x+r<n&&(g=e[x+r],_=e[x+r+1]),a&&x===t&&(m=u,h=d),a&&x===n-r&&(g=c,_=l),f=e[x],p=e[x+1],[v,y]=B1(f,p,m,h,g,_,i),o[b++]=v,o[b++]=y;for(let t=2;t<s;t++)o[b++]=e[x+t]}return o.length!=b&&(o.length=b),o}function B1(e,t,n,r,i,a,o){let s,c;n!==void 0&&r!==void 0?(s=e-n,c=t-r):i!==void 0&&a!==void 0?(s=i-e,c=a-t):(s=1,c=0);let l=Math.hypot(s,c),u=s/l,d=c/l;if(s=-d,c=u,n===void 0||r===void 0||i===void 0||a===void 0)return[e+s*o,t+c*o];let f=Hn([e,t],[n,r],[i,a]);if(Math.cos(f)>.998)return[e+u*o,t+d*o];let p=Math.cos(f/2),m=Math.sin(f/2),h=m*s+p*c,g=-p*s+m*c,_=1/m*h,v=1/m*g;return[e+_*o,t+v*o]}function V1(e,t,n=!1){for(let r=0,i=e.length-2;r<i;r+=t){let i=n&&r===0?e.length-3*t:e.length-2*t;for(let n=i;n>r+t;n-=t){let i=e[r],a=e[r+1],o=e[r+t],s=e[r+t+1],c=e[n],l=e[n+1],u=e[n+t],d=e[n+t+1],f=(d-l)*(o-i)-(u-c)*(s-a);if(f===0)continue;let p=((u-c)*(a-l)-(d-l)*(i-c))/f,m=((o-i)*(a-l)-(s-a)*(i-c))/f;if(p>0&&p<1&&m>0&&m<1){let c=i+p*(o-i),l=a+p*(s-a);e[r+t]=c,e[r+t+1]=l,e.splice(r+2*t,n-r-t);break}}}return e}var H1,U1=RegExp(`[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]`);function W1(){return H1||=new Intl.Segmenter(void 0,{granularity:`grapheme`}),H1}function G1(e,t,n,r,i,a,o,s,c,l,u,d,f=!0){let p=e[t],m=e[t+1],h=0,g=0,_=0,v=0;function y(){h=p,g=m,t+=r,p=e[t],m=e[t+1],v+=_,_=Math.sqrt((p-h)*(p-h)+(m-g)*(m-g))}do y();while(t<n-r&&v+_<a);let b=_===0?0:(a-v)/_,x=It(h,p,b),S=It(g,m,b),C=t-r,w=v,T=a+s*c(l,i,u);for(;t<n-r&&v+_<T;)y();b=_===0?0:(T-v)/_;let E=It(h,p,b),D=It(g,m,b),O=!1;if(f){if(d){let e=[x,S,E,D];Ui(e,0,4,2,d,e,e),O=e[0]>e[2]}else O=x>E}let k=Math.PI,A=[],ee=C+r===t;t=C,_=0,v=w,p=e[t],m=e[t+1];let j;if(ee)return y(),j=Math.atan2(m-g,p-h),O&&(j+=j>0?-k:k),A[0]=[(E+x)/2,(D+S)/2,(T-a)/2,j,i],A;i=i.replace(/\n/g,` `);let M=Array.from(W1().segment(i),e=>e.segment),te=O!==U1.test(i);for(let e=0,i=M.length;e<i;){y();let d=Math.atan2(m-g,p-h);if(O&&(d+=d>0?-k:k),j!==void 0){let e=d-j;if(e+=e>k?-2*k:e<-k?2*k:0,Math.abs(e)>o)return null}j=d;let f=e,x=0;for(;e<i;++e){let o=s*c(l,M[te?i-e-1:e],u);if(t+r<n&&v+_<a+x+o/2)break;x+=o}if(e===f)continue;let S=(te?M.slice(i-e,i-f):M.slice(f,e)).join(``);b=_===0?0:(a+x/2-v)/_;let C=It(h,p,b),w=It(g,m,b);A.push([C,w,x/2,d,S]),a+=x}return A}var K1=$t(),q1=[],J1=[],Y1=[],X1=[];function Z1(e){return e[3].declutterBox}function Q1(e,t){return t===`start`?t=U1.test(e)?`right`:`left`:t===`end`&&(t=U1.test(e)?`left`:`right`),I1[t]}function $1(e,t,n){return n>0&&e.push(`
|
|
5
|
+
`,``),e.push(t,``),e}function e0(e,t,n){return n%2==0&&(e+=t),e}var t0=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Di(),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_=i?new s1:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?I1[s.justify]:Q1(Array.isArray(e)?e[0]:e,s.textAlign||`center`),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(`
|
|
6
|
+
`).reduce($1,[]),{width:p,height:m,widths:h,heights:g,lineWidths:_}=eu(s,f),v=p+d,y=[],b=(v+2)*l[0],x=(m+d)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(l[0]!=1||l[1]!=1)&&y.push(`scale`,l),r&&a&&(y.push(`strokeStyle`,a.strokeStyle),y.push(`lineWidth`,d),y.push(`lineCap`,a.lineCap),y.push(`lineJoin`,a.lineJoin),y.push(`miterLimit`,a.miterLimit),y.push(`setLineDash`,[a.lineDash]),y.push(`lineDashOffset`,a.lineDashOffset)),n&&o&&y.push(`fillStyle`,o.fillStyle),y.push(`textBaseline`,`middle`),y.push(`textAlign`,`center`);let C=.5-u,w=u*v+C*d,T=[],E=[],D=0,O=0,k=0,A=0,ee;for(let e=0,t=f.length;e<t;e+=2){let t=f[e];if(t===`
|
|
7
|
+
`){O+=D,D=0,w=u*v+C*d,++A;continue}let i=f[e+1]||s.font;i!==ee&&(r&&T.push(`font`,i),n&&E.push(`font`,i),ee=i),D=Math.max(D,g[k]);let a=[t,w+C*h[k]+u*(h[k]-_[A]),.5*(d+D)+O];w+=h[k],r&&T.push(`strokeText`,a),n&&E.push(`fillText`,a),++k}return Array.prototype.push.apply(y,T),Array.prototype.push.apply(y,E),this.labels_[i]=S,S}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(q1[0]=S,X1[0]=S,q1[1]=C,J1[1]=C,J1[0]=S+b,Y1[0]=J1[0],Y1[1]=C+x,X1[1]=Y1[1]);let w;return u===0?en(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),K1):(w=Fi(Di(),n,r,1,1,u,-n,-r),Mi(w,q1),Mi(w,J1),Mi(w,Y1),Mi(w,X1),en(Math.min(q1[0],J1[0],Y1[0],X1[0]),Math.min(q1[1],J1[1],Y1[1],X1[1]),Math.max(q1[0],J1[0],Y1[0],X1[0]),Math.max(q1[1],J1[1],Y1[1],X1[1]),K1)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:K1[0],minY:K1[1],maxX:K1[2],maxY:K1[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabelArgs_(e){return this.replayImageOrLabel_(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0;return c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0&&(s&&this.replayTextBackground_(e,q1,J1,Y1,X1,a,o),tu(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=Mi(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),t!==1&&e.scale(t,t)}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,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=Q1(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=I1[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&Ge(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||=[],l=Hi(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),ji(this.renderedTransform_,n));let u=0,d=r.length,f=0,p,m=[],h,g,_,v,y,b,x,S,C,w,T,E,D,O=0,k=0,A=this.coordinateCache_,ee=this.viewRotation_,j=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,M={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:ee},te=this.instructions!=r||this.overlaps?0:200,ne,re,ie,N;for(;u<d;){let n=r[u];switch(n[0]){case Q.BEGIN_GEOMETRY:ne=n[1],N=n[3],ne.getGeometry()?o!==void 0&&!Cn(o,N.getExtent())?u=n[2]+1:++u:u=n[2],c&&(c.zIndex=n[4]);break;case Q.BEGIN_PATH:O>te&&(this.fill_(e),O=0),k>te&&(e.stroke(),k=0),!O&&!k&&(e.beginPath(),y=NaN,b=NaN),++u;break;case Q.CIRCLE:f=n[1],_=n[2]??0;let r=l[f],d=l[f+1],ae=l[f+2]-_,oe=l[f+3]-_,se=ae-r,ce=oe-d,le=Math.sqrt(se*se+ce*ce);e.moveTo(r+le,d),e.arc(r,d,le,0,2*Math.PI,!0),++u;break;case Q.CLOSE_PATH:e.closePath(),++u;break;case Q.CUSTOM:f=n[1],p=n[2];let ue=n[3],de=n[4],fe=n[5];M.geometry=ue,M.feature=ne,u in A||(A[u]=[]);let pe=A[u];fe?fe(l,f,p,2,pe):(pe[0]=l[f],pe[1]=l[f+1],pe.length=2),c&&(c.zIndex=n[6]),de(pe,M),++u;break;case Q.DRAW_IMAGE:f=n[1],p=n[2],C=n[3],h=n[4],g=n[5];let me=n[6],he=n[7],ge=n[8],_e=n[9],ve=n[10],ye=n[11],be=n[12],xe=n[13];v=n[14]||`declutter`;let Se=n[15];if(!C&&n.length>=20){w=n[19],T=n[20],E=n[21],D=n[22];let e=this.drawLabelWithPointPlacement_(w,T,E,D);C=e.label,n[3]=C;let t=n[23];h=(e.anchorX-t)*this.pixelRatio,n[4]=h;let r=n[24];g=(e.anchorY-r)*this.pixelRatio,n[5]=g,me=C.height,n[6]=me,xe=C.width,n[13]=xe}let Ce;n.length>25&&(Ce=n[25]);let we,Te,Ee;n.length>17?(we=n[16],Te=n[17],Ee=n[18]):(we=Hl,Te=null,Ee=null),ve&&j?ye+=ee:!ve&&!j&&(ye-=ee);let De=0;for(;f<p;f+=2){if(Ce&&Ce[De++]<xe/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(C.width,C.height,l[f],l[f+1],xe,me,h,g,ge,_e,ye,be,i,we,!!Te||!!Ee,ne),r=[e,t,C,n,he,Te,Ee];if(s){let e,t,i;if(Se){let n=p-f;if(!Se[n]){Se[n]={args:r,declutterMode:v};continue}let a=Se[n];e=a.args,t=a.declutterMode,delete Se[n],i=Z1(e)}let a,o;if(e&&(t!==`declutter`||!s.collides(i))&&(a=!0),v===`declutter`&&s.collides(n.declutterBox)||(o=!0),t===`declutter`&&v===`declutter`){let e=a&&o;a=e,o=e}a&&(t!==`none`&&s.insert(i),this.replayImageOrLabelArgs_(e)),o&&(v!==`none`&&s.insert(n.declutterBox),this.replayImageOrLabelArgs_(r))}else this.replayImageOrLabelArgs_(r)}++u;break;case Q.DRAW_CHARS:let Oe=n[1],ke=n[2],Ae=n[3],je=n[4];D=n[5];let Me=n[6],Ne=n[7],Pe=n[8];E=n[9];let Fe=n[10];w=n[11],Array.isArray(w)&&(w=w.reduce(e0,``)),T=n[12];let P=[n[13],n[13]];v=n[14]||`declutter`;let Ie=n[15],Le=n[16],F=this.textStates[T],Re=F.font,ze=[F.scale[0]*Ne,F.scale[1]*Ne],Be;Re in this.widths_?Be=this.widths_[Re]:(Be={},this.widths_[Re]=Be);let Ve=gd(l,Oe,ke,2),He=Math.abs(ze[0])*$l(Re,w,Be);if(je||He<=Ve){let n=this.textStates[T].textAlign,r=(Ve-He)*Q1(w,n),i=G1(l,Oe,ke,2,w,r,Me,Math.abs(ze[0]),$l,Re,Be,j?0:this.viewRotation_,Ie);e:if(i){let n=[],r,a,o,c,l;if(E)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,T,``,E),h=l[2]+(ze[0]<0?-Fe:Fe)-Le,g=Ae*c.height+(.5-Ae)*2*Fe*ze[1]/ze[0]-Pe;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,h,g,0,0,l[3],P,!1,Hl,!1,ne);if(s&&v===`declutter`&&s.collides(a.declutterBox))break e;n.push([e,t,c,a,1,null,null])}if(D)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,T,D,``),h=l[2]-Le,g=Ae*c.height-Pe;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,h,g,0,0,l[3],P,!1,Hl,!1,ne);if(s&&v===`declutter`&&s.collides(a.declutterBox))break e;n.push([e,t,c,a,1,null,null])}s&&v!==`none`&&s.load(n.map(Z1));for(let e=0,t=n.length;e<t;++e)this.replayImageOrLabelArgs_(n[e])}}++u;break;case Q.END_GEOMETRY:if(a!==void 0){ne=n[1];let e=a(ne,N,v);if(e)return e}++u;break;case Q.FILL:te?O++:this.fill_(e),++u;break;case Q.MOVE_TO_LINE_TO:f=n[1],p=n[2],_=n[3];let Ue,We,Ge;if(_){let e=(n[4]??!1)||Math.abs(l[f]-l[p-2])<1e-6&&Math.abs(l[f+1]-l[p-1])<1e-6;z1(l,f,p,2,_,e,m),V1(m,2,e),Ue=m,We=0,Ge=Ue.length}else Ue=l,We=f,Ge=p;re=Ue[We],ie=Ue[We+1],e.moveTo(re,ie),y=re+.5|0,b=ie+.5|0;for(let t=We+2;t<Ge;t+=2)re=Ue[t],ie=Ue[t+1],x=re+.5|0,S=ie+.5|0,(t==Ge-2||x!==y||S!==b)&&(e.lineTo(re,ie),y=x,b=S);++u;break;case Q.SET_FILL_STYLE:this.alignAndScaleFill_=n[2],O?(this.fill_(e),O=0,k&&=(e.stroke(),0)):k&&n[1]&&(e.stroke(),k=0),e.fillStyle=n[1],++u;break;case Q.SET_STROKE_STYLE:O&&n[1]&&(this.fill_(e),O=0),k&&=(e.stroke(),0),this.setStrokeStyle_(e,n),++u;break;case Q.STROKE:te?k++:e.stroke(),++u;break;default:++u}}O&&this.fill_(e),k&&e.stroke()}execute(e,t,n,r,i,a){this.viewRotation_=r,this.execute_(e,t,n,this.instructions,i,void 0,void 0,a)}executeHitDetection(e,t,n,r,i){return this.viewRotation_=n,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,i)}},n0=[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`],r0=[`Image`,`Text`],i0=n0.filter(e=>!r0.includes(e)),a0=!1,o0=!1;function s0(){let e=0,t=t=>{let n=yo(1,1,null,{willReadFrequently:t}),r=0,i=performance.now();for(;performance.now()-i<50;++r)n.fillStyle=`rgba(255,0,${r%256},1)`,n.fillRect(0,0,1,1),n.getImageData(0,0,1,1);return e=r>e?r:e,r};a0={[t(!0)]:!0,[t(!1)]:!1,[t(void 0)]:void 0}[e],o0=!0}var c0=class{constructor(e,t,n,r,i,a,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Di(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(i,!!o)}clip(e,t){let n=this.getClipCoords(t);e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(n[2],n[3]),e.lineTo(n[4],n[5]),e.lineTo(n[6],n[7]),e.clip()}createExecutors_(e,t){for(let n in e){let r=this.executorsByZIndex_[n];r===void 0&&(r={},this.executorsByZIndex_[n]=r);let i=e[n];for(let e in i){let n=i[e];r[e]=new t0(this.resolution_,this.pixelRatio_,this.overlaps_,n,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let n=this.executorsByZIndex_[t];for(let t=0,r=e.length;t<r;++t)if(e[t]in n)return!0}return!1}forEachFeatureAtCoordinate(e,t,n,r,i,a){o0===!1&&s0(),r=Math.round(r);let o=r*2+1,s=Fi(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-n,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=yo(o,o,null,{willReadFrequently:a0}));let l=this.hitDetectionContext_;l.canvas.width!==o||l.canvas.height!==o?(l.canvas.width=o,l.canvas.height=o):c||l.clearRect(0,0,o,o);let u;this.renderBuffer_!==void 0&&(u=$t(),sn(u,e),Kt(u,t*(this.renderBuffer_+r),u));let d=u0(r),f,p=l;function m(e,t,n){let s=p.getImageData(0,0,o,o).data;for(let c=0,l=d.length;c<l;c++)if(s[d[c]]>0){if(!a||n===`none`||f!==`Image`&&f!==`Text`||a.includes(e)){let n=(d[c]-3)/4,a=r-n%o,s=r-(n/o|0),l=i(e,t,a*a+s*s);if(l)return l}p.clearRect(0,0,o,o);break}}let h=Object.keys(this.executorsByZIndex_).map(Number);h.sort(Be);let g,_,v,y,b;for(g=h.length-1;g>=0;--g){let e=h[g].toString();for(v=this.executorsByZIndex_[e],_=n0.length-1;_>=0;--_)if(f=n0[_],y=v[f],y!==void 0&&(b=y.executeHitDetection(l,s,n,m,u),b))return b}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let n=t[0],r=t[1],i=t[2],a=t[3],o=[n,r,n,a,i,a,i,r];return Hi(o,0,8,2,e,o),o}isEmpty(){return Fe(this.executorsByZIndex_)}execute(e,t,n,r,i,a,o){let s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(o?Ve:Be),a||=n0;let c=n0.length;for(let l=0,u=s.length;l<u;++l){let u=s[l].toString(),d=this.executorsByZIndex_[u];for(let u=0,f=a.length;u<f;++u){let f=a[u],p=d[f];if(p!==void 0){let a=o===null?void 0:p.getZIndexContext(),u=a?a.getContext():e,d=this.maxExtent_&&f!==`Image`&&f!==`Text`;if(d&&(u.save(),this.clip(u,n)),!a||f===`Text`||f===`Image`?p.execute(u,t,n,r,i,o):a.pushFunction(e=>p.execute(e,t,n,r,i,o)),d&&u.restore(),a){a.offset();let e=s[l]*c+n0.indexOf(f);this.deferredZIndexContexts_[e]||(this.deferredZIndexContexts_[e]=[]),this.deferredZIndexContexts_[e].push(a)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Be);for(let n=0,r=t.length;n<r;++n)e[t[n]].forEach(e=>{e.draw(this.renderedContext_),e.clear()}),e[t[n]].length=0}},l0={};function u0(e){if(l0[e]!==void 0)return l0[e];let t=e*2+1,n=e*e,r=Array(n+1);for(let i=0;i<=e;++i)for(let a=0;a<=e;++a){let o=i*i+a*a;if(o>n)break;let s=r[o];s||(s=[],r[o]=s),s.push(((e+i)*t+(e+a))*4+3),i>0&&s.push(((e-i)*t+(e+a))*4+3),a>0&&(s.push(((e+i)*t+(e-a))*4+3),i>0&&s.push(((e-i)*t+(e-a))*4+3))}let i=[];for(let e=0,t=r.length;e<t;++e)r[e]&&i.push(...r[e]);return l0[e]=i,i}var d0=class extends x1{constructor(e,t,n,r,i,a,o){super(),this.context_=e,this.pixelRatio_=t,this.extent_=n,this.transform_=r,this.transformRotation_=r?Lt(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=i,this.squaredTolerance_=a,this.userTransform_=o,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_=Di()}drawImages_(e,t,n,r){if(!this.image_)return;let i=Hi(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,s=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=s*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let e=0,t=i.length;e<t;e+=2){let t=i[e]-this.imageAnchorX_,n=i[e+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){let e=t+this.imageAnchorX_,r=n+this.imageAnchorY_;Fi(o,e,r,1,1,c,-e,-r),a.save(),a.transform.apply(a,o),a.translate(e,r),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,n,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=s)}drawText_(e,t,n,r){if(!this.textState_||this.text_===``)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let i=Hi(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);t<n;t+=r){let e=i[t]+this.textOffsetX_,n=i[t+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(e-this.textOffsetX_,n-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,e,n),this.textFillState_&&a.fillText(this.text_,e,n))}}moveToLineTo_(e,t,n,r,i,a){let o=this.context_,s=a??0,c=Hi(e,t,n,r,this.transform_,this.pixelCoordinates_);if(Math.abs(s)>0){let e=c.length,t=i||Math.abs(c[0]-c[e-2])<1e-6&&Math.abs(c[1]-c[e-1])<1e-6;c=z1(c,0,e,2,s,t,c),V1(c,2,t)}o.moveTo(c[0],c[1]);let l=c.length;i&&(l-=2);for(let e=2;e<l;e+=2)o.lineTo(c[e],c[e+1]);return i&&o.closePath(),n}drawRings_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=this.moveToLineTo_(e,t,n[a],r,!0,i);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=Qi(e,this.transform_,this.pixelCoordinates_);if(!t)return;let n=t[2]-t[0],r=t[3]-t[1],i=Math.sqrt(n*n+r*r),a=this.context_;a.beginPath(),a.arc(t[0],t[1],i,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==``&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill()??null,e.getStroke()??null),this.setImageStyle(e.getImage()??null),this.setTextStyle(e.getText()??null)}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)}}drawFeature(e,t){let n=t.getGeometryFunction()(e);n&&(this.setStyle(t),this.drawGeometry(n))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,n=t.length;e<n;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(n,0,n.length,e.getStride(),!1,this.strokeState_.strokeOffset),t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(Cn(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates(),r=0,i=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e)r=this.moveToLineTo_(n,r,i[e],a,!1,this.strokeState_.strokeOffset);t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride(),this.strokeState_?.strokeOffset),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getOrientedFlatCoordinates(),r=0,i=e.getEndss(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e){let t=i[e];r=this.drawRings_(n,r,t,a,this.strokeState_?.strokeOffset)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,n=this.contextFillState_;n?n.fillStyle!=e.fillStyle&&(n.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=e.lineCap&&(n.lineCap=e.lineCap,t.lineCap=e.lineCap),Ge(n.lineDash,e.lineDash)||t.setLineDash(n.lineDash=e.lineDash),n.lineDashOffset!=e.lineDashOffset&&(n.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),n.lineJoin!=e.lineJoin&&(n.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),n.lineWidth!=e.lineWidth&&(n.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),n.miterLimit!=e.miterLimit&&(n.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),n.strokeStyle!=e.strokeStyle&&(n.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){let t=this.context_,n=this.contextTextState_,r=e.textAlign?e.textAlign:Bl;n?(n.font!=e.font&&(n.font=e.font,t.font=e.font),n.textAlign!=r&&(n.textAlign=r,t.textAlign=r),n.textBaseline!=e.textBaseline&&(n.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{let t=e.getColor();this.fillState_={fillStyle:Ml(t||`#000`)||`#000`}}if(!t)this.strokeState_=null;else{let e=t.getColor(),n=t.getLineCap(),r=t.getLineDash(),i=t.getLineDashOffset(),a=t.getLineJoin(),o=t.getWidth(),s=t.getMiterLimit(),c=r||Ll,l=t.getOffset();this.strokeState_={lineCap:n===void 0?Il:n,lineDash:this.pixelRatio_===1?c:c.map(e=>e*this.pixelRatio_),lineDashOffset:(i||0)*this.pixelRatio_,lineJoin:a===void 0?Rl:a,lineWidth:(o===void 0?1:o)*this.pixelRatio_,miterLimit:s===void 0?10:s,strokeStyle:Ml(e||`#000`)||`#000`,strokeOffset:(l??0)*this.pixelRatio_}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();if(!r||!i){this.image_=null;return}this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();if(!t)this.textFillState_=null;else{let e=t.getColor();this.textFillState_={fillStyle:Ml(e||`#000`)||`#000`}}let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?Il:t,lineDash:r||Ll,lineDashOffset:i||0,lineJoin:a===void 0?Rl:a,lineWidth:o===void 0?1:o,miterLimit:s===void 0?10:s,strokeStyle:Ml(e||`#000`)||`#000`}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?Pl:r,textAlign:u===void 0?Bl:u,textBaseline:d===void 0?Vl:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o!==void 0&&o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}},f0=.5;function p0(e,t,n,r,i,a,o,s,c){let l=c?xi(i,c):i,u=yo(e[0]*f0,e[1]*f0);u.imageSmoothingEnabled=!1;let d=u.canvas,f=new d0(u,f0,i,[1,0,0,1,0,0],o,s??0,c?fi(vi(),c)??void 0:void 0),p=n.length,m=Math.floor(0xffffff/p),h={};for(let e=1;e<=p;++e){let t=n[e-1],i=t.getStyleFunction()||r;if(!i)continue;let o=i(t,a);if(!o)continue;Array.isArray(o)||(o=[o]);let s=(e*m).toString(16).padStart(7,`#00000`);for(let e=0,n=o.length;e<n;++e){let n=o[e],r=n.getGeometryFunction()(t);if(!r||!Cn(l,r.getExtent()))continue;let i=n.clone(),a=i.getFill();a&&a.setColor(s);let c=i.getStroke();c&&(c.setColor(s),c.setLineDash(null)),i.setText(null);let u=n.getImage();if(u){let e=u.getImageSize();if(!e)continue;let t=yo(e[0],e[1],void 0,{alpha:!1}),n=t.canvas;t.fillStyle=s,t.fillRect(0,0,n.width,n.height),i.setImage(new cu({img:n,anchor:u.getAnchor()??void 0,anchorXUnits:`pixels`,anchorYUnits:`pixels`,offset:u.getOrigin()??void 0,opacity:1,size:u.getSize()??void 0,scale:u.getScale(),rotation:u.getRotation(),rotateWithView:u.getRotateWithView()}))}let d=i.getZIndex()||0,f=h[d];f||(f={},h[d]=f,f.Polygon=[],f.Circle=[],f.LineString=[],f.Point=[]);let p=r.getType();if(p===`GeometryCollection`){let e=r.getGeometriesArrayRecursive();for(let t=0,n=e.length;t<n;++t){let n=e[t];f[n.getType().replace(`Multi`,``)].push(n,i)}}else f[p.replace(`Multi`,``)].push(r,i)}}let g=Object.keys(h).map(Number).sort(Be);for(let e=0,n=g.length;e<n;++e){let n=h[g[e]];for(let e in n){let r=n[e];for(let e=0,n=r.length;e<n;e+=2){f.setStyle(r[e+1]);for(let n=0,i=t.length;n<i;++n)f.setTransform(t[n]),f.drawGeometry(r[e])}}}return u.getImageData(0,0,d.width,d.height)}function m0(e,t,n){let r=[];if(n){let i=Math.floor(Math.round(e[0])*f0),a=Math.floor(Math.round(e[1])*f0),o=(kt(i,0,n.width-1)+kt(a,0,n.height-1)*n.width)*4,s=n.data[o],c=n.data[o+1],l=n.data[o+2]+256*(c+256*s),u=Math.floor(0xffffff/t.length);l&&l%u===0&&r.push(t[l/u-1])}return r}var h0=.5,g0={Point:O0,LineString:T0,Polygon:A0,MultiPoint:k0,MultiLineString:E0,MultiPolygon:D0,GeometryCollection:w0,Circle:b0};function _0(e,t){return parseInt(L(e),10)-parseInt(L(t),10)}function v0(e,t){let n=y0(e,t);return n*n}function y0(e,t){return h0*e/t}function b0(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Circle`);s.setFillStrokeStyle(a,o),s.drawCircle(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function x0(e,t,n,r,i,a,o,s){let c=[],l=n.getImage();if(l){let e=!0,t=l.getImageState();t==q.LOADED||t==q.ERROR?e=!1:t==q.IDLE&&l.load(),e&&c.push(l.ready())}let u=n.getFill();u&&u.loading()&&c.push(u.ready());let d=c.length>0;return d&&Promise.all(c).then(()=>i(null)),S0(e,t,n,r,a,o,s),d}function S0(e,t,n,r,i,a,o){let s=n.getGeometryFunction()(t);if(!s)return;let c=s.simplifyTransformed(r,i);n.getRenderer()?C0(e,c,n,t,o):(0,g0[c.getType()])(e,c,n,t,o,a)}function C0(e,t,n,r,i){if(t.getType()==`GeometryCollection`){let a=t.getGeometries();for(let t=0,o=a.length;t<o;++t)C0(e,a[t],n,r,i)}else e.getBuilder(n.getZIndex(),`Default`).drawCustom(t,r,n.getRenderer(),n.getHitDetectionRenderer(),i)}function w0(e,t,n,r,i,a){let o=t.getGeometriesArray(),s,c;for(s=0,c=o.length;s<c;++s)(0,g0[o[s].getType()])(e,o[s],n,r,i,a)}function T0(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function E0(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawMultiLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function D0(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(o||a){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawMultiPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function O0(e,t,n,r,i,a){let o=n.getImage(),s=n.getText(),c=s&&s.getText(),l=a&&o&&c?{}:void 0;if(o){if(o.getImageState()!=q.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,l),a.drawPoint(t,r,i)}if(c){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s,l),a.drawText(t,r,i)}}function k0(e,t,n,r,i,a){let o=n.getImage(),s=o&&o.getOpacity()!==0,c=n.getText(),l=c&&c.getText(),u=a&&s&&l?{}:void 0;if(s){if(o.getImageState()!=q.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,u),a.drawMultiPoint(t,r,i)}if(l){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(c,u),a.drawText(t,r,i)}}function A0(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}var j0=class extends p1{constructor(e,t){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipExtent_=null,this.extendX_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=$t(),this.wrappedRenderedExtent_=$t(),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,t?.wantRotation!==void 0&&(this.wantRotation=t.wantRotation)}renderWorlds(e,t,n){let r=t.extent,i=t.viewState,a=i.center,o=i.resolution,s=i.projection,c=i.rotation,l=s.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=t.pixelRatio,p=t.viewHints,m=!(p[Dt.ANIMATING]||p[Dt.INTERACTING]),h=this.context,g=h.canvas.width,_=h.canvas.height,v=u.getWrapX()&&s.canWrapX(),y=v?V(l):null,b=r,x=v?Math.ceil((b[2]-l[2])/y)+(this.extendX_?2:1):1,S=v?Math.floor((b[0]-l[0])/y)-+!!this.extendX_:0;do{let r=this.getRenderTransform(a,o,this.sourceRotates()?c:0,f,g,_,S*y);t.declutter&&(r=r.slice(0)),e.execute(h,[h.canvas.width,h.canvas.height],r,c,m,n===void 0?n0:n?r0:i0,n?d&&t.declutter[d]:void 0)}while(++S<x)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=yo(this.context.canvas.width,this.context.canvas.height,u1))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){let e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,So(this.context),u1.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.clipExtent_&&this.clipUnrotated(this.context,e,this.clipExtent_),this.replayGroup_.renderDeferred(),this.clipExtent_&&=(this.context.restore(),null),this.resetDrawContext_())}renderFrame(e,t){let n=e.layerStatesArray[e.layerIndex];this.opacity_=n.opacity;let r=e.viewState;this.prepareContainer(e,t);let i=this.context,a=this.replayGroup_,o=a&&!a.isEmpty();if(!o&&!(this.getLayer().hasListener(Ts.PRERENDER)||this.getLayer().hasListener(Ts.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(i,e);let s=r.projection;this.clipExtent_=null;let c=!1;if(o&&n.extent&&this.clipping){let t=Si(n.extent,s);o=Cn(t,e.extent),o&&!Xt(t,e.extent)&&(e.declutter?this.clipExtent_=t:(this.clipUnrotated(i,e,t),c=!0))}return o&&this.renderWorlds(a,e,!this.getLayer().getDeclutter()&&void 0),c&&i.restore(),this.postRender(i,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_){let e=this.frameState.size.slice(),t=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,i=this.renderedProjection_,a=this.wrappedRenderedExtent_,o=this.getLayer(),s=[],c=e[0]*f0,l=e[1]*f0;s.push(this.getRenderTransform(t,n,r,f0,c,l,0).slice());let u=o.getSource(),d=i.getExtent();if(u.getWrapX()&&i.canWrapX()&&!Xt(d,a)){let e=a[0],i=V(d),o=0,u;for(;e<d[0];)--o,u=i*o,s.push(this.getRenderTransform(t,n,r,f0,c,l,u).slice()),e+=i;for(o=0,e=a[2];e>d[2];)++o,u=i*o,s.push(this.getRenderTransform(t,n,r,f0,c,l,u).slice()),e-=i}let f=vi();this.hitDetectionImageData_=p0(e,s,this.renderedFeatures_,o.getStyleFunction(),a,n,r,v0(n,this.renderedPixelRatio_),f?i:null)}t(m0(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,n,r,i){if(!this.replayGroup_)return;let a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),c={},l=function(e,t,n){let a=L(e),o=c[a];if(!o){if(n===0)return c[a]=!0,r(e,s,t);i.push(c[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return c[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,n,l,u?t.declutter?.[u]?.all().map(e=>e.value):null)}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),n=t.getSource();if(!n)return!1;let r=e.viewHints[Dt.ANIMATING],i=e.viewHints[Dt.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let s=e.extent,c=e.viewState,l=c.projection,u=c.resolution,d=e.pixelRatio,f=t.getRevision(),p=t.getRenderBuffer(),m=t.getRenderOrder();m===void 0&&(m=_0);let h=c.center.slice(),g=Kt(s,p*u),_=g.slice(),v=[g.slice()],y=l.getExtent(),b=n.getWrapX()&&l.canWrapX();if(this.extendX_=!1,b){let e=n.getExtent();e&&!wn(e)&&(this.extendX_=e[0]<y[0]||e[2]>y[2])}if(b&&(!Xt(y,e.extent)||this.extendX_)){let e=V(y),t=Math.max(V(g)/2,e),n=y[0],r=y[2];this.extendX_&&(n-=e,r+=e),g[0]=n-t,g[2]=r+t,zn(h,l);let i=On(v[0],l);i[0]<y[0]&&i[2]<y[2]?v.push([i[0]+e,i[1],i[2]+e,i[3]]):i[0]>y[0]&&i[2]>y[2]&&v.push([i[0]-e,i[1],i[2]-e,i[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedPixelRatio_===d&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!e.declutter&&Xt(this.wrappedRenderedExtent_,g))return Ge(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=h,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let x=new R1(y0(u,d),g,u,d),S=vi(),C;if(S){for(let e=0,t=v.length;e<t;++e){let t=xi(v[e],l);n.loadFeatures(t,Ci(u,l),S)}C=fi(S,l)}else for(let e=0,t=v.length;e<t;++e)n.loadFeatures(v[e],u,l);let w=v0(u,d),T=!0,E=(e,n)=>{let r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,u)),r){let t=this.renderFeature(e,w,r,x,C,this.getLayer().getDeclutter(),n);T&&=!t}},D=xi(g,l),O=n.getFeaturesInExtent(D);m&&O.sort(m);for(let e=0,t=O.length;e<t;++e)E(O[e],e);this.renderedFeatures_=O,this.ready=T;let k=x.finish(),A=new c0(g,u,d,n.getOverlaps(),k,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=m,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=g,this.renderedCenter_=h,this.renderedProjection_=l,this.renderedPixelRatio_=d,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,n,r,i,a,o){if(!n)return!1;let s=!1;if(Array.isArray(n))for(let c=0,l=n.length;c<l;++c)s=x0(r,e,n[c],t,this.boundHandleStyleImageChange_,i,a,o)||s;else s=x0(r,e,n,t,this.boundHandleStyleImageChange_,i,a,o);return s}},M0=class extends td{constructor(e){super(e)}createRenderer(){return new j0(this)}},N0={image:[`Polygon`,`Circle`,`LineString`,`Image`,`Text`],hybrid:[`Polygon`,`LineString`],vector:[]},P0={hybrid:[`Image`,`Text`,`Default`],vector:[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`]},F0=class extends _1{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=Di(),this.tileClipContexts_=null}enqueueTilesForNextExtent(){return this.getLayer().getRenderMode()!==`vector`}drawTile(e,t,n,r,i,a,o,s,c){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,n,r,i,a,o,s,c)}getTile(e,t,n,r){let i=this.getOrCreateTile(e,t,n,r);if(!i)return null;let a=r.viewState,o=a.resolution,s=r.viewHints,c=this.getLayer().getSource();if(!c)return null;let l=c.getTileGridForProjection(a.projection),u=!(s[Dt.ANIMATING]||s[Dt.INTERACTING]),d=l.getZForResolution(o,c.zDirection)===e;return u&&d?i.wantedResolution=o:i.wantedResolution||=l.getResolution(e),i}prepareFrame(e){let t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,n){let r=this.getLayer(),i=r.getRevision(),a=r.getRenderOrder()||null,o=e.wantedResolution,s=e.getReplayState(r);if(!s.dirty&&s.renderedResolution===o&&s.renderedRevision==i&&s.renderedPixelRatio===t&&s.renderedRenderOrder==a)return;let c=r.getSource();if(!c)return;let l=!!r.getDeclutter(),u=c.getTileGrid();if(!u)return;let d=c.getTileGridForProjection(n).getTileCoordExtent(e.wrappedTileCoord),f=c.getSourceTiles(t,n,e),p=L(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],s.dirty=!1;for(let i=0,m=f.length;i<m;++i){let m=f[i];if(m.getState()!=z.LOADED)continue;let h=c.getProjection(),g=m.tileCoord,_=u.getTileCoordExtent(g);n&&h&&!di(n,h)&&(_=gi(_,h,n,32));let v=yn(d,_),y=Kt(v,(r.getRenderBuffer()??0)*o,this.tempExtent),b=an(_,v)?null:y,x=new R1(0,v,o,t),S=v0(o,t),C=function(e,t){let n,i=e.getStyleFunction()||r.getStyleFunction();if(i&&(n=i(e,o)),n){let r=this.renderFeature(e,S,n,x,l,t);s.dirty=s.dirty||r}},w=m.getFeatures()??[];a&&a!==s.renderedRenderOrder&&w.sort(a);for(let e=0,t=w.length;e<t;++e){let t=w[e];n&&m.projection&&!di(n,m.projection)&&(t=t.clone(),t.getGeometry().applyTransform(mi(m.projection,n))),(!b||Cn(b,t.getGeometry()?.getExtent()))&&C.call(this,t,e)}let T=x.finish(),E=new c0(r.getRenderMode()!==`vector`&&l&&f.length===1?null:v,o,t,c.getOverlaps(),T,r.getRenderBuffer()??0,!0);e.executorGroups[p].push(E)}s.renderedRevision=i,s.renderedPixelRatio=t,s.renderedRenderOrder=a,s.renderedResolution=o}forEachFeatureAtCoordinate(e,t,n,r,i){let a=t.viewState.resolution,o=t.viewState.rotation;n??=0;let s=this.getLayer(),c=s.getSource();if(!c)return;let l=c.getTileGridForProjection(t.viewState.projection),u=s.getRenderBuffer()??0,d=Wt([e]);Kt(d,a*(u+n),d);let f={},p=function(e,t,n){let a=e.getId();a===void 0&&(a=L(e));let o=f[a];if(!o){if(n===0)return f[a]=!0,r(e,s,t);i.push(f[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return f[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},m=this.renderedTiles,h=L(s),g=s.getDeclutter(),_=g?t.declutter?.[g]?.all().map(e=>e.value)??[]:[],v;e:for(let t=m.length-1;t>=0;--t){let r=m[t];if(!Cn(l.getTileCoordExtent(r.wrappedTileCoord),d))continue;let i=r.executorGroups[h];for(let t=0,r=i.length;t<r;++t)if(v=i[t].forEachFeatureAtCoordinate(e,a,o,n,p,_),v)break e}return v}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,n)=>{let r=this.getLayer(),i=r.getSource(),a=this.renderedProjection;if(!i||!a||!this.renderedPixelToCoordinateTransform_){t([]);return}let o=a.getExtent(),s=this.renderedResolution,c=i.getTileGridForProjection(a),l=Mi(this.renderedPixelToCoordinateTransform_,e.slice()),u=c.getTileCoordForCoordAndResolution(l,s).toString(),d=this.renderedTiles.find(e=>e.tileCoord.toString()===u&&e.getState()===z.LOADED);if(!d||d.loadingSourceTiles>0){t([]);return}i.getWrapX()&&a.canWrapX()&&!Xt(o,c.getTileCoordExtent(d.tileCoord))&&zn(l,a);let f=L(r),p=xn(c.getTileCoordExtent(d.wrappedTileCoord)),m=[(l[0]-p[0])/s,(p[1]-l[1])/s],h=d.getSourceTiles().reduce((e,t)=>e.concat(t.getFeatures()??[]),[]),g=d.hitDetectionImageData[f];if(!g){let e=vc(c.getTileSize(c.getZForResolution(s,i.zDirection))),t=this.renderedRotation_;g=p0(e,[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),s,0,f0,e[0]*f0,e[1]*f0,0)],h,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,t),d.hitDetectionImageData[f]=g}t(m0(m,h,g))})}getFeaturesInExtent(e){let t=[],n=this.getTileCache();if(n.getCount()===0)return t;let r=this.getLayer().getSource();if(!r||!this.frameState)return t;let i=r.getTileGridForProjection(this.frameState.viewState.projection),a=i.getZForResolution(this.renderedResolution),o={};return n.forEach(n=>{if(n.tileCoord[0]!==a||n.getState()!==z.LOADED)return;let r=n.getSourceTiles();for(let n=0,a=r.length;n<a;++n){let a=r[n],s=a.getKey();if(s in o)continue;o[s]=!0;let c=a.tileCoord;if(Cn(e,i.getTileCoordExtent(c))){let n=a.getFeatures();if(n)for(let r=0,i=n.length;r<i;++r){let i=n[r],a=i.getGeometry();a&&Cn(e,a.getExtent())&&t.push(i)}}}}),t}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){let n=this.getCanvasContext(),r=n.globalAlpha;n.globalAlpha=t.opacity;let i=e.viewHints,a=!(i[Dt.ANIMATING]||i[Dt.INTERACTING]),o=[this.getCanvasContext().canvas.width,this.getCanvasContext().canvas.height],s=this.getLayer().getDeclutter(),c=s?e.declutter?.[s]:void 0,l=L(this.getLayer()),u=this.renderedTiles;for(let t=0,n=u.length;t<n;++t){let n=u[t],r=n.executorGroups[l];if(r)for(let t=r.length-1;t>=0;--t)r[t].execute(this.getCanvasContext(),o,this.getTileRenderTransform(n,e),e.viewState.rotation,a,r0,c)}n.globalAlpha=r}renderDeferredInternal(e){let t=this.renderedTiles,n=L(this.getLayer()),r=t.reduce((e,t,r)=>(t.executorGroups[n].forEach(t=>e.push({executorGroup:t,index:r})),e),[]),i=r.map(({executorGroup:e})=>e.getDeferredZIndexContexts()),a={};for(let e=0,t=r.length;e<t;++e){let t=r[e].executorGroup.getDeferredZIndexContexts();for(let e in t)a[e]=!0}let o=Object.keys(a).map(Number).sort(Be);this.layerExtent&&this.clipUnrotated(this.getCanvasContext(),e,this.layerExtent),o.forEach(e=>{i.forEach((t,n)=>{t[e]&&(t[e].forEach(e=>{let{executorGroup:t,index:i}=r[n],a=t.getRenderedContext();if(!a)return;let o=a.globalAlpha;a.globalAlpha=this.renderedOpacity_;let s=this.tileClipContexts_?.[i];s&&s.draw(a),e.draw(a),s&&a.restore(),a.globalAlpha=o,e.clear()}),t[e].length=0)})}),this.layerExtent&&this.getCanvasContext().restore()}getTileRenderTransform(e,t){let n=t.pixelRatio,r=t.viewState,i=r.center,a=r.resolution,o=r.rotation,s=t.size,c=Math.round(s[0]*n),l=Math.round(s[1]*n),u=this.getLayer().getSource();if(!u)return Di();let d=u.getTileGridForProjection(t.viewState.projection),f=e.tileCoord,p=d.getTileCoordExtent(e.wrappedTileCoord),m=d.getTileCoordExtent(f,this.tempExtent)[0]-p[0];return ki(Ni(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(i,a,o,n,c,l,m))}clipTileContext_(e,t,n,r,i,a){let o=[];for(let e=0,a=n.length;e<a;++e)i<r[e]&&Cn(t,n[e])&&o.push(n[e]);if(o.length===0)return!1;let s=An(t,o);e.save(),e.beginPath();for(let t=0,n=s.length;t<n;++t){let n=s[t],r=Mi(a,[n[0],n[1]]),i=Mi(a,[n[0],n[3]]),o=Mi(a,[n[2],n[3]]),c=Mi(a,[n[2],n[1]]);e.moveTo(r[0],r[1]),e.lineTo(i[0],i[1]),e.lineTo(o[0],o[1]),e.lineTo(c[0],c[1]),e.closePath()}return e.clip(),!0}postRender(e,t){let n=t.viewHints,r=!(n[Dt.ANIMATING]||n[Dt.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;let i=this.getLayer(),a=i.getRenderMode(),o=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;let s=i.getDeclutter(),c=s?P0[a].filter(e=>!r0.includes(e)):P0[a],l=t.viewState,u=l.rotation;this.layerExtent&&this.clipUnrotated(e,t,this.layerExtent);let d=i.getSource();if(!d)return;let f=d.getTileGridForProjection(l.projection).getZForResolution(l.resolution,d.zDirection),p=this.renderedTiles,m=[],h=[],g=[],_=L(i),v=!0;for(let n=p.length-1;n>=0;--n){let a=p[n];v&&=!a.getReplayState(i).dirty;let o=a.executorGroups[_].filter(e=>e.hasExecutors(c));if(o.length===0)continue;let l=this.getTileRenderTransform(a,t),d=a.tileCoord[0],y=!1,b=o[0].getClipCoords(Ti),x=e,S;if(b){let e=[b[0],b[1],b[4],b[5]];S=new s1,x=S.getContext(),f!==d&&(y=this.clipTileContext_(x,e,m,h,d,l)),m.push(e),h.push(d)}for(let n=0,i=o.length;n<i;++n)o[n].execute(e,[e.canvas.width,e.canvas.height],l,u,r,c,s?t.declutter?.[s]:void 0);y&&(x===e?x.restore():g[n]=S??null)}this.layerExtent&&e.restore(),e.globalAlpha=o,this.ready=v,this.tileClipContexts_=g,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,n,r,i,a){if(!n)return!1;let o=!1;if(Array.isArray(n))for(let s=0,c=n.length;s<c;++s)o=x0(r,e,n[s],t,this.boundHandleStyleImageChange_,void 0,i,a)||o;else o=x0(r,e,n,t,this.boundHandleStyleImageChange_,void 0,i,a);return o}tileImageNeedsRender_(e){let t=this.getLayer();if(t.getRenderMode()===`vector`)return!1;let n=e.getReplayState(t),r=t.getRevision(),i=e.wantedResolution;return n.renderedTileResolution!==i||n.renderedTileRevision!==r}renderTileImage_(e,t){let n=this.getLayer(),r=e.getReplayState(n),i=n.getRevision(),a=e.executorGroups[L(n)];r.renderedTileRevision=i;let o=e.wrappedTileCoord,s=o[0],c=n.getSource();if(!c)return;let l=t.pixelRatio,u=t.viewState.projection,d=c.getTileGridForProjection(u),f=d.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*f,m=d.getResolution(s),h=e.getContext();l=Math.round(Math.max(l,p/l));let g=c.getTilePixelSize(s,l,u);h.canvas.width=g[0],h.canvas.height=g[1];let _=l/p;if(_!==1){let e=Oi(this.tmpTransform_);Ni(e,_,_),h.setTransform(e[0],e[1],e[2],e[3],e[4],e[5])}let v=d.getTileCoordExtent(o,this.tempExtent),y=p/m,b=Oi(this.tmpTransform_);Ni(b,y,-y),Pi(b,-v[0],-v[3]);for(let e=0,t=a.length;e<t;++e)a[e].execute(h,[h.canvas.width*_,h.canvas.height*_],b,0,!0,N0[n.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}},I0=class extends td{constructor(e){e||={};let t=Object.assign({},e);delete t.preload;let n=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n;let r=e.renderMode||`hybrid`;B(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),this.getBackground,this.setBackground}createRenderer(){return new F0(this,{cacheSize:this.cacheSize_})}getFeatures(e){return super.getFeatures(e)}getFeaturesInExtent(e){let t=this.getRenderer();return t?t.getFeaturesInExtent(e):[]}getRenderMode(){return this.renderMode_}getPreload(){return this.get(v1.PRELOAD)}getUseInterimTilesOnError(){return this.get(v1.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(v1.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(v1.USE_INTERIM_TILES_ON_ERROR,e)}};function L0(e,t){return[[-1/0,-1/0,1/0,1/0]]}function R0(e,t){return[e]}var z0=class extends at{constructor(e){super(),this.projection=H(e.projection),this.attributions_=B0(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.canRotate=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX!==void 0&&e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}ready(){let e=this.getState();return e===`ready`?Promise.resolve():e===`error`?Promise.reject(Error(`Source failed to load`)):new Promise((e,t)=>{let n=()=>{let r=this.getState();r===`ready`?(this.un(`change`,n),e()):r===`error`&&(this.un(`change`,n),t(Error(`Source failed to load`)))};this.on(`change`,n)})}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=B0(e),this.changed()}setState(e){this.state_=e,this.changed()}};function B0(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}function V0(e,t,n,r){let i=document.createElement(`script`),a=`olc_`+L(t);function o(){delete window[a];let e=i.parentNode;e&&e.removeChild(i)}i.async=!0,i.src=e+(e.includes(`?`)?`&`:`?`)+(r||`callback`)+`=`+a;let s=setTimeout(function(){o(),n&&n()},1e4);window[a]=function(e){clearTimeout(s),o(),t(e)},document.head.appendChild(i)}var H0=[0,0,0],U0=5,W0=class{constructor(e){let t=e.minZoom,n=e.resolutions;t===void 0&&n&&(t=n.findIndex(e=>e!==void 0)),this.minZoom=t===void 0?0:t,this.resolutions_=n,B(Ke(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let r;if(!e.origins){for(let e=0,t=this.resolutions_.length-1;e<t;++e)if(!r)r=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==r){r=void 0;break}}this.zoomFactor_=r,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,B(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));let i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=xn(i)),B(!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,B(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,B(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i===void 0?null:i,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.tileRanges===void 0?e.sizes===void 0?i&&this.calculateTileRanges_(i):this.fullTileRanges_=e.sizes.map((e,t)=>{let n=new z_(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(i){let e=this.getTileRangeForExtentAndZ(i,t);n.minX=Math.max(e.minX,n.minX),n.maxX=Math.min(e.maxX,n.maxX),n.minY=Math.max(e.minY,n.minY),n.maxY=Math.min(e.maxY,n.maxY)}return n}):this.fullTileRanges_=e.tileRanges}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=B_(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))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_?this.origins_[e]:[0,0]}getOrigins(){return this.origins_}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return B_(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return B_(i,i,a,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?B_(o,o,s,s,n):B_(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,H0);let r=H0[1],i=H0[2];return this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,H0),B_(r,H0[1],i,H0[2],n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=vc(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=vc(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return en(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=vc(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=zt(l,U0)-1,u=zt(u,U0)-1):(l=Rt(l,U0),u=Rt(u,U0)),t1(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=vc(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];return r?(c=zt(c,U0)-1,l=zt(l,U0)-1):(c=Rt(c,U0),l=Rt(l,U0)),t1(n,c,l,i)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_?this.tileSizes_[e]:256}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){return kt(He(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Ca(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function G0(e){let t=e.getDefaultTileGrid();return t||(t=X0(e),e.setDefaultTileGrid(t)),t}function K0(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=Z0(n);if(!Yt(a,i)){let t=V(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function q0(e,t,n,r){r=r===void 0?`top-left`:r;let i=Y0(e,t,n);return new W0({extent:e,origin:hn(e,r),resolutions:i,tileSize:n})}function J0(e){let t=e||{},n=t.extent||H(`EPSG:3857`)?.getExtent();if(!n)throw Error(`Unable to determine extent for XYZ tile grid`);return new W0({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:Y0(n,t.maxZoom,t.tileSize,t.maxResolution)})}function Y0(e,t,n,r){t=t===void 0?42:t,n=vc(n===void 0?256:n);let i=vn(e),a=V(e);r=r!==void 0&&r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function X0(e,t,n,r){return q0(Z0(e),t,n,r)}function Z0(e){let t=H(e);if(!t)throw Error(`Unable to determine extent from unknown projection`);let n=t.getExtent();if(!n){let e=t.getMetersPerUnit();if(e===void 0)throw Error(`Unable to determine extent from projection without units`);let r=180*Zn.degrees/e;n=en(-r,-r,r,r)}return n}var Q0=/\{z\}/g,$0=/\{x\}/g,ev=/\{y\}/g,tv=/\{-y\}/g;function nv(e,t,n,r,i){return e.replace(Q0,t.toString()).replace($0,n.toString()).replace(ev,r.toString()).replace(tv,function(){if(i===void 0)throw Error(`If the URL template has a {-y} placeholder, the grid extent must be known`);return(i-r).toString()})}function rv(e,t,n,r){return e[Ft(a1(t,n,r),e.length)]}function iv(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function av(e,t){return(function(n,r,i){if(!n)return;let a,o=n[0];if(t){let e=t.getFullTileRange(o);e&&(a=e.getHeight()-1)}return nv(e,o,n[1],n[2],a)})}function ov(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=av(e[i],t);return sv(r)}function sv(e){return e.length===1?e[0]:(function(t,n,r){return t?e[Ft(i1(t),e.length)](t,n,r):void 0})}var cv=class extends z0{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?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&vc(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=e.key||L(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){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i,a){return I()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:G0(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=vc(r.getTileSize(e),this.tmpSize);return i==1?a:_c(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){let n=t===void 0?this.getProjection():t,r=t===void 0&&this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(e=K0(r,e,n)),o1(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}},lv=class extends et{constructor(e,t){super(e),this.tile=t}},uv={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},dv=class e extends cv{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===e.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.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){let t=e.target,n=L(t),r=t.getState(),i;r==z.LOADING?(this.tileLoadingKeys_[n]=!0,i=uv.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==z.ERROR?uv.TILELOADERROR:r==z.LOADED?uv.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new lv(i,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=iv(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(`
|
|
8
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(ov(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},fv=class extends dv{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:pv,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,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?L_:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){let t=this.getProjection();return t&&e&&!di(t,e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||di(t,e)))return this.tileGrid;let n=L(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=G0(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?z.EMPTY:z.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(F.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||di(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new $_(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i)||s,this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=r1(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=H(e);if(n){let e=L(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function pv(e,t){if(ht){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();if(!n)return;n.width=t.width,n.height=t.height;let r=n.getContext(`2d`);r&&(r.drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`)))}).catch(()=>{e.getImage()?.dispatchEvent(new Event(`error`))})}else e.getImage().src=t}var mv=class extends fv{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:H(`EPSG:3857`),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:`loading`,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX===void 0||e.wrapX,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url){if(e.jsonp)V0(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{let 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 Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){let t=e.target;if(!t.status||t.status>=200&&t.status<300){let e;try{e=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(e)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){let t=H(`EPSG:4326`),n=this.getProjection();if(!n||!t){this.handleTileJSONError();return}let r;if(e.bounds!==void 0){let i=fi(t,n);if(!i){this.handleTileJSONError();return}r=Dn(e.bounds,i)}let i=Z0(n),a=e.minzoom||0,o=J0({extent:i,maxZoom:e.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=ov(e.tiles,o),e.attribution&&!this.getAttributions()){let t=r===void 0?i:r;this.setAttributions((function(n){return Cn(t,n.extent)?[e.attribution]:null}))}this.tileJSON_=e,this.setState(`ready`)}handleTileJSONError(){this.setState(`error`)}},hv=!1;function gv(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=hv,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.getType();try{let r;e==`text`||e==`json`?r=s.responseText:e==`xml`?r=s.responseXML||s.responseText:e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}catch{o()}}else o()},s.onerror=o,s.send()}function _v(e,t){return function(n,r,i,a,o){gv(e,t,n,r,i,(e,t)=>{this.addFeatures(e),a!==void 0&&a(e)},()=>{this.changed(),o!==void 0&&o()})}}var vv=class{constructor(e){this.rbush_=new js(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[L(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=e[r],a=t[r],o={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:a};n[r]=o,this.items_[L(a)]=o}this.rbush_.load(n)}remove(e){let t=L(e),n=this.items_[t];return delete this.items_[t],this.rbush_.remove(n)!==null}update(e,t){let n=this.items_[L(t)];an([n.minX,n.minY,n.maxX,n.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(e){return e.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let n;for(let r=0,i=e.length;r<i;r++)if(n=t(e[r]),n)return n;return n}isEmpty(){return Fe(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return en(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}},yv={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`},bv=class extends et{constructor(e,t,n){super(e),this.feature=t,this.features=n}},xv=class extends z0{constructor(e){e||={},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0||e.wrapX}),this.canRotate=!0,this.on,this.once,this.un,this.loader_=Ze,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0||e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(B(this.format_,"`format` must be set when `url` is set"),this.loader_=_v(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?L0:e.strategy;let t=e.useSpatialIndex===void 0||e.useSpatialIndex;this.featuresRtree_=t?new vv:null,this.loadedExtentsRtree_=new vv,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new ct(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=L(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new bv(yv.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof Cd||(this.featureChangeKeys_[e]=[P(t,F.CHANGE,this.handleFeatureChange_,this),P(t,Ne.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let n=!0;if(t.getId()!==void 0){let e=String(t.getId());if(!(e in this.idIndex_))this.idIndex_[e]=t;else if(t instanceof Cd){let r=this.idIndex_[e];r instanceof Cd?Array.isArray(r)?r.push(t):this.idIndex_[e]=[r,t]:n=!1}else n=!1}return n&&(B(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=L(r);this.addToIndex_(i,r)&&n.push(r)}for(let e=0,i=n.length;e<i;e++){let i=n[e],a=L(i);this.setupChangeEvents_(a,i);let o=i.getGeometry();if(o){let e=o.getExtent();t.push(e),r.push(i)}else this.nullGeometryFeatures_[a]=i}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(yv.ADDFEATURE))for(let e=0,t=n.length;e<t;e++)this.dispatchEvent(new bv(yv.ADDFEATURE,n[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(yv.ADDFEATURE,(function(n){!t&&n.feature&&(t=!0,e.push(n.feature),t=!1)})),this.addEventListener(yv.REMOVEFEATURE,(function(n){!t&&n.feature&&(t=!0,e.remove(n.feature),t=!1)})),e.addEventListener(Me.ADD,(e=>{t||=(t=!0,this.addFeature(e.element),!1)})),e.addEventListener(Me.REMOVE,(e=>{t||=(t=!0,this.removeFeature(e.element),!1)})),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(Le);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)});for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new bv(yv.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){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){let r=n.getGeometry();if(r instanceof Cd||r&&r.intersectsCoordinate(e))return t(n)})}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(n){let r=n.getGeometry();if(r instanceof Cd||r&&r.intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Fe(this.nullGeometryFeatures_)||We(e,Object.values(this.nullGeometryFeatures_))),e||[]}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let n=this.featuresRtree_;return kn(e,t).flatMap(e=>n.getInExtent(e))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];t||=Ye;let c=this.featuresRtree_;return c?(c.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry();if(!t)return;let c=o;if(o=t instanceof Cd?0:t.closestPointXY(n,r,a,o),o<c){i=e;let t=Math.sqrt(o);s[0]=n-t,s[1]=r-t,s[2]=n+t,s[3]=r+t}}}),i):null}getExtent(e){return this.featuresRtree_?.getExtent(e)??null}getFeatureById(e){let t=this.idIndex_[e.toString()];return t===void 0?null:t}getFeatureByUid(e){let t=this.uidIndex_[e];return t===void 0?null:t}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,n=L(t),r=t.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[n]=t);else{let e=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}let i=t.getId();if(i!==void 0){let e=i.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[n]=t;this.changed(),this.dispatchEvent(new bv(yv.CHANGEFEATURE,t))}hasFeature(e){let t=e.getId();if(t!==void 0){let n=this.idIndex_[String(t)];return Array.isArray(n)?n.includes(e):n===e}return L(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Fe(this.nullGeometryFeatures_):!this.featuresCollection_||this.featuresCollection_.getLength()===0}loadFeatures(e,t,n){let r=this.loadedExtentsRtree_,i=this.strategy_(e,t,n);for(let e=0,a=i.length;e<a;++e){let a=i[e];if(!r.forEachInExtent(a,function(e){return Xt(e.extent,a)})){this.loading=Number(this.loading)+1,this.dispatchEvent(new bv(yv.FEATURESLOADSTART));let e=e=>{this.loading=Number(this.loading)-1,this.dispatchEvent(new bv(yv.FEATURESLOADEND,void 0,e))},i=()=>{this.changed(),this.loading=Number(this.loading)-1,this.dispatchEvent(new bv(yv.FEATURESLOADERROR))},o=!1,s=this.loader_.call(this,a,t,n,t=>o||e(t),()=>o||i());Je(s)?(o=!0,s.then(t=>{let n=t;this.addFeatures(n),e(n)}).catch(i)):this.loader_.length<4&&(this.loading=!1),r.insert(a,{extent:a.slice()})}}}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n=[];t.forEachInExtent(e,function(e){n.push(e)}),n.forEach(n=>{t.remove(n);let r=bn(n.extent,e);for(let e of r)t.insert(e,{extent:e})})}removeFeatures(e){let t=!1;for(let n=0,r=e.length;n<r;++n)t=this.removeFeatureInternal(e[n])||t;t&&this.changed()}removeFeature(e){e&&this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=L(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[t]?.forEach(Le),delete this.featureChangeKeys_[t];let n=e.getId();if(n!==void 0){let t=n.toString(),r=this.idIndex_[t];r===e?delete this.idIndex_[t]:Array.isArray(r)&&(r.splice(r.indexOf(e),1),r.length===1&&(this.idIndex_[t]=r[0]))}return delete this.uidIndex_[t],this.hasListener(yv.REMOVEFEATURE)&&this.dispatchEvent(new bv(yv.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(let t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){B(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(_v(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}},Sv=[],Cv=class extends k_{constructor(e,t,n,r,i){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_=i,this.wrappedTileCoord=n}getContext(){return this.context_||=yo(1,1,Sv),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){let t=L(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedPixelRatio:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&=(So(this.context_),Sv.push(this.context_.canvas),null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}},wv=class extends k_{constructor(e,t,n,r,i,a){super(e,t,a),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=i,this.url_=n,this.key=n}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==z.IDLE&&(this.setState(z.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.extent&&this.projection&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(z.ERROR)}setFeatures(e){this.features_=e,this.setState(z.LOADED)}setLoader(e){this.loader_=e}},Tv=class extends dv{constructor(e){let t=e.projection||`EPSG:3857`,n=e.extent||Z0(t),r=e.tileGrid||J0({extent:n,maxResolution:e.maxResolution,maxZoom:e.maxZoom===void 0?22:e.maxZoom,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:Ev,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 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||e.overlaps,this.tileClass=e.tileClass?e.tileClass:wv,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceZ_(e,t,n){let r=this.projection,i=di(t,r)?e:e/(r.getMetersPerUnit()||1)*(t.getMetersPerUnit()||1);return this.tileGrid.getZForResolution(i,n)}getSourceTiles(e,t,n,r){if(n.getState()===z.IDLE){n.setState(z.LOADING);let i=n.wrappedTileCoord,a=this.getTileGridForProjection(t),o=a.getTileCoordExtent(i),s=i[0],c=a.getResolution(s);Kt(o,-c,o);let l=this.projection;t&&l&&!di(t,l)&&(o=gi(o,t,l));let u=this.tileGrid,d=u.getExtent();d&&yn(o,d,o);let f=this.getSourceZ_(c,t,this.zDirection),p=r||this.tileUrlFunction;u.forEachTileCoord(o,f,r=>{let i=p(r,e,t);if(!i)return;this.sourceTiles_[i]||(this.sourceTiles_[i]=new this.tileClass(r,i?z.IDLE:z.EMPTY,i,this.format_,this.tileLoadFunction));let a=this.sourceTiles_[i];n.sourceTiles.push(a),this.tileKeysBySourceTileUrl_[i]||(this.tileKeysBySourceTileUrl_[i]=[]),this.tileKeysBySourceTileUrl_[i].push(n.getKey());let o=a.getState();if(o<z.LOADED){let e=t=>{this.handleTileChange(t);let r=a.getState();if(r===z.LOADED||r===z.ERROR){let t=a.getKey();t in n.errorTileKeys?a.getState()===z.LOADED&&delete n.errorTileKeys[t]:n.loadingSourceTiles--,r===z.ERROR?n.errorTileKeys[t]=!0:a.removeEventListener(F.CHANGE,e),n.loadingSourceTiles===0&&n.setState(Fe(n.errorTileKeys)?z.LOADED:z.ERROR)}};a.addEventListener(F.CHANGE,e),n.loadingSourceTiles++}o===z.IDLE&&(a.extent=u.getTileCoordExtent(r),a.projection=l,a.resolution=u.getResolution(r[0]),a.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(e=>e.getState()===z.ERROR)?z.ERROR:z.LOADED)}return n.sourceTiles}removeSourceTiles(e){let t=e.getKey(),n=e.sourceTiles;for(let e=0,r=n.length;e<r;++e){let r=n[e].getTileUrl();if(!this.tileKeysBySourceTileUrl_[r])return;let i=this.tileKeysBySourceTileUrl_[r].indexOf(t);i!==-1&&(this.tileKeysBySourceTileUrl_[r].splice(i,1),this.tileKeysBySourceTileUrl_[r].length===0&&(delete this.tileKeysBySourceTileUrl_[r],delete this.sourceTiles_[r]))}}getTile(e,t,n,r,i){let a=[e,t,n],o=this.getTileCoordForTileUrlFunction(a,i),s=this.getTileGrid(),c=s?s.getExtent():void 0,l=this.projection,u=this.getTileGridForProjection(i);if(o&&c){let t=u.getTileCoordExtent(o);Kt(t,-u.getResolution(e),t),Cn(c,!i||!l||di(i,l)?t:gi(t,i,l))||(o=null)}let d=!0;if(o!==null){let t=this.tileGrid,n=u.getResolution(e),a=this.getSourceZ_(n,i,1),s=u.getTileCoordExtent(o);Kt(s,-n,s),t.forEachTileCoord(!i||!l||di(i,l)?s:gi(s,i,l),a,e=>{d&&=!this.tileUrlFunction(e,r,l)})}let f=this.tileUrlFunction,p=new Cv(a,d?z.EMPTY:z.IDLE,o||a,e=>this.getSourceTiles(r,i,e,f),this.removeSourceTiles.bind(this));return p.key=this.getKey(),p}getTileGridForProjection(e){let t=e.getCode(),n=this.tileGrids_[t];if(!n){let r=this.projection,i=this.tileGrid;if(r!==null&&!di(r,e))return G0(e);let a=i.getResolutions().slice(),o=a.map(function(e,t){return i.getOrigin(t)}),s=a.map(function(e,t){return i.getTileSize(t)});for(let e=a.length;e<43;++e)a.push(a[e-1]/2),o.push(o[e-1]),s.push(s[e-1]);n=new W0({extent:i.getExtent()??void 0,origins:o,resolutions:a,tileSizes:s}),this.tileGrids_[t]=n}return n}getTilePixelRatio(e){return e}getTilePixelSize(e,t,n){let r=vc(this.getTileGridForProjection(n).getTileSize(e),this.tmpSize);return[Math.round(r[0]*t),Math.round(r[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}};function Ev(e,t){e.setLoader(function(n,r,i){i&&gv(t,e.getFormat(),n,r,i,(t,n)=>{e.onLoad(t,n??i)},e.onError.bind(e))})}function Dv(e,t){let n=t[0].evaluate(e),r=t[1].evaluate(e),i=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return Ep.parse(`hsla(${n}, ${r}%, ${i}%, ${a})`)}function Ov(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],a=Math.max(t,n,r),o=Math.min(t,n,r),s=(a+o)/2,c,l;if(a===o)c=0,l=0;else{let e=a-o;switch(l=s>.5?e/(2-a-o):e/(a+o),a){case t:c=(n-r)/e+(n<r?6:0);break;case n:c=(r-t)/e+2;break;case r:c=(t-n)/e+4;break;default:c=0}c/=6}return[c*360,l*100,s*100,i]}function kv(e){if(Array.isArray(e)){if(e.length===0)return e;let t=e[0];if(t===`literal`)return e;if(t===`image`&&e.length===3&&typeof e[2]==`object`&&e[2]!==null&&!Array.isArray(e[2]))return[`image-config`,kv(e[1]),[`literal`,e[2]]];let n=e.length;for(let r=1;r<n;++r){let i=e[r],a=kv(i);if(a!==i){let i=[t];for(let t=1;t<r;++t)i.push(e[t]);i.push(a);for(let t=r+1;t<n;++t)i.push(kv(e[t]));return i}}}return e}var Av={},jv={zoom:0,distanceFromCenter:0};ig.register(rg,{...ig.definitions,pitch:[{kind:`number`},[],e=>jv.pitch||0],"distance-from-center":[{kind:`number`},[],e=>jv.distanceFromCenter||0],"to-hsla":[{kind:`array`,itemType:{kind:`number`},N:4},[{kind:`string`}],(e,[t])=>Ov(pc(t.evaluate(e)))],hsl:[{kind:`color`},[{kind:`number`},{kind:`number`},{kind:`number`}],Dv],hsla:[{kind:`color`},[{kind:`number`},{kind:`number`},{kind:`number`},{kind:`number`}],Dv],"image-config":[{kind:`value`},[{kind:`string`},{kind:`value`}],(e,[t,n])=>t.evaluate(e)],"measure-light":[{kind:`number`},[{kind:`value`}],()=>1],config:[{kind:`value`},[{kind:`string`}],(e,[t])=>{let n=Av[t.evaluate(e)];return n===void 0?{}:n}]});var Mv=`https://api.mapbox.com`;function Nv(e){return e.indexOf(`mapbox://`)===0?e.slice(9):``}function Pv(e,t,n){if(typeof e==`string`)return[{id:`default`,url:Fv(e,t,n)}];for(let r of e)r.url=Fv(r.url,t,n);return e}function Fv(e,t,n){let r=Nv(e);if(!t||!r)return decodeURI(new URL(e,n).href);if(r.indexOf(`sprites/`)!==0)throw Error(`unexpected sprites url: ${e}`);return`${Mv}/styles/v1/${r.slice(8)}/sprite?access_token=${t}`}function Iv(e,t){return decodeURI(new URL(e,t||location.href).href)}function Lv(e,t){let n=Nv(e);if(!n||!t)return decodeURI(new URL(e,location.href).href);if(n.indexOf(`styles/`)!==0)throw Error(`unexpected style url: ${e}`);return`${Mv}/styles/v1/${n.slice(7)}?&access_token=${t}`}var Rv=[`a`,`b`,`c`,`d`];function zv(e,t,n,r){let i=new URL(e,r||location.href),a=Nv(e);return a?a===`mapbox.satellite`?[`https://api.mapbox.com/v4/${a}/{z}/{x}/{y}${window.devicePixelRatio>=1.5?`@2x`:``}.webp?access_token=${t}`]:Rv.map(e=>`https://${e}.tiles.mapbox.com/v4/${a}/{z}/{x}/{y}.vector.pbf?access_token=${t}`):(t&&(i.searchParams.has(n)||i.searchParams.set(n,t)),[decodeURI(i.href)])}var Bv=class extends p1{constructor(e){super(e),this.image=null,this.renderedSourceRevision_=0,this.renderedRotation=0}getImage(){return this.image?this.image.getImage():null}prepareFrame(e){let t=e.layerStatesArray[e.layerIndex],n=e.pixelRatio,r=e.viewState,i=r.resolution,a=this.getLayer().getSource(),o=e.viewHints,s=e.extent;if(t.extent!==void 0&&(s=yn(s,Si(t.extent,r.projection))),!o[Dt.ANIMATING]&&!o[Dt.INTERACTING]&&!wn(s)){if(a){!this.getLayer().rendered&&this.renderedSourceRevision_!==a.getRevision()&&(this.image=null),this.renderedSourceRevision_=a.getRevision();let e=r.projection,t=a.getImage(s,i,n,e);t&&(this.loadImage(t)?(this.image=t,this.renderedRotation=this.sourceRotates()?r.rotation:0):t.getState()===q.EMPTY&&(this.image=null))}else this.image=null}return!!this.image}getData(e){let t=this.frameState;if(!t||!this.image)return null;let n=this.getLayer(),r=Mi(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Yt(i,r))return null;let a=this.image.getExtent(),o=this.image.getImage();if(!o)return null;let s=this.renderedRotation;if(s!==0){let e=mn(a),t=Math.cos(-s),n=Math.sin(-s),i=r[0]-e[0],o=r[1]-e[1];r[0]=e[0]+t*i-n*o,r[1]=e[1]+n*i+t*o}let c=V(a),l=Math.floor(o.width*((r[0]-a[0])/c));if(l<0||l>=o.width)return null;let u=vn(a),d=Math.floor(o.height*((a[3]-r[1])/u));return d<0||d>=o.height?null:this.getImageData(o,l,d)}renderFrame(e,t){let n=this.image;if(!n)return this.getContainerElement();let r=n.getExtent(),i=n.getResolution(),[a,o]=Array.isArray(i)?i:[i,i],s=n.getPixelRatio(),c=this.renderedRotation,l=this.getLayer().getSource(),u=this.sourceRotates(),d=e.layerStatesArray[e.layerIndex],f=e.pixelRatio,p=e.viewState,m=p.center,h=p.resolution,g=p.rotation,_=f*a/(h*s),v=f*o/(h*s);this.prepareContainer(e,t);let y=this.getCanvasContext().canvas.width,b=this.getCanvasContext().canvas.height,x=this.getRenderContext(e),S=!1,C=!0;if(d.extent){let t=Si(d.extent,p.projection),n=e.extent;C=Cn(t,n),S=C&&!Xt(t,n),S&&this.clipUnrotated(x,e,t)}let w=n.getImage();if(!w)return this.getContainerElement();let T,E,D;if(!u)T=Fi(this.tempTransform,y/2,b/2,_,v,0,s*(r[0]-m[0])/a,s*(m[1]-r[3])/o),E=w.width*T[0],D=w.height*T[3];else{let e=f/h,t=Math.cos(g),n=Math.sin(g),i=mn(r),a=i[0]-m[0],o=i[1]-m[1];T=Fi(this.tempTransform,y/2+e*(t*a+n*o),b/2+e*(n*a-t*o),_,v,g-c,-w.width/2,-w.height/2),E=w.width*_,D=w.height*v}if(this.renderedResolution=o*f/s,l?.getInterpolate()||u&&g!==c||(x.imageSmoothingEnabled=!1),this.preRender(x,e),C&&E>=.5&&D>=.5){let e=d.opacity;if(u)x.save(),e!==1&&(x.globalAlpha=e),x.setTransform(T[0],T[1],T[2],T[3],T[4],T[5]),x.drawImage(w,0,0),x.restore();else{let t=T[4],n=T[5];e!==1&&(x.save(),x.globalAlpha=e),x.drawImage(w,0,0,w.width,w.height,t,n,E,D),e!==1&&x.restore()}}return this.postRender(this.getCanvasContext(),e),S&&x.restore(),x.imageSmoothingEnabled=!0,this.getContainerElement()}},Vv=class extends Es{constructor(e){e||={},super(e)}},Hv=class extends Vv{constructor(e){super(e)}createRenderer(){return new Bv(this)}getData(e){return super.getData(e)}},Uv=class extends Sl{constructor(e,t,n,r,i){let a=i===void 0?q.LOADED:q.IDLE;super(e,t,n,a),this.loader_=i===void 0?null:i,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=q.ERROR):this.state=q.LOADED,this.changed()}load(){this.state==q.IDLE&&this.loader_&&(this.state=q.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}};function Wv(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Gv(e,t,n,r,i,a,o){o??=Wv();let s=1/(e-t),c=1/(n-r),l=1/(i-a);return o[0]=-2*s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(e+t)*s,o[13]=(r+n)*c,o[14]=(a+i)*l,o[15]=1,o}function Kv(e,t,n,r,i){return i??=Wv(),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*n,i[5]=e[5]*n,i[6]=e[6]*n,i[7]=e[7]*n,i[8]=e[8]*r,i[9]=e[9]*r,i[10]=e[10]*r,i[11]=e[11]*r,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function qv(e,t,n,r,i){i??=Wv();let a,o,s,c,l,u,d,f,p,m,h,g;return e===i?(i[12]=e[0]*t+e[4]*n+e[8]*r+e[12],i[13]=e[1]*t+e[5]*n+e[9]*r+e[13],i[14]=e[2]*t+e[6]*n+e[10]*r+e[14],i[15]=e[3]*t+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],s=e[2],c=e[3],l=e[4],u=e[5],d=e[6],f=e[7],p=e[8],m=e[9],h=e[10],g=e[11],i[0]=a,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=g,i[12]=a*t+l*n+p*r+e[12],i[13]=o*t+u*n+m*r+e[13],i[14]=s*t+d*n+h*r+e[14],i[15]=c*t+f*n+g*r+e[15]),i}function Jv(e,t,n,r){return r??=Wv(),r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e,r[13]=t,r[14]=n,r[15]=1,r}var Yv=`
|
|
20
9
|
attribute vec4 a_position;
|
|
21
10
|
attribute vec4 a_texcoord;
|
|
22
11
|
|
|
@@ -30,7 +19,7 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
30
19
|
vec2 texcoord = (u_textureMatrix * a_texcoord).xy;
|
|
31
20
|
v_texcoord = texcoord;
|
|
32
21
|
}
|
|
33
|
-
`,
|
|
22
|
+
`,Xv=`
|
|
34
23
|
precision mediump float;
|
|
35
24
|
|
|
36
25
|
varying vec2 v_texcoord;
|
|
@@ -48,7 +37,7 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
48
37
|
}
|
|
49
38
|
gl_FragColor = texture2D(u_texture, v_texcoord);
|
|
50
39
|
}
|
|
51
|
-
`,
|
|
40
|
+
`,Zv=class{constructor(e){this.gl_=e,this.program_=$v(e,Xv,Yv),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,n,r,i,a,o,s,c,l,u,d,f){let p=this.gl_;s===void 0&&(s=r),c===void 0&&(c=i),a===void 0&&(a=t),o===void 0&&(o=n),l===void 0&&(l=a),u===void 0&&(u=o),d===void 0&&(d=p.canvas.width),f===void 0&&(f=p.canvas.height),p.bindTexture(p.TEXTURE_2D,e),p.useProgram(this.program_),p.bindBuffer(p.ARRAY_BUFFER,this.positionBuffer),p.enableVertexAttribArray(this.positionLocation),p.vertexAttribPointer(this.positionLocation,2,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,this.texcoordBuffer),p.enableVertexAttribArray(this.texcoordLocation),p.vertexAttribPointer(this.texcoordLocation,2,p.FLOAT,!1,0,0);let m=Gv(0,d,0,f,-1,1);m=qv(m,s,c,0),m=Kv(m,l,u,1),p.uniformMatrix4fv(this.matrixLocation,!1,m);let h=Jv(r/t,i/n,0);h=Kv(h,a/t,o/n,1),p.uniformMatrix4fv(this.textureMatrixLocation,!1,h),p.uniform1i(this.textureLocation,0),p.drawArrays(p.TRIANGLES,0,this.positions.length/2)}};function Qv(e,t,n){let r=e.createShader(t);if(r===null)throw Error(`Shader compilation failed`);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw Error(t===null?`Shader info log creation failed`:t)}return r}function $v(e,t,n){let r=e.createProgram(),i=Qv(e,e.VERTEX_SHADER,n),a=Qv(e,e.FRAGMENT_SHADER,t);if(r===null)throw Error(`Program creation failed`);if(e.attachShader(r,i),e.attachShader(r,a),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw e.getProgramInfoLog(r)===null?Error(`Program info log creation failed`):Error();return r}var ey=`
|
|
52
41
|
attribute vec4 a_position;
|
|
53
42
|
|
|
54
43
|
uniform mat4 u_matrix;
|
|
@@ -56,14 +45,14 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
56
45
|
void main() {
|
|
57
46
|
gl_Position = u_matrix * a_position;
|
|
58
47
|
}
|
|
59
|
-
`,
|
|
48
|
+
`,ty=`
|
|
60
49
|
precision mediump float;
|
|
61
50
|
|
|
62
51
|
uniform vec4 u_val;
|
|
63
52
|
void main() {
|
|
64
53
|
gl_FragColor = u_val;
|
|
65
54
|
}
|
|
66
|
-
`,
|
|
55
|
+
`,ny=`
|
|
67
56
|
attribute vec4 a_position;
|
|
68
57
|
attribute vec2 a_texcoord;
|
|
69
58
|
|
|
@@ -75,7 +64,7 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
75
64
|
gl_Position = u_matrix * a_position;
|
|
76
65
|
v_texcoord = a_texcoord;
|
|
77
66
|
}
|
|
78
|
-
`,
|
|
67
|
+
`,ry=`
|
|
79
68
|
precision mediump float;
|
|
80
69
|
|
|
81
70
|
varying vec2 v_texcoord;
|
|
@@ -88,22 +77,33 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
88
77
|
}
|
|
89
78
|
gl_FragColor = texture2D(u_texture, v_texcoord);
|
|
90
79
|
}
|
|
91
|
-
`;function NC(e,t,n,r){let i;return i=n&&n.length?n.shift():vt?new OffscreenCanvas(e||300,t||300):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`webgl`,r)}function PC(e){let t=e.canvas;t.width=1,t.height=1,e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)}var FC=[];function IC(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=Math.round(r*t),h=Math.round(r*n);e.canvas.width=m,e.canvas.height=h;let g,_;if(_=e.createTexture(),e.bindTexture(e.TEXTURE_2D,_),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),f?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,m,h,0,e.RGBA,u,null),g=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,g),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,_,0),g===null)throw Error(`Could not create framebuffer`);if(_===null)throw Error(`Could not create texture`);if(c.length===0)return{width:m,height:h,framebuffer:g,texture:_};let v=nn();c.forEach(function(e,t,n){ln(v,e.extent)});let y,b,x,S=1/i;if(!p||c.length!==1||l!==0){if(y=e.createTexture(),_===null)throw Error(`Could not create texture`);b=Math.round(z(v)*S),x=Math.round(xn(v)*S);let t=e.getParameter(e.MAX_TEXTURE_SIZE),n=Math.max(b,x),r=n>t?t/n:1,i=Math.round(b*r),a=Math.round(x*r);e.bindTexture(e.TEXTURE_2D,y),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),f?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,i,a,0,e.RGBA,u,null);let o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,y,0);let s=new EC(e);c.forEach(function(t,n,c){let u=(t.extent[0]-v[0])*S*r,d=-(t.extent[3]-v[3])*S*r,p=z(t.extent)*S*r,m=xn(t.extent)*S*r;if(e.bindFramebuffer(e.FRAMEBUFFER,o),e.viewport(0,0,i,a),t.clipExtent){let n=(t.clipExtent[0]-v[0])*S*r,i=-(t.clipExtent[3]-v[3])*S*r,a=z(t.clipExtent)*S*r,o=xn(t.clipExtent)*S*r;e.enable(e.SCISSOR_TEST),e.scissor(f?n:Math.round(n),f?i:Math.round(i),f?a:Math.round(n+a)-Math.round(n),f?o:Math.round(i+o)-Math.round(i))}s.drawImage(t.texture,t.width,t.height,l,l,t.width-2*l,t.height-2*l,f?u:Math.round(u),f?d:Math.round(d),f?p:Math.round(u+p)-Math.round(u),f?m:Math.round(d+m)-Math.round(d),i,a),e.disable(e.SCISSOR_TEST)}),e.deleteFramebuffer(o)}else y=c[0].texture,b=c[0].width,x=c[0].width;let C=Cn(o),w=Cn(v),T=e=>{let t=(e[0][0]-C[0])/a*r,n=-(e[0][1]-C[1])/a*r;return{u1:(e[1][0]-C[0])/a*r,v1:-(e[1][1]-C[1])/a*r,u0:t,v0:n,u2:(e[2][0]-C[0])/a*r,v2:-(e[2][1]-C[1])/a*r}};e.bindFramebuffer(e.FRAMEBUFFER,g),e.viewport(0,0,m,h);{let t=[],n=[],r=OC(e,MC,jC);e.useProgram(r);let a=e.getUniformLocation(r,`u_texture`);e.bindTexture(e.TEXTURE_2D,y),e.uniform1i(a,0),s.getTriangles().forEach(function(e,r,a){let o=e.source,s=e.target,{u1:c,v1:l,u0:u,v0:d,u2:f,v2:p}=T(s),m=(o[0][0]-w[0])/i/b,h=-(o[0][1]-w[1])/i/x,g=(o[1][0]-w[0])/i/b,_=-(o[1][1]-w[1])/i/x,v=(o[2][0]-w[0])/i/b,y=-(o[2][1]-w[1])/i/x;t.push(c,l,u,d,f,p),n.push(g,_,m,h,v,y)});let o=bC(0,m,h,0,-1,1),c=e.getUniformLocation(r,`u_matrix`);e.uniformMatrix4fv(c,!1,o);let l=e.getAttribLocation(r,`a_position`),u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,new Float32Array(t),e.STATIC_DRAW),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(l);let d=e.getAttribLocation(r,`a_texcoord`),f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW),e.vertexAttribPointer(d,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(d),e.drawArrays(e.TRIANGLES,0,t.length/2)}if(d){let t=OC(e,AC,kC);e.useProgram(t);let n=bC(0,m,h,0,-1,1),r=e.getUniformLocation(t,`u_matrix`);e.uniformMatrix4fv(r,!1,n);let i=Array.isArray(d)?d:[0,0,0,255],a=e.getUniformLocation(t,`u_val`);e.uniform4fv(a,i);let o=e.getAttribLocation(t,`a_position`),c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o);let l=s.getTriangles().reduce(function(e,t){let n=t.target,{u1:r,v1:i,u0:a,v0:o,u2:s,v2:c}=T(n);return e.concat([r,i,a,o,a,o,s,c,s,c,r,i])},[]);e.bufferData(e.ARRAY_BUFFER,new Float32Array(l),e.STATIC_DRAW),e.drawArrays(e.LINES,0,l.length/2)}return{width:m,height:h,framebuffer:g,texture:_}}var LC=class extends mx{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.renderEdges_=e.renderEdges===void 0?!1:e.renderEdges,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;let t=e.sourceProj,n=t.getExtent(),r=e.sourceTileGrid.getExtent();this.clipExtent_=t.canWrapX()?r?Sn(n,r):n:r;let i=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),a=this.targetTileGrid_.getExtent(),o=this.sourceTileGrid_.getExtent(),s=a?Sn(i,a):i;if(mn(s)===0){this.state=L.EMPTY;return}n&&(o=o?Sn(o,n):n);let c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),l=e.targetProj,u=xx(t,l,s,c);if(!isFinite(u)||u<=0){this.state=L.EMPTY;return}let d=e.errorThreshold===void 0?Ex:e.errorThreshold;if(this.triangulation_=new Tx(t,l,s,o,u*d,c,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=L.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let f=this.triangulation_.calculateSourceExtent();if(o&&(t.canWrapX()?(f[1]=Mt(f[1],o[1],o[3]),f[3]=Mt(f[3],o[1],o[3])):f=Sn(f,o)),!mn(f))this.state=L.EMPTY;else{let r=0,i=0;t.canWrapX()&&(r=z(n),i=Math.floor((f[0]-n[0])/r)),jn(f.slice(),t,!0).forEach(t=>{let n=this.sourceTileGrid_.getTileRangeForExtentAndZ(t,this.sourceZ_),a=e.getTileFunction;for(let e=n.minX;e<=n.maxX;e++)for(let t=n.minY;t<=n.maxY;t++){let n=a(this.sourceZ_,e,t,this.pixelRatio_);if(n){let e=i*r;this.sourceTiles_.push({tile:n,offset:e})}}++i}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){let e=[],t=!1;if(this.sourceTiles_.forEach(n=>{let r=n.tile;if(!r||r.getState()!==L.LOADED)return;let i=r.getSize(),a=this.gutter_,o,s=lx(r.getData());s?o=s:(t=!0,o=fx(cx(r.getData())));let c=[i[0]+2*a,i[1]+2*a],l=o instanceof Float32Array,u=c[0]*c[1],d=l?Float32Array:Uint8ClampedArray,f=new d(o.buffer),p=d.BYTES_PER_ELEMENT,m=p*f.length/u,h=f.byteLength/c[1],g=Math.floor(h/p/c[0]),_=this.sourceTileGrid_.getTileCoordExtent(r.tileCoord);_[0]+=n.offset,_[2]+=n.offset;let v=this.clipExtent_?.slice();v&&(v[0]+=n.offset,v[2]+=n.offset),e.push({extent:_,clipExtent:v,data:f,dataType:d,bytesPerPixel:m,pixelSize:c,bandCount:g})}),this.sourceTiles_.length=0,e.length===0){this.state=L.ERROR,this.changed();return}let n=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(n),i=typeof r==`number`?r:r[0],a=typeof r==`number`?r:r[1],o=Math.round(i*this.pixelRatio_),s=Math.round(a*this.pixelRatio_),c=this.targetTileGrid_.getResolution(n),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=e[0].bandCount,f=new e[0].dataType(d*o*s),p=NC(o,s,FC,{premultipliedAlpha:!1,antialias:!1}),m,h=p.RGBA,g;e[0].dataType==Float32Array?(g=p.FLOAT,p.getExtension(`WEBGL_color_buffer_float`),p.getExtension(`OES_texture_float`),p.getExtension(`EXT_float_blend`),m=p.getExtension(`OES_texture_float_linear`)!==null&&this.interpolate):(g=p.UNSIGNED_BYTE,m=this.interpolate);let _=Math.ceil(d/4);for(let t=_-1;t>=0;--t){let n=[];for(let r=0,i=e.length;r<i;++r){let i=e[r],a=i.pixelSize,o=a[0],s=a[1],c=new i.dataType(4*o*s),l=i.data,u=t*4;for(let e=0,t=c.length;e<t;e+=4)c[e]=l[u],c[e+1]=l[u+1],c[e+2]=l[u+2],c[e+3]=l[u+3],u+=d;let f=p.createTexture();p.bindTexture(p.TEXTURE_2D,f),m?(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR)):(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST)),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,h,o,s,0,h,g,c),n.push({extent:i.extent,clipExtent:i.clipExtent,texture:f,width:o,height:s})}let{framebuffer:r,width:o,height:s}=IC(p,i,a,this.pixelRatio_,l,c,u,this.triangulation_,n,this.gutter_,g,this.renderEdges_,m),_=o,v=s*4,y=new e[0].dataType(_*v);p.bindFramebuffer(p.FRAMEBUFFER,r),p.readPixels(0,0,o,s,p.RGBA,g,y);let b=t*4;for(let e=0,t=y.length;e<t;e+=4){let t=(_-1-(e/v|0))*v+e%v;f[b]=y[t],f[b+1]=y[t+1],f[b+2]=y[t+2],f[b+3]=y[t+3],b+=d}}if(PC(p),FC.push(p.canvas),t){let e=_o(i,a),t=new ImageData(f,i);e.putImageData(t,0,0),this.reprojData_=e.canvas}else this.reprojData_=f;this.reprojSize_=[o,s],this.state=L.LOADED,this.changed()}load(){if(this.state!==L.IDLE&&this.state!==L.ERROR)return;this.state=L.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n!==L.IDLE&&n!==L.LOADING)return;e++;let r=N(t,M.CHANGE,()=>{let n=t.getState();(n==L.LOADED||n==L.ERROR||n==L.EMPTY)&&(rt(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:e}){e.getState()==L.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(rt),this.sourcesListenerKeys_=null}},RC=class extends cS{constructor(e){let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid;n===void 0&&t&&(n=iS({extent:sS(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:n,state:e.state,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter,this.tileSize_=e.tileSize?hc(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_;let t=this.getTileGrid();return t?hc(t.getTileSize(e)):[256,256]}getGutterForProjection(e){let t=this.getProjection();return(!t||ui(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,n,r,i,a){let o=this.tileGrid||this.getTileGridForProjection(i||r),s=Math.max.apply(null,o.getResolutions().map((e,t)=>{let n=hc(o.getTileSize(t)),r=this.getTileSize(t);return Math.max(r[0]/n[0],r[1]/n[1])})),c=this.getTileGridForProjection(r),l=[e,t,n],u=this.getTileCoordForTileUrlFunction(l,r),d=new LC(Object.assign({sourceProj:i||r,sourceTileGrid:o,targetProj:r,targetTileGrid:c,tileCoord:l,wrappedTileCoord:u,pixelRatio:s,gutter:this.gutter_,getTileFunction:(e,t,n,r)=>this.getTile(e,t,n,r,void 0,a),transformMatrix:this.transformMatrix},this.tileOptions));return d.key=this.getKey(),d}getTile(e,t,n,r,i,a){let o=this.getProjection();if(i&&(o&&!ui(o,i)||this.transformMatrix))return this.getReprojTile_(e,t,n,i,o,a);let s=this.getTileSize(e),c=this.loader_,l=new AbortController,u={signal:l.signal,crossOrigin:this.crossOrigin_},d=this.getTileCoordForTileUrlFunction([e,t,n]);if(!d)return null;let f=this.getKey(),p=jx(this,f,e,t,n);if(a&&a.containsKey(p))return a.get(p);let m=d[0],h=d[1],g=d[2],_=this.getTileGrid()?.getFullTileRange(m);_&&(u.maxY=_.getHeight()-1);function v(){return Ze(function(){return c(m,h,g,u)})}let y=new mx(Object.assign({tileCoord:[e,t,n],loader:v,size:s,controller:l},this.tileOptions));return y.key=this.getKey(),y.addEventListener(M.CHANGE,this.handleTileChange_),a?.set(p,y),y}handleTileChange_(e){let t=e.target,n=F(t),r=t.getState(),i;r==L.LOADING?(this.tileLoadingKeys_[n]=!0,i=NS.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==L.ERROR?NS.TILELOADERROR:r==L.LOADED?NS.TILELOADEND:void 0),i&&this.dispatchEvent(new lS(i,t))}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||ui(t,e))&&!this.transformMatrix)return this.tileGrid;let n=F(e);return n in this.tileGridForProjection_||(this.tileGridForProjection_[n]=tS(e)),this.tileGridForProjection_[n]}setTileGridForProjection(e,t){let n=B(e);if(n){let e=F(n);e in this.tileGridForProjection_||(this.tileGridForProjection_[e]=t)}}},zC=Error(`Image failed to load`);function BC(e,t,n,r,i){return new Promise((a,o)=>{let s=new Image;s.crossOrigin=i.crossOrigin??null,s.addEventListener(`load`,()=>a(s)),s.addEventListener(`error`,()=>o(zC)),s.src=DS(e,t,n,r,i.maxY)})}function VC(e){return function(t,n,r,i){return BC(OS(e,t,n,r),t,n,r,i)}}function HC(e){return function(t,n,r,i){return BC(e(t,n,r,i),t,n,r,i)}}function UC(e){let t;if(Array.isArray(e))t=VC(e);else if(typeof e==`string`)t=VC(kS(e));else if(typeof e==`function`)t=HC(e);else throw Error(`The url option must be a single template, an array of templates, or a function for getting a URL`);return t}var WC=0;function GC(e){return Array.isArray(e)?e.join(`
|
|
92
|
-
`):typeof e==`string`?e:(++WC,`url-function-key-`+WC)}var KC=class extends RC{constructor(e){e||={};let t=e.loader,n;e.url&&(t=UC(e.url),n=GC(e.url));let r=t?e.state:`loading`,i=e.wrapX===void 0?!0:e.wrapX;super({loader:t,key:n,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:i,transition:e.transition,interpolate:e.interpolate!==!1,crossOrigin:e.crossOrigin,zDirection:e.zDirection})}setUrl(e){let t=UC(e);this.setLoader(t),this.setKey(GC(e)),this.getState()!==`ready`&&this.setState(`ready`)}},qC=`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOShgAHAAAAEgAAAISgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAAQVNDSUkAAABTY3JlZW5zaG90/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDShJQ0NfUFJPRklMRQABAQAADRhhcHBsAhAAAG1udHJSR0IgWF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V5v8l/wR1NZgqlmOAOTTqguv+PaX/cb+RqzmitTM8PK40e3lkG17gNOw9GmYyEfhurarP0n/kF2f/XGP/0EVoVMPhRvi3erN+b/ADI/KiznYMn29aBFEuCqAYyRx0z1qSiqOcKzNQS6UpdWkYldFZChOOHK5IPtjOO9adFRUjdWMq9Pmg1cqWIKWscRVl8pQnzAAnaMZwCat0UU4LRDpK0Ugqu1tGXMseY3PUr3+o6H+dWKKbinuVKClujkNUgfT531A232i1fLXMSpvDYH+tReSHAHIH3h33AZ2YLHTrm3jntXcwyqrIY5nClSOCMN0xVu/wD+PKf/AHG/lWZ4V/5FjSP+vSD/ANFinTqzTcUzGm3zuL6F7+y7FiDLH5uP+ejGQfkxIq+AFGFGAKWiqlNvdnRYKKKKkCCdGIEkX+sj5Hv6j8akjkWVFkTowzT6q2X/AB7J+P8AOo+0ZbT9f0sWqKKKs1P/2Q==`,XC=class extends Eo{constructor(e){let t=e||{},n=document.createElement(`button`);n.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">
|
|
80
|
+
`;function iy(e,t,n,r){let i;return i=n&&n.length?n.shift():ht?new OffscreenCanvas(e||300,t||300):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`webgl`,r)}function ay(e){let t=e.canvas;t.width=1,t.height=1,e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)}var oy=[];function sy(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=Math.round(r*t),h=Math.round(r*n);e.canvas.width=m,e.canvas.height=h;let g,_;if(_=e.createTexture(),e.bindTexture(e.TEXTURE_2D,_),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),f?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,m,h,0,e.RGBA,u,null),g=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,g),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,_,0),g===null)throw Error(`Could not create framebuffer`);if(_===null)throw Error(`Could not create texture`);if(c.length===0)return{width:m,height:h,framebuffer:g,texture:_};let v=$t();c.forEach(function(e,t,n){on(v,e.extent)});let y,b,x,S=1/i;if(!p||c.length!==1||l!==0){if(y=e.createTexture(),_===null)throw Error(`Could not create texture`);b=Math.round(V(v)*S),x=Math.round(vn(v)*S);let t=e.getParameter(e.MAX_TEXTURE_SIZE),n=Math.max(b,x),r=n>t?t/n:1,i=Math.round(b*r),a=Math.round(x*r);e.bindTexture(e.TEXTURE_2D,y),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),f?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,i,a,0,e.RGBA,u,null);let o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,y,0);let s=new Zv(e);c.forEach(function(t,n,c){let u=(t.extent[0]-v[0])*S*r,d=-(t.extent[3]-v[3])*S*r,p=V(t.extent)*S*r,m=vn(t.extent)*S*r;if(e.bindFramebuffer(e.FRAMEBUFFER,o),e.viewport(0,0,i,a),t.clipExtent){let n=(t.clipExtent[0]-v[0])*S*r,i=-(t.clipExtent[3]-v[3])*S*r,a=V(t.clipExtent)*S*r,o=vn(t.clipExtent)*S*r;e.enable(e.SCISSOR_TEST),e.scissor(f?n:Math.round(n),f?i:Math.round(i),f?a:Math.round(n+a)-Math.round(n),f?o:Math.round(i+o)-Math.round(i))}s.drawImage(t.texture,t.width,t.height,l,l,t.width-2*l,t.height-2*l,f?u:Math.round(u),f?d:Math.round(d),f?p:Math.round(u+p)-Math.round(u),f?m:Math.round(d+m)-Math.round(d),i,a),e.disable(e.SCISSOR_TEST)}),e.deleteFramebuffer(o)}else y=c[0].texture,b=c[0].width,x=c[0].width;let C=xn(o),w=xn(v),T=e=>{let t=(e[0][0]-C[0])/a*r,n=-(e[0][1]-C[1])/a*r;return{u1:(e[1][0]-C[0])/a*r,v1:-(e[1][1]-C[1])/a*r,u0:t,v0:n,u2:(e[2][0]-C[0])/a*r,v2:-(e[2][1]-C[1])/a*r}};e.bindFramebuffer(e.FRAMEBUFFER,g),e.viewport(0,0,m,h);{let t=[],n=[],r=$v(e,ry,ny);e.useProgram(r);let a=e.getUniformLocation(r,`u_texture`);e.bindTexture(e.TEXTURE_2D,y),e.uniform1i(a,0),s.getTriangles().forEach(function(e,r,a){let o=e.source,s=e.target,{u1:c,v1:l,u0:u,v0:d,u2:f,v2:p}=T(s),m=(o[0][0]-w[0])/i/b,h=-(o[0][1]-w[1])/i/x,g=(o[1][0]-w[0])/i/b,_=-(o[1][1]-w[1])/i/x,v=(o[2][0]-w[0])/i/b,y=-(o[2][1]-w[1])/i/x;t.push(c,l,u,d,f,p),n.push(g,_,m,h,v,y)});let o=Gv(0,m,h,0,-1,1),c=e.getUniformLocation(r,`u_matrix`);e.uniformMatrix4fv(c,!1,o);let l=e.getAttribLocation(r,`a_position`),u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,new Float32Array(t),e.STATIC_DRAW),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(l);let d=e.getAttribLocation(r,`a_texcoord`),f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW),e.vertexAttribPointer(d,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(d),e.drawArrays(e.TRIANGLES,0,t.length/2)}if(d){let t=$v(e,ty,ey);e.useProgram(t);let n=Gv(0,m,h,0,-1,1),r=e.getUniformLocation(t,`u_matrix`);e.uniformMatrix4fv(r,!1,n);let i=Array.isArray(d)?d:[0,0,0,255],a=e.getUniformLocation(t,`u_val`);e.uniform4fv(a,i);let o=e.getAttribLocation(t,`a_position`),c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o);let l=s.getTriangles().reduce(function(e,t){let n=t.target,{u1:r,v1:i,u0:a,v0:o,u2:s,v2:c}=T(n);return e.concat([r,i,a,o,a,o,s,c,s,c,r,i])},[]);e.bufferData(e.ARRAY_BUFFER,new Float32Array(l),e.STATIC_DRAW),e.drawArrays(e.LINES,0,l.length/2)}return{width:m,height:h,framebuffer:g,texture:_}}var cy=[256,256],ly=class extends I_{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,this.hasAlpha_=e.hasAlpha===void 0||e.hasAlpha,this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=null,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;let t=e.sourceProj,n=t.getExtent(),r=e.sourceTileGrid.getExtent();this.clipExtent_=t.canWrapX()?r?yn(n,r):n:r||null;let i=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),a=this.targetTileGrid_.getExtent(),o=this.sourceTileGrid_.getExtent(),s=a?yn(i,a):i;if(dn(s)===0){this.state=z.EMPTY;return}n&&(o=o?yn(o,n):n);let c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),l=e.targetProj,u=q_(t,l,s,c);if(!isFinite(u)||u<=0){this.state=z.EMPTY;return}let d=e.errorThreshold===void 0?Q_:e.errorThreshold;if(this.triangulation_=new Z_(t,l,s,o||void 0,u*d,c,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=z.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let f=this.triangulation_.calculateSourceExtent();if(o&&(t.canWrapX()?(f[1]=kt(f[1],o[1],o[3]),f[3]=kt(f[3],o[1],o[3])):f=yn(f,o)),!dn(f))this.state=z.EMPTY;else{let r=0,i=0;t.canWrapX()&&(r=V(n),i=Math.floor((f[0]-n[0])/r)),kn(f.slice(),t,!0).forEach(t=>{let n=this.sourceTileGrid_.getTileRangeForExtentAndZ(t,this.sourceZ_),a=e.getTileFunction;for(let e=n.minX;e<=n.maxX;e++)for(let t=n.minY;t<=n.maxY;t++){let n=a(this.sourceZ_,e,t,this.pixelRatio_);if(n){let e=i*r;this.sourceTiles_.push({tile:n,offset:e})}}++i}),this.sourceTiles_.length===0&&(this.state=z.EMPTY)}}getSize(){return this.reprojSize_||cy}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){let e=[],t=!1;if(this.sourceTiles_.forEach(n=>{let r=n.tile;if(!r||r.getState()!==z.LOADED)return;let i=r.getSize(),a=this.gutter_,o,s=r.getData();if(!s)return;let c=j_(s);if(c)o=c;else{t=!0;let e=A_(s);if(!e)return;o=P_(e)}let l=[i[0]+2*a,i[1]+2*a],u=o instanceof Float32Array,d=l[0]*l[1],f=u?Float32Array:Uint8ClampedArray,p=new f(o.buffer),m=f.BYTES_PER_ELEMENT,h=m*p.length/d,g=p.byteLength/l[1],_=Math.floor(g/m/l[0]),v=this.sourceTileGrid_.getTileCoordExtent(r.tileCoord);v[0]+=n.offset,v[2]+=n.offset;let y=this.clipExtent_?.slice();y&&(y[0]+=n.offset,y[2]+=n.offset),e.push({extent:v,clipExtent:y,data:p,dataType:f,bytesPerPixel:h,pixelSize:l,bandCount:_})}),this.sourceTiles_.length=0,e.length===0){this.state=z.ERROR,this.changed();return}let n=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(n),i=typeof r==`number`?r:r[0],a=typeof r==`number`?r:r[1],o=Math.round(i*this.pixelRatio_),s=Math.round(a*this.pixelRatio_),c=this.targetTileGrid_.getResolution(n),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=e[0].bandCount,f=this.hasAlpha_?-1:d,p=this.hasAlpha_?d:d+1,m=new e[0].dataType(p*o*s),h=iy(o,s,oy,{premultipliedAlpha:!1,antialias:!1}),g,_=h.RGBA,v;e[0].dataType==Float32Array?(v=h.FLOAT,h.getExtension(`WEBGL_color_buffer_float`),h.getExtension(`OES_texture_float`),h.getExtension(`EXT_float_blend`),g=h.getExtension(`OES_texture_float_linear`)!==null&&this.interpolate):(v=h.UNSIGNED_BYTE,g=this.interpolate);let y=e[0].dataType===Float32Array?1:255,b=Math.ceil(p/4);for(let t=b-1;t>=0;--t){let n=[],r=t*4;for(let t=0,i=e.length;t<i;++t){let i=e[t],a=i.pixelSize,o=a[0],s=a[1],c=i.data,l=new i.dataType(4*o*s);for(let e=0,t=0,n=l.length;e<n;e+=4){for(let n=0;n<4;++n){let i=r+n;if(i===f)l[e+n]=y;else if(i<d){let r=c[t*d+i];l[e+n]=r}}++t}let u=h.createTexture();h.bindTexture(h.TEXTURE_2D,u),g?(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.LINEAR),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.LINEAR)):(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.NEAREST)),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texImage2D(h.TEXTURE_2D,0,_,o,s,0,_,v,l),n.push({extent:i.extent,clipExtent:i.clipExtent,texture:u,width:o,height:s})}let{framebuffer:o,width:s,height:b}=sy(h,i,a,this.pixelRatio_,l,c,u,this.triangulation_,n,this.gutter_,v,this.renderEdges_,g),x=s,S=b*4,C=new e[0].dataType(x*S);h.bindFramebuffer(h.FRAMEBUFFER,o),h.readPixels(0,0,s,b,h.RGBA,v,C);for(let e=0,t=0,n=C.length;e<n;e+=4){let n=(x-1-(e/S|0))*S+e%S;for(let e=0;e<4;++e){let i=r+e;i<p&&(m[t*p+i]=C[n+e])}++t}}if(ay(h),oy.push(h.canvas),t){let e=yo(i,a);e.putImageData(e.createImageData(o,s),0,0);let t=e.getImageData(0,0,o,s);t.data.set(m),e.putImageData(t,0,0),this.reprojData_=e.canvas}else this.reprojData_=m;this.reprojSize_=[o,s],this.state=z.LOADED,this.changed()}load(){if(this.state!==z.IDLE&&this.state!==z.ERROR)return;this.state=z.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n!==z.IDLE&&n!==z.LOADING)return;e++;let r=P(t,F.CHANGE,()=>{let n=t.getState();(n==z.LOADED||n==z.ERROR||n==z.EMPTY)&&(Le(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:e}){e.getState()==z.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_&&=(this.sourcesListenerKeys_.forEach(Le),null)}},uy=class extends cv{constructor(e){let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid;n===void 0&&t&&(n=J0({extent:Z0(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:n,state:e.state,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter,this.tileSize_=e.tileSize?vc(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.hasAlpha=e.hasAlpha===void 0?this.bandCount===2||this.bandCount===4:e.hasAlpha,this.nodataBandIndex,this.tileGridForProjection_={},this.crossOrigin_=e.crossOrigin||`anonymous`,this.referrerPolicy_=e.referrerPolicy,this.transformMatrix=null}setTileSizes(e){this.tileSizes_=e}getTileSize(e){if(this.tileSizes_)return this.tileSizes_[e];if(this.tileSize_)return this.tileSize_;let t=this.getTileGrid();return t?vc(t.getTileSize(e)):[256,256]}getGutterForProjection(e){let t=this.getProjection();return(!t||di(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,n,r,i,a){let o=this.tileGrid||this.getTileGridForProjection(i||r),s=Math.max.apply(null,o.getResolutions().map((e,t)=>{let n=vc(o.getTileSize(t)),r=this.getTileSize(t);return Math.max(r[0]/n[0],r[1]/n[1])})),c=this.getTileGridForProjection(r),l=[e,t,n],u=this.getTileCoordForTileUrlFunction(l,r),d=new ly(Object.assign({sourceProj:i||r,sourceTileGrid:o,targetProj:r,targetTileGrid:c,tileCoord:l,wrappedTileCoord:u,pixelRatio:s,gutter:this.gutter_,hasAlpha:this.hasAlpha,getTileFunction:(e,t,n,r)=>this.getTile(e,t,n,r,void 0,a),transformMatrix:this.transformMatrix},this.tileOptions));return d.key=this.getKey(),d}getTile(e,t,n,r,i,a){let o=this.getProjection();if(i&&(o&&!di(o,i)||this.transformMatrix))return this.getReprojTile_(e,t,n,i,o||i,a);let s=this.getTileSize(e),c=this.loader_;if(!c)return null;let l=new AbortController,u={signal:l.signal,crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},d=this.getTileCoordForTileUrlFunction([e,t,n]);if(!d)return null;let f=this.getKey(),p=r1(this,f,e,t,n);if(a&&a.containsKey(p))return a.get(p);let m=d[0],h=d[1],g=d[2],_=this.getTileGrid()?.getFullTileRange(m);_&&(u.maxY=_.getHeight()-1);function v(){return c?$e(function(){return c(m,h,g,u)}):Promise.reject(Error(`Missing tile loader`))}let y=new I_(Object.assign({tileCoord:[e,t,n],loader:v,size:s,controller:l},this.tileOptions));return y.key=this.getKey(),y.addEventListener(F.CHANGE,this.handleTileChange_),a?.set(p,y),y}handleTileChange_(e){let t=e.target,n=L(t),r=t.getState(),i;r==z.LOADING?(this.tileLoadingKeys_[n]=!0,i=uv.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==z.ERROR?uv.TILELOADERROR:r==z.LOADED?uv.TILELOADEND:void 0),i&&this.dispatchEvent(new lv(i,t))}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||di(t,e))&&!this.transformMatrix)return this.tileGrid;let n=L(e);if(!(n in this.tileGridForProjection_)){if(this.tileGrid&&t&&!di(t,e)){let r=this.tileGrid.getResolutions(),i=r[r.length-1],a=t.getMetersPerUnit()||1,o=e.getMetersPerUnit()||1,s=i*a/o,c=Z0(e),l=Math.max(V(c)/256,vn(c)/256),u=Math.max(0,Math.ceil(Math.log2(l/s))+1);this.tileGridForProjection_[n]=X0(e,u)}else this.tileGridForProjection_[n]=G0(e)}return this.tileGridForProjection_[n]}setTileGridForProjection(e,t){let n=H(e);if(n){let e=L(n);e in this.tileGridForProjection_||(this.tileGridForProjection_[e]=t)}}};function dy(e){return Array.isArray(e)?Math.min(...e):e}var fy=class extends Sl{constructor(e,t,n,r,i,a,o){let s=e.getExtent();s&&e.canWrapX()&&(s=s.slice(),s[0]=-1/0,s[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);let l=c?yn(n,c):n,u=K_(e,t,mn(l),r),d=new Z_(e,t,l,s,u*Q_,r),f=d.calculateSourceExtent(),p=wn(f)?null:a(f,u,i),m=p?q.IDLE:q.EMPTY,h=p?p.getPixelRatio():1;super(n,r,h,m),this.targetProj_=t,this.maxSourceExtent_=s,this.triangulation_=d,this.targetResolution_=r,this.targetExtent_=n,this.sourceImage_=p,this.sourcePixelRatio_=h,this.interpolate_=o,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==q.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){let e=this.sourceImage_;if(!e)return;let t=e.getState();if(t==q.LOADED){let t=V(this.targetExtent_)/this.targetResolution_,n=vn(this.targetExtent_)/this.targetResolution_,r=e.getImage();if(!r)return;this.canvas_=J_(t,n,this.sourcePixelRatio_,dy(e.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:e.getExtent(),image:r}],0,void 0,this.interpolate_,!0)}this.state=t,this.changed()}load(){if(this.state==q.IDLE){let e=this.sourceImage_;if(!e)return;this.state=q.LOADING,this.changed();let t=e.getState();t==q.LOADED||t==q.ERROR?this.reproject_():(this.sourceListenerKey_=P(e,F.CHANGE,()=>{let t=e.getState();(t==q.LOADED||t==q.ERROR)&&(this.unlistenSource_(),this.reproject_())}),e.load())}}unlistenSource_(){Le(this.sourceListenerKey_),this.sourceListenerKey_=null}},py={IMAGELOADSTART:`imageloadstart`,IMAGELOADEND:`imageloadend`,IMAGELOADERROR:`imageloaderror`},my=class extends et{constructor(e,t){super(e),this.image=t}},hy=class extends z0{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate===void 0||e.interpolate}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions===void 0?null:e.resolutions,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){let t=this.getResolutions();return t&&(e=t[He(t,e,0)]),e}getImage(e,t,n,r){let i=this.getProjection();if(!i||!r||di(i,r))return i&&(r=i),this.getImageInternal(e,t,n,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&di(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&an(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new fy(i,r,e,t,n,(e,t,n)=>this.getImageInternal(e,t,n,i),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,n,r){if(this.loader){let i=gy(e,t,n,1),a=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Xt(this.wantedExtent_,i)||Xt(this.image.getExtent(),i))&&(this.wantedResolution_&&dy(this.wantedResolution_)===a||dy(this.image.getResolution())===a)))return this.image;this.wantedProjection_=r,this.wantedExtent_=i,this.wantedResolution_=a,this.image=new Sl(i,a,n,this.loader),this.image.addEventListener(F.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){let t=e.target,n;switch(t.getState()){case q.LOADING:this.loading=!0,n=py.IMAGELOADSTART;break;case q.LOADED:this.loading=!1,n=py.IMAGELOADEND;break;case q.ERROR:this.loading=!1,n=py.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new my(n,t))}};function gy(e,t,n,r){let i=t/n,a=mn(e),o=zt(V(e)/i,4),s=zt(vn(e)/i,4);return gn(a,i,0,[o+2*zt((r-1)*o/2,4),s+2*zt((r-1)*s/2,4)])}var _y=Error(`Image failed to load`);function vy(e,t,n,r,i){return new Promise((a,o)=>{let s=new Image;s.crossOrigin=i.crossOrigin??null,i.referrerPolicy!==void 0&&(s.referrerPolicy=i.referrerPolicy),s.addEventListener(`load`,()=>a(s)),s.addEventListener(`error`,()=>o(_y)),s.src=nv(e,t,n,r,i.maxY)})}function yy(e){return function(t,n,r,i){return vy(rv(e,t,n,r),t,n,r,i)}}function by(e){return function(t,n,r,i){return vy(e(t,n,r,i),t,n,r,i)}}function xy(e){let t;if(Array.isArray(e))t=yy(e);else if(typeof e==`string`)t=yy(iv(e));else if(typeof e==`function`)t=by(e);else throw Error(`The url option must be a single template, an array of templates, or a function for getting a URL`);return t}var Sy=0;function Cy(e){return Array.isArray(e)?e.join(`
|
|
81
|
+
`):typeof e==`string`?e:(++Sy,`url-function-key-`+Sy)}var wy=class extends uy{constructor(e){e||={};let t=e.loader,n=``;e.url&&(t=xy(e.url),n=Cy(e.url));let r=t?e.state??`ready`:`loading`,i=e.wrapX===void 0||e.wrapX;super({loader:t,key:n,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:i,transition:e.transition,interpolate:e.interpolate!==!1,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,zDirection:e.zDirection})}setUrl(e){let t=xy(e);this.setLoader(t),this.setKey(Cy(e)),this.getState()!==`ready`&&this.setState(`ready`)}};function Ty(e){function t(e,t){switch(e){case`Float32Array`:return new Float32Array(t);case`Float64Array`:return new Float64Array(t);case`Int8Array`:return new Int8Array(t);case`Int16Array`:return new Int16Array(t);case`Int32Array`:return new Int32Array(t);case`Uint16Array`:return new Uint16Array(t);case`Uint32Array`:return new Uint32Array(t);case`Uint8Array`:return new Uint8Array(t);default:return new Uint8ClampedArray(t)}}return function(n){let r=n.buffers,i=n.meta,a=n.imageOps,o=n.width,s=n.height,c=n.bandCounts,l=n.dtypes,u=r.length;if(a){let t=Array(u);for(let e=0;e<u;++e)t[e]=new ImageData(new Uint8ClampedArray(r[e]),o,s);return e(t,i).data.buffer}let d=Array(u),f=Array(u);for(let e=0;e<u;++e)d[e]=t(l[e],r[e]),f[e]=Array(c[e]);let p=d[0].length/c[0],m=new Uint8ClampedArray(p*4);for(let t=0;t<p;++t){for(let e=0;e<u;++e){let n=d[e],r=c[e],i=f[e],a=t*r;for(let e=0;e<r;++e)i[e]=n[a+e]}let n=e(f,i),r=t*4;m[r]=n[0],m[r+1]=n[1],m[r+2]=n[2],m[r+3]=n[3]}return m.buffer}}function Ey(e,t){let n=Object.keys(e.lib||{}).map(function(t){return`const `+t+` = `+e.lib?.[t].toString()+`;`}).concat([`const __minion__ = (`+Ty.toString()+`)(`,e.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(n.join(`
|
|
82
|
+
`),`binary`).toString(`base64`):URL.createObjectURL(new Blob(n,{type:`text/javascript`})));return r.addEventListener(`message`,t),r}function Dy(e,t){let n=Ty(e.operation),r=!1;return{postMessage:function(e){setTimeout(function(){r||t({data:{buffer:n(e),meta:e.meta}})},0)},terminate:function(){r=!0}}}function Oy(e){return`bandCount`in e?e:{data:e.data,width:e.width,height:e.height,bandCount:4}}function ky(e,t,n,r){let i=e.data.buffer;if(r===1)return i;let a=e.bandCount*e.data.BYTES_PER_ELEMENT,o=Math.min(t*a,i.byteLength),s=Math.min((t+n)*a,i.byteLength);return i.slice(o,s)}var Ay=class extends Re{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;t=e.threads===0?0:this.imageOps_?1:e.threads||1;let n=Array(t);if(t)for(let r=0;r<t;++r)n[r]=Ey(e,this.onWorkerMessage_.bind(this,r));else n[0]=Dy(e,this.onWorkerMessage_.bind(this,0));this.workers_=n,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,n){this.enqueue_({inputs:e.map(Oy),meta:t,callback:n}),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;let e=this.queue_.shift();if(!e)return;this.job_=e;let t=e.inputs,n=t[0].width,r=t[0].height,i=this.workers_.length;this.running_=i;let a={meta:e.meta,imageOps:this.imageOps_,width:n,height:r,bandCounts:t.map(e=>e.bandCount),dtypes:t.map(e=>e.data.constructor.name)},o=Math.ceil(n*r/i);for(let e=0;e<i;++e){let n=t.map(t=>ky(t,e*o,o,i));this.workers_[e].postMessage(Object.assign({buffers:n},a),n)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){let e=this.job_;if(!e)return;let t=e.inputs[0].width,n=e.inputs[0].height,r=this.workers_.length,i,a;if(r===1)i=new Uint8ClampedArray(this.dataLookup_[0].buffer),a=this.dataLookup_[0].meta;else{let e=t*n;i=new Uint8ClampedArray(e*4),a=Array(r);let o=4*Math.ceil(e/r);for(let e=0;e<r;++e){let t=this.dataLookup_[e].buffer,n=e*o;i.set(new Uint8ClampedArray(t),n),a[e]=this.dataLookup_[e].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(i,t,n),a),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}},jy={BEFOREOPERATIONS:`beforeoperations`,AFTEROPERATIONS:`afteroperations`},My=class extends et{constructor(e,t,n){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=n}},Ny=class extends hy{constructor(e){super({interpolate:e.interpolate,projection:void 0}),this.on,this.once,this.un,this.processor_=void 0,this.operationType_=e.operationType===void 0?`pixel`:e.operationType,this.threads_=e.threads===void 0?1:e.threads,this.layers_=Ry(e.sources),this.sampleArrayData_=e.sources.map(e=>e instanceof z0&&Fy(e));let t=this.changed.bind(this);for(let e=0,n=this.layers_.length;e<n;++e)this.layers_[e].addEventListener(F.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new Tt(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=void 0,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:Di(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:Ly(this.layers_),pixelRatio:1,pixelToCoordinateTransform:Di(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:L(this),renderTargets:{}},this.setAttributions(function(t){let n=[];for(let r=0,i=e.sources.length;r<i;++r){let i=e.sources[r],a=i instanceof z0?i:i.getSource();if(!a)continue;let o=a.getAttributions()?.(t);typeof o==`string`?n.push(o):o!==void 0&&n.push(...o)}return n}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new Ay({operation:e,imageOps:this.operationType_===`image`,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,n){let r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);let i=Math.floor(e[0]/t)*t,a=Math.floor(e[1]/t)*t,o=Math.ceil(e[2]/t)*t,s=Math.ceil(e[3]/t)*t;r.size[0]=Math.round((o-i)/t),r.size[1]=Math.round((s-a)/t),r.extent=[i,a,o,s],r.time=Date.now();let c=r.viewState;return c.center=mn(r.extent),c.projection=n,c.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let n=0,r=this.layers_.length;n<r;++n)if(t=this.layers_[n].getSource(),!t||t.getState()!==`ready`){e=!1;break}return e}getImage(e,t,n,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16);let i=this.getResolutions(r);if(i){let e=i[0];t=t>e?e*2**Math.round(Math.log2(t/e)):i[He(i,t,0)]}let a=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=a,this.renderedImageCanvas_){let e=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();t===e&&an(a.extent,n)||(this.renderedImageCanvas_=void 0)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),(this.tileQueue_.getCount()>0||this.tileQueue_.getTilesLoading()>0)&&(a.animate=!0),a.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_??null}getInput_(e,t){let n=this.layers_[e];if(this.sampleArrayData_[e]){let e=n.getRenderer();return e.prepareFrame(t)?e.readData(t):null}return t.layerIndex=e,t.renderTargets={},Iy(n,t)}getData(e){let t=this.requestedFrameState_;if(!t)return null;let n=Array(this.layers_.length);for(let r=0,i=this.layers_.length;r<i;++r){let i=this.layers_[r];if(this.sampleArrayData_[r]){let a=i.getRenderer(),o=t.viewState.resolution,s=Object.assign({},t,{extent:[e[0]-o/2,e[1]-o/2,e[0]+o/2,e[1]+o/2],size:[1,1]}),c=a.readData(s);if(!c)return null;let l=Array(c.bandCount);for(let e=0;e<c.bandCount;++e)l[e]=c.data[e];n[r]=l;continue}let a=i.getRenderer()?.getData(Mi(t.coordinateToPixelTransform,e.slice()));if(!a)return null;n[r]=a}return n}processSources_(){let e=this.requestedFrameState_,t=this.layers_.length,n=Array(t),r=Array(t);for(let i=0;i<t;++i){let t=this.layers_[i].getSource();if(!t)return;n[i]=t.getRevision();let a=this.getInput_(i,e);if(!a)return;r[i]=a}let i={};this.dispatchEvent(new My(jy.BEFOREOPERATIONS,e,i)),this.processor_?.process(r,i,this.onWorkerComplete_.bind(this,e,n))}onWorkerComplete_(e,t,n,r,i){if(n||!r)return;let a=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!an(a,this.requestedFrameState_.extent))return;for(let e=0;e<this.layers_.length;++e){let n=this.layers_[e].getSource();if(!n||t[e]!==n.getRevision())return}let s;this.renderedImageCanvas_?s=this.renderedImageCanvas_.getImage().getContext(`2d`):(s=yo(e.size[0],e.size[1]),this.renderedImageCanvas_=new Uv(a,o,1,s.canvas)),s.putImageData(r,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new My(jy.AFTEROPERATIONS,e,i))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let n=0,r=this.layers_.length;n<r;++n){let r=this.layers_[n].getSource();if(r&&(t=r.getResolutions(e),t))break}return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}};Ny.prototype.dispose;var Py=void 0;function Fy(e){return e instanceof uy&&!(e instanceof wy)}function Iy(e,t){let n=e.getRenderer();if(!n)throw Error(`Unsupported layer type: `+e);if(!n.prepareFrame(t))return null;let r=t.size[0],i=t.size[1];if(r===0||i===0)return null;let a=n.renderFrame(t,null),o;if(a instanceof HTMLCanvasElement)o=a;else{if(a&&(o=a.firstElementChild),!(o instanceof HTMLCanvasElement))throw Error(`Unsupported rendered element: `+o);if(o.width===r&&o.height===i){let e=o.getContext(`2d`);if(e)return e.getImageData(0,0,r,i)}}if(!Py)Py=yo(r,i,void 0,{willReadFrequently:!0});else{let e=Py.canvas;e.width!==r||e.height!==i?Py=yo(r,i,void 0,{willReadFrequently:!0}):Py.clearRect(0,0,r,i)}return Py.drawImage(o,0,0,r,i),Py.getImageData(0,0,r,i)}function Ly(e){return e.map(function(e){return e.getLayerState()})}function Ry(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=zy(e[r]);return n}function zy(e){let t;if(e instanceof z0){if(e instanceof cv)t=new b1({source:e});else if(e instanceof hy)t=new Hv({source:e});else throw Error(`Unsupported source type: `+e)}else t=e;return t}function By(e,t){let n=e[0],r=n.width,i=n.height,a=n.data,o=new Uint8ClampedArray(a.length),s=t.resolution*2,c=r-1,l=i-1,u=[0,0,0,0],d=Math.PI,f=t.encoding,p=t.exaggeration,m=t.zoom,h=t.method||`standard`,g=t.accentColor,_=t.shadowColors||[t.shadowColor],v=t.highlightColors||[t.highlightColor],y=(t.azimuths||[t.sunAz]).map(e=>e*d/180),b=(t.altitudes||[45]).map(e=>e*d/180),x=Math.min(y.length,b.length,_.length,v.length,4),S=m<2?.4:m<4.5?.35:.3,C=m<15?2**((15-m)*S):1;function w(e,t=`mapbox`){return t===`mapbox`?(e[0]*256*256+e[1]*256+e[2])*.1-1e4:t===`terrarium`?e[0]*256+e[1]+e[2]/256-32768:0}function T(e,t){return e===0?d/2*(t>0?1:-1):Math.atan2(t,-e)}function E(e,t){let n=y[0]+d,r=Math.atan(.625*Math.sqrt(e*e+t*t)),i=T(e,t),a=1.875-p*1.75,o=.5*d,s=p===.5?r:(a**+r-1)/(a**+o-1)*o,c=Math.cos(s),l=Math.min(Math.max(p*2,0),1),u=(1-c)*l,f=g,m=f.r*u,h=f.g*u,b=f.b*u,x=f.a*u,S=(i+n)/d+.5;S%=2,S<0&&(S+=2);let C=Math.abs(S-1),w=Math.sin(s)*l,E=_[0],D=v[0],O=(E.r*(1-C)+D.r*C)*w,k=(E.g*(1-C)+D.g*C)*w,A=(E.b*(1-C)+D.b*C)*w,ee=(E.a*(1-C)+D.a*C)*w;return[m*(1-ee)+O,h*(1-ee)+k,b*(1-ee)+A,x*(1-ee)+ee]}function D(e,t){e*=p*2,t*=p*2;let n=T(e,t),r=y[0]+d,i=Math.atan(Math.sqrt(e*e+t*t))*(2/d),a=(n+r)/d+.5;a%=2,a<0&&(a+=2);let o=1-Math.abs(a-1),s=i*o,c=i*(1-o),l=_[0],u=v[0];return[l.r*s+u.r*c,l.g*s+u.g*c,l.b*s+u.b*c,l.a*s+u.a*c]}function O(e,t){e*=p*2,t*=p*2;let n=y[0]+d,r=Math.cos(n),i=Math.sin(n),a=Math.cos(b[0]),o=(Math.sin(b[0])-(t*r*a-e*i*a))/Math.sqrt(1+e*e+t*t),s=Math.max(0,Math.min(1,o));if(s>.5){let e=2*s-1,t=v[0];return[t.r*e,t.g*e,t.b*e,t.a*e]}let c=1-2*s,l=_[0];return[l.r*c,l.g*c,l.b*c,l.a*c]}function k(e,t){e*=p*2,t*=p*2;let n=y[0]+d,r=Math.cos(n),i=Math.sin(n),a=Math.cos(b[0]),o=Math.sin(b[0]),s=Math.acos((o-(t*r*a-e*i*a))/Math.sqrt(1+e*e+t*t));s=Math.max(0,Math.min(d/2,s));let c=Math.atan(Math.sqrt(e*e+t*t))*(4/d/d),l=s*c,u=(d/2-s)*c,f=_[0],m=v[0];return[f.r*l+m.r*u,f.g*l+m.g*u,f.b*l+m.b*u,f.a*l+m.a*u]}function A(e,t){e*=p*2,t*=p*2;let n=e*e+t*t,r=Math.sqrt(1+n),i=0,a=0,o=0,s=0;for(let n=0;n<x;n++){let c=Math.cos(b[n]),l=Math.sin(b[n]),u=-Math.cos(y[n]),d=-Math.sin(y[n]),f=(l-(t*u*c-e*d*c))/r,p=Math.max(0,Math.min(1,f)),m=_[Math.min(n,_.length-1)],h=v[Math.min(n,v.length-1)];if(p>.5){let e=(2*p-1)/x;i+=h.r*e,a+=h.g*e,o+=h.b*e,s+=h.a*e}else{let e=(1-2*p)/x;i+=m.r*e,a+=m.g*e,o+=m.b*e,s+=m.a*e}}return[i,a,o,s]}let ee=h===`igor`?D:h===`basic`?O:h===`combined`?k:h===`multidirectional`?A:E,j,M,te,ne,re,ie,N,ae,oe,se,ce;for(M=0;M<=l;++M)for(re=M===0?0:M-1,ie=M===l?l:M+1,j=0;j<=c;++j){te=j===0?0:j-1,ne=j===c?c:j+1,N=(M*r+te)*4,u[0]=a[N],u[1]=a[N+1],u[2]=a[N+2],u[3]=a[N+3],ae=w(u,f),N=(M*r+ne)*4,u[0]=a[N],u[1]=a[N+1],u[2]=a[N+2],u[3]=a[N+3],oe=w(u,f),se=(oe-ae)/s*C,N=(re*r+j)*4,u[0]=a[N],u[1]=a[N+1],u[2]=a[N+2],u[3]=a[N+3],ae=w(u,f),N=(ie*r+j)*4,u[0]=a[N],u[1]=a[N+1],u[2]=a[N+2],u[3]=a[N+3],oe=w(u,f),ce=(oe-ae)/s*C;let e=ee(se,ce),t=e[3];N=(M*r+j)*4,t>0&&(o[N]=e[0]/t*255,o[N+1]=e[1]/t*255,o[N+2]=e[2]/t*255),o[N+3]=t*255}return new ImageData(o,r,i)}function Vy(e,t){let n=e[0],r=n.width,i=n.height,a=n.data,o=new Uint8ClampedArray(a.length),s=r-1,c=i-1,l=[0,0,0,0],u,d,f;function p(e){return e>0?1/(1-e):1+e}function m(e){return e>0?1-1/(1.001-e):-e}function h(e){e*=Math.PI/180;let t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let g=m(t.saturation),_=p(t.contrast),v=h(t.hueRotate),y=v,b=[v[2],v[0],v[1]],x=[v[1],v[2],v[0]],S=t.brightnessLow,C=t.brightnessHigh;for(d=0;d<=c;++d)for(u=0;u<=s;++u){f=(d*r+u)*4,l[0]=a[f],l[1]=a[f+1],l[2]=a[f+2],l[3]=a[f+3];let e=l[0],t=l[1],n=l[2],i=(e,t)=>{let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n},s=i([e,t,n],y),c=i([e,t,n],b),p=i([e,t,n],x),m=(s+c+p)/3;s+=(m-s)*g,c+=(m-c)*g,p+=(m-p)*g,s=(s-127.5)*_+127.5,c=(c-127.5)*_+127.5,p=(p-127.5)*_+127.5,s=S*(255-s)+C*s,c=S*(255-c)+C*c,p=S*(255-p)+C*p,o[f]=s,o[f+1]=c,o[f+2]=p,o[f+3]=l[3]}return new ImageData(o,r,i)}var Hy=$d,Uy={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},Wy=` `,Gy=/(italic|oblique)$/i,Ky={};function qy(e,t,n){var r=Ky[e];if(!r){Array.isArray(e)||(e=[e]);for(var i=400,a=`normal`,o=[],s,c,l=0,u=e.length;l<u;++l){var d=e[l].split(` `),f=d[d.length-1].toLowerCase();for(var p in f==`normal`||f==`italic`||f==`oblique`?(a=c?a:f,c=!0,d.pop(),f=d[d.length-1].toLowerCase()):Gy.test(f)&&(f=f.replace(Gy,``),a=c?a:d[d.length-1].replace(f,``),c=!0),Uy){var m=d.length>1?d[d.length-2].toLowerCase():``;if(f==p||f==p.replace(`-`,``)||m+`-`+f==p){i=s?i:Uy[p],d.pop(),m&&p.startsWith(m)&&d.pop();break}}!s&&typeof f==`number`&&(i=f,s=!0);var h=d.join(Wy).replace(`Klokantech Noto Sans`,`Noto Sans`).replace(`DIN Pro`,`Barlow`).replace(`Arial Unicode MS`,`Arial`);h.indexOf(Wy)!==-1&&(h=`"`+h+`"`),o.push(h)}r=Ky[e]=[a,i,o]}return r[0]+Wy+r[1]+Wy+t+`px`+(n?`/`+n:``)+Wy+r[2]}var Jy=Object.freeze({}),Yy=new WeakMap,Xy=new WeakMap;function Zy(e,t){let n=e.get(t);return n||(n={},e.set(t,n)),n}function Qy(e){return Zy(Yy,e)}function $y(e){return Zy(Xy,e)}function e2(e,t){delete Qy(e)[t],delete $y(e)[t]}function t2(e){return e*Math.PI/180}var n2=(function(){let e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e})();function r2(e,t){if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<`u`)return new OffscreenCanvas(e,t);let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}function i2(e,t){let n=0,r=t.length;for(;n<r;++n)if(t[n]<e&&n+1<r){let r=t[n]/t[n+1];return n+Math.log(t[n]/e)/Math.log(r)}return r-1}function a2(e,t){let n=Math.floor(e),r=2**(e-n);return t[n]/r}var o2={};function s2(e,t,n={},r){if(t in o2){r&&(r.url=o2[t][0].url);let n=o2[t][1];return e===`Style`?n.then(structuredClone):n}let i=n.transformRequest&&n.transformRequest(t,e)||t,a=function(e){return delete o2[t],Promise.reject(Error(`Error fetching source `+t))},o=function(e){return delete o2[t],e.ok?e.json():Promise.reject(Error(`Error fetching source `+t))},s=$e(()=>i).then(e=>e instanceof Response?(r&&(r.url=e.url),o(e)):(e instanceof Request||(e=new Request(e)),e.headers.get(`Accept`)||e.headers.set(`Accept`,`application/json`),r&&(r.url=e.url),fetch(e).then(o).catch(a))).catch(a);return o2[t]=[i,s],s}function c2(e,t){if(typeof e==`string`){if(e.trim().startsWith(`{`))try{let t=JSON.parse(e);return Promise.resolve(t)}catch(e){return Promise.reject(e)}return e=Lv(e,t.accessToken),s2(`Style`,e,t)}return Promise.resolve(e)}var l2={};function u2(e,t,n={}){let r=[t,JSON.stringify(e)].toString(),i=l2[r];if(!i||n.transformRequest){let a;n.transformRequest&&(a=(e,t)=>{let r=n.transformRequest&&n.transformRequest(t,`Tiles`)||t;if(e instanceof wv)e.setLoader((t,n,i)=>{let a=function(n){n.arrayBuffer().then(n=>{let r=e.getFormat().readFeatures(n,{extent:t,featureProjection:i});e.setFeatures(r)})};$e(()=>r).then(t=>{if(t instanceof Response)return a(t);fetch(t).then(a).catch(t=>e.setState(z.ERROR))}).catch(t=>e.setState(z.ERROR))});else{let t=e.getImage();$e(()=>r).then(n=>{if(typeof n==`string`){t.src=n;return}let r=e=>e.blob().then(e=>{let n=URL.createObjectURL(e);t.addEventListener(`load`,()=>URL.revokeObjectURL(n)),t.addEventListener(`error`,()=>URL.revokeObjectURL(n)),t.src=n});if(n instanceof Response)return r(n);fetch(n).then(r).catch(t=>e.setState(z.ERROR))}).catch(t=>e.setState(z.ERROR))}});let o=e.url;if(o&&!e.tiles){let r=zv(o,n.accessToken,n.accessTokenParam||`access_token`,t||location.href);if(o.startsWith(`mapbox://`))i=Promise.resolve({tileJson:Object.assign({},e,{url:void 0,tiles:r}),tileLoadFunction:a});else{let e={};i=s2(`Source`,r[0],n,e).then(function(t){return t.tiles=t.tiles.map(function(r){return t.scheme===`tms`&&(r=r.replace(`{y}`,`{-y}`)),zv(r,n.accessToken,n.accessTokenParam||`access_token`,e.url)[0]}),Promise.resolve({tileJson:t,tileLoadFunction:a})})}}else e.tiles?(e=Object.assign({},e,{tiles:e.tiles.map(function(r){return e.scheme===`tms`&&(r=r.replace(`{y}`,`{-y}`)),zv(r,n.accessToken,n.accessTokenParam||`access_token`,t||location.href)[0]})}),i=Promise.resolve({tileJson:Object.assign({},e),tileLoadFunction:a})):i=Promise.reject(Error("source has no `tiles` nor `url`"));l2[r]=i}return i}function d2(e,t,n,r){let i=[2*n*t.pixelRatio+t.width,2*n*t.pixelRatio+t.height],a=r2(i[0],i[1]),o=a.getContext(`2d`);o.drawImage(e,t.x,t.y,t.width,t.height,n*t.pixelRatio,n*t.pixelRatio,t.width,t.height);let s=o.getImageData(0,0,i[0],i[1]);o.globalCompositeOperation=`destination-over`,o.fillStyle=`rgba(${r.r*255},${r.g*255},${r.b*255},${r.a})`;let c=s.data;for(let e=0,r=s.width;e<r;++e)for(let i=0,a=s.height;i<a;++i)c[(i*r+e)*4+3]>0&&o.arc(e,i,n*t.pixelRatio,0,2*Math.PI);return o.fill(),a}function f2(e,t,n){let r=Math.max(0,Math.min(1,(n-e)/(t-e)));return r*r*(3-2*r)}function p2(e,t,n){let r=r2(t.width,t.height),i=r.getContext(`2d`);i.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);let a=i.getImageData(0,0,t.width,t.height),o=a.data;for(let e=0,t=a.width;e<t;++e)for(let r=0,i=a.height;r<i;++r){let i=(r*t+e)*4,a=f2(.65,.85,o[i+3]/255);a>0?(o[i+0]=Math.round(255*n.r*a),o[i+1]=Math.round(255*n.g*a),o[i+2]=Math.round(255*n.b*a),o[i+3]=Math.round(255*a)):o[i+3]=0}return i.putImageData(a,0,0),r}var m2=Array(256).join(` `);function h2(e,t){if(t>=.05){let n=``,r=e.split(`
|
|
83
|
+
`),i=m2.slice(0,Math.round(t/.1));for(let e=0,t=r.length;e<t;++e)e>0&&(n+=`
|
|
84
|
+
`),n+=r[e].split(``).join(i);return n}return e}var g2;function _2(){return g2||=r2(1,1).getContext(`2d`),g2}function v2(e,t){if(/\d+ \d+/.test(e)){let[n,r]=e.split(` `).map(Number);return n<=t&&t<=r}return e==t}function y2(e,t){return _2().measureText(e).width+(e.length-1)*t}var b2={};Ul.on(`propertychange`,()=>{for(let e in b2)delete b2[e]});function x2(e,t,n,r){if(e.indexOf(`
|
|
85
|
+
`)!==-1){let i=e.split(`
|
|
86
|
+
`),a=[];for(let e=0,o=i.length;e<o;++e)a.push(x2(i[e],t,n,r));return a.join(`
|
|
87
|
+
`)}let i=n+`,`+t+`,`+e+`,`+r,a=b2[i];if(!a){let o=e.split(` `);if(o.length>1){let e=_2();e.font=t;let i=e.measureText(`M`).width*n,s=``,c=[];for(let e=0,t=o.length;e<t;++e){let t=o[e],n=s+(s?` `:``)+t;y2(n,r)<=i?s=n:(s&&c.push(s),s=t)}s&&c.push(s);for(let e=0,t=c.length;e<t&&t>1;++e){let n=c[e];if(y2(n,r)<i*.35){let i=e>0?y2(c[e-1],r):1/0,a=e<t-1?y2(c[e+1],r):1/0;c.splice(e,1),--t,i<a?(c[e-1]+=` `+n,--e):c[e]=n+` `+c[e]}}for(let e=0,t=c.length-1;e<t;++e){let n=c[e],a=c[e+1];if(y2(n,r)>i*.7&&y2(a,r)<i*.6){let o=n.split(` `),s=o.pop();y2(s,r)<i*.2&&(c[e]=o.join(` `),c[e+1]=s+` `+a),--t}}a=c.join(`
|
|
88
|
+
`)}else a=e;a=h2(a,r),b2[i]=a}return a}var S2=[`Arial`,`Courier New`,`Times New Roman`,`Verdana`,`sans-serif`,`serif`,`monospace`,`cursive`,`fantasy`],C2={};function w2(e,t=`https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css`){if(ht)return e;let n;for(let t=0,r=e.length;t<r;++t){let r=e[t];if(r in C2)continue;C2[r]=!0;let i=qy(r,16).split(` `);n||=[],n.push([i.slice(3).join(` `).replace(/"/g,``),i[1],i[0]])}return n&&(async()=>{await document.fonts.ready;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r[0];if(S2.includes(i))continue;let a=r[1],o=r[2];if(!(await document.fonts.load(`${o} ${a} 16px "${i}"`)).some(e=>e.family.replace(/^['"]|['"]$/g,``).toLowerCase()===i.toLowerCase()&&v2(e.weight,a)&&e.style===o)){let e=t.replace(`{font-family}`,i.replace(/ /g,`-`).toLowerCase()).replace(`{Font+Family}`,i.replace(/ /g,`+`)).replace(`{fontweight}`,a).replace(`{-fontstyle}`,o.replace(`normal`,``).replace(/(.+)/,`-$1`)).replace(`{fontstyle}`,o);if(!document.querySelector(`link[href="`+e+`"]`)){let t=document.createElement(`link`);t.href=e,t.rel=`stylesheet`,document.head.appendChild(t)}}}})(),e}var T2={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},E2={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]},D2=function(e,t,n){let r=Og(e,t,n);if(r.result===`error`){let i=kv(e);i!==e&&(r=Og(i,t,n))}if(r.result===`error`){let t=r.value[0];return console.error(`Error parsing expression:`,e,t.key,t.message),{evaluate:()=>n.default}}return r.value},O2,k2;function $(e,t,n,r,i,a){let o=e.id;i||(i={},console.warn(`No functionCache provided to getValue()`)),i[o]||(i[o]={});let s=i[o];if(!s[n]){let r=(e[t]||Jy)[n],i=`layers[${o}].${t}.${n}`,a=Hy,c=a[`${t}_${e.type}`]&&a[`${t}_${e.type}`][n];r===void 0&&c&&(r=c.default);let l=wg(r);if(!l&&bg(r)&&(r=e_(r,c),l=!0),l){let e=D2(r,i,c);s[n]=e.evaluate.bind(e)}else{let e=c?c.type:typeof r;(e===`color`||e===`colorArray`)&&(r=Ep.parse(r));let t=!1;if(e===`array`)for(let e=0;e<r.length;++e){let n=r[e];if(wg(n)||bg(n)){t=!0;break}}if(t){let e=Object.assign({},c,{type:c.value}),t=[];for(let n=0;n<r.length;++n){let a=r[n];if(!wg(a)&&bg(a)&&(a=e_(a,e)),wg(a)){let r=D2(a,`${i}[${n}]`,e);t.push(r.evaluate.bind(r))}else t.push(function(){return a})}s[n]=function(e,n,r){let i=[];for(let a=0;a<t.length;++a)i[a]=t[a](e,n,r);return i}}else s[n]=function(){return r}}}return s[n](jv,r,a)}function A2(e,t,n,r){return $(e,`layout`,`${n}-allow-overlap`,t,r)?$(e,`layout`,`${n}-ignore-placement`,t,r)?`none`:`obstacle`:`declutter`}function j2(e,t,n,r){if(!(e in r))try{r[e]=Wg(t,`layers[${e}].filter`).filter}catch(t){console.warn(`Filter will evaluate to false: `+t.message),r[e]=function(){return!1}}return r[e](jv,n)}function M2(e,t){if(e){if(e.a===0||t===0)return;let n=e.a;return t=t===void 0?1:t,n===0?`transparent`:`rgba(`+Math.round(e.r*255/n)+`,`+Math.round(e.g*255/n)+`,`+Math.round(e.b*255/n)+`,`+n*t+`)`}return e}var N2=/\{[^{}}]*\}/g;function P2(e,t){return e.replace(N2,function(e){return t[e.slice(1,-1)]||``})}function F2(e,t){let n=e.split(`:`)[0];return n===e&&(n=`default`),t[n]}var I2=new WeakMap;function L2(e){return I2.get(e)}var R2=0;function z2(e,t,n,r=n2,i=void 0,a=void 0,o=void 0,s=void 0){if(typeof t==`string`&&(t=JSON.parse(t)),t.schema)for(let e in t.schema){let n=t.schema[e];`default`in n&&(Av[e]=n.default)}if(t.version!=8)throw Error(`glStyle version 8 required.`);I2.set(e,Array.from(arguments));let c={};(typeof a==`string`||a instanceof Request||a instanceof Response||a instanceof Promise)&&(a={default:a});for(let t in a){let n=a[t];$e(()=>n).then(async n=>{let r;if(typeof Image<`u`){let i=new Image;if(typeof n==`string`)i.crossOrigin=`anonymous`,i.src=n;else{let e;n instanceof Request?e=await fetch(n):n instanceof Response&&(e=n);let t=await e.blob();r=URL.createObjectURL(t),i.src=r}i.addEventListener(`load`,function n(){i.removeEventListener(`load`,n),c[t]={image:i,size:[i.width,i.height]},e.changed(),r&&URL.revokeObjectURL(r)}),i.addEventListener(`error`,function e(){URL.revokeObjectURL(r),i.removeEventListener(`error`,e)})}else if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=self;e.postMessage({action:`loadImage`,src:n}),e.addEventListener(`message`,function(e){e.data.action===`imageLoaded`&&e.data.src===n&&(c[t]={image:e.data.image,size:[e.data.image.width,e.data.image.height]})})}})}let l=nf(t.layers),u={},d=[],f={},p={},m=`ol-mapbox-style:${++R2}:`,h=Qy(t),g=$y(t),_;for(let e=0,r=l.length;e<r;++e){let r=l[e],i=r.id;if(typeof n==`string`&&r.source==n||Array.isArray(n)&&n.indexOf(i)!==-1){let n=r[`source-layer`];if(!_){_=r.source;let e=t.sources[_];if(!e)throw Error(`Source "${_}" is not defined`);let n=e.type;if(n!==`vector`&&n!==`geojson`)throw Error(`Source "${_}" is not of type "vector" or "geojson", but "${n}"`)}else if(r.source!==_)throw Error(`Layer "${i}" does not use source "${_}`);let a=u[n];a||(a=[],u[n]=a),a.push({layer:r,index:e}),d.push(i)}}let v=[],y=function(n,a,l){let d=e.getSource?.()?.format_?.layerName_??`mvt:layer`,_=n.getProperties(),y=u[_[d]];if(!y)return;let b=r.indexOf(a);b==-1&&(b=i2(a,r)),jv.zoom=b,jv.distanceFromCenter=0;let x=n.getGeometry(),S=T2[x.getType()],C=e.get(`map`);if(C&&C instanceof ld&&S===1){let e=C.getSize();e&&(jv.distanceFromCenter=Ln(C.getView().getCenter(),mn(x.getExtent()))/a/e[1])}let w={id:n.getId(),properties:_,type:S},T=e.get(`mapbox-featurestate`)[n.getId()],E=-1;for(let r=0,u=y.length;r<u;++r){let u=y[r],d=u.layer,x=d.id;if(l!==void 0&&l!==x)continue;let C=d.layout||Jy,D=d.paint||Jy;if($(d,`layout`,`visibility`,w,h,T)===`none`||`minzoom`in d&&b<d.minzoom||`maxzoom`in d&&b>=d.maxzoom)continue;let O=d.filter;if(!O||j2(x,O,w,g)){let r,l,g,y,b,x,O=u.index;if(S==3&&(d.type==`fill`||d.type==`fill-extrusion`)){if(l=$(d,`paint`,`${d.type}-opacity`,w,h,T),d.type+`-pattern`in D){let e=$(d,`paint`,`${d.type}-pattern`,w,h,T);if(e){let t=typeof e==`string`?P2(e,_):e.toString(),n=F2(t,c);if(i&&i[t]&&n){++E,x=v[E],(!x||!x.getFill()||x.getStroke()||x.getText())&&(x=new uu({fill:new ou}),v[E]=x),g=x.getFill(),x.setZIndex(O);let e=Math.round(l*100)/100,r=m+t+`.`+e;if(!Ol.get(r,null)){let a=i[t],o=r2(a.width,a.height),s=o.getContext(`2d`);s.globalAlpha=e,s.drawImage(n.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),jl(o,r,void 0,q.LOADED,null,!0)}let a=p[r];a||(a={src:r,scale:1/i[t].pixelRatio},p[r]=a),g.getColor()!==a&&g.setColor(a)}}}else if(r=M2($(d,`paint`,`${d.type}-color`,w,h,T),l),d.type+`-outline-color`in D&&(b=M2($(d,`paint`,`${d.type}-outline-color`,w,h,T),l)),b||=r,r||b){if(++E,x=v[E],(!x||r&&!x.getFill()||!r&&x.getFill()||b&&!x.getStroke()||!b&&x.getStroke()||x.getText())&&(x=new uu({fill:r?new ou:void 0,stroke:b?new lu:void 0}),v[E]=x),r&&(g=x.getFill(),g.setColor(r)),d.type===`fill-extrusion`){let e=$(d,`paint`,`fill-extrusion-height`,w,h,T);if(e>0){let t=Math.max(.1,.9-Math.min(e,225)/280);if(b&&b!==`transparent`){let e=Ep.parse(b);b=`rgba(${Math.round(e.r*255*t)},${Math.round(e.g*255*t)},${Math.round(e.b*255*t)},${e.a})`}}}b&&(y=x.getStroke(),y.setColor(b),y.setWidth(.5)),x.setZIndex(O)}g&&typeof g.setDisplacement==`function`&&(g.setDisplacement($(d,`paint`,`${d.type}-translate`,w,h,T)),g.setDisplacementAnchor($(d,`paint`,`${d.type}-translate-anchor`,w,h,T)))}if(S!=1&&d.type==`line`){r=`line-pattern`in D?void 0:M2($(d,`paint`,`line-color`,w,h,T),$(d,`paint`,`line-opacity`,w,h,T));let e=$(d,`paint`,`line-width`,w,h,T);r&&e>0&&(++E,x=v[E],(!x||!x.getStroke()||x.getFill()||x.getText())&&(x=new uu({stroke:new lu}),v[E]=x),y=x.getStroke(),y.setLineCap($(d,`layout`,`line-cap`,w,h,T)),y.setLineJoin($(d,`layout`,`line-join`,w,h,T)),y.setMiterLimit($(d,`layout`,`line-miter-limit`,w,h,T)),y.setColor(r),y.setWidth(e),y.setLineDash(D[`line-dasharray`]?$(d,`paint`,`line-dasharray`,w,h,T).map(function(t){return t*e}):null),typeof y.setOffset==`function`&&y.setOffset($(d,`paint`,`line-offset`,w,h,T)),x.setZIndex(O))}let k=!1,A=null,ee=0,j,M,te;if((S==1||S==2)&&`icon-image`in C){let t=$(d,`layout`,`icon-image`,w,h,T);if(t){j=typeof t==`string`?P2(t,_):t.toString();let r,o=s?s(e,j):void 0,l=F2(j,c);if(i&&i[j]&&l||o){let e=$(d,`layout`,`symbol-placement`,w,h,T),t=$(d,`layout`,`icon-rotation-alignment`,w,h,T),s=t===`auto`?e!==`point`:t===`map`;if(S==2){let t=n.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){let n=t.getExtent();if(Math.sqrt(Math.max(((n[2]-n[0])/a)**2,((n[3]-n[1])/a)**2))>150){let n=t.getType()===`MultiLineString`?t.getFlatMidpoints():t.getFlatMidpoint();if(k2||=(O2=[NaN,NaN],new Cd(`Point`,O2,[],2,{},void 0)),r=k2,O2[0]=n[0],O2[1]=n[1],e===`line`&&s){let e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,i=r.length-e;t<i;t+=e){let i=r[t],a=r[t+1],o=r[t+e],s=r[t+e+1],c=Math.min(i,o),l=Math.max(i,o),u=n[0],d=n[1],f=(s-a)*(u-i)-(o-i)*(d-a);if(Math.abs(f)<.001&&u<=l&&u>=c){ee=Math.atan2(a-s,o-i);break}}}}}}if(S!==2||r){let e=$(d,`layout`,`icon-size`,w,h,T),t=D[`icon-color`]===void 0?null:$(d,`paint`,`icon-color`,w,h,T);if(!t||t.a!==0){let n=$(d,`paint`,`icon-halo-color`,w,h,T),r=$(d,`paint`,`icon-halo-width`,w,h,T),a=A2(d,w,`icon`,h),c=`${j}.${e}.${r}.${n}.${s}.${a}`;if(t!==null&&(c+=`.${t}`),M=f[c],!M){let u;`icon-offset`in C&&(u=$(d,`layout`,`icon-offset`,w,h,T).slice(0),u[0]*=e,u[1]*=-e);let p=t?[t.r*255,t.g*255,t.b*255,t.a]:void 0;if(o){let t={color:p,rotateWithView:s,displacement:u,declutterMode:a,scale:e};typeof o==`string`?t.src=o:(t.img=o,t.imgSize=[o.width,o.height]),M=new cu(t)}else{let o=i[j],c,d,f;r?o.sdf?(c=d2(p2(l.image,o,t||[0,0,0,1]),{x:0,y:0,width:o.width,height:o.height,pixelRatio:o.pixelRatio},r,n),p=void 0):c=d2(l.image,o,r,n):(o.sdf?(l.unSDFedImage||=p2(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1,a:1}),c=l.unSDFedImage):c=l.image,d=[o.width,o.height],f=[o.x,o.y]),M=new cu({color:p,img:c,imgSize:l.size,size:d,offset:f,rotateWithView:s,scale:e/o.pixelRatio,displacement:u,declutterMode:a})}f[c]=M}}M&&(++E,x=v[E],(!x||!x.getImage()||x.getFill()||x.getStroke())&&(x=new uu,v[E]=x),x.setGeometry(r),M.setRotation(ee+t2($(d,`layout`,`icon-rotate`,w,h,T))),M.setOpacity($(d,`paint`,`icon-opacity`,w,h,T)),M.setAnchor(E2[$(d,`layout`,`icon-anchor`,w,h,T)]),x.setImage(M),A=x.getText(),x.setText(void 0),x.setZIndex(O),k=!0,te=!1)}else te=!0}}}if(S==1&&d.type===`circle`){++E,x=v[E],(!x||!x.getImage()||x.getFill()||x.getStroke())&&(x=new uu,v[E]=x);let e=`circle-radius`in D?$(d,`paint`,`circle-radius`,w,h,T):5,t=M2($(d,`paint`,`circle-stroke-color`,w,h,T),$(d,`paint`,`circle-stroke-opacity`,w,h,T)),n=$(d,`paint`,`circle-translate`,w,h,T),r=M2($(d,`paint`,`circle-color`,w,h,T),$(d,`paint`,`circle-opacity`,w,h,T)),i=$(d,`paint`,`circle-stroke-width`,w,h,T),a=e+`.`+t+`.`+r+`.`+i+`.`+n[0]+`.`+n[1];M=f[a],M||(M=new au({radius:e,displacement:[n[0],-n[1]],stroke:t&&i>0?new lu({width:i,color:t}):void 0,fill:r?new ou({color:r}):void 0,declutterMode:`none`}),f[a]=M),x.setImage(M),A=x.getText(),x.setText(void 0),x.setGeometry(void 0),x.setZIndex(O),k=!0}let ne,re,ie,N,ae,oe;if(`text-field`in C){N=Math.round($(d,`layout`,`text-size`,w,h,T));let e=$(d,`layout`,`text-font`,w,h,T);ie=$(d,`layout`,`text-line-height`,w,h,T),re=qy(o?o(e,t.metadata?t.metadata[`ol:webfonts`]:void 0):e,N,ie),re.includes(`sans-serif`)||(re+=`,sans-serif`),ae=$(d,`layout`,`text-letter-spacing`,w,h,T),oe=$(d,`layout`,`text-max-width`,w,h,T);let n=$(d,`layout`,`text-field`,w,h,T);ne=typeof n==`object`&&n.sections?n.sections.length===1?n.toString():n.sections.reduce((t,n,r)=>{let i=n.fontStack?n.fontStack.split(`,`):e,a=qy(o?o(i):i,N*(n.scale||1),ie),s=n.text;if(s===`
|
|
89
|
+
`)return t.push(`
|
|
90
|
+
`,``),t;if(S==2)return t.push(h2(s,ae),a),t;s=x2(s,a,oe,ae).split(`
|
|
91
|
+
`);for(let e=0,n=s.length;e<n;++e)e>0&&t.push(`
|
|
92
|
+
`,``),t.push(s[e],a);return t},[]):P2(n,_).trim(),l=$(d,`paint`,`text-opacity`,w,h,T)}if(ne&&l&&!te){k||(++E,x=v[E],(!x||!x.getText()||x.getFill()||x.getStroke())&&(x=new uu,v[E]=x),x.setImage(void 0),x.setGeometry(void 0));let e=A2(d,w,`text`,h);x.getText()||x.setText(A),A=x.getText(),(!A||`getDeclutterMode`in A&&A.getDeclutterMode()!==e)&&(A=new _u({padding:[2,2,2,2],declutterMode:e}),x.setText(A));let t=$(d,`layout`,`text-transform`,w,h,T);t==`uppercase`?ne=Array.isArray(ne)?ne.map((e,t)=>t%2?e:e.toUpperCase()):ne.toUpperCase():t==`lowercase`&&(ne=Array.isArray(ne)?ne.map((e,t)=>t%2?e:e.toLowerCase()):ne.toLowerCase());let n=Array.isArray(ne)?ne:S==2?h2(ne,ae):x2(ne,re,oe,ae);if(A.setText(n),A.setFont(re),A.setRotation(t2($(d,`layout`,`text-rotate`,w,h,T))),typeof A.setKeepUpright==`function`){let e=$(d,`layout`,`text-keep-upright`,w,h,T);A.setKeepUpright(e)}let r=$(d,`layout`,`text-anchor`,w,h,T),i=k||S==1?`point`:$(d,`layout`,`symbol-placement`,w,h,T),a;if(i===`line-center`?(A.setPlacement(`line`),a=`center`):A.setPlacement(i),i===`line`&&typeof A.setRepeat==`function`){let e=$(d,`layout`,`symbol-spacing`,w,h,T);A.setRepeat(e*2)}A.setOverflow(i===`point`);let o=$(d,`paint`,`text-halo-width`,w,h,T),s=$(d,`layout`,`text-offset`,w,h,T),c=$(d,`paint`,`text-translate`,w,h,T),u=0,f=0;if(i==`point`){a=`center`,r.indexOf(`left`)===-1?r.indexOf(`right`)!==-1&&(a=`right`,f=-o):(a=`left`,f=o);let e=$(d,`layout`,`text-rotation-alignment`,w,h,T);A.setRotateWithView(e==`map`)}else A.setMaxAngle(t2($(d,`layout`,`text-max-angle`,w,h,T))*ne.length/n.length),A.setRotateWithView(!1);A.setTextAlign(a);let p=`middle`;r.indexOf(`bottom`)==0?(p=`bottom`,u=-o-.5*(ie-1)*N):r.indexOf(`top`)==0&&(p=`top`,u=o+.5*(ie-1)*N),A.setTextBaseline(p);let m=$(d,`layout`,`text-justify`,w,h,T);A.setJustify(m===`auto`?void 0:m),A.setOffsetX(s[0]*N+f+c[0]),A.setOffsetY(s[1]*N+u+c[1]);let g=A.getFill()||new ou;g.setColor(M2($(d,`paint`,`text-color`,w,h,T),l)),A.setFill(g);let _=M2($(d,`paint`,`text-halo-color`,w,h,T),l);if(_&&o>0){let e=A.getStroke()||new lu;e.setColor(_),o*=2;let t=.5*N;e.setWidth(o<=t?o:t),A.setStroke(e)}else A.setStroke(void 0);let y=$(d,`layout`,`text-padding`,w,h,T),b=A.getPadding();y!==b[0]&&(b[0]=y,b[1]=y,b[2]=y,b[3]=y),x.setZIndex(O)}}}if(E>-1)return v.length=E+1,v};return e.setStyle(y),e.set(`mapbox-layers`,d),e.set(`mapbox-source`,_),e.set(`mapbox-featurestate`,e.get(`mapbox-featurestate`)||{}),y}var B2=Ep.parse(`#000000`),V2=Ep.parse(`#FFFFFF`),H2=Ep.parse(`#000000`);function U2(e){return new Hv({source:new Ny({operationType:`image`,operation:Vy,sources:[e]})})}function W2(e){return new Hv({source:new Ny({operationType:`image`,operation:By,sources:[e]})})}function G2(e,t,n,r){e.getSource().on(`beforeoperations`,function(e){jv.zoom=i2(e.resolution,n.resolutions||n2),jv.distanceFromCenter=0;let i=e.data;i.saturation=$(t,`paint`,`raster-saturation`,Jy,r),i.contrast=$(t,`paint`,`raster-contrast`,Jy,r),i.brightnessHigh=$(t,`paint`,`raster-brightness-max`,Jy,r),i.brightnessLow=$(t,`paint`,`raster-brightness-min`,Jy,r),i.hueRotate=$(t,`paint`,`raster-hue-rotate`,Jy,r)})}function K2(e,t,n,r,i){e.getSource().on(`beforeoperations`,function(e){let a=e.data;a.resolution=ii(r.projection||`EPSG:3857`,e.resolution,mn(e.extent),`m`);let o=i2(e.resolution,r.resolutions||n2);jv.zoom=o,jv.distanceFromCenter=0,a.zoom=o,a.encoding=t.encoding,a.method=$(n,`paint`,`hillshade-method`,Jy,i)||`standard`,a.exaggeration=$(n,`paint`,`hillshade-exaggeration`,Jy,i);let s=$(n,`paint`,`hillshade-illumination-direction`,Jy,i);s??=335,a.azimuths=Array.isArray(s)?s:[s],a.sunAz=a.azimuths[0];let c=$(n,`paint`,`hillshade-illumination-altitude`,Jy,i);c??=45,a.altitudes=Array.isArray(c)?c:[c];function l(e){return e&&e.values?e.values[0]:e}function u(e){let t=n.paint?.[e];if(Array.isArray(t)&&t.length>0&&typeof t[0]==`string`&&Ep.parse(t[0])!==void 0)return t.map(e=>Ep.parse(e));let r=$(n,`paint`,e,Jy,i);return r=l(r),r?[r]:void 0}a.highlightColors=u(`hillshade-highlight-color`),a.highlightColor=a.highlightColors?.[0]||V2,a.highlightColors||=[a.highlightColor],a.shadowColors=u(`hillshade-shadow-color`),a.shadowColor=a.shadowColors?.[0]||B2,a.shadowColors||=[a.shadowColor],a.accentColor=l($(n,`paint`,`hillshade-accent-color`,Jy,i))||H2})}var q2=[`raster-saturation`,`raster-contrast`,`raster-brightness-max`,`raster-brightness-min`,`raster-hue-rotate`];function J2(e,t,n){let r=null;return function(i){e.paint&&`raster-opacity`in e.paint&&i.frameState.viewState.zoom!==r&&(r=i.frameState.viewState.zoom,Y2(e,t,r,n))}}function Y2(e,t,n,r){jv.zoom=n,jv.distanceFromCenter=0;let i=$(e,`paint`,`raster-opacity`,Jy,r);t.setOpacity(i)}var X2=[`background`,`circle`,`fill`,`fill-extrusion`,`line`,`symbol`,`raster`,`hillshade`];function Z2(e,t=512){return e.getExtent()?J0({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():n2}function Q2(e,t){return t.accessToken||(t=Object.assign({},t),new URL(e).searchParams.forEach((e,n)=>{t.accessToken=e,t.accessTokenParam=n})),t}function $2(e,t,n=``,r={},i=void 0){let a,o,s,c,l=!0;return typeof n!=`string`&&!Array.isArray(n)?(s=n,c=s.source||s.layers,r=s):c=n,typeof r==`string`?(a=r,s={}):(a=r.styleUrl,s=r),s.updateSource===!1&&(l=!1),i||=s.resolutions,!a&&typeof t==`string`&&!t.trim().startsWith(`{`)&&(a=t),a&&(a=a.startsWith(`data:`)?location.href:Lv(a,s.accessToken),s=Q2(a,s)),new Promise(function(n,r){c2(t,s).then(function(t){if(t.version!=8)return r(Error(`glStyle version 8 required.`));let u=e.getSource(),d;if(u){if(u instanceof Tv)d=!0;else if(u instanceof xv)d=!1;else return r(Error(`Can only apply to VectorSource or VectorTileSource`))}else if(e instanceof M0||e instanceof I0)d=e instanceof I0;else return r(Error(`Can only apply to VectorLayer or VectorTileLayer`));let f=d?`vector`:`geojson`;if(c?o=Array.isArray(c)?t.layers.find(function(e){return e.id===c[0]}).source:c:(o=t.layers.find(function(e){return e.source&&t.sources[e.source].type===f}).source,c=o),!o)return r(Error(`No ${f} source found in the glStyle.`));function p(){if(!l)return Promise.resolve();let n=()=>e.getSource(),r=t=>e.setSource(t);if(d)return o4(t.sources[o],a,s).then(function(t){let i=n();i?t!==i&&(i.setTileUrlFunction(t.getTileUrlFunction()),typeof i.setUrls==`function`&&typeof t.getUrls==`function`&&i.setUrls(t.getUrls()),i.format_||=t.format_,i.getAttributions()||i.setAttributions(t.getAttributions()),i.getTileLoadFunction()===Ev&&i.setTileLoadFunction(t.getTileLoadFunction()),di(i.getProjection(),t.getProjection())&&(i.tileGrid=t.getTileGrid())):r(t);let a=n().getTileGrid();!isFinite(e.getMaxResolution())&&!isFinite(e.getMinZoom())&&a.getMinZoom()>0&&e.setMaxResolution(a2(Math.max(0,a.getMinZoom()-1e-12),a.getResolutions()))});let i=t.sources[o],c=n();c&&c.get(`mapbox-source`)===i||(c=d4(i,a,s));let u=n();return u?c!==u&&(u.getAttributions()||u.setAttributions(c.getAttributions()),u.format_||=c.getFormat(),u.url_=c.getUrl()):r(c),Promise.resolve()}let m,h,g={},_={};function v(){if(!h&&(!t.sprite||g)){if(s.projection&&!i){let e=H(s.projection).getUnits();e!==`m`&&(i=n2.map(t=>t/Zn[e]))}let l,u=e.getSource();u instanceof Tv&&u.format_ instanceof C_&&(l=u.format_.layerName_),h=z2(e,t,c,i,g,_,(e,t)=>w2(e,t?Iv(t,a):s.webfonts),s.getImage,l),e.getStyle()?p().then(n).catch(r):r(Error(`Nothing to show for source [${o}]`))}else h?(e.setStyle(h),p().then(n).catch(r)):r(Error(`Something went wrong trying to apply style.`))}if(t.sprite){let e=Pv(t.sprite,s.accessToken,a||location.href);m=ht?1:window.devicePixelRatio>=1.5?.5:1;let n=m==.5?`@2x`:``;Promise.all(e.map(function(e){let t=new URL(e.url),i=t.origin+t.pathname+n+`.json`+t.search;return new Promise(function(e,n){s2(`Sprite`,i,s).then(e).catch(function(r){i=t.origin+t.pathname+`.json`+t.search,s2(`Sprite`,i,s).then(e).catch(n)})}).then(function(i){i===void 0&&r(Error(`No sprites found.`));let a;if(a=t.origin+t.pathname+n+`.png`+t.search,s.transformRequest){let e=s.transformRequest(a,`SpriteImage`)||a;(e instanceof Request||e instanceof Promise)&&(a=e)}_[e.id]=a;for(let t in i){let n=e.id=="default"?t:`${e.id}:${t}`;g[n]=i[t]}}).catch(function(e){r(Error(`Sprites cannot be loaded: ${i}: ${e.message}`))})})).then(v).catch(r)}else v()}).catch(r)})}var e4=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function t4(e,t){if(!t.ref)return t;let n=e.find(e=>e.id===t.ref);if(!n)return t;let r=Object.assign({},t);for(let e of e4)!(e in r)&&e in n&&(r[e]=n[e]);return r}function n4(e,t){let n=e.bounds;if(n){let e=li([n[0],n[1]],t),r=li([n[2],n[3]],t);return[e[0],e[1],r[0],r[1]]}return H(t).getExtent()}function r4(e,t,n){let r=new mv({tileJSON:t,tileSize:e.tileSize||t.tileSize||512}),i=r.getTileJSON(),a=r.getTileGrid(),o=H(n.projection||`EPSG:3857`),s=n4(i,o),c=o.getExtent(),l=i.minzoom||0,u=i.maxzoom||22,d={attributions:r.getAttributions(),projection:o,tileGrid:new W0({origin:c?xn(c):a.getOrigin(0),extent:s||a.getExtent(),minZoom:l,resolutions:Z2(o,t.tileSize).slice(0,u+1),tileSize:a.getTileSize(0)})};return Array.isArray(i.tiles)?d.urls=i.tiles:d.url=i.tiles,d}function i4(e,t,n,r){let i={id:e.id,type:e.type},a=e.paint||{};i.paint=a,jv.zoom=i2(t,n.resolutions||n2),jv.distanceFromCenter=0;let o,s=$(i,`paint`,`background-color`,Jy,r);return a[`background-opacity`]!==void 0&&(o=$(i,`paint`,`background-opacity`,Jy,r)),$(i,`layout`,`visibility`,Jy,r)===`none`?void 0:M2(s,o)}function a4(e,t,n){let r=ht?{style:{}}:document.createElement(`div`);return r.className=`ol-mapbox-style-background`,r.style.position=`absolute`,r.style.width=`100%`,r.style.height=`100%`,new Es({source:new z0({}),render(i){let a=i4(e,i.viewState.resolution,t,n);return r.style.backgroundColor=a,r}})}function o4(e,t,n){return new Promise(function(r,i){u2(e,t,n).then(function({tileJson:t,tileLoadFunction:i}){let a=r4(e,t,n);a.tileLoadFunction=i,a.format=new C_({layerName:`mvt:layer`});let o=new Tv(a);o.set(`mapbox-source`,e),r(o)}).catch(i)})}function s4(e,t,n){let r=new I0({declutter:!0,visible:!1});return o4(e,t,n).then(function(e){r.setSource(e)}).catch(function(e){r.setSource(void 0)}),r}function c4(e){return`{bbox-${(e?e.getCode():`EPSG:3857`).toLowerCase().replace(/[^a-z0-9]/g,`-`)}}`}function l4(e,t,n,r){return new Promise(function(i,a){u2(e,t,n).then(function({tileJson:t,tileLoadFunction:a}){let o=new mv({interpolate:r===void 0?n.interpolate===void 0||n.interpolate:r,transition:0,crossOrigin:`anonymous`,tileJSON:t});o.tileGrid=r4(e,t,n).tileGrid,n.projection&&(o.projection=H(n.projection));let s=o.getTileUrlFunction();a&&o.setTileLoadFunction(a),o.setTileUrlFunction(function(e,t,n){let r=c4(n),i=s(e,t,n);if(i.indexOf(r)!=-1){let t=o.getTileGrid().getTileCoordExtent(e);i=i.replace(r,t.toString())}return i}),o.set(`mapbox-source`,e),i(o)}).catch(function(e){a(e)})})}function u4(e,t,n,r){let i=new b1;return l4(e,t,n,r).then(function(e){i.setSource(e)}).catch(function(){i.setSource(void 0)}),i}function d4(e,t,n){let r=n.projection?new Fd({dataProjection:n.projection}):new Fd,i=e.data,a={};if(typeof i==`string`){let[a]=zv(i,n.accessToken,n.accessTokenParam||`access_token`,t||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){let t=(e,t,n)=>{let r=c4(n);return a.replace(r,`${e.join(`,`)}`)},i=new xv({attributions:e.attribution,format:r,loader:(e,r,a,o,s)=>{s2(`GeoJSON`,typeof t==`function`?t(e,r,a):t,n).then(e=>{let t=i.getFormat().readFeatures(e,{featureProjection:a});i.addFeatures(t),o(t)}).catch(()=>{s()})},strategy:R0});return i.set(`mapbox-source`,e),i}let o=new xv({attributions:e.attribution,format:r,url:a,loader:(e,t,r,i,s)=>{s2(`GeoJSON`,a,n).then(e=>{let t=o.getFormat().readFeatures(e,{featureProjection:r});o.addFeatures(t),i(t)}).catch(()=>{s()})}});return o}a.features=r.readFeatures(i,{featureProjection:vi()||`EPSG:3857`});let o=new xv(Object.assign({attributions:e.attribution,format:r},a));return o.set(`mapbox-source`,e),o}function f4(e,t,n){return new M0({declutter:!0,source:d4(e,t,n),visible:!1})}function p4(e,t,n){function r(){let r=t.get(`mapbox-style`);if(!r)return;let i=nf(r.layers),a=e.get(`mapbox-layers`),o=i.filter(function(e){return a.includes(e.id)}).some(function(e){return!e.layout||$(e,`layout`,`visibility`,Jy,n)===`visible`});e.get(`visible`)!==o&&e.setVisible(o)}e.on(`change`,r),r()}function m4(e,t,n,r){n=t4(e.layers,n);let i=Qy(e),a=n.type,o=n.source,s=e.sources[o],c;if(a==`background`)c=a4(n,r,i),o=void 0;else if(s.type==`vector`)c=s4(s,t,r);else if(s.type==`raster`){let e=!!Object.keys(n.paint||{}).find(e=>q2.includes(e)),a=$(n,`paint`,`raster-resampling`,Jy,i)!==`nearest`&&void 0;e?(c=U2(u4(s,t,r,a)),G2(c,n,r,i)):c=u4(s,t,r,a),c.setVisible(!n.layout||$(n,`layout`,`visibility`,Jy,i)!==`none`),c.on(`prerender`,J2(n,c,i))}else s.type==`geojson`?c=f4(s,t,r):s.type==`raster-dem`&&n.type==`hillshade`&&(c=W2(u4(s,t,r)),K2(c,s,n,r,i),c.setVisible(!n.layout||$(n,`layout`,`visibility`,Jy,i)!==`none`));return c&&c.set(`mapbox-source`,o),c}function h4(e,t,n,r){e.schema&&Object.assign(Av,Object.keys(e.schema).reduce((t,n)=>(t[n]=e.schema[n]?.default,t),{}));let i=[],a=null;if(t instanceof ld){if(a=t.getView(),!a.isDef()&&!a.getRotation()&&!a.getResolutions()){let e=r.projection?H(r.projection):a.getProjection();a=new ro(Object.assign(a.getProperties(),{maxResolution:n2[0]/Zn[e.getUnits()],projection:r.projection||a.getProjection()})),t.setView(a)}`center`in e&&!a.getCenter()&&a.setCenter(li(e.center,a.getProjection())),`zoom`in e&&a.getZoom()===void 0&&a.setResolution(n2[0]/Zn[a.getProjection().getUnits()]/2**e.zoom),a.getCenter()&&a.getZoom()!==void 0||a.fit(a.getProjection().getExtent(),{nearest:!0,size:t.getSize()})}t.set(`mapbox-style`,e),t.set(`mapbox-metadata`,{styleUrl:n,options:r});let o=e.layers,s=[],c,l,u;for(let a=0,d=o.length;a<d;++a){let d=t4(o,o[a]),f=d.type;if(X2.includes(f))u=d.source,u&&u==l||(s.length&&(i.push(_4(c,s,e,n,t,r)),s=[]),c=m4(e,n,d,r),c instanceof M0||c instanceof I0||(s=[]),l=c.get(`mapbox-source`)),s.push(d.id);else{console.warn(`layers[${a}].type "${f}" not supported`);continue}}return i.push(_4(c,s,e,n,t,r)),Promise.all(i)}function g4(e,t,n={}){let r,i;if(ht){if(!(e instanceof ld)&&!(e instanceof ws))throw Error(`ol-mapbox-style in a web worker requires a Map or a LayerGroup as first argument`);i=e}else i=typeof e==`string`||e instanceof HTMLElement?new ld({target:e}):e;if(typeof t==`string`){let e=t.startsWith(`data:`)?location.href:Lv(t,n.accessToken);n=Q2(e,n),r=new Promise(function(r,a){c2(t,n).then(function(t){h4(t,i,e,n).then(function(){r(i)}).catch(a)}).catch(function(e){a(Error(`Could not load ${t}: ${e.message}`))})})}else r=new Promise(function(e,r){h4(t,i,!n.styleUrl||n.styleUrl.startsWith(`data:`)?location.href:Lv(n.styleUrl,n.accessToken),n).then(function(){e(i)}).catch(r)});return r}function _4(e,t,n,r,i,a={}){let o=24,s=0,c=n.layers;for(let e=0,n=c.length;e<n;++e){let n=c[e];t.indexOf(n.id)!==-1&&(o=Math.min(`minzoom`in n?n.minzoom:0,o),s=Math.max(`maxzoom`in n?n.maxzoom:24,s))}return new Promise(function(c,l){let u=function(){let u=e.getSource();if(!u||u.getState()===`error`)l(Error(`Error accessing data for source `+e.get(`mapbox-source`)));else{if(`getTileGrid`in u){let t=u.getTileGrid();if(t){let n=t.getMinZoom();(o>0||n>0)&&e.setMaxResolution(Math.min(a2(Math.max(0,o-1e-12),n2),a2(Math.max(0,n-1e-12),t.getResolutions()))),s<24&&e.setMinResolution(a2(s,n2))}}else o>0&&e.setMaxResolution(a2(Math.max(0,o-1e-12),n2));u instanceof xv||u instanceof Tv?$2(e,n,t,Object.assign({styleUrl:r},a)).then(function(){p4(e,i,Qy(n)),c()}).catch(l):c()}};e.set(`mapbox-layers`,t);let d=i.getLayers();d.getArray().indexOf(e)===-1&&d.push(e),e.getSource()?u():e.once(`change:source`,u)})}function v4(e,t){return e.get(`mapbox-style`).layers.find(function(e){return e.id===t})}function y4(e,t,n){let r=e.get(`mapbox-style`);e2(r,t.id);let i=r.layers,a,o=-1;if(n!==void 0){let t=v4(e,n);if(t===void 0)throw Error(`Layer with id "${n}" not found.`);a=i.indexOf(t)}else a=i.length;let s;if(a>0&&i[a-1].source===t.source?(o=a-1,s=-1):a<i.length&&i[a].source===t.source&&(o=a,s=0),o===-1){let{options:o,styleUrl:s}=e.get(`mapbox-metadata`),c=m4(r,s,t,o);if(n){let t=S4(e,n),r=e.getLayers().getArray().indexOf(t);e.getLayers().insertAt(r,c)}return i.splice(a,0,t),_4(c,[t.id],r,s,e,o)}if(i.some(e=>e.id===t.id))throw Error(`Layer with id "${t.id}" already exists.`);let c=i[o].id,l=L2(S4(e,c));if(i.splice(a,0,t),l){let[e,n,r,i,a,o,u,d]=l;if(Array.isArray(r)){let e=r.indexOf(c)+s;r.splice(e,0,t.id)}z2(e,n,r,i,a,o,u,d)}else S4(e,i[o].id).changed();return Promise.resolve()}function b4(e,t){let n=e.get(`mapbox-style`),r=n.layers,i=r.findIndex(function(e){return e.id===t.id});if(i===-1)throw Error(`Layer with id "${t.id}" not found.`);if(r[i].source!==t.source)throw Error(`Updated layer and previous version must use the same source.`);e2(n,t.id),r[i]=t;let a=L2(S4(e,t.id));if(a)return z2.apply(void 0,a),Promise.resolve();let o=S4(e,t.id),{options:s,styleUrl:c}=e.get(`mapbox-metadata`);return _4(o,[t.id],n,c,e,s)}function x4(e,t,n){let r=w4(e,t),i=e.getLayers().getArray().filter(function(e){return(e instanceof M0||e instanceof b1||e instanceof I0)&&e.getSource()===r}),a=e.get(`mapbox-metadata`),o;switch(n.type){case`vector`:o=o4(n,a.styleUrl,a.options);break;case`geojson`:o=Promise.resolve(d4(n,a.styleUrl,a.options));break;case`raster`:case`raster-dem`:o=l4(n,a.styleUrl,a.options,r&&`getInterpolate`in r?r.getInterpolate():void 0);break;default:return Promise.reject(Error(`Unsupported source type `+n.type))}return o.then(function(e){i.forEach(function(t){t.setSource(e)})}),o}function S4(e,t){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e){let r=n[e].get(`mapbox-layers`);if(r&&r.indexOf(t)!==-1)return n[e]}}function C4(e,t){let n=[],r=e.getLayers().getArray();for(let e=0,i=r.length;e<i;++e)r[e].get(`mapbox-source`)===t&&n.push(r[e]);return n}function w4(e,t){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e){let r=n[e].getSource();if(n[e].get(`mapbox-source`)===t)return r}}var T4=`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOShgAHAAAAEgAAAISgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAAQVNDSUkAAABTY3JlZW5zaG90/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDShJQ0NfUFJPRklMRQABAQAADRhhcHBsAhAAAG1udHJSR0IgWFlaIAfpAAIAHAAJAB4AD2Fjc3BBUFBMAAAAAEFQUEwAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWRlc2MAAAFQAAAAYmRzY20AAAG0AAAB9GNwcnQAAAOoAAAAI3d0cHQAAAPMAAAAFHJYWVoAAAPgAAAAFGdYWVoAAAP0AAAAFGJYWVoAAAQIAAAAFHJUUkMAAAQcAAAIDGFhcmcAAAwoAAAAIHZjZ3QAAAxIAAAAMG5kaW4AAAx4AAAAPm1tb2QAAAy4AAAAKHZjZ3AAAAzgAAAAOGJUUkMAAAQcAAAIDGdUUkMAAAQcAAAIDGFhYmcAAAwoAAAAIGFhZ2cAAAwoAAAAIGRlc2MAAAAAAAAACERpc3BsYXkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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`);n.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">
|
|
93
93
|
<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"/>
|
|
94
|
-
</svg></div>`;let r=document.createElement(`div`);r.className=`layer-control ol-unselectable ol-control`,r.appendChild(n);let i=document.createElement(`div`);i.classList.add(`layer-selection`,`hidden`),r.appendChild(i),super({element:r,target:t.target}),this.baseLayers.forEach(e=>{i.appendChild(e.thumbnailBox)}),this.layerControlElement=i,n.addEventListener(`click`,this.toggleLayerSelection.bind(this),!1)}baseLayers=[{name:`positron`,image:qC,styleUrl:`https://tiles.openfreemap.org/styles/positron`},{name:`orthofoto`,image:JC,layer:new Vx({visible:!1,source:new KC({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:YC,styleUrl:`https://kataster.bev.gv.at/styles/kataster/style_basic.json`}].map((e,t)=>{e.styleUrl&&(e.layer=new xs({visible:t===0}),e.styleUrl&&uC(e.layer,e.styleUrl));let n=document.createElement(`div`);n.classList.add(`image-box`),t===0&&n.classList.add(`selected`);let r=document.createElement(`img`);return r.src=e.image,r.alt=e.name,n.appendChild(r),n.addEventListener(`click`,t=>{this.baseLayers.forEach(e=>{t.target===e.thumbnailBox?e.thumbnailBox.classList.add(`selected`):e.thumbnailBox.classList.remove(`selected`)}),this.baseLayers.forEach(t=>{t.layer.setVisible(t.name===e.name)})}),e.thumbnailBox=n,e});baseLayerGroup;setMap(e){this.getMap()&&this.getMap().removeLayer(this.baseLayerGroup),e&&(this.baseLayerGroup=new xs({layers:this.baseLayers.map(e=>e.layer)}),e.addLayer(this.baseLayerGroup)),super.setMap(e)}layerControlElement=null;set displayLayerSelection(e){if(e){this.layerControlElement.classList.remove(`hidden`);let e=()=>{this.displayLayerSelection=!1,this.getMap().getTargetElement().removeEventListener(`click`,e)};setTimeout(()=>{this.getMap().getTargetElement().addEventListener(`click`,e)}),this.getMap().once(`moveend`,()=>{this.displayLayerSelection&&(this.displayLayerSelection=!1,document.body.removeEventListener(`click`,e))})}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)}},ZC=class extends No{#e=null;#t=new _y({source:new Ov});constructor(e){super(),this.#e=e.yioMap;let t=this.#t.getSource();t.addEventListener(`change`,e=>{this.#e.userSelect=t.getFeatures().map(e=>e.getProperties())})}setMap(e){let t=this.getMap();t&&t.removeLayer(this.#t),e&&(e.addLayer(this.#t),super.setMap(e))}#n(e){let t=this.getMap(),n=this.#e._getContentLayer();t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).filter(e=>e.get(`id`)!==void 0).length?t.getTargetElement().classList.add(`cursor-pointer`):t.getTargetElement().classList.remove(`cursor-pointer`)}#r(e){let t=this.getMap(),n=this.#e._getContentLayer(),r=this.#t.getSource(),i=t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).filter(e=>e.get(`id`)!==void 0);return r.clear(),r.addFeatures(i.map(e=>e instanceof md?gd(e):e)),this.#e.notifyNextChange=!0,this.#e._handleClick(e.originalEvent),i.length===0}handleEvent(e){return e.type===`pointermove`&&this.#n(e),e.type===`click`?this.#r(e):!0}setActive(e){super.setActive(e),e||(this.#t.getSource().clear(),this.#e&&(this.#e.userSelect.length=0))}};function QC(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function $C(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}var ew={index:-1,endIndex:NaN,closestTargetDistance:1/0};function tw(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN;for(let e=0;e<t.targets.length;++e){let n=t.targets[e],r=n.coordinates,l=1/0,u;for(let e=0;e<r.length-1;++e){let t=r[e],n=r[e+1],o=cw(i,a,t,n);o.squaredDistance<l&&(l=o.squaredDistance,u=e+o.along)}l<o&&(o=l,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?u<n.startIndex&&(u+=r.length):n.endIndex<n.startIndex&&u>n.startIndex&&(u-=r.length)),c=u,s=e)}let l=t.targets[s],u=l.ring;if(t.targetIndex===s&&u){let e=$C(l.coordinates,c);Rn(n.getPixelFromCoordinate(e),n.getPixelFromCoordinate(t.startCoord))>r&&(u=!1)}if(u){let e=l.coordinates,t=e.length,n=l.startIndex,r=c;if(n<r){let i=ow(e,n,r);ow(e,n,r-t)<i&&(c-=t)}else{let i=ow(e,n,r);ow(e,n,r+t)<i&&(c+=t)}}return ew.index=s,ew.endIndex=c,ew.closestTargetDistance=o,ew}function nw(e,t){let n=[];for(let r=0;r<t.length;++r)rw(e,t[r].getGeometry(),n);return n}function rw(e,t,n){if(t instanceof ld){iw(e,t.getCoordinates(),!1,n);return}if(t instanceof ud){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)iw(e,r[t],!1,n);return}if(t instanceof Va){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)iw(e,r[t],!0,n);return}if(t instanceof fd){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)iw(e,i[t],!0,n)}return}if(t instanceof od){let r=t.getGeometries();for(let t=0;t<r.length;++t)rw(e,r[t],n);return}}function iw(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=t[e],s=t[e+1],c=cw(i,a,o,s);if(c.squaredDistance===0){let i=e+c.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function aw(e,t){return Pt(e[0],e[1],t[0],t[1])}function ow(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return aw($C(e,r),$C(e,i));let s=0;if(r<a){let t=$C(e,r),n=QC(e,a);s+=aw(t,n)}if(o<i){let t=QC(e,o),n=$C(e,i);s+=aw(t,n)}for(let t=a;t<o-1;++t){let n=QC(e,t),r=QC(e,t+1);s+=aw(n,r)}return s}var sw={along:0,squaredDistance:0};function cw(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=Mt(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),sw.along=u,sw.squaredDistance=Bt(Pt(e,t,d,f),10),sw}var lw={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`},uw=class extends et{constructor(e,t){super(e),this.feature=t}},dw=class extends Qo{constructor(e){let t=e;t.stopDown||=Je,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_=pw(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:qe,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;if(e===`Circle`)n=(e,t,n)=>{let r=t||new ad([NaN,NaN]),i=yi(e[0],n),a=Ln(i,yi(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=_i();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=xa:e===`LineString`?t=ld:e===`Polygon`&&(t=Va),n=(n,r,i)=>(r?e===`Polygon`?n[0].length?r.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):r.setCoordinates([],this.geometryLayout_):r.setCoordinates(n,this.geometryLayout_):r=new t(n,this.geometryLayout_),r)}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,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 _y({source:new Ov({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:fw(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Ko,this.freehandCondition_,e.freehand?this.freehandCondition_=Ho:this.freehandCondition_=e.freehandCondition?e.freehandCondition:Jo,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Mo.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?Ho:e:Wo,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehand_?this.freehandCondition_=Ho:this.freehandCondition_=this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:Jo}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===M.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===I.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===I.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===I.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===I.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===I.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===I.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===I.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}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 pt(I.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}let t=this.getMap(),n=qt([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=nw(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&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 n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(QC(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(QC(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&Rn(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=tw(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex;let i=$C(r.coordinates,r.endIndex),a=this.getMap().getPixelFromCoordinate(i);e.coordinate=i,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_===`Point`)&&(this.atFinish_(e.pixel,n)?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_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=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 n=!1;if(this.sketchFeature_){let r=!1,i=[this.finishCoordinate_],a=this.mode_;if(a===`Point`)n=!0;else if(a===`Circle`)n=this.sketchCoords_.length===2;else if(a===`LineString`)r=!t&&this.sketchCoords_.length>this.minPoints_;else if(a===`Polygon`){let e=this.sketchCoords_;r=e[0].length>this.minPoints_,i=[e[0][0],e[0][e[0].length-2]],i=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(r){let t=this.getMap();for(let r=0,a=i.length;r<a;r++){let a=i[r],o=t.getPixelFromCoordinate(a),s=e[0]-o[0],c=e[1]-o[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=a;break}}}}return n}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new $u(new xa(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new $u;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new ld(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=Yi(this.geometryLayout_);for(;e.length<n;)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 $u(new ld(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new $u,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new uw(lw.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=Yi(this.geometryLayout_),a,o;for(;e.length<i;)e.push(0);this.mode_===`Point`?o=this.sketchCoords_:this.mode_===`Polygon`?(a=this.sketchCoords_[0],o=a[a.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,o=a[a.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),n.getType()===`Polygon`&&this.mode_!==`Polygon`?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r,i,a=this.mode_;return a===`LineString`||a===`Circle`?(this.finishCoordinate_=e.slice(),i=this.sketchCoords_,i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),this.geometryFunction_(i,t,n)):a===`Polygon`&&(i=this.sketchCoords_[0],i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),r&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,t,n)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;for(let i=0;i<e;++i){let e;if(r===`LineString`||r===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,n),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r===`Polygon`){e=this.sketchCoords_[0],e.splice(-2,1);let r=this.sketchLine_.getGeometry();if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}r.setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,n)}if(e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,r)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,r),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new dd([t])):this.type_===`MultiLineString`?e.setGeometry(new ud([t])):this.type_===`MultiPolygon`&&e.setGeometry(new fd([t])),this.dispatchEvent(new uw(lw.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new uw(lw.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&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;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();let n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new $u(new xa(n)),this.updateSketchFeatures_(),this.dispatchEvent(new uw(lw.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){let e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function fw(){let e=ru();return function(t,n){return e[t.getGeometry().getType()]}}function pw(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}var mw=0,hw=1,gw=[0,0,0,0],_w=[],vw={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function yw(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]];break;default:}return r}var bw=class extends et{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},xw=class extends Qo{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:Zo,this.defaultDeleteCondition_=function(e){return Ro(e)&&Go(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Ho,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Cv,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new _y({source:new Ov({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Tw(),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 dt(this.source_.getFeatures()),this.source_.addEventListener(Ev.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Ev.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw 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(Ie.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(Ie.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;t=e?e===!0?Ho:e:Wo,this.traceCondition_=t}addFeature_(e){let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_),e.addEventListener(M.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new dt;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new bw(vw.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(M.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}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_){let t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(qt(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(qt(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(qt(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(qt(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:mw,segment:[n,n]},i={feature:e,geometry:t,index:hw,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(on(n),r);let o=t,s=_i();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=Ua(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t],i=this.SEGMENT_WRITERS_[r.getType()];i(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new $u(new xa(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==I.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=I.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==I.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=qt([r]),a=this.rBush_.getInExtent(i),o={};a.sort(Sw);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=F(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===hw){Pn(ww(e,s,t),r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s);continue}if(Pn(c[0],r)&&!o[l][0]){this.dragSegments_.push([s,0]),o[l][0]=s;continue}if(Pn(c[1],r)&&!o[l][1]){if(o[l][0]&&o[l][0].index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue;break;default:}}this.dragSegments_.push([s,1]),o[l][1]=s;continue}F(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&Rn(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=tw(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}else for(let e of this.traceSegments_){let t=e[0],n=t.geometry,r=e[1],i=n.getCoordinates();yw(i,n.getType(),t.depth).splice(t.index+r,1),n.setCoordinates(i),r===0&&--t.index}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=qt([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=nw(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&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 n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();yw(o,r.getType(),t.depth).splice(a,n),r.setCoordinates(o),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(QC(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(QC(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();yw(o,n.getType(),t.depth).splice(a,0,...r),n.setCoordinates(o),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1];for(;e.length<o.getStride();)e.push(a[s][e.length]);switch(o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`MultiPolygon`:i=o.getCoordinates(),i[r[1]][r[0]][n.index+s]=e,a[s]=e;break;case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===mw)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=Rn(yi(t.getCenter(),n),yi(e,n)),i=_i();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}break;default:}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_){let n=t[0];Rn(Nn(i,n.segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t)}}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}this.updateTrace_(e),this.createOrUpdateVertexFeature_(t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){let n=this.dragSegments_[t][0],r=n.geometry;if(r.getType()===`Circle`){let t=r,i=t.getCenter(),a=n.featureSegments[0],o=n.featureSegments[1];a.segment[0]=i,a.segment[1]=i,o.segment[0]=i,o.segment[1]=i,this.rBush_.update(on(i),a);let s=t,c=_i();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=Ua(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(qt(n.segment),n)}return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new bw(vw.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=function(t,n){return Cw(e,t,r)-Cw(e,n,r)},a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new xa(vi(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof $u&&this.features_.getArray().includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=bi(Yt(xi(on(e,gw),r),t.getView().getResolution()*this.pixelTolerance_,gw),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=ww(e,s,r),u=t.getPixelFromCoordinate(l),d=Rn(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[F(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===hw)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=Ln(u,e),o=Ln(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[F(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(Pn(c[0],t[0])&&Pn(c[1],t[1])||Pn(c[0],t[1])&&Pn(c[1],t[0])){let r=F(a[e].geometry);r in f||(f[r]=!0,n[F(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(qt(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(qt(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?vi(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(qt([e])).some(({segment:t})=>Pn(t[0],e)||Pn(t[1],e))}removePoint(e){if(e&&(e=yi(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=I.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new bw(vw.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=F(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1));break;default:}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(qt(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(qt([e])).some(({segment:t})=>!(Pn(t[0],e)||Pn(t[1],e)))}insertPoint(e){let t=e?yi(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||Ge(i.depth,n))&&i.index>t&&(i.index+=r)})}};function Sw(e,t){return e.index-t.index}function Cw(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===hw){let t=_i();t&&(i=i.clone().transform(t,n));let r=Ln(i.getCenter(),yi(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=yi(e,n);return _w[0]=yi(t.segment[0],n),_w[1]=yi(t.segment[1],n),zn(i,_w)}function ww(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===hw){let t=r,i=_i();return i&&(t=t.clone().transform(i,n)),vi(t.getClosestPoint(yi(e,n)),n)}let i=yi(e,n);return _w[0]=yi(t.segment[0],n),_w[1]=yi(t.segment[1],n),vi(Nn(i,_w),n)}function Tw(){let e=ru();return function(t,n){return e.Point}}var Ew=new Yl({color:`rgba(255,255,255,0.4)`}),Dw=new Ql({color:`#3399CC`,width:1.25}),Ow=[new $l({image:new Jl({fill:Ew,stroke:Dw,radius:5}),fill:Ew,stroke:Dw})],kw=new $l({image:new Zl({opacity:1,src:`data:image/svg+xml;utf8,
|
|
94
|
+
</svg></div>`;let r=document.createElement(`div`);r.className=`layer-control ol-unselectable ol-control`,r.appendChild(n);let i=document.createElement(`div`);i.classList.add(`layer-selection`,`hidden`),r.appendChild(i),super({element:r,target:t.target}),this.baseLayers.forEach(e=>{i.appendChild(e.thumbnailBox)}),this.layerControlElement=i,n.addEventListener(`click`,this.toggleLayerSelection.bind(this),!1)}baseLayers=[{name:`positron`,image:T4,styleUrl:`https://tiles.openfreemap.org/styles/positron`},{name:`orthofoto`,image:E4,layer:new b1({visible:!1,source:new wy({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:D4,styleUrl:`https://kataster.bev.gv.at/styles/kataster/style_basic.json`}].map((e,t)=>{e.styleUrl&&(e.layer=new ws({visible:t===0}),g4(e.layer,e.styleUrl).catch(t=>{console.error(`Error loading base map '${e.name}':`,t)}));let n=document.createElement(`div`);n.classList.add(`image-box`),t===0&&n.classList.add(`selected`);let r=document.createElement(`img`);return r.src=e.image,r.alt=e.name,n.appendChild(r),n.addEventListener(`click`,t=>{this.baseLayers.forEach(e=>{t.target===e.thumbnailBox?e.thumbnailBox.classList.add(`selected`):e.thumbnailBox.classList.remove(`selected`)}),this.baseLayers.forEach(t=>{t.layer.setVisible(t.name===e.name)})}),e.thumbnailBox=n,e});baseLayerGroup;setMap(e){this.getMap()&&this.getMap().removeLayer(this.baseLayerGroup),e&&(this.baseLayerGroup=new ws({layers:this.baseLayers.map(e=>e.layer)}),e.addLayer(this.baseLayerGroup)),super.setMap(e)}layerControlElement=null;set displayLayerSelection(e){if(this.#e(),e){this.layerControlElement.classList.remove(`hidden`);let e=this.getMap(),t=e.getTargetElement(),n=()=>{this.displayLayerSelection=!1},r=setTimeout(()=>t.addEventListener(`click`,n)),i=e.once(`moveend`,n);this.#e=()=>{clearTimeout(r),t.removeEventListener(`click`,n),rt(i),this.#e=()=>{}}}else this.fadeOutAndHide()}#e=()=>{};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)}},k4=class extends Fo{#e=null;#t=new M0({source:new xv});constructor(e){super(),this.#e=e.yioMap;let t=this.#t.getSource();t.addEventListener(`change`,()=>{this.#e.userSelect=t.getFeatures().map(e=>e.getProperties())})}setMap(e){let t=this.getMap();t&&t.removeLayer(this.#t),e&&e.addLayer(this.#t),super.setMap(e)}#n(e){let t=this.getMap(),n=this.#e._getContentLayer();t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).filter(e=>e.get(`id`)!==void 0).length?t.getTargetElement().classList.add(`cursor-pointer`):t.getTargetElement().classList.remove(`cursor-pointer`)}#r(e){let t=this.getMap(),n=this.#e._getContentLayer(),r=this.#t.getSource(),i=t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).filter(e=>e.get(`id`)!==void 0);return r.clear(),r.addFeatures(i.map(e=>e instanceof Cd?Td(e):e)),this.#e.notifyNextChange=!0,this.#e._handleClick(e.originalEvent),i.length===0}handleEvent(e){return e.type===`pointermove`&&this.#n(e),e.type!==`singleclick`||this.#r(e)}setActive(e){super.setActive(e),e||(this.#t.getSource().clear(),this.#e&&(this.#e.userSelect.length=0))}},A4=class e extends Yi{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return en(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let 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){if(Cn(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||un(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=la(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(Ui(n,0,n.length,r,e,t,n)),this.changed()}};A4.prototype.transform;function j4(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function M4(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}var N4={index:-1,endIndex:NaN,closestTargetDistance:1/0};function P4(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN,l=t.targets;if(!l)return N4.index=s,N4.endIndex=c,N4.closestTargetDistance=o,N4;for(let e=0;e<l.length;++e){let n=l[e],r=n.coordinates,u=1/0,d;for(let e=0;e<r.length-1;++e){let t=V4(i,a,r[e],r[e+1]);t.squaredDistance<u&&(u=t.squaredDistance,d=e+t.along)}u<o&&(o=u,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?d!==void 0&&d<n.startIndex&&(d+=r.length):n.endIndex<n.startIndex&&d!==void 0&&d>n.startIndex&&(d-=r.length)),d!==void 0&&(c=d,s=e))}if(s<0)return N4.index=s,N4.endIndex=c,N4.closestTargetDistance=o,N4;let u=l[s],d=u.ring;if(t.targetIndex===s&&d){let e=M4(u.coordinates,c),i=n.getPixelFromCoordinate(e),a=t.startCoord;a&&Ln(i,n.getPixelFromCoordinate(a))>r&&(d=!1)}if(d){let e=u.coordinates,t=e.length,n=u.startIndex,r=c;if(n<r){let i=z4(e,n,r);z4(e,n,r-t)<i&&(c-=t)}else{let i=z4(e,n,r);z4(e,n,r+t)<i&&(c+=t)}}return N4.index=s,N4.endIndex=c,N4.closestTargetDistance=o,N4}function F4(e,t){let n=[];for(let r=0;r<t.length;++r){let i=t[r].getGeometry();i&&I4(e,i,n)}return n}function I4(e,t,n){if(t instanceof _d)L4(e,t.getCoordinates(),!1,n);else if(t instanceof vd){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)L4(e,r[t],!1,n)}else if(t instanceof Ua){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)L4(e,r[t],!0,n)}else if(t instanceof xd){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)L4(e,i[t],!0,n)}}else if(t instanceof Ed){let r=t.getGeometries();for(let t=0;t<r.length;++t)I4(e,r[t],n)}}function L4(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=V4(i,a,t[e],t[e+1]);if(o.squaredDistance===0){let i=e+o.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function R4(e,t){return jt(e[0],e[1],t[0],t[1])}function z4(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return R4(M4(e,r),M4(e,i));let s=0;if(r<a){let t=M4(e,r),n=j4(e,a);s+=R4(t,n)}if(o<i){let t=j4(e,o),n=M4(e,i);s+=R4(t,n)}for(let t=a;t<o-1;++t){let n=j4(e,t),r=j4(e,t+1);s+=R4(n,r)}return s}var B4={along:0,squaredDistance:0};function V4(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=kt(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),B4.along=u,B4.squaredDistance=Lt(jt(e,t,d,f),10),B4}var H4={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`},U4=class extends et{constructor(e,t){super(e),this.feature=t}},W4=class extends es{constructor(e){let t=e;t.stopDown||=Xe,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_=K4(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:Ye,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;n=e===`Circle`?((e,t,n)=>{let r=t||new A4([NaN,NaN]),i=e,a=bi(i[0],n),o=In(a,bi(i[i.length-1],n));r.setCenterAndRadius(a,Math.sqrt(o),this.geometryLayout_);let s=vi();return s&&r.transform(n,s),r}):(t,n,r)=>{if(n){if(e===`Polygon`){let e=t;e[0].length?n.setCoordinates([e[0].concat([e[0][0]])],this.geometryLayout_):n.setCoordinates([],this.geometryLayout_)}else n.setCoordinates(t,this.geometryLayout_)}else n=e===`Point`?new Na(t,this.geometryLayout_):e===`LineString`?new _d(t,this.geometryLayout_):new Ua(t,this.geometryLayout_);return n}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,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 M0({source:new xv({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:G4(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Jo,this.freehandCondition_,this.freehandCondition_=e.freehand?Wo:e.freehandCondition?e.freehandCondition:Xo,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Po.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?Wo:e:Ko,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?Wo:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:Xo}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===F.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===R.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===R.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===R.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===R.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===R.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===R.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===R.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}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 ut(R.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState??void 0))},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}let t=this.getMap();if(!t)return;let n=Wt([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=F4(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&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 n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(j4(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(j4(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_,n=t.targets,r=t.startCoord,i=this.getMap();if(!t.active||!n||!r||!i||t.targetIndex===-1&&Ln(e.map.getPixelFromCoordinate(r),e.pixel)<this.snapTolerance_)return;let a=P4(e.coordinate,t,i,this.snapTolerance_);if(a.index<0)return;if(t.targetIndex!==a.index){let e=t.targetIndex;if(e!==void 0&&e!==-1){let t=n[e];this.removeTracedCoordinates_(t.startIndex,t.endIndex)}let r=n[a.index];this.addTracedCoordinates_(r,r.startIndex,a.endIndex)}else{let e=n[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,a.endIndex)}t.targetIndex=a.index;let o=n[t.targetIndex];o.endIndex=a.endIndex;let s=M4(o.coordinates,o.endIndex),c=i.getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(c[0]),Math.round(c[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():this.freehand_||r&&this.mode_!==`Point`||(this.atFinish_(e.pixel,n)?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_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?(this.updateTrace_(e),this.modifyDrawing_(e.coordinate)):this.createOrUpdateSketchPoint_(e.coordinate.slice())}atFinish_(e,t){let n=!1,r=this.sketchCoords_,i=this.finishCoordinate_;if(this.sketchFeature_&&r&&i){let a=!1,o=[i],s=this.mode_;if(s===`Point`)n=!0;else if(s===`Circle`)n=r.length===2;else if(s===`LineString`)a=!t&&r.length>this.minPoints_;else if(s===`Polygon`){let e=r;a=e[0].length>this.minPoints_,o=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(a){let t=this.getMap();if(t)for(let r=0,i=o.length;r<i;r++){let i=o[r],a=t.getPixelFromCoordinate(i),s=e[0]-a[0],c=e[1]-a[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=i;break}}}}return n}createOrUpdateSketchPoint_(e){if(!this.sketchPoint_)this.sketchPoint_=new dd(new Na(e)),this.updateSketchFeatures_();else{let t=this.sketchPoint_.getGeometry();t&&t.setCoordinates(e)}}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new dd;let t=e.getLinearRing(0);if(!t)return;let n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new _d(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap();if(!t)return;let n=t.getView().getProjection(),r=Zi(this.geometryLayout_);for(;e.length<r;)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 dd(new _d(this.sketchLineCoords_)));let i=this.geometryFunction_(this.sketchCoords_,void 0,n);this.sketchFeature_=new dd,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new U4(H4.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_,r=this.sketchCoords_;if(!t||!n||!r)return;let i=n.getGeometry();if(!i)return;let a=t.getView().getProjection(),o=Zi(this.geometryLayout_),s,c;for(;e.length<o;)e.push(0);let l=this.finishCoordinate_;if(this.mode_===`Point`?c=r:this.mode_===`Polygon`?(s=r[0],c=s[s.length-1],l&&this.atFinish_(t.getPixelFromCoordinate(e))&&(e=l.slice())):(s=r,c=s[s.length-1]),c[0]=e[0],c[1]=e[1],this.geometryFunction_(r,i,a),this.sketchPoint_){let t=this.sketchPoint_.getGeometry();t&&t.setCoordinates(e)}if(i.getType()===`Polygon`&&this.mode_!==`Polygon`)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_&&this.sketchLine_){let e=this.sketchLine_.getGeometry();e&&e.setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_,n=this.sketchCoords_;if(!t||!n)return null;let r=t.getGeometry();if(!r)return null;let i=this.getMap();if(!i)return null;let a=i.getView().getProjection(),o,s,c=this.mode_;return c===`LineString`||c===`Circle`?(this.finishCoordinate_=e.slice(),s=n,s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(e.slice()),this.geometryFunction_(s,r,a)):c===`Polygon`&&(s=n[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(e.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(n,r,a)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),o?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_||!this.sketchCoords_)return;let t=this.sketchFeature_.getGeometry();if(!t)return;let n=this.getMap();if(!n)return;let r=n.getView().getProjection(),i=this.mode_;for(let n=0;n<e;++n){let e;if(i===`LineString`||i===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,r),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(i===`Polygon`){if(e=this.sketchCoords_[0],e.splice(-2,1),this.sketchLine_){let t=this.sketchLine_.getGeometry();if(t){if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}t.setCoordinates(e)}}this.geometryFunction_(this.sketchCoords_,t,r)}if(e&&e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap();if(!t||!n||!r)return e;let i=r.getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,i)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,i),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new yd([t])):this.type_===`MultiLineString`?e.setGeometry(new vd([t])):this.type_===`MultiPolygon`&&e.setGeometry(new xd([t])),this.dispatchEvent(new U4(H4.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource()?.clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new U4(H4.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&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;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();if(!(t instanceof _d))return;let n=t;this.sketchFeature_=e,this.sketchCoords_=n.getCoordinates();let r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new dd(new Na(r)),this.updateSketchFeatures_(),this.dispatchEvent(new U4(H4.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t&&(t.clear(!0),t.addFeatures(e))}updateState_(){let e=this.getMap(),t=this.getActive();e&&t||this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function G4(){let e=mu();return function(t){let n=t.getGeometry();return n?e[n.getType()]:null}}function K4(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}var q4=0,J4=1,Y4=[0,0,0,0],X4=[],Z4={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function Q4(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]]}return r}var $4=class extends et{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},e3=class extends es{constructor(e){if(super(e),this.handleSourceAdd_=this.handleSourceAdd_.bind(this),this.handleSourceRemove_=this.handleSourceRemove_.bind(this),this.handleExternalCollectionAdd_=this.handleExternalCollectionAdd_.bind(this),this.handleExternalCollectionRemove_=this.handleExternalCollectionRemove_.bind(this),this.handleFeatureChange_=this.handleFeatureChange_.bind(this),this.on,this.once,this.un,this.condition_=e.condition?e.condition:$o,this.defaultDeleteCondition_=function(e){return Bo(e)&&qo(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Wo,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new vv,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new M0({source:new xv({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:i3(),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,this.filterFunctionWasSupplied_=e.filter!=null,this.filter_=e.filter?e.filter:()=>!0,this.coordinatesEqual_=e.sharedVerticesEqual?e.sharedVerticesEqual:Nn,!(e.features||e.source))throw Error(`The modify interaction requires features collection or a source`);let t;if(e.features)t=e.features.getArray(),e.features.addEventListener(Me.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(Me.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features;else{let n=e.source;t=n.getFeatures(),n.addEventListener(yv.ADDFEATURE,this.handleSourceAdd_),n.addEventListener(yv.REMOVEFEATURE,this.handleSourceRemove_),this.source_=n}t.forEach(e=>{e.addEventListener(F.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(Ne.PROPERTYCHANGE,this.handleFeatureChange_)}),e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=[],t.filter(this.filter_).forEach(e=>this.addFeature_(e)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;t=e?e===!0?Wo:e:Ko,this.traceCondition_=t}addFeature_(e){this.features_.push(e);let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ct;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new $4(Z4.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){let t=this.features_.indexOf(e);this.features_.splice(t,1),this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.length===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}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){let t=e.feature;t&&this.externalAddFeatureHandler_(t)}handleSourceRemove_(e){let t=e.feature;t&&this.externalRemoveFeatureHandler_(t)}handleExternalCollectionAdd_(e){let t=e.element;t&&this.externalAddFeatureHandler_(t)}handleExternalCollectionRemove_(e){let t=e.element;t&&this.externalRemoveFeatureHandler_(t)}externalAddFeatureHandler_(e){e.addEventListener(F.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(Ne.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(F.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Ne.PROPERTYCHANGE,this.handleFeatureChange_),this.removeFeature_(e)}handleFeatureChange_(e){if(!this.changingFeature_){let t=e.target;this.removeFeature_(t),this.filter_(t)&&this.addFeature_(t)}}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(Wt(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(Wt(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(Wt(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(Wt(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:q4,segment:[n,n]},i={feature:e,geometry:t,index:J4,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(nn(n),r);let o=t,s=vi();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=Ga(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t];(0,this.SEGMENT_WRITERS_[r.getType()])(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new dd(new Na(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==R.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=R.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==R.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=Wt([r]),a=this.rBush_.getInExtent(i),o={};a.sort(t3);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=L(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===J4){let n=r3(e,s,t);this.coordinatesEqual_(n,r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s)}else if(this.coordinatesEqual_(c[0],r)&&!o[l][0])this.dragSegments_.push([s,0]),o[l][0]=s;else if(this.coordinatesEqual_(c[1],r)&&!o[l][1]){let e=o[l][0];if(e&&e.index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue}}this.dragSegments_.push([s,1]),o[l][1]=s}else L(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}tracePassesVertex_(e,t){if(e===t)return!1;if(e<t){let n=Math.ceil(e),r=Math.floor(t);return r===t&&--r,n<=r}let n=Math.floor(e),r=Math.ceil(t);return r===t&&(r+=1),n>=r}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&Ln(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=P4(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;let r=!0;if(t.targetIndex===-1){let e=t.targets[n.index];r=this.tracePassesVertex_(e.startIndex,n.endIndex)}if(r){if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index,t.targets[t.targetIndex].endIndex=n.endIndex}let i=M4(t.targets[n.index].coordinates,n.endIndex);for(let e of this.dragSegments_)this.updateGeometry_(i.slice(),e);return i}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=Wt([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=F4(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}shiftTracedSegmentIndices_(e,t,n){for(let r of this.dragSegments_){let i=r[0];i!==e&&i.geometry===e.geometry&&(i.depth===void 0||e.depth===void 0||Ge(i.depth,e.depth))&&i.index>=t&&(i.index+=n)}}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();Q4(o,r.getType(),t.depth).splice(a,n),this.setGeometryCoordinates_(r,o),this.shiftTracedSegmentIndices_(t,a+n,-n),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(j4(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(j4(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();Q4(o,n.getType(),t.depth).splice(a,0,...r),this.setGeometryCoordinates_(n,o),this.shiftTracedSegmentIndices_(t,a,r.length),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1],c=o.getStride();for(let t=2;t<c;++t)e[t]=a[s][t];switch(e.length=c,o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:{i=o.getCoordinates();let t=i[r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`MultiPolygon`:{i=o.getCoordinates();let t=i[r[1]][r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===q4)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=Ln(bi(t.getCenter(),n),bi(e,n)),i=vi();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_)Ln(Mn(i,t[0].segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t);this.traceSegments_.length>1&&(this.deactivateTrace_(),this.traceSegments_=null)}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}let a=this.updateTrace_(e);this.createOrUpdateVertexFeature_(a||t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){let t=this.traceState_.active?new Set:null;for(let n=this.dragSegments_.length-1;n>=0;--n){let r=this.dragSegments_[n][0];t&&t.add(r.feature);let i=r.geometry;if(i.getType()===`Circle`){let t=i,n=t.getCenter(),a=r.featureSegments[0],o=r.featureSegments[1];a.segment[0]=n,a.segment[1]=n,o.segment[0]=n,o.segment[1]=n,this.rBush_.update(nn(n),a);let s=t,c=vi();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=Ga(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(Wt(r.segment),r)}if(t)for(let e of t)this.removeFeature_(e),this.filter_(e)&&this.addFeature_(e);return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new $4(Z4.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=(t,n)=>n3(e,t,r)-n3(e,n,r),a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new Na(yi(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof dd&&this.features_.includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=xi(Kt(Si(nn(e,Y4),r),t.getView().getResolution()*this.pixelTolerance_,Y4),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=r3(e,s,r),u=t.getPixelFromCoordinate(l),d=Ln(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[L(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===J4)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=In(u,e),o=In(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[L(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(this.coordinatesEqual_(c[0],t[0])&&this.coordinatesEqual_(c[1],t[1])||this.coordinatesEqual_(c[0],t[1])&&this.coordinatesEqual_(c[1],t[0])){let r=L(a[e].geometry);r in f||(f[r]=!0,n[L(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(Wt(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(Wt(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),(this.vertexFeature_?.getGeometry()).getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?yi(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(Wt([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=bi(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=R.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new $4(Z4.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=L(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1))}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(Wt(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(Wt([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?bi(e,this.getMap().getView().getProjection()):(this.vertexFeature_?.getGeometry()).getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||Ge(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(Me.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(Me.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(F.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Ne.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(yv.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(yv.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(F.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Ne.PROPERTYCHANGE,this.handleFeatureChange_)}}};function t3(e,t){return e.index-t.index}function n3(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===J4){let t=vi();t&&(i=i.clone().transform(t,n));let r=In(i.getCenter(),bi(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=bi(e,n);return X4[0]=bi(t.segment[0],n),X4[1]=bi(t.segment[1],n),Rn(i,X4)}function r3(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===J4){let t=r,i=vi();return i&&(t=t.clone().transform(i,n)),yi(t.getClosestPoint(bi(e,n)),n)}let i=bi(e,n);return X4[0]=bi(t.segment[0],n),X4[1]=bi(t.segment[1],n),yi(Mn(i,X4),n)}function i3(){let e=mu();return function(t,n){return e.Point}}var a3=new ou({color:`rgba(255,255,255,0.4)`}),o3=new lu({color:`#3399CC`,width:1.25}),s3=[new uu({image:new au({fill:a3,stroke:o3,radius:5}),fill:a3,stroke:o3})],c3=new uu({image:new cu({opacity:1,src:`data:image/svg+xml;utf8,
|
|
95
95
|
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="%23dc4b6f" viewBox="0 0 24 24">
|
|
96
96
|
<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" />
|
|
97
97
|
</svg>
|
|
98
|
-
`,anchor:[.5,1]})}),
|
|
98
|
+
`,anchor:[.5,1]})}),l3=class extends Fo{#e=null;#t=null;#n=null;getEditLayer(){return this.#t}clearModifiedFeatures(){if(this.#a.clear(),!this.#t)return;let e=this.#t.getSource(),t=e.getFeatures().filter(e=>e.get(`id`)!==void 0);e.removeFeatures(t)}clearCreatedFeatures(){if(!this.#t)return;let e=this.#t.getSource(),t=e.getFeatures().filter(e=>e.get(`id`)===void 0);e.removeFeatures(t)}#r;#i=null;#a=new Set;constructor(e){super(),this.#e=e.yioMap}drawInteraction;modifyInteraction;#o(e){this.#e._handleClick(e.originalEvent)}#s=null;#c=!1;#l(){this.drawInteraction=new W4({source:this.#t.getSource(),condition:e=>Jo(e)?this.createEnabled&&!this.#c:!1,type:`Point`,style:()=>this.#c?null:s3}),this.getMap().addInteraction(this.drawInteraction),this.drawInteraction.on(`drawend`,e=>{e.feature.set(`mvt:layer`,this.#r)}),this.modifyInteraction=new e3({source:this.#t.getSource(),condition:e=>$o(e)?this.modifyEnabled:!1,style:()=>this.#c?null:s3}),this.getMap().addInteraction(this.modifyInteraction)}#u(){this.drawInteraction&&=(this.drawInteraction.setMap(null),null),this.modifyInteraction&&=(this.modifyInteraction.setMap(null),null)}#d=Promise.resolve();setActive(e){return this.getMap()?(this.#d=this.#d.then(()=>this.#f(e)).catch(e=>console.error(`Error toggling edit mode:`,e)),this.#d):Promise.resolve()}async contentChanged(){let e=await this.#e._getContentLayerPromise();this.#t&&e?.getLayers().getArray().includes(this.#t)||(this.getActive()&&await this.setActive(!1),this.#t=null,this.#n=null,this.#a.clear(),await this.setActive(this.createEnabled||this.modifyEnabled))}async#f(e){if(e===!!this.getActive())return;let t=this.getMap();if(t){if(e){let e=await this.#e._getContentLayerPromise();if(!e)return;if(!C4(e,`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.`);let t=e.get(`mapbox-style`);t.sources.edits={type:`geojson`,data:{type:`FeatureCollection`,features:[]}};let n=[];for(let e of t.layers)t.sources[e.source]?.type!==`vector`||e.type!==`circle`&&e.type!==`symbol`||n.push({id:`edits-`+e.id,"source-layer":e[`source-layer`]});n.length||n.push({id:`edits`});for(let t of n)await y4(e,{...t,source:`edits`,type:`circle`,paint:{"circle-radius":5,"circle-color":`#ff0000`,"circle-stroke-width":1}})}this.#t=C4(e,`edits`)[0],this.#n=this.#e._getContentLayer().getLayers().getArray().filter(e=>e instanceof I0).pop(),this.#n&&!this.#s&&(this.#s=this.#n.getStyle(),this.#n.setStyle((e,t)=>{if(!this.#a.has(e.get(`id`)))return this.#s(e,t)})),this.#p||(this.#p=e=>{if(!this.modifyEnabled)return t.getTargetElement().style.cursor=``,this.#c=!1,null;this.#c=!!this.#m(e.pixel),this.#c?t.getTargetElement().classList.add(`cursor-move`):t.getTargetElement().classList.remove(`cursor-move`)},t.on(`pointermove`,this.#p)),this.#l()}else this.#s&&=(this.#n?.setStyle(this.#s),null),this.#p&&=(t.un(`pointermove`,this.#p),null),this.#u();super.setActive(e)}}get createEnabled(){return!!this.#r}async setCreateEnabled(e){this.#r=e||void 0,e||(this.clearCreatedFeatures(),this.#n?.getSource().refresh()),await this.setActive(!!e||!!this.#i),this.drawInteraction&&this.drawInteraction.setMap(e?this.getMap():null),this.modifyInteraction&&this.modifyInteraction.setMap(e||this.#i?this.getMap():null)}get modifyEnabled(){return!!this.#i||!!this.#r}async setModifyEnabled(e){e&&e.length===0&&(e=null),e||(this.clearModifiedFeatures(),this.#n?.getSource().refresh()),this.#i=e,await this.setActive(!!e||!!this.#r),this.modifyInteraction&&this.modifyInteraction.setMap(e||this.#r?this.getMap():null)}#p=null;#m(e){let t=this.getMap().getFeaturesAtPixel(e,{layerFilter:e=>e===this.#t||e==this.#n}).filter(e=>e.getGeometry().getType()===`Point`&&(this.#t.getSource().hasFeature(e)||this.#i?.includes(e.get(`id`))));return t.length?t[0]:null}handleEvent(e){let t=!0;if(e.type===`pointerdown`){let t=this.#m(e.pixel);if(t&&t instanceof Cd&&this.modifyEnabled){let e=t.get(`id`);this.#a.has(e)||this.#a.add(e),this.#n.changed();let n=Td(t);this.#t.getSource().addFeature(n)}}return t&&this.modifyEnabled&&(t=this.modifyInteraction.handleEvent(e)),t&&this.createEnabled&&(t=this.drawInteraction.handleEvent(e)),t&&e.type===`click`&&this.#o(e),t}},u3=class extends Fo{#e=null;#t=new M0({source:new xv});constructor(e){super(),this.#e=e.yioMap,this.setActive(!1)}setMap(e){let t=this.getMap();t&&t.removeLayer(this.#t),e&&e.addLayer(this.#t),super.setMap(e)}#n(e){let t=this.#t.getSource();t.clear();let n=new dd(new Na(e));n.setStyle(c3),t.addFeature(n),this.#e.dispatchEvent(new CustomEvent(`pin`,{composed:!0,bubbles:!0,detail:{coordinate:ui(e)}}))}#r(e){let t=this.getMap(),n=this.#e._getContentLayer();t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).length===0&&this.#n(e.coordinate)}setActive(e){e||this.#t.getSource().clear(),super.setActive(e)}setPin(e){this.#n(e)}handleEvent(e){return e.type===`singleclick`&&this.#r(e),!0}},d3=`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`,f3={name:`yio-map`,description:`Web component for interactive maps using LitElement and OpenLayers`,license:`MIT`,author:`yio-map`,repository:{type:`git`,url:`https://github.com/yiogmbh/yio-map`},version:`0.15.0`,type:`module`,files:[`dist`],exports:{".":{import:`./dist/yio-map.js`,types:`./dist/index.d.ts`}},scripts:{start:`vite`,build:`vite build && vite -c vite.config-umd.js build && tsc src/index.js --outDir dist --skipLibCheck --allowJS --declaration --declarationMap --emitDeclarationOnly`,prepublishOnly:`npm run build`,lint:`eslint --ext .js,.html . && prettier "**/*.(js|html)" --check --ignore-path .gitignore`,format:`eslint --ext .js,.html . --fix && prettier "**/*.(js|html)" --write --ignore-path .gitignore`,prepare:`husky`,pretest:`tsc --noEmit && npx playwright install chromium-headless-shell`,test:`vitest run --silent`,"test:watch":`npm run pretest && vitest watch`,storybook:`storybook dev -p 6006`,"storybook:build":`storybook build`},dependencies:{lit:`^3.3.3`},peerDependencies:{ol:`^10.11.0`,"ol-mapbox-style":`^13.9.0`},devDependencies:{"@chromatic-com/storybook":`^5.6.0`,"@eslint/js":`^10.0.1`,"@storybook/addon-docs":`10.6.9`,"@storybook/web-components":`^10.6.9`,"@storybook/web-components-vite":`^10.6.9`,"@types/node":`^25.9.12`,"@vitest/browser":`^5.1.2`,"@vitest/browser-playwright":`^5.1.2`,eslint:`^10.15.0`,"eslint-config-flat-gitignore":`^2.4.0`,"eslint-config-prettier":`^10.1.9`,"eslint-plugin-html":`^8.2.1`,"eslint-plugin-storybook":`^10.6.9`,globals:`^17.14.0`,husky:`^9.1.7`,"lint-staged":`^17.6.2`,playwright:`^1.65.1`,prettier:`^3.10.1`,"rollup-plugin-peer-deps-external":`^2.2.4`,storybook:`10.6.9`,typescript:`^5.9.3`,vite:`8.4.0`,vitest:`^5.1.2`},"lint-staged":{"*.js":[`eslint --fix`,`prettier --write`]}};function p3(){let e=document.createElement(`img`);return e.src=d3,e.alt=`yio.at`,e.style.height=`1em`,new ko({label:e,render:m3})}function m3(e){let t=this.element;if(!t||!e.frameState)return;let n=this.collectSourceAttributions_(e.frameState)??[],r=[];r.push(`
|
|
99
99
|
<a href="https://yio.at" target="_blank" rel="noopener">
|
|
100
100
|
<b>yio gmbh</b>
|
|
101
|
-
</a> v${
|
|
102
|
-
`);for(let e of n)r.push(e);let i=r.map((e,t)=>t===0?`<li>${e}</li>`:`<li><span style="margin: 0 4px 0 2px;">|</span>${e}</li>`).join(``),a=t.querySelector(`ul`);a||(a=document.createElement(`ul`),t.appendChild(a)),a.innerHTML=i}
|
|
101
|
+
</a> v${f3.version}
|
|
102
|
+
`);for(let e of n)r.push(e);let i=r.map((e,t)=>t===0?`<li>${e}</li>`:`<li><span style="margin: 0 4px 0 2px;">|</span>${e}</li>`).join(``),a=t.querySelector(`ul`);a||(a=document.createElement(`ul`),t.appendChild(a)),a.innerHTML=i}var h3=`.address-search{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px}.search-container{flex-direction:column;width:100%;display:flex;position:relative}.search-input-wrapper{background:#fff;border:1px solid #ccc;border-radius:4px;align-items:center;padding:0 10px;display:flex}.search-icon{fill:#666;flex-shrink:0;width:16px;height:16px;margin-right:8px}.search-input{background:0 0;border:none;outline:none;flex:1;padding:10px 0;font-size:14px}.search-input::placeholder{color:#999}.loading-indicator{border:2px solid #e0e0e0;border-top-color:#666;border-radius:50%;flex-shrink:0;width:16px;height:16px;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.results-dropdown{background:#fff;border:1px solid #ccc;border-radius:4px;margin-top:4px;display:none}.search-container:focus-within .results-dropdown{display:block}.results-list{max-height:300px;margin:0;padding:0;list-style:none;overflow-y:auto}@container (width>=10px){.results-list{max-height:70cqh}}.result-item{cursor:pointer;border-bottom:1px solid #eee;align-items:stretch;padding:10px 12px;transition:background-color .15s;display:flex}.result-item:last-child{border-bottom:none}.result-item:hover{background-color:#f5f5f5}.result-icon{fill:#666;flex-shrink:0;width:20px;height:20px;margin-right:10px}.result-icon.special{fill:#df486e}.result-content{flex-direction:column;flex:1;justify-content:center;min-width:0;display:flex}.result-title{color:#333;white-space:nowrap;text-overflow:ellipsis;font-weight:500;overflow:hidden}.result-subtitle{color:#666;white-space:nowrap;text-overflow:ellipsis;margin-top:2px;font-size:12px;overflow:hidden}.result-distance{color:#999;white-space:nowrap;flex-shrink:0;margin-left:8px;font-size:12px}.results-footer{color:#666;background:#fafafa;border-top:1px solid #eee;padding:8px 12px;font-size:12px}.prefer-close-label{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;display:flex}.prefer-close-label input{margin-left:0;margin-right:3px}.no-results{text-align:center;color:#666;padding:16px 12px}.no-results.error{color:#c62828}.result-count-input{text-align:center;-moz-appearance:textfield;border:1px solid #ccc;border-radius:3px;width:28px;padding:1px 2px;font-size:12px}.result-count-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.result-count-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}`,g3={en:{addressSearch:{placeholder:`Search Address`,searchFailed:`Search failed. Please try again.`,showing:`Showing`,of:`of`,results:`results`,preferNearby:`Prefer nearby`,noResults:`No results`}},de:{addressSearch:{placeholder:`Adresse suchen`,searchFailed:`Suche fehlgeschlagen. Bitte erneut versuchen.`,showing:`Zeige`,of:`von`,results:`Ergebnissen`,preferNearby:`Nächstgelegene bevorzugen`,noResults:`Keine Ergebnisse`}}};function _3(e){return(e||document.documentElement.lang||navigator.language||`en`).split(`-`)[0].toLowerCase()}function v3(e,t){return(g3[_3(t)]??g3.en)[e]??g3.en[e]}var y3=`https://srv.doris.at/solr/searchservice/search/all2`,b3=250,x3=class extends ke{static styles=[a(h3),o`
|
|
103
103
|
:host {
|
|
104
104
|
display: block;
|
|
105
105
|
}
|
|
106
|
-
`];static properties={lang:{type:String},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}};get#e(){return
|
|
106
|
+
`];static properties={lang:{type:String},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}};get#e(){return v3(`addressSearch`,this.lang)}#t=null;#n=null;constructor(){super(),this.resultCount=5,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}#r(e,t){clearTimeout(this.#t),this.#t=setTimeout(e,t)}#i(e){this._query=e.target.value,this.#r(()=>this.#a(),b3)}async#a(){if(this._query.length<this.minSearchLength)this._results=[],this._showResults=!1;else{this.#n?.abort(),this.#n=new AbortController,this._loading=!0,this._showResults=!0,this._error=null;try{this._results=await this.#o(this._query)}catch(e){e.name!==`AbortError`&&(console.error(`Search error:`,e),this._results=[],this._error=this.#e.searchFailed)}finally{this._loading=!1}}}async#o(e){let t=new URLSearchParams({q:e,wt:`json2`,rows:String(this.resultCount)}),n=`${y3}/?${t}`;if(this.sortByDistance&&this.mapCenter){let[e,r]=this.mapCenter;t.set(`pt`,`${r},${e}`),n=`${y3}/geo/?${t}`}let r=await fetch(n,{signal:this.#n.signal});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();return this._totalResults=i?.response?.numFound||0,this.#s(i)}#s(e){return(e?.response?.docs||[]).map(e=>{let t=this.#c(e);return{type:e.type===`GeonamAT`?`special`:`address`,title:e.textsuggest,subtitle:e.subtext,distance:e._dist_?this.#l(e._dist_):null,coordinates:t,raw:e}})}#c(e){if(e.x&&e.y)return[parseFloat(e.x),parseFloat(e.y)];if(Array.isArray(e.geo)){let t=e.geo[0].match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(t)return[parseFloat(t[1]),parseFloat(t[2])]}if(typeof e.geo==`string`){let t=e.geo.match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(t)return[parseFloat(t[1]),parseFloat(t[2])]}return null}#l(e){return e<1e3?`${Math.round(e)} m`:`${(e/1e3).toFixed(1)} km`}#u(e){e.coordinates&&(document.activeElement?.blur(),this._query=e.title,this.dispatchEvent(new CustomEvent(`select`,{detail:{coordinates:e.coordinates,result:e},bubbles:!0,composed:!0})))}#d(e){this.sortByDistance=e.target.checked,this._query.length>=this.minSearchLength&&this.#a()}#f(e){let t=parseInt(e.target.value,10);!t||t<1||(this.resultCount=Math.min(t,100),this.#r(()=>{this._query.length>=this.minSearchLength&&this.#a()},b3))}#p(){return de`
|
|
107
107
|
<svg
|
|
108
108
|
class="search-icon"
|
|
109
109
|
viewBox="0 0 24 24"
|
|
@@ -113,7 +113,7 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
113
113
|
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"
|
|
114
114
|
/>
|
|
115
115
|
</svg>
|
|
116
|
-
`}#m(){return
|
|
116
|
+
`}#m(){return de`
|
|
117
117
|
<svg
|
|
118
118
|
class="result-icon"
|
|
119
119
|
viewBox="0 0 24 24"
|
|
@@ -123,7 +123,7 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
123
123
|
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"
|
|
124
124
|
/>
|
|
125
125
|
</svg>
|
|
126
|
-
`}#h(){return
|
|
126
|
+
`}#h(){return de`
|
|
127
127
|
<svg
|
|
128
128
|
class="result-icon special"
|
|
129
129
|
viewBox="0 0 24 24"
|
|
@@ -133,7 +133,7 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
133
133
|
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"
|
|
134
134
|
/>
|
|
135
135
|
</svg>
|
|
136
|
-
`}#g(){return
|
|
136
|
+
`}#g(){return de`
|
|
137
137
|
<div class="results-footer">
|
|
138
138
|
<span class="result-count-display">
|
|
139
139
|
${this.#e.showing}
|
|
@@ -156,12 +156,12 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
156
156
|
${this.#e.preferNearby}
|
|
157
157
|
</label>
|
|
158
158
|
</div>
|
|
159
|
-
`}#_(){return this._showResults?
|
|
159
|
+
`}#_(){return this._showResults?de`
|
|
160
160
|
<div class="results-dropdown">
|
|
161
161
|
<ul class="results-list">
|
|
162
|
-
${this._error?
|
|
163
|
-
${this._results.length===0&&!this._error?
|
|
164
|
-
${this._results.map(e=>
|
|
162
|
+
${this._error?de`<div class="no-results error">${this._error}</div>`:null}
|
|
163
|
+
${this._results.length===0&&!this._error?de`<div class="no-results">${this.#e.noResults}</div>`:null}
|
|
164
|
+
${this._results.map(e=>de`
|
|
165
165
|
<li
|
|
166
166
|
class="result-item"
|
|
167
167
|
@click=${()=>this.#u(e)}
|
|
@@ -169,19 +169,19 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
169
169
|
${e.type===`special`?this.#h():this.#m()}
|
|
170
170
|
<div class="result-content">
|
|
171
171
|
<div class="result-title">${e.title}</div>
|
|
172
|
-
${e.subtitle?
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
${e.subtitle?de`<div class="result-subtitle">
|
|
173
|
+
${e.subtitle}
|
|
174
|
+
</div>`:null}
|
|
175
175
|
</div>
|
|
176
|
-
${e.distance?
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
${e.distance?de`<span class="result-distance"
|
|
177
|
+
>${e.distance}</span
|
|
178
|
+
>`:null}
|
|
179
179
|
</li>
|
|
180
180
|
`)}
|
|
181
181
|
</ul>
|
|
182
182
|
${this.#g()}
|
|
183
183
|
</div>
|
|
184
|
-
`:null}render(){return
|
|
184
|
+
`:null}render(){return de`
|
|
185
185
|
<div class="address-search">
|
|
186
186
|
<div class="search-container" tabindex="1">
|
|
187
187
|
<div class="search-input-wrapper">
|
|
@@ -193,12 +193,12 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
193
193
|
.value=${this._query}
|
|
194
194
|
@input=${this.#i}
|
|
195
195
|
/>
|
|
196
|
-
${this._loading?
|
|
196
|
+
${this._loading?de`<div class="loading-indicator"></div>`:null}
|
|
197
197
|
</div>
|
|
198
198
|
${this.#_()}
|
|
199
199
|
</div>
|
|
200
200
|
</div>
|
|
201
|
-
`}};customElements.define(`yio-address-search`,
|
|
201
|
+
`}};customElements.define(`yio-address-search`,x3);var S3=class extends Oo{searchElement;constructor(e={}){let t=document.createElement(`yio-address-search`);t.className=`ol-address-search ol-unselectable ol-control`,super({element:t,target:e.target}),this.searchElement=t,e.onSelect&&t.addEventListener(`select`,e.onSelect)}set lang(e){this.searchElement.lang=e}#e=null;setMap(e){if(super.setMap(e),this.#e&&=(rt(this.#e),null),e){let t=e.getView(),n=()=>{let e=t.getCenter();e&&(this.searchElement.mapCenter=ui(e))};n(),this.#e=t.on(`change:center`,n)}}},C3=class extends ke{static styles=[a(Ae),a(je),o`
|
|
202
202
|
:host {
|
|
203
203
|
display: block;
|
|
204
204
|
height: 200px;
|
|
@@ -229,4 +229,4 @@ var YioMap=(function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.
|
|
|
229
229
|
max-width: 300px;
|
|
230
230
|
background-color: transparent;
|
|
231
231
|
}
|
|
232
|
-
`];static 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},lang:{type:String},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}};notifyNextChange=!1;#e=null;#t=``;#n=new
|
|
232
|
+
`];static 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},lang:{type:String},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}};notifyNextChange=!1;#e=null;#t=``;#n=new ws;#r=null;#i=null;#a=null;#o=null;#s=0;#c=null;#l=null;#u=!1;#d=!1;#f=null;#p=null;#m=!1;#h=null;#g=null;constructor(){super(),this.center=[0,0],this.zoom=2,this.userSelect=[],this.#r=new l3({yioMap:this}),this.#i=new k4({yioMap:this}),this.#a=new u3({yioMap:this})}_getContentLayer(){return this.#n}_getContentLayerPromise(){return this.#o}_handleClick(e){e instanceof PointerEvent&&(this.lastClickCoordinate=ui(this.#e.getEventCoordinate(e))),this.dispatchEvent(new PointerEvent(`click`,e))}get contentMap(){return this.#t}set contentMap(e){this.#t=e,this.#_()}get editCreate(){return this.#c}set editCreate(e){this.#c=e,this.#r.setCreateEnabled(e)}set editModify(e){this.#l=e,this.#r.setModifyEnabled(e)}get editModify(){return this.#l}get enableSelect(){return this.#u}set enableSelect(e){this.#u=e,this.#i.setActive(!!this.#u)}get enablePinning(){return this.#d}set enablePinning(e){this.#d=e,this.#a.setActive(!!this.#d)}get geojsonSources(){return this.#f}set geojsonSources(e){this.#f=e}get sourceLayerVisibility(){return this.#p}set sourceLayerVisibility(e){this.#p=e}get enableSearch(){return this.#m}set enableSearch(e){this.#m=e,this.#S()}get lang(){return this.#h}set lang(e){this.#h=e,this.#g&&(this.#g.lang=e)}get editFeatures(){let e=this.#r.getEditLayer()?.getSource()?.getFeatures();return e?new Fd().writeFeaturesObject(e,{dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`}):null}async#_(){let e=++this.#s;if(await this.#o,e===this.#s){if(this.#n.getLayers().clear(),this.#o=null,this.contentMap){if(this.#o=g4(this.#n,this.contentMap).catch(e=>{console.error(`Error applying content to yiomap:`,e)}),await this.#o,e!==this.#s)return;await this.#y(),await this.#v()}await this.#r.contentChanged()}}async#v(){if(!this.#f)return;let e=await this.#o;if(!e)return;let t=Object.keys(this.#f);try{await Promise.all(t.map(t=>{let n=this.#f[t];if(!w4(e,t))throw Error(`Geojson source '`+t+`' does not exist.`);return x4(e,t,{type:`geojson`,data:n}).then(n=>{C4(e,t).forEach(e=>{e.getSource()!==n&&e.setSource(n)})})}))}catch(e){console.error(`Error updating GeoJSON sources:`,e)}}async#y(){if(!this.#p)return;let e=await this.#o;if(!e)return;let t=e.get(`mapbox-style`),n=Object.keys(t.layers);try{await Promise.all(n.map(n=>{let r=t.layers[n],i=r[`source-layer`];if(!i||!(i in this.#p))return;let a=this.#p[i]?`visible`:`none`;b4(e,{...r,layout:{...r.layout,visibility:a}})}))}catch(e){console.error(`Error updating source layer visibility:`,e)}}#b(){this.#e=new ld({controls:Mo({attribution:!1})}),this.#e.addControl(p3()),this.#e.addControl(new O4({map:this.#e})),this.#S(),this.#e.addLayer(this.#n),this.#e.addInteraction(this.#i),this.#i.setActive(this.#u),this.#e.addInteraction(this.#a),this.#a.setActive(this.#d),this.#e.addInteraction(this.#r),this.#r.setActive(!!this.editCreate||!!this.editModify);let e=!0;this.#e.on(`moveend`,()=>{if(e){e=!1;return}let t=this.#e.getView();this.notifyNextChange=!0,this.center=ui(t.getCenter()),this.zoom=t.getZoom()})}firstUpdated(e){super.firstUpdated(e),this.#b();let t=this.shadowRoot.querySelector(`.map`);this.shadowRoot.addEventListener(`click`,e=>e.stopPropagation()),this.#e.setTarget(t)}connectedCallback(){super.connectedCallback(),this.#e&&!this.#e.getTarget()&&this.#e.setTarget(this.shadowRoot.querySelector(`.map`))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.setTarget(null)}updated(e){super.updated(e),e.has(`sourceLayerVisibility`)&&!e.has(`contentMap`)&&this.#o&&this.#y(),e.has(`geojsonSources`)&&!e.has(`contentMap`)&&this.#o&&this.#v(),!this.notifyNextChange&&(e.has(`center`)||e.has(`zoom`))&&this.#e.getView().animate({center:li(this.center),zoom:this.zoom,duration:500}),this.notifyNextChange&&(this.notifyNextChange=!1,this.dispatchEvent(new CustomEvent(`change`,{composed:!0,bubbles:!0,detail:{changedProperties:e}})))}#x=e=>{let{coordinates:t}=e.detail,n=ui(t);t&&(this.center=n,this.zoom=18),this.enablePinning&&this.setPin(n)};setPin(e){this.#a.setPin(li(e))}#S(){this.#e&&(this.#m&&!this.#g?(this.#g=new S3({onSelect:this.#x}),this.#h&&(this.#g.lang=this.#h),this.#e.addControl(this.#g)):!this.#m&&this.#g&&(this.#e.removeControl(this.#g),this.#g=null))}render(){return de`<div class="map"></div>`}};return window.customElements.define(`yio-map`,C3),C3})();
|