@eox/drawtools 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-drawtools.js +2 -2
- package/dist/eox-drawtools.umd.cjs +12 -12
- package/package.json +2 -2
package/dist/eox-drawtools.js
CHANGED
|
@@ -729,7 +729,7 @@ customElements.define("eox-drawtools-list", Ai);
|
|
|
729
729
|
const Wn = (n) => {
|
|
730
730
|
const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: i } = n, r = !t && (e == null ? void 0 : e.length) > 0 || i, s = !(e != null && e.length) && !i;
|
|
731
731
|
return { drawDisabled: r, discardDisabled: s };
|
|
732
|
-
}, qn =
|
|
732
|
+
}, 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);}';
|
|
733
733
|
function Kn(n) {
|
|
734
734
|
navigator.clipboard.writeText(n).then(
|
|
735
735
|
function() {
|
|
@@ -7007,7 +7007,7 @@ function vi(n, t) {
|
|
|
7007
7007
|
t && (n.discardDrawing(), n.selectionEvents.removeSelectionEvent(), n.draw = /** @type {import("ol/interaction").Draw} */
|
|
7008
7008
|
t.interactions.drawInteraction, t.selectInteractions.SelectLayerClickInteraction.remove(), t.selectInteractions.SelectLayerHoverInteraction.remove());
|
|
7009
7009
|
}
|
|
7010
|
-
const no = ':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color,
|
|
7010
|
+
const no = ':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);}';
|
|
7011
7011
|
function ro(n, t) {
|
|
7012
7012
|
function e(s) {
|
|
7013
7013
|
s.preventDefault(), s.stopPropagation();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(function(
|
|
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 ao=Object.defineProperty;var fn=w=>{throw TypeError(w)};var lo=(w,_,b)=>_ in w?ao(w,_,{enumerable:!0,configurable:!0,writable:!0,value:b}):w[_]=b;var Q=(w,_,b)=>lo(w,typeof _!="symbol"?_+"":_,b),pn=(w,_,b)=>_.has(w)||fn("Cannot "+b);var G=(w,_,b)=>(pn(w,_,"read from private field"),b?b.call(w):_.get(w)),tt=(w,_,b)=>_.has(w)?fn("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(w):_.set(w,b),L=(w,_,b,gt)=>(pn(w,_,"write to private field"),gt?gt.call(w,b):_.set(w,b),b);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var un,St,Ft,ct,ut,Gt,dt;const _=globalThis,b=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),
|
|
5
|
+
*/var un,St,Ft,ct,ut,Gt,dt;const _=globalThis,b=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Ue=new WeakMap;let mn=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(b&&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 _n=n=>new mn(typeof n=="string"?n:n+"",void 0,gt),vn=(n,t)=>{if(b)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)}},je=b?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return _n(e)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:wn,defineProperty:Cn,getOwnPropertyDescriptor:En,getOwnPropertyNames:bn,getOwnPropertySymbols:xn,getPrototypeOf:Pn}=Object,T=globalThis,Xe=T.trustedTypes,Mn=Xe?Xe.emptyScript:"",Qt=T.reactiveElementPolyfillSupport,ft=(n,t)=>n,te={toAttribute(n,t){switch(t){case Boolean:n=n?Mn: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}},Ye=(n,t)=>!wn(n,t),Be={attribute:!0,type:String,converter:te,reflect:!1,hasChanged:Ye};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),T.litPropertyMetadata??(T.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=Be){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&&Cn(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)??Be}static _$Ei(){if(this.hasOwnProperty(ft("elementProperties")))return;const t=Pn(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=[...bn(e),...xn(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(je(r))}else t!==void 0&&e.push(je(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 vn(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:te).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:te;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??Ye)(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,Qt==null||Qt({ReactiveElement:et}),(T.reactiveElementVersions??(T.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/class
|
|
19
|
+
*/class H extends et{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Nn(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return it}}H._$litElement$=!0,H.finalized=!0,(un=globalThis.litElementHydrateSupport)==null||un.call(globalThis,{LitElement:H});const se=globalThis.litElementPolyfillSupport;se==null||se({LitElement:H}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2020 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const Hn={},Un=(n,t=Hn)=>n._$AH=t;/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2021 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
-
*/const
|
|
31
|
+
*/const jn=On(class extends kn{constructor(){super(...arguments),this.key=E}render(n,t){return this.key=n,t}update(n,[t,e]){return t!==this.key&&(Un(n),this.key=t),e}}),Xn=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)},Yn=(n,t,e)=>{if(n.clickId===t)return;const i=e?[]:[t];n.hoverInteraction.highlightById(i)},Bn=(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()},ei={duration:750},ii={type:"FeatureCollection",features:[]},Vn=(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,ei),o.highlightById([])}else{const h=l.getExtent();o.highlightById([e]),s.getView().fit(h,ei)}t.requestUpdate()},zn="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 ni extends H{constructor(){super();Q(this,"hoverInteraction");Q(this,"clickInteraction");Q(this,"hoverId");Q(this,"clickId");this.eoxMap=null,this.olMap=null,this.draw=null,this.drawLayer=null,this.drawnFeatures=[],this.modify=null,this.unstyled=!1}_handleDelete(e){Bn(e,this),this.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))}_handleFeatureSelectAndDeselect(e){Vn(e,this)}_handleHoverFeature(e,i=!1){Yn(this,e,i)}firstUpdated(){Xn(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],O`
|
|
32
32
|
<style>
|
|
33
33
|
${!this.unstyled&&zn}
|
|
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
|
|
36
|
+
${this.drawnFeatures.map((r,s)=>{const o=s+1,a=r.getId(),l=this.hoverId===a,h=this.clickId===a;return jn(o,O`
|
|
37
37
|
<li
|
|
38
38
|
class="${l||h?"selected":E}"
|
|
39
39
|
@mouseover=${()=>this._handleHoverFeature(a)}
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
</li>
|
|
56
56
|
`)})}
|
|
57
57
|
</ul>
|
|
58
|
-
`}}Q(ni,"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",ni);const Dn=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}},Jn='button,.button { 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):not(.json-editor-btntype-*),.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-btn-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,button[class*="json-editor-btntype-"] { 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,button[class*="json-editor-btntype-"]::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: 0;}',Wn='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[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;}';function qn(n){navigator.clipboard.writeText(n).then(function(){},function(t){console.error("Could not copy text: ",t)})}class ri{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Zn={PROPERTYCHANGE:"propertychange"};class Kn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Qn(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 S(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 tr(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||!tr(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 er extends Kn{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 ri(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]))}}const oe={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function Ct(n,t,e,i,r){if(r){const o=e;e=function(){n.removeEventListener(t,e),o.apply(i??this,arguments)}}else i&&i!==n&&(e=e.bind(i));const s={target:n,type:t,listener:e};return n.addEventListener(t,e),s}function ci(n,t,e,i){return Ct(n,t,e,i,!0)}function It(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),li(n))}class Nt extends er{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(oe.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]=ci(this,t[s],e)}else i=ci(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)ir(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)}}Nt.prototype.on,Nt.prototype.once,Nt.prototype.un;function ir(n){if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)It(n[t]);else It(n)}function y(){throw new Error("Unimplemented abstract method.")}let nr=0;function rr(n){return n.ol_uid||(n.ol_uid=String(++nr))}class ui extends ri{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class di extends Nt{constructor(t){super(),this.on,this.once,this.un,rr(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 ui(i,t,e)),i=Zn.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new ui(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 sr(n,t){if(!n)throw new Error(t)}class rt extends di{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_&&(It(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Ct(t,oe.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?or(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 or(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(sr(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}new Array(6);function gi(){return[1,0,0,1,0,0]}function fi(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}const x={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function H(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 ar(n,t){return n[0]<=t[0]&&t[2]<=n[2]&&n[1]<=t[1]&&t[3]<=n[3]}function pi(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function yi(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 ae(){return[1/0,1/0,-1/0,-1/0]}function mi(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 le(n){return mi(1/0,1/0,-1/0,-1/0,n)}function _i(n,t){const e=n[0],i=n[1];return mi(e,i,e,i,t)}function he(n,t,e,i,r){const s=le(r);return vi(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 vi(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 Ot(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function kt(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=yi(n,t),s=yi(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}const _r={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ce{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_||_r[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,vr=[-st,-st,st,st],Cr=[-180,-85,180,85],jt=wt*Math.log(Math.tan(Math.PI/2));class ot extends ce{constructor(t){super({code:t,units:"m",extent:vr,global:!0,worldExtent:Cr,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 wr(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>jt?o=jt:o<-jt&&(o=-jt),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 br=6378137,wi=[-180,-90,180,90],xr=Math.PI*br/180;class U extends ce{constructor(t,e){super({code:t,units:"degrees",extent:wi,axisOrientation:e,global:!0,metersPerUnit:xr,worldExtent:wi})}}const Ei=[new U("CRS:84"),new U("EPSG:4326","neu"),new U("urn:ogc:def:crs:OGC:1.3:CRS84"),new U("urn:ogc:def:crs:OGC:2:84"),new U("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new U("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new U("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ue={};function Pr(n){return ue[n]||ue[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Mr(n,t){ue[n]=t}let at={};function Et(n,t,e){const i=n.getCode(),r=t.getCode();i in at||(at[i]={}),at[i][r]=e}function de(n,t){return n in at&&t in at[n]?at[n][t]:null}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 bi(n){return n*180/Math.PI}function Ht(n){return n*Math.PI/180}function ge(n,t,e){return n+e*(t-n)}function fe(n,t,e){if(n>=t&&n<e)return n;const i=e-t;return((n-t)%i+i)%i+t}const Ut=.9996,$=.00669438,Xt=$*$,Yt=Xt*$,Y=$/(1-$),xi=Math.sqrt(1-$),lt=(1-xi)/(1+xi),Pi=lt*lt,pe=Pi*lt,ye=pe*lt,Mi=ye*lt,$i=1-$/4-3*Xt/64-5*Yt/256,Ar=3*$/8+3*Xt/32+45*Yt/1024,Sr=15*Xt/256+45*Yt/1024,Fr=35*Yt/3072,Gr=3/2*lt-27/32*pe+269/512*Mi,Tr=21/16*Pi-55/32*ye,Rr=151/96*pe-417/128*Mi,Lr=1097/512*ye,Bt=6378137;function Ir(n,t,e){const i=n-5e5,o=(e.north?t:t-1e7)/Ut/(Bt*$i),a=o+Gr*Math.sin(2*o)+Tr*Math.sin(4*o)+Rr*Math.sin(6*o)+Lr*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-$*h,p=Math.sqrt(1-$*h),v=Bt/p,P=(1-$)/f,w=Y*c**2,F=w*w,M=i/(v*Ut),K=M*M,Tt=K*M,dn=Tt*M,gn=dn*M,so=gn*M,oo=a-u/P*(K/2-dn/24*(5+3*d+10*w-4*F-9*Y))+so/720*(61+90*d+298*w+45*g-252*Y-3*F);let je=(M-Tt/6*(1+2*d+w)+gn/120*(5-2*w+28*d-3*F+8*Y+24*g))/c;return je=fe(je+Ht(Fi(e.number)),-Math.PI,Math.PI),[bi(je),bi(oo)]}const Ai=-80,Si=84,Nr=-180,Or=180;function kr(n,t,e){n=fe(n,Nr,Or),t<Ai?t=Ai:t>Si&&(t=Si);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=Fi(e.number),u=Ht(c),d=Bt/Math.sqrt(1-$*r**2),g=Y*s**2,f=s*fe(h-u,-Math.PI,Math.PI),p=f*f,v=p*f,P=v*f,w=P*f,F=w*f,M=Bt*($i*i-Ar*Math.sin(2*i)+Sr*Math.sin(4*i)-Fr*Math.sin(6*i)),K=Ut*d*(f+v/6*(1-a+g)+w/120*(5-18*a+l+72*g-58*Y))+5e5;let Tt=Ut*(M+d*o*(p/2+P/24*(5-a+9*g+4*g**2)+F/720*(61-58*a+l+600*g-330*Y)));return e.north||(Tt+=1e7),[K,Tt]}function Fi(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 Gi(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 Ti(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 Gi(n)?new ce({code:n,units:"m"}):null}function Ur(n){const t=Gi(n.getCode());return t?{forward:Ti(kr,t),inverse:Ti(Ir,t)}:null}const Xr=[Ur],Yr=[Hr];function me(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 _e(n){Mr(n.getCode(),n),Et(n,n,me)}function Br(n){n.forEach(_e)}function A(n){if(typeof n!="string")return n;const t=Pr(n);if(t)return t;for(const e of Yr){const i=e(n);if(i)return i}return null}function Ri(n){Br(n),n.forEach(function(t){n.forEach(function(e){t!==e&&Et(t,e,me)})})}function Vr(n,t,e,i){n.forEach(function(r){t.forEach(function(s){Et(r,s,e),Et(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)===me)&&e}function Li(n,t){const e=n.getCode(),i=t.getCode();let r=de(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=ve(s.inverse,o.forward);else{const l=de(e,a);l&&(r=ve(l,o.forward))}else{const l=de(a,i);l&&(r=ve(s.inverse,l))}return r&&(_e(n),_e(t),Et(n,t,r)),r}function ve(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=A(n),i=A(t);return Li(e,i)}function Dr(){Ri(Ci),Ri(Ei),Vr(Ei,Ci,wr,Er)}Dr();function Ii(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 Jr(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 Wr(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 qr(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 Ni=gi();class Oi extends di{constructor(){super(),this.extent_=ae(),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){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}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]))&&le(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=A(t),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),h=i.getWorldExtent(),c=kt(h)/kt(l);fi(Ni,h[0],h[3],c,-c,0,0,0);const u=Ii(s,0,s.length,a,Ni,o),d=Ce(i,e);return d?d(u,u,a):u}:Ce(i,e);return this.applyTransform(r),this}}class B extends Oi{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return he(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=ki(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){y()}setLayout(t,e,i){let r;if(t)r=ki(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=V(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();Jr(i,0,i.length,r,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=Ot(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();Wr(r,0,r.length,s,t,e,i,r),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const r=this.getStride();qr(i,0,i.length,r,t,e,i),this.changed()}}}function V(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function ki(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function Zr(n,t,e,i){for(let r=0,s=e.length;r<s;++r)n[t++]=e[r];return t}function Vt(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 bt(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=Vt(n,t,e[o],i);r[s++]=l,t=l}return r.length=s,r}function ji(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=bt(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}class z extends Oi{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(It),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],oe.CHANGE,this.changed,this))}clone(){const t=new z(we(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,i,r){if(r<H(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){le(t);const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)lr(t,e[i].getExtent());return t}getGeometries(){return we(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 z(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=Ot(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(we(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 we(n){return n.map(t=>t.clone())}function Hi(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]=ge(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 Ee(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 be(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=Ee(n,t,a,i,r),t=a}return r}function Kr(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=be(n,t,a,i,r),t=a[a.length-1]}return r}function xe(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(Hi(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&&(Hi(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 Pe(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=xe(n,t,g,i,r,s,o,a,l,h,c),t=g}return h}function Qr(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=Pe(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,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 F=n[w],M=n[w+1],K=$r(F,M,f,p,v,P);K>g&&(c=w,g=K)}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 Ui(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=zt(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 ts(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 Me(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=ts(n,t,c,i,r,s,o),a.push(o),t=c}return o}function es(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l],u=[];o=Me(n,t,c,i,r,s,o,u),a.push(u),t=c[c.length-1]}return o}function Dt(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 $e(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++]=Dt(n,t,l,i,r[s]),t=l}return r.length=s,r}function is(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?[]:$e(n,t,l,i,r[s]),t=l[l.length-1]}return r.length=s,r}function Xi(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 Yi(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=Xi(n,t,a,i),t=a}return r}function ns(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=Yi(n,t,a,i),t=a[a.length-1]}return r}class xt extends B{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<H(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ee(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),xe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))}getArea(){return Xi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=zt(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=Vt(this.flatCoordinates,0,t,this.stride),this.changed()}}function Bi(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 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=Qn(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]:ge(n[a+c],n[a+i+c],l);return s}function Ae(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(ge(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function rs(n,t,e,i,r,s,o){if(o)return Ae(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 Ae(n,t,c,i,r,!1);t=c}}return null}function ss(n,t,e,i,r){return!cr(r,function(o){return!D(n,t,e,i,o[0],o[1])})}function D(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 Se(n,t,e,i,r,s){if(e.length===0||!D(n,t,e[0],i,r,s))return!1;for(let o=1,a=e.length;o<a;++o)if(D(n,e[o-1],e[o],i,r,s))return!1;return!0}function os(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(Se(n,t,l,i,r,s))return!0;t=l[l.length-1]}return!1}function Wt(n,t,e,i,r){const s=vi(ae(),n,t,e,i);return pr(r,s)?ar(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Bi(n,t,e,i,function(o,a){return mr(r,o,a)}):!1}function as(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){if(Wt(n,t,e[s],i,r))return!0;t=e[s]}return!1}function ls(n,t,e,i,r){return!!(Wt(n,t,e,i,r)||D(n,t,e,i,r[0],r[1])||D(n,t,e,i,r[0],r[3])||D(n,t,e,i,r[2],r[1])||D(n,t,e,i,r[2],r[3]))}function Vi(n,t,e,i,r){if(!ls(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(ss(n,e[s-1],e[s],i,r)&&!Wt(n,e[s-1],e[s],i,r))return!1;return!0}function hs(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(Vi(n,t,a,i,r))return!0;t=a[a.length-1]}return!1}function cs(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 J extends B{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){S(this.flatCoordinates,t),this.changed()}clone(){const t=new J(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<H(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ee(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),xe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))}forEachSegment(t){return Bi(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,Ae(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Dt(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 cs(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=zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new J(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Wt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Vt(this.flatCoordinates,0,t,this.stride),this.changed()}}class Pt extends B{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];S(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){S(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<H(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(be(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pe(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,rs(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return $e(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new J(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 J(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);S(t,h),i=l}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Ui(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Pt(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return as(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=bt(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class W extends B{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new W(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 _i(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return pi(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zr(this.flatCoordinates,0,t,this.stride),this.changed()}}class Mt extends B{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){S(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<H(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 Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new W(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 W(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(pi(t,o,a))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Vt(this.flatCoordinates,0,t,this.stride),this.changed()}}function Fe(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,F=e.length;w<F;++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,Se(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 zi(n,t,e,i,r){let s=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];s=Fe(n,t,l,i,r,2*o,s),t=l[l.length-1]}return s}function us(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 Ge(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 Te(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=Ge(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 Di(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(!Te(n,t,a,i,r))return!1;a.length&&(t=a[a.length-1])}return!0}function qt(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=Ge(n,t,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&us(n,t,a,i),t=a}return t}function Re(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s)t=qt(n,t,e[s],i,r);return t}function ds(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=Ge(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}class q extends B{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?S(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new q(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r<H(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(be(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pe(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return Se(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Yi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),qt(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,$e(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ot(this.getExtent());this.flatInteriorPoint_=Fe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new W(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;Te(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=qt(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Me(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new q(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return Vi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=bt(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Ji(n,t,e,i){const r=[];let s=ae();for(let o=0,a=e.length;o<a;++o){const l=e[o];s=he(n,t,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=l[l.length-1]}return r}class $t extends B{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;S(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;S(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 $t(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,r){return r<H(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Kr(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Qr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return os(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return ns(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Re(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,is(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Ji(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=zi(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;Di(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Re(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=es(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new $t(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 q(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 q(e.slice(s,h),t,l);r.push(c),s=h}return r}getType(){return"MultiPolygon"}intersectsExtent(t){return hs(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=ji(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 Wi=gi();class Z{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"?_i(this.flatCoordinates_):he(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Ot(this.getExtent());this.flatInteriorPoints_=Fe(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=ds(this.flatCoordinates_,this.ends_),e=Ji(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=zi(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);S(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=A(t);const e=t.getExtent(),i=t.getWorldExtent();if(e&&i){const r=kt(i)/kt(e);fi(Wi,i[0],i[3],r,-r,0,0,0),Ii(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Wi,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;return new Z(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=zt(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Ui(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,r);break;case"Polygon":r=[],i.length=Me(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,r);break}return r&&(this.simplifiedGeometry_=new Z(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Z.prototype.getFlatCoordinates=Z.prototype.getOrientedFlatCoordinates;class qi{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=rt,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?A(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=A(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 At(n,t,e){const i=e?A(e.featureProjection):null,r=e?A(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:W,LineString:J,Polygon:q,MultiPoint:Mt,MultiLineString:Pt,MultiPolygon:$t};function fs(n,t,e){return Array.isArray(t[0])?(Di(n,0,t,e)||(n=n.slice(),Re(n,0,t,e)),n):(Te(n,0,t,e)||(n=n.slice(),qt(n,0,t,e)),n)}function Zi(n,t){var s;const e=n.geometry;if(!e)return[];if(Array.isArray(e))return e.map(o=>Zi({...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 At(new Z(i,i==="Polygon"?fs(e.flatCoordinates,e.ends,r):e.flatCoordinates,(s=e.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,t)}function Le(n,t){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Le(r,t));return new z(i)}const e=gs[n.type];return At(new e(n.flatCoordinates,n.layout,n.ends),!1,t)}class ps extends qi{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Zt(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Zt(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return y()}readFeaturesFromObject(t,e){return y()}readGeometry(t,e){return this.readGeometryFromObject(Zt(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return y()}readProjection(t){return this.readProjectionFromObject(Zt(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 Zt(n){if(typeof n=="string"){const t=JSON.parse(n);return t||null}return n!==null?n:null}class ys extends ps{constructor(t){t=t||{},super(),this.dataProjection=A(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=A(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=Ie(i.geometry);if(this.featureClass===Z)return Zi({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(Le(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 ms(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=A(e.properties.name);else if(e.type==="EPSG")i=A("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=Ne(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 Ne(t,this.adaptOptions(e))}}function Ie(n,t){if(!n)return null;let e;switch(n.type){case"Point":{e=vs(n);break}case"LineString":{e=Cs(n);break}case"Polygon":{e=xs(n);break}case"MultiPoint":{e=Es(n);break}case"MultiLineString":{e=ws(n);break}case"MultiPolygon":{e=bs(n);break}case"GeometryCollection":{e=_s(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return e}function ms(n,t){const e=Ie(n);return Le(e,t)}function _s(n,t){return n.geometries.map(function(i){return Ie(i)})}function vs(n){const t=n.coordinates;return{type:"Point",flatCoordinates:t,layout:V(t.length)}}function Cs(n){var i;const t=n.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:V(((i=t[0])==null?void 0:i.length)||2)}}function ws(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=bt(i,0,t,e);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:V(e)}}function Es(n){var e;const t=n.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:V(((e=t[0])==null?void 0:e.length)||2)}}function bs(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=ji(e,0,t,i);return{type:"MultiPolygon",flatCoordinates:e,ends:r,layout:V(i)}}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.length,r=bt(e,0,t,i);return{type:"Polygon",flatCoordinates:e,ends:r,layout:V(i)}}function Ne(n,t){n=At(n,!0,t);const e=n.getType();let i;switch(e){case"Point":{i=Fs(n);break}case"LineString":{i=Ms(n);break}case"Polygon":{i=Gs(n,t);break}case"MultiPoint":{i=As(n);break}case"MultiLineString":{i=$s(n);break}case"MultiPolygon":{i=Ss(n,t);break}case"GeometryCollection":{i=Ps(n,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function Ps(n,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return Ne(i,t)})}}function Ms(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 Ss(n,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(e)}}function Fs(n,t){return{type:"Point",coordinates:n.getCoordinates()}}function Gs(n,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(e)}}const Ts=(n,t)=>new ys().writeFeaturesObject(n,t);class Rs extends qi{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(Kt(t),this.adaptOptions(e))}readFeatureFromText(t,e){return y()}readFeatures(t,e){return this.readFeaturesFromText(Kt(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return y()}readGeometry(t,e){return this.readGeometryFromText(Kt(t),this.adaptOptions(e))}readGeometryFromText(t,e){return y()}readProjection(t){return this.readProjectionFromText(Kt(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 Kt(n){return typeof n=="string"?n:""}const Ls={POINT:W,LINESTRING:J,POLYGON:q,MULTIPOINT:Mt,MULTILINESTRING:Pt,MULTIPOLYGON:$t},Ki="EMPTY",Qi="Z",tn="M",Is="ZM",m={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},Ns={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class Os{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 ks{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===Qi?t="XYZ":i===tn?t="XYM":i===Is&&(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==Ki;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 z([]);const o=this.parseGeometryCollectionText_();return new z(o)}const r=Ls[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
|
|
58
|
+
`}}Q(ni,"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",ni);const Dn=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}},Jn="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;}",Wn='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 qn(n){navigator.clipboard.writeText(n).then(function(){},function(t){console.error("Could not copy text: ",t)})}class ri{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Zn={PROPERTYCHANGE:"propertychange"};class Kn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Qn(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 S(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 tr(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||!tr(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 er extends Kn{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 ri(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]))}}const oe={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function wt(n,t,e,i,r){if(r){const o=e;e=function(){n.removeEventListener(t,e),o.apply(i??this,arguments)}}else i&&i!==n&&(e=e.bind(i));const s={target:n,type:t,listener:e};return n.addEventListener(t,e),s}function ci(n,t,e,i){return wt(n,t,e,i,!0)}function It(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),li(n))}class Nt extends er{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(oe.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]=ci(this,t[s],e)}else i=ci(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)ir(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)}}Nt.prototype.on,Nt.prototype.once,Nt.prototype.un;function ir(n){if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)It(n[t]);else It(n)}function y(){throw new Error("Unimplemented abstract method.")}let nr=0;function rr(n){return n.ol_uid||(n.ol_uid=String(++nr))}class ui extends ri{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class di extends Nt{constructor(t){super(),this.on,this.once,this.un,rr(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 ui(i,t,e)),i=Zn.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new ui(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 sr(n,t){if(!n)throw new Error(t)}class rt extends di{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_&&(It(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=wt(t,oe.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?or(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 or(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(sr(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}new Array(6);function gi(){return[1,0,0,1,0,0]}function fi(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}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 ar(n,t){return n[0]<=t[0]&&t[2]<=n[2]&&n[1]<=t[1]&&t[3]<=n[3]}function pi(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function yi(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 ae(){return[1/0,1/0,-1/0,-1/0]}function mi(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 le(n){return mi(1/0,1/0,-1/0,-1/0,n)}function _i(n,t){const e=n[0],i=n[1];return mi(e,i,e,i,t)}function he(n,t,e,i,r){const s=le(r);return vi(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 vi(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 Ot(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function kt(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=yi(n,t),s=yi(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}const _r={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ce{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_||_r[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,vr=[-st,-st,st,st],wr=[-180,-85,180,85],Ht=Ct*Math.log(Math.tan(Math.PI/2));class ot extends ce{constructor(t){super({code:t,units:"m",extent:vr,global:!0,worldExtent:wr,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 Cr(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>Ht?o=Ht:o<-Ht&&(o=-Ht),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 br=6378137,Ci=[-180,-90,180,90],xr=Math.PI*br/180;class j extends ce{constructor(t,e){super({code:t,units:"degrees",extent:Ci,axisOrientation:e,global:!0,metersPerUnit:xr,worldExtent:Ci})}}const Ei=[new j("CRS:84"),new j("EPSG:4326","neu"),new j("urn:ogc:def:crs:OGC:1.3:CRS84"),new j("urn:ogc:def:crs:OGC:2:84"),new j("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new j("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new j("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ue={};function Pr(n){return ue[n]||ue[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Mr(n,t){ue[n]=t}let at={};function Et(n,t,e){const i=n.getCode(),r=t.getCode();i in at||(at[i]={}),at[i][r]=e}function de(n,t){return n in at&&t in at[n]?at[n][t]:null}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 bi(n){return n*180/Math.PI}function Ut(n){return n*Math.PI/180}function ge(n,t,e){return n+e*(t-n)}function fe(n,t,e){if(n>=t&&n<e)return n;const i=e-t;return((n-t)%i+i)%i+t}const jt=.9996,$=.00669438,Xt=$*$,Yt=Xt*$,Y=$/(1-$),xi=Math.sqrt(1-$),lt=(1-xi)/(1+xi),Pi=lt*lt,pe=Pi*lt,ye=pe*lt,Mi=ye*lt,$i=1-$/4-3*Xt/64-5*Yt/256,Ar=3*$/8+3*Xt/32+45*Yt/1024,Sr=15*Xt/256+45*Yt/1024,Fr=35*Yt/3072,Gr=3/2*lt-27/32*pe+269/512*Mi,Tr=21/16*Pi-55/32*ye,Rr=151/96*pe-417/128*Mi,Lr=1097/512*ye,Bt=6378137;function Ir(n,t,e){const i=n-5e5,o=(e.north?t:t-1e7)/jt/(Bt*$i),a=o+Gr*Math.sin(2*o)+Tr*Math.sin(4*o)+Rr*Math.sin(6*o)+Lr*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-$*h,p=Math.sqrt(1-$*h),v=Bt/p,P=(1-$)/f,C=Y*c**2,F=C*C,M=i/(v*jt),K=M*M,Tt=K*M,dn=Tt*M,gn=dn*M,so=gn*M,oo=a-u/P*(K/2-dn/24*(5+3*d+10*C-4*F-9*Y))+so/720*(61+90*d+298*C+45*g-252*Y-3*F);let He=(M-Tt/6*(1+2*d+C)+gn/120*(5-2*C+28*d-3*F+8*Y+24*g))/c;return He=fe(He+Ut(Fi(e.number)),-Math.PI,Math.PI),[bi(He),bi(oo)]}const Ai=-80,Si=84,Nr=-180,Or=180;function kr(n,t,e){n=fe(n,Nr,Or),t<Ai?t=Ai:t>Si&&(t=Si);const i=Ut(t),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,h=Ut(n),c=Fi(e.number),u=Ut(c),d=Bt/Math.sqrt(1-$*r**2),g=Y*s**2,f=s*fe(h-u,-Math.PI,Math.PI),p=f*f,v=p*f,P=v*f,C=P*f,F=C*f,M=Bt*($i*i-Ar*Math.sin(2*i)+Sr*Math.sin(4*i)-Fr*Math.sin(6*i)),K=jt*d*(f+v/6*(1-a+g)+C/120*(5-18*a+l+72*g-58*Y))+5e5;let Tt=jt*(M+d*o*(p/2+P/24*(5-a+9*g+4*g**2)+F/720*(61-58*a+l+600*g-330*Y)));return e.north||(Tt+=1e7),[K,Tt]}function Fi(n){return(n-1)*6-180+3}const Hr=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Gi(n){let t=0;for(const r of Hr){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 Ti(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 Ur(n){return Gi(n)?new ce({code:n,units:"m"}):null}function jr(n){const t=Gi(n.getCode());return t?{forward:Ti(kr,t),inverse:Ti(Ir,t)}:null}const Xr=[jr],Yr=[Ur];function me(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 _e(n){Mr(n.getCode(),n),Et(n,n,me)}function Br(n){n.forEach(_e)}function A(n){if(typeof n!="string")return n;const t=Pr(n);if(t)return t;for(const e of Yr){const i=e(n);if(i)return i}return null}function Ri(n){Br(n),n.forEach(function(t){n.forEach(function(e){t!==e&&Et(t,e,me)})})}function Vr(n,t,e,i){n.forEach(function(r){t.forEach(function(s){Et(r,s,e),Et(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)===me)&&e}function Li(n,t){const e=n.getCode(),i=t.getCode();let r=de(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=ve(s.inverse,o.forward);else{const l=de(e,a);l&&(r=ve(l,o.forward))}else{const l=de(a,i);l&&(r=ve(s.inverse,l))}return r&&(_e(n),_e(t),Et(n,t,r)),r}function ve(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=A(n),i=A(t);return Li(e,i)}function Dr(){Ri(wi),Ri(Ei),Vr(Ei,wi,Cr,Er)}Dr();function Ii(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 Jr(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 Wr(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 qr(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 Ni=gi();class Oi extends di{constructor(){super(),this.extent_=ae(),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){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}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]))&&le(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=A(t),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),h=i.getWorldExtent(),c=kt(h)/kt(l);fi(Ni,h[0],h[3],c,-c,0,0,0);const u=Ii(s,0,s.length,a,Ni,o),d=we(i,e);return d?d(u,u,a):u}:we(i,e);return this.applyTransform(r),this}}class B extends Oi{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return he(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=ki(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){y()}setLayout(t,e,i){let r;if(t)r=ki(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=V(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();Jr(i,0,i.length,r,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=Ot(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();Wr(r,0,r.length,s,t,e,i,r),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const r=this.getStride();qr(i,0,i.length,r,t,e,i),this.changed()}}}function V(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function ki(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function Zr(n,t,e,i){for(let r=0,s=e.length;r<s;++r)n[t++]=e[r];return t}function Vt(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 bt(n,t,e,i,r){r=r||[];let s=0;for(let o=0,a=e.length;o<a;++o){const l=Vt(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=bt(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}class z extends Oi{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(It),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],oe.CHANGE,this.changed,this))}clone(){const t=new z(Ce(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){le(t);const e=this.geometries_;for(let i=0,r=e.length;i<r;++i)lr(t,e[i].getExtent());return t}getGeometries(){return Ce(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 z(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=Ot(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(Ce(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 Ce(n){return n.map(t=>t.clone())}function Ui(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]=ge(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 Ee(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 be(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=Ee(n,t,a,i,r),t=a}return r}function Kr(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];r=be(n,t,a,i,r),t=a[a.length-1]}return r}function xe(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(Ui(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&&(Ui(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 Pe(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=xe(n,t,g,i,r,s,o,a,l,h,c),t=g}return h}function Qr(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=Pe(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,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 C=d+i;C<u;C+=i){const F=n[C],M=n[C+1],K=$r(F,M,f,p,v,P);K>g&&(c=C,g=K)}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 ji(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=zt(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 ts(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 Me(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=ts(n,t,c,i,r,s,o),a.push(o),t=c}return o}function es(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l],u=[];o=Me(n,t,c,i,r,s,o,u),a.push(u),t=c[c.length-1]}return o}function Dt(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 $e(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++]=Dt(n,t,l,i,r[s]),t=l}return r.length=s,r}function is(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?[]:$e(n,t,l,i,r[s]),t=l[l.length-1]}return r.length=s,r}function Xi(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 Yi(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=Xi(n,t,a,i),t=a}return r}function ns(n,t,e,i){let r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];r+=Yi(n,t,a,i),t=a[a.length-1]}return r}class xt extends B{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(Ee(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),xe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))}getArea(){return Xi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=zt(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=Vt(this.flatCoordinates,0,t,this.stride),this.changed()}}function Bi(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 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],C=n[v+1];d+=Math.sqrt((P-c)*(P-c)+(C-u)*(C-u)),g.push(d),c=P,u=C}const f=r*d,p=Qn(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]:ge(n[a+c],n[a+i+c],l);return s}function Ae(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(ge(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function rs(n,t,e,i,r,s,o){if(o)return Ae(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 Ae(n,t,c,i,r,!1);t=c}}return null}function ss(n,t,e,i,r){return!cr(r,function(o){return!D(n,t,e,i,o[0],o[1])})}function D(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 Se(n,t,e,i,r,s){if(e.length===0||!D(n,t,e[0],i,r,s))return!1;for(let o=1,a=e.length;o<a;++o)if(D(n,e[o-1],e[o],i,r,s))return!1;return!0}function os(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(Se(n,t,l,i,r,s))return!0;t=l[l.length-1]}return!1}function Wt(n,t,e,i,r){const s=vi(ae(),n,t,e,i);return pr(r,s)?ar(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Bi(n,t,e,i,function(o,a){return mr(r,o,a)}):!1}function as(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){if(Wt(n,t,e[s],i,r))return!0;t=e[s]}return!1}function ls(n,t,e,i,r){return!!(Wt(n,t,e,i,r)||D(n,t,e,i,r[0],r[1])||D(n,t,e,i,r[0],r[3])||D(n,t,e,i,r[2],r[1])||D(n,t,e,i,r[2],r[3]))}function Vi(n,t,e,i,r){if(!ls(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(ss(n,e[s-1],e[s],i,r)&&!Wt(n,e[s-1],e[s],i,r))return!1;return!0}function hs(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(Vi(n,t,a,i,r))return!0;t=a[a.length-1]}return!1}function cs(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 J extends B{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){S(this.flatCoordinates,t),this.changed()}clone(){const t=new J(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(Ee(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),xe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))}forEachSegment(t){return Bi(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,Ae(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Dt(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 cs(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=zt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new J(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Wt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Vt(this.flatCoordinates,0,t,this.stride),this.changed()}}class Pt extends B{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];S(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){S(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(be(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pe(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,rs(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return $e(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new J(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 J(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);S(t,h),i=l}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=ji(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Pt(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return as(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=bt(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class W extends B{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new W(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 _i(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return pi(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zr(this.flatCoordinates,0,t,this.stride),this.changed()}}class Mt extends B{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){S(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 Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new W(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 W(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(pi(t,o,a))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Vt(this.flatCoordinates,0,t,this.stride),this.changed()}}function Fe(n,t,e,i,r,s,o){let a,l,h,c,u,d,g;const f=r[s+1],p=[];for(let C=0,F=e.length;C<F;++C){const M=e[C];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 C=Math.abs(u-c);C>P&&(h=(c+u)/2,Se(n,t,e,i,h,f)&&(v=h,P=C)),c=u}return isNaN(v)&&(v=r[s]),o?(o.push(v,f,P),o):[v,f,P]}function zi(n,t,e,i,r){let s=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];s=Fe(n,t,l,i,r,2*o,s),t=l[l.length-1]}return s}function us(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 Ge(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 Te(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=Ge(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 Di(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s){const a=e[s];if(!Te(n,t,a,i,r))return!1;a.length&&(t=a[a.length-1])}return!0}function qt(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=Ge(n,t,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&us(n,t,a,i),t=a}return t}function Re(n,t,e,i,r){for(let s=0,o=e.length;s<o;++s)t=qt(n,t,e[s],i,r);return t}function ds(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=Ge(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}class q extends B{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?S(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new q(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(be(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pe(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return Se(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Yi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),qt(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,$e(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ot(this.getExtent());this.flatInteriorPoint_=Fe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new W(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;Te(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=qt(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Me(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new q(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return Vi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=bt(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Ji(n,t,e,i){const r=[];let s=ae();for(let o=0,a=e.length;o<a;++o){const l=e[o];s=he(n,t,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=l[l.length-1]}return r}class $t extends B{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;S(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;S(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 $t(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(Kr(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Qr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))}containsXY(t,e){return os(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return ns(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Re(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,is(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Ji(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=zi(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;Di(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Re(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=es(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new $t(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 q(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 q(e.slice(s,h),t,l);r.push(c),s=h}return r}getType(){return"MultiPolygon"}intersectsExtent(t){return hs(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 Wi=gi();class Z{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"?_i(this.flatCoordinates_):he(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Ot(this.getExtent());this.flatInteriorPoints_=Fe(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=ds(this.flatCoordinates_,this.ends_),e=Ji(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=zi(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);S(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=A(t);const e=t.getExtent(),i=t.getWorldExtent();if(e&&i){const r=kt(i)/kt(e);fi(Wi,i[0],i[3],r,-r,0,0,0),Ii(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Wi,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;return new Z(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=zt(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=ji(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,r);break;case"Polygon":r=[],i.length=Me(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,r);break}return r&&(this.simplifiedGeometry_=new Z(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Z.prototype.getFlatCoordinates=Z.prototype.getOrientedFlatCoordinates;class qi{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=rt,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?A(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=A(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 At(n,t,e){const i=e?A(e.featureProjection):null,r=e?A(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 gs={Point:W,LineString:J,Polygon:q,MultiPoint:Mt,MultiLineString:Pt,MultiPolygon:$t};function fs(n,t,e){return Array.isArray(t[0])?(Di(n,0,t,e)||(n=n.slice(),Re(n,0,t,e)),n):(Te(n,0,t,e)||(n=n.slice(),qt(n,0,t,e)),n)}function Zi(n,t){var s;const e=n.geometry;if(!e)return[];if(Array.isArray(e))return e.map(o=>Zi({...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 At(new Z(i,i==="Polygon"?fs(e.flatCoordinates,e.ends,r):e.flatCoordinates,(s=e.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,t)}function Le(n,t){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Le(r,t));return new z(i)}const e=gs[n.type];return At(new e(n.flatCoordinates,n.layout,n.ends),!1,t)}class ps extends qi{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Zt(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Zt(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return y()}readFeaturesFromObject(t,e){return y()}readGeometry(t,e){return this.readGeometryFromObject(Zt(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return y()}readProjection(t){return this.readProjectionFromObject(Zt(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 Zt(n){if(typeof n=="string"){const t=JSON.parse(n);return t||null}return n!==null?n:null}class ys extends ps{constructor(t){t=t||{},super(),this.dataProjection=A(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=A(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=Ie(i.geometry);if(this.featureClass===Z)return Zi({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(Le(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 ms(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=A(e.properties.name);else if(e.type==="EPSG")i=A("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=Ne(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 Ne(t,this.adaptOptions(e))}}function Ie(n,t){if(!n)return null;let e;switch(n.type){case"Point":{e=vs(n);break}case"LineString":{e=ws(n);break}case"Polygon":{e=xs(n);break}case"MultiPoint":{e=Es(n);break}case"MultiLineString":{e=Cs(n);break}case"MultiPolygon":{e=bs(n);break}case"GeometryCollection":{e=_s(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return e}function ms(n,t){const e=Ie(n);return Le(e,t)}function _s(n,t){return n.geometries.map(function(i){return Ie(i)})}function vs(n){const t=n.coordinates;return{type:"Point",flatCoordinates:t,layout:V(t.length)}}function ws(n){var i;const t=n.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:V(((i=t[0])==null?void 0:i.length)||2)}}function Cs(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=bt(i,0,t,e);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:V(e)}}function Es(n){var e;const t=n.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:V(((e=t[0])==null?void 0:e.length)||2)}}function bs(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:V(i)}}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.length,r=bt(e,0,t,i);return{type:"Polygon",flatCoordinates:e,ends:r,layout:V(i)}}function Ne(n,t){n=At(n,!0,t);const e=n.getType();let i;switch(e){case"Point":{i=Fs(n);break}case"LineString":{i=Ms(n);break}case"Polygon":{i=Gs(n,t);break}case"MultiPoint":{i=As(n);break}case"MultiLineString":{i=$s(n);break}case"MultiPolygon":{i=Ss(n,t);break}case"GeometryCollection":{i=Ps(n,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function Ps(n,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return Ne(i,t)})}}function Ms(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 Ss(n,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(e)}}function Fs(n,t){return{type:"Point",coordinates:n.getCoordinates()}}function Gs(n,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(e)}}const Ts=(n,t)=>new ys().writeFeaturesObject(n,t);class Rs extends qi{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(Kt(t),this.adaptOptions(e))}readFeatureFromText(t,e){return y()}readFeatures(t,e){return this.readFeaturesFromText(Kt(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return y()}readGeometry(t,e){return this.readGeometryFromText(Kt(t),this.adaptOptions(e))}readGeometryFromText(t,e){return y()}readProjection(t){return this.readProjectionFromText(Kt(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 Kt(n){return typeof n=="string"?n:""}const Ls={POINT:W,LINESTRING:J,POLYGON:q,MULTIPOINT:Mt,MULTILINESTRING:Pt,MULTIPOLYGON:$t},Ki="EMPTY",Qi="Z",tn="M",Is="ZM",m={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},Ns={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class Os{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 ks{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===Qi?t="XYZ":i===tn?t="XYM":i===Is&&(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==Ki;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 z([]);const o=this.parseGeometryCollectionText_();return new z(o)}const r=Ls[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 Os(t);return new ks(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 At(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 z(i);return this.writeGeometryText(r,e)}writeGeometryText(t,e){return rn(At(t,!0,e))}}function en(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("("+en(e[i])+")");return t.join(",")}function js(n){const t=[],e=n.getGeometries();for(let i=0,r=e.length;i<r;++i)t.push(rn(e[i]));return t.join(",")}function Oe(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 Xs(n){const t=[],e=n.getLineStrings();for(let i=0,r=e.length;i<r;++i)t.push("("+Oe(e[i])+")");return t.join(",")}function nn(n){const t=[],e=n.getLinearRings();for(let i=0,r=e.length;i<r;++i)t.push("("+Oe(e[i])+")");return t.join(",")}function Ys(n){const t=[],e=n.getPolygons();for(let i=0,r=e.length;i<r;++i)t.push("("+nn(e[i])+")");return t.join(",")}function Bs(n){const t=n.getLayout();let e="";return(t==="XYZ"||t==="XYZM")&&(e+=Qi),(t==="XYM"||t==="XYZM")&&(e+=tn),e}const Vs={Point:en,LineString:Oe,Polygon:nn,MultiPoint:Us,MultiLineString:Xs,MultiPolygon:Ys,GeometryCollection:js};function rn(n){const t=n.getType(),e=Vs[t],i=e(n);let r=Ns[t];if(typeof n.getFlatCoordinates=="function"){const s=Bs(n);s.length>0&&(r+=" "+s)}return i.length===0?r+" "+Ki:r+"("+i+")"}const zs=(n,t)=>new Hs().writeFeatures(n,t);/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2021 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/function sn(n,t,e){return n?t(n):e==null?void 0:e(n)}class on extends
|
|
63
|
+
*/function sn(n,t,e){return n?t(n):e==null?void 0:e(n)}class on extends H{constructor(){super();tt(this,St,!0);tt(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}=Dn(this);L(this,St,e),L(this,Ft,i)}createRenderRoot(){return this}render(){this.updateButtonStates();const e=this.currentlyDrawing?"drawing":"draw";return O`
|
|
64
64
|
<style>
|
|
65
65
|
${!this.unstyled&&Jn}
|
|
66
66
|
${!this.unstyled&&Wn}
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
color: white;
|
|
176
176
|
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
177
|
}
|
|
178
|
-
`,Js=n=>{(()=>{n.emitDrawnFeatures(),n.multipleFeatures||(n.draw.setActive(!1),n.selectionEvents.removeSelectionEvent(),n.currentlyDrawing=!1)})(),n.requestUpdate()},Ws=n=>{const t=()=>{n.drawLayer.set("isDrawingEnabled",!0),n.draw.setActive(!0),n.selectionEvents.addSelectionEvent()},e=()=>{n.currentlyDrawing=!0,n.requestUpdate()};t(),e()},qs=n=>{let t;return typeof n=="string"?t=document.querySelector(n):t=n,t},an=(n,t)=>{var s;const i=qs(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"},interactions:[{type:"draw",options:{active:!1,id:"drawInteraction",type:n.type,modify:n.allowModify,stopClick:!0}},{type:"select",options:{id:"selectHover",condition:"pointermove",style:{"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:{"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,ke(n,i,n.layerId),(s=n.modify)==null||s.on("modifyend",()=>n.onModifyEnd()),i.addEventListener("addfeatures",()=>Js(n)),{EoxMap:i,OlMap:r}},Zs=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()},Ks=(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=Ts(n.drawnFeatures);break;case"wkt":o=zs(n.drawnFeatures);break;case"feature":o=n.drawnFeatures;break;default:o=n.drawnFeatures;break}n.updateGeoJSON(),n.requestUpdate(),t(o)},0)},Qs=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)}}},ke=(n,t,e)=>{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:{"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:{"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)},to=(n,t,e,i)=>{if(t){if(e){i&&e!==i&&ln(n,t),ke(n,t,e);return}if(!e&&i){ln(n,t);return}}};function ln(n,t){t&&(n.discardDrawing(),n.selectionEvents.removeSelectionEvent(),n.draw=t.interactions.drawInteraction,t.selectInteractions.SelectLayerClickInteraction.remove(),t.selectInteractions.SelectLayerHoverInteraction.remove())}const eo=':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --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 io(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=>hn(s,n),!1)}function no(n){n.preventDefault(),n.stopPropagation()}function hn(n,t){no(n);const e=n.dataTransfer?n.dataTransfer.files:n.target.files;Array.from(e).forEach(i=>ro(i,t))}function ro(n,t){const e=new FileReader;e.readAsText(n),e.onloadend=function(){typeof e.result=="string"&&t.handleFeatureChange(e.result)}}class cn extends j{constructor(){super();tt(this,ct);tt(this,ut);tt(this,Gt);tt(this,dt);this.allowModify=!1,this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.layerId="",this.drawnFeatures=[],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},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},layerId:{attribute:"layer-id",type:String},drawnFeatures:{attribute:!1,state:!0,type:Array},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 layerId(e){to(this,this.eoxMap,e,G(this,dt)),L(this,dt,e)}get layerId(){return G(this,dt)}startDrawing(){Ws(this)}discardDrawing(){Zs(this)}handleFeatureChange(e,i=!1){this.eoxMap.parseTextToFeature(e||JSON.stringify(ii),this.drawLayer,this.eoxMap,i)}handleFilesChange(e){hn(e,this)}onModifyEnd(){this.emitDrawnFeatures()}updateGeoJSON(){L(this,Gt,JSON.stringify(this.eoxMap.parseFeature(this.drawnFeatures)||ii,void 0,2))}emitDrawnFeatures(){Ks(this,i=>{this.dispatchEvent(new CustomEvent("drawupdate",{detail:i}))})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){const{EoxMap:e,OlMap:i}=an(this,this.multipleFeatures);this.eoxMap=e,L(this,ut,i),this.selectionEvents=Qs(this),this.importFeatures&&io(this,this.eoxMap),this.updateGeoJSON(),this.requestUpdate()}updated(e){if(e.has("for")){const{EoxMap:i,OlMap:r}=an(this,this.multipleFeatures);this.eoxMap=i,L(this,ut,r)}}get eoxMap(){return G(this,ct)}set eoxMap(e){const i=G(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 O`
|
|
178
|
+
`,Js=n=>{(()=>{n.emitDrawnFeatures(),n.multipleFeatures||(n.draw.setActive(!1),n.selectionEvents.removeSelectionEvent(),n.currentlyDrawing=!1)})(),n.requestUpdate()},Ws=n=>{const t=()=>{n.drawLayer.set("isDrawingEnabled",!0),n.draw.setActive(!0),n.selectionEvents.addSelectionEvent()},e=()=>{n.currentlyDrawing=!0,n.requestUpdate()};t(),e()},qs=n=>{let t;return typeof n=="string"?t=document.querySelector(n):t=n,t},an=(n,t)=>{var s;const i=qs(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"},interactions:[{type:"draw",options:{active:!1,id:"drawInteraction",type:n.type,modify:n.allowModify,stopClick:!0}},{type:"select",options:{id:"selectHover",condition:"pointermove",style:{"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:{"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,ke(n,i,n.layerId),(s=n.modify)==null||s.on("modifyend",()=>n.onModifyEnd()),i.addEventListener("addfeatures",()=>Js(n)),{EoxMap:i,OlMap:r}},Zs=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()},Ks=(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=Ts(n.drawnFeatures);break;case"wkt":o=zs(n.drawnFeatures);break;case"feature":o=n.drawnFeatures;break;default:o=n.drawnFeatures;break}n.updateGeoJSON(),n.requestUpdate(),t(o)},0)},Qs=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)}}},ke=(n,t,e)=>{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:{"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:{"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)},to=(n,t,e,i)=>{if(t){if(e){i&&e!==i&&ln(n,t),ke(n,t,e);return}if(!e&&i){ln(n,t);return}}};function ln(n,t){t&&(n.discardDrawing(),n.selectionEvents.removeSelectionEvent(),n.draw=t.interactions.drawInteraction,t.selectInteractions.SelectLayerClickInteraction.remove(),t.selectInteractions.SelectLayerHoverInteraction.remove())}const eo=':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 io(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=>hn(s,n),!1)}function no(n){n.preventDefault(),n.stopPropagation()}function hn(n,t){no(n);const e=n.dataTransfer?n.dataTransfer.files:n.target.files;Array.from(e).forEach(i=>ro(i,t))}function ro(n,t){const e=new FileReader;e.readAsText(n),e.onloadend=function(){typeof e.result=="string"&&t.handleFeatureChange(e.result)}}class cn extends H{constructor(){super();tt(this,ct);tt(this,ut);tt(this,Gt);tt(this,dt);this.allowModify=!1,this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.layerId="",this.drawnFeatures=[],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},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},layerId:{attribute:"layer-id",type:String},drawnFeatures:{attribute:!1,state:!0,type:Array},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 layerId(e){to(this,this.eoxMap,e,G(this,dt)),L(this,dt,e)}get layerId(){return G(this,dt)}startDrawing(){Ws(this)}discardDrawing(){Zs(this)}handleFeatureChange(e,i=!1){this.eoxMap.parseTextToFeature(e||JSON.stringify(ii),this.drawLayer,this.eoxMap,i)}handleFilesChange(e){hn(e,this)}onModifyEnd(){this.emitDrawnFeatures()}updateGeoJSON(){L(this,Gt,JSON.stringify(this.eoxMap.parseFeature(this.drawnFeatures)||ii,void 0,2))}emitDrawnFeatures(){Ks(this,i=>{this.dispatchEvent(new CustomEvent("drawupdate",{detail:i}))})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){const{EoxMap:e,OlMap:i}=an(this,this.multipleFeatures);this.eoxMap=e,L(this,ut,i),this.selectionEvents=Qs(this),this.importFeatures&&io(this,this.eoxMap),this.updateGeoJSON(),this.requestUpdate()}updated(e){if(e.has("for")){const{EoxMap:i,OlMap:r}=an(this,this.multipleFeatures);this.eoxMap=i,L(this,ut,r)}}get eoxMap(){return G(this,ct)}set eoxMap(e){const i=G(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 O`
|
|
179
179
|
<style>
|
|
180
180
|
:host { display: block; }
|
|
181
181
|
${!this.unstyled&&eo}
|
|
@@ -206,4 +206,4 @@
|
|
|
206
206
|
.unstyled=${this.unstyled}
|
|
207
207
|
@changed=${()=>{this.updateGeoJSON(),this.requestUpdate()}}
|
|
208
208
|
></eox-drawtools-list>`:E}
|
|
209
|
-
`}}ct=new WeakMap,ut=new WeakMap,Gt=new WeakMap,dt=new WeakMap,customElements.define("eox-drawtools",cn),
|
|
209
|
+
`}}ct=new WeakMap,ut=new WeakMap,Gt=new WeakMap,dt=new WeakMap,customElements.define("eox-drawtools",cn),w.EOxDrawTools=cn,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.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"vite": "^6.0.3"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"watch": "vite build --watch"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@eox/elements-utils": "^0.1.
|
|
35
|
+
"@eox/elements-utils": "^0.1.5",
|
|
36
36
|
"lit": "^3.2.0",
|
|
37
37
|
"ol": "^10.0.0"
|
|
38
38
|
}
|