a2g_maps/Resources/Public/JavaScript/a2gMap.min.js
2023-12-04 16:36:56 +01:00

10 lines
388 KiB
JavaScript
Executable File

var Yl=Object.defineProperty,Ul=Object.defineProperties;var Wl=Object.getOwnPropertyDescriptors;var Vo=Object.getOwnPropertySymbols;var Bl=Object.prototype.hasOwnProperty,Zl=Object.prototype.propertyIsEnumerable;var Ho=(i,r,t)=>r in i?Yl(i,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[r]=t,$o=(i,r)=>{for(var t in r||(r={}))Bl.call(r,t)&&Ho(i,t,r[t]);if(Vo)for(var t of Vo(r))Zl.call(r,t)&&Ho(i,t,r[t]);return i},qo=(i,r)=>Ul(i,Wl(r));const zl=function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))e(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&e(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerpolicy&&(o.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?o.credentials="include":n.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function e(n){if(n.ep)return;n.ep=!0;const o=t(n);fetch(n.href,o)}};zl();function F(){return function(){throw new Error("Unimplemented abstract method.")}()}var Kl=0;function H(i){return i.ol_uid||(i.ol_uid=String(++Kl))}var Vl="6.14.1",Hl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$l=function(i){Hl(r,i);function r(t){var e=this,n="v"+Vl.split("-")[0],o="Assertion failed. See https://openlayers.org/en/"+n+"/doc/errors/#"+t+" for details.";return e=i.call(this,o)||this,e.code=t,e.name="AssertionError",e.message=o,e}return r}(Error),Ja=$l,ql=function(){function i(r){this.propagationStopped,this.defaultPrevented,this.type=r,this.target=null}return i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i}();function Jl(i){i.stopPropagation()}var Ht=ql,Er={PROPERTYCHANGE:"propertychange"},Ql=function(){function i(){this.disposed=!1}return i.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},i.prototype.disposeInternal=function(){},i}(),eo=Ql;function tu(i,r,t){for(var e,n,o=t||Ke,a=0,s=i.length,l=!1;a<s;)e=a+(s-a>>1),n=+o(i[e],r),n<0?a=e+1:(s=e,l=!n);return l?a:~a}function Ke(i,r){return i>r?1:i<r?-1:0}function Jo(i,r){return i.indexOf(r)>=0}function ro(i,r,t){var e=i.length;if(i[0]<=r)return 0;if(r<=i[e-1])return e-1;var n=void 0;if(t>0){for(n=1;n<e;++n)if(i[n]<r)return n-1}else if(t<0){for(n=1;n<e;++n)if(i[n]<=r)return n}else for(n=1;n<e;++n){if(i[n]==r)return n;if(i[n]<r)return typeof t=="function"?t(r,i[n-1],i[n])>0?n-1:n:i[n-1]-r<r-i[n]?n-1:n}return e-1}function eu(i,r,t){for(;r<t;){var e=i[r];i[r]=i[t],i[t]=e,++r,--t}}function Yt(i,r){for(var t=Array.isArray(r)?r:[r],e=t.length,n=0;n<e;n++)i[i.length]=t[n]}function qe(i,r){var t=i.length;if(t!==r.length)return!1;for(var e=0;e<t;e++)if(i[e]!==r[e])return!1;return!0}function ru(i,r,t){var e=r||Ke;return i.every(function(n,o){if(o===0)return!0;var a=e(i[o-1],n);return!(a>0||t&&a===0)})}function _r(){return!0}function ei(){return!1}function Ve(){}function nu(i){var r=!1,t,e,n;return function(){var o=Array.prototype.slice.call(arguments);return(!r||this!==n||!qe(o,e))&&(r=!0,n=this,e=o,t=i.apply(this,arguments)),t}}var ut=typeof Object.assign=="function"?Object.assign:function(i,r){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(i),e=1,n=arguments.length;e<n;++e){var o=arguments[e];if(o!=null)for(var a in o)o.hasOwnProperty(a)&&(t[a]=o[a])}return t};function tn(i){for(var r in i)delete i[r]}var Qa=typeof Object.values=="function"?Object.values:function(i){var r=[];for(var t in i)r.push(i[t]);return r};function Tr(i){var r;for(r in i)return!1;return!r}var iu=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ou=function(i){iu(r,i);function r(t){var e=i.call(this)||this;return e.eventTarget_=t,e.pendingRemovals_=null,e.dispatching_=null,e.listeners_=null,e}return r.prototype.addEventListener=function(t,e){if(!(!t||!e)){var n=this.listeners_||(this.listeners_={}),o=n[t]||(n[t]=[]);o.indexOf(e)===-1&&o.push(e)}},r.prototype.dispatchEvent=function(t){var e=typeof t=="string",n=e?t:t.type,o=this.listeners_&&this.listeners_[n];if(!!o){var a=e?new Ht(t):t;a.target||(a.target=this.eventTarget_||this);var s=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});n in s||(s[n]=0,l[n]=0),++s[n];for(var u,h=0,f=o.length;h<f;++h)if("handleEvent"in o[h]?u=o[h].handleEvent(a):u=o[h].call(this,a),u===!1||a.propagationStopped){u=!1;break}if(--s[n]===0){var c=l[n];for(delete l[n];c--;)this.removeEventListener(n,Ve);delete s[n]}return u}},r.prototype.disposeInternal=function(){this.listeners_&&tn(this.listeners_)},r.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},r.prototype.hasListener=function(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1},r.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var o=n.indexOf(e);o!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[o]=Ve,++this.pendingRemovals_[t]):(n.splice(o,1),n.length===0&&delete this.listeners_[t]))}},r}(eo),xr=ou,G={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 W(i,r,t,e,n){if(e&&e!==i&&(t=t.bind(e)),n){var o=t;t=function(){i.removeEventListener(r,t),o.apply(this,arguments)}}var a={target:i,type:r,listener:t};return i.addEventListener(r,t),a}function kn(i,r,t,e){return W(i,r,t,e,!0)}function J(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),tn(i))}var au=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ri=function(i){au(r,i);function r(){var t=i.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return r.prototype.changed=function(){++this.revision_,this.dispatchEvent(G.CHANGE)},r.prototype.getRevision=function(){return this.revision_},r.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,o=new Array(n),a=0;a<n;++a)o[a]=W(this,t[a],e);return o}else return W(this,t,e)},r.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var o=t.length;n=new Array(o);for(var a=0;a<o;++a)n[a]=kn(this,t[a],e)}else n=kn(this,t,e);return e.ol_key=n,n},r.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)su(n);else if(Array.isArray(t))for(var o=0,a=t.length;o<a;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},r}(xr);ri.prototype.on;ri.prototype.once;ri.prototype.un;function su(i){if(Array.isArray(i))for(var r=0,t=i.length;r<t;++r)J(i[r]);else J(i)}var ts=ri,es=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Qo=function(i){es(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.key=e,o.oldValue=n,o}return r}(Ht),lu=function(i){es(r,i);function r(t){var e=i.call(this)||this;return e.on,e.once,e.un,H(e),e.values_=null,t!==void 0&&e.setProperties(t),e}return r.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},r.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},r.prototype.getProperties=function(){return this.values_&&ut({},this.values_)||{}},r.prototype.hasProperties=function(){return!!this.values_},r.prototype.notify=function(t,e){var n;n="change:".concat(t),this.hasListener(n)&&this.dispatchEvent(new Qo(n,t,e)),n=Er.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new Qo(n,t,e))},r.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},r.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},r.prototype.set=function(t,e,n){var o=this.values_||(this.values_={});if(n)o[t]=e;else{var a=o[t];o[t]=e,a!==e&&this.notify(t,a)}},r.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},r.prototype.applyProperties=function(t){!t.values_||ut(this.values_||(this.values_={}),t.values_)},r.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],Tr(this.values_)&&(this.values_=null),e||this.notify(t,n)}},r}(ts),bt=lu,St={ADD:"add",REMOVE:"remove"},rs=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ta={LENGTH:"length"},Tn=function(i){rs(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.element=e,o.index=n,o}return r}(Ht),uu=function(i){rs(r,i);function r(t,e){var n=i.call(this)||this;n.on,n.once,n.un;var o=e||{};if(n.unique_=!!o.unique,n.array_=t||[],n.unique_)for(var a=0,s=n.array_.length;a<s;++a)n.assertUnique_(n.array_[a],a);return n.updateLength_(),n}return r.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},r.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},r.prototype.forEach=function(t){for(var e=this.array_,n=0,o=e.length;n<o;++n)t(e[n],n,e)},r.prototype.getArray=function(){return this.array_},r.prototype.item=function(t){return this.array_[t]},r.prototype.getLength=function(){return this.get(ta.LENGTH)},r.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Tn(St.ADD,e,t))},r.prototype.pop=function(){return this.removeAt(this.getLength()-1)},r.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},r.prototype.remove=function(t){for(var e=this.array_,n=0,o=e.length;n<o;++n)if(e[n]===t)return this.removeAt(n)},r.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Tn(St.REMOVE,e,t)),e},r.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Tn(St.REMOVE,o,t)),this.dispatchEvent(new Tn(St.ADD,e,t))}else{for(var a=n;a<t;++a)this.insertAt(a,void 0);this.insertAt(t,e)}},r.prototype.updateLength_=function(){this.set(ta.LENGTH,this.array_.length)},r.prototype.assertUnique_=function(t,e){for(var n=0,o=this.array_.length;n<o;++n)if(this.array_[n]===t&&n!==e)throw new Ja(58)},r}(bt),Gt=uu;function B(i,r){if(!i)throw new Ja(r)}var hu=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),cu=function(i){hu(r,i);function r(t){var e=i.call(this)||this;if(e.on,e.once,e.un,e.id_=void 0,e.geometryName_="geometry",e.style_=null,e.styleFunction_=void 0,e.geometryChangeKey_=null,e.addChangeListener(e.geometryName_,e.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){var n=t;e.setGeometry(n)}else{var o=t;e.setProperties(o)}return e}return r.prototype.clone=function(){var t=new r(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var e=this.getGeometry();e&&t.setGeometry(e.clone());var n=this.getStyle();return n&&t.setStyle(n),t},r.prototype.getGeometry=function(){return this.get(this.geometryName_)},r.prototype.getId=function(){return this.id_},r.prototype.getGeometryName=function(){return this.geometryName_},r.prototype.getStyle=function(){return this.style_},r.prototype.getStyleFunction=function(){return this.styleFunction_},r.prototype.handleGeometryChange_=function(){this.changed()},r.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(J(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=W(t,G.CHANGE,this.handleGeometryChange_,this)),this.changed()},r.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},r.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?fu(t):void 0,this.changed()},r.prototype.setId=function(t){this.id_=t,this.changed()},r.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},r}(bt);function fu(i){if(typeof i=="function")return i;var r;if(Array.isArray(i))r=i;else{B(typeof i.getZIndex=="function",41);var t=i;r=[t]}return function(){return r}}var Oe=cu,q={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},P={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},Or={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Vt={};Vt[Or.RADIANS]=6370997/(2*Math.PI);Vt[Or.DEGREES]=2*Math.PI*6370997/360;Vt[Or.FEET]=.3048;Vt[Or.METERS]=1;Vt[Or.USFEET]=1200/3937;var oe=Or,Se=typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"?navigator.userAgent.toLowerCase():"",pu=Se.indexOf("firefox")!==-1,du=Se.indexOf("safari")!==-1&&Se.indexOf("chrom")==-1;du&&(Se.indexOf("version/15.4")>=0||Se.match(/cpu (os|iphone os) 15_4 like mac os x/));var vu=Se.indexOf("webkit")!==-1&&Se.indexOf("edge")==-1,ns=Se.indexOf("macintosh")!==-1,is=typeof devicePixelRatio!="undefined"?devicePixelRatio:1,ni=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,gu=typeof Image!="undefined"&&Image.prototype.decode,os=function(){var i=!1;try{var r=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,r),window.removeEventListener("_",null,r)}catch{}return i}();new Array(6);function Kt(){return[1,0,0,1,0,0]}function _u(i,r,t,e,n,o,a){return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i[4]=o,i[5]=a,i}function yu(i,r){return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i}function st(i,r){var t=r[0],e=r[1];return r[0]=i[0]*t+i[2]*e+i[4],r[1]=i[1]*t+i[3]*e+i[5],r}function mu(i,r,t){return _u(i,r,0,0,t,0,0)}function se(i,r,t,e,n,o,a,s){var l=Math.sin(o),u=Math.cos(o);return i[0]=e*u,i[1]=n*l,i[2]=-e*l,i[3]=n*u,i[4]=a*e*u-s*e*l+r,i[5]=a*n*l+s*n*u+t,i}function no(i,r){var t=Eu(r);B(t!==0,32);var e=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5];return i[0]=a/t,i[1]=-n/t,i[2]=-o/t,i[3]=e/t,i[4]=(o*l-a*s)/t,i[5]=-(e*l-n*s)/t,i}function Eu(i){return i[0]*i[3]-i[1]*i[2]}var ea;function as(i){var r="matrix("+i.join(", ")+")";if(ni)return r;var t=ea||(ea=document.createElement("div"));return t.style.transform=r,t.style.transform}var Xr={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},vt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ra(i){for(var r=Pt(),t=0,e=i.length;t<e;++t)Br(r,i[t]);return r}function ii(i,r,t){return t?(t[0]=i[0]-r,t[1]=i[1]-r,t[2]=i[2]+r,t[3]=i[3]+r,t):[i[0]-r,i[1]-r,i[2]+r,i[3]+r]}function ss(i,r){return r?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r):i.slice()}function Je(i,r,t){var e,n;return r<i[0]?e=i[0]-r:i[2]<r?e=r-i[2]:e=0,t<i[1]?n=i[1]-t:i[3]<t?n=t-i[3]:n=0,e*e+n*n}function en(i,r){return io(i,r[0],r[1])}function je(i,r){return i[0]<=r[0]&&r[2]<=i[2]&&i[1]<=r[1]&&r[3]<=i[3]}function io(i,r,t){return i[0]<=r&&r<=i[2]&&i[1]<=t&&t<=i[3]}function ji(i,r){var t=i[0],e=i[1],n=i[2],o=i[3],a=r[0],s=r[1],l=vt.UNKNOWN;return a<t?l=l|vt.LEFT:a>n&&(l=l|vt.RIGHT),s<e?l=l|vt.BELOW:s>o&&(l=l|vt.ABOVE),l===vt.UNKNOWN&&(l=vt.INTERSECTING),l}function Pt(){return[1/0,1/0,-1/0,-1/0]}function le(i,r,t,e,n){return n?(n[0]=i,n[1]=r,n[2]=t,n[3]=e,n):[i,r,t,e]}function rn(i){return le(1/0,1/0,-1/0,-1/0,i)}function ls(i,r){var t=i[0],e=i[1];return le(t,e,t,e,r)}function us(i,r,t,e,n){var o=rn(n);return hs(o,i,r,t,e)}function zr(i,r){return i[0]==r[0]&&i[2]==r[2]&&i[1]==r[1]&&i[3]==r[3]}function oo(i,r){return r[0]<i[0]&&(i[0]=r[0]),r[2]>i[2]&&(i[2]=r[2]),r[1]<i[1]&&(i[1]=r[1]),r[3]>i[3]&&(i[3]=r[3]),i}function Br(i,r){r[0]<i[0]&&(i[0]=r[0]),r[0]>i[2]&&(i[2]=r[0]),r[1]<i[1]&&(i[1]=r[1]),r[1]>i[3]&&(i[3]=r[1])}function hs(i,r,t,e,n){for(;t<e;t+=n)Tu(i,r[t],r[t+1]);return i}function Tu(i,r,t){i[0]=Math.min(i[0],r),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],r),i[3]=Math.max(i[3],t)}function cs(i,r){var t;return t=r(oi(i)),t||(t=r(ai(i)),t)||(t=r(si(i)),t)||(t=r(Qe(i)),t)?t:!1}function Xi(i){var r=0;return ao(i)||(r=it(i)*Ut(i)),r}function oi(i){return[i[0],i[1]]}function ai(i){return[i[2],i[1]]}function Re(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Cu(i,r){var t;return r===Xr.BOTTOM_LEFT?t=oi(i):r===Xr.BOTTOM_RIGHT?t=ai(i):r===Xr.TOP_LEFT?t=Qe(i):r===Xr.TOP_RIGHT?t=si(i):B(!1,13),t}function Yi(i,r,t,e,n){var o=r*e[0]/2,a=r*e[1]/2,s=Math.cos(t),l=Math.sin(t),u=o*s,h=o*l,f=a*s,c=a*l,p=i[0],d=i[1],v=p-u+c,g=p-u-c,m=p+u-c,_=p+u+c,y=d-h-f,E=d-h+f,T=d+h+f,x=d+h-f;return le(Math.min(v,g,m,_),Math.min(y,E,T,x),Math.max(v,g,m,_),Math.max(y,E,T,x),n)}function Ut(i){return i[3]-i[1]}function Zr(i,r,t){var e=t||Pt();return Rt(i,r)?(i[0]>r[0]?e[0]=i[0]:e[0]=r[0],i[1]>r[1]?e[1]=i[1]:e[1]=r[1],i[2]<r[2]?e[2]=i[2]:e[2]=r[2],i[3]<r[3]?e[3]=i[3]:e[3]=r[3]):rn(e),e}function Qe(i){return[i[0],i[3]]}function si(i){return[i[2],i[3]]}function it(i){return i[2]-i[0]}function Rt(i,r){return i[0]<=r[2]&&i[2]>=r[0]&&i[1]<=r[3]&&i[3]>=r[1]}function ao(i){return i[2]<i[0]||i[3]<i[1]}function xu(i,r){return r?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r):i}function Ou(i,r,t){var e=!1,n=ji(i,r),o=ji(i,t);if(n===vt.INTERSECTING||o===vt.INTERSECTING)e=!0;else{var a=i[0],s=i[1],l=i[2],u=i[3],h=r[0],f=r[1],c=t[0],p=t[1],d=(p-f)/(c-h),v=void 0,g=void 0;!!(o&vt.ABOVE)&&!(n&vt.ABOVE)&&(v=c-(p-u)/d,e=v>=a&&v<=l),!e&&!!(o&vt.RIGHT)&&!(n&vt.RIGHT)&&(g=p-(c-l)*d,e=g>=s&&g<=u),!e&&!!(o&vt.BELOW)&&!(n&vt.BELOW)&&(v=c-(p-s)/d,e=v>=a&&v<=l),!e&&!!(o&vt.LEFT)&&!(n&vt.LEFT)&&(g=p-(c-a)*d,e=g>=s&&g<=u)}return e}function wu(i,r){var t=r.getExtent(),e=Re(i);if(r.canWrapX()&&(e[0]<t[0]||e[0]>=t[2])){var n=it(t),o=Math.floor((e[0]-t[0])/n),a=o*n;i[0]-=a,i[2]-=a}return i}var Su=function(){function i(r){this.code_=r.code,this.units_=r.units,this.extent_=r.extent!==void 0?r.extent:null,this.worldExtent_=r.worldExtent!==void 0?r.worldExtent:null,this.axisOrientation_=r.axisOrientation!==void 0?r.axisOrientation:"enu",this.global_=r.global!==void 0?r.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=r.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=r.metersPerUnit}return i.prototype.canWrapX=function(){return this.canWrapX_},i.prototype.getCode=function(){return this.code_},i.prototype.getExtent=function(){return this.extent_},i.prototype.getUnits=function(){return this.units_},i.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Vt[this.units_]},i.prototype.getWorldExtent=function(){return this.worldExtent_},i.prototype.getAxisOrientation=function(){return this.axisOrientation_},i.prototype.isGlobal=function(){return this.global_},i.prototype.setGlobal=function(r){this.global_=r,this.canWrapX_=!!(r&&this.extent_)},i.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},i.prototype.setDefaultTileGrid=function(r){this.defaultTileGrid_=r},i.prototype.setExtent=function(r){this.extent_=r,this.canWrapX_=!!(this.global_&&r)},i.prototype.setWorldExtent=function(r){this.worldExtent_=r},i.prototype.setGetPointResolution=function(r){this.getPointResolutionFunc_=r},i.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},i}(),fs=Su;function ot(i,r,t){return Math.min(Math.max(i,r),t)}var Ru=function(){var i;return"cosh"in Math?i=Math.cosh:i=function(r){var t=Math.exp(r);return(t+1/t)/2},i}(),Pu=function(){var i;return"log2"in Math?i=Math.log2:i=function(r){return Math.log(r)*Math.LOG2E},i}();function Lu(i,r,t,e,n,o){var a=n-t,s=o-e;if(a!==0||s!==0){var l=((i-t)*a+(r-e)*s)/(a*a+s*s);l>1?(t=n,e=o):l>0&&(t+=a*l,e+=s*l)}return Be(i,r,t,e)}function Be(i,r,t,e){var n=t-i,o=e-r;return n*n+o*o}function Iu(i){for(var r=i.length,t=0;t<r;t++){for(var e=t,n=Math.abs(i[t][t]),o=t+1;o<r;o++){var a=Math.abs(i[o][t]);a>n&&(n=a,e=o)}if(n===0)return null;var s=i[e];i[e]=i[t],i[t]=s;for(var l=t+1;l<r;l++)for(var u=-i[l][t]/i[t][t],h=t;h<r+1;h++)t==h?i[l][h]=0:i[l][h]+=u*i[t][h]}for(var f=new Array(r),c=r-1;c>=0;c--){f[c]=i[c][r]/i[c][c];for(var p=c-1;p>=0;p--)i[p][r]-=i[p][c]*f[c]}return f}function na(i){return i*180/Math.PI}function Ze(i){return i*Math.PI/180}function yr(i,r){var t=i%r;return t*r<0?t+r:t}function ie(i,r,t){return i+t*(r-i)}function ps(i,r){var t=Math.pow(10,r);return Math.round(i*t)/t}function Cn(i,r){return Math.floor(ps(i,r))}function xn(i,r){return Math.ceil(ps(i,r))}var Au=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),nn=6378137,gr=Math.PI*nn,Mu=[-gr,-gr,gr,gr],Fu=[-180,-85,180,85],On=nn*Math.log(Math.tan(Math.PI/2)),sr=function(i){Au(r,i);function r(t){return i.call(this,{code:t,units:oe.METERS,extent:Mu,global:!0,worldExtent:Fu,getPointResolution:function(e,n){return e/Ru(n[1]/nn)}})||this}return r}(fs),ia=[new sr("EPSG:3857"),new sr("EPSG:102100"),new sr("EPSG:102113"),new sr("EPSG:900913"),new sr("http://www.opengis.net/def/crs/EPSG/0/3857"),new sr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Nu(i,r,t){var e=i.length,n=t>1?t:2,o=r;o===void 0&&(n>2?o=i.slice():o=new Array(e));for(var a=0;a<e;a+=n){o[a]=gr*i[a]/180;var s=nn*Math.log(Math.tan(Math.PI*(+i[a+1]+90)/360));s>On?s=On:s<-On&&(s=-On),o[a+1]=s}return o}function Du(i,r,t){var e=i.length,n=t>1?t:2,o=r;o===void 0&&(n>2?o=i.slice():o=new Array(e));for(var a=0;a<e;a+=n)o[a]=180*i[a]/gr,o[a+1]=360*Math.atan(Math.exp(i[a+1]/nn))/Math.PI-90;return o}var Gu=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ku=6378137,oa=[-180,-90,180,90],bu=Math.PI*ku/180,Fe=function(i){Gu(r,i);function r(t,e){return i.call(this,{code:t,units:oe.DEGREES,extent:oa,axisOrientation:e,global:!0,metersPerUnit:bu,worldExtent:oa})||this}return r}(fs),aa=[new Fe("CRS:84"),new Fe("EPSG:4326","neu"),new Fe("urn:ogc:def:crs:OGC:1.3:CRS84"),new Fe("urn:ogc:def:crs:OGC:2:84"),new Fe("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Fe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fe("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Ui={};function ju(i){return Ui[i]||Ui[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Xu(i,r){Ui[i]=r}var mr={};function bn(i,r,t){var e=i.getCode(),n=r.getCode();e in mr||(mr[e]={}),mr[e][n]=t}function Yu(i,r){var t;return i in mr&&r in mr[i]&&(t=mr[i][r]),t}function Gr(i,r,t){var e=t!==void 0?i.toFixed(t):""+i,n=e.indexOf(".");return n=n===-1?e.length:n,n>r?e:new Array(1+r-n).join("0")+e}function ds(i,r){return i[0]+=+r[0],i[1]+=+r[1],i}function jn(i,r){for(var t=!0,e=i.length-1;e>=0;--e)if(i[e]!=r[e]){t=!1;break}return t}function so(i,r){var t=Math.cos(r),e=Math.sin(r),n=i[0]*t-i[1]*e,o=i[1]*t+i[0]*e;return i[0]=n,i[1]=o,i}function vs(i,r){return i[0]*=r,i[1]*=r,i}function gs(i,r){if(r.canWrapX()){var t=it(r.getExtent()),e=Uu(i,r,t);e&&(i[0]-=e*t)}return i}function Uu(i,r,t){var e=r.getExtent(),n=0;if(r.canWrapX()&&(i[0]<e[0]||i[0]>e[2])){var o=t||it(e);n=Math.floor((i[0]-e[0])/o)}return n}var _s=63710088e-1;function sa(i,r,t){var e=t||_s,n=Ze(i[1]),o=Ze(r[1]),a=(o-n)/2,s=Ze(r[0]-i[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(o);return 2*e*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Wu(i,r,t,e){var n=e||_s,o=Ze(i[1]),a=Ze(i[0]),s=r/n,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(t)),u=a+Math.atan2(Math.sin(t)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l));return[na(u),na(l)]}var Wi=!0;function ys(i){var r=i===void 0?!0:i;Wi=!r}function lo(i,r,t){var e;if(r!==void 0){for(var n=0,o=i.length;n<o;++n)r[n]=i[n];e=r}else e=i.slice();return e}function uo(i,r,t){if(r!==void 0&&i!==r){for(var e=0,n=i.length;e<n;++e)r[e]=i[e];i=r}return i}function Bu(i){Xu(i.getCode(),i),bn(i,i,lo)}function Zu(i){i.forEach(Bu)}function at(i){return typeof i=="string"?ju(i):i||null}function la(i,r,t,e){i=at(i);var n,o=i.getPointResolutionFunc();if(o){if(n=o(r,t),e&&e!==i.getUnits()){var a=i.getMetersPerUnit();a&&(n=n*a/Vt[e])}}else{var s=i.getUnits();if(s==oe.DEGREES&&!e||e==oe.DEGREES)n=r;else{var l=li(i,at("EPSG:4326"));if(l===uo&&s!==oe.DEGREES)n=r*i.getMetersPerUnit();else{var u=[t[0]-r/2,t[1],t[0]+r/2,t[1],t[0],t[1]-r/2,t[0],t[1]+r/2];u=l(u,u,2);var h=sa(u.slice(0,2),u.slice(2,4)),f=sa(u.slice(4,6),u.slice(6,8));n=(h+f)/2}var a=e?Vt[e]:i.getMetersPerUnit();a!==void 0&&(n/=a)}}return n}function ua(i){Zu(i),i.forEach(function(r){i.forEach(function(t){r!==t&&bn(r,t,lo)})})}function zu(i,r,t,e){i.forEach(function(n){r.forEach(function(o){bn(n,o,t),bn(o,n,e)})})}function ho(i,r){return i?typeof i=="string"?at(i):i:at(r)}function Ku(i,r){return ys(),ms(i,"EPSG:4326",r!==void 0?r:"EPSG:3857")}function ke(i,r){if(i===r)return!0;var t=i.getUnits()===r.getUnits();if(i.getCode()===r.getCode())return t;var e=li(i,r);return e===lo&&t}function li(i,r){var t=i.getCode(),e=r.getCode(),n=Yu(t,e);return n||(n=uo),n}function Xn(i,r){var t=at(i),e=at(r);return li(t,e)}function ms(i,r,t){var e=Xn(r,t);return e(i,void 0,i.length)}var Vu=null;function Hu(){return Vu}function Bi(i,r){return i}function te(i,r){return Wi&&!jn(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(Wi=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function Es(i,r){return i}function Xe(i,r){return i}function $u(){ua(ia),ua(aa),zu(aa,ia,Nu,Du)}$u();function ze(i,r,t,e,n,o){for(var a=o||[],s=0,l=r;l<t;l+=e){var u=i[l],h=i[l+1];a[s++]=n[0]*u+n[2]*h+n[4],a[s++]=n[1]*u+n[3]*h+n[5]}return o&&a.length!=s&&(a.length=s),a}function Ts(i,r,t,e,n,o,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),h=o[0],f=o[1],c=0,p=r;p<t;p+=e){var d=i[p]-h,v=i[p+1]-f;s[c++]=h+d*l-v*u,s[c++]=f+d*u+v*l;for(var g=p+2;g<p+e;++g)s[c++]=i[g]}return a&&s.length!=c&&(s.length=c),s}function qu(i,r,t,e,n,o,a,s){for(var l=s||[],u=a[0],h=a[1],f=0,c=r;c<t;c+=e){var p=i[c]-u,d=i[c+1]-h;l[f++]=u+n*p,l[f++]=h+o*d;for(var v=c+2;v<c+e;++v)l[f++]=i[v]}return s&&l.length!=f&&(l.length=f),l}function Ju(i,r,t,e,n,o,a){for(var s=a||[],l=0,u=r;u<t;u+=e){s[l++]=i[u]+n,s[l++]=i[u+1]+o;for(var h=u+2;h<u+e;++h)s[l++]=i[h]}return a&&s.length!=l&&(s.length=l),s}var Qu=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ha=Kt(),th=function(i){Qu(r,i);function r(){var t=i.call(this)||this;return t.extent_=Pt(),t.extentRevision_=-1,t.simplifiedGeometryMaxMinSquaredTolerance=0,t.simplifiedGeometryRevision=0,t.simplifyTransformedInternal=nu(function(e,n,o){if(!o)return this.getSimplifiedGeometry(n);var a=this.clone();return a.applyTransform(o),a.getSimplifiedGeometry(n)}),t}return r.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},r.prototype.clone=function(){return F()},r.prototype.closestPointXY=function(t,e,n,o){return F()},r.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},r.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},r.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},r.prototype.computeExtent=function(t){return F()},r.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&rn(e),this.extentRevision_=this.getRevision()}return xu(this.extent_,t)},r.prototype.rotate=function(t,e){F()},r.prototype.scale=function(t,e,n){F()},r.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},r.prototype.getSimplifiedGeometry=function(t){return F()},r.prototype.getType=function(){return F()},r.prototype.applyTransform=function(t){F()},r.prototype.intersectsExtent=function(t){return F()},r.prototype.translate=function(t,e){F()},r.prototype.transform=function(t,e){var n=at(t),o=n.getUnits()==oe.TILE_PIXELS?function(a,s,l){var u=n.getExtent(),h=n.getWorldExtent(),f=Ut(h)/Ut(u);return se(ha,h[0],h[3],f,-f,0,0,0),ze(a,0,a.length,l,ha,s),Xn(n,e)(a,s,l)}:Xn(n,e);return this.applyTransform(o),this},r}(bt),Cs=th,eh=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rh=function(i){eh(r,i);function r(){var t=i.call(this)||this;return t.layout=q.XY,t.stride=2,t.flatCoordinates=null,t}return r.prototype.computeExtent=function(t){return us(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinates=function(){return F()},r.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},r.prototype.getFlatCoordinates=function(){return this.flatCoordinates},r.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},r.prototype.getLayout=function(){return this.layout},r.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t),n=e.getFlatCoordinates();return n.length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},r.prototype.getSimplifiedGeometryInternal=function(t){return this},r.prototype.getStride=function(){return this.stride},r.prototype.setFlatCoordinates=function(t,e){this.stride=ca(t),this.layout=t,this.flatCoordinates=e},r.prototype.setCoordinates=function(t,e){F()},r.prototype.setLayout=function(t,e,n){var o;if(t)o=ca(t);else{for(var a=0;a<n;++a)if(e.length===0){this.layout=q.XY,this.stride=2;return}else e=e[0];o=e.length,t=nh(o)}this.layout=t,this.stride=o},r.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},r.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var o=this.getStride();Ts(n,0,n.length,o,t,e,n),this.changed()}},r.prototype.scale=function(t,e,n){var o=e;o===void 0&&(o=t);var a=n;a||(a=Re(this.getExtent()));var s=this.getFlatCoordinates();if(s){var l=this.getStride();qu(s,0,s.length,l,t,o,a,s),this.changed()}},r.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var o=this.getStride();Ju(n,0,n.length,o,t,e,n),this.changed()}},r}(Cs);function nh(i){var r;return i==2?r=q.XY:i==3?r=q.XYZ:i==4&&(r=q.XYZM),r}function ca(i){var r;return i==q.XY?r=2:i==q.XYZ||i==q.XYM?r=3:i==q.XYZM&&(r=4),r}function ih(i,r,t){var e=i.getFlatCoordinates();if(e){var n=i.getStride();return ze(e,0,e.length,n,r,t)}else return null}var tr=rh;function fa(i,r,t,e,n,o,a){var s=i[r],l=i[r+1],u=i[t]-s,h=i[t+1]-l,f;if(u===0&&h===0)f=r;else{var c=((n-s)*u+(o-l)*h)/(u*u+h*h);if(c>1)f=t;else if(c>0){for(var p=0;p<e;++p)a[p]=ie(i[r+p],i[t+p],c);a.length=e;return}else f=r}for(var p=0;p<e;++p)a[p]=i[f+p];a.length=e}function co(i,r,t,e,n){var o=i[r],a=i[r+1];for(r+=e;r<t;r+=e){var s=i[r],l=i[r+1],u=Be(o,a,s,l);u>n&&(n=u),o=s,a=l}return n}function fo(i,r,t,e,n){for(var o=0,a=t.length;o<a;++o){var s=t[o];n=co(i,r,s,e,n),r=s}return n}function oh(i,r,t,e,n){for(var o=0,a=t.length;o<a;++o){var s=t[o];n=fo(i,r,s,e,n),r=s[s.length-1]}return n}function po(i,r,t,e,n,o,a,s,l,u,h){if(r==t)return u;var f,c;if(n===0)if(c=Be(a,s,i[r],i[r+1]),c<u){for(f=0;f<e;++f)l[f]=i[r+f];return l.length=e,c}else return u;for(var p=h||[NaN,NaN],d=r+e;d<t;)if(fa(i,d-e,d,e,a,s,p),c=Be(a,s,p[0],p[1]),c<u){for(u=c,f=0;f<e;++f)l[f]=p[f];l.length=e,d+=e}else d+=e*Math.max((Math.sqrt(c)-Math.sqrt(u))/n|0,1);if(o&&(fa(i,t-e,r,e,a,s,p),c=Be(a,s,p[0],p[1]),c<u)){for(u=c,f=0;f<e;++f)l[f]=p[f];l.length=e}return u}function vo(i,r,t,e,n,o,a,s,l,u,h){for(var f=h||[NaN,NaN],c=0,p=t.length;c<p;++c){var d=t[c];u=po(i,r,d,e,n,o,a,s,l,u,f),r=d}return u}function ah(i,r,t,e,n,o,a,s,l,u,h){for(var f=h||[NaN,NaN],c=0,p=t.length;c<p;++c){var d=t[c];u=vo(i,r,d,e,n,o,a,s,l,u,f),r=d[d.length-1]}return u}function sh(i,r,t,e){for(var n=0,o=t.length;n<o;++n)i[r++]=t[n];return r}function ui(i,r,t,e){for(var n=0,o=t.length;n<o;++n)for(var a=t[n],s=0;s<e;++s)i[r++]=a[s];return r}function go(i,r,t,e,n){for(var o=n||[],a=0,s=0,l=t.length;s<l;++s){var u=ui(i,r,t[s],e);o[a++]=u,r=u}return o.length=a,o}function lh(i,r,t,e,n){for(var o=n||[],a=0,s=0,l=t.length;s<l;++s){var u=go(i,r,t[s],e,o[a]);o[a++]=u,r=u[u.length-1]}return o.length=a,o}function _o(i,r,t,e,n,o,a){var s=(t-r)/e;if(s<3){for(;r<t;r+=e)o[a++]=i[r],o[a++]=i[r+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[r,t-e],h=0;u.length>0;){for(var f=u.pop(),c=u.pop(),p=0,d=i[c],v=i[c+1],g=i[f],m=i[f+1],_=c+e;_<f;_+=e){var y=i[_],E=i[_+1],T=Lu(y,E,d,v,g,m);T>p&&(h=_,p=T)}p>n&&(l[(h-r)/e]=1,c+e<h&&u.push(c,h),h+e<f&&u.push(h,f))}for(var _=0;_<s;++_)l[_]&&(o[a++]=i[r+_*e],o[a++]=i[r+_*e+1]);return a}function uh(i,r,t,e,n,o,a,s){for(var l=0,u=t.length;l<u;++l){var h=t[l];a=_o(i,r,h,e,n,o,a),s.push(a),r=h}return a}function Ge(i,r){return r*Math.round(i/r)}function hh(i,r,t,e,n,o,a){if(r==t)return a;var s=Ge(i[r],n),l=Ge(i[r+1],n);r+=e,o[a++]=s,o[a++]=l;var u,h;do if(u=Ge(i[r],n),h=Ge(i[r+1],n),r+=e,r==t)return o[a++]=u,o[a++]=h,a;while(u==s&&h==l);for(;r<t;){var f=Ge(i[r],n),c=Ge(i[r+1],n);if(r+=e,!(f==u&&c==h)){var p=u-s,d=h-l,v=f-s,g=c-l;if(p*g==d*v&&(p<0&&v<p||p==v||p>0&&v>p)&&(d<0&&g<d||d==g||d>0&&g>d)){u=f,h=c;continue}o[a++]=u,o[a++]=h,s=u,l=h,u=f,h=c}}return o[a++]=u,o[a++]=h,a}function xs(i,r,t,e,n,o,a,s){for(var l=0,u=t.length;l<u;++l){var h=t[l];a=hh(i,r,h,e,n,o,a),s.push(a),r=h}return a}function ch(i,r,t,e,n,o,a,s){for(var l=0,u=t.length;l<u;++l){var h=t[l],f=[];a=xs(i,r,h,e,n,o,a,f),s.push(f),r=h[h.length-1]}return a}function Ce(i,r,t,e,n){for(var o=n!==void 0?n:[],a=0,s=r;s<t;s+=e)o[a++]=i.slice(s,s+e);return o.length=a,o}function Kr(i,r,t,e,n){for(var o=n!==void 0?n:[],a=0,s=0,l=t.length;s<l;++s){var u=t[s];o[a++]=Ce(i,r,u,e,o[a]),r=u}return o.length=a,o}function Zi(i,r,t,e,n){for(var o=n!==void 0?n:[],a=0,s=0,l=t.length;s<l;++s){var u=t[s];o[a++]=Kr(i,r,u,e,o[a]),r=u[u.length-1]}return o.length=a,o}function Os(i,r,t,e){for(var n=0,o=i[t-e],a=i[t-e+1];r<t;r+=e){var s=i[r],l=i[r+1];n+=a*s-o*l,o=s,a=l}return n/2}function ws(i,r,t,e){for(var n=0,o=0,a=t.length;o<a;++o){var s=t[o];n+=Os(i,r,s,e),r=s}return n}function fh(i,r,t,e){for(var n=0,o=0,a=t.length;o<a;++o){var s=t[o];n+=ws(i,r,s,e),r=s[s.length-1]}return n}var ph=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),dh=function(i){ph(r,i);function r(t,e){var n=i.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?n.setFlatCoordinates(e,t):n.setCoordinates(t,e),n}return r.prototype.clone=function(){return new r(this.flatCoordinates.slice(),this.layout)},r.prototype.closestPointXY=function(t,e,n,o){return o<Je(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(co(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),po(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,o))},r.prototype.getArea=function(){return Os(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getCoordinates=function(){return Ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[];return e.length=_o(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new r(e,q.XY)},r.prototype.getType=function(){return P.LINEAR_RING},r.prototype.intersectsExtent=function(t){return!1},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ui(this.flatCoordinates,0,t,this.stride),this.changed()},r}(tr),pa=dh,vh=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),gh=function(i){vh(r,i);function r(t,e){var n=i.call(this)||this;return n.setCoordinates(t,e),n}return r.prototype.clone=function(){var t=new r(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},r.prototype.closestPointXY=function(t,e,n,o){var a=this.flatCoordinates,s=Be(t,e,a[0],a[1]);if(s<o){for(var l=this.stride,u=0;u<l;++u)n[u]=a[u];return n.length=l,s}else return o},r.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},r.prototype.computeExtent=function(t){return ls(this.flatCoordinates,t)},r.prototype.getType=function(){return P.POINT},r.prototype.intersectsExtent=function(t){return io(t,this.flatCoordinates[0],this.flatCoordinates[1])},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sh(this.flatCoordinates,0,t,this.stride),this.changed()},r}(tr),Pe=gh;function _h(i,r,t,e,n){var o=cs(n,function(a){return!Ye(i,r,t,e,a[0],a[1])});return!o}function Ye(i,r,t,e,n,o){for(var a=0,s=i[t-e],l=i[t-e+1];r<t;r+=e){var u=i[r],h=i[r+1];l<=o?h>o&&(u-s)*(o-l)-(n-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(n-s)*(h-l)<0&&a--,s=u,l=h}return a!==0}function yo(i,r,t,e,n,o){if(t.length===0||!Ye(i,r,t[0],e,n,o))return!1;for(var a=1,s=t.length;a<s;++a)if(Ye(i,t[a-1],t[a],e,n,o))return!1;return!0}function yh(i,r,t,e,n,o){if(t.length===0)return!1;for(var a=0,s=t.length;a<s;++a){var l=t[a];if(yo(i,r,l,e,n,o))return!0;r=l[l.length-1]}return!1}function Ss(i,r,t,e,n,o,a){for(var s,l,u,h,f,c,p,d=n[o+1],v=[],g=0,m=t.length;g<m;++g){var _=t[g];for(h=i[_-e],c=i[_-e+1],s=r;s<_;s+=e)f=i[s],p=i[s+1],(d<=c&&p<=d||c<=d&&d<=p)&&(u=(d-c)/(p-c)*(f-h)+h,v.push(u)),h=f,c=p}var y=NaN,E=-1/0;for(v.sort(Ke),h=v[0],s=1,l=v.length;s<l;++s){f=v[s];var T=Math.abs(f-h);T>E&&(u=(h+f)/2,yo(i,r,t,e,u,d)&&(y=u,E=T)),h=f}return isNaN(y)&&(y=n[o]),a?(a.push(y,d,E),a):[y,d,E]}function mh(i,r,t,e,n){for(var o=[],a=0,s=t.length;a<s;++a){var l=t[a];o=Ss(i,r,l,e,n,2*a,o),r=l[l.length-1]}return o}function Rs(i,r,t,e,n){var o;for(r+=e;r<t;r+=e)if(o=n(i.slice(r-e,r),i.slice(r,r+e)),o)return o;return!1}function hi(i,r,t,e,n){var o=hs(Pt(),i,r,t,e);return Rt(n,o)?je(n,o)||o[0]>=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:Rs(i,r,t,e,function(a,s){return Ou(n,a,s)}):!1}function Eh(i,r,t,e,n){for(var o=0,a=t.length;o<a;++o){if(hi(i,r,t[o],e,n))return!0;r=t[o]}return!1}function Th(i,r,t,e,n){return!!(hi(i,r,t,e,n)||Ye(i,r,t,e,n[0],n[1])||Ye(i,r,t,e,n[0],n[3])||Ye(i,r,t,e,n[2],n[1])||Ye(i,r,t,e,n[2],n[3]))}function Ps(i,r,t,e,n){if(!Th(i,r,t[0],e,n))return!1;if(t.length===1)return!0;for(var o=1,a=t.length;o<a;++o)if(_h(i,t[o-1],t[o],e,n)&&!hi(i,t[o-1],t[o],e,n))return!1;return!0}function Ch(i,r,t,e,n){for(var o=0,a=t.length;o<a;++o){var s=t[o];if(Ps(i,r,s,e,n))return!0;r=s[s.length-1]}return!1}function xh(i,r,t,e){for(;r<t-e;){for(var n=0;n<e;++n){var o=i[r+n];i[r+n]=i[t-e+n],i[t-e+n]=o}r+=e,t-=e}}function Ls(i,r,t,e){for(var n=0,o=i[t-e],a=i[t-e+1];r<t;r+=e){var s=i[r],l=i[r+1];n+=(s-o)*(l+a),o=s,a=l}return n===0?void 0:n>0}function Is(i,r,t,e,n){for(var o=n!==void 0?n:!1,a=0,s=t.length;a<s;++a){var l=t[a],u=Ls(i,r,l,e);if(a===0){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;r=l}return!0}function Oh(i,r,t,e,n){for(var o=0,a=t.length;o<a;++o){var s=t[o];if(!Is(i,r,s,e,n))return!1;s.length&&(r=s[s.length-1])}return!0}function zi(i,r,t,e,n){for(var o=n!==void 0?n:!1,a=0,s=t.length;a<s;++a){var l=t[a],u=Ls(i,r,l,e),h=a===0?o&&u||!o&&!u:o&&!u||!o&&u;h&&xh(i,r,l,e),r=l}return r}function da(i,r,t,e,n){for(var o=0,a=t.length;o<a;++o)r=zi(i,r,t[o],e,n);return r}var wh=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),mo=function(i){wh(r,i);function r(t,e,n){var o=i.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,e!==void 0&&n?(o.setFlatCoordinates(e,t),o.ends_=n):o.setCoordinates(t,e),o}return r.prototype.appendLinearRing=function(t){this.flatCoordinates?Yt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},r.prototype.clone=function(){var t=new r(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},r.prototype.closestPointXY=function(t,e,n,o){return o<Je(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),vo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,o))},r.prototype.containsXY=function(t,e){return yo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},r.prototype.getArea=function(){return ws(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},r.prototype.getCoordinates=function(t){var e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),zi(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Kr(e,0,this.ends_,this.stride)},r.prototype.getEnds=function(){return this.ends_},r.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Re(this.getExtent());this.flatInteriorPoint_=Ss(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},r.prototype.getInteriorPoint=function(){return new Pe(this.getFlatInteriorPoint(),q.XYM)},r.prototype.getLinearRingCount=function(){return this.ends_.length},r.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new pa(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},r.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,o=[],a=0,s=0,l=n.length;s<l;++s){var u=n[s],h=new pa(e.slice(a,u),t);o.push(h),a=u}return o},r.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Is(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=zi(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[],n=[];return e.length=xs(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new r(e,q.XY,n)},r.prototype.getType=function(){return P.POLYGON},r.prototype.intersectsExtent=function(t){return Ps(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=go(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()},r}(tr),Yn=mo;function Sh(i,r,t,e){for(var n=t||32,o=[],a=0;a<n;++a)Yt(o,Wu(i,r,2*Math.PI*a/n,e));return o.push(o[0],o[1]),new mo(o,q.XY,[o.length])}function va(i){var r=i[0],t=i[1],e=i[2],n=i[3],o=[r,t,r,n,e,n,e,t,r,t];return new mo(o,q.XY,[o.length])}var As=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rt={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},Rh=function(i){As(r,i);function r(t){var e=i.call(this,G.ERROR)||this;return e.code=t.code,e.message=t.message,e}return r}(Ht),Ph=function(i){As(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un;var n=t||{};return e.position_=null,e.transform_=uo,e.watchId_=void 0,e.addChangeListener(rt.PROJECTION,e.handleProjectionChanged_),e.addChangeListener(rt.TRACKING,e.handleTrackingChanged_),n.projection!==void 0&&e.setProjection(n.projection),n.trackingOptions!==void 0&&e.setTrackingOptions(n.trackingOptions),e.setTracking(n.tracking!==void 0?n.tracking:!1),e}return r.prototype.disposeInternal=function(){this.setTracking(!1),i.prototype.disposeInternal.call(this)},r.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=li(at("EPSG:4326"),t),this.position_&&this.set(rt.POSITION,this.transform_(this.position_)))},r.prototype.handleTrackingChanged_=function(){if("geolocation"in navigator){var t=this.getTracking();t&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!t&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},r.prototype.positionChange_=function(t){var e=t.coords;this.set(rt.ACCURACY,e.accuracy),this.set(rt.ALTITUDE,e.altitude===null?void 0:e.altitude),this.set(rt.ALTITUDE_ACCURACY,e.altitudeAccuracy===null?void 0:e.altitudeAccuracy),this.set(rt.HEADING,e.heading===null?void 0:Ze(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var n=this.transform_(this.position_);this.set(rt.POSITION,n),this.set(rt.SPEED,e.speed===null?void 0:e.speed);var o=Sh(this.position_,e.accuracy);o.applyTransform(this.transform_),this.set(rt.ACCURACY_GEOMETRY,o),this.changed()},r.prototype.positionError_=function(t){this.dispatchEvent(new Rh(t))},r.prototype.getAccuracy=function(){return this.get(rt.ACCURACY)},r.prototype.getAccuracyGeometry=function(){return this.get(rt.ACCURACY_GEOMETRY)||null},r.prototype.getAltitude=function(){return this.get(rt.ALTITUDE)},r.prototype.getAltitudeAccuracy=function(){return this.get(rt.ALTITUDE_ACCURACY)},r.prototype.getHeading=function(){return this.get(rt.HEADING)},r.prototype.getPosition=function(){return this.get(rt.POSITION)},r.prototype.getProjection=function(){return this.get(rt.PROJECTION)},r.prototype.getSpeed=function(){return this.get(rt.SPEED)},r.prototype.getTracking=function(){return this.get(rt.TRACKING)},r.prototype.getTrackingOptions=function(){return this.get(rt.TRACKING_OPTIONS)},r.prototype.setProjection=function(t){this.set(rt.PROJECTION,at(t))},r.prototype.setTracking=function(t){this.set(rt.TRACKING,t)},r.prototype.setTrackingOptions=function(t){this.set(rt.TRACKING_OPTIONS,t)},r}(bt),Lh=Ph,we={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Ih=function(){function i(r){var t=r||{};this.color_=t.color!==void 0?t.color:null}return i.prototype.clone=function(){var r=this.getColor();return new i({color:Array.isArray(r)?r.slice():r||void 0})},i.prototype.getColor=function(){return this.color_},i.prototype.setColor=function(r){this.color_=r},i}(),Tt=Ih;function Ms(i,r,t,e,n,o,a){var s,l,u=(t-r)/e;if(u===1)s=r;else if(u===2)s=r,l=n;else if(u!==0){for(var h=i[r],f=i[r+1],c=0,p=[0],d=r+e;d<t;d+=e){var v=i[d],g=i[d+1];c+=Math.sqrt((v-h)*(v-h)+(g-f)*(g-f)),p.push(c),h=v,f=g}var m=n*c,_=tu(p,m);_<0?(l=(m-p[-_-2])/(p[-_-1]-p[-_-2]),s=r+(-_-2)*e):s=r+_*e}for(var y=a>1?a:2,E=o||new Array(y),d=0;d<y;++d)E[d]=s===void 0?NaN:l===void 0?i[s+d]:ie(i[s+d],i[s+e+d],l);return E}function Ki(i,r,t,e,n,o){if(t==r)return null;var a;if(n<i[r+e-1])return o?(a=i.slice(r,r+e),a[e-1]=n,a):null;if(i[t-1]<n)return o?(a=i.slice(t-e,t),a[e-1]=n,a):null;if(n==i[r+e-1])return i.slice(r,r+e);for(var s=r/e,l=t/e;s<l;){var u=s+l>>1;n<i[(u+1)*e-1]?l=u:s=u+1}var h=i[s*e-1];if(n==h)return i.slice((s-1)*e,(s-1)*e+e);var f=i[(s+1)*e-1],c=(n-h)/(f-h);a=[];for(var p=0;p<e-1;++p)a.push(ie(i[(s-1)*e+p],i[s*e+p],c));return a.push(n),a}function Ah(i,r,t,e,n,o,a){if(a)return Ki(i,r,t[t.length-1],e,n,o);var s;if(n<i[e-1])return o?(s=i.slice(0,e),s[e-1]=n,s):null;if(i[i.length-1]<n)return o?(s=i.slice(i.length-e),s[e-1]=n,s):null;for(var l=0,u=t.length;l<u;++l){var h=t[l];if(r!=h){if(n<i[r+e-1])return null;if(n<=i[h-1])return Ki(i,r,h,e,n,!1);r=h}}return null}function Fs(i,r,t,e){for(var n=i[r],o=i[r+1],a=0,s=r+e;s<t;s+=e){var l=i[s],u=i[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-o)*(u-o)),n=l,o=u}return a}var Mh=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Fh=function(i){Mh(r,i);function r(t,e){var n=i.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?n.setFlatCoordinates(e,t):n.setCoordinates(t,e),n}return r.prototype.appendCoordinate=function(t){this.flatCoordinates?Yt(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},r.prototype.clone=function(){var t=new r(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},r.prototype.closestPointXY=function(t,e,n,o){return o<Je(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(co(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),po(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,o))},r.prototype.forEachSegment=function(t){return Rs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinateAtM=function(t,e){if(this.layout!=q.XYM&&this.layout!=q.XYZM)return null;var n=e!==void 0?e:!1;return Ki(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},r.prototype.getCoordinates=function(){return Ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getCoordinateAt=function(t,e){return Ms(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},r.prototype.getLength=function(){return Fs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[];return e.length=_o(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new r(e,q.XY)},r.prototype.getType=function(){return P.LINE_STRING},r.prototype.intersectsExtent=function(t){return hi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ui(this.flatCoordinates,0,t,this.stride),this.changed()},r}(tr),Un=Fh,Nh=function(){function i(r){var t=r||{};this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}return i.prototype.clone=function(){var r=this.getColor();return new i({color:Array.isArray(r)?r.slice():r||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},i.prototype.getColor=function(){return this.color_},i.prototype.getLineCap=function(){return this.lineCap_},i.prototype.getLineDash=function(){return this.lineDash_},i.prototype.getLineDashOffset=function(){return this.lineDashOffset_},i.prototype.getLineJoin=function(){return this.lineJoin_},i.prototype.getMiterLimit=function(){return this.miterLimit_},i.prototype.getWidth=function(){return this.width_},i.prototype.setColor=function(r){this.color_=r},i.prototype.setLineCap=function(r){this.lineCap_=r},i.prototype.setLineDash=function(r){this.lineDash_=r},i.prototype.setLineDashOffset=function(r){this.lineDashOffset_=r},i.prototype.setLineJoin=function(r){this.lineJoin_=r},i.prototype.setMiterLimit=function(r){this.miterLimit_=r},i.prototype.setWidth=function(r){this.width_=r},i}(),Et=Nh,tt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ga(i){return i[0]>0&&i[1]>0}function Dh(i,r,t){return t===void 0&&(t=[0,0]),t[0]=i[0]*r+.5|0,t[1]=i[1]*r+.5|0,t}function Ft(i,r){return Array.isArray(i)?i:(r===void 0?r=[i,i]:(r[0]=i,r[1]=i),r)}var Gh=function(){function i(r){this.opacity_=r.opacity,this.rotateWithView_=r.rotateWithView,this.rotation_=r.rotation,this.scale_=r.scale,this.scaleArray_=Ft(r.scale),this.displacement_=r.displacement}return i.prototype.clone=function(){var r=this.getScale();return new i({opacity:this.getOpacity(),scale:Array.isArray(r)?r.slice():r,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},i.prototype.getOpacity=function(){return this.opacity_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getDisplacement=function(){return this.displacement_},i.prototype.getAnchor=function(){return F()},i.prototype.getImage=function(r){return F()},i.prototype.getHitDetectionImage=function(){return F()},i.prototype.getPixelRatio=function(r){return 1},i.prototype.getImageState=function(){return F()},i.prototype.getImageSize=function(){return F()},i.prototype.getOrigin=function(){return F()},i.prototype.getSize=function(){return F()},i.prototype.setDisplacement=function(r){this.displacement_=r},i.prototype.setOpacity=function(r){this.opacity_=r},i.prototype.setRotateWithView=function(r){this.rotateWithView_=r},i.prototype.setRotation=function(r){this.rotation_=r},i.prototype.setScale=function(r){this.scale_=r,this.scaleArray_=Ft(r)},i.prototype.listenImageChange=function(r){F()},i.prototype.load=function(){F()},i.prototype.unlistenImageChange=function(r){F()},i}(),Ns=Gh,kh=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,bh=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ds(i){return typeof i=="string"?i:Gs(i)}function jh(i){var r=document.createElement("div");if(r.style.color=i,r.style.color!==""){document.body.appendChild(r);var t=getComputedStyle(r).color;return document.body.removeChild(r),t}else return""}var Xh=function(){var i=1024,r={},t=0;return function(e){var n;if(r.hasOwnProperty(e))n=r[e];else{if(t>=i){var o=0;for(var a in r)(o++&3)===0&&(delete r[a],--t)}n=Yh(e),r[e]=n,++t}return n}}();function Wn(i){return Array.isArray(i)?i:Xh(i)}function Yh(i){var r,t,e,n,o;if(bh.exec(i)&&(i=jh(i)),kh.exec(i)){var a=i.length-1,s=void 0;a<=4?s=1:s=2;var l=a===4||a===8;r=parseInt(i.substr(1+0*s,s),16),t=parseInt(i.substr(1+1*s,s),16),e=parseInt(i.substr(1+2*s,s),16),l?n=parseInt(i.substr(1+3*s,s),16):n=255,s==1&&(r=(r<<4)+r,t=(t<<4)+t,e=(e<<4)+e,l&&(n=(n<<4)+n)),o=[r,t,e,n/255]}else i.indexOf("rgba(")==0?(o=i.slice(5,-1).split(",").map(Number),_a(o)):i.indexOf("rgb(")==0?(o=i.slice(4,-1).split(",").map(Number),o.push(1),_a(o)):B(!1,14);return o}function _a(i){return i[0]=ot(i[0]+.5|0,0,255),i[1]=ot(i[1]+.5|0,0,255),i[2]=ot(i[2]+.5|0,0,255),i[3]=ot(i[3],0,1),i}function Gs(i){var r=i[0];r!=(r|0)&&(r=r+.5|0);var t=i[1];t!=(t|0)&&(t=t+.5|0);var e=i[2];e!=(e|0)&&(e=e+.5|0);var n=i[3]===void 0?1:Math.round(i[3]*100)/100;return"rgba("+r+","+t+","+e+","+n+")"}function zt(i){return Array.isArray(i)?Gs(i):i}function kt(i,r,t,e){var n;return t&&t.length?n=t.shift():ni?n=new OffscreenCanvas(i||300,r||300):n=document.createElement("canvas"),i&&(n.width=i),r&&(n.height=r),n.getContext("2d",e)}function Uh(i){var r=i.offsetWidth,t=getComputedStyle(i);return r+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),r}function Wh(i){var r=i.offsetHeight,t=getComputedStyle(i);return r+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),r}function Bn(i,r){var t=r.parentNode;t&&t.replaceChild(i,r)}function Zn(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function ks(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function Bh(i,r){for(var t=i.childNodes,e=0;;++e){var n=t[e],o=r[e];if(!n&&!o)break;if(n!==o){if(!n){i.appendChild(o);continue}if(!o){i.removeChild(n),--e;continue}i.insertBefore(o,n)}}}var wn="ol-hidden",Zh="ol-selectable",He="ol-unselectable",ya="ol-unsupported",on="ol-control",ma="ol-collapsed",zh=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Ea=["style","variant","weight","size","lineHeight","family"],bs=function(i){var r=i.match(zh);if(!r)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},e=0,n=Ea.length;e<n;++e){var o=r[e+1];o!==void 0&&(t[Ea[e]]=o)}return t.families=t.family.split(/,\s?/),t};function js(i){return i===1?"":String(Math.round(i*100)/100)}var Xs="10px sans-serif",ae="#000",zn="round",Vr=[],Hr=0,Cr="round",$r=10,qr="#000",Jr="center",Kn="middle",Ue=[0,0,0,0],Qr=1,ee=new bt,Kh=new xr;Kh.setSize=function(){console.warn("labelCache is deprecated.")};var fr=null,Vi,Hi={},Vh=function(){var i=100,r="32px ",t=["monospace","serif"],e=t.length,n="wmytzilWMYTZIL@#/&?$%10\uF013",o,a;function s(u,h,f){for(var c=!0,p=0;p<e;++p){var d=t[p];if(a=Vn(u+" "+h+" "+r+d,n),f!=d){var v=Vn(u+" "+h+" "+r+f+","+d,n);c=c&&v!=a}}return!!c}function l(){for(var u=!0,h=ee.getKeys(),f=0,c=h.length;f<c;++f){var p=h[f];ee.get(p)<i&&(s.apply(this,p.split(`
`))?(tn(Hi),fr=null,Vi=void 0,ee.set(p,i)):(ee.set(p,ee.get(p)+1,!0),u=!1))}u&&(clearInterval(o),o=void 0)}return function(u){var h=bs(u);if(!!h)for(var f=h.families,c=0,p=f.length;c<p;++c){var d=f[c],v=h.style+`
`+h.weight+`
`+d;ee.get(v)===void 0&&(ee.set(v,i,!0),s(h.style,h.weight,d)||(ee.set(v,0,!0),o===void 0&&(o=setInterval(l,32))))}}}(),Hh=function(){var i;return function(r){var t=Hi[r];if(t==null){if(ni){var e=bs(r),n=Ys(r,"\u017Dg"),o=isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight);t=o*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=r,document.body.appendChild(i),t=i.offsetHeight,document.body.removeChild(i);Hi[r]=t}return t}}();function Ys(i,r){return fr||(fr=kt(1,1)),i!=Vi&&(fr.font=i,Vi=fr.font),fr.measureText(r)}function Vn(i,r){return Ys(i,r).width}function Ta(i,r,t){if(r in t)return t[r];var e=Vn(i,r);return t[r]=e,e}function $h(i,r){for(var t=[],e=[],n=[],o=0,a=0,s=0,l=0,u=0,h=r.length;u<=h;u+=2){var f=r[u];if(f===`
`||u===h){o=Math.max(o,a),n.push(a),a=0,s+=l;continue}var c=r[u+1]||i.font,p=Vn(c,f);t.push(p),a+=p;var d=Hh(c);e.push(d),l=Math.max(l,d)}return{width:o,height:s,widths:t,heights:e,lineWidths:n}}function qh(i,r,t,e,n,o,a,s,l,u,h){i.save(),t!==1&&(i.globalAlpha*=t),r&&i.setTransform.apply(i,r),e.contextInstructions?(i.translate(l,u),i.scale(h[0],h[1]),Jh(e,i)):h[0]<0||h[1]<0?(i.translate(l,u),i.scale(h[0],h[1]),i.drawImage(e,n,o,a,s,0,0,a,s)):i.drawImage(e,n,o,a,s,l,u,a*h[0],s*h[1]),i.restore()}function Jh(i,r){for(var t=i.contextInstructions,e=0,n=t.length;e<n;e+=2)Array.isArray(t[e+1])?r[t[e]].apply(r,t[e+1]):r[t[e]]=t[e+1]}var Qh=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),tc=function(i){Qh(r,i);function r(t){var e=this,n=t.rotateWithView!==void 0?t.rotateWithView:!1;return e=i.call(this,{opacity:1,rotateWithView:n,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0]})||this,e.canvas_=void 0,e.hitDetectionCanvas_=null,e.fill_=t.fill!==void 0?t.fill:null,e.origin_=[0,0],e.points_=t.points,e.radius_=t.radius!==void 0?t.radius:t.radius1,e.radius2_=t.radius2,e.angle_=t.angle!==void 0?t.angle:0,e.stroke_=t.stroke!==void 0?t.stroke:null,e.size_=null,e.renderOptions_=null,e.render(),e}return r.prototype.clone=function(){var t=this.getScale(),e=new r({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return e.setOpacity(this.getOpacity()),e},r.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},r.prototype.getAngle=function(){return this.angle_},r.prototype.getFill=function(){return this.fill_},r.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},r.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,o=kt(n.size*t,n.size*t);this.draw_(n,o,t),e=o.canvas,this.canvas_[t]=e}return e},r.prototype.getPixelRatio=function(t){return t},r.prototype.getImageSize=function(){return this.size_},r.prototype.getImageState=function(){return tt.LOADED},r.prototype.getOrigin=function(){return this.origin_},r.prototype.getPoints=function(){return this.points_},r.prototype.getRadius=function(){return this.radius_},r.prototype.getRadius2=function(){return this.radius2_},r.prototype.getSize=function(){return this.size_},r.prototype.getStroke=function(){return this.stroke_},r.prototype.listenImageChange=function(t){},r.prototype.load=function(){},r.prototype.unlistenImageChange=function(t){},r.prototype.calculateLineJoinSize_=function(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;var o=this.radius_,a=this.radius2_===void 0?o:this.radius2_;if(o<a){var s=o;o=a,a=s}var l=this.radius2_===void 0?this.points_:this.points_*2,u=2*Math.PI/l,h=a*Math.sin(u),f=Math.sqrt(a*a-h*h),c=o-f,p=Math.sqrt(h*h+c*c),d=p/h;if(t==="miter"&&d<=n)return d*e;var v=e/2/d,g=e/2*(c/p),m=Math.sqrt((o+v)*(o+v)+g*g),_=m-o;if(this.radius2_===void 0||t==="bevel")return _*2;var y=o*Math.sin(u),E=Math.sqrt(o*o-y*y),T=a-E,x=Math.sqrt(y*y+T*T),w=x/y;if(w<=n){var O=w*e/2-a-o;return 2*Math.max(_,O)}return _*2},r.prototype.createRenderOptions=function(){var t=Cr,e=0,n=null,o=0,a,s=0;this.stroke_&&(a=this.stroke_.getColor(),a===null&&(a=qr),a=zt(a),s=this.stroke_.getWidth(),s===void 0&&(s=Qr),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=Cr),e=this.stroke_.getMiterLimit(),e===void 0&&(e=$r));var l=this.calculateLineJoinSize_(t,s,e),u=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*u+l);return{strokeStyle:a,strokeWidth:s,size:h,lineDash:n,lineDashOffset:o,lineJoin:t,miterLimit:e}},r.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},r.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();o===null&&(o=ae),e.fillStyle=zt(o),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},r.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),n=0;if(typeof e=="string"&&(e=Wn(e)),e===null?n=1:Array.isArray(e)&&(n=e.length===4?e[3]:1),n===0){var o=kt(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},r.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var o=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(e*=2);for(var a=this.angle_-Math.PI/2,s=2*Math.PI/e,l=0;l<e;l++){var u=a+l*s,h=l%2===0?n:o;t.lineTo(h*Math.cos(u),h*Math.sin(u))}t.closePath()}},r.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=ae,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},r}(Ns),ec=tc,rc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),nc=function(i){rc(r,i);function r(t){var e=t||{};return i.call(this,{points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0]})||this}return r.prototype.clone=function(){var t=this.getScale(),e=new r({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return e.setOpacity(this.getOpacity()),e},r.prototype.setRadius=function(t){this.radius_=t,this.render()},r}(ec),ge=nc,Us=function(){function i(r){var t=r||{};this.geometry_=null,this.geometryFunction_=Ca,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}return i.prototype.clone=function(){var r=this.getGeometry();return r&&typeof r=="object"&&(r=r.clone()),new i({geometry:r,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},i.prototype.getRenderer=function(){return this.renderer_},i.prototype.setRenderer=function(r){this.renderer_=r},i.prototype.setHitDetectionRenderer=function(r){this.hitDetectionRenderer_=r},i.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},i.prototype.getGeometry=function(){return this.geometry_},i.prototype.getGeometryFunction=function(){return this.geometryFunction_},i.prototype.getFill=function(){return this.fill_},i.prototype.setFill=function(r){this.fill_=r},i.prototype.getImage=function(){return this.image_},i.prototype.setImage=function(r){this.image_=r},i.prototype.getStroke=function(){return this.stroke_},i.prototype.setStroke=function(r){this.stroke_=r},i.prototype.getText=function(){return this.text_},i.prototype.setText=function(r){this.text_=r},i.prototype.getZIndex=function(){return this.zIndex_},i.prototype.setGeometry=function(r){typeof r=="function"?this.geometryFunction_=r:typeof r=="string"?this.geometryFunction_=function(t){return t.get(r)}:r?r!==void 0&&(this.geometryFunction_=function(){return r}):this.geometryFunction_=Ca,this.geometry_=r},i.prototype.setZIndex=function(r){this.zIndex_=r},i}();function ic(i){var r;if(typeof i=="function")r=i;else{var t;if(Array.isArray(i))t=i;else{B(typeof i.getZIndex=="function",41);var e=i;t=[e]}r=function(){return t}}return r}var Ti=null;function oc(i,r){if(!Ti){var t=new Tt({color:"rgba(255,255,255,0.4)"}),e=new Et({color:"#3399CC",width:1.25});Ti=[new Us({image:new ge({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return Ti}function Ca(i){return i.getGeometry()}var yt=Us,Ws={POINT:"point",LINE:"line"},ac="#333",sc=function(){function i(r){var t=r||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Ft(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Tt({color:ac}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:Ws.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}return i.prototype.clone=function(){var r=this.getScale();return new i({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(r)?r.slice():r,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},i.prototype.getOverflow=function(){return this.overflow_},i.prototype.getFont=function(){return this.font_},i.prototype.getMaxAngle=function(){return this.maxAngle_},i.prototype.getPlacement=function(){return this.placement_},i.prototype.getOffsetX=function(){return this.offsetX_},i.prototype.getOffsetY=function(){return this.offsetY_},i.prototype.getFill=function(){return this.fill_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getStroke=function(){return this.stroke_},i.prototype.getText=function(){return this.text_},i.prototype.getTextAlign=function(){return this.textAlign_},i.prototype.getTextBaseline=function(){return this.textBaseline_},i.prototype.getBackgroundFill=function(){return this.backgroundFill_},i.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},i.prototype.getPadding=function(){return this.padding_},i.prototype.setOverflow=function(r){this.overflow_=r},i.prototype.setFont=function(r){this.font_=r},i.prototype.setMaxAngle=function(r){this.maxAngle_=r},i.prototype.setOffsetX=function(r){this.offsetX_=r},i.prototype.setOffsetY=function(r){this.offsetY_=r},i.prototype.setPlacement=function(r){this.placement_=r},i.prototype.setRotateWithView=function(r){this.rotateWithView_=r},i.prototype.setFill=function(r){this.fill_=r},i.prototype.setRotation=function(r){this.rotation_=r},i.prototype.setScale=function(r){this.scale_=r,this.scaleArray_=Ft(r!==void 0?r:1)},i.prototype.setStroke=function(r){this.stroke_=r},i.prototype.setText=function(r){this.text_=r},i.prototype.setTextAlign=function(r){this.textAlign_=r},i.prototype.setTextBaseline=function(r){this.textBaseline_=r},i.prototype.setBackgroundFill=function(r){this.backgroundFill_=r},i.prototype.setBackgroundStroke=function(r){this.backgroundStroke_=r},i.prototype.setPadding=function(r){this.padding_=r},i}(),lc=sc,$={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"},uc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),hc=function(i){uc(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un,e.background_=t.background;var n=ut({},t);return typeof t.properties=="object"&&(delete n.properties,ut(n,t.properties)),n[$.OPACITY]=t.opacity!==void 0?t.opacity:1,B(typeof n[$.OPACITY]=="number",64),n[$.VISIBLE]=t.visible!==void 0?t.visible:!0,n[$.Z_INDEX]=t.zIndex,n[$.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,n[$.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,n[$.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,n[$.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,e.className_=n.className!==void 0?n.className:"ol-layer",delete n.className,e.setProperties(n),e.state_=null,e}return r.prototype.getBackground=function(){return this.background_},r.prototype.getClassName=function(){return this.className_},r.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return e.opacity=ot(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},r.prototype.getLayersArray=function(t){return F()},r.prototype.getLayerStatesArray=function(t){return F()},r.prototype.getExtent=function(){return this.get($.EXTENT)},r.prototype.getMaxResolution=function(){return this.get($.MAX_RESOLUTION)},r.prototype.getMinResolution=function(){return this.get($.MIN_RESOLUTION)},r.prototype.getMinZoom=function(){return this.get($.MIN_ZOOM)},r.prototype.getMaxZoom=function(){return this.get($.MAX_ZOOM)},r.prototype.getOpacity=function(){return this.get($.OPACITY)},r.prototype.getSourceState=function(){return F()},r.prototype.getVisible=function(){return this.get($.VISIBLE)},r.prototype.getZIndex=function(){return this.get($.Z_INDEX)},r.prototype.setBackground=function(t){this.background_=t,this.changed()},r.prototype.setExtent=function(t){this.set($.EXTENT,t)},r.prototype.setMaxResolution=function(t){this.set($.MAX_RESOLUTION,t)},r.prototype.setMinResolution=function(t){this.set($.MIN_RESOLUTION,t)},r.prototype.setMaxZoom=function(t){this.set($.MAX_ZOOM,t)},r.prototype.setMinZoom=function(t){this.set($.MIN_ZOOM,t)},r.prototype.setOpacity=function(t){B(typeof t=="number",64),this.set($.OPACITY,t)},r.prototype.setVisible=function(t){this.set($.VISIBLE,t)},r.prototype.setZIndex=function(t){this.set($.Z_INDEX,t)},r.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),i.prototype.disposeInternal.call(this)},r}(bt),Bs=hc,$e={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},cc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),fc=function(i){cc(r,i);function r(t){var e=this,n=ut({},t);delete n.source,e=i.call(this,n)||this,e.on,e.once,e.un,e.mapPrecomposeKey_=null,e.mapRenderKey_=null,e.sourceChangeKey_=null,e.renderer_=null,e.rendered=!1,t.render&&(e.render=t.render),t.map&&e.setMap(t.map),e.addChangeListener($.SOURCE,e.handleSourcePropertyChange_);var o=t.source?t.source:null;return e.setSource(o),e}return r.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},r.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},r.prototype.getSource=function(){return this.get($.SOURCE)||null},r.prototype.getRenderSource=function(){return this.getSource()},r.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():$e.UNDEFINED},r.prototype.handleSourceChange_=function(){this.changed()},r.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(J(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=W(t,G.CHANGE,this.handleSourceChange_,this)),this.changed()},r.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(e){return e([])})},r.prototype.getData=function(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)},r.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return this.rendered=!0,n.renderFrame(t,e)},r.prototype.unrender=function(){this.rendered=!1},r.prototype.setMapInternal=function(t){t||this.unrender(),this.set($.MAP,t)},r.prototype.getMapInternal=function(){return this.get($.MAP)},r.prototype.setMap=function(t){this.mapPrecomposeKey_&&(J(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(J(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=W(t,we.PRECOMPOSE,function(e){var n=e,o=n.frameState.layerStatesArray,a=this.getLayerState(!1);B(!o.some(function(s){return s.layer===a.layer}),67),o.push(a)},this),this.mapRenderKey_=W(this,G.CHANGE,t.render,t),this.changed())},r.prototype.setSource=function(t){this.set($.SOURCE,t)},r.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},r.prototype.hasRenderer=function(){return!!this.renderer_},r.prototype.createRenderer=function(){return null},r.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),i.prototype.disposeInternal.call(this)},r}(Bs);function Hn(i,r){if(!i.visible)return!1;var t=r.resolution;if(t<i.minResolution||t>=i.maxResolution)return!1;var e=r.zoom;return e>i.minZoom&&e<=i.maxZoom}var ci=fc;function pc(i,r,t,e,n){Zs(i,r,t||0,e||i.length-1,n||dc)}function Zs(i,r,t,e,n){for(;e>t;){if(e-t>600){var o=e-t+1,a=r-t+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),h=Math.max(t,Math.floor(r-a*l/o+u)),f=Math.min(e,Math.floor(r+(o-a)*l/o+u));Zs(i,r,h,f,n)}var c=i[r],p=t,d=e;for(kr(i,t,r),n(i[e],c)>0&&kr(i,t,e);p<d;){for(kr(i,p,d),p++,d--;n(i[p],c)<0;)p++;for(;n(i[d],c)>0;)d--}n(i[t],c)===0?kr(i,t,d):(d++,kr(i,d,e)),d<=r&&(t=d+1),r<=d&&(e=d-1)}}function kr(i,r,t){var e=i[r];i[r]=i[t],i[t]=e}function dc(i,r){return i<r?-1:i>r?1:0}class zs{constructor(r=9){this._maxEntries=Math.max(4,r),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(r){let t=this.data;const e=[];if(!Rn(r,t))return e;const n=this.toBBox,o=[];for(;t;){for(let a=0;a<t.children.length;a++){const s=t.children[a],l=t.leaf?n(s):s;Rn(r,l)&&(t.leaf?e.push(s):xi(r,l)?this._all(s,e):o.push(s))}t=o.pop()}return e}collides(r){let t=this.data;if(!Rn(r,t))return!1;const e=[];for(;t;){for(let n=0;n<t.children.length;n++){const o=t.children[n],a=t.leaf?this.toBBox(o):o;if(Rn(r,a)){if(t.leaf||xi(r,a))return!0;e.push(o)}}t=e.pop()}return!1}load(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(let e=0;e<r.length;e++)this.insert(r[e]);return this}let t=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(r){return r&&this._insert(r,this.data.height-1),this}clear(){return this.data=pr([]),this}remove(r,t){if(!r)return this;let e=this.data;const n=this.toBBox(r),o=[],a=[];let s,l,u;for(;e||o.length;){if(e||(e=o.pop(),l=o[o.length-1],s=a.pop(),u=!0),e.leaf){const h=vc(r,e.children,t);if(h!==-1)return e.children.splice(h,1),o.push(e),this._condense(o),this}!u&&!e.leaf&&xi(e,n)?(o.push(e),a.push(s),s=0,l=e,e=e.children[0]):l?(s++,e=l.children[s],u=!1):e=null}return this}toBBox(r){return r}compareMinX(r,t){return r.minX-t.minX}compareMinY(r,t){return r.minY-t.minY}toJSON(){return this.data}fromJSON(r){return this.data=r,this}_all(r,t){const e=[];for(;r;)r.leaf?t.push(...r.children):e.push(...r.children),r=e.pop();return t}_build(r,t,e,n){const o=e-t+1;let a=this._maxEntries,s;if(o<=a)return s=pr(r.slice(t,e+1)),lr(s,this.toBBox),s;n||(n=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,n-1))),s=pr([]),s.leaf=!1,s.height=n;const l=Math.ceil(o/a),u=l*Math.ceil(Math.sqrt(a));xa(r,t,e,u,this.compareMinX);for(let h=t;h<=e;h+=u){const f=Math.min(h+u-1,e);xa(r,h,f,l,this.compareMinY);for(let c=h;c<=f;c+=l){const p=Math.min(c+l-1,f);s.children.push(this._build(r,c,p,n-1))}}return lr(s,this.toBBox),s}_chooseSubtree(r,t,e,n){for(;n.push(t),!(t.leaf||n.length-1===e);){let o=1/0,a=1/0,s;for(let l=0;l<t.children.length;l++){const u=t.children[l],h=Ci(u),f=yc(r,u)-h;f<a?(a=f,o=h<o?h:o,s=u):f===a&&h<o&&(o=h,s=u)}t=s||t.children[0]}return t}_insert(r,t,e){const n=e?r:this.toBBox(r),o=[],a=this._chooseSubtree(n,this.data,t,o);for(a.children.push(r),Ur(a,n);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(n,o,t)}_split(r,t){const e=r[t],n=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,n);const a=this._chooseSplitIndex(e,o,n),s=pr(e.children.splice(a,e.children.length-a));s.height=e.height,s.leaf=e.leaf,lr(e,this.toBBox),lr(s,this.toBBox),t?r[t-1].children.push(s):this._splitRoot(e,s)}_splitRoot(r,t){this.data=pr([r,t]),this.data.height=r.height+1,this.data.leaf=!1,lr(this.data,this.toBBox)}_chooseSplitIndex(r,t,e){let n,o=1/0,a=1/0;for(let s=t;s<=e-t;s++){const l=Yr(r,0,s,this.toBBox),u=Yr(r,s,e,this.toBBox),h=mc(l,u),f=Ci(l)+Ci(u);h<o?(o=h,n=s,a=f<a?f:a):h===o&&f<a&&(a=f,n=s)}return n||e-t}_chooseSplitAxis(r,t,e){const n=r.leaf?this.compareMinX:gc,o=r.leaf?this.compareMinY:_c,a=this._allDistMargin(r,t,e,n),s=this._allDistMargin(r,t,e,o);a<s&&r.children.sort(n)}_allDistMargin(r,t,e,n){r.children.sort(n);const o=this.toBBox,a=Yr(r,0,t,o),s=Yr(r,e-t,e,o);let l=Sn(a)+Sn(s);for(let u=t;u<e-t;u++){const h=r.children[u];Ur(a,r.leaf?o(h):h),l+=Sn(a)}for(let u=e-t-1;u>=t;u--){const h=r.children[u];Ur(s,r.leaf?o(h):h),l+=Sn(s)}return l}_adjustParentBBoxes(r,t,e){for(let n=e;n>=0;n--)Ur(t[n],r)}_condense(r){for(let t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():lr(r[t],this.toBBox)}}function vc(i,r,t){if(!t)return r.indexOf(i);for(let e=0;e<r.length;e++)if(t(i,r[e]))return e;return-1}function lr(i,r){Yr(i,0,i.children.length,r,i)}function Yr(i,r,t,e,n){n||(n=pr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let o=r;o<t;o++){const a=i.children[o];Ur(n,i.leaf?e(a):a)}return n}function Ur(i,r){return i.minX=Math.min(i.minX,r.minX),i.minY=Math.min(i.minY,r.minY),i.maxX=Math.max(i.maxX,r.maxX),i.maxY=Math.max(i.maxY,r.maxY),i}function gc(i,r){return i.minX-r.minX}function _c(i,r){return i.minY-r.minY}function Ci(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function Sn(i){return i.maxX-i.minX+(i.maxY-i.minY)}function yc(i,r){return(Math.max(r.maxX,i.maxX)-Math.min(r.minX,i.minX))*(Math.max(r.maxY,i.maxY)-Math.min(r.minY,i.minY))}function mc(i,r){const t=Math.max(i.minX,r.minX),e=Math.max(i.minY,r.minY),n=Math.min(i.maxX,r.maxX),o=Math.min(i.maxY,r.maxY);return Math.max(0,n-t)*Math.max(0,o-e)}function xi(i,r){return i.minX<=r.minX&&i.minY<=r.minY&&r.maxX<=i.maxX&&r.maxY<=i.maxY}function Rn(i,r){return r.minX<=i.maxX&&r.minY<=i.maxY&&r.maxX>=i.minX&&r.maxY>=i.minY}function pr(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xa(i,r,t,e,n){const o=[r,t];for(;o.length;){if(t=o.pop(),r=o.pop(),t-r<=e)continue;const a=r+Math.ceil((t-r)/e/2)*e;pc(i,a,r,t,n),o.push(r,a,a,t)}}var Ec=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Oa={RENDER_ORDER:"renderOrder"},Tc=function(i){Ec(r,i);function r(t){var e=this,n=t||{},o=ut({},n);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,e=i.call(this,o)||this,e.declutter_=n.declutter!==void 0?n.declutter:!1,e.renderBuffer_=n.renderBuffer!==void 0?n.renderBuffer:100,e.style_=null,e.styleFunction_=void 0,e.setStyle(n.style),e.updateWhileAnimating_=n.updateWhileAnimating!==void 0?n.updateWhileAnimating:!1,e.updateWhileInteracting_=n.updateWhileInteracting!==void 0?n.updateWhileInteracting:!1,e}return r.prototype.getDeclutter=function(){return this.declutter_},r.prototype.getFeatures=function(t){return i.prototype.getFeatures.call(this,t)},r.prototype.getRenderBuffer=function(){return this.renderBuffer_},r.prototype.getRenderOrder=function(){return this.get(Oa.RENDER_ORDER)},r.prototype.getStyle=function(){return this.style_},r.prototype.getStyleFunction=function(){return this.styleFunction_},r.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},r.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},r.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new zs(9)),this.getRenderer().renderDeclutter(t)},r.prototype.setRenderOrder=function(t){this.set(Oa.RENDER_ORDER,t)},r.prototype.setStyle=function(t){this.style_=t!==void 0?t:oc,this.styleFunction_=t===null?void 0:ic(this.style_),this.changed()},r}(ci),Cc=Tc,an={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Pn=[an.FILL],xe=[an.STROKE],We=[an.BEGIN_PATH],wa=[an.CLOSE_PATH],N=an,xc=function(){function i(){}return i.prototype.drawCustom=function(r,t,e,n){},i.prototype.drawGeometry=function(r){},i.prototype.setStyle=function(r){},i.prototype.drawCircle=function(r,t){},i.prototype.drawFeature=function(r,t){},i.prototype.drawGeometryCollection=function(r,t){},i.prototype.drawLineString=function(r,t){},i.prototype.drawMultiLineString=function(r,t){},i.prototype.drawMultiPoint=function(r,t){},i.prototype.drawMultiPolygon=function(r,t){},i.prototype.drawPoint=function(r,t){},i.prototype.drawPolygon=function(r,t){},i.prototype.drawText=function(r,t){},i.prototype.setFillStrokeStyle=function(r,t){},i.prototype.setImageStyle=function(r,t){},i.prototype.setTextStyle=function(r,t){},i}(),Ks=xc,Oc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),wc=function(i){Oc(r,i);function r(t,e,n,o){var a=i.call(this)||this;return a.tolerance=t,a.maxExtent=e,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=n,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return r.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})},r.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,l=0,u=t.length;l<u;l+=e)o[0]=t[l],o[1]=t[l+1],en(n,o)&&(a[s++]=o[0],a[s++]=o[1]);return s},r.prototype.appendFlatLineCoordinates=function(t,e,n,o,a,s){var l=this.coordinates,u=l.length,h=this.getBufferedMaxExtent();s&&(e+=o);var f=t[e],c=t[e+1],p=this.tmpCoordinate_,d=!0,v,g,m;for(v=e+o;v<n;v+=o)p[0]=t[v],p[1]=t[v+1],m=ji(h,p),m!==g?(d&&(l[u++]=f,l[u++]=c,d=!1),l[u++]=p[0],l[u++]=p[1]):m===vt.INTERSECTING?(l[u++]=p[0],l[u++]=p[1],d=!1):d=!0,f=p[0],c=p[1],g=m;return(a&&d||v===e+o)&&(l[u++]=f,l[u++]=c),u},r.prototype.drawCustomCoordinates_=function(t,e,n,o,a){for(var s=0,l=n.length;s<l;++s){var u=n[s],h=this.appendFlatLineCoordinates(t,e,u,o,!1,!1);a.push(h),e=u}return e},r.prototype.drawCustom=function(t,e,n,o){this.beginGeometry(t,e);var a=t.getType(),s=t.getStride(),l=this.coordinates.length,u,h,f,c,p;switch(a){case P.MULTI_POLYGON:u=t.getOrientedFlatCoordinates(),c=[];var d=t.getEndss();p=0;for(var v=0,g=d.length;v<g;++v){var m=[];p=this.drawCustomCoordinates_(u,p,d[v],s,m),c.push(m)}this.instructions.push([N.CUSTOM,l,c,t,n,Zi]),this.hitDetectionInstructions.push([N.CUSTOM,l,c,t,o||n,Zi]);break;case P.POLYGON:case P.MULTI_LINE_STRING:f=[],u=a==P.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),p=this.drawCustomCoordinates_(u,0,t.getEnds(),s,f),this.instructions.push([N.CUSTOM,l,f,t,n,Kr]),this.hitDetectionInstructions.push([N.CUSTOM,l,f,t,o||n,Kr]);break;case P.LINE_STRING:case P.CIRCLE:u=t.getFlatCoordinates(),h=this.appendFlatLineCoordinates(u,0,u.length,s,!1,!1),this.instructions.push([N.CUSTOM,l,h,t,n,Ce]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n,Ce]);break;case P.MULTI_POINT:u=t.getFlatCoordinates(),h=this.appendFlatPointCoordinates(u,s),h>l&&(this.instructions.push([N.CUSTOM,l,h,t,n,Ce]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n,Ce]));break;case P.POINT:u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),h=this.coordinates.length,this.instructions.push([N.CUSTOM,l,h,t,n]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n]);break}this.endGeometry(e)},r.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[N.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[N.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},r.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},r.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var e,n=t.length,o,a,s=-1;for(e=0;e<n;++e)o=t[e],a=o[0],a==N.END_GEOMETRY?s=e:a==N.BEGIN_GEOMETRY&&(o[2]=e,eu(this.hitDetectionInstructions,s,e),s=-1)},r.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var o=t.getColor();n.fillStyle=zt(o||ae)}else n.fillStyle=void 0;if(e){var a=e.getColor();n.strokeStyle=zt(a||qr);var s=e.getLineCap();n.lineCap=s!==void 0?s:zn;var l=e.getLineDash();n.lineDash=l?l.slice():Vr;var u=e.getLineDashOffset();n.lineDashOffset=u||Hr;var h=e.getLineJoin();n.lineJoin=h!==void 0?h:Cr;var f=e.getWidth();n.lineWidth=f!==void 0?f:Qr;var c=e.getMiterLimit();n.miterLimit=c!==void 0?c:$r,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},r.prototype.createFill=function(t){var e=t.fillStyle,n=[N.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(!0),n},r.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},r.prototype.createStroke=function(t){return[N.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},r.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},r.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,o=t.lineCap,a=t.lineDash,s=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=o||a!=t.currentLineDash&&!qe(t.currentLineDash,a)||t.currentLineDashOffset!=s||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=h)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=o,t.currentLineDash=a,t.currentLineDashOffset=s,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=h)},r.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[N.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},r.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ss(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;ii(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},r}(Ks),sn=wc,Sc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Rc=function(i){Sc(r,i);function r(t,e,n,o){var a=i.call(this,t,e,n,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterImageWithText_=void 0,a}return r.prototype.drawPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,o);this.instructions.push([N.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},r.prototype.drawMultiPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,o);this.instructions.push([N.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},r.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,i.prototype.finish.call(this)},r.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),o=t.getSize(),a=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),l=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=a,this.image_=s,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=l[0]*this.imagePixelRatio_,this.originY_=l[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},r}(sn),Pc=Rc,Lc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ic=function(i){Lc(r,i);function r(t,e,n,o){return i.call(this,t,e,n,o)||this}return r.prototype.drawFlatCoordinates_=function(t,e,n,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(t,e,n,o,!1,!1),l=[N.MOVE_TO_LINE_TO,a,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),n},r.prototype.drawLineString=function(t,e){var n=this.state,o=n.strokeStyle,a=n.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Vr,Hr],We);var s=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(xe),this.endGeometry(e)}},r.prototype.drawMultiLineString=function(t,e){var n=this.state,o=n.strokeStyle,a=n.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],We);for(var s=t.getEnds(),l=t.getFlatCoordinates(),u=t.getStride(),h=0,f=0,c=s.length;f<c;++f)h=this.drawFlatCoordinates_(l,h,s[f],u);this.hitDetectionInstructions.push(xe),this.endGeometry(e)}},r.prototype.finish=function(){var t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(xe),this.reverseHitDetectionInstructions(),this.state=null,i.prototype.finish.call(this)},r.prototype.applyStroke=function(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(xe),t.lastStroke=this.coordinates.length),t.lastStroke=0,i.prototype.applyStroke.call(this,t),this.instructions.push(We)},r}(sn),Ac=Ic,Mc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Fc=function(i){Mc(r,i);function r(t,e,n,o){return i.call(this,t,e,n,o)||this}return r.prototype.drawFlatCoordinatess_=function(t,e,n,o){var a=this.state,s=a.fillStyle!==void 0,l=a.strokeStyle!==void 0,u=n.length;this.instructions.push(We),this.hitDetectionInstructions.push(We);for(var h=0;h<u;++h){var f=n[h],c=this.coordinates.length,p=this.appendFlatLineCoordinates(t,e,f,o,!0,!l),d=[N.MOVE_TO_LINE_TO,c,p];this.instructions.push(d),this.hitDetectionInstructions.push(d),l&&(this.instructions.push(wa),this.hitDetectionInstructions.push(wa)),e=f}return s&&(this.instructions.push(Pn),this.hitDetectionInstructions.push(Pn)),l&&(this.instructions.push(xe),this.hitDetectionInstructions.push(xe)),e},r.prototype.drawCircle=function(t,e){var n=this.state,o=n.fillStyle,a=n.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_FILL_STYLE,ae]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var s=t.getFlatCoordinates(),l=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,l,!1,!1);var h=[N.CIRCLE,u];this.instructions.push(We,h),this.hitDetectionInstructions.push(We,h),n.fillStyle!==void 0&&(this.instructions.push(Pn),this.hitDetectionInstructions.push(Pn)),n.strokeStyle!==void 0&&(this.instructions.push(xe),this.hitDetectionInstructions.push(xe)),this.endGeometry(e)}},r.prototype.drawPolygon=function(t,e){var n=this.state,o=n.fillStyle,a=n.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_FILL_STYLE,ae]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var s=t.getEnds(),l=t.getOrientedFlatCoordinates(),u=t.getStride();this.drawFlatCoordinatess_(l,0,s,u),this.endGeometry(e)}},r.prototype.drawMultiPolygon=function(t,e){var n=this.state,o=n.fillStyle,a=n.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,e),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_FILL_STYLE,ae]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var s=t.getEndss(),l=t.getOrientedFlatCoordinates(),u=t.getStride(),h=0,f=0,c=s.length;f<c;++f)h=this.drawFlatCoordinatess_(l,h,s[f],u);this.endGeometry(e)}},r.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(t!==0)for(var e=this.coordinates,n=0,o=e.length;n<o;++n)e[n]=Ge(e[n],t);return i.prototype.finish.call(this)},r.prototype.setFillStrokeStyles_=function(){var t=this.state,e=t.fillStyle;e!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)},r}(sn),Sa=Fc;function Nc(i,r,t,e,n){var o=t,a=t,s=0,l=0,u=t,h,f,c,p,d,v,g,m,_,y;for(f=t;f<e;f+=n){var E=r[f],T=r[f+1];d!==void 0&&(_=E-d,y=T-v,p=Math.sqrt(_*_+y*y),g!==void 0&&(l+=c,h=Math.acos((g*_+m*y)/(c*p)),h>i&&(l>s&&(s=l,o=u,a=f),l=0,u=f-n)),c=p,g=_,m=y),d=E,v=T}return l+=p,l>s?[u,f]:[o,a]}var Dc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$n={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Gc=function(i){Dc(r,i);function r(t,e,n,o){var a=i.call(this,t,e,n,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return r.prototype.finish=function(){var t=i.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},r.prototype.drawText=function(t,e){var n=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!n&&!o)){var s=this.coordinates,l=s.length,u=t.getType(),h=null,f=t.getStride();if(a.placement===Ws.LINE&&(u==P.LINE_STRING||u==P.MULTI_LINE_STRING||u==P.POLYGON||u==P.MULTI_POLYGON)){if(!Rt(this.getBufferedMaxExtent(),t.getExtent()))return;var c=void 0;if(h=t.getFlatCoordinates(),u==P.LINE_STRING)c=[h.length];else if(u==P.MULTI_LINE_STRING)c=t.getEnds();else if(u==P.POLYGON)c=t.getEnds().slice(0,1);else if(u==P.MULTI_POLYGON){var p=t.getEndss();c=[];for(var d=0,v=p.length;d<v;++d)c.push(p[d][0])}this.beginGeometry(t,e);for(var g=a.textAlign,m=0,_=void 0,y=0,E=c.length;y<E;++y){if(g==null){var T=Nc(a.maxAngle,h,m,c[y],f);m=T[0],_=T[1]}else _=c[y];for(var d=m;d<_;d+=f)s.push(h[d],h[d+1]);var x=s.length;m=c[y],this.drawChars_(l,x),l=x}this.endGeometry(e)}else{var w=a.overflow?null:[];switch(u){case P.POINT:case P.MULTI_POINT:h=t.getFlatCoordinates();break;case P.LINE_STRING:h=t.getFlatMidpoint();break;case P.CIRCLE:h=t.getCenter();break;case P.MULTI_LINE_STRING:h=t.getFlatMidpoints(),f=2;break;case P.POLYGON:h=t.getFlatInteriorPoint(),a.overflow||w.push(h[2]/this.resolution),f=3;break;case P.MULTI_POLYGON:var O=t.getFlatInteriorPoints();h=[];for(var d=0,v=O.length;d<v;d+=3)a.overflow||w.push(O[d+2]/this.resolution),h.push(O[d],O[d+1]);if(h.length===0)return;f=2;break}var x=this.appendFlatPointCoordinates(h,f);if(x===l)return;if(w&&(x-l)/2!==h.length/f){var R=l/2;w=w.filter(function(z,Z){var V=s[(R+Z)*2]===h[Z*f]&&s[(R+Z)*2+1]===h[Z*f+1];return V||--R,V})}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var M=a.padding;if(M!=Ue&&(a.scale[0]<0||a.scale[1]<0)){var b=a.padding[0],I=a.padding[1],j=a.padding[2],U=a.padding[3];a.scale[0]<0&&(I=-I,U=-U),a.scale[1]<0&&(b=-b,j=-j),M=[b,I,j,U]}var A=this.pixelRatio;this.instructions.push([N.DRAW_IMAGE,l,x,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,M==Ue?Ue:M.map(function(z){return z*A}),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]);var k=1/A;this.hitDetectionInstructions.push([N.DRAW_IMAGE,l,x,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[k,k],NaN,this.declutterImageWithText_,M,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]),this.endGeometry(e)}}},r.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var a=this.textKey_;a in this.textStates||(this.textStates[a]={font:e.font,textAlign:e.textAlign||Jr,textBaseline:e.textBaseline||Kn,scale:e.scale});var s=this.fillKey_;n&&(s in this.fillStates||(this.fillStates[s]={fillStyle:n.fillStyle}))},r.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,o=this.textState_,a=this.strokeKey_,s=this.textKey_,l=this.fillKey_;this.saveTextStates_();var u=this.pixelRatio,h=$n[o.textBaseline],f=this.textOffsetY_*u,c=this.text_,p=n?n.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([N.DRAW_CHARS,t,e,h,o.overflow,l,o.maxAngle,u,f,a,p*u,c,s,1]),this.hitDetectionInstructions.push([N.DRAW_CHARS,t,e,h,o.overflow,l,o.maxAngle,1,f,a,p,c,s,1/u])},r.prototype.setTextStyle=function(t,e){var n,o,a;if(!t)this.text_="";else{var s=t.getFill();s?(o=this.textFillState_,o||(o={},this.textFillState_=o),o.fillStyle=zt(s.getColor()||ae)):(o=null,this.textFillState_=o);var l=t.getStroke();if(!l)a=null,this.textStrokeState_=a;else{a=this.textStrokeState_,a||(a={},this.textStrokeState_=a);var u=l.getLineDash(),h=l.getLineDashOffset(),f=l.getWidth(),c=l.getMiterLimit();a.lineCap=l.getLineCap()||zn,a.lineDash=u?u.slice():Vr,a.lineDashOffset=h===void 0?Hr:h,a.lineJoin=l.getLineJoin()||Cr,a.lineWidth=f===void 0?Qr:f,a.miterLimit=c===void 0?$r:c,a.strokeStyle=zt(l.getColor()||qr)}n=this.textState_;var p=t.getFont()||Xs;Vh(p);var d=t.getScaleArray();n.overflow=t.getOverflow(),n.font=p,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.textBaseline=t.getTextBaseline()||Kn,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Ue,n.scale=d===void 0?[1,1]:d;var v=t.getOffsetX(),g=t.getOffsetY(),m=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=v===void 0?0:v,this.textOffsetY_=g===void 0?0:g,this.textRotateWithView_=m===void 0?!1:m,this.textRotation_=_===void 0?0:_,this.strokeKey_=a?(typeof a.strokeStyle=="string"?a.strokeStyle:H(a.strokeStyle))+a.lineCap+a.lineDashOffset+"|"+a.lineWidth+a.lineJoin+a.miterLimit+"["+a.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.textBaseline||"?"),this.fillKey_=o?typeof o.fillStyle=="string"?o.fillStyle:"|"+H(o.fillStyle):""}this.declutterImageWithText_=e},r}(sn),kc=Gc,bc={Circle:Sa,Default:sn,Image:Pc,LineString:Ac,Polygon:Sa,Text:kc},jc=function(){function i(r,t,e,n){this.tolerance_=r,this.maxExtent_=t,this.pixelRatio_=n,this.resolution_=e,this.buildersByZIndex_={}}return i.prototype.finish=function(){var r={};for(var t in this.buildersByZIndex_){r[t]=r[t]||{};var e=this.buildersByZIndex_[t];for(var n in e){var o=e[n].finish();r[t][n]=o}}return r},i.prototype.getBuilder=function(r,t){var e=r!==void 0?r.toString():"0",n=this.buildersByZIndex_[e];n===void 0&&(n={},this.buildersByZIndex_[e]=n);var o=n[t];if(o===void 0){var a=bc[t];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[t]=o}return o},i}(),Ra=jc,Xc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Yc=function(i){Xc(r,i);function r(t){var e=i.call(this)||this;return e.ready=!0,e.boundHandleImageChange_=e.handleImageChange_.bind(e),e.layer_=t,e.declutterExecutorGroup=null,e}return r.prototype.getFeatures=function(t){return F()},r.prototype.getData=function(t){return null},r.prototype.prepareFrame=function(t){return F()},r.prototype.renderFrame=function(t,e){return F()},r.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},r.prototype.createLoadedTileFinder=function(t,e,n){return function(o,a){var s=this.loadedTileCallback.bind(this,n,o);return t.forEachLoadedTile(e,o,a,s)}.bind(this)},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a){},r.prototype.getDataAtPixel=function(t,e,n){return null},r.prototype.getLayer=function(){return this.layer_},r.prototype.handleFontsChanged=function(){},r.prototype.handleImageChange_=function(t){var e=t.target;e.getState()===tt.LOADED&&this.renderIfReadyAndVisible()},r.prototype.loadImage=function(t){var e=t.getState();return e!=tt.LOADED&&e!=tt.ERROR&&t.addEventListener(G.CHANGE,this.boundHandleImageChange_),e==tt.IDLE&&(t.load(),e=t.getState()),e==tt.LOADED},r.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==$e.READY&&t.changed()},r.prototype.disposeInternal=function(){delete this.layer_,i.prototype.disposeInternal.call(this)},r}(ts),Uc=Yc,Wc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Bc=function(i){Wc(r,i);function r(t,e,n,o){var a=i.call(this,t)||this;return a.inversePixelTransform=e,a.frameState=n,a.context=o,a}return r}(Ht),Vs=Bc,Zc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wr=null;function zc(){var i=document.createElement("canvas");i.width=1,i.height=1,Wr=i.getContext("2d")}var Kc=function(i){Zc(r,i);function r(t){var e=i.call(this,t)||this;return e.container=null,e.renderedResolution,e.tempTransform=Kt(),e.pixelTransform=Kt(),e.inversePixelTransform=Kt(),e.context=null,e.containerReused=!1,e.pixelContext_=null,e.frameState=null,e}return r.prototype.getImageData=function(t,e,n){Wr||zc(),Wr.clearRect(0,0,1,1);var o;try{Wr.drawImage(t,e,n,1,1,0,0,1,1),o=Wr.getImageData(0,0,1,1).data}catch{return null}return o},r.prototype.getBackground=function(t){var e=this.getLayer(),n=e.getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0},r.prototype.useContainer=function(t,e,n,o){var a=this.getLayer().getClassName(),s,l;if(t&&t.className===a&&t.style.opacity===""&&n===1&&(!o||t.style.backgroundColor&&qe(Wn(t.style.backgroundColor),Wn(o)))){var u=t.firstElementChild;u instanceof HTMLCanvasElement&&(l=u.getContext("2d"))}if(l&&l.canvas.style.transform===e?(this.container=t,this.context=l,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){s=document.createElement("div"),s.className=a;var h=s.style;h.position="absolute",h.width="100%",h.height="100%",o&&(h.backgroundColor=o),l=kt();var u=l.canvas;s.appendChild(u),h=u.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=s,this.context=l}},r.prototype.clipUnrotated=function(t,e,n){var o=Qe(n),a=si(n),s=ai(n),l=oi(n);st(e.coordinateToPixelTransform,o),st(e.coordinateToPixelTransform,a),st(e.coordinateToPixelTransform,s),st(e.coordinateToPixelTransform,l);var u=this.inversePixelTransform;st(u,o),st(u,a),st(u,s),st(u,l),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(l[0]),Math.round(l[1])),t.clip()},r.prototype.dispatchRenderEvent_=function(t,e,n){var o=this.getLayer();if(o.hasListener(t)){var a=new Vs(t,this.inversePixelTransform,n,e);o.dispatchEvent(a)}},r.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(we.PRERENDER,t,e)},r.prototype.postRender=function(t,e){this.dispatchRenderEvent_(we.POSTRENDER,t,e)},r.prototype.getRenderTransform=function(t,e,n,o,a,s,l){var u=a/2,h=s/2,f=o/e,c=-f,p=-t[0]+l,d=-t[1];return se(this.tempTransform,u,h,f,c,-n,p,d)},r.prototype.getDataAtPixel=function(t,e,n){var o=st(this.inversePixelTransform,t.slice()),a=this.context,s=this.getLayer(),l=s.getExtent();if(l){var u=st(e.pixelToCoordinateTransform,t.slice());if(!en(l,u))return null}var h=Math.round(o[0]),f=Math.round(o[1]),c=this.pixelContext_;if(!c){var p=document.createElement("canvas");p.width=1,p.height=1,c=p.getContext("2d"),this.pixelContext_=c}c.clearRect(0,0,1,1);var d;try{c.drawImage(a.canvas,h,f,1,1,0,0,1,1),d=c.getImageData(0,0,1,1).data}catch(v){return v.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):d}return d[3]===0?null:d},r.prototype.disposeInternal=function(){delete this.frameState,i.prototype.disposeInternal.call(this)},r}(Uc),Hs=Kc,nt={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function Vc(i,r,t,e,n,o,a,s,l,u,h,f){var c=i[r],p=i[r+1],d=0,v=0,g=0,m=0;function _(){d=c,v=p,r+=e,c=i[r],p=i[r+1],m+=g,g=Math.sqrt((c-d)*(c-d)+(p-v)*(p-v))}do _();while(r<t-e&&m+g<o);for(var y=g===0?0:(o-m)/g,E=ie(d,c,y),T=ie(v,p,y),x=r-e,w=m,O=o+s*l(u,n,h);r<t-e&&m+g<O;)_();y=g===0?0:(O-m)/g;var R=ie(d,c,y),M=ie(v,p,y),b;if(f){var I=[E,T,R,M];Ts(I,0,4,2,f,I,I),b=I[0]>I[2]}else b=E>R;var j=Math.PI,U=[],A=x+e===r;r=x,g=0,m=w,c=i[r],p=i[r+1];var k;if(A){_(),k=Math.atan2(p-v,c-d),b&&(k+=k>0?-j:j);var L=(R+E)/2,z=(M+T)/2;return U[0]=[L,z,(O-o)/2,k,n],U}for(var Z=0,V=n.length;Z<V;){_();var Q=Math.atan2(p-v,c-d);if(b&&(Q+=Q>0?-j:j),k!==void 0){var C=Q-k;if(C+=C>j?-2*j:C<-j?2*j:0,Math.abs(C)>a)return null}k=Q;for(var lt=Z,X=0;Z<V;++Z){var ct=b?V-Z-1:Z,Lt=s*l(u,n[ct],h);if(r+e<t&&m+g<o+X+Lt/2)break;X+=Lt}if(Z!==lt){var It=b?n.substring(V-lt,V-Z):n.substring(lt,Z);y=g===0?0:(o+X/2-m)/g;var L=ie(d,c,y),z=ie(v,p,y);U.push([L,z,X/2,Q,It]),o+=X}}return U}var ur=Pt(),fe=[],qt=[],Jt=[],pe=[];function Pa(i){return i[3].declutterBox}var Hc=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function La(i,r){return(r==="start"||r==="end")&&!Hc.test(i)&&(r=r==="start"?"left":"right"),$n[r]}function $c(i,r,t){return t>0&&i.push(`
`,""),i.push(r,""),i}var qc=function(){function i(r,t,e,n){this.overlaps=e,this.pixelRatio=t,this.resolution=r,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=Kt(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return i.prototype.createLabel=function(r,t,e,n){var o=r+t+e+n;if(this.labels_[o])return this.labels_[o];var a=n?this.strokeStates[n]:null,s=e?this.fillStates[e]:null,l=this.textStates[t],u=this.pixelRatio,h=[l.scale[0]*u,l.scale[1]*u],f=Array.isArray(r),c=La(f?r[0]:r,l.textAlign||Jr),p=n&&a.lineWidth?a.lineWidth:0,d=f?r:r.split(`
`).reduce($c,[]),v=$h(l,d),g=v.width,m=v.height,_=v.widths,y=v.heights,E=v.lineWidths,T=g+p,x=[],w=(T+2)*h[0],O=(m+p)*h[1],R={width:w<0?Math.floor(w):Math.ceil(w),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:x};if((h[0]!=1||h[1]!=1)&&x.push("scale",h),n){x.push("strokeStyle",a.strokeStyle),x.push("lineWidth",p),x.push("lineCap",a.lineCap),x.push("lineJoin",a.lineJoin),x.push("miterLimit",a.miterLimit);var M=ni?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;M.prototype.setLineDash&&(x.push("setLineDash",[a.lineDash]),x.push("lineDashOffset",a.lineDashOffset))}e&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var b=.5-c,I=c*T+b*p,j=[],U=[],A=0,k=0,L=0,z=0,Z,V=0,Q=d.length;V<Q;V+=2){var C=d[V];if(C===`
`){k+=A,A=0,I=c*T+b*p,++z;continue}var lt=d[V+1]||l.font;lt!==Z&&(n&&j.push("font",lt),e&&U.push("font",lt),Z=lt),A=Math.max(A,y[L]);var X=[C,I+b*_[L]+c*(_[L]-E[z]),.5*(p+A)+k];I+=_[L],n&&j.push("strokeText",X),e&&U.push("fillText",X),++L}return Array.prototype.push.apply(x,j),Array.prototype.push.apply(x,U),this.labels_[o]=R,R},i.prototype.replayTextBackground_=function(r,t,e,n,o,a,s){r.beginPath(),r.moveTo.apply(r,t),r.lineTo.apply(r,e),r.lineTo.apply(r,n),r.lineTo.apply(r,o),r.lineTo.apply(r,t),a&&(this.alignFill_=a[2],this.fill_(r)),s&&(this.setStrokeStyle_(r,s),r.stroke())},i.prototype.calculateImageOrLabelDimensions_=function(r,t,e,n,o,a,s,l,u,h,f,c,p,d,v,g){s*=c[0],l*=c[1];var m=e-s,_=n-l,y=o+u>r?r-u:o,E=a+h>t?t-h:a,T=d[3]+y*c[0]+d[1],x=d[0]+E*c[1]+d[2],w=m-d[3],O=_-d[0];(v||f!==0)&&(fe[0]=w,pe[0]=w,fe[1]=O,qt[1]=O,qt[0]=w+T,Jt[0]=qt[0],Jt[1]=O+x,pe[1]=Jt[1]);var R;return f!==0?(R=se(Kt(),e,n,1,1,f,-e,-n),st(R,fe),st(R,qt),st(R,Jt),st(R,pe),le(Math.min(fe[0],qt[0],Jt[0],pe[0]),Math.min(fe[1],qt[1],Jt[1],pe[1]),Math.max(fe[0],qt[0],Jt[0],pe[0]),Math.max(fe[1],qt[1],Jt[1],pe[1]),ur)):le(Math.min(w,w+T),Math.min(O,O+x),Math.max(w,w+T),Math.max(O,O+x),ur),p&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:y,drawImageH:E,originX:u,originY:h,declutterBox:{minX:ur[0],minY:ur[1],maxX:ur[2],maxY:ur[3],value:g},canvasTransform:R,scale:c}},i.prototype.replayImageOrLabel_=function(r,t,e,n,o,a,s){var l=!!(a||s),u=n.declutterBox,h=r.canvas,f=s?s[2]*n.scale[0]/2:0,c=u.minX-f<=h.width/t&&u.maxX+f>=0&&u.minY-f<=h.height/t&&u.maxY+f>=0;return c&&(l&&this.replayTextBackground_(r,fe,qt,Jt,pe,a,s),qh(r,n.canvasTransform,o,e,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},i.prototype.fill_=function(r){if(this.alignFill_){var t=st(this.renderedTransform_,[0,0]),e=512*this.pixelRatio;r.save(),r.translate(t[0]%e,t[1]%e),r.rotate(this.viewRotation_)}r.fill(),this.alignFill_&&r.restore()},i.prototype.setStrokeStyle_=function(r,t){r.strokeStyle=t[1],r.lineWidth=t[2],r.lineCap=t[3],r.lineJoin=t[4],r.miterLimit=t[5],r.setLineDash&&(r.lineDashOffset=t[7],r.setLineDash(t[6]))},i.prototype.drawLabelWithPointPlacement_=function(r,t,e,n){var o=this.textStates[t],a=this.createLabel(r,t,n,e),s=this.strokeStates[e],l=this.pixelRatio,u=La(Array.isArray(r)?r[0]:r,o.textAlign||Jr),h=$n[o.textBaseline||Kn],f=s&&s.lineWidth?s.lineWidth:0,c=a.width/l-2*o.scale[0],p=u*c+2*(.5-u)*f,d=h*a.height/l+2*(.5-h)*f;return{label:a,anchorX:p,anchorY:d}},i.prototype.execute_=function(r,t,e,n,o,a,s,l){var u;this.pixelCoordinates_&&qe(e,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=ze(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),yu(this.renderedTransform_,e));for(var h=0,f=n.length,c=0,p,d,v,g,m,_,y,E,T,x,w,O,R=0,M=0,b=null,I=null,j=this.coordinateCache_,U=this.viewRotation_,A=Math.round(Math.atan2(-e[1],e[0])*1e12)/1e12,k={context:r,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:U},L=this.instructions!=n||this.overlaps?0:200,z,Z,V,Q;h<f;){var C=n[h],lt=C[0];switch(lt){case N.BEGIN_GEOMETRY:z=C[1],Q=C[3],z.getGeometry()?s!==void 0&&!Rt(s,Q.getExtent())?h=C[2]+1:++h:h=C[2];break;case N.BEGIN_PATH:R>L&&(this.fill_(r),R=0),M>L&&(r.stroke(),M=0),!R&&!M&&(r.beginPath(),g=NaN,m=NaN),++h;break;case N.CIRCLE:c=C[1];var X=u[c],ct=u[c+1],Lt=u[c+2],It=u[c+3],xt=Lt-X,At=It-ct,rr=Math.sqrt(xt*xt+At*At);r.moveTo(X+rr,ct),r.arc(X,ct,rr,0,2*Math.PI,!0),++h;break;case N.CLOSE_PATH:r.closePath(),++h;break;case N.CUSTOM:c=C[1],p=C[2];var Wt=C[3],fn=C[4],pn=C.length==6?C[5]:void 0;k.geometry=Wt,k.feature=z,h in j||(j[h]=[]);var ue=j[h];pn?pn(u,c,p,2,ue):(ue[0]=u[c],ue[1]=u[c+1],ue.length=2),fn(ue,k),++h;break;case N.DRAW_IMAGE:c=C[1],p=C[2],E=C[3],d=C[4],v=C[5];var nr=C[6],dn=C[7],Rr=C[8],vn=C[9],Ie=C[10],Pr=C[11],gn=C[12],ir=C[13],he=C[14];if(!E&&C.length>=19){T=C[18],x=C[19],w=C[20],O=C[21];var or=this.drawLabelWithPointPlacement_(T,x,w,O);E=or.label,C[3]=E;var gi=C[22];d=(or.anchorX-gi)*this.pixelRatio,C[4]=d;var _n=C[23];v=(or.anchorY-_n)*this.pixelRatio,C[5]=v,nr=E.height,C[6]=nr,ir=E.width,C[13]=ir}var Lr=void 0;C.length>24&&(Lr=C[24]);var $t=void 0,Bt=void 0,Ae=void 0;C.length>16?($t=C[15],Bt=C[16],Ae=C[17]):($t=Ue,Bt=!1,Ae=!1),Ie&&A?Pr+=U:!Ie&&!A&&(Pr-=U);for(var Ir=0;c<p;c+=2)if(!(Lr&&Lr[Ir++]<ir/this.pixelRatio)){var Ot=this.calculateImageOrLabelDimensions_(E.width,E.height,u[c],u[c+1],ir,nr,d,v,Rr,vn,Pr,gn,o,$t,Bt||Ae,z),yn=[r,t,E,Ot,dn,Bt?b:null,Ae?I:null],_t=void 0,ar=void 0;if(l&&he){var Me=p-c;if(!he[Me]){he[Me]=yn;continue}if(_t=he[Me],delete he[Me],ar=Pa(_t),l.collides(ar))continue}l&&l.collides(Ot.declutterBox)||(_t&&(l&&l.insert(ar),this.replayImageOrLabel_.apply(this,_t)),l&&l.insert(Ot.declutterBox),this.replayImageOrLabel_.apply(this,yn))}++h;break;case N.DRAW_CHARS:var Xo=C[1],Yo=C[2],_i=C[3],Gl=C[4];O=C[5];var kl=C[6],Uo=C[7],Wo=C[8];w=C[9];var yi=C[10];T=C[11],x=C[12];var Bo=[C[13],C[13]],mi=this.textStates[x],Ar=mi.font,Mr=[mi.scale[0]*Uo,mi.scale[1]*Uo],Fr=void 0;Ar in this.widths_?Fr=this.widths_[Ar]:(Fr={},this.widths_[Ar]=Fr);var Zo=Fs(u,Xo,Yo,2),zo=Math.abs(Mr[0])*Ta(Ar,T,Fr);if(Gl||zo<=Zo){var bl=this.textStates[x].textAlign,jl=(Zo-zo)*$n[bl],Nr=Vc(u,Xo,Yo,2,T,jl,kl,Math.abs(Mr[0]),Ta,Ar,Fr,A?0:this.viewRotation_);t:if(Nr){var Dr=[],ce=void 0,mn=void 0,En=void 0,wt=void 0,Nt=void 0;if(w)for(ce=0,mn=Nr.length;ce<mn;++ce){Nt=Nr[ce],En=Nt[4],wt=this.createLabel(En,x,"",w),d=Nt[2]+(Mr[0]<0?-yi:yi),v=_i*wt.height+(.5-_i)*2*yi*Mr[1]/Mr[0]-Wo;var Ot=this.calculateImageOrLabelDimensions_(wt.width,wt.height,Nt[0],Nt[1],wt.width,wt.height,d,v,0,0,Nt[3],Bo,!1,Ue,!1,z);if(l&&l.collides(Ot.declutterBox))break t;Dr.push([r,t,wt,Ot,1,null,null])}if(O)for(ce=0,mn=Nr.length;ce<mn;++ce){Nt=Nr[ce],En=Nt[4],wt=this.createLabel(En,x,O,""),d=Nt[2],v=_i*wt.height-Wo;var Ot=this.calculateImageOrLabelDimensions_(wt.width,wt.height,Nt[0],Nt[1],wt.width,wt.height,d,v,0,0,Nt[3],Bo,!1,Ue,!1,z);if(l&&l.collides(Ot.declutterBox))break t;Dr.push([r,t,wt,Ot,1,null,null])}l&&l.load(Dr.map(Pa));for(var Ei=0,Xl=Dr.length;Ei<Xl;++Ei)this.replayImageOrLabel_.apply(this,Dr[Ei])}}++h;break;case N.END_GEOMETRY:if(a!==void 0){z=C[1];var Ko=a(z,Q);if(Ko)return Ko}++h;break;case N.FILL:L?R++:this.fill_(r),++h;break;case N.MOVE_TO_LINE_TO:for(c=C[1],p=C[2],Z=u[c],V=u[c+1],_=Z+.5|0,y=V+.5|0,(_!==g||y!==m)&&(r.moveTo(Z,V),g=_,m=y),c+=2;c<p;c+=2)Z=u[c],V=u[c+1],_=Z+.5|0,y=V+.5|0,(c==p-2||_!==g||y!==m)&&(r.lineTo(Z,V),g=_,m=y);++h;break;case N.SET_FILL_STYLE:b=C,this.alignFill_=C[2],R&&(this.fill_(r),R=0,M&&(r.stroke(),M=0)),r.fillStyle=C[1],++h;break;case N.SET_STROKE_STYLE:I=C,M&&(r.stroke(),M=0),this.setStrokeStyle_(r,C),++h;break;case N.STROKE:L?M++:r.stroke(),++h;break;default:++h;break}}R&&this.fill_(r),M&&r.stroke()},i.prototype.execute=function(r,t,e,n,o,a){this.viewRotation_=n,this.execute_(r,t,e,this.instructions,o,void 0,void 0,a)},i.prototype.executeHitDetection=function(r,t,e,n,o){return this.viewRotation_=e,this.execute_(r,1,t,this.hitDetectionInstructions,!0,n,o)},i}(),Jc=qc,Oi=[nt.POLYGON,nt.CIRCLE,nt.LINE_STRING,nt.IMAGE,nt.TEXT,nt.DEFAULT],Qc=function(){function i(r,t,e,n,o,a){this.maxExtent_=r,this.overlaps_=n,this.pixelRatio_=e,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Kt(),this.createExecutors_(o)}return i.prototype.clip=function(r,t){var e=this.getClipCoords(t);r.beginPath(),r.moveTo(e[0],e[1]),r.lineTo(e[2],e[3]),r.lineTo(e[4],e[5]),r.lineTo(e[6],e[7]),r.clip()},i.prototype.createExecutors_=function(r){for(var t in r){var e=this.executorsByZIndex_[t];e===void 0&&(e={},this.executorsByZIndex_[t]=e);var n=r[t];for(var o in n){var a=n[o];e[o]=new Jc(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}},i.prototype.hasExecutors=function(r){for(var t in this.executorsByZIndex_)for(var e=this.executorsByZIndex_[t],n=0,o=r.length;n<o;++n)if(r[n]in e)return!0;return!1},i.prototype.forEachFeatureAtCoordinate=function(r,t,e,n,o,a){n=Math.round(n);var s=n*2+1,l=se(this.hitDetectionTransform_,n+.5,n+.5,1/t,-1/t,-e,-r[0],-r[1]),u=!this.hitDetectionContext_;u&&(this.hitDetectionContext_=kt(s,s));var h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):u||h.clearRect(0,0,s,s);var f;this.renderBuffer_!==void 0&&(f=Pt(),Br(f,r),ii(f,t*(this.renderBuffer_+n),f));var c=tf(n),p;function d(x,w){for(var O=h.getImageData(0,0,s,s).data,R=0,M=c.length;R<M;R++)if(O[c[R]]>0){if(!a||p!==nt.IMAGE&&p!==nt.TEXT||a.indexOf(x)!==-1){var b=(c[R]-3)/4,I=n-b%s,j=n-(b/s|0),U=o(x,w,I*I+j*j);if(U)return U}h.clearRect(0,0,s,s);break}}var v=Object.keys(this.executorsByZIndex_).map(Number);v.sort(Ke);var g,m,_,y,E;for(g=v.length-1;g>=0;--g){var T=v[g].toString();for(_=this.executorsByZIndex_[T],m=Oi.length-1;m>=0;--m)if(p=Oi[m],y=_[p],y!==void 0&&(E=y.executeHitDetection(h,l,e,d,f),E))return E}},i.prototype.getClipCoords=function(r){var t=this.maxExtent_;if(!t)return null;var e=t[0],n=t[1],o=t[2],a=t[3],s=[e,n,e,a,o,a,o,n];return ze(s,0,8,2,r,s),s},i.prototype.isEmpty=function(){return Tr(this.executorsByZIndex_)},i.prototype.execute=function(r,t,e,n,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(Ke),this.maxExtent_&&(r.save(),this.clip(r,e));var u=a||Oi,h,f,c,p,d,v;for(s&&l.reverse(),h=0,f=l.length;h<f;++h){var g=l[h].toString();for(d=this.executorsByZIndex_[g],c=0,p=u.length;c<p;++c){var m=u[c];v=d[m],v!==void 0&&v.execute(r,t,e,n,o,s)}}this.maxExtent_&&r.restore()},i}(),wi={};function tf(i){if(wi[i]!==void 0)return wi[i];for(var r=i*2+1,t=i*i,e=new Array(t+1),n=0;n<=i;++n)for(var o=0;o<=i;++o){var a=n*n+o*o;if(a>t)break;var s=e[a];s||(s=[],e[a]=s),s.push(((i+n)*r+(i+o))*4+3),n>0&&s.push(((i-n)*r+(i+o))*4+3),o>0&&(s.push(((i+n)*r+(i-o))*4+3),n>0&&s.push(((i-n)*r+(i-o))*4+3))}for(var l=[],n=0,u=e.length;n<u;++n)e[n]&&l.push.apply(l,e[n]);return wi[i]=l,l}var Ia=Qc,Ct={ANIMATING:0,INTERACTING:1},ef=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rf=function(i){ef(r,i);function r(t,e,n,o,a,s,l){var u=i.call(this)||this;return u.context_=t,u.pixelRatio_=e,u.extent_=n,u.transform_=o,u.viewRotation_=a,u.squaredTolerance_=s,u.userTransform_=l,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=Kt(),u}return r.prototype.drawImages_=function(t,e,n,o){if(!!this.image_){var a=ze(t,e,n,o,this.transform_,this.pixelCoordinates_),s=this.context_,l=this.tmpLocalTransform_,u=s.globalAlpha;this.imageOpacity_!=1&&(s.globalAlpha=u*this.imageOpacity_);var h=this.imageRotation_;this.imageRotateWithView_&&(h+=this.viewRotation_);for(var f=0,c=a.length;f<c;f+=2){var p=a[f]-this.imageAnchorX_,d=a[f+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){var v=p+this.imageAnchorX_,g=d+this.imageAnchorY_;se(l,v,g,1,1,h,-v,-g),s.setTransform.apply(s,l),s.translate(v,g),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.setTransform(1,0,0,1,0,0)}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,p,d,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(s.globalAlpha=u)}},r.prototype.drawText_=function(t,e,n,o){if(!(!this.textState_||this.text_==="")){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var a=ze(t,e,n,o,this.transform_,this.pixelCoordinates_),s=this.context_,l=this.textRotation_;for(this.textRotateWithView_&&(l+=this.viewRotation_);e<n;e+=o){var u=a[e]+this.textOffsetX_,h=a[e+1]+this.textOffsetY_;if(l!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){var f=se(this.tmpLocalTransform_,u,h,1,1,l,-u,-h);s.setTransform.apply(s,f),s.translate(u,h),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&s.strokeText(this.text_,u,h),this.textFillState_&&s.fillText(this.text_,u,h)}}},r.prototype.moveToLineTo_=function(t,e,n,o,a){var s=this.context_,l=ze(t,e,n,o,this.transform_,this.pixelCoordinates_);s.moveTo(l[0],l[1]);var u=l.length;a&&(u-=2);for(var h=2;h<u;h+=2)s.lineTo(l[h],l[h+1]);return a&&s.closePath(),n},r.prototype.drawRings_=function(t,e,n,o){for(var a=0,s=n.length;a<s;++a)e=this.moveToLineTo_(t,e,n[a],o,!0);return e},r.prototype.drawCircle=function(t){if(!!Rt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=ih(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],o=e[3]-e[1],a=Math.sqrt(n*n+o*o),s=this.context_;s.beginPath(),s.arc(e[0],e[1],a,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}},r.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},r.prototype.setTransform=function(t){this.transform_=t},r.prototype.drawGeometry=function(t){var e=t.getType();switch(e){case P.POINT:this.drawPoint(t);break;case P.LINE_STRING:this.drawLineString(t);break;case P.POLYGON:this.drawPolygon(t);break;case P.MULTI_POINT:this.drawMultiPoint(t);break;case P.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case P.MULTI_POLYGON:this.drawMultiPolygon(t);break;case P.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case P.CIRCLE:this.drawCircle(t);break}},r.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);!n||!Rt(this.extent_,n.getExtent())||(this.setStyle(e),this.drawGeometry(n))},r.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,o=e.length;n<o;++n)this.drawGeometry(e[n])},r.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)},r.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)},r.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Rt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},r.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(!!Rt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,o=t.getFlatCoordinates(),a=0,s=t.getEnds(),l=t.getStride();n.beginPath();for(var u=0,h=s.length;u<h;++u)a=this.moveToLineTo_(o,a,s[u],l,!1);n.stroke()}if(this.text_!==""){var f=t.getFlatMidpoints();this.drawText_(f,0,f.length,2)}}},r.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Rt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},r.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Rt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),o=0,a=t.getEndss(),s=t.getStride();e.beginPath();for(var l=0,u=a.length;l<u;++l){var h=a[l];o=this.drawRings_(n,o,h,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){var f=t.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}}},r.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},r.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(qe(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},r.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,o=t.textAlign?t.textAlign:Jr;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=o&&(n.textAlign=o,e.textAlign=o),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},r.prototype.setFillStrokeStyle=function(t,e){var n=this;if(!t)this.fillState_=null;else{var o=t.getColor();this.fillState_={fillStyle:zt(o||ae)}}if(!e)this.strokeState_=null;else{var a=e.getColor(),s=e.getLineCap(),l=e.getLineDash(),u=e.getLineDashOffset(),h=e.getLineJoin(),f=e.getWidth(),c=e.getMiterLimit(),p=l||Vr;this.strokeState_={lineCap:s!==void 0?s:zn,lineDash:this.pixelRatio_===1?p:p.map(function(d){return d*n.pixelRatio_}),lineDashOffset:(u||Hr)*this.pixelRatio_,lineJoin:h!==void 0?h:Cr,lineWidth:(f!==void 0?f:Qr)*this.pixelRatio_,miterLimit:c!==void 0?c:$r,strokeStyle:zt(a||qr)}}},r.prototype.setImageStyle=function(t){var e;if(!t||!(e=t.getSize())){this.image_=null;return}var n=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_},r.prototype.setTextStyle=function(t){if(!t)this.text_="";else{var e=t.getFill();if(!e)this.textFillState_=null;else{var n=e.getColor();this.textFillState_={fillStyle:zt(n||ae)}}var o=t.getStroke();if(!o)this.textStrokeState_=null;else{var a=o.getColor(),s=o.getLineCap(),l=o.getLineDash(),u=o.getLineDashOffset(),h=o.getLineJoin(),f=o.getWidth(),c=o.getMiterLimit();this.textStrokeState_={lineCap:s!==void 0?s:zn,lineDash:l||Vr,lineDashOffset:u||Hr,lineJoin:h!==void 0?h:Cr,lineWidth:f!==void 0?f:Qr,miterLimit:c!==void 0?c:$r,strokeStyle:zt(a||qr)}}var p=t.getFont(),d=t.getOffsetX(),v=t.getOffsetY(),g=t.getRotateWithView(),m=t.getRotation(),_=t.getScaleArray(),y=t.getText(),E=t.getTextAlign(),T=t.getTextBaseline();this.textState_={font:p!==void 0?p:Xs,textAlign:E!==void 0?E:Jr,textBaseline:T!==void 0?T:Kn},this.text_=y!==void 0?Array.isArray(y)?y.reduce(function(x,w,O){return x+=O%2?" ":w},""):y:"",this.textOffsetX_=d!==void 0?this.pixelRatio_*d:0,this.textOffsetY_=v!==void 0?this.pixelRatio_*v:0,this.textRotateWithView_=g!==void 0?g:!1,this.textRotation_=m!==void 0?m:0,this.textScale_=[this.pixelRatio_*_[0],this.pixelRatio_*_[1]]}},r}(Ks),nf=rf,ye={FRACTION:"fraction",PIXELS:"pixels"},Dt={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},of=function(){function i(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return i.prototype.clear=function(){this.cache_={},this.cacheSize_=0},i.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},i.prototype.expire=function(){if(this.canExpireCache()){var r=0;for(var t in this.cache_){var e=this.cache_[t];(r++&3)===0&&!e.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},i.prototype.get=function(r,t,e){var n=Aa(r,t,e);return n in this.cache_?this.cache_[n]:null},i.prototype.set=function(r,t,e,n){var o=Aa(r,t,e);this.cache_[o]=n,++this.cacheSize_},i.prototype.setSize=function(r){this.maxCacheSize_=r,this.expire()},i}();function Aa(i,r,t){var e=t?Ds(t):"null";return r+":"+i+":"+e}var qn=new of,af=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sf=function(i){af(r,i);function r(t,e,n,o){var a=i.call(this)||this;return a.extent=t,a.pixelRatio_=n,a.resolution=e,a.state=o,a}return r.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return F()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){F()},r}(xr),lf=sf,uf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();(function(i){uf(r,i);function r(t,e,n,o,a,s){var l=i.call(this,t,e,n,tt.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=tt.IDLE,l.imageLoadFunction_=s,l}return r.prototype.getImage=function(){return this.image_},r.prototype.handleImageError_=function(){this.state=tt.ERROR,this.unlistenImage_(),this.changed()},r.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ut(this.extent)/this.image_.height),this.state=tt.LOADED,this.unlistenImage_(),this.changed()},r.prototype.load=function(){(this.state==tt.IDLE||this.state==tt.ERROR)&&(this.state=tt.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},r.prototype.setImage=function(t){this.image_=t,this.resolution=Ut(this.extent)/this.image_.height},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r})(lf);function Eo(i,r,t){var e=i,n=!0,o=!1,a=!1,s=[kn(e,G.LOAD,function(){a=!0,o||r()})];return e.src&&gu?(o=!0,e.decode().then(function(){n&&r()}).catch(function(l){n&&(a?r():t())})):s.push(kn(e,G.ERROR,t)),function(){n=!1,s.forEach(J)}}var hf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),br=null,cf=function(i){hf(r,i);function r(t,e,n,o,a,s){var l=i.call(this)||this;return l.hitDetectionImage_=null,l.image_=t||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=a,l.size_=n,l.src_=e,l.tainted_,l}return r.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===tt.LOADED){br||(br=kt(1,1)),br.drawImage(this.image_,0,0);try{br.getImageData(0,0,1,1),this.tainted_=!1}catch{br=null,this.tainted_=!0}}return this.tainted_===!0},r.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(G.CHANGE)},r.prototype.handleImageError_=function(){this.imageState_=tt.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},r.prototype.handleImageLoad_=function(){this.imageState_=tt.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},r.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},r.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},r.prototype.getImageState=function(){return this.imageState_},r.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=kt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},r.prototype.getSize=function(){return this.size_},r.prototype.getSrc=function(){return this.src_},r.prototype.load=function(){if(this.imageState_==tt.IDLE){this.imageState_=tt.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},r.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==tt.LOADED)){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply",n.globalCompositeOperation==="multiply"||this.isTainted_())n.fillStyle=Ds(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var o=n.getImageData(0,0,e.width,e.height),a=o.data,s=this.color_[0]/255,l=this.color_[1]/255,u=this.color_[2]/255,h=this.color_[3],f=0,c=a.length;f<c;f+=4)a[f]*=s,a[f+1]*=l,a[f+2]*=u,a[f+3]*=h;n.putImageData(o,0,0)}}},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r}(xr);function ff(i,r,t,e,n,o){var a=qn.get(r,e,o);return a||(a=new cf(i,r,t,e,n,o),qn.set(r,e,o,a)),a}var pf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),df=function(i){pf(r,i);function r(t){var e=this,n=t||{},o=n.opacity!==void 0?n.opacity:1,a=n.rotation!==void 0?n.rotation:0,s=n.scale!==void 0?n.scale:1,l=n.rotateWithView!==void 0?n.rotateWithView:!1;e=i.call(this,{opacity:o,rotation:a,scale:s,displacement:n.displacement!==void 0?n.displacement:[0,0],rotateWithView:l})||this,e.anchor_=n.anchor!==void 0?n.anchor:[.5,.5],e.normalizedAnchor_=null,e.anchorOrigin_=n.anchorOrigin!==void 0?n.anchorOrigin:Dt.TOP_LEFT,e.anchorXUnits_=n.anchorXUnits!==void 0?n.anchorXUnits:ye.FRACTION,e.anchorYUnits_=n.anchorYUnits!==void 0?n.anchorYUnits:ye.FRACTION,e.crossOrigin_=n.crossOrigin!==void 0?n.crossOrigin:null;var u=n.img!==void 0?n.img:null;e.imgSize_=n.imgSize;var h=n.src;B(!(h!==void 0&&u),4),B(!u||u&&e.imgSize_,5),(h===void 0||h.length===0)&&u&&(h=u.src||H(u)),B(h!==void 0&&h.length>0,6);var f=n.src!==void 0?tt.IDLE:tt.LOADED;return e.color_=n.color!==void 0?Wn(n.color):null,e.iconImage_=ff(u,h,e.imgSize_!==void 0?e.imgSize_:null,e.crossOrigin_,f,e.color_),e.offset_=n.offset!==void 0?n.offset:[0,0],e.offsetOrigin_=n.offsetOrigin!==void 0?n.offsetOrigin:Dt.TOP_LEFT,e.origin_=null,e.size_=n.size!==void 0?n.size:null,e}return r.prototype.clone=function(){var t=this.getScale();return new r({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})},r.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==ye.FRACTION||this.anchorYUnits_==ye.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ye.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==ye.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Dt.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==Dt.TOP_RIGHT||this.anchorOrigin_==Dt.BOTTOM_RIGHT)&&(t[0]=-t[0]+e[0]),(this.anchorOrigin_==Dt.BOTTOM_LEFT||this.anchorOrigin_==Dt.BOTTOM_RIGHT)&&(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},r.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},r.prototype.getColor=function(){return this.color_},r.prototype.getImage=function(t){return this.iconImage_.getImage(t)},r.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},r.prototype.getImageSize=function(){return this.iconImage_.getSize()},r.prototype.getImageState=function(){return this.iconImage_.getImageState()},r.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},r.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Dt.TOP_LEFT){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_==Dt.TOP_RIGHT||this.offsetOrigin_==Dt.BOTTOM_RIGHT)&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_==Dt.BOTTOM_LEFT||this.offsetOrigin_==Dt.BOTTOM_RIGHT)&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},r.prototype.getSrc=function(){return this.iconImage_.getSrc()},r.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},r.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(G.CHANGE,t)},r.prototype.load=function(){this.iconImage_.load()},r.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(G.CHANGE,t)},r}(Ns),Gn=df,Zt=.5;function vf(i,r,t,e,n,o,a){var s=i[0]*Zt,l=i[1]*Zt,u=kt(s,l);u.imageSmoothingEnabled=!1;for(var h=u.canvas,f=new nf(u,Zt,n,null,a),c=t.length,p=Math.floor((256*256*256-1)/c),d={},v=1;v<=c;++v){var g=t[v-1],m=g.getStyleFunction()||e;if(!!e){var _=m(g,o);if(!!_){Array.isArray(_)||(_=[_]);for(var y=v*p,E="#"+("000000"+y.toString(16)).slice(-6),T=0,x=_.length;T<x;++T){var w=_[T],O=w.getGeometryFunction()(g);if(!(!O||!Rt(n,O.getExtent()))){var R=w.clone(),M=R.getFill();M&&M.setColor(E);var b=R.getStroke();b&&(b.setColor(E),b.setLineDash(null)),R.setText(void 0);var I=w.getImage();if(I&&I.getOpacity()!==0){var j=I.getImageSize();if(!j)continue;var U=kt(j[0],j[1],void 0,{alpha:!1}),A=U.canvas;U.fillStyle=E,U.fillRect(0,0,A.width,A.height),R.setImage(new Gn({img:A,imgSize:j,anchor:I.getAnchor(),anchorXUnits:ye.PIXELS,anchorYUnits:ye.PIXELS,offset:I.getOrigin(),opacity:1,size:I.getSize(),scale:I.getScale(),rotation:I.getRotation(),rotateWithView:I.getRotateWithView()}))}var k=R.getZIndex()||0,L=d[k];L||(L={},d[k]=L,L[P.POLYGON]=[],L[P.CIRCLE]=[],L[P.LINE_STRING]=[],L[P.POINT]=[]),L[O.getType().replace("Multi","")].push(O,R)}}}}}for(var z=Object.keys(d).map(Number).sort(Ke),v=0,Z=z.length;v<Z;++v){var L=d[z[v]];for(var V in L)for(var Q=L[V],T=0,x=Q.length;T<x;T+=2){f.setStyle(Q[T+1]);for(var C=0,lt=r.length;C<lt;++C)f.setTransform(r[C]),f.drawGeometry(Q[T])}}return u.getImageData(0,0,h.width,h.height)}function gf(i,r,t){var e=[];if(t){var n=Math.floor(Math.round(i[0])*Zt),o=Math.floor(Math.round(i[1])*Zt),a=(ot(n,0,t.width-1)+ot(o,0,t.height-1)*t.width)*4,s=t.data[a],l=t.data[a+1],u=t.data[a+2],h=u+256*(l+256*s),f=Math.floor((256*256*256-1)/r.length);h&&h%f===0&&e.push(r[h/f-1])}return e}var _f=.5,$s={Point:Sf,LineString:xf,Polygon:Pf,MultiPoint:Rf,MultiLineString:Of,MultiPolygon:wf,GeometryCollection:Cf,Circle:Ef};function yf(i,r){return parseInt(H(i),10)-parseInt(H(r),10)}function mf(i,r){var t=$i(i,r);return t*t}function $i(i,r){return _f*i/r}function Ef(i,r,t,e,n){var o=t.getFill(),a=t.getStroke();if(o||a){var s=i.getBuilder(t.getZIndex(),nt.CIRCLE);s.setFillStrokeStyle(o,a),s.drawCircle(r,e)}var l=t.getText();if(l&&l.getText()){var u=(n||i).getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(l),u.drawText(r,e)}}function Ma(i,r,t,e,n,o,a){var s=!1,l=t.getImage();if(l){var u=l.getImageState();u==tt.LOADED||u==tt.ERROR?l.unlistenImageChange(n):(u==tt.IDLE&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return Tf(i,r,t,e,o,a),s}function Tf(i,r,t,e,n,o){var a=t.getGeometryFunction()(r);if(!!a){var s=a.simplifyTransformed(e,n),l=t.getRenderer();if(l)qs(i,s,t,r);else{var u=$s[s.getType()];u(i,s,t,r,o)}}}function qs(i,r,t,e){if(r.getType()==P.GEOMETRY_COLLECTION){for(var n=r.getGeometries(),o=0,a=n.length;o<a;++o)qs(i,n[o],t,e);return}var s=i.getBuilder(t.getZIndex(),nt.DEFAULT);s.drawCustom(r,e,t.getRenderer(),t.getHitDetectionRenderer())}function Cf(i,r,t,e,n){var o=r.getGeometriesArray(),a,s;for(a=0,s=o.length;a<s;++a){var l=$s[o[a].getType()];l(i,o[a],t,e,n)}}function xf(i,r,t,e,n){var o=t.getStroke();if(o){var a=i.getBuilder(t.getZIndex(),nt.LINE_STRING);a.setFillStrokeStyle(null,o),a.drawLineString(r,e)}var s=t.getText();if(s&&s.getText()){var l=(n||i).getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(s),l.drawText(r,e)}}function Of(i,r,t,e,n){var o=t.getStroke();if(o){var a=i.getBuilder(t.getZIndex(),nt.LINE_STRING);a.setFillStrokeStyle(null,o),a.drawMultiLineString(r,e)}var s=t.getText();if(s&&s.getText()){var l=(n||i).getBuilder(t.getZIndex(),nt.TEXT);l.setTextStyle(s),l.drawText(r,e)}}function wf(i,r,t,e,n){var o=t.getFill(),a=t.getStroke();if(a||o){var s=i.getBuilder(t.getZIndex(),nt.POLYGON);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(r,e)}var l=t.getText();if(l&&l.getText()){var u=(n||i).getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(l),u.drawText(r,e)}}function Sf(i,r,t,e,n){var o=t.getImage(),a=t.getText(),s;if(n&&(i=n,s=o&&a&&a.getText()?{}:void 0),o){if(o.getImageState()!=tt.LOADED)return;var l=i.getBuilder(t.getZIndex(),nt.IMAGE);l.setImageStyle(o,s),l.drawPoint(r,e)}if(a&&a.getText()){var u=i.getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(a,s),u.drawText(r,e)}}function Rf(i,r,t,e,n){var o=t.getImage(),a=t.getText(),s;if(n&&(i=n,s=o&&a&&a.getText()?{}:void 0),o){if(o.getImageState()!=tt.LOADED)return;var l=i.getBuilder(t.getZIndex(),nt.IMAGE);l.setImageStyle(o,s),l.drawMultiPoint(r,e)}if(a&&a.getText()){var u=(n||i).getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(a,s),u.drawText(r,e)}}function Pf(i,r,t,e,n){var o=t.getFill(),a=t.getStroke();if(o||a){var s=i.getBuilder(t.getZIndex(),nt.POLYGON);s.setFillStrokeStyle(o,a),s.drawPolygon(r,e)}var l=t.getText();if(l&&l.getText()){var u=(n||i).getBuilder(t.getZIndex(),nt.TEXT);u.setTextStyle(l),u.drawText(r,e)}}var Lf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),If=function(i){Lf(r,i);function r(t){var e=i.call(this,t)||this;return e.boundHandleStyleImageChange_=e.handleStyleImageChange_.bind(e),e.animatingOrInteracting_,e.dirty_=!1,e.hitDetectionImageData_=null,e.renderedFeatures_=null,e.renderedRevision_=-1,e.renderedResolution_=NaN,e.renderedExtent_=Pt(),e.wrappedRenderedExtent_=Pt(),e.renderedRotation_,e.renderedCenter_=null,e.renderedProjection_=null,e.renderedRenderOrder_=null,e.replayGroup_=null,e.replayGroupChanged=!0,e.declutterExecutorGroup=null,e.clipping=!0,e}return r.prototype.renderWorlds=function(t,e,n){var o=e.extent,a=e.viewState,s=a.center,l=a.resolution,u=a.projection,h=a.rotation,f=u.getExtent(),c=this.getLayer().getSource(),p=e.pixelRatio,d=e.viewHints,v=!(d[Ct.ANIMATING]||d[Ct.INTERACTING]),g=this.context,m=Math.round(e.size[0]*p),_=Math.round(e.size[1]*p),y=c.getWrapX()&&u.canWrapX(),E=y?it(f):null,T=y?Math.ceil((o[2]-f[2])/E)+1:1,x=y?Math.floor((o[0]-f[0])/E):0;do{var w=this.getRenderTransform(s,l,h,p,m,_,x*E);t.execute(g,1,w,h,v,void 0,n)}while(++x<T)},r.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},r.prototype.renderFrame=function(t,e){var n=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];mu(this.pixelTransform,1/n,1/n),no(this.inversePixelTransform,this.pixelTransform);var a=as(this.pixelTransform);this.useContainer(e,a,o.opacity,this.getBackground(t));var s=this.context,l=s.canvas,u=this.replayGroup_,h=this.declutterExecutorGroup;if((!u||u.isEmpty())&&(!h||h.isEmpty()))return null;var f=Math.round(t.size[0]*n),c=Math.round(t.size[1]*n);l.width!=f||l.height!=c?(l.width=f,l.height=c,l.style.transform!==a&&(l.style.transform=a)):this.containerReused||s.clearRect(0,0,f,c),this.preRender(s,t);var p=t.viewState;p.projection;var d=!1,v=!0;if(o.extent&&this.clipping){var g=Xe(o.extent);v=Rt(g,t.extent),d=v&&!je(g,t.extent),d&&this.clipUnrotated(s,t,g)}v&&this.renderWorlds(u,t),d&&s.restore(),this.postRender(s,t);var m=js(o.opacity),_=this.container;return m!==_.style.opacity&&(_.style.opacity=m),this.renderedRotation_!==p.rotation&&(this.renderedRotation_=p.rotation,this.hitDetectionImageData_=null),this.container},r.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];st(this.pixelTransform,n);var o=this.renderedCenter_,a=this.renderedResolution_,s=this.renderedRotation_,l=this.renderedProjection_,u=this.wrappedRenderedExtent_,h=this.getLayer(),f=[],c=n[0]*Zt,p=n[1]*Zt;f.push(this.getRenderTransform(o,a,s,Zt,c,p,0).slice());var d=h.getSource(),v=l.getExtent();if(d.getWrapX()&&l.canWrapX()&&!je(v,u)){for(var g=u[0],m=it(v),_=0,y=void 0;g<v[0];)--_,y=m*_,f.push(this.getRenderTransform(o,a,s,Zt,c,p,y).slice()),g+=m;for(_=0,g=u[2];g>v[2];)++_,y=m*_,f.push(this.getRenderTransform(o,a,s,Zt,c,p,y).slice()),g-=m}this.hitDetectionImageData_=vf(n,f,this.renderedFeatures_,h.getStyleFunction(),u,a,s)}e(gf(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a){var s=this;if(!!this.replayGroup_){var l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),f={},c=function(v,g,m){var _=H(v),y=f[_];if(y){if(y!==!0&&m<y.distanceSq){if(m===0)return f[_]=!0,a.splice(a.lastIndexOf(y),1),o(v,h,g);y.geometry=g,y.distanceSq=m}}else{if(m===0)return f[_]=!0,o(v,h,g);a.push(f[_]={feature:v,layer:h,geometry:g,distanceSq:m,callback:o})}},p,d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some(function(v){return p=v.forEachFeatureAtCoordinate(t,l,u,n,c,v===s.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(function(g){return g.value}):null)}),p}},r.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},r.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},r.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var o=t.viewHints[Ct.ANIMATING],a=t.viewHints[Ct.INTERACTING],s=e.getUpdateWhileAnimating(),l=e.getUpdateWhileInteracting();if(!this.dirty_&&!s&&o||!l&&a)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var u=t.extent,h=t.viewState,f=h.projection,c=h.resolution,p=t.pixelRatio,d=e.getRevision(),v=e.getRenderBuffer(),g=e.getRenderOrder();g===void 0&&(g=yf);var m=h.center.slice(),_=ii(u,v*c),y=_.slice(),E=[_.slice()],T=f.getExtent();if(n.getWrapX()&&f.canWrapX()&&!je(T,t.extent)){var x=it(T),w=Math.max(it(_)/2,x);_[0]=T[0]-w,_[2]=T[2]+w,gs(m,f);var O=wu(E[0],f);O[0]<T[0]&&O[2]<T[2]?E.push([O[0]+x,O[1],O[2]+x,O[3]]):O[0]>T[0]&&O[2]>T[2]&&E.push([O[0]-x,O[1],O[2]-x,O[3]])}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&je(this.wrappedRenderedExtent_,_))return qe(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var R=new Ra($i(c,p),_,c,p),M;this.getLayer().getDeclutter()&&(M=new Ra($i(c,p),_,c,p));for(var b,I,j,I=0,j=E.length;I<j;++I)n.loadFeatures(E[I],c,f);var U=mf(c,p),A=function(V){var Q,C=V.getStyleFunction()||e.getStyleFunction();if(C&&(Q=C(V,c)),Q){var lt=this.renderFeature(V,U,Q,R,b,M);this.dirty_=this.dirty_||lt}}.bind(this),k=Es(_),L=n.getFeaturesInExtent(k);g&&L.sort(g);for(var I=0,j=L.length;I<j;++I)A(L[I]);this.renderedFeatures_=L;var z=R.finish(),Z=new Ia(_,c,p,n.getOverlaps(),z,e.getRenderBuffer());return M&&(this.declutterExecutorGroup=new Ia(_,c,p,n.getOverlaps(),M.finish(),e.getRenderBuffer())),this.renderedResolution_=c,this.renderedRevision_=d,this.renderedRenderOrder_=g,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=m,this.renderedProjection_=f,this.replayGroup_=Z,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},r.prototype.renderFeature=function(t,e,n,o,a,s){if(!n)return!1;var l=!1;if(Array.isArray(n))for(var u=0,h=n.length;u<h;++u)l=Ma(o,t,n[u],e,this.boundHandleStyleImageChange_,a,s)||l;else l=Ma(o,t,n,e,this.boundHandleStyleImageChange_,a,s);return l},r}(Hs),Af=If,Mf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ff=function(i){Mf(r,i);function r(t){return i.call(this,t)||this}return r.prototype.createRenderer=function(){return new Af(this)},r}(Cc),hr=Ff,Nf=function(){function i(r){this.rbush_=new zs(r),this.items_={}}return i.prototype.insert=function(r,t){var e={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:t};this.rbush_.insert(e),this.items_[H(t)]=e},i.prototype.load=function(r,t){for(var e=new Array(t.length),n=0,o=t.length;n<o;n++){var a=r[n],s=t[n],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};e[n]=l,this.items_[H(s)]=l}this.rbush_.load(e)},i.prototype.remove=function(r){var t=H(r),e=this.items_[t];return delete this.items_[t],this.rbush_.remove(e)!==null},i.prototype.update=function(r,t){var e=this.items_[H(t)],n=[e.minX,e.minY,e.maxX,e.maxY];zr(n,r)||(this.remove(t),this.insert(r,t))},i.prototype.getAll=function(){var r=this.rbush_.all();return r.map(function(t){return t.value})},i.prototype.getInExtent=function(r){var t={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]},e=this.rbush_.search(t);return e.map(function(n){return n.value})},i.prototype.forEach=function(r){return this.forEach_(this.getAll(),r)},i.prototype.forEachInExtent=function(r,t){return this.forEach_(this.getInExtent(r),t)},i.prototype.forEach_=function(r,t){for(var e,n=0,o=r.length;n<o;n++)if(e=t(r[n]),e)return e;return e},i.prototype.isEmpty=function(){return Tr(this.items_)},i.prototype.clear=function(){this.rbush_.clear(),this.items_={}},i.prototype.getExtent=function(r){var t=this.rbush_.toJSON();return le(t.minX,t.minY,t.maxX,t.maxY,r)},i.prototype.concat=function(r){this.rbush_.load(r.rbush_.all());for(var t in r.items_)this.items_[t]=r.items_[t]},i}(),Fa=Nf,Df=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Gf=function(i){Df(r,i);function r(t){var e=i.call(this)||this;e.projection=at(t.projection),e.attributions_=Na(t.attributions),e.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,e.loading=!1,e.state_=t.state!==void 0?t.state:$e.READY,e.wrapX_=t.wrapX!==void 0?t.wrapX:!1,e.interpolate_=!!t.interpolate,e.viewResolver=null,e.viewRejector=null;var n=e;return e.viewPromise_=new Promise(function(o,a){n.viewResolver=o,n.viewRejector=a}),e}return r.prototype.getAttributions=function(){return this.attributions_},r.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},r.prototype.getProjection=function(){return this.projection},r.prototype.getResolutions=function(){return F()},r.prototype.getView=function(){return this.viewPromise_},r.prototype.getState=function(){return this.state_},r.prototype.getWrapX=function(){return this.wrapX_},r.prototype.getInterpolate=function(){return this.interpolate_},r.prototype.refresh=function(){this.changed()},r.prototype.setAttributions=function(t){this.attributions_=Na(t),this.changed()},r.prototype.setState=function(t){this.state_=t,this.changed()},r}(bt);function Na(i){return i?Array.isArray(i)?function(r){return i}:typeof i=="function"?i:function(r){return[i]}:null}var Js=Gf,jt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function kf(i,r){return[[-1/0,-1/0,1/0,1/0]]}var be={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"},bf=!1;function jf(i,r,t,e,n,o,a){var s=new XMLHttpRequest;s.open("GET",typeof i=="function"?i(t,e,n):i,!0),r.getType()==be.ARRAY_BUFFER&&(s.responseType="arraybuffer"),s.withCredentials=bf,s.onload=function(l){if(!s.status||s.status>=200&&s.status<300){var u=r.getType(),h=void 0;u==be.JSON||u==be.TEXT?h=s.responseText:u==be.XML?(h=s.responseXML,h||(h=new DOMParser().parseFromString(s.responseText,"application/xml"))):u==be.ARRAY_BUFFER&&(h=s.response),h?o(r.readFeatures(h,{extent:t,featureProjection:n}),r.readProjection(h)):a()}else a()},s.onerror=a,s.send()}function Da(i,r){return function(t,e,n,o,a){var s=this;jf(i,r,t,e,n,function(l,u){s.addFeatures(l),o!==void 0&&o(l)},a||Ve)}}var Qs=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),de=function(i){Qs(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.feature=e,o.features=n,o}return r}(Ht),Xf=function(i){Qs(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:$e.READY,wrapX:n.wrapX!==void 0?n.wrapX:!0})||this,e.on,e.once,e.un,e.loader_=Ve,e.format_=n.format,e.overlaps_=n.overlaps===void 0?!0:n.overlaps,e.url_=n.url,n.loader!==void 0?e.loader_=n.loader:e.url_!==void 0&&(B(e.format_,7),e.loader_=Da(e.url_,e.format_)),e.strategy_=n.strategy!==void 0?n.strategy:kf;var o=n.useSpatialIndex!==void 0?n.useSpatialIndex:!0;e.featuresRtree_=o?new Fa:null,e.loadedExtentsRtree_=new Fa,e.loadingExtentsCount_=0,e.nullGeometryFeatures_={},e.idIndex_={},e.uidIndex_={},e.featureChangeKeys_={},e.featuresCollection_=null;var a,s;return Array.isArray(n.features)?s=n.features:n.features&&(a=n.features,s=a.getArray()),!o&&a===void 0&&(a=new Gt(s)),s!==void 0&&e.addFeaturesInternal(s),a!==void 0&&e.bindFeaturesCollection_(a),e}return r.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},r.prototype.addFeatureInternal=function(t){var e=H(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var o=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new de(jt.ADDFEATURE,t))},r.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[W(e,G.CHANGE,this.handleFeatureChange_,this),W(e,Er.PROPERTYCHANGE,this.handleFeatureChange_,this)]},r.prototype.addToIndex_=function(t,e){var n=!0,o=e.getId();return o!==void 0&&(o.toString()in this.idIndex_?n=!1:this.idIndex_[o.toString()]=e),n&&(B(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},r.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},r.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],o=[],a=0,s=t.length;a<s;a++){var l=t[a],u=H(l);this.addToIndex_(u,l)&&n.push(l)}for(var a=0,h=n.length;a<h;a++){var l=n[a],u=H(l);this.setupChangeEvents_(u,l);var f=l.getGeometry();if(f){var c=f.getExtent();e.push(c),o.push(l)}else this.nullGeometryFeatures_[u]=l}if(this.featuresRtree_&&this.featuresRtree_.load(e,o),this.hasListener(jt.ADDFEATURE))for(var a=0,p=n.length;a<p;a++)this.dispatchEvent(new de(jt.ADDFEATURE,n[a]))},r.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(jt.ADDFEATURE,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(jt.REMOVEFEATURE,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(St.ADD,function(n){e||(e=!0,this.addFeature(n.element),e=!1)}.bind(this)),t.addEventListener(St.REMOVE,function(n){e||(e=!0,this.removeFeature(n.element),e=!1)}.bind(this)),this.featuresCollection_=t},r.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){var n=this.featureChangeKeys_[e];n.forEach(J)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var o=function(l){this.removeFeatureInternal(l)}.bind(this);this.featuresRtree_.forEach(o);for(var a in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[a])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var s=new de(jt.CLEAR);this.dispatchEvent(s),this.changed()},r.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},r.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(o){var a=o.getGeometry();if(a.intersectsCoordinate(t))return e(o)})},r.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},r.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(n){var o=n.getGeometry();if(o.intersectsExtent(t)){var a=e(n);if(a)return a}})},r.prototype.getFeaturesCollection=function(){return this.featuresCollection_},r.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Tr(this.nullGeometryFeatures_)||Yt(t,Qa(this.nullGeometryFeatures_))),t},r.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e},r.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},r.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],o=t[1],a=null,s=[NaN,NaN],l=1/0,u=[-1/0,-1/0,1/0,1/0],h=e||_r;return this.featuresRtree_.forEachInExtent(u,function(f){if(h(f)){var c=f.getGeometry(),p=l;if(l=c.closestPointXY(n,o,s,l),l<p){a=f;var d=Math.sqrt(l);u[0]=n-d,u[1]=o-d,u[2]=n+d,u[3]=o+d}}}),a},r.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},r.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return e!==void 0?e:null},r.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return e!==void 0?e:null},r.prototype.getFormat=function(){return this.format_},r.prototype.getOverlaps=function(){return this.overlaps_},r.prototype.getUrl=function(){return this.url_},r.prototype.handleFeatureChange_=function(t){var e=t.target,n=H(e),o=e.getGeometry();if(!o)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);else{var a=o.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}var s=e.getId();if(s!==void 0){var l=s.toString();this.idIndex_[l]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[l]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new de(jt.CHANGEFEATURE,e))},r.prototype.hasFeature=function(t){var e=t.getId();return e!==void 0?e in this.idIndex_:H(t)in this.uidIndex_},r.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Tr(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0},r.prototype.loadFeatures=function(t,e,n){for(var o=this.loadedExtentsRtree_,a=this.strategy_(t,e,n),s=function(f,c){var p=a[f],d=o.forEachInExtent(p,function(v){return je(v.extent,p)});d||(++l.loadingExtentsCount_,l.dispatchEvent(new de(jt.FEATURESLOADSTART)),l.loader_.call(l,p,e,n,function(v){--this.loadingExtentsCount_,this.dispatchEvent(new de(jt.FEATURESLOADEND,void 0,v))}.bind(l),function(){--this.loadingExtentsCount_,this.dispatchEvent(new de(jt.FEATURESLOADERROR))}.bind(l)),o.insert(p,{extent:p.slice()}))},l=this,u=0,h=a.length;u<h;++u)s(u);this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0},r.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),i.prototype.refresh.call(this)},r.prototype.removeLoadedExtent=function(t){var e=this.loadedExtentsRtree_,n;e.forEachInExtent(t,function(o){if(zr(o.extent,t))return n=o,!0}),n&&e.remove(n)},r.prototype.removeFeature=function(t){if(!!t){var e=H(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);var n=this.removeFeatureInternal(t);n&&this.changed()}},r.prototype.removeFeatureInternal=function(t){var e=H(t),n=this.featureChangeKeys_[e];if(!!n){n.forEach(J),delete this.featureChangeKeys_[e];var o=t.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[e],this.dispatchEvent(new de(jt.REMOVEFEATURE,t)),t}},r.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},r.prototype.setLoader=function(t){this.loader_=t},r.prototype.setUrl=function(t){B(this.format_,7),this.url_=t,this.setLoader(Da(t,this.format_))},r}(Js),dr=Xf;function Ln(i,r){return st(i.inversePixelTransform,r.slice(0))}var D={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function tl(i){return Math.pow(i,3)}function er(i){return 1-tl(1-i)}function Yf(i){return 3*i*i-2*i*i*i}function Uf(i){return i}var Wf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Bf=function(i){Wf(r,i);function r(t,e,n){var o=i.call(this)||this,a=n||{};return o.tileCoord=t,o.state=e,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return r.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},r.prototype.release=function(){},r.prototype.getKey=function(){return this.key+"/"+this.tileCoord},r.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==D.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},r.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==D.LOADED){t.interimTile=null;break}else t.getState()==D.LOADING?e=t:t.getState()==D.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}},r.prototype.getTileCoord=function(){return this.tileCoord},r.prototype.getState=function(){return this.state},r.prototype.setState=function(t){if(this.state!==D.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},r.prototype.load=function(){F()},r.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;var o=e-n+1e3/60;return o>=this.transition_?1:tl(o/this.transition_)},r.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},r.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},r}(xr),el=Bf,Zf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),zf=function(i){Zf(r,i);function r(t,e,n,o,a,s){var l=i.call(this,t,e,s)||this;return l.crossOrigin_=o,l.src_=n,l.key=n,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=a,l}return r.prototype.getImage=function(){return this.image_},r.prototype.setImage=function(t){this.image_=t,this.state=D.LOADED,this.unlistenImage_(),this.changed()},r.prototype.handleImageError_=function(){this.state=D.ERROR,this.unlistenImage_(),this.image_=Kf(),this.changed()},r.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=D.LOADED:this.state=D.EMPTY,this.unlistenImage_(),this.changed()},r.prototype.load=function(){this.state==D.ERROR&&(this.state=D.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==D.IDLE&&(this.state=D.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r}(el);function Kf(){var i=kt(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}var rl=zf,Vf=function(){function i(r,t,e){this.decay_=r,this.minVelocity_=t,this.delay_=e,this.points_=[],this.angle_=0,this.initialVelocity_=0}return i.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},i.prototype.update=function(r,t){this.points_.push(r,t,Date.now())},i.prototype.end=function(){if(this.points_.length<6)return!1;var r=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<r)return!1;for(var e=t-3;e>0&&this.points_[e+2]>r;)e-=3;var n=this.points_[t+2]-this.points_[e+2];if(n<1e3/60)return!1;var o=this.points_[t]-this.points_[e],a=this.points_[t+1]-this.points_[e+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/n,this.initialVelocity_>this.minVelocity_},i.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},i.prototype.getAngle=function(){return this.angle_},i}(),Hf=Vf,$f=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),qf=function(i){$f(r,i);function r(t){var e=i.call(this)||this;return e.map_=t,e}return r.prototype.dispatchRenderEvent=function(t,e){F()},r.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;se(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),no(o,n)},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a,s,l,u){var h,f=e.viewState;function c(A,k,L,z){return a.call(s,k,A?L:null,z)}var p=f.projection,d=gs(t.slice(),p),v=[[0,0]];if(p.canWrapX()&&o){var g=p.getExtent(),m=it(g);v.push([-m,0],[m,0])}for(var _=e.layerStatesArray,y=_.length,E=[],T=[],x=0;x<v.length;x++)for(var w=y-1;w>=0;--w){var O=_[w],R=O.layer;if(R.hasRenderer()&&Hn(O,f)&&l.call(u,R)){var M=R.getRenderer(),b=R.getSource();if(M&&b){var I=b.getWrapX()?d:t,j=c.bind(null,O.managed);T[0]=I[0]+v[x][0],T[1]=I[1]+v[x][1],h=M.forEachFeatureAtCoordinate(T,e,n,j,E)}if(h)return h}}if(E.length!==0){var U=1/E.length;return E.forEach(function(A,k){return A.distanceSq+=k*U}),E.sort(function(A,k){return A.distanceSq-k.distanceSq}),E.some(function(A){return h=A.callback(A.feature,A.layer,A.geometry)}),h}},r.prototype.forEachLayerAtPixel=function(t,e,n,o,a){return F()},r.prototype.hasFeatureAtCoordinate=function(t,e,n,o,a,s){var l=this.forEachFeatureAtCoordinate(t,e,n,o,_r,this,a,s);return l!==void 0},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(t){F()},r.prototype.scheduleExpireIconCache=function(t){qn.canExpireCache()&&t.postRenderFunctions.push(Jf)},r}(eo);function Jf(i,r){qn.expire()}var Qf=qf,tp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ep=function(i){tp(r,i);function r(t){var e=i.call(this,t)||this;e.fontChangeListenerKey_=W(ee,Er.PROPERTYCHANGE,t.redrawText.bind(t)),e.element_=document.createElement("div");var n=e.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",e.element_.className=He+" ol-layers";var o=t.getViewport();return o.insertBefore(e.element_,o.firstChild||null),e.children_=[],e.renderedVisible_=!0,e}return r.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var o=new Vs(t,void 0,e);n.dispatchEvent(o)}},r.prototype.disposeInternal=function(){J(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),i.prototype.disposeInternal.call(this)},r.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(we.PRECOMPOSE,t);var e=t.layerStatesArray.sort(function(p,d){return p.zIndex-d.zIndex}),n=t.viewState;this.children_.length=0;for(var o=[],a=null,s=0,l=e.length;s<l;++s){var u=e[s];t.layerIndex=s;var h=u.layer,f=h.getSourceState();if(!Hn(u,n)||f!=$e.READY&&f!=$e.UNDEFINED){h.unrender();continue}var c=h.render(t,a);!c||(c!==a&&(this.children_.push(c),a=c),"getDeclutter"in h&&o.push(h))}for(var s=o.length-1;s>=0;--s)o[s].renderDeclutter(t);Bh(this.element_,this.children_),this.dispatchRenderEvent(we.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},r.prototype.forEachLayerAtPixel=function(t,e,n,o,a){for(var s=e.viewState,l=e.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var f=l[h],c=f.layer;if(c.hasRenderer()&&Hn(f,s)&&a(c)){var p=c.getRenderer(),d=p.getDataAtPixel(t,e,n);if(d){var v=o(c,d);if(v)return v}}}},r}(Qf),rp=ep,nl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),me=function(i){nl(r,i);function r(t,e){var n=i.call(this,t)||this;return n.layer=e,n}return r}(Ht),Si={LAYERS:"layers"},np=function(i){nl(r,i);function r(t){var e=this,n=t||{},o=ut({},n);delete o.layers;var a=n.layers;return e=i.call(this,o)||this,e.on,e.once,e.un,e.layersListenerKeys_=[],e.listenerKeys_={},e.addChangeListener(Si.LAYERS,e.handleLayersChanged_),a?Array.isArray(a)?a=new Gt(a.slice(),{unique:!0}):B(typeof a.getArray=="function",43):a=new Gt(void 0,{unique:!0}),e.setLayers(a),e}return r.prototype.handleLayerChange_=function(){this.changed()},r.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(J),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(W(t,St.ADD,this.handleLayersAdd_,this),W(t,St.REMOVE,this.handleLayersRemove_,this));for(var e in this.listenerKeys_)this.listenerKeys_[e].forEach(J);tn(this.listenerKeys_);for(var n=t.getArray(),o=0,a=n.length;o<a;o++){var s=n[o];this.registerLayerListeners_(s),this.dispatchEvent(new me("addlayer",s))}this.changed()},r.prototype.registerLayerListeners_=function(t){var e=[W(t,Er.PROPERTYCHANGE,this.handleLayerChange_,this),W(t,G.CHANGE,this.handleLayerChange_,this)];t instanceof r&&e.push(W(t,"addlayer",this.handleLayerGroupAdd_,this),W(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[H(t)]=e},r.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new me("addlayer",t.layer))},r.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new me("removelayer",t.layer))},r.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new me("addlayer",e)),this.changed()},r.prototype.handleLayersRemove_=function(t){var e=t.element,n=H(e);this.listenerKeys_[n].forEach(J),delete this.listenerKeys_[n],this.dispatchEvent(new me("removelayer",e)),this.changed()},r.prototype.getLayers=function(){return this.get(Si.LAYERS)},r.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var n=e.getArray(),o=0,a=n.length;o<a;++o)this.dispatchEvent(new me("removelayer",n[o]));this.set(Si.LAYERS,t)},r.prototype.getLayersArray=function(t){var e=t!==void 0?t:[];return this.getLayers().forEach(function(n){n.getLayersArray(e)}),e},r.prototype.getLayerStatesArray=function(t){var e=t!==void 0?t:[],n=e.length;this.getLayers().forEach(function(h){h.getLayerStatesArray(e)});var o=this.getLayerState(),a=o.zIndex;!t&&o.zIndex===void 0&&(a=0);for(var s=n,l=e.length;s<l;s++){var u=e[s];u.opacity*=o.opacity,u.visible=u.visible&&o.visible,u.maxResolution=Math.min(u.maxResolution,o.maxResolution),u.minResolution=Math.max(u.minResolution,o.minResolution),u.minZoom=Math.max(u.minZoom,o.minZoom),u.maxZoom=Math.min(u.maxZoom,o.maxZoom),o.extent!==void 0&&(u.extent!==void 0?u.extent=Zr(u.extent,o.extent):u.extent=o.extent),u.zIndex===void 0&&(u.zIndex=a)}return e},r.prototype.getSourceState=function(){return $e.READY},r}(Bs),fi=np,ip=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),op=function(i){ip(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.map=e,o.frameState=n!==void 0?n:null,o}return r}(Ht),vr=op,ap=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sp=function(i){ap(r,i);function r(t,e,n,o,a){var s=i.call(this,t,e,a)||this;return s.originalEvent=n,s.pixel_=null,s.coordinate_=null,s.dragging=o!==void 0?o:!1,s}return Object.defineProperty(r.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),r.prototype.preventDefault=function(){i.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){i.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},r}(vr),_e=sp,et={SINGLECLICK:"singleclick",CLICK:G.CLICK,DBLCLICK:G.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ee={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},lp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),up=function(i){lp(r,i);function r(t,e){var n=i.call(this,t)||this;n.map_=t,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=e===void 0?1:e,n.down_=null;var o=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=o,n.pointerdownListenerKey_=W(o,Ee.POINTERDOWN,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=W(o,Ee.POINTERMOVE,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(G.TOUCHMOVE,n.boundHandleTouchMove_,os?{passive:!1}:!1),n}return r.prototype.emulateClick_=function(t){var e=new _e(et.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new _e(et.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var n=new _e(et.SINGLECLICK,this.map_,t);this.dispatchEvent(n)}.bind(this),250)},r.prototype.updateActivePointers_=function(t){var e=t;e.type==et.POINTERUP||e.type==et.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==et.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},r.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new _e(et.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_===0&&(this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},r.prototype.isMouseActionButton_=function(t){return t.button===0},r.prototype.handlePointerDown_=function(t){this.emulateClicks_=this.activePointers_===0,this.updateActivePointers_(t);var e=new _e(et.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_={};for(var n in t){var o=t[n];this.down_[n]=typeof o=="function"?Ve:o}if(this.dragListenerKeys_.length===0){var a=this.map_.getOwnerDocument();this.dragListenerKeys_.push(W(a,et.POINTERMOVE,this.handlePointerMove_,this),W(a,et.POINTERUP,this.handlePointerUp_,this),W(this.element_,et.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==a&&this.dragListenerKeys_.push(W(this.element_.getRootNode(),et.POINTERUP,this.handlePointerUp_,this))}},r.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new _e(et.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},r.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new _e(t.type,this.map_,t,e))},r.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()},r.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},r.prototype.disposeInternal=function(){this.relayedListenerKey_&&(J(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(G.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(J(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0,this.element_=null,i.prototype.disposeInternal.call(this)},r}(xr),hp=up,re={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},dt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Jn=1/0,cp=function(){function i(r,t){this.priorityFunction_=r,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return i.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,tn(this.queuedElements_)},i.prototype.dequeue=function(){var r=this.elements_,t=this.priorities_,e=r[0];r.length==1?(r.length=0,t.length=0):(r[0]=r.pop(),t[0]=t.pop(),this.siftUp_(0));var n=this.keyFunction_(e);return delete this.queuedElements_[n],e},i.prototype.enqueue=function(r){B(!(this.keyFunction_(r)in this.queuedElements_),31);var t=this.priorityFunction_(r);return t!=Jn?(this.elements_.push(r),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(r)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},i.prototype.getCount=function(){return this.elements_.length},i.prototype.getLeftChildIndex_=function(r){return r*2+1},i.prototype.getRightChildIndex_=function(r){return r*2+2},i.prototype.getParentIndex_=function(r){return r-1>>1},i.prototype.heapify_=function(){var r;for(r=(this.elements_.length>>1)-1;r>=0;r--)this.siftUp_(r)},i.prototype.isEmpty=function(){return this.elements_.length===0},i.prototype.isKeyQueued=function(r){return r in this.queuedElements_},i.prototype.isQueued=function(r){return this.isKeyQueued(this.keyFunction_(r))},i.prototype.siftUp_=function(r){for(var t=this.elements_,e=this.priorities_,n=t.length,o=t[r],a=e[r],s=r;r<n>>1;){var l=this.getLeftChildIndex_(r),u=this.getRightChildIndex_(r),h=u<n&&e[u]<e[l]?u:l;t[r]=t[h],e[r]=e[h],r=h}t[r]=o,e[r]=a,this.siftDown_(s,r)},i.prototype.siftDown_=function(r,t){for(var e=this.elements_,n=this.priorities_,o=e[t],a=n[t];t>r;){var s=this.getParentIndex_(t);if(n[s]>a)e[t]=e[s],n[t]=n[s],t=s;else break}e[t]=o,n[t]=a},i.prototype.reprioritize=function(){var r=this.priorityFunction_,t=this.elements_,e=this.priorities_,n=0,o=t.length,a,s,l;for(s=0;s<o;++s)a=t[s],l=r(a),l==Jn?delete this.queuedElements_[this.keyFunction_(a)]:(e[n]=l,t[n++]=a);t.length=n,e.length=n,this.heapify_()},i}(),fp=cp,pp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),dp=function(i){pp(r,i);function r(t,e){var n=i.call(this,function(o){return t.apply(null,o)},function(o){return o[0].getKey()})||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=e,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return r.prototype.enqueue=function(t){var e=i.prototype.enqueue.call(this,t);if(e){var n=t[0];n.addEventListener(G.CHANGE,this.boundHandleTileChange_)}return e},r.prototype.getTilesLoading=function(){return this.tilesLoading_},r.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(n===D.LOADED||n===D.ERROR||n===D.EMPTY){e.removeEventListener(G.CHANGE,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},r.prototype.loadMoreTiles=function(t,e){for(var n=0,o,a,s;this.tilesLoading_<t&&n<e&&this.getCount()>0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===D.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++n,a.load())},r}(fp),vp=dp;function gp(i,r,t,e,n){if(!i||!(t in i.wantedTiles)||!i.wantedTiles[t][r.getKey()])return Jn;var o=i.viewState.center,a=e[0]-o[0],s=e[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}var Xt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},_p=42,To=256;function Ga(i,r,t){return function(e,n,o,a,s){if(!!e){if(!n&&!r)return e;var l=r?0:o[0]*n,u=r?0:o[1]*n,h=s?s[0]:0,f=s?s[1]:0,c=i[0]+l/2+h,p=i[2]-l/2+h,d=i[1]+u/2+f,v=i[3]-u/2+f;c>p&&(c=(p+c)/2,p=c),d>v&&(d=(v+d)/2,v=d);var g=ot(e[0],c,p),m=ot(e[1],d,v);if(a&&t&&n){var _=30*n;g+=-_*Math.log(1+Math.max(0,c-e[0])/_)+_*Math.log(1+Math.max(0,e[0]-p)/_),m+=-_*Math.log(1+Math.max(0,d-e[1])/_)+_*Math.log(1+Math.max(0,e[1]-v)/_)}return[g,m]}}}function yp(i){return i}function Co(i,r,t,e){var n=it(r)/t[0],o=Ut(r)/t[1];return e?Math.min(i,Math.max(n,o)):Math.min(i,Math.min(n,o))}function xo(i,r,t){var e=Math.min(i,r),n=50;return e*=Math.log(1+n*Math.max(0,i/r-1))/n+1,t&&(e=Math.max(e,t),e/=Math.log(1+n*Math.max(0,t/i-1))/n+1),ot(e,t/2,r*2)}function mp(i,r,t,e){return function(n,o,a,s){if(n!==void 0){var l=i[0],u=i[i.length-1],h=t?Co(l,t,a,e):l;if(s){var f=r!==void 0?r:!0;return f?xo(n,h,u):ot(n,u,h)}var c=Math.min(h,n),p=Math.floor(ro(i,c,o));return i[p]>h&&p<i.length-1?i[p+1]:i[p]}else return}}function Ep(i,r,t,e,n,o){return function(a,s,l,u){if(a!==void 0){var h=n?Co(r,n,l,o):r,f=t!==void 0?t:0;if(u){var c=e!==void 0?e:!0;return c?xo(a,h,f):ot(a,f,h)}var p=1e-9,d=Math.ceil(Math.log(r/h)/Math.log(i)-p),v=-s*(.5-p)+.5,g=Math.min(h,a),m=Math.floor(Math.log(r/g)/Math.log(i)+v),_=Math.max(d,m),y=r/Math.pow(i,_);return ot(y,f,h)}else return}}function ka(i,r,t,e,n){return function(o,a,s,l){if(o!==void 0){var u=e?Co(i,e,s,n):i,h=t!==void 0?t:!0;return!h||!l?ot(o,r,u):xo(o,u,r)}else return}}function Oo(i){if(i!==void 0)return 0}function ba(i){if(i!==void 0)return i}function Tp(i){var r=2*Math.PI/i;return function(t,e){if(e)return t;if(t!==void 0)return t=Math.floor(t/r+.5)*r,t}}function Cp(i){var r=i||Ze(5);return function(t,e){if(e)return t;if(t!==void 0)return Math.abs(t)<=r?0:t}}var xp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ri=0,Op=function(i){xp(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un;var n=ut({},t);return e.hints_=[0,0],e.animations_=[],e.updateAnimationKey_,e.projection_=ho(n.projection,"EPSG:3857"),e.viewportSize_=[100,100],e.targetCenter_=null,e.targetResolution_,e.targetRotation_,e.nextCenter_=null,e.nextResolution_,e.nextRotation_,e.cancelAnchor_=void 0,n.projection&&ys(),n.center&&(n.center=te(n.center,e.projection_)),n.extent&&(n.extent=Xe(n.extent,e.projection_)),e.applyOptions_(n),e}return r.prototype.applyOptions_=function(t){var e=ut({},t);for(var n in Xt)delete e[n];this.setProperties(e,!0);var o=Sp(t);this.maxResolution_=o.maxResolution,this.minResolution_=o.minResolution,this.zoomFactor_=o.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=o.minZoom;var a=wp(t),s=o.constraint,l=Rp(t);this.constraints_={center:a,resolution:s,rotation:l},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)},Object.defineProperty(r.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var o=t||[0,0,0,0];e=e||[0,0,0,0];var a=this.getResolution(),s=a/2*(o[3]-e[3]+e[1]-o[1]),l=a/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([n[0]+s,n[1]-l])}},enumerable:!1,configurable:!0}),r.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),ut({},e,t)},r.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),n=0;n<e.length;++n){var o=arguments[n];o.center&&(o=ut({},o),o.center=te(o.center,this.getProjection())),o.anchor&&(o=ut({},o),o.anchor=te(o.anchor,this.getProjection())),e[n]=o}this.animateInternal.apply(this,e)},r.prototype.animateInternal=function(t){var e=arguments.length,n;e>1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);for(var o=0;o<e&&!this.isDef();++o){var a=arguments[o];a.center&&this.setCenterInternal(a.center),a.zoom!==void 0?this.setZoom(a.zoom):a.resolution&&this.setResolution(a.resolution),a.rotation!==void 0&&this.setRotation(a.rotation)}if(o===e){n&&In(n,!0);return}for(var s=Date.now(),l=this.targetCenter_.slice(),u=this.targetResolution_,h=this.targetRotation_,f=[];o<e;++o){var c=arguments[o],p={start:s,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||Yf,callback:n};if(c.center&&(p.sourceCenter=l,p.targetCenter=c.center.slice(),l=p.targetCenter),c.zoom!==void 0?(p.sourceResolution=u,p.targetResolution=this.getResolutionForZoom(c.zoom),u=p.targetResolution):c.resolution&&(p.sourceResolution=u,p.targetResolution=c.resolution,u=p.targetResolution),c.rotation!==void 0){p.sourceRotation=h;var d=yr(c.rotation-h+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=h+d,h=p.targetRotation}Pp(p)?p.complete=!0:s+=p.duration,f.push(p)}this.animations_.push(f),this.setHint(Ct.ANIMATING,1),this.updateAnimations_()},r.prototype.getAnimating=function(){return this.hints_[Ct.ANIMATING]>0},r.prototype.getInteracting=function(){return this.hints_[Ct.INTERACTING]>0},r.prototype.cancelAnimations=function(){this.setHint(Ct.ANIMATING,-this.hints_[Ct.ANIMATING]);for(var t,e=0,n=this.animations_.length;e<n;++e){var o=this.animations_[e];if(o[0].callback&&In(o[0].callback,!1),!t)for(var a=0,s=o.length;a<s;++a){var l=o[a];if(!l.complete){t=l.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},r.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!!this.getAnimating()){for(var t=Date.now(),e=!1,n=this.animations_.length-1;n>=0;--n){for(var o=this.animations_[n],a=!0,s=0,l=o.length;s<l;++s){var u=o[s];if(!u.complete){var h=t-u.start,f=u.duration>0?h/u.duration:1;f>=1?(u.complete=!0,f=1):a=!1;var c=u.easing(f);if(u.sourceCenter){var p=u.sourceCenter[0],d=u.sourceCenter[1],v=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=p+c*(v-p),_=d+c*(g-d);this.targetCenter_=[m,_]}if(u.sourceResolution&&u.targetResolution){var y=c===1?u.targetResolution:u.sourceResolution+c*(u.targetResolution-u.sourceResolution);if(u.anchor){var E=this.getViewportSize_(this.getRotation()),T=this.constraints_.resolution(y,0,E,!0);this.targetCenter_=this.calculateCenterZoom(T,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var x=c===1?yr(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+c*(u.targetRotation-u.sourceRotation);if(u.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!u.complete)break}}if(a){this.animations_[n]=null,this.setHint(Ct.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&In(O,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},r.prototype.calculateCenterRotate=function(t,e){var n,o=this.getCenterInternal();return o!==void 0&&(n=[o[0]-e[0],o[1]-e[1]],so(n,t-this.getRotation()),ds(n,e)),n},r.prototype.calculateCenterZoom=function(t,e){var n,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=e[0]-t*(e[0]-o[0])/a,l=e[1]-t*(e[1]-o[1])/a;n=[s,l]}return n},r.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],o=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(o*Math.cos(t))]}else return e},r.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},r.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&Bi(t,this.getProjection())},r.prototype.getCenterInternal=function(){return this.get(Xt.CENTER)},r.prototype.getConstraints=function(){return this.constraints_},r.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},r.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},r.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Es(e,this.getProjection())},r.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();B(n,1);var o=this.getResolution();B(o!==void 0,2);var a=this.getRotation();return B(a!==void 0,3),Yi(n,o,a,e)},r.prototype.getMaxResolution=function(){return this.maxResolution_},r.prototype.getMinResolution=function(){return this.minResolution_},r.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},r.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},r.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},r.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},r.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},r.prototype.getProjection=function(){return this.projection_},r.prototype.getResolution=function(){return this.get(Xt.RESOLUTION)},r.prototype.getResolutions=function(){return this.resolutions_},r.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Xe(t,this.getProjection()),e)},r.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),o=it(t)/n[0],a=Ut(t)/n[1];return Math.max(o,a)},r.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(n/o)/Math.log(e);return function(s){var l=n/Math.pow(e,s*a);return l}},r.prototype.getRotation=function(){return this.get(Xt.ROTATION)},r.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(n/o)/e;return function(s){var l=Math.log(n/s)/e/a;return l}},r.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},r.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=Pi(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],e,n)}return{center:o.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},r.prototype.getZoom=function(){var t,e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t},r.prototype.getZoomForResolution=function(t){var e=this.minZoom_||0,n,o;if(this.resolutions_){var a=ro(this.resolutions_,t,1);e=a,n=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=n/this.resolutions_[a+1]}else n=this.maxResolution_,o=this.zoomFactor_;return e+Math.log(n/t)/Math.log(o)},r.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=ot(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,ot(t-e,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},r.prototype.fit=function(t,e){var n;if(B(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){B(!ao(t),25);var o=Xe(t,this.getProjection());n=va(o)}else if(t.getType()===P.CIRCLE){var o=Xe(t.getExtent(),this.getProjection());n=va(o),n.rotate(this.getRotation(),Re(o))}else{var a=Hu();a?n=t.clone().transform(a,this.getProjection()):n=t}this.fitInternal(n,e)},r.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),o=Math.sin(-e),a=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,f=-1/0,c=0,p=a.length;c<p;c+=s){var d=a[c]*n-a[c+1]*o,v=a[c]*o+a[c+1]*n;l=Math.min(l,d),u=Math.min(u,v),h=Math.max(h,d),f=Math.max(f,v)}return[l,u,h,f]},r.prototype.fitInternal=function(t,e){var n=e||{},o=n.size;o||(o=this.getViewportSizeMinusPadding_());var a=n.padding!==void 0?n.padding:[0,0,0,0],s=n.nearest!==void 0?n.nearest:!1,l;n.minResolution!==void 0?l=n.minResolution:n.maxZoom!==void 0?l=this.getResolutionForZoom(n.maxZoom):l=0;var u=this.rotatedExtentForGeometry(t),h=this.getResolutionForExtentInternal(u,[o[0]-a[1]-a[3],o[1]-a[0]-a[2]]);h=isNaN(h)?l:Math.max(h,l),h=this.getConstrainedResolution(h,s?0:1);var f=this.getRotation(),c=Math.sin(f),p=Math.cos(f),d=Re(u);d[0]+=(a[1]-a[3])/2*h,d[1]+=(a[0]-a[2])/2*h;var v=d[0]*p-d[1]*c,g=d[1]*p+d[0]*c,m=this.getConstrainedCenter([v,g],h),_=n.callback?n.callback:Ve;n.duration!==void 0?this.animateInternal({resolution:h,center:m,duration:n.duration,easing:n.easing},_):(this.targetResolution_=h,this.targetCenter_=m,this.applyTargetState_(!1,!0),In(_,!0))},r.prototype.centerOn=function(t,e,n){this.centerOnInternal(te(t,this.getProjection()),e,n)},r.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(Pi(t,e,n,this.getResolution(),this.getRotation()))},r.prototype.calculateCenterShift=function(t,e,n,o){var a,s=this.padding_;if(s&&t){var l=this.getViewportSizeMinusPadding_(-n),u=Pi(t,o,[l[0]/2+s[3],l[1]/2+s[0]],e,n);a=[t[0]-u[0],t[1]-u[1]]}return a},r.prototype.isDef=function(){return!!this.getCenterInternal()&&this.getResolution()!==void 0},r.prototype.adjustCenter=function(t){var e=Bi(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},r.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},r.prototype.adjustResolution=function(t,e){var n=e&&te(e,this.getProjection());this.adjustResolutionInternal(t,n)},r.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),a=this.constraints_.resolution(this.targetResolution_*t,0,o,n);e&&(this.targetCenter_=this.calculateCenterZoom(a,e)),this.targetResolution_*=t,this.applyTargetState_()},r.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},r.prototype.adjustRotation=function(t,e){e&&(e=te(e,this.getProjection())),this.adjustRotationInternal(t,e)},r.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},r.prototype.setCenter=function(t){this.setCenterInternal(t&&te(t,this.getProjection()))},r.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},r.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},r.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},r.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},r.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},r.prototype.applyTargetState_=function(t,e){var n=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,n),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,0,a,n),l=this.constraints_.center(this.targetCenter_,s,a,n,this.calculateCenterShift(this.targetCenter_,s,o,a));this.get(Xt.ROTATION)!==o&&this.set(Xt.ROTATION,o),this.get(Xt.RESOLUTION)!==s&&(this.set(Xt.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),(!l||!this.get(Xt.CENTER)||!jn(this.get(Xt.CENTER),l))&&this.set(Xt.CENTER,l),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},r.prototype.resolveConstraints=function(t,e,n){var o=t!==void 0?t:200,a=e||0,s=this.constraints_.rotation(this.targetRotation_),l=this.getViewportSize_(s),u=this.constraints_.resolution(this.targetResolution_,a,l),h=this.constraints_.center(this.targetCenter_,u,l,!1,this.calculateCenterShift(this.targetCenter_,u,s,l));if(o===0&&!this.cancelAnchor_){this.targetResolution_=u,this.targetRotation_=s,this.targetCenter_=h,this.applyTargetState_();return}var f=n||(o===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==u||this.getRotation()!==s||!this.getCenterInternal()||!jn(this.getCenterInternal(),h))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:h,resolution:u,duration:o,easing:er,anchor:f}))},r.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Ct.INTERACTING,1)},r.prototype.endInteraction=function(t,e,n){var o=n&&te(n,this.getProjection());this.endInteractionInternal(t,e,o)},r.prototype.endInteractionInternal=function(t,e,n){this.setHint(Ct.INTERACTING,-1),this.resolveConstraints(t,e,n)},r.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},r.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},r.prototype.getConstrainedResolution=function(t,e){var n=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,o)},r}(bt);function In(i,r){setTimeout(function(){i(r)},0)}function wp(i){if(i.extent!==void 0){var r=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return Ga(i.extent,i.constrainOnlyCenter,r)}var t=ho(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&t.isGlobal()){var e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Ga(e,!1,!1)}return yp}function Sp(i){var r,t,e,n=28,o=2,a=i.minZoom!==void 0?i.minZoom:Ri,s=i.maxZoom!==void 0?i.maxZoom:n,l=i.zoomFactor!==void 0?i.zoomFactor:o,u=i.multiWorld!==void 0?i.multiWorld:!1,h=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,f=i.showFullExtent!==void 0?i.showFullExtent:!1,c=ho(i.projection,"EPSG:3857"),p=c.getExtent(),d=i.constrainOnlyCenter,v=i.extent;if(!u&&!v&&c.isGlobal()&&(d=!1,v=p),i.resolutions!==void 0){var g=i.resolutions;t=g[a],e=g[s]!==void 0?g[s]:g[g.length-1],i.constrainResolution?r=mp(g,h,!d&&v,f):r=ka(t,e,h,!d&&v,f)}else{var m=p?Math.max(it(p),Ut(p)):360*Vt[oe.DEGREES]/c.getMetersPerUnit(),_=m/To/Math.pow(o,Ri),y=_/Math.pow(o,n-Ri);t=i.maxResolution,t!==void 0?a=0:t=_/Math.pow(l,a),e=i.minResolution,e===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?e=t/Math.pow(l,s):e=_/Math.pow(l,s):e=y),s=a+Math.floor(Math.log(t/e)/Math.log(l)),e=t/Math.pow(l,s-a),i.constrainResolution?r=Ep(l,t,e,h,!d&&v,f):r=ka(t,e,h,!d&&v,f)}return{constraint:r,maxResolution:t,minResolution:e,minZoom:a,zoomFactor:l}}function Rp(i){var r=i.enableRotation!==void 0?i.enableRotation:!0;if(r){var t=i.constrainRotation;return t===void 0||t===!0?Cp():t===!1?ba:typeof t=="number"?Tp(t):ba}else return Oo}function Pp(i){return!(i.sourceCenter&&i.targetCenter&&!jn(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Pi(i,r,t,e,n){var o=Math.cos(-n),a=Math.sin(-n),s=i[0]*o-i[1]*a,l=i[1]*o+i[0]*a;s+=(r[0]/2-t[0])*e,l+=(t[1]-r[1]/2)*e,a=-a;var u=s*o-l*a,h=l*o+s*a;return[u,h]}var Te=Op,Lp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();function il(i){if(i instanceof ci){i.setMapInternal(null);return}i instanceof fi&&i.getLayers().forEach(il)}function ol(i,r){if(i instanceof ci){i.setMapInternal(r);return}if(i instanceof fi)for(var t=i.getLayers().getArray(),e=0,n=t.length;e<n;++e)ol(t[e],r)}var Ip=function(i){Lp(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un;var n=Ap(t);e.renderComplete_,e.loaded_=!0,e.boundHandleBrowserEvent_=e.handleBrowserEvent.bind(e),e.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,e.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:is,e.postRenderTimeoutHandle_,e.animationDelayKey_,e.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(e),e.coordinateToPixelTransform_=Kt(),e.pixelToCoordinateTransform_=Kt(),e.frameIndex_=0,e.frameState_=null,e.previousExtent_=null,e.viewPropertyListenerKey_=null,e.viewChangeListenerKey_=null,e.layerGroupPropertyListenerKeys_=null,e.viewport_=document.createElement("div"),e.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),e.viewport_.style.position="relative",e.viewport_.style.overflow="hidden",e.viewport_.style.width="100%",e.viewport_.style.height="100%",e.overlayContainer_=document.createElement("div"),e.overlayContainer_.style.position="absolute",e.overlayContainer_.style.zIndex="0",e.overlayContainer_.style.width="100%",e.overlayContainer_.style.height="100%",e.overlayContainer_.style.pointerEvents="none",e.overlayContainer_.className="ol-overlaycontainer",e.viewport_.appendChild(e.overlayContainer_),e.overlayContainerStopEvent_=document.createElement("div"),e.overlayContainerStopEvent_.style.position="absolute",e.overlayContainerStopEvent_.style.zIndex="0",e.overlayContainerStopEvent_.style.width="100%",e.overlayContainerStopEvent_.style.height="100%",e.overlayContainerStopEvent_.style.pointerEvents="none",e.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",e.viewport_.appendChild(e.overlayContainerStopEvent_),e.mapBrowserEventHandler_=null,e.moveTolerance_=t.moveTolerance,e.keyboardEventTarget_=n.keyboardEventTarget,e.targetChangeHandlerKeys_=null,e.controls=n.controls||new Gt,e.interactions=n.interactions||new Gt,e.overlays_=n.overlays,e.overlayIdIndex_={},e.renderer_=null,e.postRenderFunctions_=[],e.tileQueue_=new vp(e.getTilePriority.bind(e),e.handleTileChange_.bind(e)),e.addChangeListener(dt.LAYERGROUP,e.handleLayerGroupChanged_),e.addChangeListener(dt.VIEW,e.handleViewChanged_),e.addChangeListener(dt.SIZE,e.handleSizeChanged_),e.addChangeListener(dt.TARGET,e.handleTargetChanged_),e.setProperties(n.values);var o=e;return t.view&&!(t.view instanceof Te)&&t.view.then(function(a){o.setView(new Te(a))}),e.controls.addEventListener(St.ADD,function(a){a.element.setMap(this)}.bind(e)),e.controls.addEventListener(St.REMOVE,function(a){a.element.setMap(null)}.bind(e)),e.interactions.addEventListener(St.ADD,function(a){a.element.setMap(this)}.bind(e)),e.interactions.addEventListener(St.REMOVE,function(a){a.element.setMap(null)}.bind(e)),e.overlays_.addEventListener(St.ADD,function(a){this.addOverlayInternal_(a.element)}.bind(e)),e.overlays_.addEventListener(St.REMOVE,function(a){var s=a.element,l=s.getId();l!==void 0&&delete this.overlayIdIndex_[l.toString()],a.element.setMap(null)}.bind(e)),e.controls.forEach(function(a){a.setMap(this)}.bind(e)),e.interactions.forEach(function(a){a.setMap(this)}.bind(e)),e.overlays_.forEach(e.addOverlayInternal_.bind(e)),e}return r.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},r.prototype.addControl=function(t){this.getControls().push(t)},r.prototype.addInteraction=function(t){this.getInteractions().push(t)},r.prototype.addLayer=function(t){var e=this.getLayerGroup().getLayers();e.push(t)},r.prototype.handleLayerAdd_=function(t){ol(t.layer,this)},r.prototype.addOverlay=function(t){this.getOverlays().push(t)},r.prototype.addOverlayInternal_=function(t){var e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},r.prototype.disposeInternal=function(){this.setTarget(null),i.prototype.disposeInternal.call(this)},r.prototype.forEachFeatureAtPixel=function(t,e,n){if(!(!this.frameState_||!this.renderer_)){var o=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};var a=n.hitTolerance!==void 0?n.hitTolerance:0,s=n.layerFilter!==void 0?n.layerFilter:_r,l=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,a,l,e,null,s,null)}},r.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,function(o){n.push(o)},e),n},r.prototype.getAllLayers=function(){var t=[];function e(n){n.forEach(function(o){o instanceof fi?e(o.getLayers()):t.push(o)})}return e(this.getLayers()),t},r.prototype.forEachLayerAtPixel=function(t,e,n){if(!(!this.frameState_||!this.renderer_)){var o=n||{},a=o.hitTolerance!==void 0?o.hitTolerance:0,s=o.layerFilter||_r;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,a,e,s)}},r.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var n=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};var o=e.layerFilter!==void 0?e.layerFilter:_r,a=e.hitTolerance!==void 0?e.hitTolerance:0,s=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,a,s,o,null)},r.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},r.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},r.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},r.prototype.getTarget=function(){return this.get(dt.TARGET)},r.prototype.getTargetElement=function(){var t=this.getTarget();return t!==void 0?typeof t=="string"?document.getElementById(t):t:null},r.prototype.getCoordinateFromPixel=function(t){return Bi(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},r.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?st(e.pixelToCoordinateTransform,t.slice()):null},r.prototype.getControls=function(){return this.controls},r.prototype.getOverlays=function(){return this.overlays_},r.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null},r.prototype.getInteractions=function(){return this.interactions},r.prototype.getLayerGroup=function(){return this.get(dt.LAYERGROUP)},r.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof Gt){e.setLayers(t);return}var n=e.getLayers();n.clear(),n.extend(t)},r.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t},r.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var o=t[e];if(!!o.visible){var a=o.layer.getRenderer();if(a&&!a.ready)return!0;var s=o.layer.getSource();if(s&&s.loading)return!0}}return!1},r.prototype.getPixelFromCoordinate=function(t){var e=te(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},r.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?st(e.coordinateToPixelTransform,t.slice(0,2)):null},r.prototype.getRenderer=function(){return this.renderer_},r.prototype.getSize=function(){return this.get(dt.SIZE)},r.prototype.getView=function(){return this.get(dt.VIEW)},r.prototype.getViewport=function(){return this.viewport_},r.prototype.getOverlayContainer=function(){return this.overlayContainer_},r.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},r.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},r.prototype.getTilePriority=function(t,e,n,o){return gp(this.frameState_,t,e,n,o)},r.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,o=new _e(n,this,t);this.handleMapBrowserEvent(o)},r.prototype.handleMapBrowserEvent=function(t){if(!!this.frameState_){var e=t.originalEvent,n=e.type;if(n===Ee.POINTERDOWN||n===G.WHEEL||n===G.KEYDOWN){var o=this.getOwnerDocument(),a=this.viewport_.getRootNode?this.viewport_.getRootNode():o,s=e.target;if(this.overlayContainerStopEvent_.contains(s)||!(a===o?o.documentElement:a).contains(s))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1)for(var l=this.getInteractions().getArray().slice(),u=l.length-1;u>=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var f=h.handleEvent(t);if(!f||t.propagationStopped)break}}}},r.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,o=n;if(t){var a=t.viewHints;if(a[Ct.ANIMATING]||a[Ct.INTERACTING]){var s=Date.now()-t.time>8;n=s?0:8,o=s?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,o))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(we.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(we.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new vr(re.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new vr(re.LOADSTART,this,t))));for(var l=this.postRenderFunctions_,u=0,h=l.length;u<h;++u)l[u](this,t);l.length=0},r.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},r.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)J(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(G.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(G.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Zn(this.viewport_)}var n=this.getTargetElement();if(!n)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{n.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new hp(this,this.moveTolerance_);for(var o in et)this.mapBrowserEventHandler_.addEventListener(et[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(G.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(G.WHEEL,this.boundHandleBrowserEvent_,os?{passive:!1}:!1);var a=this.getOwnerDocument().defaultView,s=this.keyboardEventTarget_?this.keyboardEventTarget_:n;this.targetChangeHandlerKeys_=[W(s,G.KEYDOWN,this.handleBrowserEvent,this),W(s,G.KEYPRESS,this.handleBrowserEvent,this),W(a,G.RESIZE,this.updateSize,this)]}this.updateSize()},r.prototype.handleTileChange_=function(){this.render()},r.prototype.handleViewPropertyChanged_=function(){this.render()},r.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(J(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(J(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=W(t,Er.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=W(t,G.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},r.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(J),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new me("addlayer",t)),this.layerGroupPropertyListenerKeys_=[W(t,Er.PROPERTYCHANGE,this.render,this),W(t,G.CHANGE,this.render,this),W(t,"addlayer",this.handleLayerAdd_,this),W(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},r.prototype.isRendered=function(){return!!this.frameState_},r.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},r.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var o=t[e].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},r.prototype.render=function(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},r.prototype.removeControl=function(t){return this.getControls().remove(t)},r.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},r.prototype.removeLayer=function(t){var e=this.getLayerGroup().getLayers();return e.remove(t)},r.prototype.handleLayerRemove_=function(t){il(t.layer)},r.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},r.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),o=this.getView(),a=this.frameState_,s=null;if(n!==void 0&&ga(n)&&o&&o.isDef()){var l=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),u=o.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Yi(u.center,u.resolution,u.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:u,viewHints:l,wantedTiles:{},mapId:H(this),renderTargets:{}},u.nextCenter&&u.nextResolution){var h=isNaN(u.nextRotation)?u.rotation:u.nextRotation;s.nextExtent=Yi(u.nextCenter,u.nextResolution,h,n)}}if(this.frameState_=s,this.renderer_.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),a){var f=!this.previousExtent_||!ao(this.previousExtent_)&&!zr(s.extent,this.previousExtent_);f&&(this.dispatchEvent(new vr(re.MOVESTART,this,a)),this.previousExtent_=rn(this.previousExtent_))}var c=this.previousExtent_&&!s.viewHints[Ct.ANIMATING]&&!s.viewHints[Ct.INTERACTING]&&!zr(s.extent,this.previousExtent_);c&&(this.dispatchEvent(new vr(re.MOVEEND,this,s)),ss(s.extent,this.previousExtent_))}this.dispatchEvent(new vr(re.POSTRENDER,this,s)),this.renderComplete_=this.hasListener(re.LOADSTART)||this.hasListener(re.LOADEND)||this.hasListener(we.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()},0))},r.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new me("removelayer",e)),this.set(dt.LAYERGROUP,t)},r.prototype.setSize=function(t){this.set(dt.SIZE,t)},r.prototype.setTarget=function(t){this.set(dt.TARGET,t)},r.prototype.setView=function(t){if(!t||t instanceof Te){this.set(dt.VIEW,t);return}this.set(dt.VIEW,new Te);var e=this;t.then(function(n){e.setView(new Te(n))})},r.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),o=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),a=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(e=[o,a],!ga(e)&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(e),this.updateViewportSize_()},r.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},r}(bt);function Ap(i){var r=null;i.keyboardEventTarget!==void 0&&(r=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);var t={},e=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new fi({layers:i.layers});t[dt.LAYERGROUP]=e,t[dt.TARGET]=i.target,t[dt.VIEW]=i.view instanceof Te?i.view:new Te;var n;i.controls!==void 0&&(Array.isArray(i.controls)?n=new Gt(i.controls.slice()):(B(typeof i.controls.getArray=="function",47),n=i.controls));var o;i.interactions!==void 0&&(Array.isArray(i.interactions)?o=new Gt(i.interactions.slice()):(B(typeof i.interactions.getArray=="function",48),o=i.interactions));var a;return i.overlays!==void 0?Array.isArray(i.overlays)?a=new Gt(i.overlays.slice()):(B(typeof i.overlays.getArray=="function",49),a=i.overlays):a=new Gt,{controls:n,interactions:o,keyboardEventTarget:r,overlays:a,values:t}}var Mp=Ip,Fp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Np=function(i){Fp(r,i);function r(t){var e=i.call(this)||this,n=t.element;return n&&!t.target&&!n.style.pointerEvents&&(n.style.pointerEvents="auto"),e.element=n||null,e.target_=null,e.map_=null,e.listenerKeys=[],t.render&&(e.render=t.render),t.target&&e.setTarget(t.target),e}return r.prototype.disposeInternal=function(){Zn(this.element),i.prototype.disposeInternal.call(this)},r.prototype.getMap=function(){return this.map_},r.prototype.setMap=function(t){this.map_&&Zn(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)J(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){var o=this.target_?this.target_:t.getOverlayContainerStopEvent();o.appendChild(this.element),this.render!==Ve&&this.listenerKeys.push(W(t,re.POSTRENDER,this.render,this)),t.render()}},r.prototype.render=function(t){},r.prototype.setTarget=function(t){this.target_=typeof t=="string"?document.getElementById(t):t},r}(bt),ln=Np,Dp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Gp=function(i){Dp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this,e.ulElement_=document.createElement("ul"),e.collapsed_=n.collapsed!==void 0?n.collapsed:!0,e.userCollapsed_=e.collapsed_,e.overrideCollapsible_=n.collapsible!==void 0,e.collapsible_=n.collapsible!==void 0?n.collapsible:!0,e.collapsible_||(e.collapsed_=!1);var o=n.className!==void 0?n.className:"ol-attribution",a=n.tipLabel!==void 0?n.tipLabel:"Attributions",s=n.expandClassName!==void 0?n.expandClassName:o+"-expand",l=n.collapseLabel!==void 0?n.collapseLabel:"\u203A",u=n.collapseClassName!==void 0?n.collapseClassName:o+"-collapse";typeof l=="string"?(e.collapseLabel_=document.createElement("span"),e.collapseLabel_.textContent=l,e.collapseLabel_.className=u):e.collapseLabel_=l;var h=n.label!==void 0?n.label:"i";typeof h=="string"?(e.label_=document.createElement("span"),e.label_.textContent=h,e.label_.className=s):e.label_=h;var f=e.collapsible_&&!e.collapsed_?e.collapseLabel_:e.label_;e.toggleButton_=document.createElement("button"),e.toggleButton_.setAttribute("type","button"),e.toggleButton_.setAttribute("aria-expanded",String(!e.collapsed_)),e.toggleButton_.title=a,e.toggleButton_.appendChild(f),e.toggleButton_.addEventListener(G.CLICK,e.handleClick_.bind(e),!1);var c=o+" "+He+" "+on+(e.collapsed_&&e.collapsible_?" "+ma:"")+(e.collapsible_?"":" ol-uncollapsible"),p=e.element;return p.className=c,p.appendChild(e.toggleButton_),p.appendChild(e.ulElement_),e.renderedAttributions_=[],e.renderedVisible_=!0,e}return r.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],o=!0,a=t.layerStatesArray,s=0,l=a.length;s<l;++s){var u=a[s];if(!!Hn(u,t.viewState)){var h=u.layer.getSource();if(!!h){var f=h.getAttributions();if(!!f){var c=f(t);if(!!c)if(o=o&&h.getAttributionsCollapsible()!==!1,Array.isArray(c))for(var p=0,d=c.length;p<d;++p)c[p]in e||(n.push(c[p]),e[c[p]]=!0);else c in e||(n.push(c),e[c]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),n},r.prototype.updateElement_=function(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!qe(e,this.renderedAttributions_)){ks(this.ulElement_);for(var o=0,a=e.length;o<a;++o){var s=document.createElement("li");s.innerHTML=e[o],this.ulElement_.appendChild(s)}this.renderedAttributions_=e}},r.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},r.prototype.handleToggle_=function(){this.element.classList.toggle(ma),this.collapsed_?Bn(this.collapseLabel_,this.label_):Bn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},r.prototype.getCollapsible=function(){return this.collapsible_},r.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},r.prototype.setCollapsed=function(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()},r.prototype.getCollapsed=function(){return this.collapsed_},r.prototype.render=function(t){this.updateElement_(t.frameState)},r}(ln),kp=Gp,bp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),jp=function(i){bp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var o=n.className!==void 0?n.className:"ol-rotate",a=n.label!==void 0?n.label:"\u21E7",s=n.compassClassName!==void 0?n.compassClassName:"ol-compass";e.label_=null,typeof a=="string"?(e.label_=document.createElement("span"),e.label_.className=s,e.label_.textContent=a):(e.label_=a,e.label_.classList.add(s));var l=n.tipLabel?n.tipLabel:"Reset rotation",u=document.createElement("button");u.className=o+"-reset",u.setAttribute("type","button"),u.title=l,u.appendChild(e.label_),u.addEventListener(G.CLICK,e.handleClick_.bind(e),!1);var h=o+" "+He+" "+on,f=e.element;return f.className=h,f.appendChild(u),e.callResetNorth_=n.resetNorth?n.resetNorth:void 0,e.duration_=n.duration!==void 0?n.duration:250,e.autoHide_=n.autoHide!==void 0?n.autoHide:!0,e.rotation_=void 0,e.autoHide_&&e.element.classList.add(wn),e}return r.prototype.handleClick_=function(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()},r.prototype.resetNorth_=function(){var t=this.getMap(),e=t.getView();if(!!e){var n=e.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:er}):e.setRotation(0))}},r.prototype.render=function(t){var e=t.frameState;if(!!e){var n=e.viewState.rotation;if(n!=this.rotation_){var o="rotate("+n+"rad)";if(this.autoHide_){var a=this.element.classList.contains(wn);!a&&n===0?this.element.classList.add(wn):a&&n!==0&&this.element.classList.remove(wn)}this.label_.style.transform=o}this.rotation_=n}},r}(ln),Xp=jp,Yp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Up=function(i){Yp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),target:n.target})||this;var o=n.className!==void 0?n.className:"ol-zoom",a=n.delta!==void 0?n.delta:1,s=n.zoomInClassName!==void 0?n.zoomInClassName:o+"-in",l=n.zoomOutClassName!==void 0?n.zoomOutClassName:o+"-out",u=n.zoomInLabel!==void 0?n.zoomInLabel:"+",h=n.zoomOutLabel!==void 0?n.zoomOutLabel:"\u2013",f=n.zoomInTipLabel!==void 0?n.zoomInTipLabel:"Zoom in",c=n.zoomOutTipLabel!==void 0?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=f,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(G.CLICK,e.handleClick_.bind(e,a),!1);var d=document.createElement("button");d.className=l,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof h=="string"?document.createTextNode(h):h),d.addEventListener(G.CLICK,e.handleClick_.bind(e,-a),!1);var v=o+" "+He+" "+on,g=e.element;return g.className=v,g.appendChild(p),g.appendChild(d),e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},r.prototype.zoomByDelta_=function(t){var e=this.getMap(),n=e.getView();if(!!n){var o=n.getZoom();if(o!==void 0){var a=n.getConstrainedZoom(o+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:a,duration:this.duration_,easing:er})):n.setZoom(a)}}},r}(ln),Wp=Up,Bp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ja=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Xa={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},Zp=function(i){Bp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),target:n.target})||this,e.on,e.once,e.un,e.keys_=n.keys!==void 0?n.keys:!1,e.source_=n.source,e.isInFullscreen_=!1,e.boundHandleMapTargetChange_=e.handleMapTargetChange_.bind(e),e.cssClassName_=n.className!==void 0?n.className:"ol-full-screen",e.documentListeners_=[],e.activeClassName_=n.activeClassName!==void 0?n.activeClassName.split(" "):[e.cssClassName_+"-true"],e.inactiveClassName_=n.inactiveClassName!==void 0?n.inactiveClassName.split(" "):[e.cssClassName_+"-false"];var o=n.label!==void 0?n.label:"\u2922";e.labelNode_=typeof o=="string"?document.createTextNode(o):o;var a=n.labelActive!==void 0?n.labelActive:"\xD7";e.labelActiveNode_=typeof a=="string"?document.createTextNode(a):a;var s=n.tipLabel?n.tipLabel:"Toggle full-screen";return e.button_=document.createElement("button"),e.button_.title=s,e.button_.setAttribute("type","button"),e.button_.appendChild(e.labelNode_),e.button_.addEventListener(G.CLICK,e.handleClick_.bind(e),!1),e.setClassName_(e.button_,e.isInFullscreen_),e.element.className="".concat(e.cssClassName_," ").concat(He," ").concat(on),e.element.appendChild(e.button_),e}return r.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},r.prototype.handleFullScreen_=function(){var t=this.getMap();if(!!t){var e=t.getOwnerDocument();if(!!Ya(e))if(Ua(e))Kp(e);else{var n=void 0;this.source_?n=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:n=t.getTargetElement(),this.keys_?zp(n):al(n)}}},r.prototype.handleFullScreenChange_=function(){var t=this.getMap();if(!!t){var e=this.isInFullscreen_;this.isInFullscreen_=Ua(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Bn(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Xa.ENTERFULLSCREEN)):(Bn(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Xa.LEAVEFULLSCREEN)),t.updateSize())}},r.prototype.setClassName_=function(t,e){var n,o,a,s;e?((n=t.classList).remove.apply(n,this.inactiveClassName_),(o=t.classList).add.apply(o,this.activeClassName_)):((a=t.classList).remove.apply(a,this.activeClassName_),(s=t.classList).add.apply(s,this.inactiveClassName_))},r.prototype.setMap=function(t){var e=this.getMap();e&&e.removeChangeListener(dt.TARGET,this.boundHandleMapTargetChange_),i.prototype.setMap.call(this,t),this.handleMapTargetChange_(),t&&t.addChangeListener(dt.TARGET,this.boundHandleMapTargetChange_)},r.prototype.handleMapTargetChange_=function(){for(var t=this.documentListeners_,e=0,n=t.length;e<n;++e)J(t[e]);t.length=0;var o=this.getMap();if(o){var a=o.getOwnerDocument();Ya(a)?this.element.classList.remove(ya):this.element.classList.add(ya);for(var e=0,n=ja.length;e<n;++e)t.push(W(a,ja[e],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}},r}(ln);function Ya(i){var r=i.body;return!!(r.webkitRequestFullscreen||r.msRequestFullscreen&&i.msFullscreenEnabled||r.requestFullscreen&&i.fullscreenEnabled)}function Ua(i){return!!(i.webkitIsFullScreen||i.msFullscreenElement||i.fullscreenElement)}function al(i){i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.webkitRequestFullscreen&&i.webkitRequestFullscreen()}function zp(i){i.webkitRequestFullscreen?i.webkitRequestFullscreen():al(i)}function Kp(i){i.exitFullscreen?i.exitFullscreen():i.msExitFullscreen?i.msExitFullscreen():i.webkitExitFullscreen&&i.webkitExitFullscreen()}var Vp=Zp,Mt={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"},Hp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),mt={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},$p=function(i){Hp(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un,e.options=t,e.id=t.id,e.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,e.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,e.element=document.createElement("div"),e.element.className=t.className!==void 0?t.className:"ol-overlay-container "+Zh,e.element.style.position="absolute",e.element.style.pointerEvents="auto";var n=t.autoPan;return n&&typeof n!="object"&&(n={animation:t.autoPanAnimation,margin:t.autoPanMargin}),e.autoPan=n||!1,e.rendered={transform_:"",visible:!0},e.mapPostrenderListenerKey=null,e.addChangeListener(mt.ELEMENT,e.handleElementChanged),e.addChangeListener(mt.MAP,e.handleMapChanged),e.addChangeListener(mt.OFFSET,e.handleOffsetChanged),e.addChangeListener(mt.POSITION,e.handlePositionChanged),e.addChangeListener(mt.POSITIONING,e.handlePositioningChanged),t.element!==void 0&&e.setElement(t.element),e.setOffset(t.offset!==void 0?t.offset:[0,0]),e.setPositioning(t.positioning!==void 0?t.positioning:Mt.TOP_LEFT),t.position!==void 0&&e.setPosition(t.position),e}return r.prototype.getElement=function(){return this.get(mt.ELEMENT)},r.prototype.getId=function(){return this.id},r.prototype.getMap=function(){return this.get(mt.MAP)||null},r.prototype.getOffset=function(){return this.get(mt.OFFSET)},r.prototype.getPosition=function(){return this.get(mt.POSITION)},r.prototype.getPositioning=function(){return this.get(mt.POSITIONING)},r.prototype.handleElementChanged=function(){ks(this.element);var t=this.getElement();t&&this.element.appendChild(t)},r.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Zn(this.element),J(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=W(t,re.POSTRENDER,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},r.prototype.render=function(){this.updatePixelPosition()},r.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},r.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},r.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},r.prototype.setElement=function(t){this.set(mt.ELEMENT,t)},r.prototype.setMap=function(t){this.set(mt.MAP,t)},r.prototype.setOffset=function(t){this.set(mt.OFFSET,t)},r.prototype.setPosition=function(t){this.set(mt.POSITION,t)},r.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},r.prototype.panIntoView=function(t){var e=this.getMap();if(!(!e||!e.getTargetElement()||!this.get(mt.POSITION))){var n=this.getRect(e.getTargetElement(),e.getSize()),o=this.getElement(),a=this.getRect(o,[Uh(o),Wh(o)]),s=t||{},l=s.margin===void 0?20:s.margin;if(!je(n,a)){var u=a[0]-n[0],h=n[2]-a[2],f=a[1]-n[1],c=n[3]-a[3],p=[0,0];if(u<0?p[0]=u-l:h<0&&(p[0]=Math.abs(h)+l),f<0?p[1]=f-l:c<0&&(p[1]=Math.abs(c)+l),p[0]!==0||p[1]!==0){var d=e.getView().getCenterInternal(),v=e.getPixelFromCoordinateInternal(d);if(!v)return;var g=[v[0]+p[0],v[1]+p[1]],m=s.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(g),duration:m.duration,easing:m.easing})}}}},r.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),o=n.left+window.pageXOffset,a=n.top+window.pageYOffset;return[o,a,o+e[0],a+e[1]]},r.prototype.setPositioning=function(t){this.set(mt.POSITIONING,t)},r.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},r.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}var n=t.getPixelFromCoordinate(e),o=t.getSize();this.updateRenderedPosition(n,o)},r.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,o=this.getOffset(),a=this.getPositioning();this.setVisible(!0);var s=Math.round(t[0]+o[0])+"px",l=Math.round(t[1]+o[1])+"px",u="0%",h="0%";a==Mt.BOTTOM_RIGHT||a==Mt.CENTER_RIGHT||a==Mt.TOP_RIGHT?u="-100%":(a==Mt.BOTTOM_CENTER||a==Mt.CENTER_CENTER||a==Mt.TOP_CENTER)&&(u="-50%"),a==Mt.BOTTOM_LEFT||a==Mt.BOTTOM_CENTER||a==Mt.BOTTOM_RIGHT?h="-100%":(a==Mt.CENTER_LEFT||a==Mt.CENTER_CENTER||a==Mt.CENTER_RIGHT)&&(h="-50%");var f="translate(".concat(u,", ").concat(h,") translate(").concat(s,", ").concat(l,")");this.rendered.transform_!=f&&(this.rendered.transform_=f,n.transform=f,n.msTransform=f)},r.prototype.getOptions=function(){return this.options},r}(bt),qp=$p,Jp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),jr={VERTICAL:0,HORIZONTAL:1},Qp=function(i){Jp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),render:n.render})||this,e.dragListenerKeys_=[],e.currentResolution_=void 0,e.direction_=jr.VERTICAL,e.dragging_,e.heightLimit_=0,e.widthLimit_=0,e.startX_,e.startY_,e.thumbSize_=null,e.sliderInitialized_=!1,e.duration_=n.duration!==void 0?n.duration:200;var o=n.className!==void 0?n.className:"ol-zoomslider",a=document.createElement("button");a.setAttribute("type","button"),a.className=o+"-thumb "+He;var s=e.element;return s.className=o+" "+He+" "+on,s.appendChild(a),s.addEventListener(Ee.POINTERDOWN,e.handleDraggerStart_.bind(e),!1),s.addEventListener(Ee.POINTERMOVE,e.handleDraggerDrag_.bind(e),!1),s.addEventListener(Ee.POINTERUP,e.handleDraggerEnd_.bind(e),!1),s.addEventListener(G.CLICK,e.handleContainerClick_.bind(e),!1),a.addEventListener(G.CLICK,Jl,!1),e}return r.prototype.setMap=function(t){i.prototype.setMap.call(this,t),t&&t.render()},r.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,n=t.offsetHeight;if(e===0&&n===0)return this.sliderInitialized_=!1;var o=getComputedStyle(t);e-=parseFloat(o.paddingRight)+parseFloat(o.paddingLeft),n-=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom);var a=t.firstElementChild,s=getComputedStyle(a),l=a.offsetWidth+parseFloat(s.marginRight)+parseFloat(s.marginLeft),u=a.offsetHeight+parseFloat(s.marginTop)+parseFloat(s.marginBottom);return this.thumbSize_=[l,u],e>n?(this.direction_=jr.HORIZONTAL,this.widthLimit_=e-l):(this.direction_=jr.VERTICAL,this.heightLimit_=n-u),this.sliderInitialized_=!0},r.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),n=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),o=this.getResolutionForPosition_(n),a=e.getConstrainedZoom(e.getZoomForResolution(o));e.animateInternal({zoom:a,duration:this.duration_,easing:er})},r.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,this.dragListenerKeys_.length===0){var n=this.handleDraggerDrag_,o=this.handleDraggerEnd_,a=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(W(a,Ee.POINTERMOVE,n,this),W(a,Ee.POINTERUP,o,this))}}},r.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,n=t.clientY-this.startY_,o=this.getRelativePosition_(e,n);this.currentResolution_=this.getResolutionForPosition_(o),this.getMap().getView().setResolution(this.currentResolution_)}},r.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0}},r.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==jr.HORIZONTAL?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},r.prototype.getRelativePosition_=function(t,e){var n;return this.direction_===jr.HORIZONTAL?n=t/this.widthLimit_:n=e/this.heightLimit_,ot(n,0,1)},r.prototype.getResolutionForPosition_=function(t){var e=this.getMap().getView().getResolutionForValueFunction();return e(1-t)},r.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return ot(1-e(t),0,1)},r.prototype.render=function(t){if(!!t.frameState&&!(!this.sliderInitialized_&&!this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},r}(ln),td=Qp;function sl(i){var r=i||{},t=new Gt,e=r.zoom!==void 0?r.zoom:!0;e&&t.push(new Wp(r.zoomOptions));var n=r.rotate!==void 0?r.rotate:!0;n&&t.push(new Xp(r.rotateOptions));var o=r.attribution!==void 0?r.attribution:!0;return o&&t.push(new kp(r.attributionOptions)),t}var Wa={ACTIVE:"active"},ed=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rd=function(i){ed(r,i);function r(t){var e=i.call(this)||this;return e.on,e.once,e.un,t&&t.handleEvent&&(e.handleEvent=t.handleEvent),e.map_=null,e.setActive(!0),e}return r.prototype.getActive=function(){return this.get(Wa.ACTIVE)},r.prototype.getMap=function(){return this.map_},r.prototype.handleEvent=function(t){return!0},r.prototype.setActive=function(t){this.set(Wa.ACTIVE,t)},r.prototype.setMap=function(t){this.map_=t},r}(bt);function nd(i,r,t){var e=i.getCenterInternal();if(e){var n=[e[0]+r[0],e[1]+r[1]];i.animateInternal({duration:t!==void 0?t:250,easing:Uf,center:i.getConstrainedCenter(n)})}}function wo(i,r,t,e){var n=i.getZoom();if(n!==void 0){var o=i.getConstrainedZoom(n+r),a=i.getResolutionForZoom(o);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:a,anchor:t,duration:e!==void 0?e:250,easing:er})}}var un=rd,id=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),od=function(i){id(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.delta_=n.delta?n.delta:1,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==et.DBLCLICK){var n=t.originalEvent,o=t.map,a=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_,l=o.getView();wo(l,s,a,this.duration_),n.preventDefault(),e=!0}return!e},r}(un),ad=od,sd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ld=function(i){sd(r,i);function r(t){var e=this,n=t||{};return e=i.call(this,n)||this,n.handleDownEvent&&(e.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(e.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(e.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(e.handleUpEvent=n.handleUpEvent),n.stopDown&&(e.stopDown=n.stopDown),e.handlingDownUpSequence=!1,e.trackedPointers_={},e.targetPointers=[],e}return r.prototype.getPointerCount=function(){return this.targetPointers.length},r.prototype.handleDownEvent=function(t){return!1},r.prototype.handleDragEvent=function(t){},r.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==et.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==et.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==et.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==et.POINTERMOVE&&this.handleMoveEvent(t);return!e},r.prototype.handleMoveEvent=function(t){},r.prototype.handleUpEvent=function(t){return!1},r.prototype.stopDown=function(t){return t},r.prototype.updateTrackedPointers_=function(t){if(ud(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==et.POINTERUP?delete this.trackedPointers_[n]:t.type==et.POINTERDOWN?this.trackedPointers_[n]=e:n in this.trackedPointers_&&(this.trackedPointers_[n]=e),this.targetPointers=Qa(this.trackedPointers_)}},r}(un);function So(i){for(var r=i.length,t=0,e=0,n=0;n<r;n++)t+=i[n].clientX,e+=i[n].clientY;return[t/r,e/r]}function ud(i){var r=i.type;return r===et.POINTERDOWN||r===et.POINTERDRAG||r===et.POINTERUP}var hn=ld;function qi(i){var r=arguments;return function(t){for(var e=!0,n=0,o=r.length;n<o&&(e=e&&r[n](t),!!e);++n);return e}}var hd=function(i){var r=i.originalEvent;return r.altKey&&!(r.metaKey||r.ctrlKey)&&r.shiftKey},cd=function(i){var r=i.map.getTargetElement(),t=i.map.getOwnerDocument().activeElement;return r.contains(t)},ll=function(i){return i.map.getTargetElement().hasAttribute("tabindex")?cd(i):!0},fd=_r,ul=function(i){var r=i.originalEvent;return r.button==0&&!(vu&&ns&&r.ctrlKey)},hl=function(i){var r=i.originalEvent;return!r.altKey&&!(r.metaKey||r.ctrlKey)&&!r.shiftKey},Ba=function(i){var r=i.originalEvent;return!r.altKey&&(ns?r.metaKey:r.ctrlKey)&&!r.shiftKey},pd=function(i){var r=i.originalEvent;return!r.altKey&&!(r.metaKey||r.ctrlKey)&&r.shiftKey},cl=function(i){var r=i.originalEvent,t=r.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"},Li=function(i){var r=i.originalEvent;return B(r!==void 0,56),r.pointerType=="mouse"},dd=function(i){var r=i.originalEvent;return B(r!==void 0,56),r.isPrimary&&r.button===0},vd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),gd=function(i){vd(r,i);function r(t){var e=i.call(this,{stopDown:ei})||this,n=t||{};e.kinetic_=n.kinetic,e.lastCentroid=null,e.lastPointersCount_,e.panning_=!1;var o=n.condition?n.condition:qi(hl,dd);return e.condition_=n.onFocusOnly?qi(ll,o):o,e.noKinetic_=!1,e}return r.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=So(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var o=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map,s=a.getView();vs(o,s.getResolution()),so(o,s.getRotation()),s.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},r.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),a=this.kinetic_.getAngle(),s=n.getCenterInternal(),l=e.getPixelFromCoordinateInternal(s),u=e.getCoordinateFromPixelInternal([l[0]-o*Math.cos(a),l[1]-o*Math.sin(a)]);n.animateInternal({center:n.getConstrainedCenter(u),duration:500,easing:er})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map,n=e.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},r}(hn),fl=gd,_d=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yd=function(i){_d(r,i);function r(t){var e=this,n=t||{};return e=i.call(this,{stopDown:ei})||this,e.condition_=n.condition?n.condition:hd,e.lastAngle_=void 0,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleDragEvent=function(t){if(!!Li(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Oo){var o=e.getSize(),a=t.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;n.adjustRotationInternal(-l)}this.lastAngle_=s}}},r.prototype.handleUpEvent=function(t){if(!Li(t))return!0;var e=t.map,n=e.getView();return n.endInteraction(this.duration_),!1},r.prototype.handleDownEvent=function(t){if(!Li(t))return!1;if(ul(t)&&this.condition_(t)){var e=t.map;return e.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},r}(hn),md=yd,Ed=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Td=function(i){Ed(r,i);function r(t){var e=i.call(this)||this;return e.geometry_=null,e.element_=document.createElement("div"),e.element_.style.position="absolute",e.element_.style.pointerEvents="auto",e.element_.className="ol-box "+t,e.map_=null,e.startPixel_=null,e.endPixel_=null,e}return r.prototype.disposeInternal=function(){this.setMap(null)},r.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+n,o.top=Math.min(t[1],e[1])+n,o.width=Math.abs(e[0]-t[0])+n,o.height=Math.abs(e[1]-t[1])+n},r.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},r.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},r.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]],o=n.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Yn([o])},r.prototype.getGeometry=function(){return this.geometry_},r}(eo),Cd=Td,pl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),An={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Ii=function(i){pl(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.coordinate=e,o.mapBrowserEvent=n,o}return r}(Ht),xd=function(i){pl(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un;var n=t||{};return e.box_=new Cd(n.className||"ol-dragbox"),e.minArea_=n.minArea!==void 0?n.minArea:64,n.onBoxEnd&&(e.onBoxEnd=n.onBoxEnd),e.startPixel_=null,e.condition_=n.condition?n.condition:ul,e.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:e.defaultBoxEndCondition,e}return r.prototype.defaultBoxEndCondition=function(t,e,n){var o=n[0]-e[0],a=n[1]-e[1];return o*o+a*a>=this.minArea_},r.prototype.getGeometry=function(){return this.box_.getGeometry()},r.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ii(An.BOXDRAG,t.coordinate,t))},r.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Ii(e?An.BOXEND:An.BOXCANCEL,t.coordinate,t)),!1},r.prototype.handleDownEvent=function(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ii(An.BOXSTART,t.coordinate,t)),!0):!1},r.prototype.onBoxEnd=function(t){},r}(hn),Od=xd,wd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Sd=function(i){wd(r,i);function r(t){var e=this,n=t||{},o=n.condition?n.condition:pd;return e=i.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this,e.duration_=n.duration!==void 0?n.duration:200,e.out_=n.out!==void 0?n.out:!1,e}return r.prototype.onBoxEnd=function(t){var e=this.getMap(),n=e.getView(),o=this.getGeometry();if(this.out_){var a=n.rotatedExtentForGeometry(o),s=n.getResolutionForExtentInternal(a),l=n.getResolution()/s;o=o.clone(),o.scale(l*l)}n.fitInternal(o,{duration:this.duration_,easing:er})},r}(Od),Rd=Sd,Ne={LEFT:37,UP:38,RIGHT:39,DOWN:40},Pd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ld=function(i){Pd(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.defaultCondition_=function(o){return hl(o)&&cl(o)},e.condition_=n.condition!==void 0?n.condition:e.defaultCondition_,e.duration_=n.duration!==void 0?n.duration:100,e.pixelDelta_=n.pixelDelta!==void 0?n.pixelDelta:128,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==G.KEYDOWN){var n=t.originalEvent,o=n.keyCode;if(this.condition_(t)&&(o==Ne.DOWN||o==Ne.LEFT||o==Ne.RIGHT||o==Ne.UP)){var a=t.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;o==Ne.DOWN?h=-l:o==Ne.LEFT?u=-l:o==Ne.RIGHT?u=l:h=l;var f=[u,h];so(f,s.getRotation()),nd(s,f,this.duration_),n.preventDefault(),e=!0}}return!e},r}(un),Id=Ld,Ad=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Md=function(i){Ad(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.condition_=n.condition?n.condition:cl,e.delta_=n.delta?n.delta:1,e.duration_=n.duration!==void 0?n.duration:100,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==G.KEYDOWN||t.type==G.KEYPRESS){var n=t.originalEvent,o=n.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var a=t.map,s=o=="+".charCodeAt(0)?this.delta_:-this.delta_,l=a.getView();wo(l,s,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},r}(un),Fd=Md,Nd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ai={TRACKPAD:"trackpad",WHEEL:"wheel"},Dd=function(i){Nd(r,i);function r(t){var e=this,n=t||{};e=i.call(this,n)||this,e.totalDelta_=0,e.lastDelta_=0,e.maxDelta_=n.maxDelta!==void 0?n.maxDelta:1,e.duration_=n.duration!==void 0?n.duration:250,e.timeout_=n.timeout!==void 0?n.timeout:80,e.useAnchor_=n.useAnchor!==void 0?n.useAnchor:!0,e.constrainResolution_=n.constrainResolution!==void 0?n.constrainResolution:!1;var o=n.condition?n.condition:fd;return e.condition_=n.onFocusOnly?qi(ll,o):o,e.lastAnchor_=null,e.startTime_=void 0,e.timeoutId_,e.mode_=void 0,e.trackpadEventGap_=400,e.trackpadTimeoutId_,e.deltaPerZoom_=300,e}return r.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap().getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},r.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==G.WHEEL)return!0;var n=t.map,o=t.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var a;if(t.type==G.WHEEL&&(a=o.deltaY,pu&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=is),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?Ai.TRACKPAD:Ai.WHEEL);var l=n.getView();if(this.mode_===Ai.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),u),!1},r.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-ot(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),wo(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},r.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},r}(un),dl=Dd,Gd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),kd=function(i){Gd(r,i);function r(t){var e=this,n=t||{},o=n;return o.stopDown||(o.stopDown=ei),e=i.call(this,o)||this,e.anchor_=null,e.lastAngle_=void 0,e.rotating_=!1,e.rotationDelta_=0,e.threshold_=n.threshold!==void 0?n.threshold:.3,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-n.clientY,o.clientX-n.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=s}this.lastAngle_=a;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==Oo){var h=l.getViewport().getBoundingClientRect(),f=So(this.targetPointers);f[0]-=h.left,f[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),u.adjustRotationInternal(e,this.anchor_))}},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,n=e.getView();return n.endInteraction(this.duration_),!1}else return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}else return!1},r}(hn),bd=kd,jd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Xd=function(i){jd(r,i);function r(t){var e=this,n=t||{},o=n;return o.stopDown||(o.stopDown=ei),e=i.call(this,o)||this,e.anchor_=null,e.duration_=n.duration!==void 0?n.duration:400,e.lastDistance_=void 0,e.lastScaleDelta_=1,e}return r.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],o=this.targetPointers[1],a=n.clientX-o.clientX,s=n.clientY-o.clientY,l=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(e=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();e!=1&&(this.lastScaleDelta_=e);var f=u.getViewport().getBoundingClientRect(),c=So(this.targetPointers);c[0]-=f.left,c[1]-=f.top,this.anchor_=u.getCoordinateFromPixelInternal(c),u.render(),h.adjustResolutionInternal(e,this.anchor_)},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,n=e.getView(),o=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,o),!1}else return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}else return!1},r}(hn),Yd=Xd,Ud=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wd=function(i){Ud(r,i);function r(t,e,n){var o=i.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(t[0]))o.setCoordinates(t,e);else if(e!==void 0&&n)o.setFlatCoordinates(e,t),o.ends_=n;else{for(var a=o.getLayout(),s=t,l=[],u=[],h=0,f=s.length;h<f;++h){var c=s[h];h===0&&(a=c.getLayout()),Yt(l,c.getFlatCoordinates()),u.push(l.length)}o.setFlatCoordinates(a,l),o.ends_=u}return o}return r.prototype.appendLineString=function(t){this.flatCoordinates?Yt(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},r.prototype.clone=function(){var t=new r(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},r.prototype.closestPointXY=function(t,e,n,o){return o<Je(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),vo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,o))},r.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=q.XYM&&this.layout!=q.XYZM||this.flatCoordinates.length===0)return null;var o=e!==void 0?e:!1,a=n!==void 0?n:!1;return Ah(this.flatCoordinates,0,this.ends_,this.stride,t,o,a)},r.prototype.getCoordinates=function(){return Kr(this.flatCoordinates,0,this.ends_,this.stride)},r.prototype.getEnds=function(){return this.ends_},r.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Un(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},r.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,o=[],a=0,s=0,l=e.length;s<l;++s){var u=e[s],h=new Un(t.slice(a,u),n);o.push(h),a=u}return o},r.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,o=this.ends_,a=this.stride,s=0,l=o.length;s<l;++s){var u=o[s],h=Ms(e,n,u,a,.5);Yt(t,h),n=u}return t},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[],n=[];return e.length=uh(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,n),new r(e,q.XY,n)},r.prototype.getType=function(){return P.MULTI_LINE_STRING},r.prototype.intersectsExtent=function(t){return Eh(this.flatCoordinates,0,this.ends_,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=go(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()},r}(tr),vl=Wd,Bd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Zd=function(i){Bd(r,i);function r(t,e){var n=i.call(this)||this;return e&&!Array.isArray(t[0])?n.setFlatCoordinates(e,t):n.setCoordinates(t,e),n}return r.prototype.appendPoint=function(t){this.flatCoordinates?Yt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},r.prototype.clone=function(){var t=new r(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},r.prototype.closestPointXY=function(t,e,n,o){if(o<Je(this.getExtent(),t,e))return o;for(var a=this.flatCoordinates,s=this.stride,l=0,u=a.length;l<u;l+=s){var h=Be(t,e,a[l],a[l+1]);if(h<o){o=h;for(var f=0;f<s;++f)n[f]=a[l+f];n.length=s}}return o},r.prototype.getCoordinates=function(){return Ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Pe(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},r.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,o=[],a=0,s=t.length;a<s;a+=n){var l=new Pe(t.slice(a,a+n),e);o.push(l)}return o},r.prototype.getType=function(){return P.MULTI_POINT},r.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,o=0,a=e.length;o<a;o+=n){var s=e[o],l=e[o+1];if(io(t,s,l))return!0}return!1},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ui(this.flatCoordinates,0,t,this.stride),this.changed()},r}(tr),gl=Zd;function zd(i,r,t,e){for(var n=[],o=Pt(),a=0,s=t.length;a<s;++a){var l=t[a];o=us(i,r,l[0],e),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),r=l[l.length-1]}return n}var Kd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Vd=function(i){Kd(r,i);function r(t,e,n){var o=i.call(this)||this;if(o.endss_=[],o.flatInteriorPointsRevision_=-1,o.flatInteriorPoints_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,!n&&!Array.isArray(t[0])){for(var a=o.getLayout(),s=t,l=[],u=[],h=0,f=s.length;h<f;++h){var c=s[h];h===0&&(a=c.getLayout());for(var p=l.length,d=c.getEnds(),v=0,g=d.length;v<g;++v)d[v]+=p;Yt(l,c.getFlatCoordinates()),u.push(d)}e=a,t=l,n=u}return e!==void 0&&n?(o.setFlatCoordinates(e,t),o.endss_=n):o.setCoordinates(t,e),o}return r.prototype.appendPolygon=function(t){var e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{var n=this.flatCoordinates.length;Yt(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(var o=0,a=e.length;o<a;++o)e[o]+=n}this.endss_.push(e),this.changed()},r.prototype.clone=function(){for(var t=this.endss_.length,e=new Array(t),n=0;n<t;++n)e[n]=this.endss_[n].slice();var o=new r(this.flatCoordinates.slice(),this.layout,e);return o.applyProperties(this),o},r.prototype.closestPointXY=function(t,e,n,o){return o<Je(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(oh(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ah(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,o))},r.prototype.containsXY=function(t,e){return yh(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},r.prototype.getArea=function(){return fh(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},r.prototype.getCoordinates=function(t){var e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),da(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Zi(e,0,this.endss_,this.stride)},r.prototype.getEndss=function(){return this.endss_},r.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=zd(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=mh(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},r.prototype.getInteriorPoints=function(){return new gl(this.getFlatInteriorPoints().slice(),q.XYM)},r.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Oh(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=da(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[],n=[];return e.length=ch(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,n),new r(e,q.XY,n)},r.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(t===0)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var o=this.endss_[t].slice(),a=o[o.length-1];if(e!==0)for(var s=0,l=o.length;s<l;++s)o[s]-=e;return new Yn(this.flatCoordinates.slice(e,a),this.layout,o)},r.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,o=[],a=0,s=0,l=n.length;s<l;++s){var u=n[s].slice(),h=u[u.length-1];if(a!==0)for(var f=0,c=u.length;f<c;++f)u[f]-=a;var p=new Yn(e.slice(a,h),t,u);o.push(p),a=h}return o},r.prototype.getType=function(){return P.MULTI_POLYGON},r.prototype.intersectsExtent=function(t){return Ch(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=lh(this.flatCoordinates,0,t,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{var o=n[n.length-1];this.flatCoordinates.length=o.length===0?0:o[o.length-1]}this.changed()},r}(tr),Hd=Vd;function _l(i){var r=i||{},t=new Gt,e=new Hf(-.005,.05,100),n=r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0;n&&t.push(new md);var o=r.doubleClickZoom!==void 0?r.doubleClickZoom:!0;o&&t.push(new ad({delta:r.zoomDelta,duration:r.zoomDuration}));var a=r.dragPan!==void 0?r.dragPan:!0;a&&t.push(new fl({onFocusOnly:r.onFocusOnly,kinetic:e}));var s=r.pinchRotate!==void 0?r.pinchRotate:!0;s&&t.push(new bd);var l=r.pinchZoom!==void 0?r.pinchZoom:!0;l&&t.push(new Yd({duration:r.zoomDuration}));var u=r.keyboard!==void 0?r.keyboard:!0;u&&(t.push(new Id),t.push(new Fd({delta:r.zoomDelta,duration:r.zoomDuration})));var h=r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0;h&&t.push(new dl({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration}));var f=r.shiftDragZoom!==void 0?r.shiftDragZoom:!0;return f&&t.push(new Rd({duration:r.zoomDuration})),t}var $d=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),qd=function(i){$d(r,i);function r(t){return t=ut({},t),t.controls||(t.controls=sl()),t.interactions||(t.interactions=_l({onFocusOnly:!0})),i.call(this,t)||this}return r.prototype.createRenderer=function(){return new rp(this)},r}(Mp),Jd=qd,Qd=function(){function i(r){this.highWaterMark=r!==void 0?r:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return i.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},i.prototype.expireCache=function(r){for(;this.canExpireCache();)this.pop()},i.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},i.prototype.containsKey=function(r){return this.entries_.hasOwnProperty(r)},i.prototype.forEach=function(r){for(var t=this.oldest_;t;)r(t.value_,t.key_,this),t=t.newer},i.prototype.get=function(r,t){var e=this.entries_[r];return B(e!==void 0,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},i.prototype.remove=function(r){var t=this.entries_[r];return B(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[r],--this.count_,t.value_},i.prototype.getCount=function(){return this.count_},i.prototype.getKeys=function(){var r=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)r[t++]=e.key_;return r},i.prototype.getValues=function(){var r=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)r[t++]=e.value_;return r},i.prototype.peekLast=function(){return this.oldest_.value_},i.prototype.peekLastKey=function(){return this.oldest_.key_},i.prototype.peekFirstKey=function(){return this.newest_.key_},i.prototype.pop=function(){var r=this.oldest_;return delete this.entries_[r.key_],r.newer&&(r.newer.older=null),this.oldest_=r.newer,this.oldest_||(this.newest_=null),--this.count_,r.value_},i.prototype.replace=function(r,t){this.get(r),this.entries_[r].value_=t},i.prototype.set=function(r,t){B(!(r in this.entries_),16);var e={key_:r,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=e:this.oldest_=e,this.newest_=e,this.entries_[r]=e,++this.count_},i.prototype.setSize=function(r){this.highWaterMark=r},i}(),tv=Qd;function Za(i,r,t,e){return e!==void 0?(e[0]=i,e[1]=r,e[2]=t,e):[i,r,t]}function pi(i,r,t){return i+"/"+r+"/"+t}function yl(i){return pi(i[0],i[1],i[2])}function ev(i){return i.split("/").map(Number)}function rv(i){return(i[1]<<i[0])+i[2]}function nv(i,r){var t=i[0],e=i[1],n=i[2];if(r.getMinZoom()>t||t>r.getMaxZoom())return!1;var o=r.getFullTileRange(t);return o?o.containsXY(e,n):!0}var iv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ov=function(i){iv(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast();if(e.getKey()in t)break;this.pop().release()}},r.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),e=ev(t),n=e[0];this.forEach(function(o){o.tileCoord[0]!==n&&(this.remove(yl(o.tileCoord)),o.release())}.bind(this))}},r}(tv),ml=ov,El=function(){function i(r,t,e,n){this.minX=r,this.maxX=t,this.minY=e,this.maxY=n}return i.prototype.contains=function(r){return this.containsXY(r[1],r[2])},i.prototype.containsTileRange=function(r){return this.minX<=r.minX&&r.maxX<=this.maxX&&this.minY<=r.minY&&r.maxY<=this.maxY},i.prototype.containsXY=function(r,t){return this.minX<=r&&r<=this.maxX&&this.minY<=t&&t<=this.maxY},i.prototype.equals=function(r){return this.minX==r.minX&&this.minY==r.minY&&this.maxX==r.maxX&&this.maxY==r.maxY},i.prototype.extend=function(r){r.minX<this.minX&&(this.minX=r.minX),r.maxX>this.maxX&&(this.maxX=r.maxX),r.minY<this.minY&&(this.minY=r.minY),r.maxY>this.maxY&&(this.maxY=r.maxY)},i.prototype.getHeight=function(){return this.maxY-this.minY+1},i.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},i.prototype.getWidth=function(){return this.maxX-this.minX+1},i.prototype.intersects=function(r){return this.minX<=r.maxX&&this.maxX>=r.minX&&this.minY<=r.maxY&&this.maxY>=r.minY},i}();function cr(i,r,t,e,n){return n!==void 0?(n.minX=i,n.maxX=r,n.minY=t,n.maxY=e,n):new El(i,r,t,e)}var Tl=El,Cl=function(){function i(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return i.prototype.getReadOptions=function(r,t){var e;if(t){var n=t.dataProjection?at(t.dataProjection):this.readProjection(r);t.extent&&n&&n.getUnits()===oe.TILE_PIXELS&&(n=at(n),n.setWorldExtent(t.extent)),e={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(e)},i.prototype.adaptOptions=function(r){return ut({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},r)},i.prototype.getType=function(){return F()},i.prototype.readFeature=function(r,t){return F()},i.prototype.readFeatures=function(r,t){return F()},i.prototype.readGeometry=function(r,t){return F()},i.prototype.readProjection=function(r){return F()},i.prototype.writeFeature=function(r,t){return F()},i.prototype.writeFeatures=function(r,t){return F()},i.prototype.writeGeometry=function(r,t){return F()},i}();function Le(i,r,t){var e=t?at(t.featureProjection):null,n=t?at(t.dataProjection):null,o;if(e&&n&&!ke(e,n)?o=(r?i.clone():i).transform(r?e:n,r?n:e):o=i,r&&t&&t.decimals!==void 0){var a=Math.pow(10,t.decimals),s=function(l){for(var u=0,h=l.length;u<h;++u)l[u]=Math.round(l[u]*a)/a;return l};o===i&&(o=i.clone()),o.applyTransform(s)}return o}var av=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sv=function(i){av(r,i);function r(){return i.call(this)||this}return r.prototype.getType=function(){return be.JSON},r.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Mn(t),this.getReadOptions(t,e))},r.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Mn(t),this.getReadOptions(t,e))},r.prototype.readFeatureFromObject=function(t,e){return F()},r.prototype.readFeaturesFromObject=function(t,e){return F()},r.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Mn(t),this.getReadOptions(t,e))},r.prototype.readGeometryFromObject=function(t,e){return F()},r.prototype.readProjection=function(t){return this.readProjectionFromObject(Mn(t))},r.prototype.readProjectionFromObject=function(t){return F()},r.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},r.prototype.writeFeatureObject=function(t,e){return F()},r.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},r.prototype.writeFeaturesObject=function(t,e){return F()},r.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},r.prototype.writeGeometryObject=function(t,e){return F()},r}(Cl);function Mn(i){if(typeof i=="string"){var r=JSON.parse(i);return r||null}else return i!==null?i:null}var lv=sv,uv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),hv=function(i){uv(r,i);function r(t){var e=i.call(this)||this;return e.geometries_=t||null,e.changeEventsKeys_=[],e.listenGeometriesChange_(),e}return r.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(J),this.changeEventsKeys_.length=0},r.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(W(this.geometries_[t],G.CHANGE,this.changed,this))},r.prototype.clone=function(){var t=new r(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},r.prototype.closestPointXY=function(t,e,n,o){if(o<Je(this.getExtent(),t,e))return o;for(var a=this.geometries_,s=0,l=a.length;s<l;++s)o=a[s].closestPointXY(t,e,n,o);return o},r.prototype.containsXY=function(t,e){for(var n=this.geometries_,o=0,a=n.length;o<a;++o)if(n[o].containsXY(t,e))return!0;return!1},r.prototype.computeExtent=function(t){rn(t);for(var e=this.geometries_,n=0,o=e.length;n<o;++n)oo(t,e[n].getExtent());return t},r.prototype.getGeometries=function(){return za(this.geometries_)},r.prototype.getGeometriesArray=function(){return this.geometries_},r.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,n=0,o=e.length;n<o;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t},r.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var e=[],n=this.geometries_,o=!1,a=0,s=n.length;a<s;++a){var l=n[a],u=l.getSimplifiedGeometry(t);e.push(u),u!==l&&(o=!0)}if(o){var h=new r(null);return h.setGeometriesArray(e),h}else return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},r.prototype.getType=function(){return P.GEOMETRY_COLLECTION},r.prototype.intersectsExtent=function(t){for(var e=this.geometries_,n=0,o=e.length;n<o;++n)if(e[n].intersectsExtent(t))return!0;return!1},r.prototype.isEmpty=function(){return this.geometries_.length===0},r.prototype.rotate=function(t,e){for(var n=this.geometries_,o=0,a=n.length;o<a;++o)n[o].rotate(t,e);this.changed()},r.prototype.scale=function(t,e,n){var o=n;o||(o=Re(this.getExtent()));for(var a=this.geometries_,s=0,l=a.length;s<l;++s)a[s].scale(t,e,o);this.changed()},r.prototype.setGeometries=function(t){this.setGeometriesArray(za(t))},r.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},r.prototype.applyTransform=function(t){for(var e=this.geometries_,n=0,o=e.length;n<o;++n)e[n].applyTransform(t);this.changed()},r.prototype.translate=function(t,e){for(var n=this.geometries_,o=0,a=n.length;o<a;++o)n[o].translate(t,e);this.changed()},r.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),i.prototype.disposeInternal.call(this)},r}(Cs);function za(i){for(var r=[],t=0,e=i.length;t<e;++t)r.push(i[t].clone());return r}var cv=hv,fv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),pv=function(i){fv(r,i);function r(t){var e=this,n=t||{};return e=i.call(this)||this,e.dataProjection=at(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(e.defaultFeatureProjection=at(n.featureProjection)),e.geometryName_=n.geometryName,e.extractGeometryName_=n.extractGeometryName,e.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],e}return r.prototype.readFeatureFromObject=function(t,e){var n=null;t.type==="Feature"?n=t:n={type:"Feature",geometry:t,properties:null};var o=Ji(n.geometry,e),a=new Oe;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in n!==void 0&&a.setGeometryName(n.geometry_name),a.setGeometry(o),"id"in n&&a.setId(n.id),n.properties&&a.setProperties(n.properties,!0),a},r.prototype.readFeaturesFromObject=function(t,e){var n=t,o=null;if(n.type==="FeatureCollection"){var a=t;o=[];for(var s=a.features,l=0,u=s.length;l<u;++l)o.push(this.readFeatureFromObject(s[l],e))}else o=[this.readFeatureFromObject(t,e)];return o},r.prototype.readGeometryFromObject=function(t,e){return Ji(t,e)},r.prototype.readProjectionFromObject=function(t){var e=t.crs,n;return e?e.type=="name"?n=at(e.properties.name):e.type==="EPSG"?n=at("EPSG:"+e.properties.code):B(!1,36):n=this.dataProjection,n},r.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var n={type:"Feature",geometry:null,properties:null},o=t.getId();if(o!==void 0&&(n.id=o),!t.hasProperties())return n;var a=t.getProperties(),s=t.getGeometry();return s&&(n.geometry=Qi(s,e),delete a[t.getGeometryName()]),Tr(a)||(n.properties=a),n},r.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var n=[],o=0,a=t.length;o<a;++o)n.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:n}},r.prototype.writeGeometryObject=function(t,e){return Qi(t,this.adaptOptions(e))},r}(lv);function Ji(i,r){if(!i)return null;var t;switch(i.type){case P.POINT:{t=vv(i);break}case P.LINE_STRING:{t=gv(i);break}case P.POLYGON:{t=Ev(i);break}case P.MULTI_POINT:{t=yv(i);break}case P.MULTI_LINE_STRING:{t=_v(i);break}case P.MULTI_POLYGON:{t=mv(i);break}case P.GEOMETRY_COLLECTION:{t=dv(i);break}default:throw new Error("Unsupported GeoJSON type: "+i.type)}return Le(t,!1,r)}function dv(i,r){var t=i.geometries.map(function(e){return Ji(e,r)});return new cv(t)}function vv(i){return new Pe(i.coordinates)}function gv(i){return new Un(i.coordinates)}function _v(i){return new vl(i.coordinates)}function yv(i){return new gl(i.coordinates)}function mv(i){return new Hd(i.coordinates)}function Ev(i){return new Yn(i.coordinates)}function Qi(i,r){i=Le(i,!0,r);var t=i.getType(),e;switch(t){case P.POINT:{e=Sv(i);break}case P.LINE_STRING:{e=Cv(i);break}case P.POLYGON:{e=Rv(i,r);break}case P.MULTI_POINT:{e=Ov(i);break}case P.MULTI_LINE_STRING:{e=xv(i);break}case P.MULTI_POLYGON:{e=wv(i,r);break}case P.GEOMETRY_COLLECTION:{e=Tv(i,r);break}case P.CIRCLE:{e={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return e}function Tv(i,r){var t=i.getGeometriesArray().map(function(e){var n=ut({},r);return delete n.featureProjection,Qi(e,n)});return{type:"GeometryCollection",geometries:t}}function Cv(i,r){return{type:"LineString",coordinates:i.getCoordinates()}}function xv(i,r){return{type:"MultiLineString",coordinates:i.getCoordinates()}}function Ov(i,r){return{type:"MultiPoint",coordinates:i.getCoordinates()}}function wv(i,r){var t;return r&&(t=r.rightHanded),{type:"MultiPolygon",coordinates:i.getCoordinates(t)}}function Sv(i,r){return{type:"Point",coordinates:i.getCoordinates()}}function Rv(i,r){var t;return r&&(t=r.rightHanded),{type:"Polygon",coordinates:i.getCoordinates(t)}}var Ka=pv,Va="http://www.w3.org/2001/XMLSchema-instance";function Ro(i,r){return cn().createElementNS(i,r)}function di(i,r){return xl(i,r,[]).join("")}function xl(i,r,t){if(i.nodeType==Node.CDATA_SECTION_NODE||i.nodeType==Node.TEXT_NODE)r?t.push(String(i.nodeValue).replace(/(\r\n|\r|\n)/g,"")):t.push(i.nodeValue);else{var e=void 0;for(e=i.firstChild;e;e=e.nextSibling)xl(e,r,t)}return t}function Fn(i){return"documentElement"in i}function Nn(i){return new DOMParser().parseFromString(i,"application/xml")}function Mi(i,r){return function(t,e){var n=i.call(r!==void 0?r:this,t,e);if(n!==void 0){var o=e[e.length-1];o.push(n)}}}function K(i,r,t){return function(e,n){var o=i.call(t!==void 0?t:this,e,n);if(o!==void 0){var a=n[n.length-1],s=r!==void 0?r:e.localName;a[s]=o}}}function Y(i,r){return function(t,e,n){i.call(r!==void 0?r:this,t,e,n);var o=n[n.length-1],a=o.node;a.appendChild(t)}}function Ol(i,r){var t,e;return function(n,o,a){if(t===void 0){t={};var s={};s[n.localName]=i,t[n.namespaceURI]=s,e=Po(n.localName)}wl(t,e,o,a)}}function Po(i,r){var t=i;return function(e,n,o){var a=n[n.length-1],s=a.node,l=t;l===void 0&&(l=o);var u=r!==void 0?r:s.namespaceURI;return Ro(u,l)}}var vi=Po();function Lo(i,r){for(var t=r.length,e=new Array(t),n=0;n<t;++n)e[n]=i[r[n]];return e}function gt(i,r,t){var e=t!==void 0?t:{},n,o;for(n=0,o=i.length;n<o;++n)e[i[n]]=r;return e}function Io(i,r,t,e){var n;for(n=r.firstElementChild;n;n=n.nextElementSibling){var o=i[n.namespaceURI];if(o!==void 0){var a=o[n.localName];a!==void 0&&a.call(e,n,t)}}}function wr(i,r,t,e,n){return e.push(i),Io(r,t,e,n),e.pop()}function wl(i,r,t,e,n,o){for(var a=(n!==void 0?n:t).length,s,l,u=0;u<a;++u)s=t[u],s!==void 0&&(l=r.call(o!==void 0?o:this,s,e,n!==void 0?n[u]:void 0),l!==void 0&&i[l.namespaceURI][l.localName].call(o,l,s,e))}function Sr(i,r,t,e,n,o,a){return n.push(i),wl(r,t,e,n,o,a),n.pop()}var Fi=void 0;function Pv(){return Fi===void 0&&typeof XMLSerializer!="undefined"&&(Fi=new XMLSerializer),Fi}var Ni=void 0;function cn(){return Ni===void 0&&typeof document!="undefined"&&(Ni=document.implementation.createDocument("","",null)),Ni}var Lv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Iv=function(i){Lv(r,i);function r(){var t=i.call(this)||this;return t.xmlSerializer_=Pv(),t}return r.prototype.getType=function(){return be.XML},r.prototype.readFeature=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readFeatureFromDocument(n,e)}else return Fn(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e);else return null},r.prototype.readFeatureFromDocument=function(t,e){var n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null},r.prototype.readFeatureFromNode=function(t,e){return null},r.prototype.readFeatures=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readFeaturesFromDocument(n,e)}else return Fn(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e);else return[]},r.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],o=t.firstChild;o;o=o.nextSibling)o.nodeType==Node.ELEMENT_NODE&&Yt(n,this.readFeaturesFromNode(o,e));return n},r.prototype.readFeaturesFromNode=function(t,e){return F()},r.prototype.readGeometry=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readGeometryFromDocument(n,e)}else return Fn(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e);else return null},r.prototype.readGeometryFromDocument=function(t,e){return null},r.prototype.readGeometryFromNode=function(t,e){return null},r.prototype.readProjection=function(t){if(t)if(typeof t=="string"){var e=Nn(t);return this.readProjectionFromDocument(e)}else return Fn(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t);else return null},r.prototype.readProjectionFromDocument=function(t){return this.dataProjection},r.prototype.readProjectionFromNode=function(t){return this.dataProjection},r.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeFeatureNode=function(t,e){return null},r.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeFeaturesNode=function(t,e){return null},r.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeGeometryNode=function(t,e){return null},r}(Cl),Av=Iv;function Ao(i){var r=di(i,!1),t=Date.parse(r);return isNaN(t)?void 0:t/1e3}function ne(i){var r=di(i,!1);return Mv(r)}function Mv(i){var r=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i);if(r)return parseFloat(r[1])}function Qn(i){var r=di(i,!1);return Fv(r)}function Fv(i){var r=/^\s*(\d+)\s*$/.exec(i);if(r)return parseInt(r[1],10)}function ft(i){return di(i,!1).trim()}function Nv(i,r){var t=new Date(r*1e3),e=t.getUTCFullYear()+"-"+Gr(t.getUTCMonth()+1,2)+"-"+Gr(t.getUTCDate(),2)+"T"+Gr(t.getUTCHours(),2)+":"+Gr(t.getUTCMinutes(),2)+":"+Gr(t.getUTCSeconds(),2)+"Z";i.appendChild(cn().createTextNode(e))}function De(i,r){var t=r.toPrecision();i.appendChild(cn().createTextNode(t))}function ti(i,r){var t=r.toString();i.appendChild(cn().createTextNode(t))}function pt(i,r){i.appendChild(cn().createTextNode(r))}var Dv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ht=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],Gv="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",kv={rte:Sl,trk:Rl,wpt:Pl},bv=gt(ht,{rte:Mi(Sl),trk:Mi(Rl),wpt:Mi(Pl)}),jv=gt(ht,{text:K(ft,"linkText"),type:K(ft,"linkType")}),Xv=gt(ht,{rte:Y(hg),trk:Y(cg),wpt:Y(pg)}),Yv=function(i){Dv(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.dataProjection=at("EPSG:4326"),e.readExtensions_=n.readExtensions,e}return r.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,n=t.length;e<n;++e){var o=t[e];if(this.readExtensions_){var a=o.get("extensionsNode_")||null;this.readExtensions_(o,a)}o.set("extensionsNode_",void 0)}},r.prototype.readFeatureFromNode=function(t,e){if(!Jo(ht,t.namespaceURI))return null;var n=kv[t.localName];if(!n)return null;var o=n(t,[this.getReadOptions(t,e)]);return o?(this.handleReadExtensions_([o]),o):null},r.prototype.readFeaturesFromNode=function(t,e){if(!Jo(ht,t.namespaceURI))return[];if(t.localName=="gpx"){var n=wr([],bv,t,[this.getReadOptions(t,e)]);return n?(this.handleReadExtensions_(n),n):[]}return[]},r.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var n=Ro("http://www.topografix.com/GPX/1/1","gpx"),o="http://www.w3.org/2000/xmlns/";return n.setAttributeNS(o,"xmlns:xsi",Va),n.setAttributeNS(Va,"xsi:schemaLocation",Gv),n.setAttribute("version","1.1"),n.setAttribute("creator","OpenLayers"),Sr({node:n},Xv,ag,t,[e]),n},r}(Av),Uv=gt(ht,{name:K(ft),cmt:K(ft),desc:K(ft),src:K(ft),link:No,number:K(Qn),extensions:Do,type:K(ft),rtept:sg}),Wv=gt(ht,{ele:K(ne),time:K(Ao)}),Bv=gt(ht,{name:K(ft),cmt:K(ft),desc:K(ft),src:K(ft),link:No,number:K(Qn),type:K(ft),extensions:Do,trkseg:ug}),Zv=gt(ht,{trkpt:lg}),zv=gt(ht,{ele:K(ne),time:K(Ao)}),Kv=gt(ht,{ele:K(ne),time:K(Ao),magvar:K(ne),geoidheight:K(ne),name:K(ft),cmt:K(ft),desc:K(ft),src:K(ft),link:No,sym:K(ft),type:K(ft),fix:K(ft),sat:K(Qn),hdop:K(ne),vdop:K(ne),pdop:K(ne),ageofdgpsdata:K(ne),dgpsid:K(Qn),extensions:Do}),Vv=["text","type"],Hv=gt(ht,{text:Y(pt),type:Y(pt)}),$v=gt(ht,["name","cmt","desc","src","link","number","type","rtept"]),qv=gt(ht,{name:Y(pt),cmt:Y(pt),desc:Y(pt),src:Y(pt),link:Y(Go),number:Y(ti),type:Y(pt),rtept:Ol(Y(ko))}),Jv=gt(ht,["ele","time"]),Qv=gt(ht,["name","cmt","desc","src","link","number","type","trkseg"]),tg=gt(ht,{name:Y(pt),cmt:Y(pt),desc:Y(pt),src:Y(pt),link:Y(Go),number:Y(ti),type:Y(pt),trkseg:Ol(Y(fg))}),eg=Po("trkpt"),rg=gt(ht,{trkpt:Y(ko)}),ng=gt(ht,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),ig=gt(ht,{ele:Y(De),time:Y(Nv),magvar:Y(De),geoidheight:Y(De),name:Y(pt),cmt:Y(pt),desc:Y(pt),src:Y(pt),link:Y(Go),sym:Y(pt),type:Y(pt),fix:Y(pt),sat:Y(ti),hdop:Y(De),vdop:Y(De),pdop:Y(De),ageofdgpsdata:Y(De),dgpsid:Y(ti)}),og={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function ag(i,r,t){var e=i.getGeometry();if(e){var n=og[e.getType()];if(n){var o=r[r.length-1].node;return Ro(o.namespaceURI,n)}}}function Mo(i,r,t,e){return i.push(parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))),"ele"in e?(i.push(e.ele),delete e.ele,r.hasZ=!0):i.push(0),"time"in e?(i.push(e.time),delete e.time,r.hasM=!0):i.push(0),i}function Fo(i,r,t){var e=q.XY,n=2;if(i.hasZ&&i.hasM?(e=q.XYZM,n=4):i.hasZ?(e=q.XYZ,n=3):i.hasM&&(e=q.XYM,n=3),n!==4){for(var o=0,a=r.length/4;o<a;o++)r[o*n]=r[o*4],r[o*n+1]=r[o*4+1],i.hasZ&&(r[o*n+2]=r[o*4+2]),i.hasM&&(r[o*n+2]=r[o*4+3]);if(r.length=r.length/4*n,t)for(var o=0,a=t.length;o<a;o++)t[o]=t[o]/4*n}return e}function No(i,r){var t=r[r.length-1],e=i.getAttribute("href");e!==null&&(t.link=e),Io(jv,i,r)}function Do(i,r){var t=r[r.length-1];t.extensionsNode_=i}function sg(i,r){var t=wr({},Wv,i,r);if(t){var e=r[r.length-1],n=e.flatCoordinates,o=e.layoutOptions;Mo(n,o,i,t)}}function lg(i,r){var t=wr({},zv,i,r);if(t){var e=r[r.length-1],n=e.flatCoordinates,o=e.layoutOptions;Mo(n,o,i,t)}}function ug(i,r){var t=r[r.length-1];Io(Zv,i,r);var e=t.flatCoordinates,n=t.ends;n.push(e.length)}function Sl(i,r){var t=r[0],e=wr({flatCoordinates:[],layoutOptions:{}},Uv,i,r);if(!!e){var n=e.flatCoordinates;delete e.flatCoordinates;var o=e.layoutOptions;delete e.layoutOptions;var a=Fo(o,n),s=new Un(n,a);Le(s,!1,t);var l=new Oe(s);return l.setProperties(e,!0),l}}function Rl(i,r){var t=r[0],e=wr({flatCoordinates:[],ends:[],layoutOptions:{}},Bv,i,r);if(!!e){var n=e.flatCoordinates;delete e.flatCoordinates;var o=e.ends;delete e.ends;var a=e.layoutOptions;delete e.layoutOptions;var s=Fo(a,n,o),l=new vl(n,s,o);Le(l,!1,t);var u=new Oe(l);return u.setProperties(e,!0),u}}function Pl(i,r){var t=r[0],e=wr({},Kv,i,r);if(!!e){var n={},o=Mo([],n,i,e),a=Fo(n,o),s=new Pe(o,a);Le(s,!1,t);var l=new Oe(s);return l.setProperties(e,!0),l}}function Go(i,r,t){i.setAttribute("href",r);var e=t[t.length-1],n=e.properties,o=[n.linkText,n.linkType];Sr({node:i},Hv,vi,o,t,Vv)}function ko(i,r,t){var e=t[t.length-1],n=e.node,o=n.namespaceURI,a=e.properties;i.setAttributeNS(null,"lat",String(r[1])),i.setAttributeNS(null,"lon",String(r[0]));var s=e.geometryLayout;switch(s){case q.XYZM:r[3]!==0&&(a.time=r[3]);case q.XYZ:r[2]!==0&&(a.ele=r[2]);break;case q.XYM:r[2]!==0&&(a.time=r[2]);break}var l=i.nodeName=="rtept"?Jv[o]:ng[o],u=Lo(a,l);Sr({node:i,properties:a},ig,vi,u,t,l)}function hg(i,r,t){var e=t[0],n=r.getProperties(),o={node:i};o.properties=n;var a=r.getGeometry();if(a.getType()==P.LINE_STRING){var s=Le(a,!0,e);o.geometryLayout=s.getLayout(),n.rtept=s.getCoordinates()}var l=t[t.length-1].node,u=$v[l.namespaceURI],h=Lo(n,u);Sr(o,qv,vi,h,t,u)}function cg(i,r,t){var e=t[0],n=r.getProperties(),o={node:i};o.properties=n;var a=r.getGeometry();if(a.getType()==P.MULTI_LINE_STRING){var s=Le(a,!0,e);n.trkseg=s.getLineStrings()}var l=t[t.length-1].node,u=Qv[l.namespaceURI],h=Lo(n,u);Sr(o,tg,vi,h,t,u)}function fg(i,r,t){var e={node:i};e.geometryLayout=r.getLayout(),e.properties={},Sr(e,rg,eg,r.getCoordinates(),t)}function pg(i,r,t){var e=t[0],n=t[t.length-1];n.properties=r.getProperties();var o=r.getGeometry();if(o.getType()==P.POINT){var a=Le(o,!0,e);n.geometryLayout=a.getLayout(),ko(i,a.getCoordinates(),t)}}var dg=Yv,vg=.5,Qt=!0,gg=10,Ha=.25,_g=function(){function i(r,t,e,n,o,a){this.sourceProj_=r,this.targetProj_=t;var s={},l=Xn(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){var E=y[0]+"/"+y[1];return s[E]||(s[E]=l(y)),s[E]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&it(n)==it(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?it(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?it(this.targetProj_.getExtent()):null;var u=Qe(e),h=si(e),f=ai(e),c=oi(e),p=this.transformInv_(u),d=this.transformInv_(h),v=this.transformInv_(f),g=this.transformInv_(c),m=gg+(a?Math.max(0,Math.ceil(Pu(Xi(e)/(a*a*256*256)))):0);if(this.addQuad_(u,h,f,c,p,d,v,g,m),this.wrapsXInSource_){var _=1/0;this.triangles_.forEach(function(y,E,T){_=Math.min(_,y.source[0][0],y.source[1][0],y.source[2][0])}),this.triangles_.forEach(function(y){if(Math.max(y.source[0][0],y.source[1][0],y.source[2][0])-_>this.sourceWorldWidth_/2){var E=[[y.source[0][0],y.source[0][1]],[y.source[1][0],y.source[1][1]],[y.source[2][0],y.source[2][1]]];E[0][0]-_>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-_>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-_>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);var T=Math.min(E[0][0],E[1][0],E[2][0]),x=Math.max(E[0][0],E[1][0],E[2][0]);x-T<this.sourceWorldWidth_/2&&(y.source=E)}}.bind(this))}s={}}return i.prototype.addTriangle_=function(r,t,e,n,o,a){this.triangles_.push({source:[n,o,a],target:[r,t,e]})},i.prototype.addQuad_=function(r,t,e,n,o,a,s,l,u){var h=ra([o,a,s,l]),f=this.sourceWorldWidth_?it(h)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&f>.5&&f<1,d=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=ra([r,t,e,n]),g=it(v)/this.targetWorldWidth_;d=g>Ha||d}!p&&this.sourceProj_.isGlobal()&&f&&(d=f>Ha||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Rt(h,this.maxSourceExtent_))){var m=0;if(!d&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)d=!0;else if(m=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!d){var _=[(r[0]+e[0])/2,(r[1]+e[1])/2],y=this.transformInv_(_),E=void 0;if(p){var T=(yr(o[0],c)+yr(s[0],c))/2;E=T-yr(y[0],c)}else E=(o[0]+s[0])/2-y[0];var x=(o[1]+s[1])/2-y[1],w=E*E+x*x;d=w>this.errorThresholdSquared_}if(d){if(Math.abs(r[0]-e[0])<=Math.abs(r[1]-e[1])){var O=[(t[0]+e[0])/2,(t[1]+e[1])/2],R=this.transformInv_(O),M=[(n[0]+r[0])/2,(n[1]+r[1])/2],b=this.transformInv_(M);this.addQuad_(r,t,O,M,o,a,R,b,u-1),this.addQuad_(M,O,e,n,b,R,s,l,u-1)}else{var I=[(r[0]+t[0])/2,(r[1]+t[1])/2],j=this.transformInv_(I),U=[(e[0]+n[0])/2,(e[1]+n[1])/2],A=this.transformInv_(U);this.addQuad_(r,I,U,n,o,j,A,l,u-1),this.addQuad_(I,t,e,U,j,a,s,A,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(r,e,n,o,s,l),(m&14)==0&&this.addTriangle_(r,e,t,o,s,a),m&&((m&13)==0&&this.addTriangle_(t,n,r,a,l,o),(m&7)==0&&this.addTriangle_(t,n,e,a,l,s))}},i.prototype.calculateSourceExtent=function(){var r=Pt();return this.triangles_.forEach(function(t,e,n){var o=t.source;Br(r,o[0]),Br(r,o[1]),Br(r,o[2])}),r},i.prototype.getTriangles=function(){return this.triangles_},i}(),yg=_g,to={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},mg={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Di;function $a(i,r,t,e,n){i.beginPath(),i.moveTo(0,0),i.lineTo(r,t),i.lineTo(e,n),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(r,e)+1,Math.max(t,n)),i.restore()}function Gi(i,r){return Math.abs(i[r*4]-210)>2||Math.abs(i[r*4+3]-.75*255)>2}function Eg(){if(Di===void 0){var i=document.createElement("canvas").getContext("2d");i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",$a(i,4,5,4,0),$a(i,4,5,0,5);var r=i.getImageData(0,0,3,3).data;Di=Gi(r,0)||Gi(r,4)||Gi(r,8)}return Di}function qa(i,r,t,e){var n=ms(t,r,i),o=la(r,e,t),a=r.getMetersPerUnit();a!==void 0&&(o*=a);var s=i.getMetersPerUnit();s!==void 0&&(o/=s);var l=i.getExtent();if(!l||en(l,n)){var u=la(i,o,n)/o;isFinite(u)&&u>0&&(o/=u)}return o}function Tg(i,r,t,e){var n=Re(t),o=qa(i,r,n,e);return(!isFinite(o)||o<=0)&&cs(t,function(a){return o=qa(i,r,a,e),isFinite(o)&&o>0}),o}function Cg(i,r,t,e,n,o,a,s,l,u,h,f){var c=kt(Math.round(t*i),Math.round(t*r));if(f||ut(c,to),l.length===0)return c.canvas;c.scale(t,t);function p(E){return Math.round(E*t)/t}c.globalCompositeOperation="lighter";var d=Pt();l.forEach(function(E,T,x){oo(d,E.extent)});var v=it(d),g=Ut(d),m=kt(Math.round(t*v/e),Math.round(t*g/e));f||ut(m,to);var _=t/e;l.forEach(function(E,T,x){var w=E.extent[0]-d[0],O=-(E.extent[3]-d[3]),R=it(E.extent),M=Ut(E.extent);E.image.width>0&&E.image.height>0&&m.drawImage(E.image,u,u,E.image.width-2*u,E.image.height-2*u,w*_,O*_,R*_,M*_)});var y=Qe(a);return s.getTriangles().forEach(function(E,T,x){var w=E.source,O=E.target,R=w[0][0],M=w[0][1],b=w[1][0],I=w[1][1],j=w[2][0],U=w[2][1],A=p((O[0][0]-y[0])/o),k=p(-(O[0][1]-y[1])/o),L=p((O[1][0]-y[0])/o),z=p(-(O[1][1]-y[1])/o),Z=p((O[2][0]-y[0])/o),V=p(-(O[2][1]-y[1])/o),Q=R,C=M;R=0,M=0,b-=Q,I-=C,j-=Q,U-=C;var lt=[[b,I,0,0,L-A],[j,U,0,0,Z-A],[0,0,b,I,z-k],[0,0,j,U,V-k]],X=Iu(lt);if(!!X){if(c.save(),c.beginPath(),Eg()||!f){c.moveTo(L,z);for(var ct=4,Lt=A-L,It=k-z,xt=0;xt<ct;xt++)c.lineTo(L+p((xt+1)*Lt/ct),z+p(xt*It/(ct-1))),xt!=ct-1&&c.lineTo(L+p((xt+1)*Lt/ct),z+p((xt+1)*It/(ct-1)));c.lineTo(Z,V)}else c.moveTo(L,z),c.lineTo(A,k),c.lineTo(Z,V);c.clip(),c.transform(X[0],X[2],X[1],X[3],A,k),c.translate(d[0]-Q,d[3]-C),c.scale(e/t,-e/t),c.drawImage(m.canvas,0,0),c.restore()}}),h&&(c.save(),c.globalCompositeOperation="source-over",c.strokeStyle="black",c.lineWidth=1,s.getTriangles().forEach(function(E,T,x){var w=E.target,O=(w[0][0]-y[0])/o,R=-(w[0][1]-y[1])/o,M=(w[1][0]-y[0])/o,b=-(w[1][1]-y[1])/o,I=(w[2][0]-y[0])/o,j=-(w[2][1]-y[1])/o;c.beginPath(),c.moveTo(M,b),c.lineTo(O,R),c.lineTo(I,j),c.closePath(),c.stroke()}),c.restore()),c.canvas}var xg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Og=function(i){xg(r,i);function r(t,e,n,o,a,s,l,u,h,f,c,p){var d=i.call(this,a,D.IDLE,{interpolate:!!p})||this;d.renderEdges_=c!==void 0?c:!1,d.pixelRatio_=l,d.gutter_=u,d.canvas_=null,d.sourceTileGrid_=e,d.targetTileGrid_=o,d.wrappedTileCoord_=s||a,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var v=o.getTileCoordExtent(d.wrappedTileCoord_),g=d.targetTileGrid_.getExtent(),m=d.sourceTileGrid_.getExtent(),_=g?Zr(v,g):v;if(Xi(_)===0)return d.state=D.EMPTY,d;var y=t.getExtent();y&&(m?m=Zr(m,y):m=y);var E=o.getResolution(d.wrappedTileCoord_[0]),T=Tg(t,n,_,E);if(!isFinite(T)||T<=0)return d.state=D.EMPTY,d;var x=f!==void 0?f:vg;if(d.triangulation_=new yg(t,n,_,m,T*x,E),d.triangulation_.getTriangles().length===0)return d.state=D.EMPTY,d;d.sourceZ_=e.getZForResolution(T);var w=d.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(w[1]=ot(w[1],m[1],m[3]),w[3]=ot(w[3],m[1],m[3])):w=Zr(w,m)),!Xi(w))d.state=D.EMPTY;else{for(var O=e.getTileRangeForExtentAndZ(w,d.sourceZ_),R=O.minX;R<=O.maxX;R++)for(var M=O.minY;M<=O.maxY;M++){var b=h(d.sourceZ_,R,M,l);b&&d.sourceTiles_.push(b)}d.sourceTiles_.length===0&&(d.state=D.EMPTY)}return d}return r.prototype.getImage=function(){return this.canvas_},r.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(h,f,c){h&&h.getState()==D.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(h.tileCoord),image:h.getImage()})}.bind(this)),this.sourceTiles_.length=0,t.length===0)this.state=D.ERROR;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),o=typeof n=="number"?n:n[0],a=typeof n=="number"?n:n[1],s=this.targetTileGrid_.getResolution(e),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Cg(o,a,this.pixelRatio_,l,this.sourceTileGrid_.getExtent(),s,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=D.LOADED}this.changed()},r.prototype.load=function(){if(this.state==D.IDLE){this.state=D.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,o){var a=e.getState();if(a==D.IDLE||a==D.LOADING){t++;var s=W(e,G.CHANGE,function(l){var u=e.getState();(u==D.LOADED||u==D.ERROR||u==D.EMPTY)&&(J(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(s)}}.bind(this)),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,n,o){var a=e.getState();a==D.IDLE&&e.load()})}},r.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(J),this.sourcesListenerKeys_=null},r}(el),Ll=Og,ki={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},wg=[0,0,0],ve=5,Sg=function(){function i(r){this.minZoom=r.minZoom!==void 0?r.minZoom:0,this.resolutions_=r.resolutions,B(ru(this.resolutions_,function(a,s){return s-a},!0),17);var t;if(!r.origins){for(var e=0,n=this.resolutions_.length-1;e<n;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=r.origin!==void 0?r.origin:null,this.origins_=null,r.origins!==void 0&&(this.origins_=r.origins,B(this.origins_.length==this.resolutions_.length,20));var o=r.extent;o!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Qe(o)),B(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,r.tileSizes!==void 0&&(this.tileSizes_=r.tileSizes,B(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=r.tileSize!==void 0?r.tileSize:this.tileSizes_?null:To,B(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=o!==void 0?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],r.sizes!==void 0?this.fullTileRanges_=r.sizes.map(function(a,s){var l=new Tl(Math.min(0,a[0]),Math.max(a[0]-1,-1),Math.min(0,a[1]),Math.max(a[1]-1,-1));if(o){var u=this.getTileRangeForExtentAndZ(o,s);l.minX=Math.max(u.minX,l.minX),l.maxX=Math.min(u.maxX,l.maxX),l.minY=Math.max(u.minY,l.minY),l.maxY=Math.min(u.maxY,l.maxY)}return l},this):o&&this.calculateTileRanges_(o)}return i.prototype.forEachTileCoord=function(r,t,e){for(var n=this.getTileRangeForExtentAndZ(r,t),o=n.minX,a=n.maxX;o<=a;++o)for(var s=n.minY,l=n.maxY;s<=l;++s)e([t,o,s])},i.prototype.forEachTileCoordParentTileRange=function(r,t,e,n){var o,a,s,l=null,u=r[0]-1;for(this.zoomFactor_===2?(a=r[1],s=r[2]):l=this.getTileCoordExtent(r,n);u>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=cr(a,a,s,s,e)):o=this.getTileRangeForExtentAndZ(l,u,e),t(u,o))return!0;--u}return!1},i.prototype.getExtent=function(){return this.extent_},i.prototype.getMaxZoom=function(){return this.maxZoom},i.prototype.getMinZoom=function(){return this.minZoom},i.prototype.getOrigin=function(r){return this.origin_?this.origin_:this.origins_[r]},i.prototype.getResolution=function(r){return this.resolutions_[r]},i.prototype.getResolutions=function(){return this.resolutions_},i.prototype.getTileCoordChildTileRange=function(r,t,e){if(r[0]<this.maxZoom){if(this.zoomFactor_===2){var n=r[1]*2,o=r[2]*2;return cr(n,n+1,o,o+1,t)}var a=this.getTileCoordExtent(r,e||this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,r[0]+1,t)}return null},i.prototype.getTileRangeForTileCoordAndZ=function(r,t,e){if(t>this.maxZoom||t<this.minZoom)return null;var n=r[0],o=r[1],a=r[2];if(t===n)return cr(o,a,o,a,e);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,t-n),l=Math.floor(o*s),u=Math.floor(a*s);if(t<n)return cr(l,l,u,u,e);var h=Math.floor(s*(o+1))-1,f=Math.floor(s*(a+1))-1;return cr(l,h,u,f,e)}var c=this.getTileCoordExtent(r,this.tmpExtent_);return this.getTileRangeForExtentAndZ(c,t,e)},i.prototype.getTileRangeExtent=function(r,t,e){var n=this.getOrigin(r),o=this.getResolution(r),a=Ft(this.getTileSize(r),this.tmpSize_),s=n[0]+t.minX*a[0]*o,l=n[0]+(t.maxX+1)*a[0]*o,u=n[1]+t.minY*a[1]*o,h=n[1]+(t.maxY+1)*a[1]*o;return le(s,u,l,h,e)},i.prototype.getTileRangeForExtentAndZ=function(r,t,e){var n=wg;this.getTileCoordForXYAndZ_(r[0],r[3],t,!1,n);var o=n[1],a=n[2];return this.getTileCoordForXYAndZ_(r[2],r[1],t,!0,n),cr(o,n[1],a,n[2],e)},i.prototype.getTileCoordCenter=function(r){var t=this.getOrigin(r[0]),e=this.getResolution(r[0]),n=Ft(this.getTileSize(r[0]),this.tmpSize_);return[t[0]+(r[1]+.5)*n[0]*e,t[1]-(r[2]+.5)*n[1]*e]},i.prototype.getTileCoordExtent=function(r,t){var e=this.getOrigin(r[0]),n=this.getResolution(r[0]),o=Ft(this.getTileSize(r[0]),this.tmpSize_),a=e[0]+r[1]*o[0]*n,s=e[1]-(r[2]+1)*o[1]*n,l=a+o[0]*n,u=s+o[1]*n;return le(a,s,l,u,t)},i.prototype.getTileCoordForCoordAndResolution=function(r,t,e){return this.getTileCoordForXYAndResolution_(r[0],r[1],t,!1,e)},i.prototype.getTileCoordForXYAndResolution_=function(r,t,e,n,o){var a=this.getZForResolution(e),s=e/this.getResolution(a),l=this.getOrigin(a),u=Ft(this.getTileSize(a),this.tmpSize_),h=s*(r-l[0])/e/u[0],f=s*(l[1]-t)/e/u[1];return n?(h=xn(h,ve)-1,f=xn(f,ve)-1):(h=Cn(h,ve),f=Cn(f,ve)),Za(a,h,f,o)},i.prototype.getTileCoordForXYAndZ_=function(r,t,e,n,o){var a=this.getOrigin(e),s=this.getResolution(e),l=Ft(this.getTileSize(e),this.tmpSize_),u=(r-a[0])/s/l[0],h=(a[1]-t)/s/l[1];return n?(u=xn(u,ve)-1,h=xn(h,ve)-1):(u=Cn(u,ve),h=Cn(h,ve)),Za(e,u,h,o)},i.prototype.getTileCoordForCoordAndZ=function(r,t,e){return this.getTileCoordForXYAndZ_(r[0],r[1],t,!1,e)},i.prototype.getTileCoordResolution=function(r){return this.resolutions_[r[0]]},i.prototype.getTileSize=function(r){return this.tileSize_?this.tileSize_:this.tileSizes_[r]},i.prototype.getFullTileRange=function(r){return this.fullTileRanges_?this.fullTileRanges_[r]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,r):null},i.prototype.getZForResolution=function(r,t){var e=ro(this.resolutions_,r,t||0);return ot(e,this.minZoom,this.maxZoom)},i.prototype.calculateTileRanges_=function(r){for(var t=this.resolutions_.length,e=new Array(t),n=this.minZoom;n<t;++n)e[n]=this.getTileRangeForExtentAndZ(r,n);this.fullTileRanges_=e},i}(),Il=Sg;function Al(i){var r=i.getDefaultTileGrid();return r||(r=Ig(i),i.setDefaultTileGrid(r)),r}function Rg(i,r,t){var e=r[0],n=i.getTileCoordCenter(r),o=bo(t);if(en(o,n))return r;var a=it(o),s=Math.ceil((o[0]-n[0])/a);return n[0]+=a*s,i.getTileCoordForCoordAndZ(n,e)}function Pg(i,r,t,e){var n=e!==void 0?e:Xr.TOP_LEFT,o=Ml(i,r,t);return new Il({extent:i,origin:Cu(i,n),resolutions:o,tileSize:t})}function Lg(i){var r=i||{},t=r.extent||at("EPSG:3857").getExtent(),e={extent:t,minZoom:r.minZoom,tileSize:r.tileSize,resolutions:Ml(t,r.maxZoom,r.tileSize,r.maxResolution)};return new Il(e)}function Ml(i,r,t,e){for(var n=r!==void 0?r:_p,o=Ut(i),a=it(i),s=Ft(t!==void 0?t:To),l=e>0?e:Math.max(a/s[0],o/s[1]),u=n+1,h=new Array(u),f=0;f<u;++f)h[f]=l/Math.pow(2,f);return h}function Ig(i,r,t,e){var n=bo(i);return Pg(n,r,t,e)}function bo(i){i=at(i);var r=i.getExtent();if(!r){var t=180*Vt[oe.DEGREES]/i.getMetersPerUnit();r=le(-t,-t,t,t)}return r}var Fl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ag=function(i){Fl(r,i);function r(t){var e=i.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate})||this;e.on,e.once,e.un,e.opaque_=t.opaque!==void 0?t.opaque:!1,e.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,e.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;var n=[256,256];return e.tileGrid&&Ft(e.tileGrid.getTileSize(e.tileGrid.getMinZoom()),n),e.tileCache=new ml(t.cacheSize||0),e.tmpSize=[0,0],e.key_=t.key||"",e.tileOptions={transition:t.transition,interpolate:t.interpolate},e.zDirection=t.zDirection?t.zDirection:0,e}return r.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},r.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},r.prototype.forEachLoadedTile=function(t,e,n,o){var a=this.getTileCacheForProjection(t);if(!a)return!1;for(var s=!0,l,u,h,f=n.minX;f<=n.maxX;++f)for(var c=n.minY;c<=n.maxY;++c)u=pi(e,f,c),h=!1,a.containsKey(u)&&(l=a.get(u),h=l.getState()===D.LOADED,h&&(h=o(l)!==!1)),h||(s=!1);return s},r.prototype.getGutterForProjection=function(t){return 0},r.prototype.getKey=function(){return this.key_},r.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},r.prototype.getOpaque=function(t){return this.opaque_},r.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},r.prototype.getTile=function(t,e,n,o,a){return F()},r.prototype.getTileGrid=function(){return this.tileGrid},r.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Al(t)},r.prototype.getTileCacheForProjection=function(t){return B(ke(this.getProjection(),t),68),this.tileCache},r.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},r.prototype.getTilePixelSize=function(t,e,n){var o=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),s=Ft(o.getTileSize(t),this.tmpSize);return a==1?s:Dh(s,a,this.tmpSize)},r.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=e!==void 0?e:this.getProjection(),o=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Rg(o,t,n)),nv(t,o)?t:null},r.prototype.clear=function(){this.tileCache.clear()},r.prototype.refresh=function(){this.clear(),i.prototype.refresh.call(this)},r.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},r.prototype.useTile=function(t,e,n,o){},r}(Js),Mg=function(i){Fl(r,i);function r(t,e){var n=i.call(this,t)||this;return n.tile=e,n}return r}(Ht),Fg=Ag;function Ng(i,r){var t=/\{z\}/g,e=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){if(a)return i.replace(t,a[0].toString()).replace(e,a[1].toString()).replace(n,a[2].toString()).replace(o,function(){var u=a[0],h=r.getFullTileRange(u);B(h,55);var f=h.getHeight()-a[2]-1;return f.toString()})}}function Dg(i,r){for(var t=i.length,e=new Array(t),n=0;n<t;++n)e[n]=Ng(i[n],r);return Gg(e)}function Gg(i){return i.length===1?i[0]:function(r,t,e){if(r){var n=rv(r),o=yr(n,i.length);return i[o](r,t,e)}else return}}function kg(i){var r=[],t=/\{([a-z])-([a-z])\}/.exec(i);if(t){var e=t[1].charCodeAt(0),n=t[2].charCodeAt(0),o=void 0;for(o=e;o<=n;++o)r.push(i.replace(t[0],String.fromCharCode(o)));return r}if(t=/\{(\d+)-(\d+)\}/.exec(i),t){for(var a=parseInt(t[2],10),s=parseInt(t[1],10);s<=a;s++)r.push(i.replace(t[0],s.toString()));return r}return r.push(i),r}var bg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),jg=function(i){bg(r,i);function r(t){var e=i.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return e.generateTileUrlFunction_=e.tileUrlFunction===r.prototype.tileUrlFunction,e.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(e.tileUrlFunction=t.tileUrlFunction),e.urls=null,t.urls?e.setUrls(t.urls):t.url&&e.setUrl(t.url),e.tileLoadingKeys_={},e}return r.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},r.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},r.prototype.getUrls=function(){return this.urls},r.prototype.handleTileChange=function(t){var e=t.target,n=H(e),o=e.getState(),a;o==D.LOADING?(this.tileLoadingKeys_[n]=!0,a=ki.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],a=o==D.ERROR?ki.TILELOADERROR:o==D.LOADED?ki.TILELOADEND:void 0),a!=null&&this.dispatchEvent(new Mg(a,e))},r.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},r.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e!="undefined"?this.setKey(e):this.changed()},r.prototype.setUrl=function(t){var e=kg(t);this.urls=e,this.setUrls(e)},r.prototype.setUrls=function(t){this.urls=t;var e=t.join(`
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Dg(t,this.tileGrid),e):this.setKey(e)},r.prototype.tileUrlFunction=function(t,e,n){},r.prototype.useTile=function(t,e,n){var o=pi(t,e,n);this.tileCache.containsKey(o)&&this.tileCache.get(o)},r}(Fg),Xg=jg,Yg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ug=function(i){Yg(r,i);function r(t){var e=this,n=t.imageSmoothing!==void 0?t.imageSmoothing:!0;return t.interpolate!==void 0&&(n=t.interpolate),e=i.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Wg,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:n,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this,e.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,e.tileClass=t.tileClass!==void 0?t.tileClass:rl,e.tileCacheForProjection={},e.tileGridForProjection={},e.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,e.renderReprojectionEdges_=!1,e}return r.prototype.canExpireCache=function(){if(!Qt)return i.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},r.prototype.expireCache=function(t,e){if(!Qt){i.prototype.expireCache.call(this,t,e);return}var n=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==n?e:{});for(var o in this.tileCacheForProjection){var a=this.tileCacheForProjection[o];a.expireCache(a==n?e:{})}},r.prototype.getGutterForProjection=function(t){return Qt&&this.getProjection()&&t&&!ke(this.getProjection(),t)?0:this.getGutter()},r.prototype.getGutter=function(){return 0},r.prototype.getKey=function(){var t=i.prototype.getKey.call(this);return this.getInterpolate()||(t+=":disable-interpolation"),t},r.prototype.getOpaque=function(t){return Qt&&this.getProjection()&&t&&!ke(this.getProjection(),t)?!1:i.prototype.getOpaque.call(this,t)},r.prototype.getTileGridForProjection=function(t){if(!Qt)return i.prototype.getTileGridForProjection.call(this,t);var e=this.getProjection();if(this.tileGrid&&(!e||ke(e,t)))return this.tileGrid;var n=H(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Al(t)),this.tileGridForProjection[n]},r.prototype.getTileCacheForProjection=function(t){if(!Qt)return i.prototype.getTileCacheForProjection.call(this,t);var e=this.getProjection();if(!e||ke(e,t))return this.tileCache;var n=H(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new ml(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},r.prototype.createTile_=function(t,e,n,o,a,s){var l=[t,e,n],u=this.getTileCoordForTileUrlFunction(l,a),h=u?this.tileUrlFunction(u,o,a):void 0,f=new this.tileClass(l,h!==void 0?D.IDLE:D.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return f.key=s,f.addEventListener(G.CHANGE,this.handleTileChange.bind(this)),f},r.prototype.getTile=function(t,e,n,o,a){var s=this.getProjection();if(!Qt||!s||!a||ke(s,a))return this.getTileInternal(t,e,n,o,s||a);var l=this.getTileCacheForProjection(a),u=[t,e,n],h=void 0,f=yl(u);l.containsKey(f)&&(h=l.get(f));var c=this.getKey();if(h&&h.key==c)return h;var p=this.getTileGridForProjection(s),d=this.getTileGridForProjection(a),v=this.getTileCoordForTileUrlFunction(u,a),g=new Ll(s,p,a,d,u,v,this.getTilePixelRatio(o),this.getGutter(),function(m,_,y,E){return this.getTileInternal(m,_,y,E,s)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return g.key=c,h?(g.interimTile=h,g.refreshInterimChain(),l.replace(f,g)):l.set(f,g),g},r.prototype.getTileInternal=function(t,e,n,o,a){var s=null,l=pi(t,e,n),u=this.getKey();if(!this.tileCache.containsKey(l))s=this.createTile_(t,e,n,o,a,u),this.tileCache.set(l,s);else if(s=this.tileCache.get(l),s.key!=u){var h=s;s=this.createTile_(t,e,n,o,a,u),h.getState()==D.IDLE?s.interimTile=h.interimTile:s.interimTile=h,s.refreshInterimChain(),this.tileCache.replace(l,s)}return s},r.prototype.setRenderReprojectionEdges=function(t){if(!(!Qt||this.renderReprojectionEdges_==t)){this.renderReprojectionEdges_=t;for(var e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},r.prototype.setTileGridForProjection=function(t,e){if(Qt){var n=at(t);if(n){var o=H(n);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}}},r}(Xg);function Wg(i,r){i.getImage().src=r}var Bg=Ug,Zg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),zg=function(i){Zg(r,i);function r(t){var e=t||{},n=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(n=e.interpolate);var o=e.projection!==void 0?e.projection:"EPSG:3857",a=e.tileGrid!==void 0?e.tileGrid:Lg({extent:bo(o),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});return i.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:n,opaque:e.opaque,projection:o,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:a,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this}return r}(Bg),jo=zg,Kg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Vg=function(i){Kg(r,i);function r(t){var e=i.call(this,{attributions:t.attributions,wrapX:t.wrapX})||this;return e.resolution=void 0,e.distance=t.distance!==void 0?t.distance:20,e.minDistance=t.minDistance||0,e.interpolationRatio=0,e.features=[],e.geometryFunction=t.geometryFunction||function(n){var o=n.getGeometry();return B(o.getType()==P.POINT,10),o},e.createCustomCluster_=t.createCluster,e.source=null,e.boundRefresh_=e.refresh.bind(e),e.updateDistance(e.distance,e.minDistance),e.setSource(t.source||null),e}return r.prototype.clear=function(t){this.features.length=0,i.prototype.clear.call(this,t)},r.prototype.getDistance=function(){return this.distance},r.prototype.getSource=function(){return this.source},r.prototype.loadFeatures=function(t,e,n){this.source.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())},r.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},r.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},r.prototype.getMinDistance=function(){return this.minDistance},r.prototype.setSource=function(t){this.source&&this.source.removeEventListener(G.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(G.CHANGE,this.boundRefresh_),this.refresh()},r.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},r.prototype.updateDistance=function(t,e){var n=t===0?0:Math.min(e,t)/t,o=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,o&&this.refresh()},r.prototype.cluster=function(){if(!(this.resolution===void 0||!this.source))for(var t=Pt(),e=this.distance*this.resolution,n=this.source.getFeatures(),o={},a=0,s=n.length;a<s;a++){var l=n[a];if(!(H(l)in o)){var u=this.geometryFunction(l);if(u){var h=u.getCoordinates();ls(h,t),ii(t,e,t);var f=this.source.getFeaturesInExtent(t).filter(function(c){var p=H(c);return p in o?!1:(o[p]=!0,!0)});this.features.push(this.createCluster(f,t))}}}},r.prototype.createCluster=function(t,e){for(var n=[0,0],o=t.length-1;o>=0;--o){var a=this.geometryFunction(t[o]);a?ds(n,a.getCoordinates()):t.splice(o,1)}vs(n,1/t.length);var s=Re(e),l=this.interpolationRatio,u=new Pe([n[0]*(1-l)+s[0]*l,n[1]*(1-l)+s[1]*l]);return this.createCustomCluster_?this.createCustomCluster_(u,t):new Oe({geometry:u,features:t})},r}(dr),Hg=Vg,$g=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Nl='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',qg=function(i){$g(r,i);function r(t){var e=t||{},n=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(n=e.interpolate);var o;e.attributions!==void 0?o=e.attributions:o=[Nl];var a=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return i.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:a,interpolate:n,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,opaque:e.opaque!==void 0?e.opaque:!0,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})||this}return r}(jo),Jg=qg,Dn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"},Qg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),t_=function(i){Qg(r,i);function r(t){var e=this,n=t||{},o=ut({},n);return delete o.preload,delete o.useInterimTilesOnError,e=i.call(this,o)||this,e.on,e.once,e.un,e.setPreload(n.preload!==void 0?n.preload:0),e.setUseInterimTilesOnError(n.useInterimTilesOnError!==void 0?n.useInterimTilesOnError:!0),e}return r.prototype.getPreload=function(){return this.get(Dn.PRELOAD)},r.prototype.setPreload=function(t){this.set(Dn.PRELOAD,t)},r.prototype.getUseInterimTilesOnError=function(){return this.get(Dn.USE_INTERIM_TILES_ON_ERROR)},r.prototype.setUseInterimTilesOnError=function(t){this.set(Dn.USE_INTERIM_TILES_ON_ERROR,t)},r.prototype.getData=function(t){return i.prototype.getData.call(this,t)},r}(ci),e_=t_,r_=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),n_=function(i){r_(r,i);function r(t){var e=i.call(this,t)||this;return e.extentChanged=!0,e.renderedExtent_=null,e.renderedPixelRatio,e.renderedProjection=null,e.renderedRevision,e.renderedTiles=[],e.newTiles_=!1,e.tmpExtent=Pt(),e.tmpTileRange_=new Tl(0,0,0,0),e}return r.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),o=e.getUseInterimTilesOnError();return n==D.LOADED||n==D.EMPTY||n==D.ERROR&&!o},r.prototype.getTile=function(t,e,n,o){var a=o.pixelRatio,s=o.viewState.projection,l=this.getLayer(),u=l.getSource(),h=u.getTile(t,e,n,a,s);return h.getState()==D.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):h.setState(D.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},r.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),o=st(e.pixelToCoordinateTransform,t.slice()),a=n.getExtent();if(a&&!en(a,o))return null;for(var s=e.pixelRatio,l=e.viewState.projection,u=e.viewState,h=n.getRenderSource(),f=h.getTileGridForProjection(u.projection),c=h.getTilePixelRatio(e.pixelRatio),p=f.getZForResolution(u.resolution);p>=f.getMinZoom();--p){var d=f.getTileCoordForCoordAndZ(o,p),v=h.getTile(p,d[1],d[2],s,l);if(!(v instanceof rl||v instanceof Ll))return null;if(v.getState()===D.LOADED){var g=f.getOrigin(p),m=Ft(f.getTileSize(p)),_=f.getResolution(p),y=Math.floor(c*((o[0]-g[0])/_-d[1]*m[0])),E=Math.floor(c*((g[1]-o[1])/_-d[2]*m[1]));return this.getImageData(v.getImage(),y,E)}}return null},r.prototype.loadedTileCallback=function(t,e,n){return this.isDrawableTile(n)?i.prototype.loadedTileCallback.call(this,t,e,n):!1},r.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},r.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],o=t.viewState,a=o.projection,s=o.resolution,l=o.center,u=o.rotation,h=t.pixelRatio,f=this.getLayer(),c=f.getSource(),p=c.getRevision(),d=c.getTileGridForProjection(a),v=d.getZForResolution(s,c.zDirection),g=d.getResolution(v),m=t.extent,_=n.extent&&Xe(n.extent);_&&(m=Zr(m,Xe(n.extent)));var y=c.getTilePixelRatio(h),E=Math.round(t.size[0]*y),T=Math.round(t.size[1]*y);if(u){var x=Math.round(Math.sqrt(E*E+T*T));E=x,T=x}var w=g*E/2/y,O=g*T/2/y,R=[l[0]-w,l[1]-O,l[0]+w,l[1]+O],M=d.getTileRangeForExtentAndZ(m,v),b={};b[v]={};var I=this.createLoadedTileFinder(c,a,b),j=this.tmpExtent,U=this.tmpTileRange_;this.newTiles_=!1;for(var A=M.minX;A<=M.maxX;++A)for(var k=M.minY;k<=M.maxY;++k){var L=this.getTile(v,A,k,t);if(this.isDrawableTile(L)){var z=H(this);if(L.getState()==D.LOADED){b[v][L.tileCoord.toString()]=L;var Z=L.inTransition(z);!this.newTiles_&&(Z||this.renderedTiles.indexOf(L)===-1)&&(this.newTiles_=!0)}if(L.getAlpha(z,t.time)===1)continue}var V=d.getTileCoordChildTileRange(L.tileCoord,U,j),Q=!1;V&&(Q=I(v+1,V)),Q||d.forEachTileCoordParentTileRange(L.tileCoord,I,U,j)}var C=g/s;se(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,u,-E/2,-T/2);var lt=as(this.pixelTransform);this.useContainer(e,lt,n.opacity,this.getBackground(t));var X=this.context,ct=X.canvas;no(this.inversePixelTransform,this.pixelTransform),se(this.tempTransform,E/2,T/2,C,C,0,-E/2,-T/2),ct.width!=E||ct.height!=T?(ct.width=E,ct.height=T):this.containerReused||X.clearRect(0,0,E,T),_&&this.clipUnrotated(X,t,_),c.getInterpolate()||ut(X,to),this.preRender(X,t),this.renderedTiles.length=0;var Lt=Object.keys(b).map(Number);Lt.sort(Ke);var It,xt,At;n.opacity===1&&(!this.containerReused||c.getOpaque(t.viewState.projection))?Lt=Lt.reverse():(It=[],xt=[]);for(var rr=Lt.length-1;rr>=0;--rr){var Wt=Lt[rr],fn=c.getTilePixelSize(Wt,h,a),pn=d.getResolution(Wt),ue=pn/g,nr=fn[0]*ue*C,dn=fn[1]*ue*C,Rr=d.getTileCoordForCoordAndZ(Qe(R),Wt),vn=d.getTileCoordExtent(Rr),Ie=st(this.tempTransform,[y*(vn[0]-R[0])/g,y*(R[3]-vn[3])/g]),Pr=y*c.getGutterForProjection(a),gn=b[Wt];for(var ir in gn){var L=gn[ir],he=L.tileCoord,or=Rr[1]-he[1],gi=Math.round(Ie[0]-(or-1)*nr),_n=Rr[2]-he[2],Lr=Math.round(Ie[1]-(_n-1)*dn),A=Math.round(Ie[0]-or*nr),k=Math.round(Ie[1]-_n*dn),$t=gi-A,Bt=Lr-k,Ae=v===Wt,Z=Ae&&L.getAlpha(H(this),t.time)!==1,Ir=!1;if(!Z)if(It){At=[A,k,A+$t,k,A+$t,k+Bt,A,k+Bt];for(var Ot=0,yn=It.length;Ot<yn;++Ot)if(v!==Wt&&Wt<xt[Ot]){var _t=It[Ot];Rt([A,k,A+$t,k+Bt],[_t[0],_t[3],_t[4],_t[7]])&&(Ir||(X.save(),Ir=!0),X.beginPath(),X.moveTo(At[0],At[1]),X.lineTo(At[2],At[3]),X.lineTo(At[4],At[5]),X.lineTo(At[6],At[7]),X.moveTo(_t[6],_t[7]),X.lineTo(_t[4],_t[5]),X.lineTo(_t[2],_t[3]),X.lineTo(_t[0],_t[1]),X.clip())}It.push(At),xt.push(Wt)}else X.clearRect(A,k,$t,Bt);this.drawTileImage(L,t,A,k,$t,Bt,Pr,Ae),It&&!Z?(Ir&&X.restore(),this.renderedTiles.unshift(L)):this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,c,L)}}this.renderedRevision=p,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!zr(this.renderedExtent_,R),this.renderedExtent_=R,this.renderedPixelRatio=h,this.renderedProjection=a,this.manageTilePyramid(t,c,d,h,a,m,v,f.getPreload()),this.scheduleExpireCache(t,c),this.postRender(X,t),n.extent&&X.restore(),ut(X,mg),lt!==ct.style.transform&&(ct.style.transform=lt);var ar=js(n.opacity),Me=this.container;return ar!==Me.style.opacity&&(Me.style.opacity=ar),this.container},r.prototype.drawTileImage=function(t,e,n,o,a,s,l,u){var h=this.getTileImage(t);if(!!h){var f=H(this),c=u?t.getAlpha(f,e.time):1,p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(h,l,l,h.width-2*l,h.height-2*l,n,o,a,s),p&&this.context.restore(),c!==1?e.animate=!0:u&&t.endTransition(f)}},r.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},r.prototype.getTileImage=function(t){return t.getImage()},r.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(o,a,s){var l=H(o);l in s.usedTiles&&o.expireCache(s.viewState.projection,s.usedTiles[l])}.bind(null,e);t.postRenderFunctions.push(n)}},r.prototype.updateUsedTiles=function(t,e,n){var o=H(e);o in t||(t[o]={}),t[o][n.getKey()]=!0},r.prototype.manageTilePyramid=function(t,e,n,o,a,s,l,u,h){var f=H(e);f in t.wantedTiles||(t.wantedTiles[f]={});var c=t.wantedTiles[f],p=t.tileQueue,d=n.getMinZoom(),v=0,g,m,_,y,E,T;for(T=d;T<=l;++T)for(m=n.getTileRangeForExtentAndZ(s,T,m),_=n.getResolution(T),y=m.minX;y<=m.maxX;++y)for(E=m.minY;E<=m.maxY;++E)l-T<=u?(++v,g=e.getTile(T,y,E,o,a),g.getState()==D.IDLE&&(c[g.getKey()]=!0,p.isKeyQueued(g.getKey())||p.enqueue([g,f,n.getTileCoordCenter(g.tileCoord),_])),h!==void 0&&h(g)):e.useTile(T,y,E,a);e.updateCacheSize(v,a)},r}(Hs),i_=n_,o_=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),a_=function(i){o_(r,i);function r(t){return i.call(this,t)||this}return r.prototype.createRenderer=function(){return new i_(this)},r}(e_),bi=a_,s_=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),l_=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',Nl],u_={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},h_={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},c_=function(i){s_(r,i);function r(t){var e=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(e=t.interpolate);var n=t.layer.indexOf("-"),o=n==-1?t.layer:t.layer.slice(0,n),a=h_[o],s=u_[t.layer],l=t.url!==void 0?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+s.extension;return i.call(this,{attributions:l_,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:e,maxZoom:t.maxZoom!=null?t.maxZoom:a.maxZoom,minZoom:t.minZoom!=null?t.minZoom:a.minZoom,opaque:s.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:l,wrapX:t.wrapX,zDirection:t.zDirection})||this}return r}(jo),f_=c_;if(typeof Dl!="object")var Dl={};const S={mapWrapClass:"a2g-map-wrap",mapClass:"a2g-map",convexHullFill:null,convexHullStroke:null,textFill:null,textStroke:null,innerCircle:null,outerCircle:null,initMapConfig:function(i){this.layers.maptiler.a===null&&i.api&&i.api.maptiler&&i.api.maptiler.key&&(this.layers.maptiler.a=i.api.maptiler.key),this.layers.thunderforest.a===null&&i.api&&i.api.thunderforest&&i.api.thunderforest.key&&(this.layers.thunderforest.a=i.api.thunderforest.key),this.convexHullFill===null&&(i.style&&typeof i.style.convexHullFill=="object"?this.convexHullFill=new Tt(i.style.convexHullFill):this.convexHullFill=new Tt({color:"rgba(255, 153, 0, 0.4)"})),this.convexHullStroke===null&&(i.style&&typeof i.style.convexHullStroke=="object"?this.convexHullStroke=new Et(i.style.convexHullStroke):this.convexHullStroke=new Et({color:"rgba(255, 153, 0, 0.4)"})),this.textFill===null&&(i.style&&typeof i.style.textFill=="object"?this.textFill=new Tt(i.style.textFill):this.textFill=new Tt({color:"rgba(0, 0, 0, 0.9)"})),this.textStroke===null&&(i.style&&typeof i.style.textStroke=="object"?this.textStroke=new Et(i.style.textStroke):this.textStroke=new Et({color:"rgba(255, 153, 0, 0.4)"})),this.innerCircle===null&&(i.style&&typeof i.style.innerCircle=="object"?this.innerCircle=new ge({radius:i.style.innerCircle.radius,fill:new Tt(i.style.innerCircle.fill)}):this.innerCircle=new ge({radius:14,fill:new Tt({color:"rgba(255, 165, 0, 0.7)"})})),this.outerCircle===null&&(i.style&&typeof i.style.outerCircle=="object"?this.outerCircle=new ge({radius:i.style.outerCircle.radius,fill:new Tt(i.style.outerCircle.fill)}):this.outerCircle=new ge({radius:14,fill:new Tt({color:"rgba(255, 165, 0, 0.7)"})})),i.style&&i.style.gpx?this.gpx.initConfig(i.style.gpx):this.gpx.initConfig({})},styles:[],mapWraps:[],maps:[],mapConfigs:[],mapObjects:[],gpx:{mapSources:[],mapLayers:[],style:{Point:null,LineString:null,MultiLineString:null},initConfig:function(i){this.style.Point===null&&(typeof i.Point=="object"?this.style.Point=new yt({image:new ge({fill:new Tt(i.Point.image.fill),radius:i.Point.image.radius,stroke:new Et(i.Point.image.stroke)})}):this.style.Point=new yt({image:new ge({fill:new Tt({color:"rgba(255,255,0,0.4)"}),radius:5,stroke:new Et({color:"#ff0",width:1})})})),this.style.LineString===null&&(typeof i.LineString=="object"?this.style.LineString=new yt({stroke:new Et(i.LineString.stroke)}):this.style.LineString=new yt({stroke:new Et({color:"#f00",width:3})})),this.style.MultiLineString===null&&(typeof i.MultiLineString=="object"?this.style.MultiLineString=new yt({stroke:new Et(i.MultiLineString.stroke)}):this.style.MultiLineString=new yt({stroke:new Et({color:"#f00",width:3})}))},init:function(i){var r=this;typeof S.mapConfigs[i].gpxSource!="undefined"&&(r.mapSources[i]=new dr({url:S.mapConfigs[i].gpxSource,format:new dg}),r.mapLayers[i]=new hr({source:r.mapSources[i],style:function(t){return r.style[t.getGeometry().getType()]}}),S.layers.mapLayers[i].push(r.mapLayers[i]))}},geolocate:{locateMeDoms:[],checkboxClass:"a2g-map-geolocate-me",geolocations:[],positionFeature:new Oe,accuracyFeature:new Oe,mapSources:[],mapLayers:[],setPositionFeatureStyle:function(){this.positionFeature.setStyle(new yt({image:new ge({radius:6,fill:new Tt({color:"#3399CC"}),stroke:new Et({color:"#fff",width:2})})}))},setMapGeolocations:function(i){var r=this;r.geolocations[i]=new Lh({trackingOptions:{enableHighAccuracy:!0},projection:S.views[i].getProjection()}),r.geolocations[i].on("change:position",function(){const t=r.geolocations[i].getPosition();r.positionFeature.setGeometry(t?new Pe(t):null)}),r.geolocations[i].on("change:accuracyGeometry",function(){r.accuracyFeature.setGeometry(r.geolocations[i].getAccuracyGeometry())})},setGeolocateMeAction:function(i){var r=this;r.locateMeDoms[i]=S.mapWraps[i].getElementsByClassName(r.checkboxClass),r.locateMeDoms[i].length>0&&(r.setMapGeolocations(i),r.mapSources[i]=new dr({features:[r.accuracyFeature,r.positionFeature]}),r.mapLayers[i]=new hr({map:S.mapObjects[i],source:r.mapSources[i]}));for(var t=0;t<r.locateMeDoms[i].length;t++)r.locateMeDoms[i][t].addEventListener("change",function(){r.geolocations[i].setTracking(this.checked);for(var e=0;e<r.locateMeDoms[i].length;e++)r.locateMeDoms[i][e].checked=this.checked;this.checked?r.mapLayers[i].setSource(r.mapSources[i]):r.mapLayers[i].setSource(null)})},init:function(i){this.setPositionFeatureStyle(),this.setGeolocateMeAction(i)}},popup:{class:"a2g-map-popup",contentClass:"a2g-map-popup-content",closerClass:"a2g-map-popup-closer",content:[],closer:[],overlay:[],init:function(i){if(S.mapWraps[i].querySelector("."+S.popup.class)){var r=S.mapWraps[i].querySelector("."+S.popup.class);r.classList.contains("d-none")&&r.classList.remove("d-none"),r.querySelector("."+S.popup.contentClass)&&typeof this.content[i]=="undefined"&&(this.content[i]=r.querySelector("."+S.popup.contentClass)),r.querySelector("."+S.popup.closerClass)&&typeof this.closer[i]=="undefined"&&(this.closer[i]=r.querySelector("."+S.popup.closerClass)),typeof this.overlay[i]=="undefined"&&(this.overlay[i]=new qp({element:r,autoPan:{animation:{duration:250}}}),typeof this.closer[i]!="undefined"&&(this.closer[i].onclick=function(){return S.popup.overlay[i].setPosition(void 0),S.popup.closer[i].blur(),!1}))}}},layers:{mapLayerSources:[],mapLayerSourcess:[],mapLayers:[],mapLayerSelects:[],mapLayerSwitchers:[],mapCountryOverlay:[],mapLayerSwitcherClass:"a2g-map-layer-swipe",mapLayerSelectClass:"a2g-map-layer-select",coutriesGeojsonSource:"/data/countries.geojson",attributions:'&copy; <a href="https://www.altogether.at" target="_blank"> altogether</a>',attributionOpenStreetMap:'&copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>',thunderforest:{a:null,baseUrl:"https://tile.thunderforest.com/",baseUrlSufix:"/{z}/{x}/{y}.png?apikey=",getUrl:function(i){return this.baseUrl+i+this.baseUrlSufix+this.a}},maptiler:{a:null,baseUrl:"https://api.maptiler.com/maps/",baseUrlSufix:"/{z}/{x}/{y}.png?key=",jpgUrlSufix:"/{z}/{x}/{y}.jpg?key=",getUrl:function(i){return i==="hybrid"||i==="openstreetmap"?this.baseUrl+i+this.jpgUrlSufix+this.a:this.baseUrl+i+this.baseUrlSufix+this.a}},countryLayerStyle:new yt({fill:new Tt({color:"#aaa"}),stroke:new Et({color:"#333"})}),setCountryLayer:function(i,r,t){var e=this;e.mapCountryOverlay[i]=r,e.mapLayerSources[i][r]=new dr({url:typeof t.countryGeoSource=="undefined"?e.coutriesGeojsonSource:t.countryGeoSource,format:new Ka}),e.mapLayers[i][r]=new hr({source:e.mapLayerSources[i][r],style:function(n){return e.countryLayerStyle.getFill().setColor("#aaa"),e.countryLayerStyle}})},setMapXyzLayer:function(i,r,t){this.mapLayerSources[i][r]=new jo(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},setMapOsmLayer:function(i,r,t){this.mapLayerSources[i][r]=new Jg(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},setMapStamenLayer:function(i,r,t){this.mapLayerSources[i][r]=new f_(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},appendToMapLayerSwitcher:function(i,r,t){for(var e=0;e<this.mapLayerSelects[i].length;e++)if(typeof r.label!="undefined"){var n=document.createElement("option");n.text=r.label,n.value=t,typeof r.active!="undefined"&&r.active&&(n.selected=!0),this.mapLayerSelects[i][e].add(n)}else{var n=document.createElement("option");n.text=t,n.value=t,typeof r.active!="undefined"&&r.active&&(n.selected=!0),this.mapLayerSelects[i][e].add(n)}},setLayerSwitcherAction:function(i){for(var r=this,t=0;t<r.mapLayerSelects[i].length;t++)r.mapLayerSelects[i][t].dataset.map=i,r.mapLayerSelects[i][t].addEventListener("change",function(e){for(var n=0;n<r.mapLayerSources[this.dataset.map].length;n++)(typeof r.layerSwitchLayerIds[this.dataset.map]=="undefined"||r.layerSwitchLayerIds[this.dataset.map]!==n)&&r.mapLayers[this.dataset.map][n].setSource(null);r.mapLayers[this.dataset.map][this.value].setSource(r.mapLayerSources[this.dataset.map][this.value]);for(var n=0;n<r.mapLayerSelects[i].length;n++)r.mapLayerSelects[i][n].selectedIndex=this.selectedIndex})},layerSwitchLayerIds:[],init:function(i){var r=this;if(typeof r.mapLayers[i]=="undefined"&&(r.mapLayers[i]=[],r.mapLayerSources[i]=[]),r.mapLayerSelects[i]=S.mapWraps[i].getElementsByClassName(r.mapLayerSelectClass),r.mapLayerSwitchers[i]=S.mapWraps[i].getElementsByClassName(r.mapLayerSwitcherClass),typeof S.mapConfigs[i].mapLayers!="undefined"){for(var t=S.mapConfigs[i].mapLayers,e=!0,n=0,o=!0,a=0;a<t.length;a++)if(typeof t[a].layer!=""&&typeof t[a].config=="object")switch(t[a].layer){case"osm":break;case"country":break;default:o=!1;break}for(var a=0;a<t.length;a++){if(typeof t[a].layer!=""&&typeof t[a].config=="object")switch(t[a].config.attributions=r.attributions,t[a].layer){case"osm":o&&(t[a].config.attributions=t[a].config.attributions+", "+r.attributionOpenStreetMap),this.setMapOsmLayer(i,a,t[a].config);break;case"stamen":this.setMapStamenLayer(i,a,t[a].config);break;case"thunderforest":t[a].config.url=r.thunderforest.getUrl(t[a].config.layer),this.setMapXyzLayer(i,a,t[a].config);break;case"maptiler":t[a].config.url=r.maptiler.getUrl(t[a].config.layer),this.setMapXyzLayer(i,a,t[a].config);break;case"country":this.setCountryLayer(i,a,t[a].config);break}if(typeof t[a].active=="undefined"||!t[a].active)r.mapLayers[i][a].setSource(null);else if(e=!1,n++,typeof r.mapLayerSwitchers[i][0]!="undefined")if(n===2){for(var s=0;s<r.mapLayerSwitchers[i].length;s++)r.mapLayers[i][a].on("prerender",function(u){const h=u.context,f=S.mapObjects[i].getSize(),c=f[0]*(r.mapLayerSwitchers[i][0].value/100),p=Ln(u,[c,0]),d=Ln(u,[f[0],0]),v=Ln(u,[c,f[1]]),g=Ln(u,f);h.save(),h.beginPath(),h.moveTo(p[0],p[1]),h.lineTo(v[0],v[1]),h.lineTo(g[0],g[1]),h.lineTo(d[0],d[1]),h.closePath(),h.clip()}),r.mapLayerSwitchers[i][s].addEventListener("input",function(){S.mapObjects[i].render()}),r.mapLayerSwitchers[i][s].addEventListener("change",function(){S.mapObjects[i].render()});r.mapLayers[i][a].on("postrender",function(u){u.context.restore()}),r.layerSwitchLayerIds[i]=a}else n>2&&this.mapLayers[i][a].setSource(null);else n>2&&this.mapLayers[i][a].setSource(null);this.appendToMapLayerSwitcher(i,t[a],a)}if(this.setLayerSwitcherAction(i),e){this.mapLayers[i][S.layers.mapLayers[i].length-1].setSource(S.layers.mapLayerSources[i][S.layers.mapLayerSources[i].length-1]);for(var a=0;a<this.mapLayerSelects[i].length;a++)this.mapLayerSelects[i][a].selectedIndex=S.layers.mapLayers[i].length-1}}}},views:[],controls:[],setMapFeatureLayer:function(i){var r=this;r.setFeatureOverlayStyle(i,r.mapConfigs[i]),r.featureOverlay[i]=new hr({source:new dr,style:r.featureOverlayStyle[i]}),r.layers.mapLayers[i].push(r.featureOverlay[i])},setMapObject:function(i){var r=this,t=[typeof r.mapConfigs[i].centerLon=="number"?r.mapConfigs[i].centerLon:0,typeof r.mapConfigs[i].centerLat=="number"?r.mapConfigs[i].centerLat:0];r.views[i]=new Te({center:Ku(t),padding:[30,30,30,30],zoom:typeof r.mapConfigs[i].zoom=="number"?r.mapConfigs[i].zoom:1,maxZoom:typeof r.mapConfigs[i].maxZoom=="number"?r.mapConfigs[i].maxZoom:18,showFullExtent:!0}),r.controls[i]=[],r.mapConfigs[i].fullScreen&&(r.mapConfigs[i].fullScreen===!0||r.mapConfigs[i].fullScreen==="true")&&r.controls[i].push(new Vp),r.mapConfigs[i].zoomSlider&&(r.mapConfigs[i].zoomSlider===!0||r.mapConfigs[i].zoomSlider==="true")&&r.controls[i].push(new td),r.mapObjects[i]=new Jd({layers:r.layers.mapLayers[i],interactions:_l({dragPan:!1,mouseWheelZoom:!1}).extend([new fl({condition:function(e){return this.getPointerCount()===2||Ba(e)}}),new dl({condition:Ba})]),controls:sl().extend(r.controls[i]),target:r.maps[i],overlays:[r.popup.overlay[i]],view:r.views[i]}),typeof r.mapConfigs[i].centerCountry!="undefined"&&r.mapConfigs[i].centerCountry===!0&&document.addEventListener("DOMContentLoaded",()=>{typeof r.layers.mapCountryOverlay[i]!="undefined"&&(document.addEventListener("pointermove",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("click",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("focus",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("scroll",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}))})},executedInitActions:[],featureOverlaySource:[],featureOverlayStyle:[],setFeatureOverlayStyle:function(i,r){typeof this.featureOverlayStyle[i]=="undefined"&&(r.style&&typeof r.style.featureOverlay=="object"?typeof r.style.featureOverlay.fill=="object"&&typeof r.style.featureOverlay.stroke=="object"?this.featureOverlayStyle[i]=new yt({fill:new Tt(r.style.featureOverlay.fill),stroke:new Et(r.style.featureOverlay.stroke)}):typeof r.style.featureOverlay.fill=="object"?this.featureOverlayStyle[i]=new yt({fill:new Tt(r.style.featureOverlay.fill)}):typeof r.style.featureOverlay.stroke=="object"&&(this.featureOverlayStyle[i]=new yt({stroke:new Et(r.style.featureOverlay.stroke)})):this.featureOverlayStyle[i]=new yt({stroke:new Et({color:"rgba(255,255,255, 0.6)",width:4})}))},featureOverlay:[],featureHighlight:[],setMapClickAction:function(i){S.layers.mapCountryOverlay[i]!==null&&S.mapObjects[i].on("pointermove",function(r){typeof S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]]!="undefined"&&S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]].getFeatures(r.pixel).then(function(t){const e=t.length?t[0]:void 0;e!==S.featureHighlight[i]&&(S.featureHighlight[i]&&S.featureOverlay[i].getSource().removeFeature(S.featureHighlight[i]),e&&S.featureOverlay[i].getSource().addFeature(e),S.featureHighlight[i]=e)})}),S.mapObjects[i].on("click",function(r){var t=!0;typeof S.marker.layers.mapClusters[i]!="undefined"&&S.marker.layers.mapClusters[i].getFeatures(r.pixel).then(function(e){if(e.length>0){t=!1;const n=e[0].get("features");if(n.length>1){const o=Pt();n.forEach(l=>oo(o,l.getGeometry().getExtent()));const a=S.mapObjects[i].getView(),s=S.mapObjects[i].getView().getResolution();a.getZoom()===a.getMaxZoom()?(clickFeature=e[0],clickResolution=s,S.marker.layers.mapClusterCircles[i].setStyle(S.marker.layers.clusterCircleStyle)):a.fit(o,{duration:500,padding:[170,50,30,150]})}else typeof n[0].values_.popup!="undefined"&&(S.popup.content[i].innerHTML=n[0].values_.popup,S.popup.overlay[i].setPosition(n[0].getGeometry().getCoordinates()))}}),S.layers.mapCountryOverlay[i]!==null&&typeof S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]]!="undefined"&&S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]].getFeatures(r.pixel).then(function(e){if(t){const u=e.length?e[0]:void 0;if(u!==void 0&&u.get("popup")!==void 0){S.popup.content[i].innerHTML=u.get("popup");for(var n=0,o=0,a=0,s=0;s<u.getGeometry().getCoordinates().length;s++)for(var l=0;l<u.getGeometry().getCoordinates()[s].length;l++)n+=u.getGeometry().getCoordinates()[s][l][0],o+=u.getGeometry().getCoordinates()[s][l][1],a++;n=n/a,o=o/a,S.popup.overlay[i].setPosition([n,o]),S.views[i].fit(u.getGeometry(),{duration:500,padding:[170,50,30,150]})}}})})},marker:{markerSwitcherClass:"a2g-map-marker-visible-switcher",markerSwitchers:[],setMarkerSwitcherAction:function(i){var r=this;r.markerSwitchers[i]=S.mapWraps[i].getElementsByClassName(this.markerSwitcherClass);for(var t=0;t<r.markerSwitchers[i].length;t++)r.markerSwitchers[i][t].addEventListener("change",function(e){this.checked?(r.layers.mapClusters[i].setSource(null),r.layers.mapClusterCircles[i].setSource(null)):(r.layers.mapClusters[i].setSource(r.layers.mapClusterSources[i]),r.layers.mapClusterCircles[i].setSource(r.layers.mapClusterSources[i]));for(var n=0;n<r.markerSwitchers[i].length;n++)r.markerSwitchers[i][n].checked=this.checked})},icons:{costumIconsDataTag:"icons",costumIconsUrlTag:"iconsUrl",costumIconsId:"a2g-costum-icons",defaulMarkerIcon:"https://travel.altogether.at/typo3conf/ext/a2g_maps/Resources/Public/Icons/Marker/markerSolid.svg",defaultMarkerIconDataAttribute:"defaultMarkerIcon",costumIcons:[],mapIcons:[],defaultIcons:[],fillCostumIconsHelper:function(i,r){S.mapConfigs[r].defaultMarkerIcon?this.defaultIcons[r]=new Gn({src:S.mapConfigs[r].defaultMarkerIcon}):this.defaultIcons[r]=new Gn({src:this.defaulMarkerIcon});for(let t=0;t<i.length;t++)typeof i[t].uid!="undefined"&&typeof this.costumIcons[i[t].uid]=="undefined"&&(typeof i[t].icon=="undefined"?this.costumIcons[i[t].uid]=null:this.costumIcons[i[t].uid]=new Gn({src:i[t].icon}))},fillCostumIcons:function(i){document.getElementById(this.costumIconsId)&&this.fillCostumIconsHelper(JSON.parse(document.getElementById(this.costumIconsId).dataset.content),i)},clusterMemberStyle:function(i){return typeof i.get("icon")=="undefined"||typeof this.costumIcons[i.get("icon")]=="undefined"?new yt({geometry:i.getGeometry(),image:this.defaultIcons[0]}):new yt({geometry:i.getGeometry(),image:this.costumIcons[i.get("icon")]})}},layers:{clusterDistance:35,circleDistanceMultiplier:1,circleFootSeparation:28,circleStartAngle:Math.PI/2,mapClusterSources:[],mapVectorSources:[],mapClusters:[],mapClusterCircles:[],generatePointsCircle:function(i,r,t){let n=this.circleDistanceMultiplier*this.circleFootSeparation*(2+i)/(Math.PI*2);const o=Math.PI*2/i,a=[];let s;n=Math.max(n,45)*t;for(let l=0;l<i;++l)s=this.circleStartAngle+l*o,a.push([r[0]+n*Math.cos(s),r[1]+n*Math.sin(s)]);return a},clusterStyle:function(i){const r=i.get("features").length;return r>1?[new yt({image:S.outerCircle}),new yt({image:S.innerCircle,text:new lc({text:r.toString(),fill:S.textFill,stroke:S.textStroke})})]:S.marker.icons.clusterMemberStyle(i.get("features")[0])},clusterCircleStyle:function(i,r){if(i!==S.clickFeature||r!==S.clickResolution)return;const t=i.get("features");return i.getGeometry().getCoordinates(),S.marker.layers.generatePointsCircle(t.length,i.getGeometry().getCoordinates(),r).reduce((e,n,o)=>{const a=new Pe(n);return e.push(S.marker.icons.clusterMemberStyle(new Oe(qo($o({},t[o].getProperties()),{geometry:a})))),e},[])},setMapMarkerLayer:function(i){typeof this.mapVectorSources[i]=="undefined"&&(S.mapConfigs[i].markerSource?this.mapVectorSources[i]=new dr({format:new Ka,url:S.mapConfigs[i].markerSource}):this.mapVectorSources[i]=null),typeof this.mapClusterSources[i]=="undefined"&&this.mapVectorSources[i]!==null&&(this.mapClusterSources[i]=new Hg({distance:this.clusterDistance,source:this.mapVectorSources[i]})),typeof this.mapClusters[i]=="undefined"&&typeof this.mapClusterSources[i]=="object"&&(this.mapClusters[i]=new hr({source:this.mapClusterSources[i],style:this.clusterStyle})),typeof this.mapClusterCircles[i]=="undefined"&&typeof this.mapClusterSources[i]=="object"&&(this.mapClusterCircles[i]=new hr({source:this.mapClusterSources[i],style:this.clusterCircleStyle})),this.mapVectorSources[i]!==null&&(S.layers.mapLayers[i].push(this.mapClusters[i]),S.layers.mapLayers[i].push(this.mapClusterCircles[i]))}}},clickFeature:null,clickResolution:null,fillMapConfigs:function(i){this.maps[i].dataset.mapConfig&&(this.mapConfigs[i]=JSON.parse(this.maps[i].dataset.mapConfig)),typeof this.mapConfigs[i]=="undefined"&&(this.mapConfigs[i]={}),this.maps[i].dataset.markers&&(this.mapConfigs[i].markers=this.maps[i].dataset.markers),this.maps[i].dataset.markerSource&&(this.mapConfigs[i].markerSource=this.maps[i].dataset.markerSource),this.maps[i].dataset.mapLayers&&(this.mapConfigs[i].mapLayers=JSON.parse(this.maps[i].dataset.mapLayers)),this.maps[i].dataset.gpxSource&&(this.mapConfigs[i].gpxSource=this.maps[i].dataset.gpxSource),this.maps[i].dataset.defaultMarkerIcon&&(this.mapConfigs[i].defaultMarkerIcon=this.maps[i].dataset.defaultMarkerIcon),this.maps[i].dataset.centerLon&&(this.mapConfigs[i].centerLon=this.maps[i].dataset.centerLon),this.maps[i].dataset.centerLat&&(this.mapConfigs[i].centerLat=this.maps[i].dataset.centerLat),this.maps[i].dataset.zoom&&(this.mapConfigs[i].zoom=this.maps[i].dataset.zoom),this.maps[i].dataset.maxZoom&&(this.mapConfigs[i].maxZoom=this.maps[i].dataset.maxZoom),this.maps[i].dataset.zoomSlider&&(this.mapConfigs[i].zoomSlider=this.maps[i].dataset.zoomSlider),this.maps[i].dataset.fullScreen&&(this.mapConfigs[i].fullScreen=this.maps[i].dataset.fullScreen)},init:function(i){this.initMapConfig(i);var r=document.getElementsByClassName(this.mapWrapClass);for(let t=0;t<r.length;t++)this.mapWraps[t]=r[t],this.maps[t]=this.mapWraps[t].querySelector("."+this.mapClass),this.fillMapConfigs(t),this.layers.init(t),this.marker.icons.fillCostumIcons(t),this.setMapFeatureLayer(t),this.marker.layers.setMapMarkerLayer(t),this.popup.init(t),this.gpx.init(t),this.setMapObject(t),this.setMapClickAction(t),this.geolocate.init(t),this.marker.setMarkerSwitcherAction(t)}};S.init(Dl);