@eox/drawtools 0.13.5 → 0.14.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.
@@ -1,18 +1,18 @@
1
- (function(C,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(C=typeof globalThis<"u"?globalThis:C||self,_(C["eox-drawtools"]={}))})(this,function(C){"use strict";var lo=Object.defineProperty;var pn=C=>{throw TypeError(C)};var ho=(C,_,E)=>_ in C?lo(C,_,{enumerable:!0,configurable:!0,writable:!0,value:E}):C[_]=E;var tt=(C,_,E)=>ho(C,typeof _!="symbol"?_+"":_,E),yn=(C,_,E)=>_.has(C)||pn("Cannot "+E);var A=(C,_,E)=>(yn(C,_,"read from private field"),E?E.call(C):_.get(C)),T=(C,_,E)=>_.has(C)?pn("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(C):_.set(C,E),L=(C,_,E,gt)=>(yn(C,_,"write to private field"),gt?gt.call(C,E):_.set(C,E),E);/**
1
+ (function(w,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(w=typeof globalThis<"u"?globalThis:w||self,_(w["eox-drawtools"]={}))})(this,function(w){"use strict";var lo=Object.defineProperty;var pn=w=>{throw TypeError(w)};var ho=(w,_,E)=>_ in w?lo(w,_,{enumerable:!0,configurable:!0,writable:!0,value:E}):w[_]=E;var tt=(w,_,E)=>ho(w,typeof _!="symbol"?_+"":_,E),yn=(w,_,E)=>_.has(w)||pn("Cannot "+E);var A=(w,_,E)=>(yn(w,_,"read from private field"),E?E.call(w):_.get(w)),R=(w,_,E)=>_.has(w)?pn("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(w):_.set(w,E),I=(w,_,E,ft)=>(yn(w,_,"write to private field"),ft?ft.call(w,E):_.set(w,E),E);/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var dn,At,Ft,ct,ut,Gt,dt,Lt;const _=globalThis,E=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Ue=new WeakMap;let _n=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(E&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ue.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ue.set(e,t))}return t}toString(){return this.cssText}};const vn=n=>new _n(typeof n=="string"?n:n+"",void 0,gt),Cn=(n,t)=>{if(E)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=_.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,n.appendChild(i)}},Xe=E?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return vn(e)})(n):n;/**
5
+ */var dn,At,Ft,ct,ut,Gt,dt,It;const _=globalThis,E=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ft=Symbol(),Ue=new WeakMap;let _n=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ft)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(E&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ue.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ue.set(e,t))}return t}toString(){return this.cssText}};const vn=n=>new _n(typeof n=="string"?n:n+"",void 0,ft),wn=(n,t)=>{if(E)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=_.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,n.appendChild(i)}},Xe=E?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return vn(e)})(n):n;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:wn,defineProperty:bn,getOwnPropertyDescriptor:En,getOwnPropertyNames:xn,getOwnPropertySymbols:Pn,getPrototypeOf:Mn}=Object,I=globalThis,Ye=I.trustedTypes,Sn=Ye?Ye.emptyScript:"",te=I.reactiveElementPolyfillSupport,ft=(n,t)=>n,ee={toAttribute(n,t){switch(t){case Boolean:n=n?Sn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},Be=(n,t)=>!wn(n,t),Ve={attribute:!0,type:String,converter:ee,reflect:!1,hasChanged:Be};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),I.litPropertyMetadata??(I.litPropertyMetadata=new WeakMap);class et extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ve){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&bn(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:s}=En(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);s.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ve}static _$Ei(){if(this.hasOwnProperty(ft("elementProperties")))return;const t=Mn(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ft("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ft("properties"))){const e=this.properties,i=[...xn(e),...Pn(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(Xe(r))}else t!==void 0&&e.push(Xe(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Cn(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:ee).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:ee;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??Be)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,o]of r)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var s;return(s=r.hostUpdate)==null?void 0:s.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}et.elementStyles=[],et.shadowRootOptions={mode:"open"},et[ft("elementProperties")]=new Map,et[ft("finalized")]=new Map,te==null||te({ReactiveElement:et}),(I.reactiveElementVersions??(I.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:Cn,defineProperty:bn,getOwnPropertyDescriptor:En,getOwnPropertyNames:xn,getOwnPropertySymbols:Pn,getPrototypeOf:Mn}=Object,L=globalThis,Ye=L.trustedTypes,Sn=Ye?Ye.emptyScript:"",te=L.reactiveElementPolyfillSupport,gt=(n,t)=>n,ee={toAttribute(n,t){switch(t){case Boolean:n=n?Sn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},Be=(n,t)=>!Cn(n,t),Ve={attribute:!0,type:String,converter:ee,reflect:!1,hasChanged:Be};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),L.litPropertyMetadata??(L.litPropertyMetadata=new WeakMap);class et extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ve){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&bn(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:s}=En(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);s.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ve}static _$Ei(){if(this.hasOwnProperty(gt("elementProperties")))return;const t=Mn(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(gt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(gt("properties"))){const e=this.properties,i=[...xn(e),...Pn(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(Xe(r))}else t!==void 0&&e.push(Xe(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wn(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:ee).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:ee;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??Be)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,o]of r)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var s;return(s=r.hostUpdate)==null?void 0:s.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}et.elementStyles=[],et.shadowRootOptions={mode:"open"},et[gt("elementProperties")]=new Map,et[gt("finalized")]=new Map,te==null||te({ReactiveElement:et}),(L.reactiveElementVersions??(L.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const pt=globalThis,Rt=pt.trustedTypes,ze=Rt?Rt.createPolicy("lit-html",{createHTML:n=>n}):void 0,Je="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,We="?"+R,$n=`<${We}>`,N=document,yt=()=>N.createComment(""),mt=n=>n===null||typeof n!="object"&&typeof n!="function",ie=Array.isArray,An=n=>ie(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ne=`[
13
+ */const pt=globalThis,Tt=pt.trustedTypes,ze=Tt?Tt.createPolicy("lit-html",{createHTML:n=>n}):void 0,Je="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,We="?"+T,$n=`<${We}>`,N=document,yt=()=>N.createComment(""),mt=n=>n===null||typeof n!="object"&&typeof n!="function",ie=Array.isArray,An=n=>ie(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ne=`[
14
14
  \f\r]`,_t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qe=/-->/g,Ze=/>/g,O=RegExp(`>|${ne}(?:([^\\s"'>=/]+)(${ne}*=${ne}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,Ke=/"/g,Qe=/^(?:script|style|textarea|title)$/i,Fn=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),k=Fn(1),it=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),ti=new WeakMap,j=N.createTreeWalker(N,129);function ei(n,t){if(!ie(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ze!==void 0?ze.createHTML(t):t}const Gn=(n,t)=>{const e=n.length-1,i=[];let r,s=t===2?"<svg>":t===3?"<math>":"",o=_t;for(let a=0;a<e;a++){const l=n[a];let h,c,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,c=o.exec(l),c!==null);)d=o.lastIndex,o===_t?c[1]==="!--"?o=qe:c[1]!==void 0?o=Ze:c[2]!==void 0?(Qe.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=O):c[3]!==void 0&&(o=O):o===O?c[0]===">"?(o=r??_t,u=-1):c[1]===void 0?u=-2:(u=o.lastIndex-c[2].length,h=c[1],o=c[3]===void 0?O:c[3]==='"'?Ke:De):o===Ke||o===De?o=O:o===qe||o===Ze?o=_t:(o=O,r=void 0);const g=o===O&&n[a+1].startsWith("/>")?" ":"";s+=o===_t?l+$n:u>=0?(i.push(h),l.slice(0,u)+Je+l.slice(u)+R+g):l+R+(u===-2?a:g)}return[ei(n,s+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class vt{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let s=0,o=0;const a=t.length-1,l=this.parts,[h,c]=Gn(t,e);if(this.el=vt.createElement(h,i),j.currentNode=this.el.content,e===2||e===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=j.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const u of r.getAttributeNames())if(u.endsWith(Je)){const d=c[o++],g=r.getAttribute(u).split(R),f=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:f[2],strings:g,ctor:f[1]==="."?In:f[1]==="?"?Rn:f[1]==="@"?Tn:Tt}),r.removeAttribute(u)}else u.startsWith(R)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Qe.test(r.tagName)){const u=r.textContent.split(R),d=u.length-1;if(d>0){r.textContent=Rt?Rt.emptyScript:"";for(let g=0;g<d;g++)r.append(u[g],yt()),j.nextNode(),l.push({type:2,index:++s});r.append(u[d],yt())}}}else if(r.nodeType===8)if(r.data===We)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(R,u+1))!==-1;)l.push({type:7,index:s}),u+=R.length-1}s++}}static createElement(t,e){const i=N.createElement("template");return i.innerHTML=t,i}}function nt(n,t,e=n,i){var o,a;if(t===it)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const s=mt(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=nt(n,r._$AS(n,t.values),r,i)),t}let Ln=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??N).importNode(e,!0);j.currentNode=r;let s=j.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new re(s,s.nextSibling,this,t):l.type===1?h=new l.ctor(s,l.name,l.strings,this,t):l.type===6&&(h=new Nn(s,this,t)),this._$AV.push(h),l=i[++a]}o!==(l==null?void 0:l.index)&&(s=j.nextNode(),o++)}return j.currentNode=N,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},re=class mn{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=nt(this,t,e),mt(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==it&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):An(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==b&&mt(this._$AH)?this._$AA.nextSibling.data=t:this.T(N.createTextNode(t)),this._$AH=t}$(t){var s;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=vt.createElement(ei(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(e);else{const o=new Ln(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=ti.get(t.strings);return e===void 0&&ti.set(t.strings,e=new vt(t)),e}k(t){ie(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const s of t)r===e.length?e.push(i=new mn(this.O(yt()),this.O(yt()),this,this.options)):i=e[r],i._$AI(s),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}};class Tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,s){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,r){const s=this.strings;let o=!1;if(s===void 0)t=nt(this,t,e,0),o=!mt(t)||t!==this._$AH&&t!==it,o&&(this._$AH=t);else{const a=t;let l,h;for(t=s[0],l=0;l<s.length-1;l++)h=nt(this,a[i+l],e,l),h===it&&(h=this._$AH[l]),o||(o=!mt(h)||h!==this._$AH[l]),h===b?t=b:t!==b&&(t+=(h??"")+s[l+1]),this._$AH[l]=h}o&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class In extends Tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}}class Rn extends Tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}}class Tn extends Tt{constructor(t,e,i,r,s){super(t,e,i,r,s),this.type=5}_$AI(t,e=this){if((t=nt(this,t,e,0)??b)===it)return;const i=this._$AH,r=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==b&&(i===b||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Nn{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){nt(this,t)}}const se=pt.litHtmlPolyfillSupport;se==null||se(vt,re),(pt.litHtmlVersions??(pt.litHtmlVersions=[])).push("3.2.1");const On=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const s=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new re(t.insertBefore(yt(),s),s,void 0,e??{})}return r._$AI(n),r};/**
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,Ke=/"/g,Qe=/^(?:script|style|textarea|title)$/i,Fn=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),k=Fn(1),it=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),ti=new WeakMap,j=N.createTreeWalker(N,129);function ei(n,t){if(!ie(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ze!==void 0?ze.createHTML(t):t}const Gn=(n,t)=>{const e=n.length-1,i=[];let r,s=t===2?"<svg>":t===3?"<math>":"",o=_t;for(let a=0;a<e;a++){const l=n[a];let h,c,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,c=o.exec(l),c!==null);)d=o.lastIndex,o===_t?c[1]==="!--"?o=qe:c[1]!==void 0?o=Ze:c[2]!==void 0?(Qe.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=O):c[3]!==void 0&&(o=O):o===O?c[0]===">"?(o=r??_t,u=-1):c[1]===void 0?u=-2:(u=o.lastIndex-c[2].length,h=c[1],o=c[3]===void 0?O:c[3]==='"'?Ke:De):o===Ke||o===De?o=O:o===qe||o===Ze?o=_t:(o=O,r=void 0);const f=o===O&&n[a+1].startsWith("/>")?" ":"";s+=o===_t?l+$n:u>=0?(i.push(h),l.slice(0,u)+Je+l.slice(u)+T+f):l+T+(u===-2?a:f)}return[ei(n,s+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class vt{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let s=0,o=0;const a=t.length-1,l=this.parts,[h,c]=Gn(t,e);if(this.el=vt.createElement(h,i),j.currentNode=this.el.content,e===2||e===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=j.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const u of r.getAttributeNames())if(u.endsWith(Je)){const d=c[o++],f=r.getAttribute(u).split(T),g=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:g[2],strings:f,ctor:g[1]==="."?Ln:g[1]==="?"?Tn:g[1]==="@"?Rn:Rt}),r.removeAttribute(u)}else u.startsWith(T)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Qe.test(r.tagName)){const u=r.textContent.split(T),d=u.length-1;if(d>0){r.textContent=Tt?Tt.emptyScript:"";for(let f=0;f<d;f++)r.append(u[f],yt()),j.nextNode(),l.push({type:2,index:++s});r.append(u[d],yt())}}}else if(r.nodeType===8)if(r.data===We)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(T,u+1))!==-1;)l.push({type:7,index:s}),u+=T.length-1}s++}}static createElement(t,e){const i=N.createElement("template");return i.innerHTML=t,i}}function nt(n,t,e=n,i){var o,a;if(t===it)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const s=mt(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=nt(n,r._$AS(n,t.values),r,i)),t}let In=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??N).importNode(e,!0);j.currentNode=r;let s=j.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new re(s,s.nextSibling,this,t):l.type===1?h=new l.ctor(s,l.name,l.strings,this,t):l.type===6&&(h=new Nn(s,this,t)),this._$AV.push(h),l=i[++a]}o!==(l==null?void 0:l.index)&&(s=j.nextNode(),o++)}return j.currentNode=N,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},re=class mn{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=nt(this,t,e),mt(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==it&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):An(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==b&&mt(this._$AH)?this._$AA.nextSibling.data=t:this.T(N.createTextNode(t)),this._$AH=t}$(t){var s;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=vt.createElement(ei(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(e);else{const o=new In(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=ti.get(t.strings);return e===void 0&&ti.set(t.strings,e=new vt(t)),e}k(t){ie(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const s of t)r===e.length?e.push(i=new mn(this.O(yt()),this.O(yt()),this,this.options)):i=e[r],i._$AI(s),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}};class Rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,s){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,r){const s=this.strings;let o=!1;if(s===void 0)t=nt(this,t,e,0),o=!mt(t)||t!==this._$AH&&t!==it,o&&(this._$AH=t);else{const a=t;let l,h;for(t=s[0],l=0;l<s.length-1;l++)h=nt(this,a[i+l],e,l),h===it&&(h=this._$AH[l]),o||(o=!mt(h)||h!==this._$AH[l]),h===b?t=b:t!==b&&(t+=(h??"")+s[l+1]),this._$AH[l]=h}o&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ln extends Rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}}class Tn extends Rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}}class Rn extends Rt{constructor(t,e,i,r,s){super(t,e,i,r,s),this.type=5}_$AI(t,e=this){if((t=nt(this,t,e,0)??b)===it)return;const i=this._$AH,r=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==b&&(i===b||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Nn{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){nt(this,t)}}const se=pt.litHtmlPolyfillSupport;se==null||se(vt,re),(pt.litHtmlVersions??(pt.litHtmlVersions=[])).push("3.2.1");const On=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const s=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new re(t.insertBefore(yt(),s),s,void 0,e??{})}return r._$AI(n),r};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
@@ -28,12 +28,12 @@
28
28
  * @license
29
29
  * Copyright 2021 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */const Xn=kn(class extends jn{constructor(){super(...arguments),this.key=b}render(n,t){return this.key=n,t}update(n,[t,e]){return t!==this.key&&(Un(n),this.key=t),e}}),Yn=n=>{n.hoverInteraction=n.eoxMap.selectInteractions.selectHover,n.clickInteraction=n.eoxMap.selectInteractions.selectClick;const t=()=>{n.requestUpdate()};n.hoverInteraction.selectStyleLayer.on("change",t),n.clickInteraction.selectStyleLayer.on("change",t)},Bn=(n,t,e)=>{if(n.clickId===t)return;const i=e?[]:[t];n.hoverInteraction.highlightById(i)},Vn=(n,t)=>{n.stopPropagation();const e=Number(n.target.getAttribute("index")),i=t.drawnFeatures[e];t.drawLayer.getSource().removeFeature(i),t.drawnFeatures.splice(e,1),t.requestUpdate()},ii={duration:750},ni={type:"FeatureCollection",features:[]},zn=(n,t)=>{const e=n.getId(),{clickId:i,drawLayer:r,olMap:s,clickInteraction:o}=t,a=i===e,l=n.getGeometry();if(a){const h=r.getSource().getExtent();s.getView().fit(h,ii),o.highlightById([])}else{const h=l.getExtent();o.highlightById([e]),s.getView().fit(h,ii)}t.requestUpdate()},Jn="ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";class ri extends H{constructor(){super();tt(this,"hoverInteraction");tt(this,"clickInteraction");tt(this,"hoverId");tt(this,"clickId");this.eoxMap=null,this.olMap=null,this.draw=null,this.drawLayer=null,this.drawnFeatures=[],this.modify=null,this.unstyled=!1}_handleDelete(e){Vn(e,this),this.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))}_handleFeatureSelectAndDeselect(e){zn(e,this)}_handleHoverFeature(e,i=!1){Bn(this,e,i)}firstUpdated(){Yn(this)}createRenderRoot(){return this}render(){var e,i;return this.hoverId=(e=this.hoverInteraction)==null?void 0:e.selectedFids[0],this.clickId=(i=this.clickInteraction)==null?void 0:i.selectedFids[0],k`
31
+ */const Xn=kn(class extends jn{constructor(){super(...arguments),this.key=b}render(n,t){return this.key=n,t}update(n,[t,e]){return t!==this.key&&(Un(n),this.key=t),e}}),Yn=n=>{n.hoverInteraction=n.eoxMap.selectInteractions.selectHover,n.clickInteraction=n.eoxMap.selectInteractions.selectClick;const t=()=>{n.requestUpdate()};n.hoverInteraction.selectStyleLayer.on("change",t),n.clickInteraction.selectStyleLayer.on("change",t)},Bn=(n,t,e)=>{if(n.clickId===t)return;const i=e?[]:[t];n.hoverInteraction.highlightById(i)},Vn=(n,t)=>{n.stopPropagation();const e=Number(n.target.getAttribute("index")),i=t.drawnFeatures[e];t.drawLayer.getSource().removeFeature(i),t.drawnFeatures.splice(e,1),t.requestUpdate()},ii={duration:750,padding:[20,20,20,20]},ni={type:"FeatureCollection",features:[]},zn=(n,t)=>{const{clickId:e,drawLayer:i,olMap:r,clickInteraction:s}=t,o=s.getId(n);if(e===o){const l=i.getSource().getExtent();r.getView().fit(l,ii),s.highlightById([])}else{const l=t.eoxMap.projection||"EPSG:3857",h=t.eoxDrawTools.projection,c=n.clone().getGeometry().transform(h,l).getExtent();s.highlightById([o]),r.getView().fit(c,ii)}t.requestUpdate()},Jn="ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";class ri extends H{constructor(){super();tt(this,"hoverInteraction");tt(this,"clickInteraction");tt(this,"hoverId");tt(this,"clickId");this.eoxDrawTools=null,this.eoxMap=null,this.olMap=null,this.draw=null,this.drawLayer=null,this.drawnFeatures=[],this.featureName="Feature",this.modify=null,this.unstyled=!1}_handleDelete(e){Vn(e,this),this.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))}_handleFeatureSelectAndDeselect(e){zn(e,this)}_handleHoverFeature(e,i=!1){Bn(this,e,i)}firstUpdated(){Yn(this)}createRenderRoot(){return this}render(){var e,i;return this.hoverId=(e=this.hoverInteraction)==null?void 0:e.selectedFids[0],this.clickId=(i=this.clickInteraction)==null?void 0:i.selectedFids[0],k`
32
32
  <style>
33
33
  ${!this.unstyled&&Jn}
34
34
  </style>
35
35
  <ul class="list-wrap">
36
- ${this.drawnFeatures.map((r,s)=>{const o=s+1,a=r.getId(),l=this.hoverId===a,h=this.clickId===a;return Xn(o,k`
36
+ ${this.drawnFeatures.map((r,s)=>{const o=s+1,a=Object.values(this.eoxMap.selectInteractions)[0].getId(r),l=this.hoverId===a,h=this.clickId===a;return Xn(o,k`
37
37
  <li
38
38
  class="${l||h?"selected":b}"
39
39
  @mouseover=${()=>this._handleHoverFeature(a)}
@@ -43,7 +43,9 @@
43
43
  class="list"
44
44
  @click="${()=>this._handleFeatureSelectAndDeselect(r)}"
45
45
  >
46
- <span class="title">Feature #${o}</span>
46
+ <span class="title"
47
+ >${this.featureName} ${o}</span
48
+ >
47
49
  <button
48
50
  index=${s}
49
51
  class="icon smallest discard"
@@ -55,12 +57,12 @@
55
57
  </li>
56
58
  `)})}
57
59
  </ul>
58
- `}}tt(ri,"properties",{eoxMap:{attribute:!1,state:!0},olMap:{attribute:!1,state:!0},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},modify:{attribute:!1,state:!0},unstyled:{type:Boolean}}),customElements.define("eox-drawtools-list",ri);const Wn=n=>{const{multipleFeatures:t,drawnFeatures:e,currentlyDrawing:i}=n,r=!t&&(e==null?void 0:e.length)>0||i,s=!(e!=null&&e.length)&&!i;return{drawDisabled:r,discardDisabled:s}},qn="button,.button { /* TODO: why does this only work here and not from :root? */ --primary-color: #004170; --primary-color-hover: #004170cc; --error-color: #ff5252; display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0px;}",Zn='textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input,input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004; background-color: var(--background-color);}';function Dn(n){navigator.clipboard.writeText(n).then(function(){},function(t){console.error("Could not copy text: ",t)})}const Kn={PROPERTYCHANGE:"propertychange"},ae={CHANGE:"change"};class Qn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function tr(n,t,e){let i,r;e=e||si;let s=0,o=n.length,a=!1;for(;s<o;)i=s+(o-s>>1),r=+e(n[i],t),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function si(n,t){return n>t?1:n<t?-1:0}function F(n,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let r=0;r<i;r++)n[n.length]=e[r]}function er(n,t){const e=n.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(n[i]!==t[i])return!1;return!0}function oi(){}function ai(n){let t,e,i;return function(){const r=Array.prototype.slice.call(arguments);return(!e||this!==i||!er(r,e))&&(i=this,e=r,t=n.apply(this,arguments)),t}}function li(n){for(const t in n)delete n[t]}function hi(n){let t;for(t in n)return!1;return!t}class ci{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class ir extends Qn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),r=i[t]||(i[t]=[]);r.includes(e)||r.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=e?new ci(t):t;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let h=0,c=r.length;h<c;++h)if("handleEvent"in r[h]?l=r[h].handleEvent(s):l=r[h].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let h=a[i];for(delete a[i];h--;)this.removeEventListener(i,oi);delete o[i]}return l}disposeInternal(){this.listeners_&&li(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const r=i.indexOf(e);r!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[r]=oi,++this.pendingRemovals_[t]):(i.splice(r,1),i.length===0&&delete this.listeners_[t]))}}function Ct(n,t,e,i,r){if(r){const o=e;e=function(a){return n.removeEventListener(t,e),o.call(i??this,a)}}else i&&i!==n&&(e=e.bind(i));const s={target:n,type:t,listener:e};return n.addEventListener(t,e),s}function ui(n,t,e,i){return Ct(n,t,e,i,!0)}function Nt(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),li(n))}class Ot extends ir{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ae.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=Ct(this,t[s],e);return r}return Ct(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const r=t.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=ui(this,t[s],e)}else i=ui(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)nr(i);else if(Array.isArray(t))for(let r=0,s=t.length;r<s;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)}}Ot.prototype.on,Ot.prototype.once,Ot.prototype.un;function nr(n){if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)Nt(n[t]);else Nt(n)}function y(){throw new Error("Unimplemented abstract method.")}let rr=0;function sr(n){return n.ol_uid||(n.ol_uid=String(++rr))}class di extends ci{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class gi extends Ot{constructor(t){super(),this.on,this.once,this.un,sr(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}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(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new di(i,t,e)),i=Kn.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new di(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const r=this.values_||(this.values_={});if(i)r[t]=e;else{const s=r[t];r[t]=e,s!==e&&this.notify(t,s)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],hi(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}function or(n,t){if(!n)throw new Error(t)}class rt extends gi{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new rt(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const 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_&&(Nt(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Ct(t,ae.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?ar(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function ar(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(or(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}const x={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function U(n,t,e){let i,r;return t<n[0]?i=n[0]-t:n[2]<t?i=t-n[2]:i=0,e<n[1]?r=n[1]-e:n[3]<e?r=e-n[3]:r=0,i*i+r*r}function fi(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function pi(n,t){const e=n[0],i=n[1],r=n[2],s=n[3],o=t[0],a=t[1];let l=x.UNKNOWN;return o<e?l=l|x.LEFT:o>r&&(l=l|x.RIGHT),a<i?l=l|x.BELOW:a>s&&(l=l|x.ABOVE),l===x.UNKNOWN&&(l=x.INTERSECTING),l}function le(){return[1/0,1/0,-1/0,-1/0]}function yi(n,t,e,i,r){return r?(r[0]=n,r[1]=t,r[2]=e,r[3]=i,r):[n,t,e,i]}function he(n){return yi(1/0,1/0,-1/0,-1/0,n)}function mi(n,t){const e=n[0],i=n[1];return yi(e,i,e,i,t)}function ce(n,t,e,i,r){const s=he(r);return _i(s,n,t,e,i)}function lr(n,t){return t[0]<n[0]&&(n[0]=t[0]),t[2]>n[2]&&(n[2]=t[2]),t[1]<n[1]&&(n[1]=t[1]),t[3]>n[3]&&(n[3]=t[3]),n}function _i(n,t,e,i,r){for(;e<i;e+=r)hr(n,t[e],t[e+1]);return n}function hr(n,t,e){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],e),n[2]=Math.max(n[2],t),n[3]=Math.max(n[3],e)}function cr(n,t){let e;return e=t(ur(n)),e||(e=t(dr(n)),e)||(e=t(fr(n)),e)||(e=t(gr(n)),e)?e:!1}function ur(n){return[n[0],n[1]]}function dr(n){return[n[2],n[1]]}function kt(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function jt(n){return n[3]-n[1]}function gr(n){return[n[0],n[3]]}function fr(n){return[n[2],n[3]]}function pr(n,t){return n[0]<=t[2]&&n[2]>=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function yr(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n}function mr(n,t,e){let i=!1;const r=pi(n,t),s=pi(n,e);if(r===x.INTERSECTING||s===x.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],h=n[3],c=t[0],u=t[1],d=e[0],g=e[1],f=(g-u)/(d-c);let p,v;s&x.ABOVE&&!(r&x.ABOVE)&&(p=d-(g-h)/f,i=p>=o&&p<=l),!i&&s&x.RIGHT&&!(r&x.RIGHT)&&(v=g-(d-l)*f,i=v>=a&&v<=h),!i&&s&x.BELOW&&!(r&x.BELOW)&&(p=d-(g-a)/f,i=p>=o&&p<=l),!i&&s&x.LEFT&&!(r&x.LEFT)&&(v=g-(d-o)*f,i=v>=a&&v<=h)}return i}function _r(n,t,e,i,r,s){const o=r-e,a=s-i;if(o!==0||a!==0){const l=((n-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=r,i=s):l>0&&(e+=o*l,i+=a*l)}return X(n,t,e,i)}function X(n,t,e,i){const r=e-n,s=i-t;return r*r+s*s}function vi(n){return n*180/Math.PI}function Ht(n){return n*Math.PI/180}function ue(n,t,e){return n+e*(t-n)}function de(n,t,e){if(n>=t&&n<e)return n;const i=e-t;return((n-t)%i+i)%i+t}const vr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ge{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||vr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const wt=6378137,st=Math.PI*wt,Cr=[-st,-st,st,st],wr=[-180,-85,180,85],Ut=wt*Math.log(Math.tan(Math.PI/2));class ot extends ge{constructor(t){super({code:t,units:"m",extent:Cr,global:!0,worldExtent:wr,getPointResolution:function(e,i){return e/Math.cosh(i[1]/wt)}})}}const Ci=[new ot("EPSG:3857"),new ot("EPSG:102100"),new ot("EPSG:102113"),new ot("EPSG:900913"),new ot("http://www.opengis.net/def/crs/EPSG/0/3857"),new ot("http://www.opengis.net/gml/srs/epsg.xml#3857")];function br(n,t,e,i){const r=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(r));for(let s=0;s<r;s+=i){t[s]=st*n[s]/180;let o=wt*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>Ut?o=Ut:o<-Ut&&(o=-Ut),t[s+1]=o}return t}function Er(n,t,e,i){const r=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(r));for(let s=0;s<r;s+=i)t[s]=180*n[s]/st,t[s+1]=360*Math.atan(Math.exp(n[s+1]/wt))/Math.PI-90;return t}const xr=6378137,wi=[-180,-90,180,90],Pr=Math.PI*xr/180;class Y extends ge{constructor(t,e){super({code:t,units:"degrees",extent:wi,axisOrientation:e,global:!0,metersPerUnit:Pr,worldExtent:wi})}}const bi=[new Y("CRS:84"),new Y("EPSG:4326","neu"),new Y("urn:ogc:def:crs:OGC:1.3:CRS84"),new Y("urn:ogc:def:crs:OGC:2:84"),new Y("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Y("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Y("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let fe={};function Mr(n){return fe[n]||fe[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Sr(n,t){fe[n]=t}let at={};function bt(n,t,e){const i=n.getCode(),r=t.getCode();i in at||(at[i]={}),at[i][r]=e}function pe(n,t){return n in at&&t in at[n]?at[n][t]:null}const Xt=.9996,S=.00669438,Yt=S*S,Bt=Yt*S,B=S/(1-S),Ei=Math.sqrt(1-S),lt=(1-Ei)/(1+Ei),xi=lt*lt,ye=xi*lt,me=ye*lt,Pi=me*lt,Mi=1-S/4-3*Yt/64-5*Bt/256,$r=3*S/8+3*Yt/32+45*Bt/1024,Ar=15*Yt/256+45*Bt/1024,Fr=35*Bt/3072,Gr=3/2*lt-27/32*ye+269/512*Pi,Lr=21/16*xi-55/32*me,Ir=151/96*ye-417/128*Pi,Rr=1097/512*me,Vt=6378137;function Tr(n,t,e){const i=n-5e5,o=(e.north?t:t-1e7)/Xt/(Vt*Mi),a=o+Gr*Math.sin(2*o)+Lr*Math.sin(4*o)+Ir*Math.sin(6*o)+Rr*Math.sin(8*o),l=Math.sin(a),h=l*l,c=Math.cos(a),u=l/c,d=u*u,g=d*d,f=1-S*h,p=Math.sqrt(1-S*h),v=Vt/p,P=(1-S)/f,w=B*c**2,G=w*w,M=i/(v*Xt),Q=M*M,It=Q*M,gn=It*M,fn=gn*M,oo=fn*M,ao=a-u/P*(Q/2-gn/24*(5+3*d+10*w-4*G-9*B))+oo/720*(61+90*d+298*w+45*g-252*B-3*G);let He=(M-It/6*(1+2*d+w)+fn/120*(5-2*w+28*d-3*G+8*B+24*g))/c;return He=de(He+Ht(Ai(e.number)),-Math.PI,Math.PI),[vi(He),vi(ao)]}const Si=-80,$i=84,Nr=-180,Or=180;function kr(n,t,e){n=de(n,Nr,Or),t<Si?t=Si:t>$i&&(t=$i);const i=Ht(t),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,h=Ht(n),c=Ai(e.number),u=Ht(c),d=Vt/Math.sqrt(1-S*r**2),g=B*s**2,f=s*de(h-u,-Math.PI,Math.PI),p=f*f,v=p*f,P=v*f,w=P*f,G=w*f,M=Vt*(Mi*i-$r*Math.sin(2*i)+Ar*Math.sin(4*i)-Fr*Math.sin(6*i)),Q=Xt*d*(f+v/6*(1-a+g)+w/120*(5-18*a+l+72*g-58*B))+5e5;let It=Xt*(M+d*o*(p/2+P/24*(5-a+9*g+4*g**2)+G/720*(61-58*a+l+600*g-330*B)));return e.north||(It+=1e7),[Q,It]}function Ai(n){return(n-1)*6-180+3}const jr=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Fi(n){let t=0;for(const r of jr){const s=n.match(r);if(s){t=parseInt(s[1]);break}}if(!t)return null;let e=0,i=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(i=!0,e=t-32600),e?{number:e,north:i}:null}function Gi(n,t){return function(e,i,r,s){const o=e.length;r=r>1?r:2,s=s??r,i||(r>2?i=e.slice():i=new Array(o));for(let a=0;a<o;a+=s){const l=e[a],h=e[a+1],c=n(l,h,t);i[a]=c[0],i[a+1]=c[1]}return i}}function Hr(n){return Fi(n)?new ge({code:n,units:"m"}):null}function Ur(n){const t=Fi(n.getCode());return t?{forward:Gi(kr,t),inverse:Gi(Tr,t)}:null}const Xr=[Ur],Yr=[Hr];function _e(n,t){if(t!==void 0){for(let e=0,i=n.length;e<i;++e)t[e]=n[e];t=t}else t=n.slice();return t}function ve(n){Sr(n.getCode(),n),bt(n,n,_e)}function Br(n){n.forEach(ve)}function $(n){if(typeof n!="string")return n;const t=Mr(n);if(t)return t;for(const e of Yr){const i=e(n);if(i)return i}return null}function Li(n){Br(n),n.forEach(function(t){n.forEach(function(e){t!==e&&bt(t,e,_e)})})}function Vr(n,t,e,i){n.forEach(function(r){t.forEach(function(s){bt(r,s,e),bt(s,r,i)})})}function zr(n,t){if(n===t)return!0;const e=n.getUnits()===t.getUnits();return(n.getCode()===t.getCode()||Ii(n,t)===_e)&&e}function Ii(n,t){const e=n.getCode(),i=t.getCode();let r=pe(e,i);if(r)return r;let s=null,o=null;for(const l of Xr)s||(s=l(n)),o||(o=l(t));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=Ce(s.inverse,o.forward);else{const l=pe(e,a);l&&(r=Ce(l,o.forward))}else{const l=pe(a,i);l&&(r=Ce(s.inverse,l))}return r&&(ve(n),ve(t),bt(n,t,r)),r}function Ce(n,t){return function(e,i,r,s){return i=n(e,i,r,s),t(i,i,r,s)}}function we(n,t){const e=$(n),i=$(t);return Ii(e,i)}function Jr(){Li(Ci),Li(bi),Vr(bi,Ci,br,Er)}Jr(),new Array(6);function Ri(){return[1,0,0,1,0,0]}function Ti(n,t,e,i,r,s,o,a){const l=Math.sin(s),h=Math.cos(s);return n[0]=i*h,n[1]=r*l,n[2]=-i*l,n[3]=r*h,n[4]=o*i*h-a*i*l+t,n[5]=o*r*l+a*r*h+e,n}function Ni(n,t,e,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=t;l<e;l+=i){const h=n[l],c=n[l+1];s[a++]=r[0]*h+r[2]*c+r[4],s[a++]=r[1]*h+r[3]*c+r[5];for(let u=2;u<o;u++)s[a++]=n[l+u]}return s&&s.length!=a&&(s.length=a),s}function Wr(n,t,e,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),h=s[0],c=s[1];let u=0;for(let d=t;d<e;d+=i){const g=n[d]-h,f=n[d+1]-c;o[u++]=h+g*a-f*l,o[u++]=c+g*l+f*a;for(let p=d+2;p<d+i;++p)o[u++]=n[p]}return o&&o.length!=u&&(o.length=u),o}function qr(n,t,e,i,r,s,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=i){const d=n[u]-l,g=n[u+1]-h;a[c++]=l+r*d,a[c++]=h+s*g;for(let f=u+2;f<u+i;++f)a[c++]=n[f]}return a&&a.length!=c&&(a.length=c),a}function Zr(n,t,e,i,r,s,o){o=o||[];let a=0;for(let l=t;l<e;l+=i){o[a++]=n[l]+r,o[a++]=n[l+1]+s;for(let h=l+2;h<l+i;++h)o[a++]=n[h]}return o&&o.length!=a&&(o.length=a),o}const Oi=Ri(),Dr=[NaN,NaN];class ki extends gi{constructor(){super(),this.extent_=le(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ai((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return y()}closestPointXY(t,e,i,r){return y()}containsXY(t,e){return this.closestPointXY(t,e,Dr,Number.MIN_VALUE)===0}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return y()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&he(e),this.extentRevision_=this.getRevision()}return yr(this.extent_,t)}rotate(t,e){y()}scale(t,e,i){y()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return y()}getType(){return y()}applyTransform(t){y()}intersectsExtent(t){return y()}translate(t,e){y()}transform(t,e){const i=$(t),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),h=i.getWorldExtent(),c=jt(h)/jt(l);Ti(Oi,h[0],h[3],c,-c,0,0,0);const u=Ni(s,0,s.length,a,Oi,o),d=we(i,e);return d?d(u,u,a):u}:we(i,e);return this.applyTransform(r),this}}class V extends ki{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return y()}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(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=ji(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){y()}setLayout(t,e,i){let r;if(t)r=ji(t);else{for(let s=0;s<i;++s){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}r=e.length,t=z(r)}this.layout=t,this.stride=r}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Wr(i,0,i.length,r,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=kt(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();qr(r,0,r.length,s,t,e,i,r),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Zr(i,0,i.length,r,t,e,i),this.changed()}}}function z(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function ji(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function Kr(n,t,e,i){for(let r=0,s=e.length;r<s;++r)n[t++]=e[r];return t}function zt(n,t,e,i){for(let r=0,s=e.length;r<s;++r){const o=e[r];for(let a=0;a<i;++a)n[t++]=o[a]}return t}function Et(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=zt(n,t,e[o],i);r[s++]=l,t=l}return r.length=s,r}function Hi(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=Et(n,t,e[o],i,r[s]);l.length===0&&(l[0]=t),r[s++]=l,t=l[l.length-1]}return r.length=s,r}function Ui(n,t,e,i){const r=[];let s=le();for(let o=0,a=e.length;o<a;++o){const l=e[o];s=ce(n,t,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=l[l.length-1]}return r}function Qr(n,t,e,i,r){return!cr(r,function(o){return!J(n,t,e,i,o[0],o[1])})}function J(n,t,e,i,r,s){let o=0,a=n[e-i],l=n[e-i+1];for(;t<e;t+=i){const h=n[t],c=n[t+1];l<=s?c>s&&(h-a)*(s-l)-(r-a)*(c-l)>0&&o++:c<=s&&(h-a)*(s-l)-(r-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function be(n,t,e,i,r,s){if(e.length===0||!J(n,t,e[0],i,r,s))return!1;for(let o=1,a=e.length;o<a;++o)if(J(n,e[o-1],e[o],i,r,s))return!1;return!0}function ts(n,t,e,i,r,s){if(e.length===0)return!1;for(let o=0,a=e.length;o<a;++o){const l=e[o];if(be(n,t,l,i,r,s))return!0;t=l[l.length-1]}return!1}function Ee(n,t,e,i,r,s,o){let a,l,h,c,u,d,g;const f=r[s+1],p=[];for(let w=0,G=e.length;w<G;++w){const M=e[w];for(c=n[M-i],d=n[M-i+1],a=t;a<M;a+=i)u=n[a],g=n[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(h=(f-d)/(g-d)*(u-c)+c,p.push(h)),c=u,d=g}let v=NaN,P=-1/0;for(p.sort(si),c=p[0],a=1,l=p.length;a<l;++a){u=p[a];const w=Math.abs(u-c);w>P&&(h=(c+u)/2,be(n,t,e,i,h,f)&&(v=h,P=w)),c=u}return isNaN(v)&&(v=r[s]),o?(o.push(v,f,P),o):[v,f,P]}function Xi(n,t,e,i,r){let s=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];s=Ee(n,t,l,i,r,2*o,s),t=l[l.length-1]}return s}function Jt(n,t,e,i,r,s,o){let a,l;const h=(e-t)/i;if(h===1)a=t;else if(h===2)a=t,l=r;else if(h!==0){let c=n[t],u=n[t+1],d=0;const g=[0];for(let v=t+i;v<e;v+=i){const P=n[v],w=n[v+1];d+=Math.sqrt((P-c)*(P-c)+(w-u)*(w-u)),g.push(d),c=P,u=w}const f=r*d,p=tr(g,f);p<0?(l=(f-g[-p-2])/(g[-p-1]-g[-p-2]),a=t+(-p-2)*i):a=t+p*i}o=o>1?o:2,s=s||new Array(o);for(let c=0;c<o;++c)s[c]=a===void 0?NaN:l===void 0?n[a+c]:ue(n[a+c],n[a+i+c],l);return s}function xe(n,t,e,i,r,s){if(e==t)return null;let o;if(r<n[t+i-1])return s?(o=n.slice(t,t+i),o[i-1]=r,o):null;if(n[e-1]<r)return s?(o=n.slice(e-i,e),o[i-1]=r,o):null;if(r==n[t+i-1])return n.slice(t,t+i);let a=t/i,l=e/i;for(;a<l;){const d=a+l>>1;r<n[(d+1)*i-1]?l=d:a=d+1}const h=n[a*i-1];if(r==h)return n.slice((a-1)*i,(a-1)*i+i);const c=n[(a+1)*i-1],u=(r-h)/(c-h);o=[];for(let d=0;d<i-1;++d)o.push(ue(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function es(n,t,e,i,r,s,o){if(o)return xe(n,t,e[e.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let l=0,h=e.length;l<h;++l){const c=e[l];if(t!=c){if(r<n[t+i-1])return null;if(r<=n[c-1])return xe(n,t,c,i,r,!1);t=c}}return null}function is(n,t,e,i){for(;t<e-i;){for(let r=0;r<i;++r){const s=n[t+r];n[t+r]=n[e-i+r],n[e-i+r]=s}t+=i,e-=i}}function Pe(n,t,e,i){let r=0,s=n[e-i],o=n[e-i+1];for(;t<e;t+=i){const a=n[t],l=n[t+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function Me(n,t,e,i,r){r=r!==void 0?r:!1;for(let s=0,o=e.length;s<o;++s){const a=e[s],l=Pe(n,t,a,i);if(s===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;t=a}return!0}function Yi(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(!Me(n,t,a,i,r))return!1;a.length&&(t=a[a.length-1])}return!0}function Wt(n,t,e,i,r){r=r!==void 0?r:!1;for(let s=0,o=e.length;s<o;++s){const a=e[s],l=Pe(n,t,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&is(n,t,a,i),t=a}return t}function Se(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s)t=Wt(n,t,e[s],i,r);return t}function ns(n,t){const e=[];let i=0,r=0,s;for(let o=0,a=t.length;o<a;++o){const l=t[o],h=Pe(n,i,l,2);if(s===void 0&&(s=h),h===s)e.push(t.slice(r,o+1));else{if(e.length===0)continue;e[e.length-1].push(t[r])}r=o+1,i=l}return e}function qt(n,t,e,i,r,s,o){const a=(e-t)/i;if(a<3){for(;t<e;t+=i)s[o++]=n[t],s[o++]=n[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-i];let c=0;for(;h.length>0;){const u=h.pop(),d=h.pop();let g=0;const f=n[d],p=n[d+1],v=n[u],P=n[u+1];for(let w=d+i;w<u;w+=i){const G=n[w],M=n[w+1],Q=_r(G,M,f,p,v,P);Q>g&&(c=w,g=Q)}g>r&&(l[(c-t)/i]=1,d+i<c&&h.push(d,c),c+i<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(s[o++]=n[t+u*i],s[o++]=n[t+u*i+1]);return o}function Bi(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=qt(n,t,c,i,r,s,o),a.push(o),t=c}return o}function ht(n,t){return t*Math.round(n/t)}function rs(n,t,e,i,r,s,o){if(t==e)return o;let a=ht(n[t],r),l=ht(n[t+1],r);t+=i,s[o++]=a,s[o++]=l;let h,c;do if(h=ht(n[t],r),c=ht(n[t+1],r),t+=i,t==e)return s[o++]=h,s[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=ht(n[t],r),d=ht(n[t+1],r);if(t+=i,u==h&&d==c)continue;const g=h-a,f=c-l,p=u-a,v=d-l;if(g*v==f*p&&(g<0&&p<g||g==p||g>0&&p>g)&&(f<0&&v<f||f==v||f>0&&v>f)){h=u,c=d;continue}s[o++]=h,s[o++]=c,a=h,l=c,h=u,c=d}return s[o++]=h,s[o++]=c,o}function $e(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=rs(n,t,c,i,r,s,o),a.push(o),t=c}return o}function ss(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l],u=[];o=$e(n,t,c,i,r,s,o,u),a.push(u),t=c[c.length-1]}return o}class W extends ki{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Nt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,i=t.length;e<i;++e)this.changeEventsKeys_.push(Ct(t[e],ae.CHANGE,this.changed,this))}clone(){const t=new W(Ae(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,i,r){if(r<U(this.getExtent(),t,e))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(t,e,i,r);return r}containsXY(t,e){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(t,e))return!0;return!1}computeExtent(t){he(t);const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)lr(t,e[i].getExtent());return t}getGeometries(){return Ae(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],l=a.getSimplifiedGeometry(t);e.push(l),l!==a&&(r=!0)}return r?new W(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(t,e);this.changed()}scale(t,e,i){i||(i=kt(this.getExtent()));const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)r[s].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Ae(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Ae(n){return n.map(t=>t.clone())}function Vi(n,t,e,i){let r=0;const s=n[e-i],o=n[e-i+1];let a=0,l=0;for(;t<e;t+=i){const h=n[t]-s,c=n[t+1]-o;r+=l*h-a*c,a=h,l=c}return r/2}function zi(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=Vi(n,t,a,i),t=a}return r}function os(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=zi(n,t,a,i),t=a[a.length-1]}return r}function Ji(n,t,e,i,r,s,o){const a=n[t],l=n[t+1],h=n[e]-a,c=n[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((r-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let g=0;g<i;++g)o[g]=ue(n[t+g],n[e+g],d);o.length=i;return}else u=t}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function Fe(n,t,e,i,r){let s=n[t],o=n[t+1];for(t+=i;t<e;t+=i){const a=n[t],l=n[t+1],h=X(s,o,a,l);h>r&&(r=h),s=a,o=l}return r}function Ge(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=Fe(n,t,a,i,r),t=a}return r}function as(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=Ge(n,t,a,i,r),t=a[a.length-1]}return r}function Le(n,t,e,i,r,s,o,a,l,h,c){if(t==e)return h;let u,d;if(r===0){if(d=X(o,a,n[t],n[t+1]),d<h){for(u=0;u<i;++u)l[u]=n[t+u];return l.length=i,d}return h}c=c||[NaN,NaN];let g=t+i;for(;g<e;)if(Ji(n,g-i,g,i,o,a,c),d=X(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(d)-Math.sqrt(h))/r|0,1);if(s&&(Ji(n,e-i,t,i,o,a,c),d=X(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i}return h}function Ie(n,t,e,i,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const g=e[u];h=Le(n,t,g,i,r,s,o,a,l,h,c),t=g}return h}function ls(n,t,e,i,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const g=e[u];h=Ie(n,t,g,i,r,s,o,a,l,h,c),t=g[g.length-1]}return h}function Zt(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=t;o<e;o+=i)r[s++]=n.slice(o,o+i);return r.length=s,r}function Re(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];r[s++]=Zt(n,t,l,i,r[s]),t=l}return r.length=s,r}function hs(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];r[s++]=l.length===1&&l[0]===t?[]:Re(n,t,l,i,r[s]),t=l[l.length-1]}return r.length=s,r}class xt extends V{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new xt(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Fe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Le(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))}getArea(){return Vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=qt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new xt(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zt(this.flatCoordinates,0,t,this.stride),this.changed()}}function Wi(n,t,e,i,r){let s;for(t+=i;t<e;t+=i)if(s=r(n.slice(t-i,t),n.slice(t,t+i)),s)return s;return!1}function Dt(n,t,e,i,r,s){return s=s??_i(le(),n,t,e,i),pr(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Wi(n,t,e,i,function(o,a){return mr(r,o,a)}):!1}function cs(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){if(Dt(n,t,e[s],i,r))return!0;t=e[s]}return!1}function us(n,t,e,i,r){return!!(Dt(n,t,e,i,r)||J(n,t,e,i,r[0],r[1])||J(n,t,e,i,r[0],r[3])||J(n,t,e,i,r[2],r[1])||J(n,t,e,i,r[2],r[3]))}function qi(n,t,e,i,r){if(!us(n,t,e[0],i,r))return!1;if(e.length===1)return!0;for(let s=1,o=e.length;s<o;++s)if(Qr(n,e[s-1],e[s],i,r)&&!Dt(n,e[s-1],e[s],i,r))return!1;return!0}function ds(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(qi(n,t,a,i,r))return!0;t=a[a.length-1]}return!1}function gs(n,t,e,i){let r=n[t],s=n[t+1],o=0;for(let a=t+i;a<e;a+=i){const l=n[a],h=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(h-s)*(h-s)),r=l,s=h}return o}class q extends V{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){F(this.flatCoordinates,t),this.changed()}clone(){const t=new q(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Fe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Le(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))}forEachSegment(t){return Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,xe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Jt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return gs(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){const e=[];return e.length=qt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new q(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zt(this.flatCoordinates,0,t,this.stride),this.changed()}}class Pt extends V{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{const r=t,s=[],o=[];for(let l=0,h=r.length;l<h;++l){const c=r[l];F(s,c.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(t){F(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Pt(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ge(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ie(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))}getCoordinateAtM(t,e,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,i=i!==void 0?i:!1,es(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return Re(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new q(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=e[o],h=new q(t.slice(s,l),i);r.push(h),s=l}return r}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const l=r[o],h=Jt(e,i,l,s,.5);F(t,h),i=l}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Bi(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Pt(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return cs(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Et(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class Z extends V{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Z(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){const s=this.flatCoordinates,o=X(t,e,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return mi(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return fi(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Kr(this.flatCoordinates,0,t,this.stride),this.changed()}}class Mt extends V{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){F(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new Mt(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){if(r<U(this.getExtent(),t,e))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,l=s.length;a<l;a+=o){const h=X(t,e,s[a],s[a+1]);if(h<r){r=h;for(let c=0;c<o;++c)i[c]=s[a+c];i.length=o}}return r}getCoordinates(){return Zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new Z(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,r=[];for(let s=0,o=t.length;s<o;s+=i){const a=new Z(t.slice(s,s+i),e);r.push(a)}return r}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let r=0,s=e.length;r<s;r+=i){const o=e[r],a=e[r+1];if(fi(t,o,a))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zt(this.flatCoordinates,0,t,this.stride),this.changed()}}class D extends V{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?F(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new D(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ge(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ie(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return be(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return zi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Wt(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Re(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=kt(this.getExtent());this.flatInteriorPoint_=Ee(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Z(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new xt(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],h=new xt(e.slice(s,l),t);r.push(h),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Me(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Wt(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=$e(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new D(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return qi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Et(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class St extends V{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){const r=t,s=[],o=[];for(let a=0,l=r.length;a<l;++a){const h=r[a],c=s.length,u=h.getEnds();for(let d=0,g=u.length;d<g;++d)u[d]+=c;F(s,h.getFlatCoordinates()),o.push(u)}e=r.length===0?this.getLayout():r[0].getLayout(),t=s,i=o}e!==void 0&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;F(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let r=0,s=e.length;r<s;++r)e[r]+=i}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let r=0;r<t;++r)e[r]=this.endss_[r].slice();const i=new St(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(as(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ls(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return ts(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return os(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Se(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,hs(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Ui(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Xi(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Mt(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Yi(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Se(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=ss(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new St(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const s=this.endss_[t-1];e=s[s.length-1]}const i=this.endss_[t].slice(),r=i[i.length-1];if(e!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=e;return new D(this.flatCoordinates.slice(e,r),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o].slice(),h=l[l.length-1];if(s!==0)for(let u=0,d=l.length;u<d;++u)l[u]-=s;const c=new D(e.slice(s,h),t,l);r.push(c),s=h}return r}getType(){return"MultiPolygon"}intersectsExtent(t){return ds(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Hi(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}const Zi=Ri();class K{constructor(t,e,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?mi(this.flatCoordinates_):ce(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=kt(this.getExtent());this.flatInteriorPoints_=Ee(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=ns(this.flatCoordinates_,this.ends_),e=Ui(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=Xi(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Jt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=Jt(t,e,o,2,.5);F(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=$(t);const e=t.getExtent(),i=t.getWorldExtent();if(e&&i){const r=jt(i)/jt(e);Ti(Zi,i[0],i[3],r,-r,0,0,0),Ni(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Zi,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;return new K(this.type_,this.flatCoordinates_.slice(),(t=this.ends_)==null?void 0:t.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=ai((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let r;switch(this.type_){case"LineString":i.length=qt(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Bi(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,r);break;case"Polygon":r=[],i.length=$e(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,r);break}return r&&(this.simplifiedGeometry_=new K(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}K.prototype.getFlatCoordinates=K.prototype.getOrientedFlatCoordinates;class Di{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=rt,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?$(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=$(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return y()}readFeature(t,e){return y()}readFeatures(t,e){return y()}readGeometry(t,e){return y()}readProjection(t){return y()}writeFeature(t,e){return y()}writeFeatures(t,e){return y()}writeGeometry(t,e){return y()}}function $t(n,t,e){const i=e?$(e.featureProjection):null,r=e?$(e.dataProjection):null;let s=n;if(i&&r&&!zr(i,r)){t&&(s=n.clone());const o=t?i:r,a=t?r:i;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(we(o,a))}if(t&&e&&e.decimals!==void 0){const o=Math.pow(10,e.decimals),a=function(l){for(let h=0,c=l.length;h<c;++h)l[h]=Math.round(l[h]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const fs={Point:Z,LineString:q,Polygon:D,MultiPoint:Mt,MultiLineString:Pt,MultiPolygon:St};function ps(n,t,e){return Array.isArray(t[0])?(Yi(n,0,t,e)||(n=n.slice(),Se(n,0,t,e)),n):(Me(n,0,t,e)||(n=n.slice(),Wt(n,0,t,e)),n)}function Ki(n,t){var s;const e=n.geometry;if(!e)return[];if(Array.isArray(e))return e.map(o=>Ki({...n,geometry:o})).flat();const i=e.type==="MultiPolygon"?"Polygon":e.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const r=e.layout.length;return $t(new K(i,i==="Polygon"?ps(e.flatCoordinates,e.ends,r):e.flatCoordinates,(s=e.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,t)}function Te(n,t){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Te(r,t));return new W(i)}const e=fs[n.type];return $t(new e(n.flatCoordinates,n.layout||"XY",n.ends),!1,t)}class ys extends Di{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Kt(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Kt(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return y()}readFeaturesFromObject(t,e){return y()}readGeometry(t,e){return this.readGeometryFromObject(Kt(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return y()}readProjection(t){return this.readProjectionFromObject(Kt(t))}readProjectionFromObject(t){return y()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return y()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return y()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return y()}}function Kt(n){if(typeof n=="string"){const t=JSON.parse(n);return t||null}return n!==null?n:null}class ms extends ys{constructor(t){t=t||{},super(),this.dataProjection=$(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=$(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};const r=Ne(i.geometry);if(this.featureClass===K)return Ki({geometry:r,id:i.id,properties:i.properties},e);const s=new rt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(Te(r,e)),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(t,e){const i=t;let r=null;if(i.type==="FeatureCollection"){const s=t;r=[];const o=s.features;for(let a=0,l=o.length;a<l;++a){const h=this.readFeatureFromObject(o[a],e);h&&r.push(h)}}else r=[this.readFeatureFromObject(t,e)];return r.flat()}readGeometryFromObject(t,e){return _s(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=$(e.properties.name);else if(e.type==="EPSG")i=$("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},r=t.getId();if(r!==void 0&&(i.id=r),!t.hasProperties())return i;const s=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=Oe(o,e),delete s[t.getGeometryName()]),hi(s)||(i.properties=s),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let r=0,s=t.length;r<s;++r)i.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return Oe(t,this.adaptOptions(e))}}function Ne(n,t){if(!n)return null;let e;switch(n.type){case"Point":{e=Cs(n);break}case"LineString":{e=ws(n);break}case"Polygon":{e=Ps(n);break}case"MultiPoint":{e=Es(n);break}case"MultiLineString":{e=bs(n);break}case"MultiPolygon":{e=xs(n);break}case"GeometryCollection":{e=vs(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return e}function _s(n,t){const e=Ne(n);return Te(e,t)}function vs(n,t){return n.geometries.map(function(i){return Ne(i)})}function Cs(n){const t=n.coordinates;return{type:"Point",flatCoordinates:t,layout:z(t.length)}}function ws(n){var i;const t=n.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:z(((i=t[0])==null?void 0:i.length)||2)}}function bs(n){var s,o;const t=n.coordinates,e=((o=(s=t[0])==null?void 0:s[0])==null?void 0:o.length)||2,i=[],r=Et(i,0,t,e);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:z(e)}}function Es(n){var e;const t=n.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:z(((e=t[0])==null?void 0:e.length)||2)}}function xs(n){var s,o;const t=n.coordinates,e=[],i=((o=(s=t[0])==null?void 0:s[0])==null?void 0:o[0].length)||2,r=Hi(e,0,t,i);return{type:"MultiPolygon",flatCoordinates:e,ends:r,layout:z(i)}}function Ps(n){var s,o;const t=n.coordinates,e=[],i=(o=(s=t[0])==null?void 0:s[0])==null?void 0:o.length,r=Et(e,0,t,i);return{type:"Polygon",flatCoordinates:e,ends:r,layout:z(i)}}function Oe(n,t){n=$t(n,!0,t);const e=n.getType();let i;switch(e){case"Point":{i=Gs(n);break}case"LineString":{i=Ss(n);break}case"Polygon":{i=Ls(n,t);break}case"MultiPoint":{i=As(n);break}case"MultiLineString":{i=$s(n);break}case"MultiPolygon":{i=Fs(n,t);break}case"GeometryCollection":{i=Ms(n,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function Ms(n,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return Oe(i,t)})}}function Ss(n,t){return{type:"LineString",coordinates:n.getCoordinates()}}function $s(n,t){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function As(n,t){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function Fs(n,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(e)}}function Gs(n,t){return{type:"Point",coordinates:n.getCoordinates()}}function Ls(n,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(e)}}const Is=(n,t)=>new ms().writeFeaturesObject(n,t);class Rs extends Di{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(Qt(t),this.adaptOptions(e))}readFeatureFromText(t,e){return y()}readFeatures(t,e){return this.readFeaturesFromText(Qt(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return y()}readGeometry(t,e){return this.readGeometryFromText(Qt(t),this.adaptOptions(e))}readGeometryFromText(t,e){return y()}readProjection(t){return this.readProjectionFromText(Qt(t))}readProjectionFromText(t){return this.dataProjection}writeFeature(t,e){return this.writeFeatureText(t,this.adaptOptions(e))}writeFeatureText(t,e){return y()}writeFeatures(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))}writeFeaturesText(t,e){return y()}writeGeometry(t,e){return this.writeGeometryText(t,this.adaptOptions(e))}writeGeometryText(t,e){return y()}}function Qt(n){return typeof n=="string"?n:""}const Ts={POINT:Z,LINESTRING:q,POLYGON:D,MULTIPOINT:Mt,MULTILINESTRING:Pt,MULTIPOLYGON:St},Qi="EMPTY",tn="Z",en="M",Ns="ZM",m={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},Os={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class ks{constructor(t){this.wkt=t,this.index_=-1}isAlpha_(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return e=e!==void 0?e:!1,t>="0"&&t<="9"||t=="."&&!e}isWhiteSpace_(t){return t==" "||t==" "||t=="\r"||t==`
59
- `}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let i=t,r;if(t=="(")r=m.LEFT_PAREN;else if(t==",")r=m.COMMA;else if(t==")")r=m.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")r=m.NUMBER,i=this.readNumber_();else if(this.isAlpha_(t))r=m.TEXT,i=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")r=m.EOF;else throw new Error("Unexpected character: "+t)}return{position:e,value:i,type:r}}readNumber_(){let t;const e=this.index_;let i=!1,r=!1;do t=="."?i=!0:(t=="e"||t=="E")&&(r=!0),t=this.nextChar_();while(this.isNumeric_(t,i)||!r&&(t=="e"||t=="E")||r&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}class js{constructor(t){this.lexer_=t,this.token_={position:0,type:m.START},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(t){return this.token_.type==t}match(t){const e=this.isTokenType(t);return e&&this.consume_(),e}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let t="XY";const e=this.token_;if(this.isTokenType(m.TEXT)){const i=e.value;i===tn?t="XYZ":i===en?t="XYM":i===Ns&&(t="XYZM"),t!=="XY"&&this.consume_()}return t}parseGeometryCollectionText_(){if(this.match(m.LEFT_PAREN)){const t=[];do t.push(this.parseGeometry_());while(this.match(m.COMMA));if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(m.LEFT_PAREN)){const t=this.parsePoint_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(m.LEFT_PAREN)){const t=this.parsePointList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(m.LEFT_PAREN)){const t=this.parseLineStringTextList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(m.LEFT_PAREN)){let t;if(this.token_.type==m.LEFT_PAREN?t=this.parsePointTextList_():t=this.parsePointList_(),this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(m.LEFT_PAREN)){const t=this.parseLineStringTextList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(m.LEFT_PAREN)){const t=this.parsePolygonTextList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePoint_(){const t=[],e=this.layout_.length;for(let i=0;i<e;++i){const r=this.token_;if(this.match(m.NUMBER))t.push(r.value);else break}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}parsePointList_(){const t=[this.parsePoint_()];for(;this.match(m.COMMA);)t.push(this.parsePoint_());return t}parsePointTextList_(){const t=[this.parsePointText_()];for(;this.match(m.COMMA);)t.push(this.parsePointText_());return t}parseLineStringTextList_(){const t=[this.parseLineStringText_()];for(;this.match(m.COMMA);)t.push(this.parseLineStringText_());return t}parsePolygonTextList_(){const t=[this.parsePolygonText_()];for(;this.match(m.COMMA);)t.push(this.parsePolygonText_());return t}isEmptyGeometry_(){const t=this.isTokenType(m.TEXT)&&this.token_.value==Qi;return t&&this.consume_(),t}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const t=this.token_;if(this.match(m.TEXT)){const e=t.value;this.layout_=this.parseGeometryLayout_();const i=this.isEmptyGeometry_();if(e=="GEOMETRYCOLLECTION"){if(i)return new W([]);const o=this.parseGeometryCollectionText_();return new W(o)}const r=Ts[e];if(!r)throw new Error("Invalid geometry type: "+e);let s;if(i)e=="POINT"?s=[NaN,NaN]:s=[];else switch(e){case"POINT":{s=this.parsePointText_();break}case"LINESTRING":{s=this.parseLineStringText_();break}case"POLYGON":{s=this.parsePolygonText_();break}case"MULTIPOINT":{s=this.parseMultiPointText_();break}case"MULTILINESTRING":{s=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{s=this.parseMultiPolygonText_();break}}return new r(s,this.layout_)}throw new Error(this.formatErrorMessage_())}}class Hs extends Rs{constructor(t){super(),t=t||{},this.splitCollection_=t.splitCollection!==void 0?t.splitCollection:!1}parse_(t){const e=new ks(t);return new js(e).parse()}readFeatureFromText(t,e){const i=this.readGeometryFromText(t,e),r=new rt;return r.setGeometry(i),r}readFeaturesFromText(t,e){let i=[];const r=this.readGeometryFromText(t,e);this.splitCollection_&&r.getType()=="GeometryCollection"?i=r.getGeometriesArray():i=[r];const s=[];for(let o=0,a=i.length;o<a;++o){const l=new rt;l.setGeometry(i[o]),s.push(l)}return s}readGeometryFromText(t,e){const i=this.parse_(t);return $t(i,!1,e)}writeFeatureText(t,e){const i=t.getGeometry();return i?this.writeGeometryText(i,e):""}writeFeaturesText(t,e){if(t.length==1)return this.writeFeatureText(t[0],e);const i=[];for(let s=0,o=t.length;s<o;++s)i.push(t[s].getGeometry());const r=new W(i);return this.writeGeometryText(r,e)}writeGeometryText(t,e){return sn($t(t,!0,e))}}function nn(n){const t=n.getCoordinates();return t.length===0?"":t.join(" ")}function Us(n){const t=[],e=n.getPoints();for(let i=0,r=e.length;i<r;++i)t.push("("+nn(e[i])+")");return t.join(",")}function Xs(n){const t=[],e=n.getGeometries();for(let i=0,r=e.length;i<r;++i)t.push(sn(e[i]));return t.join(",")}function ke(n){const t=n.getCoordinates(),e=[];for(let i=0,r=t.length;i<r;++i)e.push(t[i].join(" "));return e.join(",")}function Ys(n){const t=[],e=n.getLineStrings();for(let i=0,r=e.length;i<r;++i)t.push("("+ke(e[i])+")");return t.join(",")}function rn(n){const t=[],e=n.getLinearRings();for(let i=0,r=e.length;i<r;++i)t.push("("+ke(e[i])+")");return t.join(",")}function Bs(n){const t=[],e=n.getPolygons();for(let i=0,r=e.length;i<r;++i)t.push("("+rn(e[i])+")");return t.join(",")}function Vs(n){const t=n.getLayout();let e="";return(t==="XYZ"||t==="XYZM")&&(e+=tn),(t==="XYM"||t==="XYZM")&&(e+=en),e}const zs={Point:nn,LineString:ke,Polygon:rn,MultiPoint:Us,MultiLineString:Ys,MultiPolygon:Bs,GeometryCollection:Xs};function sn(n){const t=n.getType(),e=zs[t],i=e(n);let r=Os[t];if(typeof n.getFlatCoordinates=="function"){const s=Vs(n);s.length>0&&(r+=" "+s)}return i.length===0?r+" "+Qi:r+"("+i+")"}const Js=(n,t)=>new Hs().writeFeatures(n,t);/**
60
+ `}}tt(ri,"properties",{eoxDrawTools:{attribute:!1,state:!0},eoxMap:{attribute:!1,state:!0},olMap:{attribute:!1,state:!0},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},featureName:{attribute:!1,state:!0,type:String},modify:{attribute:!1,state:!0},unstyled:{type:Boolean}}),customElements.define("eox-drawtools-list",ri);const Wn=n=>{const{multipleFeatures:t,drawnFeatures:e,currentlyDrawing:i}=n,r=!t&&(e==null?void 0:e.length)>0||i,s=!(e!=null&&e.length)&&!i;return{drawDisabled:r,discardDisabled:s}},qn="button,.button { /* TODO: why does this only work here and not from :root? */ --primary-color: #004170; --primary-color-hover: #004170cc; --error-color: #ff5252; display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0px;}",Zn='textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input,input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004; background-color: var(--background-color);}';function Dn(n){navigator.clipboard.writeText(n).then(function(){},function(t){console.error("Could not copy text: ",t)})}const Kn={PROPERTYCHANGE:"propertychange"},ae={CHANGE:"change"};class Qn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function tr(n,t,e){let i,r;e=e||si;let s=0,o=n.length,a=!1;for(;s<o;)i=s+(o-s>>1),r=+e(n[i],t),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function si(n,t){return n>t?1:n<t?-1:0}function F(n,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let r=0;r<i;r++)n[n.length]=e[r]}function er(n,t){const e=n.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(n[i]!==t[i])return!1;return!0}function oi(){}function ai(n){let t,e,i;return function(){const r=Array.prototype.slice.call(arguments);return(!e||this!==i||!er(r,e))&&(i=this,e=r,t=n.apply(this,arguments)),t}}function li(n){for(const t in n)delete n[t]}function hi(n){let t;for(t in n)return!1;return!t}class ci{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class ir extends Qn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),r=i[t]||(i[t]=[]);r.includes(e)||r.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=e?new ci(t):t;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let h=0,c=r.length;h<c;++h)if("handleEvent"in r[h]?l=r[h].handleEvent(s):l=r[h].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let h=a[i];for(delete a[i];h--;)this.removeEventListener(i,oi);delete o[i]}return l}disposeInternal(){this.listeners_&&li(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const r=i.indexOf(e);r!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[r]=oi,++this.pendingRemovals_[t]):(i.splice(r,1),i.length===0&&delete this.listeners_[t]))}}function wt(n,t,e,i,r){if(r){const o=e;e=function(a){return n.removeEventListener(t,e),o.call(i??this,a)}}else i&&i!==n&&(e=e.bind(i));const s={target:n,type:t,listener:e};return n.addEventListener(t,e),s}function ui(n,t,e,i){return wt(n,t,e,i,!0)}function Nt(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),li(n))}class Ot extends ir{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ae.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=wt(this,t[s],e);return r}return wt(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const r=t.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=ui(this,t[s],e)}else i=ui(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)nr(i);else if(Array.isArray(t))for(let r=0,s=t.length;r<s;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)}}Ot.prototype.on,Ot.prototype.once,Ot.prototype.un;function nr(n){if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)Nt(n[t]);else Nt(n)}function y(){throw new Error("Unimplemented abstract method.")}let rr=0;function sr(n){return n.ol_uid||(n.ol_uid=String(++rr))}class di extends ci{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class fi extends Ot{constructor(t){super(),this.on,this.once,this.un,sr(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}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(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new di(i,t,e)),i=Kn.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new di(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const r=this.values_||(this.values_={});if(i)r[t]=e;else{const s=r[t];r[t]=e,s!==e&&this.notify(t,s)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],hi(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}function or(n,t){if(!n)throw new Error(t)}class rt extends fi{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new rt(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const 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_&&(Nt(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=wt(t,ae.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?ar(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function ar(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(or(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}const x={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function U(n,t,e){let i,r;return t<n[0]?i=n[0]-t:n[2]<t?i=t-n[2]:i=0,e<n[1]?r=n[1]-e:n[3]<e?r=e-n[3]:r=0,i*i+r*r}function gi(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function pi(n,t){const e=n[0],i=n[1],r=n[2],s=n[3],o=t[0],a=t[1];let l=x.UNKNOWN;return o<e?l=l|x.LEFT:o>r&&(l=l|x.RIGHT),a<i?l=l|x.BELOW:a>s&&(l=l|x.ABOVE),l===x.UNKNOWN&&(l=x.INTERSECTING),l}function le(){return[1/0,1/0,-1/0,-1/0]}function yi(n,t,e,i,r){return r?(r[0]=n,r[1]=t,r[2]=e,r[3]=i,r):[n,t,e,i]}function he(n){return yi(1/0,1/0,-1/0,-1/0,n)}function mi(n,t){const e=n[0],i=n[1];return yi(e,i,e,i,t)}function ce(n,t,e,i,r){const s=he(r);return _i(s,n,t,e,i)}function lr(n,t){return t[0]<n[0]&&(n[0]=t[0]),t[2]>n[2]&&(n[2]=t[2]),t[1]<n[1]&&(n[1]=t[1]),t[3]>n[3]&&(n[3]=t[3]),n}function _i(n,t,e,i,r){for(;e<i;e+=r)hr(n,t[e],t[e+1]);return n}function hr(n,t,e){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],e),n[2]=Math.max(n[2],t),n[3]=Math.max(n[3],e)}function cr(n,t){let e;return e=t(ur(n)),e||(e=t(dr(n)),e)||(e=t(gr(n)),e)||(e=t(fr(n)),e)?e:!1}function ur(n){return[n[0],n[1]]}function dr(n){return[n[2],n[1]]}function kt(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function jt(n){return n[3]-n[1]}function fr(n){return[n[0],n[3]]}function gr(n){return[n[2],n[3]]}function pr(n,t){return n[0]<=t[2]&&n[2]>=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function yr(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n}function mr(n,t,e){let i=!1;const r=pi(n,t),s=pi(n,e);if(r===x.INTERSECTING||s===x.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],h=n[3],c=t[0],u=t[1],d=e[0],f=e[1],g=(f-u)/(d-c);let p,v;s&x.ABOVE&&!(r&x.ABOVE)&&(p=d-(f-h)/g,i=p>=o&&p<=l),!i&&s&x.RIGHT&&!(r&x.RIGHT)&&(v=f-(d-l)*g,i=v>=a&&v<=h),!i&&s&x.BELOW&&!(r&x.BELOW)&&(p=d-(f-a)/g,i=p>=o&&p<=l),!i&&s&x.LEFT&&!(r&x.LEFT)&&(v=f-(d-o)*g,i=v>=a&&v<=h)}return i}function _r(n,t,e,i,r,s){const o=r-e,a=s-i;if(o!==0||a!==0){const l=((n-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=r,i=s):l>0&&(e+=o*l,i+=a*l)}return X(n,t,e,i)}function X(n,t,e,i){const r=e-n,s=i-t;return r*r+s*s}function vi(n){return n*180/Math.PI}function Ht(n){return n*Math.PI/180}function ue(n,t,e){return n+e*(t-n)}function de(n,t,e){if(n>=t&&n<e)return n;const i=e-t;return((n-t)%i+i)%i+t}const vr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class fe{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||vr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Ct=6378137,st=Math.PI*Ct,wr=[-st,-st,st,st],Cr=[-180,-85,180,85],Ut=Ct*Math.log(Math.tan(Math.PI/2));class ot extends fe{constructor(t){super({code:t,units:"m",extent:wr,global:!0,worldExtent:Cr,getPointResolution:function(e,i){return e/Math.cosh(i[1]/Ct)}})}}const wi=[new ot("EPSG:3857"),new ot("EPSG:102100"),new ot("EPSG:102113"),new ot("EPSG:900913"),new ot("http://www.opengis.net/def/crs/EPSG/0/3857"),new ot("http://www.opengis.net/gml/srs/epsg.xml#3857")];function br(n,t,e,i){const r=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(r));for(let s=0;s<r;s+=i){t[s]=st*n[s]/180;let o=Ct*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>Ut?o=Ut:o<-Ut&&(o=-Ut),t[s+1]=o}return t}function Er(n,t,e,i){const r=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(r));for(let s=0;s<r;s+=i)t[s]=180*n[s]/st,t[s+1]=360*Math.atan(Math.exp(n[s+1]/Ct))/Math.PI-90;return t}const xr=6378137,Ci=[-180,-90,180,90],Pr=Math.PI*xr/180;class Y extends fe{constructor(t,e){super({code:t,units:"degrees",extent:Ci,axisOrientation:e,global:!0,metersPerUnit:Pr,worldExtent:Ci})}}const bi=[new Y("CRS:84"),new Y("EPSG:4326","neu"),new Y("urn:ogc:def:crs:OGC:1.3:CRS84"),new Y("urn:ogc:def:crs:OGC:2:84"),new Y("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Y("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Y("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ge={};function Mr(n){return ge[n]||ge[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Sr(n,t){ge[n]=t}let at={};function bt(n,t,e){const i=n.getCode(),r=t.getCode();i in at||(at[i]={}),at[i][r]=e}function pe(n,t){return n in at&&t in at[n]?at[n][t]:null}const Xt=.9996,S=.00669438,Yt=S*S,Bt=Yt*S,B=S/(1-S),Ei=Math.sqrt(1-S),lt=(1-Ei)/(1+Ei),xi=lt*lt,ye=xi*lt,me=ye*lt,Pi=me*lt,Mi=1-S/4-3*Yt/64-5*Bt/256,$r=3*S/8+3*Yt/32+45*Bt/1024,Ar=15*Yt/256+45*Bt/1024,Fr=35*Bt/3072,Gr=3/2*lt-27/32*ye+269/512*Pi,Ir=21/16*xi-55/32*me,Lr=151/96*ye-417/128*Pi,Tr=1097/512*me,Vt=6378137;function Rr(n,t,e){const i=n-5e5,o=(e.north?t:t-1e7)/Xt/(Vt*Mi),a=o+Gr*Math.sin(2*o)+Ir*Math.sin(4*o)+Lr*Math.sin(6*o)+Tr*Math.sin(8*o),l=Math.sin(a),h=l*l,c=Math.cos(a),u=l/c,d=u*u,f=d*d,g=1-S*h,p=Math.sqrt(1-S*h),v=Vt/p,P=(1-S)/g,C=B*c**2,G=C*C,M=i/(v*Xt),Q=M*M,Lt=Q*M,fn=Lt*M,gn=fn*M,oo=gn*M,ao=a-u/P*(Q/2-fn/24*(5+3*d+10*C-4*G-9*B))+oo/720*(61+90*d+298*C+45*f-252*B-3*G);let He=(M-Lt/6*(1+2*d+C)+gn/120*(5-2*C+28*d-3*G+8*B+24*f))/c;return He=de(He+Ht(Ai(e.number)),-Math.PI,Math.PI),[vi(He),vi(ao)]}const Si=-80,$i=84,Nr=-180,Or=180;function kr(n,t,e){n=de(n,Nr,Or),t<Si?t=Si:t>$i&&(t=$i);const i=Ht(t),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,h=Ht(n),c=Ai(e.number),u=Ht(c),d=Vt/Math.sqrt(1-S*r**2),f=B*s**2,g=s*de(h-u,-Math.PI,Math.PI),p=g*g,v=p*g,P=v*g,C=P*g,G=C*g,M=Vt*(Mi*i-$r*Math.sin(2*i)+Ar*Math.sin(4*i)-Fr*Math.sin(6*i)),Q=Xt*d*(g+v/6*(1-a+f)+C/120*(5-18*a+l+72*f-58*B))+5e5;let Lt=Xt*(M+d*o*(p/2+P/24*(5-a+9*f+4*f**2)+G/720*(61-58*a+l+600*f-330*B)));return e.north||(Lt+=1e7),[Q,Lt]}function Ai(n){return(n-1)*6-180+3}const jr=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Fi(n){let t=0;for(const r of jr){const s=n.match(r);if(s){t=parseInt(s[1]);break}}if(!t)return null;let e=0,i=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(i=!0,e=t-32600),e?{number:e,north:i}:null}function Gi(n,t){return function(e,i,r,s){const o=e.length;r=r>1?r:2,s=s??r,i||(r>2?i=e.slice():i=new Array(o));for(let a=0;a<o;a+=s){const l=e[a],h=e[a+1],c=n(l,h,t);i[a]=c[0],i[a+1]=c[1]}return i}}function Hr(n){return Fi(n)?new fe({code:n,units:"m"}):null}function Ur(n){const t=Fi(n.getCode());return t?{forward:Gi(kr,t),inverse:Gi(Rr,t)}:null}const Xr=[Ur],Yr=[Hr];function _e(n,t){if(t!==void 0){for(let e=0,i=n.length;e<i;++e)t[e]=n[e];t=t}else t=n.slice();return t}function ve(n){Sr(n.getCode(),n),bt(n,n,_e)}function Br(n){n.forEach(ve)}function $(n){if(typeof n!="string")return n;const t=Mr(n);if(t)return t;for(const e of Yr){const i=e(n);if(i)return i}return null}function Ii(n){Br(n),n.forEach(function(t){n.forEach(function(e){t!==e&&bt(t,e,_e)})})}function Vr(n,t,e,i){n.forEach(function(r){t.forEach(function(s){bt(r,s,e),bt(s,r,i)})})}function zr(n,t){if(n===t)return!0;const e=n.getUnits()===t.getUnits();return(n.getCode()===t.getCode()||Li(n,t)===_e)&&e}function Li(n,t){const e=n.getCode(),i=t.getCode();let r=pe(e,i);if(r)return r;let s=null,o=null;for(const l of Xr)s||(s=l(n)),o||(o=l(t));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=we(s.inverse,o.forward);else{const l=pe(e,a);l&&(r=we(l,o.forward))}else{const l=pe(a,i);l&&(r=we(s.inverse,l))}return r&&(ve(n),ve(t),bt(n,t,r)),r}function we(n,t){return function(e,i,r,s){return i=n(e,i,r,s),t(i,i,r,s)}}function Ce(n,t){const e=$(n),i=$(t);return Li(e,i)}function Jr(){Ii(wi),Ii(bi),Vr(bi,wi,br,Er)}Jr(),new Array(6);function Ti(){return[1,0,0,1,0,0]}function Ri(n,t,e,i,r,s,o,a){const l=Math.sin(s),h=Math.cos(s);return n[0]=i*h,n[1]=r*l,n[2]=-i*l,n[3]=r*h,n[4]=o*i*h-a*i*l+t,n[5]=o*r*l+a*r*h+e,n}function Ni(n,t,e,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=t;l<e;l+=i){const h=n[l],c=n[l+1];s[a++]=r[0]*h+r[2]*c+r[4],s[a++]=r[1]*h+r[3]*c+r[5];for(let u=2;u<o;u++)s[a++]=n[l+u]}return s&&s.length!=a&&(s.length=a),s}function Wr(n,t,e,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),h=s[0],c=s[1];let u=0;for(let d=t;d<e;d+=i){const f=n[d]-h,g=n[d+1]-c;o[u++]=h+f*a-g*l,o[u++]=c+f*l+g*a;for(let p=d+2;p<d+i;++p)o[u++]=n[p]}return o&&o.length!=u&&(o.length=u),o}function qr(n,t,e,i,r,s,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=i){const d=n[u]-l,f=n[u+1]-h;a[c++]=l+r*d,a[c++]=h+s*f;for(let g=u+2;g<u+i;++g)a[c++]=n[g]}return a&&a.length!=c&&(a.length=c),a}function Zr(n,t,e,i,r,s,o){o=o||[];let a=0;for(let l=t;l<e;l+=i){o[a++]=n[l]+r,o[a++]=n[l+1]+s;for(let h=l+2;h<l+i;++h)o[a++]=n[h]}return o&&o.length!=a&&(o.length=a),o}const Oi=Ti(),Dr=[NaN,NaN];class ki extends fi{constructor(){super(),this.extent_=le(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ai((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return y()}closestPointXY(t,e,i,r){return y()}containsXY(t,e){return this.closestPointXY(t,e,Dr,Number.MIN_VALUE)===0}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return y()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&he(e),this.extentRevision_=this.getRevision()}return yr(this.extent_,t)}rotate(t,e){y()}scale(t,e,i){y()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return y()}getType(){return y()}applyTransform(t){y()}intersectsExtent(t){return y()}translate(t,e){y()}transform(t,e){const i=$(t),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),h=i.getWorldExtent(),c=jt(h)/jt(l);Ri(Oi,h[0],h[3],c,-c,0,0,0);const u=Ni(s,0,s.length,a,Oi,o),d=Ce(i,e);return d?d(u,u,a):u}:Ce(i,e);return this.applyTransform(r),this}}class V extends ki{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return y()}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(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=ji(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){y()}setLayout(t,e,i){let r;if(t)r=ji(t);else{for(let s=0;s<i;++s){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}r=e.length,t=z(r)}this.layout=t,this.stride=r}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Wr(i,0,i.length,r,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=kt(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();qr(r,0,r.length,s,t,e,i,r),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Zr(i,0,i.length,r,t,e,i),this.changed()}}}function z(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function ji(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function Kr(n,t,e,i){for(let r=0,s=e.length;r<s;++r)n[t++]=e[r];return t}function zt(n,t,e,i){for(let r=0,s=e.length;r<s;++r){const o=e[r];for(let a=0;a<i;++a)n[t++]=o[a]}return t}function Et(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=zt(n,t,e[o],i);r[s++]=l,t=l}return r.length=s,r}function Hi(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=Et(n,t,e[o],i,r[s]);l.length===0&&(l[0]=t),r[s++]=l,t=l[l.length-1]}return r.length=s,r}function Ui(n,t,e,i){const r=[];let s=le();for(let o=0,a=e.length;o<a;++o){const l=e[o];s=ce(n,t,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=l[l.length-1]}return r}function Qr(n,t,e,i,r){return!cr(r,function(o){return!J(n,t,e,i,o[0],o[1])})}function J(n,t,e,i,r,s){let o=0,a=n[e-i],l=n[e-i+1];for(;t<e;t+=i){const h=n[t],c=n[t+1];l<=s?c>s&&(h-a)*(s-l)-(r-a)*(c-l)>0&&o++:c<=s&&(h-a)*(s-l)-(r-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function be(n,t,e,i,r,s){if(e.length===0||!J(n,t,e[0],i,r,s))return!1;for(let o=1,a=e.length;o<a;++o)if(J(n,e[o-1],e[o],i,r,s))return!1;return!0}function ts(n,t,e,i,r,s){if(e.length===0)return!1;for(let o=0,a=e.length;o<a;++o){const l=e[o];if(be(n,t,l,i,r,s))return!0;t=l[l.length-1]}return!1}function Ee(n,t,e,i,r,s,o){let a,l,h,c,u,d,f;const g=r[s+1],p=[];for(let C=0,G=e.length;C<G;++C){const M=e[C];for(c=n[M-i],d=n[M-i+1],a=t;a<M;a+=i)u=n[a],f=n[a+1],(g<=d&&f<=g||d<=g&&g<=f)&&(h=(g-d)/(f-d)*(u-c)+c,p.push(h)),c=u,d=f}let v=NaN,P=-1/0;for(p.sort(si),c=p[0],a=1,l=p.length;a<l;++a){u=p[a];const C=Math.abs(u-c);C>P&&(h=(c+u)/2,be(n,t,e,i,h,g)&&(v=h,P=C)),c=u}return isNaN(v)&&(v=r[s]),o?(o.push(v,g,P),o):[v,g,P]}function Xi(n,t,e,i,r){let s=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];s=Ee(n,t,l,i,r,2*o,s),t=l[l.length-1]}return s}function Jt(n,t,e,i,r,s,o){let a,l;const h=(e-t)/i;if(h===1)a=t;else if(h===2)a=t,l=r;else if(h!==0){let c=n[t],u=n[t+1],d=0;const f=[0];for(let v=t+i;v<e;v+=i){const P=n[v],C=n[v+1];d+=Math.sqrt((P-c)*(P-c)+(C-u)*(C-u)),f.push(d),c=P,u=C}const g=r*d,p=tr(f,g);p<0?(l=(g-f[-p-2])/(f[-p-1]-f[-p-2]),a=t+(-p-2)*i):a=t+p*i}o=o>1?o:2,s=s||new Array(o);for(let c=0;c<o;++c)s[c]=a===void 0?NaN:l===void 0?n[a+c]:ue(n[a+c],n[a+i+c],l);return s}function xe(n,t,e,i,r,s){if(e==t)return null;let o;if(r<n[t+i-1])return s?(o=n.slice(t,t+i),o[i-1]=r,o):null;if(n[e-1]<r)return s?(o=n.slice(e-i,e),o[i-1]=r,o):null;if(r==n[t+i-1])return n.slice(t,t+i);let a=t/i,l=e/i;for(;a<l;){const d=a+l>>1;r<n[(d+1)*i-1]?l=d:a=d+1}const h=n[a*i-1];if(r==h)return n.slice((a-1)*i,(a-1)*i+i);const c=n[(a+1)*i-1],u=(r-h)/(c-h);o=[];for(let d=0;d<i-1;++d)o.push(ue(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function es(n,t,e,i,r,s,o){if(o)return xe(n,t,e[e.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let l=0,h=e.length;l<h;++l){const c=e[l];if(t!=c){if(r<n[t+i-1])return null;if(r<=n[c-1])return xe(n,t,c,i,r,!1);t=c}}return null}function is(n,t,e,i){for(;t<e-i;){for(let r=0;r<i;++r){const s=n[t+r];n[t+r]=n[e-i+r],n[e-i+r]=s}t+=i,e-=i}}function Pe(n,t,e,i){let r=0,s=n[e-i],o=n[e-i+1];for(;t<e;t+=i){const a=n[t],l=n[t+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function Me(n,t,e,i,r){r=r!==void 0?r:!1;for(let s=0,o=e.length;s<o;++s){const a=e[s],l=Pe(n,t,a,i);if(s===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;t=a}return!0}function Yi(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(!Me(n,t,a,i,r))return!1;a.length&&(t=a[a.length-1])}return!0}function Wt(n,t,e,i,r){r=r!==void 0?r:!1;for(let s=0,o=e.length;s<o;++s){const a=e[s],l=Pe(n,t,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&is(n,t,a,i),t=a}return t}function Se(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s)t=Wt(n,t,e[s],i,r);return t}function ns(n,t){const e=[];let i=0,r=0,s;for(let o=0,a=t.length;o<a;++o){const l=t[o],h=Pe(n,i,l,2);if(s===void 0&&(s=h),h===s)e.push(t.slice(r,o+1));else{if(e.length===0)continue;e[e.length-1].push(t[r])}r=o+1,i=l}return e}function qt(n,t,e,i,r,s,o){const a=(e-t)/i;if(a<3){for(;t<e;t+=i)s[o++]=n[t],s[o++]=n[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-i];let c=0;for(;h.length>0;){const u=h.pop(),d=h.pop();let f=0;const g=n[d],p=n[d+1],v=n[u],P=n[u+1];for(let C=d+i;C<u;C+=i){const G=n[C],M=n[C+1],Q=_r(G,M,g,p,v,P);Q>f&&(c=C,f=Q)}f>r&&(l[(c-t)/i]=1,d+i<c&&h.push(d,c),c+i<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(s[o++]=n[t+u*i],s[o++]=n[t+u*i+1]);return o}function Bi(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=qt(n,t,c,i,r,s,o),a.push(o),t=c}return o}function ht(n,t){return t*Math.round(n/t)}function rs(n,t,e,i,r,s,o){if(t==e)return o;let a=ht(n[t],r),l=ht(n[t+1],r);t+=i,s[o++]=a,s[o++]=l;let h,c;do if(h=ht(n[t],r),c=ht(n[t+1],r),t+=i,t==e)return s[o++]=h,s[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=ht(n[t],r),d=ht(n[t+1],r);if(t+=i,u==h&&d==c)continue;const f=h-a,g=c-l,p=u-a,v=d-l;if(f*v==g*p&&(f<0&&p<f||f==p||f>0&&p>f)&&(g<0&&v<g||g==v||g>0&&v>g)){h=u,c=d;continue}s[o++]=h,s[o++]=c,a=h,l=c,h=u,c=d}return s[o++]=h,s[o++]=c,o}function $e(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=rs(n,t,c,i,r,s,o),a.push(o),t=c}return o}function ss(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l],u=[];o=$e(n,t,c,i,r,s,o,u),a.push(u),t=c[c.length-1]}return o}class W extends ki{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Nt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,i=t.length;e<i;++e)this.changeEventsKeys_.push(wt(t[e],ae.CHANGE,this.changed,this))}clone(){const t=new W(Ae(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,i,r){if(r<U(this.getExtent(),t,e))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(t,e,i,r);return r}containsXY(t,e){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(t,e))return!0;return!1}computeExtent(t){he(t);const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)lr(t,e[i].getExtent());return t}getGeometries(){return Ae(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],l=a.getSimplifiedGeometry(t);e.push(l),l!==a&&(r=!0)}return r?new W(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(t,e);this.changed()}scale(t,e,i){i||(i=kt(this.getExtent()));const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)r[s].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Ae(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Ae(n){return n.map(t=>t.clone())}function Vi(n,t,e,i){let r=0;const s=n[e-i],o=n[e-i+1];let a=0,l=0;for(;t<e;t+=i){const h=n[t]-s,c=n[t+1]-o;r+=l*h-a*c,a=h,l=c}return r/2}function zi(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=Vi(n,t,a,i),t=a}return r}function os(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=zi(n,t,a,i),t=a[a.length-1]}return r}function Ji(n,t,e,i,r,s,o){const a=n[t],l=n[t+1],h=n[e]-a,c=n[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((r-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let f=0;f<i;++f)o[f]=ue(n[t+f],n[e+f],d);o.length=i;return}else u=t}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function Fe(n,t,e,i,r){let s=n[t],o=n[t+1];for(t+=i;t<e;t+=i){const a=n[t],l=n[t+1],h=X(s,o,a,l);h>r&&(r=h),s=a,o=l}return r}function Ge(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=Fe(n,t,a,i,r),t=a}return r}function as(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=Ge(n,t,a,i,r),t=a[a.length-1]}return r}function Ie(n,t,e,i,r,s,o,a,l,h,c){if(t==e)return h;let u,d;if(r===0){if(d=X(o,a,n[t],n[t+1]),d<h){for(u=0;u<i;++u)l[u]=n[t+u];return l.length=i,d}return h}c=c||[NaN,NaN];let f=t+i;for(;f<e;)if(Ji(n,f-i,f,i,o,a,c),d=X(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i,f+=i}else f+=i*Math.max((Math.sqrt(d)-Math.sqrt(h))/r|0,1);if(s&&(Ji(n,e-i,t,i,o,a,c),d=X(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i}return h}function Le(n,t,e,i,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const f=e[u];h=Ie(n,t,f,i,r,s,o,a,l,h,c),t=f}return h}function ls(n,t,e,i,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const f=e[u];h=Le(n,t,f,i,r,s,o,a,l,h,c),t=f[f.length-1]}return h}function Zt(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=t;o<e;o+=i)r[s++]=n.slice(o,o+i);return r.length=s,r}function Te(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];r[s++]=Zt(n,t,l,i,r[s]),t=l}return r.length=s,r}function hs(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];r[s++]=l.length===1&&l[0]===t?[]:Te(n,t,l,i,r[s]),t=l[l.length-1]}return r.length=s,r}class xt extends V{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new xt(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Fe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))}getArea(){return Vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=qt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new xt(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zt(this.flatCoordinates,0,t,this.stride),this.changed()}}function Wi(n,t,e,i,r){let s;for(t+=i;t<e;t+=i)if(s=r(n.slice(t-i,t),n.slice(t,t+i)),s)return s;return!1}function Dt(n,t,e,i,r,s){return s=s??_i(le(),n,t,e,i),pr(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Wi(n,t,e,i,function(o,a){return mr(r,o,a)}):!1}function cs(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){if(Dt(n,t,e[s],i,r))return!0;t=e[s]}return!1}function us(n,t,e,i,r){return!!(Dt(n,t,e,i,r)||J(n,t,e,i,r[0],r[1])||J(n,t,e,i,r[0],r[3])||J(n,t,e,i,r[2],r[1])||J(n,t,e,i,r[2],r[3]))}function qi(n,t,e,i,r){if(!us(n,t,e[0],i,r))return!1;if(e.length===1)return!0;for(let s=1,o=e.length;s<o;++s)if(Qr(n,e[s-1],e[s],i,r)&&!Dt(n,e[s-1],e[s],i,r))return!1;return!0}function ds(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(qi(n,t,a,i,r))return!0;t=a[a.length-1]}return!1}function fs(n,t,e,i){let r=n[t],s=n[t+1],o=0;for(let a=t+i;a<e;a+=i){const l=n[a],h=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(h-s)*(h-s)),r=l,s=h}return o}class q extends V{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){F(this.flatCoordinates,t),this.changed()}clone(){const t=new q(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Fe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))}forEachSegment(t){return Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,xe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Jt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return fs(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){const e=[];return e.length=qt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new q(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zt(this.flatCoordinates,0,t,this.stride),this.changed()}}class Pt extends V{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{const r=t,s=[],o=[];for(let l=0,h=r.length;l<h;++l){const c=r[l];F(s,c.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(t){F(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Pt(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ge(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Le(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))}getCoordinateAtM(t,e,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,i=i!==void 0?i:!1,es(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return Te(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new q(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=e[o],h=new q(t.slice(s,l),i);r.push(h),s=l}return r}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const l=r[o],h=Jt(e,i,l,s,.5);F(t,h),i=l}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Bi(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Pt(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return cs(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Et(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class Z extends V{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Z(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){const s=this.flatCoordinates,o=X(t,e,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return mi(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return gi(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Kr(this.flatCoordinates,0,t,this.stride),this.changed()}}class Mt extends V{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){F(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new Mt(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){if(r<U(this.getExtent(),t,e))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,l=s.length;a<l;a+=o){const h=X(t,e,s[a],s[a+1]);if(h<r){r=h;for(let c=0;c<o;++c)i[c]=s[a+c];i.length=o}}return r}getCoordinates(){return Zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new Z(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,r=[];for(let s=0,o=t.length;s<o;s+=i){const a=new Z(t.slice(s,s+i),e);r.push(a)}return r}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let r=0,s=e.length;r<s;r+=i){const o=e[r],a=e[r+1];if(gi(t,o,a))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zt(this.flatCoordinates,0,t,this.stride),this.changed()}}class D extends V{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?F(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new D(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ge(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Le(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return be(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return zi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Wt(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Te(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=kt(this.getExtent());this.flatInteriorPoint_=Ee(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Z(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new xt(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],h=new xt(e.slice(s,l),t);r.push(h),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Me(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Wt(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=$e(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new D(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return qi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Et(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class St extends V{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){const r=t,s=[],o=[];for(let a=0,l=r.length;a<l;++a){const h=r[a],c=s.length,u=h.getEnds();for(let d=0,f=u.length;d<f;++d)u[d]+=c;F(s,h.getFlatCoordinates()),o.push(u)}e=r.length===0?this.getLayout():r[0].getLayout(),t=s,i=o}e!==void 0&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;F(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let r=0,s=e.length;r<s;++r)e[r]+=i}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let r=0;r<t;++r)e[r]=this.endss_[r].slice();const i=new St(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,r){return r<U(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(as(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ls(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return ts(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return os(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Se(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,hs(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Ui(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Xi(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Mt(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Yi(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Se(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=ss(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new St(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const s=this.endss_[t-1];e=s[s.length-1]}const i=this.endss_[t].slice(),r=i[i.length-1];if(e!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=e;return new D(this.flatCoordinates.slice(e,r),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o].slice(),h=l[l.length-1];if(s!==0)for(let u=0,d=l.length;u<d;++u)l[u]-=s;const c=new D(e.slice(s,h),t,l);r.push(c),s=h}return r}getType(){return"MultiPolygon"}intersectsExtent(t){return ds(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Hi(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}const Zi=Ti();class K{constructor(t,e,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?mi(this.flatCoordinates_):ce(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=kt(this.getExtent());this.flatInteriorPoints_=Ee(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=ns(this.flatCoordinates_,this.ends_),e=Ui(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=Xi(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Jt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=Jt(t,e,o,2,.5);F(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=$(t);const e=t.getExtent(),i=t.getWorldExtent();if(e&&i){const r=jt(i)/jt(e);Ri(Zi,i[0],i[3],r,-r,0,0,0),Ni(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Zi,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;return new K(this.type_,this.flatCoordinates_.slice(),(t=this.ends_)==null?void 0:t.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=ai((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let r;switch(this.type_){case"LineString":i.length=qt(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Bi(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,r);break;case"Polygon":r=[],i.length=$e(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,r);break}return r&&(this.simplifiedGeometry_=new K(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}K.prototype.getFlatCoordinates=K.prototype.getOrientedFlatCoordinates;class Di{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=rt,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?$(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=$(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return y()}readFeature(t,e){return y()}readFeatures(t,e){return y()}readGeometry(t,e){return y()}readProjection(t){return y()}writeFeature(t,e){return y()}writeFeatures(t,e){return y()}writeGeometry(t,e){return y()}}function $t(n,t,e){const i=e?$(e.featureProjection):null,r=e?$(e.dataProjection):null;let s=n;if(i&&r&&!zr(i,r)){t&&(s=n.clone());const o=t?i:r,a=t?r:i;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(Ce(o,a))}if(t&&e&&e.decimals!==void 0){const o=Math.pow(10,e.decimals),a=function(l){for(let h=0,c=l.length;h<c;++h)l[h]=Math.round(l[h]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const gs={Point:Z,LineString:q,Polygon:D,MultiPoint:Mt,MultiLineString:Pt,MultiPolygon:St};function ps(n,t,e){return Array.isArray(t[0])?(Yi(n,0,t,e)||(n=n.slice(),Se(n,0,t,e)),n):(Me(n,0,t,e)||(n=n.slice(),Wt(n,0,t,e)),n)}function Ki(n,t){var s;const e=n.geometry;if(!e)return[];if(Array.isArray(e))return e.map(o=>Ki({...n,geometry:o})).flat();const i=e.type==="MultiPolygon"?"Polygon":e.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const r=e.layout.length;return $t(new K(i,i==="Polygon"?ps(e.flatCoordinates,e.ends,r):e.flatCoordinates,(s=e.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,t)}function Re(n,t){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Re(r,t));return new W(i)}const e=gs[n.type];return $t(new e(n.flatCoordinates,n.layout||"XY",n.ends),!1,t)}class ys extends Di{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Kt(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Kt(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return y()}readFeaturesFromObject(t,e){return y()}readGeometry(t,e){return this.readGeometryFromObject(Kt(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return y()}readProjection(t){return this.readProjectionFromObject(Kt(t))}readProjectionFromObject(t){return y()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return y()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return y()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return y()}}function Kt(n){if(typeof n=="string"){const t=JSON.parse(n);return t||null}return n!==null?n:null}class ms extends ys{constructor(t){t=t||{},super(),this.dataProjection=$(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=$(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};const r=Ne(i.geometry);if(this.featureClass===K)return Ki({geometry:r,id:i.id,properties:i.properties},e);const s=new rt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(Re(r,e)),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(t,e){const i=t;let r=null;if(i.type==="FeatureCollection"){const s=t;r=[];const o=s.features;for(let a=0,l=o.length;a<l;++a){const h=this.readFeatureFromObject(o[a],e);h&&r.push(h)}}else r=[this.readFeatureFromObject(t,e)];return r.flat()}readGeometryFromObject(t,e){return _s(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=$(e.properties.name);else if(e.type==="EPSG")i=$("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},r=t.getId();if(r!==void 0&&(i.id=r),!t.hasProperties())return i;const s=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=Oe(o,e),delete s[t.getGeometryName()]),hi(s)||(i.properties=s),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let r=0,s=t.length;r<s;++r)i.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return Oe(t,this.adaptOptions(e))}}function Ne(n,t){if(!n)return null;let e;switch(n.type){case"Point":{e=ws(n);break}case"LineString":{e=Cs(n);break}case"Polygon":{e=Ps(n);break}case"MultiPoint":{e=Es(n);break}case"MultiLineString":{e=bs(n);break}case"MultiPolygon":{e=xs(n);break}case"GeometryCollection":{e=vs(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return e}function _s(n,t){const e=Ne(n);return Re(e,t)}function vs(n,t){return n.geometries.map(function(i){return Ne(i)})}function ws(n){const t=n.coordinates;return{type:"Point",flatCoordinates:t,layout:z(t.length)}}function Cs(n){var i;const t=n.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:z(((i=t[0])==null?void 0:i.length)||2)}}function bs(n){var s,o;const t=n.coordinates,e=((o=(s=t[0])==null?void 0:s[0])==null?void 0:o.length)||2,i=[],r=Et(i,0,t,e);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:z(e)}}function Es(n){var e;const t=n.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:z(((e=t[0])==null?void 0:e.length)||2)}}function xs(n){var s,o;const t=n.coordinates,e=[],i=((o=(s=t[0])==null?void 0:s[0])==null?void 0:o[0].length)||2,r=Hi(e,0,t,i);return{type:"MultiPolygon",flatCoordinates:e,ends:r,layout:z(i)}}function Ps(n){var s,o;const t=n.coordinates,e=[],i=(o=(s=t[0])==null?void 0:s[0])==null?void 0:o.length,r=Et(e,0,t,i);return{type:"Polygon",flatCoordinates:e,ends:r,layout:z(i)}}function Oe(n,t){n=$t(n,!0,t);const e=n.getType();let i;switch(e){case"Point":{i=Gs(n);break}case"LineString":{i=Ss(n);break}case"Polygon":{i=Is(n,t);break}case"MultiPoint":{i=As(n);break}case"MultiLineString":{i=$s(n);break}case"MultiPolygon":{i=Fs(n,t);break}case"GeometryCollection":{i=Ms(n,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function Ms(n,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return Oe(i,t)})}}function Ss(n,t){return{type:"LineString",coordinates:n.getCoordinates()}}function $s(n,t){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function As(n,t){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function Fs(n,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(e)}}function Gs(n,t){return{type:"Point",coordinates:n.getCoordinates()}}function Is(n,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(e)}}const Ls=(n,t)=>new ms().writeFeaturesObject(n,t);class Ts extends Di{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(Qt(t),this.adaptOptions(e))}readFeatureFromText(t,e){return y()}readFeatures(t,e){return this.readFeaturesFromText(Qt(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return y()}readGeometry(t,e){return this.readGeometryFromText(Qt(t),this.adaptOptions(e))}readGeometryFromText(t,e){return y()}readProjection(t){return this.readProjectionFromText(Qt(t))}readProjectionFromText(t){return this.dataProjection}writeFeature(t,e){return this.writeFeatureText(t,this.adaptOptions(e))}writeFeatureText(t,e){return y()}writeFeatures(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))}writeFeaturesText(t,e){return y()}writeGeometry(t,e){return this.writeGeometryText(t,this.adaptOptions(e))}writeGeometryText(t,e){return y()}}function Qt(n){return typeof n=="string"?n:""}const Rs={POINT:Z,LINESTRING:q,POLYGON:D,MULTIPOINT:Mt,MULTILINESTRING:Pt,MULTIPOLYGON:St},Qi="EMPTY",tn="Z",en="M",Ns="ZM",m={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},Os={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class ks{constructor(t){this.wkt=t,this.index_=-1}isAlpha_(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return e=e!==void 0?e:!1,t>="0"&&t<="9"||t=="."&&!e}isWhiteSpace_(t){return t==" "||t==" "||t=="\r"||t==`
61
+ `}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let i=t,r;if(t=="(")r=m.LEFT_PAREN;else if(t==",")r=m.COMMA;else if(t==")")r=m.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")r=m.NUMBER,i=this.readNumber_();else if(this.isAlpha_(t))r=m.TEXT,i=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")r=m.EOF;else throw new Error("Unexpected character: "+t)}return{position:e,value:i,type:r}}readNumber_(){let t;const e=this.index_;let i=!1,r=!1;do t=="."?i=!0:(t=="e"||t=="E")&&(r=!0),t=this.nextChar_();while(this.isNumeric_(t,i)||!r&&(t=="e"||t=="E")||r&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}class js{constructor(t){this.lexer_=t,this.token_={position:0,type:m.START},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(t){return this.token_.type==t}match(t){const e=this.isTokenType(t);return e&&this.consume_(),e}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let t="XY";const e=this.token_;if(this.isTokenType(m.TEXT)){const i=e.value;i===tn?t="XYZ":i===en?t="XYM":i===Ns&&(t="XYZM"),t!=="XY"&&this.consume_()}return t}parseGeometryCollectionText_(){if(this.match(m.LEFT_PAREN)){const t=[];do t.push(this.parseGeometry_());while(this.match(m.COMMA));if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(m.LEFT_PAREN)){const t=this.parsePoint_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(m.LEFT_PAREN)){const t=this.parsePointList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(m.LEFT_PAREN)){const t=this.parseLineStringTextList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(m.LEFT_PAREN)){let t;if(this.token_.type==m.LEFT_PAREN?t=this.parsePointTextList_():t=this.parsePointList_(),this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(m.LEFT_PAREN)){const t=this.parseLineStringTextList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(m.LEFT_PAREN)){const t=this.parsePolygonTextList_();if(this.match(m.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePoint_(){const t=[],e=this.layout_.length;for(let i=0;i<e;++i){const r=this.token_;if(this.match(m.NUMBER))t.push(r.value);else break}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}parsePointList_(){const t=[this.parsePoint_()];for(;this.match(m.COMMA);)t.push(this.parsePoint_());return t}parsePointTextList_(){const t=[this.parsePointText_()];for(;this.match(m.COMMA);)t.push(this.parsePointText_());return t}parseLineStringTextList_(){const t=[this.parseLineStringText_()];for(;this.match(m.COMMA);)t.push(this.parseLineStringText_());return t}parsePolygonTextList_(){const t=[this.parsePolygonText_()];for(;this.match(m.COMMA);)t.push(this.parsePolygonText_());return t}isEmptyGeometry_(){const t=this.isTokenType(m.TEXT)&&this.token_.value==Qi;return t&&this.consume_(),t}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const t=this.token_;if(this.match(m.TEXT)){const e=t.value;this.layout_=this.parseGeometryLayout_();const i=this.isEmptyGeometry_();if(e=="GEOMETRYCOLLECTION"){if(i)return new W([]);const o=this.parseGeometryCollectionText_();return new W(o)}const r=Rs[e];if(!r)throw new Error("Invalid geometry type: "+e);let s;if(i)e=="POINT"?s=[NaN,NaN]:s=[];else switch(e){case"POINT":{s=this.parsePointText_();break}case"LINESTRING":{s=this.parseLineStringText_();break}case"POLYGON":{s=this.parsePolygonText_();break}case"MULTIPOINT":{s=this.parseMultiPointText_();break}case"MULTILINESTRING":{s=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{s=this.parseMultiPolygonText_();break}}return new r(s,this.layout_)}throw new Error(this.formatErrorMessage_())}}class Hs extends Ts{constructor(t){super(),t=t||{},this.splitCollection_=t.splitCollection!==void 0?t.splitCollection:!1}parse_(t){const e=new ks(t);return new js(e).parse()}readFeatureFromText(t,e){const i=this.readGeometryFromText(t,e),r=new rt;return r.setGeometry(i),r}readFeaturesFromText(t,e){let i=[];const r=this.readGeometryFromText(t,e);this.splitCollection_&&r.getType()=="GeometryCollection"?i=r.getGeometriesArray():i=[r];const s=[];for(let o=0,a=i.length;o<a;++o){const l=new rt;l.setGeometry(i[o]),s.push(l)}return s}readGeometryFromText(t,e){const i=this.parse_(t);return $t(i,!1,e)}writeFeatureText(t,e){const i=t.getGeometry();return i?this.writeGeometryText(i,e):""}writeFeaturesText(t,e){if(t.length==1)return this.writeFeatureText(t[0],e);const i=[];for(let s=0,o=t.length;s<o;++s)i.push(t[s].getGeometry());const r=new W(i);return this.writeGeometryText(r,e)}writeGeometryText(t,e){return sn($t(t,!0,e))}}function nn(n){const t=n.getCoordinates();return t.length===0?"":t.join(" ")}function Us(n){const t=[],e=n.getPoints();for(let i=0,r=e.length;i<r;++i)t.push("("+nn(e[i])+")");return t.join(",")}function Xs(n){const t=[],e=n.getGeometries();for(let i=0,r=e.length;i<r;++i)t.push(sn(e[i]));return t.join(",")}function ke(n){const t=n.getCoordinates(),e=[];for(let i=0,r=t.length;i<r;++i)e.push(t[i].join(" "));return e.join(",")}function Ys(n){const t=[],e=n.getLineStrings();for(let i=0,r=e.length;i<r;++i)t.push("("+ke(e[i])+")");return t.join(",")}function rn(n){const t=[],e=n.getLinearRings();for(let i=0,r=e.length;i<r;++i)t.push("("+ke(e[i])+")");return t.join(",")}function Bs(n){const t=[],e=n.getPolygons();for(let i=0,r=e.length;i<r;++i)t.push("("+rn(e[i])+")");return t.join(",")}function Vs(n){const t=n.getLayout();let e="";return(t==="XYZ"||t==="XYZM")&&(e+=tn),(t==="XYM"||t==="XYZM")&&(e+=en),e}const zs={Point:nn,LineString:ke,Polygon:rn,MultiPoint:Us,MultiLineString:Ys,MultiPolygon:Bs,GeometryCollection:Xs};function sn(n){const t=n.getType(),e=zs[t],i=e(n);let r=Os[t];if(typeof n.getFlatCoordinates=="function"){const s=Vs(n);s.length>0&&(r+=" "+s)}return i.length===0?r+" "+Qi:r+"("+i+")"}const Js=(n,t)=>new Hs().writeFeatures(n,t);/**
60
62
  * @license
61
63
  * Copyright 2021 Google LLC
62
64
  * SPDX-License-Identifier: BSD-3-Clause
63
- */function on(n,t,e){return n?t(n):e==null?void 0:e(n)}class an extends H{constructor(){super();T(this,At,!0);T(this,Ft,!0);this.multipleFeatures=!1,this.drawnFeatures=[],this.importFeatures=!1,this.showEditor=!1,this.currentlyDrawing=!1,this.drawFunc=null,this.geoJSON="",this.unstyled=!1,this.select=!1}updateButtonStates(){const{drawDisabled:e,discardDisabled:i}=Wn(this);L(this,At,e),L(this,Ft,i)}createRenderRoot(){return this}render(){this.updateButtonStates();const e=this.currentlyDrawing?"drawing":"draw";return k`
65
+ */function on(n,t,e){return n?t(n):e==null?void 0:e(n)}class an extends H{constructor(){super();R(this,At,!0);R(this,Ft,!0);this.multipleFeatures=!1,this.drawnFeatures=[],this.importFeatures=!1,this.showEditor=!1,this.currentlyDrawing=!1,this.drawFunc=null,this.geoJSON="",this.unstyled=!1,this.select=!1}updateButtonStates(){const{drawDisabled:e,discardDisabled:i}=Wn(this);I(this,At,e),I(this,Ft,i)}createRenderRoot(){return this}render(){this.updateButtonStates();const e=this.currentlyDrawing?"drawing":"draw";return k`
64
66
  <style>
65
67
  ${!this.unstyled&&qn}
66
68
  ${!this.unstyled&&Zn}
@@ -175,7 +177,7 @@
175
177
  color: white;
176
178
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Econtent-copy%3C/title%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z' fill='white' /%3E%3C/svg%3E")
177
179
  }
178
- `,qs=n=>{(()=>{if(n.emitDrawnFeatures(),!n.multipleFeatures)n.draw.setActive(!1),n.selectionEvents.removeSelectionEvent(),n.currentlyDrawing=!1;else if(n.continuous)if(!n.layerId)n.drawLayer.getSource().clear(!0),n.drawnFeatures=[];else{const i=n.drawLayer.getSource().getFeatures().at(-1);n.drawLayer.getSource().clear(!0),n.drawLayer.getSource().addFeature(i),n.drawnFeatures=[i]}})(),n.requestUpdate()},Zs=n=>{const t=()=>{n.drawLayer.set("isDrawingEnabled",!0),n.draw.setActive(!0),n.selectionEvents.addSelectionEvent()},e=()=>{n.currentlyDrawing=!0,n.requestUpdate()};t(),e()},Ds=n=>{let t;return typeof n=="string"?t=document.querySelector(n):t=n,t},ln=(n,t)=>{var s,o,a,l,h;const i=Ds(n.for),r=i.map;return n.drawLayer=i.addOrUpdateLayer({zIndex:100,type:"Vector",properties:{id:"drawLayer",layerControlHide:!0,isDrawingEnabled:!1,multipleFeatures:t},source:{type:"Vector"},style:(s=n.featureStyles)==null?void 0:s.layer,interactions:[{type:"draw",options:{active:!1,id:"drawInteraction",type:n.type,modify:n.allowModify,stopClick:!0,style:(o=n.featureStyles)==null?void 0:o.layer}},{type:"select",options:{id:"selectHover",condition:"pointermove",style:((a=n.featureStyles)==null?void 0:a.hover)||{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5},tooltip:!1}},{type:"select",options:{id:"selectClick",condition:"click",panIn:!0,style:((l=n.featureStyles)==null?void 0:l.click)||{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5}}}]}),n.draw=i.interactions.drawInteraction,n.modify=i.interactions.drawInteractionmodify,je(n,i,n.layerId),(h=n.modify)==null||h.on("modifyend",()=>n.onModifyEnd()),i.addEventListener("addfeatures",()=>qs(n)),{EoxMap:i,OlMap:r}},Ks=n=>{const t=()=>{n.drawnFeatures=[],n.draw.setActive(!1),n.selectionEvents.removeSelectionEvent(),n.drawLayer.getSource().clear(),n.geoJSON=null},e=()=>{n.emitDrawnFeatures(),n.currentlyDrawing=!1,n.requestUpdate()};t(),e()},Qs=(n,t)=>{setTimeout(()=>{const i=n.drawLayer.getSource().getFeatures(),r=n.eoxMap.projection||"EPSG:3857",s=n.projection;n.drawnFeatures=s?i.map(a=>{a=a.clone();const l=a.getGeometry().transform(r,s);return a.setGeometry(l),a}):i;let o;switch(n.format){case"geojson":o=Is(n.drawnFeatures);break;case"wkt":o=Js(n.drawnFeatures);break;case"feature":o=n.drawnFeatures;break;default:o=n.drawnFeatures;break}n.updateGeoJSON(),n.requestUpdate(),t(o)},0)},to=n=>{const t=r=>{(r==null?void 0:r.detail.id)!=="SelectLayerClickInteraction"||!r.detail.feature||(n.drawLayer.getSource().addFeature(r.detail.feature),n.eoxMap.dispatchEvent(new CustomEvent("addfeatures",{detail:r.detail})))};return{addSelectionEvent:()=>{n.layerId&&(n.eoxMap.selectInteractions.SelectLayerHoverInteraction.setActive(!0),n.eoxMap.addEventListener("select",t))},removeSelectionEvent:()=>{var s;const r=(s=n.eoxMap.selectInteractions)==null?void 0:s.SelectLayerHoverInteraction;r&&(r.selectedFids=[],r.setActive(!1)),n.eoxMap.removeEventListener("select",t)}}},je=(n,t,e)=>{var a,l;if(!e||!t)return;const i=JSON.parse(JSON.stringify(t.getLayerById(e).get("_jsonDefinition")))||null;if(!i){console.error(`Layer with id ${e} not found`);return}const r={type:"select",active:!1,options:{id:"SelectLayerHoverInteraction",condition:"pointermove",active:!1,style:((a=n.featureStyles)==null?void 0:a.hover)||{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"#3399CC","stroke-width":2.5}}},s={type:"select",options:{id:"SelectLayerClickInteraction",condition:"click",multi:n.multipleFeatures,modify:n.allowModify,active:!1,style:((l=n.featureStyles)==null?void 0:l.click)||{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"rgba(0, 0, 0,0.0)"}}};i.interactions=[r,s],t.addOrUpdateLayer(i);const o=n.draw;n.draw=t.selectInteractions.SelectLayerClickInteraction,o.setActive(!1),t.selectInteractions.SelectLayerClickInteraction.setActive(!1),t.selectInteractions.SelectLayerHoverInteraction.setActive(!1)},eo=(n,t,e,i)=>{if(t){if(e){i&&e!==i&&hn(n,t),je(n,t,e);return}if(!e&&i){hn(n,t);return}}};function hn(n,t){t&&(n.discardDrawing(),n.selectionEvents.removeSelectionEvent(),n.draw=t.interactions.drawInteraction,t.selectInteractions.SelectLayerClickInteraction.remove(),t.selectInteractions.SelectLayerHoverInteraction.remove())}const io=':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, transparent); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}pre { position: relative; border-radius: 4px; z-index: 1; margin: 0; padding: 20px 0; background: transparent; background: var(--code-bg-color, #8e96aa24); overflow: auto;}code { display: block; padding: 0 24px; width: fit-content; min-width: 100%; line-height: var(--code-line-height, 1.7); font-family: var(--code-font-family, monospace); font-size: var(--code-font-size, var(--font-size)); color: var(--code-color, #004170);}:not(pre) > code { display: inline; border-radius: 4px; background: var(--code-bg-color, #8e96aa24); padding: var(--code-padding, 3px 6px);}';function no(n,t){function e(s){s.preventDefault(),s.stopPropagation()}function i(s){s.srcElement.style.opacity="0.4"}function r(s){s.srcElement.style.opacity="1"}["dragenter","dragover","dragleave","drop"].forEach(s=>{t.addEventListener(s,e,!1),["dragenter","dragover"].includes(s)?t.addEventListener(s,i,!1):t.addEventListener(s,r,!1)}),t.addEventListener("drop",s=>cn(s,n),!1)}function ro(n){n.preventDefault(),n.stopPropagation()}function cn(n,t){ro(n);const e=n.dataTransfer?n.dataTransfer.files:n.target.files;Array.from(e).forEach(i=>so(i,t))}function so(n,t){const e=new FileReader;e.readAsText(n),e.onloadend=function(){typeof e.result=="string"&&t.handleFeatureChange(e.result)}}class un extends H{constructor(){super();T(this,ct);T(this,ut);T(this,Gt);T(this,dt);T(this,Lt);this.allowModify=!1,this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.layerId="",this.drawnFeatures=[],this.featureStyles=null,this.modify=null,this.multipleFeatures=!1,this.importFeatures=!1,this.showEditor=!1,this.showList=!1,this.projection="EPSG:4326",this.type="Polygon",this.selectionEvents=null,this.format="feature",this.unstyled=!1,this.noShadow=!1}static get properties(){return{allowModify:{attribute:"allow-modify",type:Boolean},for:{type:String},currentlyDrawing:{attribute:!1,state:!0,type:Boolean},continuous:{type:Boolean},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},layerId:{attribute:"layer-id",type:String},featureStyles:{attribute:!1},modify:{attribute:!1,state:!0},multipleFeatures:{attribute:"multiple-features",type:Boolean},importFeatures:{attribute:"import-features",type:Boolean},showEditor:{attribute:"show-editor",type:Boolean},showList:{attribute:"show-list",type:Boolean},projection:{type:String},noShadow:{type:Boolean},format:{type:String},type:{type:String},unstyled:{type:Boolean}}}set continuous(e){L(this,Lt,e),e&&(this.multipleFeatures=!0)}get continuous(){return A(this,Lt)}set layerId(e){eo(this,this.eoxMap,e,A(this,dt)),L(this,dt,e)}get layerId(){return A(this,dt)}startDrawing(){Zs(this)}discardDrawing(){Ks(this)}handleFeatureChange(e,i=!1){this.eoxMap.parseTextToFeature(e||JSON.stringify(ni),this.drawLayer,this.eoxMap,i)}handleFilesChange(e){cn(e,this)}onModifyEnd(){this.emitDrawnFeatures()}updateGeoJSON(){L(this,Gt,JSON.stringify(this.eoxMap.parseFeature(this.drawnFeatures)||ni,void 0,2))}emitDrawnFeatures(){Qs(this,i=>{this.dispatchEvent(new CustomEvent("drawupdate",{detail:i}))})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){const{EoxMap:e,OlMap:i}=ln(this,this.multipleFeatures);this.eoxMap=e,L(this,ut,i),this.selectionEvents=to(this),this.importFeatures&&no(this,this.eoxMap),this.updateGeoJSON(),this.requestUpdate()}updated(e){if(e.has("for")){const{EoxMap:i,OlMap:r}=ln(this,this.multipleFeatures);this.eoxMap=i,L(this,ut,r)}}get eoxMap(){return A(this,ct)}set eoxMap(e){const i=A(this,ct);L(this,ct,e),this.requestUpdate("eoxMap",i)}disconnectedCallback(){var e;(e=this.eoxMap)==null||e.map.removeLayer(this.drawLayer),super.disconnectedCallback()}render(){var e;return k`
180
+ `,qs=n=>{(()=>{if(n.emitDrawnFeatures(),!n.multipleFeatures)n.draw.setActive(!1),n.selectionEvents.removeSelectionEvent(),n.currentlyDrawing=!1;else if(n.continuous)if(!n.layerId)n.drawLayer.getSource().clear(!0),n.drawnFeatures=[];else{const i=n.drawLayer.getSource().getFeatures().at(-1);n.drawLayer.getSource().clear(!0),n.drawLayer.getSource().addFeature(i),n.drawnFeatures=[i]}})(),n.requestUpdate()},Zs=n=>{const t=()=>{n.drawLayer.set("isDrawingEnabled",!0),n.draw.setActive(!0),n.selectionEvents.addSelectionEvent()},e=()=>{n.currentlyDrawing=!0,n.requestUpdate()};t(),e()},Ds=n=>{let t;return typeof n=="string"?t=document.querySelector(n):t=n,t},ln=(n,t)=>{var s,o,a,l,h;const i=Ds(n.for),r=i.map;return n.drawLayer=i.addOrUpdateLayer({zIndex:100,type:"Vector",properties:{id:"drawLayer",layerControlHide:!0,isDrawingEnabled:!1,multipleFeatures:t},source:{type:"Vector"},style:(s=n.featureStyles)==null?void 0:s.layer,interactions:[{type:"draw",options:{active:!1,id:"drawInteraction",type:n.type,modify:n.allowModify,stopClick:!0,style:(o=n.featureStyles)==null?void 0:o.layer}},{type:"select",options:{id:"selectHover",condition:"pointermove",style:((a=n.featureStyles)==null?void 0:a.hover)||{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5},tooltip:!1}},{type:"select",options:{id:"selectClick",condition:"click",panIn:!0,style:((l=n.featureStyles)==null?void 0:l.click)||{"fill-color":"rgba(51, 153, 204,0.5)","stroke-color":"#3399CC","stroke-width":2.5}}}]}),n.draw=i.interactions.drawInteraction,n.modify=i.interactions.drawInteractionmodify,je(n,i,n.layerId),(h=n.modify)==null||h.on("modifyend",()=>n.onModifyEnd()),i.addEventListener("addfeatures",()=>qs(n)),{EoxMap:i,OlMap:r}},Ks=n=>{const t=()=>{n.drawnFeatures=[],n.draw.setActive(!1),n.selectionEvents.removeSelectionEvent(),n.drawLayer.getSource().clear(),n.geoJSON=null},e=()=>{n.emitDrawnFeatures(),n.currentlyDrawing=!1,n.requestUpdate()};t(),e()},Qs=(n,t)=>{setTimeout(()=>{const i=n.drawLayer.getSource().getFeatures(),r=n.eoxMap.projection||"EPSG:3857",s=n.projection;n.drawnFeatures=s?i.map(a=>{a=a.clone();const l=a.getGeometry().transform(r,s);return a.setGeometry(l),a}):i;let o;switch(n.format){case"geojson":o=Ls(n.drawnFeatures);break;case"wkt":o=Js(n.drawnFeatures);break;case"feature":o=n.drawnFeatures;break;default:o=n.drawnFeatures;break}n.updateGeoJSON(),n.requestUpdate(),t(o)},0)},to=n=>{const t=r=>{(r==null?void 0:r.detail.id)!=="SelectLayerClickInteraction"||!r.detail.feature||(n.drawLayer.getSource().addFeature(r.detail.feature),n.eoxMap.dispatchEvent(new CustomEvent("addfeatures",{detail:r.detail})))};return{addSelectionEvent:()=>{n.layerId&&(n.eoxMap.selectInteractions.SelectLayerHoverInteraction.setActive(!0),n.eoxMap.addEventListener("select",t))},removeSelectionEvent:()=>{var s;const r=(s=n.eoxMap.selectInteractions)==null?void 0:s.SelectLayerHoverInteraction;r&&(r.selectedFids=[],r.setActive(!1)),n.eoxMap.removeEventListener("select",t)}}},je=(n,t,e)=>{var a,l;if(!e||!t)return;const i=JSON.parse(JSON.stringify(t.getLayerById(e).get("_jsonDefinition")))||null;if(!i){console.error(`Layer with id ${e} not found`);return}const r={type:"select",active:!1,options:{id:"SelectLayerHoverInteraction",condition:"pointermove",active:!1,style:((a=n.featureStyles)==null?void 0:a.hover)||{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"#3399CC","stroke-width":2.5}}},s={type:"select",options:{id:"SelectLayerClickInteraction",condition:"click",multi:n.multipleFeatures,modify:n.allowModify,active:!1,style:((l=n.featureStyles)==null?void 0:l.click)||{"fill-color":"rgba(0, 0, 0,0.0)","stroke-color":"rgba(0, 0, 0,0.0)"}}};i.interactions=[r,s],t.addOrUpdateLayer(i);const o=n.draw;n.draw=t.selectInteractions.SelectLayerClickInteraction,o.setActive(!1),t.selectInteractions.SelectLayerClickInteraction.setActive(!1),t.selectInteractions.SelectLayerHoverInteraction.setActive(!1)},eo=(n,t,e,i)=>{if(t){if(e){i&&e!==i&&hn(n,t),je(n,t,e);return}if(!e&&i){hn(n,t);return}}};function hn(n,t){t&&(n.discardDrawing(),n.selectionEvents.removeSelectionEvent(),n.draw=t.interactions.drawInteraction,t.selectInteractions.SelectLayerClickInteraction.remove(),t.selectInteractions.SelectLayerHoverInteraction.remove())}const io=':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, transparent); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}pre { position: relative; border-radius: 4px; z-index: 1; margin: 0; padding: 20px 0; background: transparent; background: var(--code-bg-color, #8e96aa24); overflow: auto;}code { display: block; padding: 0 24px; width: fit-content; min-width: 100%; line-height: var(--code-line-height, 1.7); font-family: var(--code-font-family, monospace); font-size: var(--code-font-size, var(--font-size)); color: var(--code-color, #004170);}:not(pre) > code { display: inline; border-radius: 4px; background: var(--code-bg-color, #8e96aa24); padding: var(--code-padding, 3px 6px);}';function no(n,t){function e(s){s.preventDefault(),s.stopPropagation()}function i(s){s.srcElement.style.opacity="0.4"}function r(s){s.srcElement.style.opacity="1"}["dragenter","dragover","dragleave","drop"].forEach(s=>{t.addEventListener(s,e,!1),["dragenter","dragover"].includes(s)?t.addEventListener(s,i,!1):t.addEventListener(s,r,!1)}),t.addEventListener("drop",s=>cn(s,n),!1)}function ro(n){n.preventDefault(),n.stopPropagation()}function cn(n,t){ro(n);const e=n.dataTransfer?n.dataTransfer.files:n.target.files;Array.from(e).forEach(i=>so(i,t))}function so(n,t){const e=new FileReader;e.readAsText(n),e.onloadend=function(){typeof e.result=="string"&&t.handleFeatureChange(e.result)}}class un extends H{constructor(){super();R(this,ct);R(this,ut);R(this,Gt);R(this,dt);R(this,It);this.allowModify=!1,this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.layerId="",this.drawnFeatures=[],this.featureName="Feature",this.featureStyles=null,this.modify=null,this.multipleFeatures=!1,this.importFeatures=!1,this.showEditor=!1,this.showList=!1,this.projection="EPSG:4326",this.type="Polygon",this.selectionEvents=null,this.format="feature",this.unstyled=!1,this.noShadow=!1}static get properties(){return{allowModify:{attribute:"allow-modify",type:Boolean},for:{type:String},currentlyDrawing:{attribute:!1,state:!0,type:Boolean},continuous:{type:Boolean},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},featureName:{attribute:"feature-name",type:String},layerId:{attribute:"layer-id",type:String},featureStyles:{attribute:!1},modify:{attribute:!1,state:!0},multipleFeatures:{attribute:"multiple-features",type:Boolean},importFeatures:{attribute:"import-features",type:Boolean},showEditor:{attribute:"show-editor",type:Boolean},showList:{attribute:"show-list",type:Boolean},projection:{type:String},noShadow:{type:Boolean},format:{type:String},type:{type:String},unstyled:{type:Boolean}}}set continuous(e){I(this,It,e),e&&(this.multipleFeatures=!0)}get continuous(){return A(this,It)}set layerId(e){eo(this,this.eoxMap,e,A(this,dt)),I(this,dt,e)}get layerId(){return A(this,dt)}startDrawing(){Zs(this)}discardDrawing(){Ks(this)}handleFeatureChange(e,i=!1){this.eoxMap.parseTextToFeature(e||JSON.stringify(ni),this.drawLayer,this.eoxMap,i)}handleFilesChange(e){cn(e,this)}onModifyEnd(){this.emitDrawnFeatures()}updateGeoJSON(){I(this,Gt,JSON.stringify(this.eoxMap.parseFeature(this.drawnFeatures)||ni,void 0,2))}emitDrawnFeatures(){Qs(this,i=>{this.dispatchEvent(new CustomEvent("drawupdate",{detail:i}))})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){const{EoxMap:e,OlMap:i}=ln(this,this.multipleFeatures);this.eoxMap=e,I(this,ut,i),this.selectionEvents=to(this),this.importFeatures&&no(this,this.eoxMap),this.updateGeoJSON(),this.requestUpdate()}updated(e){if(e.has("for")){const{EoxMap:i,OlMap:r}=ln(this,this.multipleFeatures);this.eoxMap=i,I(this,ut,r)}}get eoxMap(){return A(this,ct)}set eoxMap(e){const i=A(this,ct);I(this,ct,e),this.requestUpdate("eoxMap",i)}disconnectedCallback(){var e;(e=this.eoxMap)==null||e.map.removeLayer(this.drawLayer),super.disconnectedCallback()}render(){var e;return k`
179
181
  <style>
180
182
  :host { display: block; }
181
183
  ${!this.unstyled&&io}
@@ -197,13 +199,15 @@
197
199
 
198
200
  <!-- List Component -->
199
201
  ${this.showList&&((e=this.drawnFeatures)!=null&&e.length)?k`<eox-drawtools-list
202
+ .eoxDrawTools=${this}
200
203
  .eoxMap=${this.eoxMap}
201
204
  .olMap=${A(this,ut)}
202
205
  .draw=${this.draw}
203
206
  .drawLayer=${this.drawLayer}
204
207
  .drawnFeatures=${this.drawnFeatures}
208
+ .featureName=${this.featureName}
205
209
  .modify=${this.modify}
206
210
  .unstyled=${this.unstyled}
207
211
  @changed=${()=>{this.updateGeoJSON(),this.requestUpdate()}}
208
212
  ></eox-drawtools-list>`:b}
209
- `}}ct=new WeakMap,ut=new WeakMap,Gt=new WeakMap,dt=new WeakMap,Lt=new WeakMap,customElements.define("eox-drawtools",un),C.EOxDrawTools=un,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
213
+ `}}ct=new WeakMap,ut=new WeakMap,Gt=new WeakMap,dt=new WeakMap,It=new WeakMap,customElements.define("eox-drawtools",un),w.EOxDrawTools=un,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/drawtools",
3
- "version": "0.13.5",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/map": "^1.19.3",
@@ -16,14 +16,14 @@
16
16
  "src"
17
17
  ],
18
18
  "main": "./src/main.js",
19
- "types": "./types/main.d.ts",
19
+ "types": "./types/drawtools/src/main.d.ts",
20
20
  "typesVersions": {
21
21
  "*": {
22
22
  ".": [
23
- "./types/main.d.ts"
23
+ "./types/drawtools/src/main.d.ts"
24
24
  ],
25
25
  "src/*": [
26
- "./types/*"
26
+ "./types/drawtools/src/*"
27
27
  ]
28
28
  }
29
29
  },