From 2818181faae33c9cc89d8c2a792f936b9a6553ea Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 18 Jan 2024 17:53:40 +0300 Subject: [PATCH] rc-2 --- composer.json | 4 +- resources/css/index.scss | 18 ++++- resources/dist/filament-openstreetmap.css | 2 +- resources/dist/filament-openstreetmap.js | 36 +++++----- resources/js/index.ts | 59 ++++------------ .../views/forms/components/map.blade.php | 7 +- src/Forms/Components/MapInput.php | 44 ++++++------ src/Rules/GeoPoint.php | 67 +++++++++++++++++++ 8 files changed, 147 insertions(+), 90 deletions(-) create mode 100644 src/Rules/GeoPoint.php diff --git a/composer.json b/composer.json index 86b063c..208d578 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "traineratwot/filament-openstreetmap", - "version": "1.0.0", + "version": "1.1.0", "description": "This is my package filament-openstreetmap", "keywords": [ "Traineratwot", @@ -25,7 +25,7 @@ "filament/filament": "^3.2", "filament/forms": "^3.2", "illuminate/contracts": "^10.0", - "matanyadaev/laravel-eloquent-spatial": "^3.2", + "matanyadaev/laravel-eloquent-spatial": "*", "spatie/laravel-package-tools": "^1.15.0" }, "require-dev": { diff --git a/resources/css/index.scss b/resources/css/index.scss index 8e70434..80b0be4 100644 --- a/resources/css/index.scss +++ b/resources/css/index.scss @@ -1,6 +1,20 @@ @import '../../node_modules/ol/ol.css'; @import '../../node_modules/ol-geocoder/dist/ol-geocoder.min.css'; -.gcd-txt-control { - color: #09090b !important; +.open-street-map { + position: relative; + .gcd-txt-control { + color: #09090b !important; + } + + .center { + z-index: 9999 !important; + position: absolute; + border: solid 1px black; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 20px; + height: 20px; + } } diff --git a/resources/dist/filament-openstreetmap.css b/resources/dist/filament-openstreetmap.css index cea8195..73fde26 100644 --- a/resources/dist/filament-openstreetmap.css +++ b/resources/dist/filament-openstreetmap.css @@ -3,4 +3,4 @@ * A geocoder extension compatible with OpenLayers v6.x, v7.x & v8.x * https://github.com/Dominique92/ol-geocoder * Built: 15/09/2023 16:57:43 - */.ol-touch .ol-control.gcd-gl-control button{font-size:1.14em}.ol-touch .ol-geocoder.gcd-gl-container{font-size:1.1em}.ol-geocoder.gcd-gl-container{box-sizing:border-box;font-size:.9em;left:.5em;position:absolute;top:4.875em}.ol-geocoder.gcd-gl-container *,.ol-geocoder.gcd-gl-container :after,.ol-geocoder.gcd-gl-container :before{box-sizing:inherit}.ol-geocoder .gcd-gl-control{height:2.1875em;overflow:hidden;transition:width .2s,height .2s;width:2.1875em}.ol-geocoder .gcd-gl-expanded{height:2.1875em;width:15.625em}.ol-geocoder .gcd-gl-input{background-color:#fff;border:1px solid #ccc;color:#222;font-family:inherit;font-size:.875em;left:2.5em;padding:5px;position:absolute;top:.25em;width:14.84375em;z-index:99}.ol-geocoder .gcd-gl-input:focus{border:none;box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 5px #4d90fe;outline:none}.ol-geocoder .gcd-gl-search{background-color:initial;border:none;cursor:pointer;display:inline-block;height:100%;line-height:1.4;outline:0;position:absolute;right:0;top:0;width:1.5625em;z-index:100}.ol-geocoder .gcd-gl-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:1.5em}.ol-geocoder .gcd-gl-btn{cursor:pointer;height:1.5625em;left:.125em;position:absolute;top:.125em;width:1.5625em}.ol-geocoder .gcd-gl-btn:after{content:"\1F50D"}.ol-geocoder ul.gcd-gl-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px #000c;left:2em;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:2.1875em;transition:max-height .3s ease-in;white-space:normal;width:16.25em}.ol-geocoder ul.gcd-gl-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-gl-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-gl-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-gl-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-gl-result:empty{display:none}.ol-geocoder.gcd-txt-container{box-sizing:border-box;height:4.375em;left:calc(50% - 12.5em);position:absolute;top:.5em;width:25em}.ol-geocoder.gcd-txt-container *,.ol-geocoder.gcd-txt-container :after,.ol-geocoder.gcd-txt-container :before{box-sizing:inherit}.ol-geocoder .gcd-txt-control{background-color:#fff;border:1px solid #ccc;height:4.375em;overflow:hidden;position:relative;width:100%}.ol-geocoder .gcd-txt-label{display:inline-block;text-align:center;width:100%}.ol-geocoder .gcd-txt-input{background-color:initial;border:none;font-family:inherit;font-size:.875em;height:100%;left:0;padding:5px 30px 5px 40px;position:absolute;text-indent:6px;top:0;width:100%;z-index:99}.ol-geocoder .gcd-txt-input:focus{box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 6px #4d90fe;outline:none}.ol-geocoder .gcd-txt-search{background-color:initial;border:none;cursor:pointer;display:inline-block;height:100%;line-height:100%;outline:0;position:absolute;right:0;top:0;vertical-align:middle;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:2em}.ol-geocoder .gcd-txt-glass{display:inline-block;height:100%;left:9px;position:absolute;top:26px;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-glass:after{content:"\1F50D"}.ol-geocoder ul.gcd-txt-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px #000c;left:0;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:4.575em;transition:max-height .3s ease-in;white-space:normal;width:25em}.ol-geocoder ul.gcd-txt-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-txt-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-txt-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-txt-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-txt-result:empty{display:none}.ol-geocoder .gcd-hidden{opacity:0;visibility:hidden}.ol-geocoder .gcd-pseudo-rotate:after{animation:spin .7s linear infinite}.gcd-address,.gcd-road{color:#333;font-size:.875em;font-weight:500}.gcd-city{font-weight:400}.gcd-city,.gcd-country{color:#333;font-size:.75em}.gcd-country{font-weight:lighter}.gcd-txt-control{color:#09090b!important} \ No newline at end of file + */.ol-touch .ol-control.gcd-gl-control button{font-size:1.14em}.ol-touch .ol-geocoder.gcd-gl-container{font-size:1.1em}.ol-geocoder.gcd-gl-container{box-sizing:border-box;font-size:.9em;left:.5em;position:absolute;top:4.875em}.ol-geocoder.gcd-gl-container *,.ol-geocoder.gcd-gl-container :after,.ol-geocoder.gcd-gl-container :before{box-sizing:inherit}.ol-geocoder .gcd-gl-control{height:2.1875em;overflow:hidden;transition:width .2s,height .2s;width:2.1875em}.ol-geocoder .gcd-gl-expanded{height:2.1875em;width:15.625em}.ol-geocoder .gcd-gl-input{background-color:#fff;border:1px solid #ccc;color:#222;font-family:inherit;font-size:.875em;left:2.5em;padding:5px;position:absolute;top:.25em;width:14.84375em;z-index:99}.ol-geocoder .gcd-gl-input:focus{border:none;box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 5px #4d90fe;outline:none}.ol-geocoder .gcd-gl-search{background-color:initial;border:none;cursor:pointer;display:inline-block;height:100%;line-height:1.4;outline:0;position:absolute;right:0;top:0;width:1.5625em;z-index:100}.ol-geocoder .gcd-gl-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:1.5em}.ol-geocoder .gcd-gl-btn{cursor:pointer;height:1.5625em;left:.125em;position:absolute;top:.125em;width:1.5625em}.ol-geocoder .gcd-gl-btn:after{content:"\1F50D"}.ol-geocoder ul.gcd-gl-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px #000c;left:2em;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:2.1875em;transition:max-height .3s ease-in;white-space:normal;width:16.25em}.ol-geocoder ul.gcd-gl-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-gl-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-gl-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-gl-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-gl-result:empty{display:none}.ol-geocoder.gcd-txt-container{box-sizing:border-box;height:4.375em;left:calc(50% - 12.5em);position:absolute;top:.5em;width:25em}.ol-geocoder.gcd-txt-container *,.ol-geocoder.gcd-txt-container :after,.ol-geocoder.gcd-txt-container :before{box-sizing:inherit}.ol-geocoder .gcd-txt-control{background-color:#fff;border:1px solid #ccc;height:4.375em;overflow:hidden;position:relative;width:100%}.ol-geocoder .gcd-txt-label{display:inline-block;text-align:center;width:100%}.ol-geocoder .gcd-txt-input{background-color:initial;border:none;font-family:inherit;font-size:.875em;height:100%;left:0;padding:5px 30px 5px 40px;position:absolute;text-indent:6px;top:0;width:100%;z-index:99}.ol-geocoder .gcd-txt-input:focus{box-shadow:inset 0 0 0 1px #4d90fe,inset 0 0 6px #4d90fe;outline:none}.ol-geocoder .gcd-txt-search{background-color:initial;border:none;cursor:pointer;display:inline-block;height:100%;line-height:100%;outline:0;position:absolute;right:0;top:0;vertical-align:middle;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-search:after{color:#333;content:"\2386";cursor:pointer;display:inline-block;font-size:2em}.ol-geocoder .gcd-txt-glass{display:inline-block;height:100%;left:9px;position:absolute;top:26px;width:2.5em;z-index:100}.ol-geocoder .gcd-txt-glass:after{content:"\1F50D"}.ol-geocoder ul.gcd-txt-result{background-color:#fff;border-radius:4px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 1px 7px #000c;left:0;list-style:none;margin:0;max-height:18.75em;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;top:4.575em;transition:max-height .3s ease-in;white-space:normal;width:25em}.ol-geocoder ul.gcd-txt-result>li{border-bottom:1px solid #eee;line-height:.875rem;overflow:hidden;padding:0;width:100%}.ol-geocoder ul.gcd-txt-result>li>a{display:block;padding:3px 5px;text-decoration:none}.ol-geocoder ul.gcd-txt-result>li>a:hover{background-color:#d4d4d4}.ol-geocoder ul.gcd-txt-result>li:nth-child(odd){background-color:#e0ffe0}.ol-geocoder ul.gcd-txt-result:empty{display:none}.ol-geocoder .gcd-hidden{opacity:0;visibility:hidden}.ol-geocoder .gcd-pseudo-rotate:after{animation:spin .7s linear infinite}.gcd-address,.gcd-road{color:#333;font-size:.875em;font-weight:500}.gcd-city{font-weight:400}.gcd-city,.gcd-country{color:#333;font-size:.75em}.gcd-country{font-weight:lighter}.open-street-map{position:relative}.open-street-map .gcd-txt-control{color:#09090b!important}.open-street-map .center{z-index:9999!important;position:absolute;border:1px solid #000;top:50%;left:50%;transform:translate(-50%,-50%);width:20px;height:20px} \ No newline at end of file diff --git a/resources/dist/filament-openstreetmap.js b/resources/dist/filament-openstreetmap.js index cda8d8a..5badc2e 100644 --- a/resources/dist/filament-openstreetmap.js +++ b/resources/dist/filament-openstreetmap.js @@ -1,29 +1,29 @@ -var _m=Object.create;var Ms=Object.defineProperty;var ym=Object.getOwnPropertyDescriptor;var xm=Object.getOwnPropertyNames;var Em=Object.getPrototypeOf,Cm=Object.prototype.hasOwnProperty;var S=(n,t)=>()=>(n&&(t=n(n=0)),t);var Wc=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),zi=(n,t)=>{for(var e in t)Ms(n,e,{get:t[e],enumerable:!0})},zc=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xm(t))!Cm.call(n,r)&&r!==e&&Ms(n,r,{get:()=>t[r],enumerable:!(i=ym(t,r))||i.enumerable});return n};var Yc=(n,t,e)=>(e=n!=null?_m(Em(n)):{},zc(t||!n||!n.__esModule?Ms(e,"default",{value:n,enumerable:!0}):e,n)),Yi=n=>zc(Ms({},"__esModule",{value:!0}),n);var ta,Lt,ke=S(()=>{ta=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},Lt=ta});var Ne,Yn=S(()=>{Ne={PROPERTYCHANGE:"propertychange"}});var ea,Bn,As=S(()=>{ea=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}},Bn=ea});function Bc(n,t,e){let i,r;e=e||pe;let s=0,o=n.length,a=!1;for(;s>1),r=+e(n[i],t),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function pe(n,t){return n>t?1:n0?r-1:r}return i-1}if(e>0){for(let r=1;r0||e&&o===0)})}var Ct=S(()=>{});function gi(){return!0}function mi(){return!1}function Ge(){}function Ps(n){let t=!1,e,i,r;return function(){let s=Array.prototype.slice.call(arguments);return(!t||this!==r||!Nt(s,i))&&(t=!0,r=this,i=s,e=n.apply(this,arguments)),e}}var Jt=S(()=>{Ct()});function He(n){for(let t in n)delete n[t]}function Xe(n){let t;for(t in n)return!1;return!t}var We=S(()=>{});var ia,Bi,Dr=S(()=>{As();ke();Jt();We();ia=class extends Bn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;let i=this.listeners_||(this.listeners_={}),r=i[t]||(i[t]=[]);r.includes(e)||r.push(e)}dispatchEvent(t){let e=typeof t=="string",i=e?t:t.type,r=this.listeners_&&this.listeners_[i];if(!r)return;let s=e?new Lt(t):t;s.target||(s.target=this.eventTarget_||this);let o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let h=0,c=r.length;h0:!1}removeEventListener(t,e){if(!this.listeners_)return;let i=this.listeners_[t];if(!i)return;let r=i.indexOf(e);r!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[r]=Ge,++this.pendingRemovals_[t]):(i.splice(r,1),i.length===0&&delete this.listeners_[t]))}},Bi=ia});var A,gt=S(()=>{A={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 U(n,t,e,i,r){if(i&&i!==n&&(e=e.bind(i)),r){let o=e;e=function(){n.removeEventListener(t,e),o.apply(this,arguments)}}let s={target:n,type:t,listener:e};return n.addEventListener(t,e),s}function Vn(n,t,e,i){return U(n,t,e,i,!0)}function et(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),He(n))}var _e=S(()=>{We()});function wm(n){if(Array.isArray(n))for(let t=0,e=n.length;t{Dr();gt();_e();Kn=class extends Bi{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(A.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){let i=t.length,r=new Array(i);for(let s=0;s{Tm=0});var Fs,ra,bt,ze=S(()=>{ke();Yn();na();wt();We();Fs=class extends Lt{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}},ra=class extends Os{constructor(t){super(),this.on,this.once,this.un,z(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new Fs(i,t,e)),i=Ne.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Fs(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){let r=this.values_||(this.values_={});if(i)r[t]=e;else{let s=r[t];r[t]=e,s!==e&&this.notify(t,s)}}setProperties(t,e){for(let i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){let i=this.values_[t];delete this.values_[t],Xe(this.values_)&&(this.values_=null),e||this.notify(t,i)}}},bt=ra});var St,Zn=S(()=>{St={ADD:"add",REMOVE:"remove"}});var Vc,qn,sa,Gt,yn=S(()=>{ze();Zn();ke();Vc={LENGTH:"length"},qn=class extends Lt{constructor(t,e,i){super(t),this.element=e,this.index=i}},sa=class extends bt{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,r=this.array_.length;i0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new qn(St.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);let e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){let e=this.array_;for(let i=0,r=e.length;i=this.getLength())return;let e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new qn(St.REMOVE,e,t)),e}setAt(t,e){let i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);let r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new qn(St.REMOVE,r,t)),this.dispatchEvent(new qn(St.ADD,e,t))}updateLength_(){this.set(Vc.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,r=this.array_.length;i{Ui=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Kc=Ui.includes("firefox"),Sm=Ui.includes("safari")&&!Ui.includes("chrom"),ty=Sm&&(Ui.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ui)),Zc=Ui.includes("webkit")&&!Ui.includes("edge"),oa=Ui.includes("macintosh"),Ds=typeof devicePixelRatio<"u"?devicePixelRatio:1,Hn=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,aa=typeof Image<"u"&&Image.prototype.decode,ks=function(){let n=!1;try{let t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}()});function Y(n,t){if(!n)throw new Error(t)}var Ht=S(()=>{});function Xt(){return[1,0,0,1,0,0]}function vm(n,t,e,i,r,s,o){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function Hc(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function yt(n,t){let e=t[0],i=t[1];return t[0]=n[0]*e+n[2]*i+n[4],t[1]=n[1]*e+n[3]*i+n[5],t}function $c(n,t,e){return vm(n,t,0,0,e,0,0)}function jt(n,t,e,i,r,s,o,a){let l=Math.sin(s),h=Math.cos(s);return n[0]=i*h,n[1]=r*l,n[2]=-i*l,n[3]=r*h,n[4]=o*i*h-a*i*l+t,n[5]=o*r*l+a*r*h+e,n}function $n(n,t){let e=Rm(t);Y(e!==0,"Transformation matrix cannot be inverted");let i=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5];return n[0]=o/e,n[1]=-r/e,n[2]=-s/e,n[3]=i/e,n[4]=(s*l-o*a)/e,n[5]=-(i*l-r*a)/e,n}function Rm(n){return n[0]*n[3]-n[1]*n[2]}function Ns(n){let t="matrix("+n.join(", ")+")";if(Hn)return t;let e=qc||(qc=document.createElement("div"));return e.style.transform=t,e.style.transform}var sy,qc,Ye=S(()=>{pi();Ht();sy=new Array(6)});var Mt,la=S(()=>{Mt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16}});function ye(n){let t=vt();for(let e=0,i=n.length;er&&(l=l|Mt.RIGHT),as&&(l=l|Mt.ABOVE),l===Mt.UNKNOWN&&(l=Mt.INTERSECTING),l}function vt(){return[1/0,1/0,-1/0,-1/0]}function xe(n,t,e,i,r){return r?(r[0]=n,r[1]=t,r[2]=e,r[3]=i,r):[n,t,e,i]}function xn(n){return xe(1/0,1/0,-1/0,-1/0,n)}function Ki(n,t){let e=n[0],i=n[1];return xe(e,i,e,i,t)}function Jn(n,t,e,i,r){let s=xn(r);return ca(s,n,t,e,i)}function yi(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function Jc(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function En(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function ca(n,t,e,i,r){for(;et[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function qi(n){return n[2]=o&&m<=l),!i&&s&Mt.RIGHT&&!(r&Mt.RIGHT)&&(p=f-(d-l)*g,i=p>=a&&p<=h),!i&&s&Mt.BELOW&&!(r&Mt.BELOW)&&(m=d-(f-a)/g,i=m>=o&&m<=l),!i&&s&Mt.LEFT&&!(r&Mt.LEFT)&&(p=f-(d-o)*g,i=p>=a&&p<=h)}return i}function iu(n,t,e,i){if(qi(n))return xn(e);let r=[];if(i>1){let a=n[2]-n[0],l=n[3]-n[1];for(let h=0;h=e[2])){let r=$(e),o=Math.floor((i[0]-e[0])/r)*r;n[0]-=o,n[2]-=o}return n}function nu(n,t){if(t.canWrapX()){let e=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[e[0],n[1],e[2],n[3]]];ua(n,t);let i=$(e);if($(n)>i)return[[e[0],n[1],e[2],n[3]]];if(n[0]e[2])return[[n[0],n[1],e[2],n[3]],[e[0],n[1],n[2]-i,n[3]]]}return[n]}var it=S(()=>{la()});var xi,Gr=S(()=>{xi={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}});var Cn,oe,Bs=S(()=>{Gr();Cn={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Cn.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};Cn.max=Cn.whitepoint[2].D65;Cn.rgb=function(n,t){t=t||Cn.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],r=n[2]/t[2],s,o,a;return s=e*3.240969941904521+i*-1.537383177570093+r*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+r*.041555057407175,a=e*.055630079696993+i*-.20397695888897+r*1.056971514242878,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[s*255,o*255,a*255]};xi.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,r=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var s=e*.41239079926595+i*.35758433938387+r*.18048078840183,o=e*.21263900587151+i*.71516867876775+r*.072192315360733,a=e*.019330818715591+i*.11919477979462+r*.95053215224966;return t=t||Cn.whitepoint[2].E,[s*t[0],o*t[1],a*t[2]]};oe=Cn});var Us,ru=S(()=>{Bs();Us={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,r,s,o,a,l,h,c,u,d,f,g,m;if(s=n[0],o=n[1],a=n[2],s===0)return[0,0,0];var p=.0011070564598794539;return t=t||"D65",e=e||2,u=oe.whitepoint[e][t][0],d=oe.whitepoint[e][t][1],f=oe.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),m=9*d/(u+15*d+3*f),i=o/(13*s)+g||0,r=a/(13*s)+m||0,h=s>8?d*Math.pow((s+16)/116,3):d*s*p,l=h*9*i/(4*r)||0,c=h*(12-3*i-20*r)/(4*r)||0,[l,h,c]}};oe.luv=function(n,t,e){var i,r,s,o,a,l,h,c,u,d,f,g,m,p=.008856451679035631,_=903.2962962962961;t=t||"D65",e=e||2,u=oe.whitepoint[e][t][0],d=oe.whitepoint[e][t][1],f=oe.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),m=9*d/(u+15*d+3*f),l=n[0],h=n[1],c=n[2],i=4*l/(l+15*h+3*c)||0,r=9*h/(l+15*h+3*c)||0;var y=h/d;return s=y<=p?_*y:116*Math.pow(y,1/3)-16,o=13*s*(i-g),a=13*s*(r-m),[s,o,a]}});var su,ou,au=S(()=>{ru();Bs();su={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],r,s,o;return o=i/360*2*Math.PI,r=e*Math.cos(o),s=e*Math.sin(o),[t,r,s]},xyz:function(n){return Us.xyz(su.luv(n))}},ou=su;Us.lchuv=function(n){var t=n[0],e=n[1],i=n[2],r=Math.sqrt(e*e+i*i),s=Math.atan2(i,e),o=s*360/2/Math.PI;return o<0&&(o+=360),[t,r,o]};oe.lchuv=function(n){return Us.lchuv(oe.luv(n))}});var hu=Wc((yy,lu)=>{"use strict";lu.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});function bm(n){var t,e=[],i=1,r;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),da.default[n])e=da.default[n].slice(),r="rgb";else if(n==="transparent")i=0,r="rgb",e=[0,0,0];else if(n[0]==="#"){var s=n.slice(1),o=s.length,a=o<=4;i=1,a?(e=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],o===4&&(i=parseInt(s[3]+s[3],16)/255)):(e=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],o===8&&(i=parseInt(s[6]+s[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),r="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];r=l.replace(/a$/,"");var h=r==="cmyk"?4:r==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),r==="color"&&(r=e.shift()),e=e.map(function(c,u){if(c[c.length-1]==="%")return c=parseFloat(c)/100,u===3?c:r==="rgb"?c*255:r[0]==="h"||r[0]==="l"&&!u?c*100:r==="lab"?c*125:r==="lch"?u<2?c*150:c*360:r[0]==="o"&&!u?c:r==="oklab"?c*.4:r==="oklch"?u<2?c*.4:c*360:c;if(r[u]==="h"||u===2&&r[r.length-1]==="h"){if(cu[c]!==void 0)return cu[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),i=e.length>h?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),r=n.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:r,values:e,alpha:i}}var da,uu,cu,du=S(()=>{da=Yc(hu(),1),uu=bm,cu={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}});var js,fu=S(()=>{Gr();js={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,r,s,o,a,l,h=0;if(e===0)return l=i*255,[l,l,l];for(s=i<.5?i*(1+e):i+e-i*e,r=2*i-s,a=[0,0,0];h<3;)o=t+1/3*-(h-1),o<0?o++:o>1&&o--,l=6*o<1?r+(s-r)*6*o:2*o<1?s:3*o<2?r+(s-r)*(2/3-o)*6:r,a[h++]=l*255;return a}};xi.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,r=Math.min(t,e,i),s=Math.max(t,e,i),o=s-r,a,l,h;return s===r?a=0:t===s?a=(e-i)/o:e===s?a=2+(i-t)/o:i===s&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),h=(r+s)/2,s===r?l=0:h<=.5?l=o/(s+r):l=o/(2-s-r),[a,l*100,h*100]}});function fa(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e,i,r=uu(n);if(!r.space)return[];let s=r.space[0]==="h"?js.min:xi.min,o=r.space[0]==="h"?js.max:xi.max;return t=Array(3),t[0]=Math.min(Math.max(r.values[0],s[0]),o[0]),t[1]=Math.min(Math.max(r.values[1],s[1]),o[1]),t[2]=Math.min(Math.max(r.values[2],s[2]),o[2]),r.space[0]==="h"&&(t=js.rgb(t)),t.push(Math.min(Math.max(r.alpha,0),1)),t}var gu=S(()=>{du();Gr();fu()});function at(n,t,e){return Math.min(Math.max(n,t),e)}function mu(n,t,e,i,r,s){let o=r-e,a=s-i;if(o!==0||a!==0){let l=((n-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=r,i=s):l>0&&(e+=o*l,i+=a*l)}return Ei(n,t,e,i)}function Ei(n,t,e,i){let r=e-n,s=i-t;return r*r+s*s}function pu(n){let t=n.length;for(let i=0;is&&(s=l,r=a)}if(s===0)return null;let o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a=0;i--){e[i]=n[i][t]/n[i][i];for(let r=i-1;r>=0;r--)n[r][t]-=n[r][i]*e[i]}return e}function ir(n){return n*Math.PI/180}function Ee(n,t){let e=n%t;return e*t<0?e+t:e}function $t(n,t,e){return n+e*(t-n)}function Vs(n,t){let e=Math.pow(10,t);return Math.round(n*e)/e}function Xr(n,t){return Math.floor(Vs(n,t))}function Wr(n,t){return Math.ceil(Vs(n,t))}var mt=S(()=>{});function Ks(n){return typeof n=="string"?n:_a(n)}function _u(n){if(n.length===4)return n;let t=n.slice();return t[3]=1,t}function ma(n){let t=oe.lchuv(xi.xyz(n));return t[3]=n[3],t}function yu(n){let t=oe.rgb(ou.xyz(n));return t[3]=n[3],t}function Zs(n){if(zr.hasOwnProperty(n))return zr[n];if(ga>=Mm){let e=0;for(let i in zr)e++&3||(delete zr[i],--ga)}let t=fa(n);if(t.length!==4)throw new Error('Failed to parse "'+n+'" as color');for(let e of t)if(isNaN(e))throw new Error('Failed to parse "'+n+'" as color');return pa(t),zr[n]=t,++ga,t}function wn(n){return Array.isArray(n)?n:Zs(n)}function pa(n){return n[0]=at(n[0]+.5|0,0,255),n[1]=at(n[1]+.5|0,0,255),n[2]=at(n[2]+.5|0,0,255),n[3]=at(n[3],0,1),n}function _a(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);let r=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+t+","+e+","+i+","+r+")"}function xu(n){try{return Zs(n),!0}catch{return!1}}var Mm,zr,ga,Ci=S(()=>{au();gu();Gr();Bs();mt();Mm=1024,zr={},ga=0});function Eu(n,t,e){let i=e?Ks(e):"null";return t+":"+n+":"+i}var ya,nr,xa=S(()=>{Ci();ya=class{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(let e in this.cache_){let i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){let r=Eu(t,e,i);return r in this.cache_?this.cache_[r]:null}set(t,e,i,r){let s=Eu(t,e,i);this.cache_[s]=r,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}};nr=new ya});var ht,Ea=S(()=>{ht={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"}});var Ca,qs,wa=S(()=>{ze();Ea();wt();Ht();mt();Ca=class extends bt{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;let e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[ht.OPACITY]=t.opacity!==void 0?t.opacity:1,Y(typeof e[ht.OPACITY]=="number","Layer opacity must be a number"),e[ht.VISIBLE]=t.visible!==void 0?t.visible:!0,e[ht.Z_INDEX]=t.zIndex,e[ht.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[ht.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[ht.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[ht.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){let e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=at(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return H()}getLayerStatesArray(t){return H()}getExtent(){return this.get(ht.EXTENT)}getMaxResolution(){return this.get(ht.MAX_RESOLUTION)}getMinResolution(){return this.get(ht.MIN_RESOLUTION)}getMinZoom(){return this.get(ht.MIN_ZOOM)}getMaxZoom(){return this.get(ht.MAX_ZOOM)}getOpacity(){return this.get(ht.OPACITY)}getSourceState(){return H()}getVisible(){return this.get(ht.VISIBLE)}getZIndex(){return this.get(ht.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(ht.EXTENT,t)}setMaxResolution(t){this.set(ht.MAX_RESOLUTION,t)}setMinResolution(t){this.set(ht.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(ht.MAX_ZOOM,t)}setMinZoom(t){this.set(ht.MIN_ZOOM,t)}setOpacity(t){Y(typeof t=="number","Layer opacity must be a number"),this.set(ht.OPACITY,t)}setVisible(t){this.set(ht.VISIBLE,t)}setZIndex(t){this.set(ht.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}},qs=Ca});var Qt,rr=S(()=>{Qt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}});var Dt,Hs=S(()=>{Dt={ANIMATING:0,INTERACTING:1}});var be,Cu=S(()=>{be={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"}});var $e,Ta=S(()=>{$e={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937}});var Sa,sr,$s=S(()=>{Ta();Sa=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||$e[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},sr=Sa});function wu(n,t,e){let i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let r=0;rJs?s=Js:s<-Js&&(s=-Js),t[r+1]=s}return t}function Tu(n,t,e){let i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let r=0;r{$s();Yr=6378137,or=Math.PI*Yr,Am=[-or,-or,or,or],Pm=[-180,-85,180,85],Js=Yr*Math.log(Math.tan(Math.PI/2)),Hi=class extends sr{constructor(t){super({code:t,units:"m",extent:Am,global:!0,worldExtent:Pm,getPointResolution:function(e,i){return e/Math.cosh(i[1]/Yr)}})}},va=[new Hi("EPSG:3857"),new Hi("EPSG:102100"),new Hi("EPSG:102113"),new Hi("EPSG:900913"),new Hi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Hi("http://www.opengis.net/gml/srs/epsg.xml#3857")]});var Om,vu,Fm,wi,Ra,Ru=S(()=>{$s();Om=6378137,vu=[-180,-90,180,90],Fm=Math.PI*Om/180,wi=class extends sr{constructor(t,e){super({code:t,units:"degrees",extent:vu,axisOrientation:e,global:!0,metersPerUnit:Fm,worldExtent:vu})}},Ra=[new wi("CRS:84"),new wi("EPSG:4326","neu"),new wi("urn:ogc:def:crs:OGC:1.3:CRS84"),new wi("urn:ogc:def:crs:OGC:2:84"),new wi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new wi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new wi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")]});function Iu(){Qs={}}function Lu(n){return Qs[n]||Qs[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function bu(n,t){Qs[n]=t}var Qs,Mu=S(()=>{Qs={}});function Au(){Tn={}}function Sn(n,t,e){let i=n.getCode(),r=t.getCode();i in Tn||(Tn[i]={}),Tn[i][r]=e}function Pu(n,t){let e;return n in Tn&&t in Tn[n]&&(e=Tn[n][t]),e}var Tn,Ou=S(()=>{Tn={}});function Fu(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Ia(n,t){let e=n[0],i=n[1],r=t[0],s=t[1],o=r[0],a=r[1],l=s[0],h=s[1],c=l-o,u=h-a,d=c===0&&u===0?0:(c*(e-o)+u*(i-a))/(c*c+u*u||0),f,g;return d<=0?(f=o,g=a):d>=1?(f=l,g=h):(f=o+d*c,g=a+d*u),[f,g]}function Du(n){return function(t){return km(t,n)}}function Dm(n,t,e){return n?t.replace("{x}",n[0].toFixed(e)).replace("{y}",n[1].toFixed(e)):""}function te(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function ar(n,t){let e=Math.cos(t),i=Math.sin(t),r=n[0]*e-n[1]*i,s=n[1]*e+n[0]*i;return n[0]=r,n[1]=s,n}function ku(n,t){return n[0]*=t,n[1]*=t,n}function lr(n,t){let e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function La(n,t){return Math.sqrt(lr(n,t))}function Nu(n,t){return lr(n,Ia(n,t))}function km(n,t){return Dm(n,"{x}, {y}",t)}function hr(n,t){if(t.canWrapX()){let e=$(t.getExtent()),i=ba(n,t,e);i&&(n[0]-=i*e)}return n}function ba(n,t,e){let i=t.getExtent(),r=0;return t.canWrapX()&&(n[0]i[2])&&(e=e||$(i),r=Math.floor((n[0]-i[0])/e)),r}var Je=S(()=>{it()});function Ma(n,t,e){e=e||Nm;let i=ir(n[1]),r=ir(t[1]),s=(r-i)/2,o=ir(t[0]-n[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}var Nm,Gu=S(()=>{mt();Nm=63710088e-1});function to(...n){Gm>Xu.warn||console.warn(...n)}var Xu,Gm,Aa=S(()=>{Xu={info:1,warn:2,error:3,none:4},Gm=Xu.info});var Vu={};zi(Vu,{METERS_PER_UNIT:()=>$e,Projection:()=>sr,addCommon:()=>ju,addCoordinateTransforms:()=>Wm,addEquivalentProjections:()=>Oa,addEquivalentTransforms:()=>Yu,addProjection:()=>Wu,addProjections:()=>zu,clearAllProjections:()=>Xm,clearUserProjection:()=>Bm,cloneTransform:()=>io,createProjection:()=>Ur,createSafeCoordinateTransform:()=>jm,createTransformFromCoordinateTransform:()=>Fa,disableCoordinateWarning:()=>eo,equivalent:()=>Si,fromLonLat:()=>Ti,fromUserCoordinate:()=>Et,fromUserExtent:()=>ae,fromUserResolution:()=>Uu,get:()=>ft,getPointResolution:()=>no,getTransform:()=>$i,getTransformFromProjections:()=>Qe,getUserProjection:()=>Ce,identityTransform:()=>Br,setUserProjection:()=>Bu,toLonLat:()=>zm,toUserCoordinate:()=>ti,toUserExtent:()=>vi,toUserResolution:()=>ka,transform:()=>vn,transformExtent:()=>Da,transformWithProjections:()=>Ym,useGeographic:()=>Um});function eo(n){Pa=!(n===void 0?!0:n)}function io(n,t){if(t!==void 0){for(let e=0,i=n.length;e=a?t[s+l]:o[l]}return e}}function Wm(n,t,e,i){let r=ft(n),s=ft(t);Sn(r,s,Fa(e)),Sn(s,r,Fa(i))}function Ti(n,t){return eo(),vn(n,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function zm(n,t){let e=vn(n,t!==void 0?t:"EPSG:3857","EPSG:4326"),i=e[0];return(i<-180||i>180)&&(e[0]=Ee(i+180,360)-180),e}function Si(n,t){if(n===t)return!0;let e=n.getUnits()===t.getUnits();return(n.getCode()===t.getCode()||Qe(n,t)===io)&&e}function Qe(n,t){let e=n.getCode(),i=t.getCode(),r=Pu(e,i);return r||(r=Br),r}function $i(n,t){let e=ft(n),i=ft(t);return Qe(e,i)}function vn(n,t,e){return $i(t,e)(n,void 0,n.length)}function Da(n,t,e,i){let r=$i(t,e);return iu(n,r,void 0,i)}function Ym(n,t,e){return Qe(t,e)(n)}function Bu(n){ee=ft(n)}function Bm(){ee=null}function Ce(){return ee}function Um(){Bu("EPSG:4326")}function ti(n,t){return ee?vn(n,t,ee):n}function Et(n,t){return ee?vn(n,ee,t):(Pa&&!te(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Pa=!1,to("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function vi(n,t){return ee?Da(n,t,ee):n}function ae(n,t){return ee?Da(n,ee,t):n}function ka(n,t){if(!ee)return n;let e=ft(t).getMetersPerUnit(),i=ee.getMetersPerUnit();return e&&i?n*e/i:n}function Uu(n,t){if(!ee)return n;let e=ft(t).getMetersPerUnit(),i=ee.getMetersPerUnit();return e&&i?n*i/e:n}function jm(n,t,e){return function(i){let r,s;if(n.canWrapX()){let o=n.getExtent(),a=$(o);i=i.slice(0),s=ba(i,n,a),s&&(i[0]=i[0]-s*a),i[0]=at(i[0],o[0],o[2]),i[1]=at(i[1],o[1],o[3]),r=e(i)}else r=e(i);return s&&t.canWrapX()&&(r[0]+=s*$(t.getExtent())),r}}function ju(){Oa(va),Oa(Ra),Yu(Ra,va,wu,Tu)}var Pa,ee,Wt=S(()=>{$s();Su();Ru();Ta();Mu();Ou();it();mt();Je();Gu();Aa();Pa=!0;ee=null;ju()});function Na(n,t,e){return function(i,r,s,o,a){if(!i)return;if(!r&&!t)return i;let l=t?0:s[0]*r,h=t?0:s[1]*r,c=a?a[0]:0,u=a?a[1]:0,d=n[0]+l/2+c,f=n[2]-l/2+c,g=n[1]+h/2+u,m=n[3]-h/2+u;d>f&&(d=(f+d)/2,f=d),g>m&&(g=(m+g)/2,m=g);let p=at(i[0],d,f),_=at(i[1],g,m);if(o&&e&&r){let y=30*r;p+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),_+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-m)/y)}return[p,_]}}function Ku(n){return n}var Zu=S(()=>{mt()});function Ga(n,t,e,i){let r=$(t)/e[0],s=At(t)/e[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function Xa(n,t,e){let i=Math.min(n,t),r=50;return i*=Math.log(1+r*Math.max(0,n/t-1))/r+1,e&&(i=Math.max(i,e),i/=Math.log(1+r*Math.max(0,e/n-1))/r+1),at(i,e/2,t*2)}function qu(n,t,e,i){return t=t!==void 0?t:!0,function(r,s,o,a){if(r!==void 0){let l=n[0],h=n[n.length-1],c=e?Ga(l,e,o,i):l;if(a)return t?Xa(r,c,h):at(r,h,c);let u=Math.min(c,r),d=Math.floor(Un(n,u,s));return n[d]>c&&d{mt();it();Ct()});function cr(n){if(n!==void 0)return 0}function za(n){if(n!==void 0)return n}function Ju(n){let t=2*Math.PI/n;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function Qu(n){let t=n===void 0?ir(5):n;return function(e,i){return i||e===void 0?e:Math.abs(e)<=t?0:e}}var ro=S(()=>{mt()});function Ya(n){return Math.pow(n,3)}function Me(n){return 1-Ya(1-n)}function td(n){return 3*n*n-2*n*n*n}function ed(n){return n}var Ji=S(()=>{});function le(n,t,e,i,r,s){s=s||[];let o=0;for(let a=t;a{});var rd,Ba,sd,od=S(()=>{ze();wt();Ye();it();Wt();Jt();Qi();rd=Xt(),Ba=class extends bt{constructor(){super(),this.extent_=vt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Ps((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);let r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return H()}closestPointXY(t,e,i,r){return H()}containsXY(t,e){let i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return H()}getExtent(t){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&xn(e),this.extentRevision_=this.getRevision()}return tu(this.extent_,t)}rotate(t,e){H()}scale(t,e,i){H()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return H()}getType(){return H()}applyTransform(t){H()}intersectsExtent(t){return H()}translate(t,e){H()}transform(t,e){let i=ft(t),r=i.getUnits()=="tile-pixels"?function(s,o,a){let l=i.getExtent(),h=i.getWorldExtent(),c=At(h)/At(l);return jt(rd,h[0],h[3],c,-c,0,0,0),le(s,0,s.length,a,rd,o),$i(i,e)(s,o,a)}:$i(i,e);return this.applyTransform(r),this}},sd=Ba});function Vm(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function ad(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function ld(n,t,e){let i=n.getFlatCoordinates();if(!i)return null;let r=n.getStride();return le(i,0,i.length,r,t,e)}var Ua,ur,jr=S(()=>{od();wt();it();Qi();Ua=class extends sd{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return H()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fr&&(r=h),s=a,o=l}return r}function cd(n,t,e,i,r){for(let s=0,o=e.length;s{mt()});function dd(n,t,e,i){for(let r=0,s=e.length;r{});function Vr(n,t,e,i,r,s,o){let a=(e-t)/i;if(a<3){for(;t0;){let u=h.pop(),d=h.pop(),f=0,g=n[d],m=n[d+1],p=n[u],_=n[u+1];for(let y=d+i;yf&&(c=y,f=T)}f>r&&(l[(c-t)/i]=1,d+i0&&m>f)&&(g<0&&p0&&p>g)){h=u,c=d;continue}s[o++]=h,s[o++]=c,a=h,l=c,h=u,c=d}return s[o++]=h,s[o++]=c,o}function ao(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l{mt()});function en(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=t;o{});function Ha(n,t,e,i){let r=0,s=n[e-i],o=n[e-i+1];for(;t{});var Ja,Qa,pd=S(()=>{jr();Ka();it();oo();Kr();lo();$a();Ja=class n extends ur{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new n(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,r){return rAe});var tl,Ae,Zr=S(()=>{jr();it();oo();mt();tl=class n extends ur{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){let t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){let s=this.flatCoordinates,o=Ei(t,e,s[0],s[1]);if(os&&(h-a)*(s-l)-(r-a)*(c-l)>0&&o++:c<=s&&(h-a)*(s-l)-(r-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function ho(n,t,e,i,r,s){if(e.length===0||!nn(n,t,e[0],i,r,s))return!1;for(let o=1,a=e.length;o{it()});function qr(n,t,e,i,r,s,o){let a,l,h,c,u,d,f,g=r[s+1],m=[];for(let y=0,C=e.length;y_&&(h=(c+u)/2,ho(n,t,e,i,h,g)&&(p=h,_=y)),c=u}return isNaN(p)&&(p=r[s]),o?(o.push(p,g,_),o):[p,g,_]}function xd(n,t,e,i,r){let s=[];for(let o=0,a=e.length;o{Ct();co()});function Ed(n,t,e,i,r){let s;for(t+=i;t{});function wd(n,t,e,i,r){let s=ca(vt(),n,t,e,i);return xt(r,s)?_i(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Ed(n,t,e,i,function(o,a){return eu(r,o,a)}):!1}function il(n,t,e,i,r){return!!(wd(n,t,e,i,r)||nn(n,t,e,i,r[0],r[1])||nn(n,t,e,i,r[0],r[3])||nn(n,t,e,i,r[2],r[1])||nn(n,t,e,i,r[2],r[3]))}function Td(n,t,e,i,r){if(!il(n,t,e[0],i,r))return!1;if(e.length===1)return!0;for(let s=1,o=e.length;s{it();Cd();co()});function Sd(n,t,e,i){for(;t{});function rl(n,t,e,i){let r=0,s=n[e-i],o=n[e-i+1];for(;t0}function Rd(n,t,e,i,r){r=r!==void 0?r:!1;for(let s=0,o=e.length;s{vd()});function al(n){if(qi(n))throw new Error("Cannot create polygon from empty extent");let t=n[0],e=n[1],i=n[2],r=n[3],s=[t,e,t,r,i,r,i,e,t,e];return new Hr(s,"XY",[s.length])}function ll(n,t,e){t=t||32;let i=n.getStride(),r=n.getLayout(),s=n.getCenter(),o=i*(t+1),a=new Array(o);for(let c=0;c{pd();Zr();jr();Ka();it();oo();Ct();el();lo();nl();ol();$a();co();mt();Kr();Hr=class n extends ur{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?jn(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new n(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r{ze();Hs();Cu();Wt();Jt();Je();Ht();Zu();mt();$u();ro();Ji();it();Ct();uo();hl=0,ul=class extends bt{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Ur(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&eo(),t.center&&(t.center=Et(t.center,this.projection_)),t.extent&&(t.extent=ae(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){let e=Object.assign({},t);for(let a in be)delete e[a];this.setProperties(e,!0);let i=Hm(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;let r=qm(t),s=i.constraint,o=$m(t);this.constraints_={center:r,resolution:s,rotation:o},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)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;let i=this.getCenterInternal();if(i){let r=t||[0,0,0,0];e=e||[0,0,0,0];let s=this.getResolution(),o=s/2*(r[3]-e[3]+e[1]-r[1]),a=s/2*(r[0]-e[0]+e[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(t){let e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let e=new Array(arguments.length);for(let i=0;i1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let r=0;for(;r0}getInteracting(){return this.hints_[Dt.INTERACTING]>0}cancelAnimations(){this.setHint(Dt.ANIMATING,-this.hints_[Dt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){let r=this.animations_[i],s=!0;for(let o=0,a=r.length;o0?h/l.duration:1;c>=1?(l.complete=!0,c=1):s=!1;let u=l.easing(c);if(l.sourceCenter){let d=l.sourceCenter[0],f=l.sourceCenter[1],g=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;let p=d+u*(g-d),_=f+u*(m-f);this.targetCenter_=[p,_]}if(l.sourceResolution&&l.targetResolution){let d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){let f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){let d=u===1?Ee(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){let f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(Dt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let o=r[0].callback;o&&fo(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i,r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-e[0],r[1]-e[1]],ar(i,t-this.getRotation()),Fu(i,e)),i}calculateCenterZoom(t,e){let i,r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){let o=e[0]-t*(e[0]-r[0])/s,a=e[1]-t*(e[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(t){let e=this.viewportSize_;if(t){let i=e[0],r=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){let t=this.getCenterInternal();return t&&ti(t,this.getProjection())}getCenterInternal(){return this.get(be.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){let e=this.calculateExtentInternal(t);return vi(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();let e=this.getCenterInternal();Y(e,"The view center is not defined");let i=this.getResolution();Y(i!==void 0,"The view resolution is not defined");let r=this.getRotation();return Y(r!==void 0,"The view rotation is not defined"),Nr(e,i,r,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(be.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(ae(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();let i=$(t)/e[0],r=At(t)/e[1];return Math.max(i,r)}getResolutionForValueFunction(t){t=t||2;let e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(e/i)/Math.log(t);return function(s){return e/Math.pow(t,s*r)}}getRotation(){return this.get(be.ROTATION)}getValueForResolutionFunction(t){let e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/e;return function(o){return Math.log(i/o)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){let t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),s=this.padding_;if(s){let o=this.getViewportSizeMinusPadding_();r=cl(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],e,i)}return{center:r.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t,e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,r;if(this.resolutions_){let s=Un(this.resolutions_,t,1);e=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return e+Math.log(i/t)/Math.log(r)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;let e=at(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,at(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(Y(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Y(!qi(t),"Cannot fit empty extent provided as `geometry`");let r=ae(t,this.getProjection());i=al(r)}else if(t.getType()==="Circle"){let r=ae(t.getExtent(),this.getProjection());i=al(r),i.rotate(this.getRotation(),Ie(r))}else{let r=Ce();r?i=t.clone().transform(r,this.getProjection()):i=t}this.fitInternal(i,e)}rotatedExtentForGeometry(t){let e=this.getRotation(),i=Math.cos(e),r=Math.sin(-e),s=t.getFlatCoordinates(),o=t.getStride(),a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=s.length;u=n.maxResolution)return!1;let i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}var dl,Rn,fr=S(()=>{wa();gt();Ea();rr();go();Ht();it();_e();dl=class extends qs{constructor(t){let e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(ht.SOURCE,this.handleSourcePropertyChange_);let i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(ht.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){let t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(et(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;let t=this.getSource();t&&(this.sourceChangeKey_=U(t,A.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e,i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof we?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;e.layerStatesArray?r=e.layerStatesArray.find(o=>o.layer===this):r=this.getLayerState();let s=this.getExtent();return $r(r,e.viewState)&&(!s||xt(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e,i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];let r=t instanceof we?t.getViewStateAndExtent():t,s=e(r);return Array.isArray(s)||(s=[s]),s}render(t,e){let i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(ht.MAP,t)}getMapInternal(){return this.get(ht.MAP)}setMap(t){this.mapPrecomposeKey_&&(et(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(et(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=U(t,Qt.PRECOMPOSE,function(e){let r=e.frameState.layerStatesArray,s=this.getLayerState(!1);Y(!r.some(function(o){return o.layer===s.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),r.push(s)},this),this.mapRenderKey_=U(this,A.CHANGE,t.render,t),this.changed())}setSource(t){this.set(ht.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}};Rn=dl});var gl,mo,ml=S(()=>{ke();gl=class extends Lt{constructor(t,e,i,r){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=r}},mo=gl});var Jr,rn,gr,pl,tp,Ad,_l,mr=S(()=>{Jr="ol-hidden",rn="ol-unselectable",gr="ol-control",pl="ol-collapsed",tp=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"),Ad=["style","variant","weight","size","lineHeight","family"],_l=function(n){let t=n.match(tp);if(!t)return null;let e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,r=Ad.length;i{pi()});function Dd(n,t){return pr||(pr=pt(1,1)),n!=xl&&(pr.font=n,xl=pr.font),pr.measureText(t)}function po(n,t){return Dd(n,t).width}function Cl(n,t,e){if(t in e)return e[t];let i=t.split(` -`).reduce((r,s)=>Math.max(r,po(n,s)),0);return e[t]=i,i}function kd(n,t){let e=[],i=[],r=[],s=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){let u=t[h];if(u===` -`||h===c){s=Math.max(s,o),r.push(o),o=0,a+=l;continue}let d=t[h+1]||n.font,f=po(d,u);e.push(f),o+=f;let g=ep(d);i.push(g),l=Math.max(l,g)}return{width:s,height:a,widths:e,heights:i,lineWidths:r}}function Nd(n,t,e,i,r,s,o,a,l,h,c){n.save(),e!==1&&(n.globalAlpha*=e),t&&n.transform.apply(n,t),i.contextInstructions?(n.translate(l,h),n.scale(c[0],c[1]),ip(i,n)):c[0]<0||c[1]<0?(n.translate(l,h),n.scale(c[0],c[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,h,o*c[0],a*c[1]),n.restore()}function ip(n,t){let e=n.contextInstructions;for(let i=0,r=e.length;i{ze();pi();We();ie();mr();_o="10px sans-serif",kt="#000",ii="round",he=[],ce=0,ni="round",Ri=10,Ii="#000",sn="center",Ln="middle",Li=[0,0,0,0],bi=1,ei=new bt,pr=null,El={},Fd=function(){let t="32px ",e=["monospace","serif"],i=e.length,r="wmytzilWMYTZIL@#/&?$%10\uF013",s,o;function a(h,c,u){let d=!0;for(let f=0;f()=>(n&&(t=n(n=0)),t);var Rc=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Fi=(n,t)=>{for(var e in t)ys(n,e,{get:t[e],enumerable:!0})},Sc=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of em(t))!nm.call(n,r)&&r!==e&&ys(n,r,{get:()=>t[r],enumerable:!(i=tm(t,r))||i.enumerable});return n};var Ic=(n,t,e)=>(e=n!=null?Qg(im(n)):{},Sc(t||!n||!n.__esModule?ys(e,"default",{value:n,enumerable:!0}):e,n)),Di=n=>Sc(ys({},"__esModule",{value:!0}),n);var Wo,Ft,je=v(()=>{Wo=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},Ft=Wo});var Ae,Fn=v(()=>{Ae={PROPERTYCHANGE:"propertychange"}});var zo,Dn,xs=v(()=>{zo=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}},Dn=zo});function Lc(n,t,e){let i,r;e=e||de;let s=0,o=n.length,a=!1;for(;s>1),r=+e(n[i],t),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function de(n,t){return n>t?1:n0?r-1:r}return i-1}if(e>0){for(let r=1;r0||e&&o===0)})}var Ct=v(()=>{});function li(){return!0}function hi(){return!1}function Me(){}function Es(n){let t=!1,e,i,r;return function(){let s=Array.prototype.slice.call(arguments);return(!t||this!==r||!Vt(s,i))&&(t=!0,r=this,i=s,e=n.apply(this,arguments)),e}}var Ht=v(()=>{Ct()});function Be(n){for(let t in n)delete n[t]}function Pe(n){let t;for(t in n)return!1;return!t}var Oe=v(()=>{});var Yo,ki,Lr=v(()=>{xs();je();Ht();Oe();Yo=class extends Dn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;let i=this.listeners_||(this.listeners_={}),r=i[t]||(i[t]=[]);r.includes(e)||r.push(e)}dispatchEvent(t){let e=typeof t=="string",i=e?t:t.type,r=this.listeners_&&this.listeners_[i];if(!r)return;let s=e?new Ft(t):t;s.target||(s.target=this.eventTarget_||this);let o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let h=0,c=r.length;h0:!1}removeEventListener(t,e){if(!this.listeners_)return;let i=this.listeners_[t];if(!i)return;let r=i.indexOf(e);r!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[r]=Me,++this.pendingRemovals_[t]):(i.splice(r,1),i.length===0&&delete this.listeners_[t]))}},ki=Yo});var D,pt=v(()=>{D={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 U(n,t,e,i,r){if(i&&i!==n&&(e=e.bind(i)),r){let o=e;e=function(){n.removeEventListener(t,e),o.apply(this,arguments)}}let s={target:n,type:t,listener:e};return n.addEventListener(t,e),s}function Gn(n,t,e,i){return U(n,t,e,i,!0)}function et(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Be(n))}var fe=v(()=>{Oe()});function rm(n){if(Array.isArray(n))for(let t=0,e=n.length;t{Lr();pt();fe();Xn=class extends ki{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(D.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){let i=t.length,r=new Array(i);for(let s=0;s{sm=0});var ws,jo,St,Fe=v(()=>{je();Fn();Uo();wt();Oe();ws=class extends Ft{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}},jo=class extends Cs{constructor(t){super(),this.on,this.once,this.un,K(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new ws(i,t,e)),i=Ae.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new ws(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){let r=this.values_||(this.values_={});if(i)r[t]=e;else{let s=r[t];r[t]=e,s!==e&&this.notify(t,s)}}setProperties(t,e){for(let i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){let i=this.values_[t];delete this.values_[t],Pe(this.values_)&&(this.values_=null),e||this.notify(t,i)}}},St=jo});var Dt,br=v(()=>{Dt={ADD:"add",REMOVE:"remove"}});var Mc,Wn,Bo,$t,zn=v(()=>{Fe();br();je();Mc={LENGTH:"length"},Wn=class extends Ft{constructor(t,e,i){super(t),this.element=e,this.index=i}},Bo=class extends St{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,r=this.array_.length;i0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Wn(Dt.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);let e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){let e=this.array_;for(let i=0,r=e.length;i=this.getLength())return;let e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Wn(Dt.REMOVE,e,t)),e}setAt(t,e){let i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);let r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Wn(Dt.REMOVE,r,t)),this.dispatchEvent(new Wn(Dt.ADD,e,t))}updateLength_(){this.set(Mc.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,r=this.array_.length;i{Ni=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Pc=Ni.includes("firefox"),om=Ni.includes("safari")&&!Ni.includes("chrom"),F_=om&&(Ni.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ni)),Oc=Ni.includes("webkit")&&!Ni.includes("edge"),Ko=Ni.includes("macintosh"),Ts=typeof devicePixelRatio<"u"?devicePixelRatio:1,Yn=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Vo=typeof Image<"u"&&Image.prototype.decode,vs=function(){let n=!1;try{let t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}()});function z(n,t){if(!n)throw new Error(t)}var Zt=v(()=>{});function kt(){return[1,0,0,1,0,0]}function am(n,t,e,i,r,s,o){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function Dc(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function _t(n,t){let e=t[0],i=t[1];return t[0]=n[0]*e+n[2]*i+n[4],t[1]=n[1]*e+n[3]*i+n[5],t}function kc(n,t,e){return am(n,t,0,0,e,0,0)}function zt(n,t,e,i,r,s,o,a){let l=Math.sin(s),h=Math.cos(s);return n[0]=i*h,n[1]=r*l,n[2]=-i*l,n[3]=r*h,n[4]=o*i*h-a*i*l+t,n[5]=o*r*l+a*r*h+e,n}function Un(n,t){let e=lm(t);z(e!==0,"Transformation matrix cannot be inverted");let i=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5];return n[0]=o/e,n[1]=-r/e,n[2]=-s/e,n[3]=i/e,n[4]=(s*l-o*a)/e,n[5]=-(i*l-r*a)/e,n}function lm(n){return n[0]*n[3]-n[1]*n[2]}function Rs(n){let t="matrix("+n.join(", ")+")";if(Yn)return t;let e=Fc||(Fc=document.createElement("div"));return e.style.transform=t,e.style.transform}var X_,Fc,De=v(()=>{ci();Zt();X_=new Array(6)});var It,Zo=v(()=>{It={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16}});function qo(n){let t=Tt();for(let e=0,i=n.length;er&&(l=l|It.RIGHT),as&&(l=l|It.ABOVE),l===It.UNKNOWN&&(l=It.INTERSECTING),l}function Tt(){return[1/0,1/0,-1/0,-1/0]}function ge(n,t,e,i,r){return r?(r[0]=n,r[1]=t,r[2]=e,r[3]=i,r):[n,t,e,i]}function hn(n){return ge(1/0,1/0,-1/0,-1/0,n)}function bs(n,t){let e=n[0],i=n[1];return ge(e,i,e,i,t)}function Bn(n,t,e,i,r){let s=hn(r);return $o(s,n,t,e,i)}function di(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function Nc(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function cn(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function $o(n,t,e,i,r){for(;et[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function Wi(n){return n[2]=o&&m<=l),!i&&s&It.RIGHT&&!(r&It.RIGHT)&&(p=f-(d-l)*g,i=p>=a&&p<=h),!i&&s&It.BELOW&&!(r&It.BELOW)&&(m=d-(f-a)/g,i=m>=o&&m<=l),!i&&s&It.LEFT&&!(r&It.LEFT)&&(p=f-(d-o)*g,i=p>=a&&p<=h)}return i}function zc(n,t,e,i){if(Wi(n))return hn(e);let r=[];if(i>1){let a=n[2]-n[0],l=n[3]-n[1];for(let h=0;h=e[2])){let r=$(e),o=Math.floor((i[0]-e[0])/r)*r;n[0]-=o,n[2]-=o}return n}function Yc(n,t){if(t.canWrapX()){let e=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[e[0],n[1],e[2],n[3]]];Jo(n,t);let i=$(e);if($(n)>i)return[[e[0],n[1],e[2],n[3]]];if(n[0]e[2])return[[n[0],n[1],e[2],n[3]],[e[0],n[1],n[2]-i,n[3]]]}return[n]}var rt=v(()=>{Zo()});var fi,Pr=v(()=>{fi={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}});var un,ne,Ps=v(()=>{Pr();un={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};un.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};un.max=un.whitepoint[2].D65;un.rgb=function(n,t){t=t||un.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],r=n[2]/t[2],s,o,a;return s=e*3.240969941904521+i*-1.537383177570093+r*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+r*.041555057407175,a=e*.055630079696993+i*-.20397695888897+r*1.056971514242878,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[s*255,o*255,a*255]};fi.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,r=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var s=e*.41239079926595+i*.35758433938387+r*.18048078840183,o=e*.21263900587151+i*.71516867876775+r*.072192315360733,a=e*.019330818715591+i*.11919477979462+r*.95053215224966;return t=t||un.whitepoint[2].E,[s*t[0],o*t[1],a*t[2]]};ne=un});var Os,Uc=v(()=>{Ps();Os={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,r,s,o,a,l,h,c,u,d,f,g,m;if(s=n[0],o=n[1],a=n[2],s===0)return[0,0,0];var p=.0011070564598794539;return t=t||"D65",e=e||2,u=ne.whitepoint[e][t][0],d=ne.whitepoint[e][t][1],f=ne.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),m=9*d/(u+15*d+3*f),i=o/(13*s)+g||0,r=a/(13*s)+m||0,h=s>8?d*Math.pow((s+16)/116,3):d*s*p,l=h*9*i/(4*r)||0,c=h*(12-3*i-20*r)/(4*r)||0,[l,h,c]}};ne.luv=function(n,t,e){var i,r,s,o,a,l,h,c,u,d,f,g,m,p=.008856451679035631,_=903.2962962962961;t=t||"D65",e=e||2,u=ne.whitepoint[e][t][0],d=ne.whitepoint[e][t][1],f=ne.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),m=9*d/(u+15*d+3*f),l=n[0],h=n[1],c=n[2],i=4*l/(l+15*h+3*c)||0,r=9*h/(l+15*h+3*c)||0;var y=h/d;return s=y<=p?_*y:116*Math.pow(y,1/3)-16,o=13*s*(i-g),a=13*s*(r-m),[s,o,a]}});var jc,Bc,Kc=v(()=>{Uc();Ps();jc={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],r,s,o;return o=i/360*2*Math.PI,r=e*Math.cos(o),s=e*Math.sin(o),[t,r,s]},xyz:function(n){return Os.xyz(jc.luv(n))}},Bc=jc;Os.lchuv=function(n){var t=n[0],e=n[1],i=n[2],r=Math.sqrt(e*e+i*i),s=Math.atan2(i,e),o=s*360/2/Math.PI;return o<0&&(o+=360),[t,r,o]};ne.lchuv=function(n){return Os.lchuv(ne.luv(n))}});var Zc=Rc((J_,Vc)=>{"use strict";Vc.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});function um(n){var t,e=[],i=1,r;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),Qo.default[n])e=Qo.default[n].slice(),r="rgb";else if(n==="transparent")i=0,r="rgb",e=[0,0,0];else if(n[0]==="#"){var s=n.slice(1),o=s.length,a=o<=4;i=1,a?(e=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],o===4&&(i=parseInt(s[3]+s[3],16)/255)):(e=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],o===8&&(i=parseInt(s[6]+s[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),r="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];r=l.replace(/a$/,"");var h=r==="cmyk"?4:r==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),r==="color"&&(r=e.shift()),e=e.map(function(c,u){if(c[c.length-1]==="%")return c=parseFloat(c)/100,u===3?c:r==="rgb"?c*255:r[0]==="h"||r[0]==="l"&&!u?c*100:r==="lab"?c*125:r==="lch"?u<2?c*150:c*360:r[0]==="o"&&!u?c:r==="oklab"?c*.4:r==="oklch"?u<2?c*.4:c*360:c;if(r[u]==="h"||u===2&&r[r.length-1]==="h"){if(qc[c]!==void 0)return qc[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),i=e.length>h?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),r=n.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:r,values:e,alpha:i}}var Qo,Hc,qc,$c=v(()=>{Qo=Ic(Zc(),1),Hc=um,qc={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}});var Fs,Jc=v(()=>{Pr();Fs={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,r,s,o,a,l,h=0;if(e===0)return l=i*255,[l,l,l];for(s=i<.5?i*(1+e):i+e-i*e,r=2*i-s,a=[0,0,0];h<3;)o=t+1/3*-(h-1),o<0?o++:o>1&&o--,l=6*o<1?r+(s-r)*6*o:2*o<1?s:3*o<2?r+(s-r)*(2/3-o)*6:r,a[h++]=l*255;return a}};fi.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,r=Math.min(t,e,i),s=Math.max(t,e,i),o=s-r,a,l,h;return s===r?a=0:t===s?a=(e-i)/o:e===s?a=2+(i-t)/o:i===s&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),h=(r+s)/2,s===r?l=0:h<=.5?l=o/(s+r):l=o/(2-s-r),[a,l*100,h*100]}});function ta(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e,i,r=Hc(n);if(!r.space)return[];let s=r.space[0]==="h"?Fs.min:fi.min,o=r.space[0]==="h"?Fs.max:fi.max;return t=Array(3),t[0]=Math.min(Math.max(r.values[0],s[0]),o[0]),t[1]=Math.min(Math.max(r.values[1],s[1]),o[1]),t[2]=Math.min(Math.max(r.values[2],s[2]),o[2]),r.space[0]==="h"&&(t=Fs.rgb(t)),t.push(Math.min(Math.max(r.alpha,0),1)),t}var Qc=v(()=>{$c();Pr();Jc()});function ot(n,t,e){return Math.min(Math.max(n,t),e)}function tu(n,t,e,i,r,s){let o=r-e,a=s-i;if(o!==0||a!==0){let l=((n-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=r,i=s):l>0&&(e+=o*l,i+=a*l)}return gi(n,t,e,i)}function gi(n,t,e,i){let r=e-n,s=i-t;return r*r+s*s}function eu(n){let t=n.length;for(let i=0;is&&(s=l,r=a)}if(s===0)return null;let o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a=0;i--){e[i]=n[i][t]/n[i][i];for(let r=i-1;r>=0;r--)n[r][t]-=n[r][i]*e[i]}return e}function qn(n){return n*Math.PI/180}function ke(n,t){let e=n%t;return e*t<0?e+t:e}function qt(n,t,e){return n+e*(t-n)}function Ds(n,t){let e=Math.pow(10,t);return Math.round(n*e)/e}function Or(n,t){return Math.floor(Ds(n,t))}function Fr(n,t){return Math.ceil(Ds(n,t))}var xt=v(()=>{});function ks(n){return typeof n=="string"?n:ra(n)}function iu(n){if(n.length===4)return n;let t=n.slice();return t[3]=1,t}function ia(n){let t=ne.lchuv(fi.xyz(n));return t[3]=n[3],t}function nu(n){let t=ne.rgb(Bc.xyz(n));return t[3]=n[3],t}function Ns(n){if(Dr.hasOwnProperty(n))return Dr[n];if(ea>=dm){let e=0;for(let i in Dr)e++&3||(delete Dr[i],--ea)}let t=ta(n);if(t.length!==4)throw new Error('Failed to parse "'+n+'" as color');for(let e of t)if(isNaN(e))throw new Error('Failed to parse "'+n+'" as color');return na(t),Dr[n]=t,++ea,t}function dn(n){return Array.isArray(n)?n:Ns(n)}function na(n){return n[0]=ot(n[0]+.5|0,0,255),n[1]=ot(n[1]+.5|0,0,255),n[2]=ot(n[2]+.5|0,0,255),n[3]=ot(n[3],0,1),n}function ra(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);let r=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+t+","+e+","+i+","+r+")"}function ru(n){try{return Ns(n),!0}catch{return!1}}var dm,Dr,ea,mi=v(()=>{Kc();Qc();Pr();Ps();xt();dm=1024,Dr={},ea=0});function su(n,t,e){let i=e?ks(e):"null";return t+":"+n+":"+i}var sa,Hn,oa=v(()=>{mi();sa=class{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(let e in this.cache_){let i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){let r=su(t,e,i);return r in this.cache_?this.cache_[r]:null}set(t,e,i,r){let s=su(t,e,i);this.cache_[s]=r,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}};Hn=new sa});var lt,aa=v(()=>{lt={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"}});var la,Gs,ha=v(()=>{Fe();aa();wt();Zt();xt();la=class extends St{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;let e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[lt.OPACITY]=t.opacity!==void 0?t.opacity:1,z(typeof e[lt.OPACITY]=="number","Layer opacity must be a number"),e[lt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[lt.Z_INDEX]=t.zIndex,e[lt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[lt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[lt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[lt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){let e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=ot(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return H()}getLayerStatesArray(t){return H()}getExtent(){return this.get(lt.EXTENT)}getMaxResolution(){return this.get(lt.MAX_RESOLUTION)}getMinResolution(){return this.get(lt.MIN_RESOLUTION)}getMinZoom(){return this.get(lt.MIN_ZOOM)}getMaxZoom(){return this.get(lt.MAX_ZOOM)}getOpacity(){return this.get(lt.OPACITY)}getSourceState(){return H()}getVisible(){return this.get(lt.VISIBLE)}getZIndex(){return this.get(lt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(lt.EXTENT,t)}setMaxResolution(t){this.set(lt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(lt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(lt.MAX_ZOOM,t)}setMinZoom(t){this.set(lt.MIN_ZOOM,t)}setOpacity(t){z(typeof t=="number","Layer opacity must be a number"),this.set(lt.OPACITY,t)}setVisible(t){this.set(lt.VISIBLE,t)}setZIndex(t){this.set(lt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}},Gs=la});var Jt,$n=v(()=>{Jt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}});var Pt,Xs=v(()=>{Pt={ANIMATING:0,INTERACTING:1}});var we,ou=v(()=>{we={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"}});var Ke,ca=v(()=>{Ke={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937}});var ua,Jn,Ws=v(()=>{ca();ua=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Ke[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},Jn=ua});function au(n,t,e){let i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let r=0;rzs?s=zs:s<-zs&&(s=-zs),t[r+1]=s}return t}function lu(n,t,e){let i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let r=0;r{Ws();kr=6378137,Qn=Math.PI*kr,fm=[-Qn,-Qn,Qn,Qn],gm=[-180,-85,180,85],zs=kr*Math.log(Math.tan(Math.PI/2)),zi=class extends Jn{constructor(t){super({code:t,units:"m",extent:fm,global:!0,worldExtent:gm,getPointResolution:function(e,i){return e/Math.cosh(i[1]/kr)}})}},da=[new zi("EPSG:3857"),new zi("EPSG:102100"),new zi("EPSG:102113"),new zi("EPSG:900913"),new zi("http://www.opengis.net/def/crs/EPSG/0/3857"),new zi("http://www.opengis.net/gml/srs/epsg.xml#3857")]});var mm,cu,pm,pi,fa,uu=v(()=>{Ws();mm=6378137,cu=[-180,-90,180,90],pm=Math.PI*mm/180,pi=class extends Jn{constructor(t,e){super({code:t,units:"degrees",extent:cu,axisOrientation:e,global:!0,metersPerUnit:pm,worldExtent:cu})}},fa=[new pi("CRS:84"),new pi("EPSG:4326","neu"),new pi("urn:ogc:def:crs:OGC:1.3:CRS84"),new pi("urn:ogc:def:crs:OGC:2:84"),new pi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new pi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new pi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")]});function du(){Ys={}}function fu(n){return Ys[n]||Ys[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function gu(n,t){Ys[n]=t}var Ys,mu=v(()=>{Ys={}});function pu(){fn={}}function gn(n,t,e){let i=n.getCode(),r=t.getCode();i in fn||(fn[i]={}),fn[i][r]=e}function _u(n,t){let e;return n in fn&&t in fn[n]&&(e=fn[n][t]),e}var fn,yu=v(()=>{fn={}});function xu(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Eu(n){return function(t){return ym(t,n)}}function _m(n,t,e){return n?t.replace("{x}",n[0].toFixed(e)).replace("{y}",n[1].toFixed(e)):""}function mn(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function tr(n,t){let e=Math.cos(t),i=Math.sin(t),r=n[0]*e-n[1]*i,s=n[1]*e+n[0]*i;return n[0]=r,n[1]=s,n}function Cu(n,t){return n[0]*=t,n[1]*=t,n}function ym(n,t){return _m(n,"{x}, {y}",t)}function er(n,t){if(t.canWrapX()){let e=$(t.getExtent()),i=ga(n,t,e);i&&(n[0]-=i*e)}return n}function ga(n,t,e){let i=t.getExtent(),r=0;return t.canWrapX()&&(n[0]i[2])&&(e=e||$(i),r=Math.floor((n[0]-i[0])/e)),r}var _i=v(()=>{rt()});function ma(n,t,e){e=e||xm;let i=qn(n[1]),r=qn(t[1]),s=(r-i)/2,o=qn(t[0]-n[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}var xm,wu=v(()=>{xt();xm=63710088e-1});function Us(...n){Em>Tu.warn||console.warn(...n)}var Tu,Em,pa=v(()=>{Tu={info:1,warn:2,error:3,none:4},Em=Tu.info});var Au={};Fi(Au,{METERS_PER_UNIT:()=>Ke,Projection:()=>Jn,addCommon:()=>bu,addCoordinateTransforms:()=>wm,addEquivalentProjections:()=>ya,addEquivalentTransforms:()=>Su,addProjection:()=>vu,addProjections:()=>Ru,clearAllProjections:()=>Cm,clearUserProjection:()=>Rm,cloneTransform:()=>Bs,createProjection:()=>Gr,createSafeCoordinateTransform:()=>Im,createTransformFromCoordinateTransform:()=>xa,disableCoordinateWarning:()=>js,equivalent:()=>yi,fromLonLat:()=>ir,fromUserCoordinate:()=>Te,fromUserExtent:()=>ve,fromUserResolution:()=>Lu,get:()=>ft,getPointResolution:()=>Ks,getTransform:()=>Yi,getTransformFromProjections:()=>Ve,getUserProjection:()=>_n,identityTransform:()=>Nr,setUserProjection:()=>Iu,toLonLat:()=>Tm,toUserCoordinate:()=>nr,toUserExtent:()=>yn,toUserResolution:()=>Ca,transform:()=>pn,transformExtent:()=>Ea,transformWithProjections:()=>vm,useGeographic:()=>Sm});function js(n){_a=!(n===void 0?!0:n)}function Bs(n,t){if(t!==void 0){for(let e=0,i=n.length;e=a?t[s+l]:o[l]}return e}}function wm(n,t,e,i){let r=ft(n),s=ft(t);gn(r,s,xa(e)),gn(s,r,xa(i))}function ir(n,t){return js(),pn(n,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function Tm(n,t){let e=pn(n,t!==void 0?t:"EPSG:3857","EPSG:4326"),i=e[0];return(i<-180||i>180)&&(e[0]=ke(i+180,360)-180),e}function yi(n,t){if(n===t)return!0;let e=n.getUnits()===t.getUnits();return(n.getCode()===t.getCode()||Ve(n,t)===Bs)&&e}function Ve(n,t){let e=n.getCode(),i=t.getCode(),r=_u(e,i);return r||(r=Nr),r}function Yi(n,t){let e=ft(n),i=ft(t);return Ve(e,i)}function pn(n,t,e){return Yi(t,e)(n,void 0,n.length)}function Ea(n,t,e,i){let r=Yi(t,e);return zc(n,r,void 0,i)}function vm(n,t,e){return Ve(t,e)(n)}function Iu(n){Qt=ft(n)}function Rm(){Qt=null}function _n(){return Qt}function Sm(){Iu("EPSG:4326")}function nr(n,t){return Qt?pn(n,t,Qt):n}function Te(n,t){return Qt?pn(n,Qt,t):(_a&&!mn(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(_a=!1,Us("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function yn(n,t){return Qt?Ea(n,t,Qt):n}function ve(n,t){return Qt?Ea(n,Qt,t):n}function Ca(n,t){if(!Qt)return n;let e=ft(t).getMetersPerUnit(),i=Qt.getMetersPerUnit();return e&&i?n*e/i:n}function Lu(n,t){if(!Qt)return n;let e=ft(t).getMetersPerUnit(),i=Qt.getMetersPerUnit();return e&&i?n*i/e:n}function Im(n,t,e){return function(i){let r,s;if(n.canWrapX()){let o=n.getExtent(),a=$(o);i=i.slice(0),s=ga(i,n,a),s&&(i[0]=i[0]-s*a),i[0]=ot(i[0],o[0],o[2]),i[1]=ot(i[1],o[1],o[3]),r=e(i)}else r=e(i);return s&&t.canWrapX()&&(r[0]+=s*$(t.getExtent())),r}}function bu(){ya(da),ya(fa),Su(fa,da,au,lu)}var _a,Qt,Yt=v(()=>{Ws();hu();uu();ca();mu();yu();rt();xt();_i();wu();pa();_a=!0;Qt=null;bu()});function wa(n,t,e){return function(i,r,s,o,a){if(!i)return;if(!r&&!t)return i;let l=t?0:s[0]*r,h=t?0:s[1]*r,c=a?a[0]:0,u=a?a[1]:0,d=n[0]+l/2+c,f=n[2]-l/2+c,g=n[1]+h/2+u,m=n[3]-h/2+u;d>f&&(d=(f+d)/2,f=d),g>m&&(g=(m+g)/2,m=g);let p=ot(i[0],d,f),_=ot(i[1],g,m);if(o&&e&&r){let y=30*r;p+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),_+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-m)/y)}return[p,_]}}function Mu(n){return n}var Pu=v(()=>{xt()});function Ta(n,t,e,i){let r=$(t)/e[0],s=Lt(t)/e[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function va(n,t,e){let i=Math.min(n,t),r=50;return i*=Math.log(1+r*Math.max(0,n/t-1))/r+1,e&&(i=Math.max(i,e),i/=Math.log(1+r*Math.max(0,e/n-1))/r+1),ot(i,e/2,t*2)}function Ou(n,t,e,i){return t=t!==void 0?t:!0,function(r,s,o,a){if(r!==void 0){let l=n[0],h=n[n.length-1],c=e?Ta(l,e,o,i):l;if(a)return t?va(r,c,h):ot(r,h,c);let u=Math.min(c,r),d=Math.floor(kn(n,u,s));return n[d]>c&&d{xt();rt();Ct()});function rr(n){if(n!==void 0)return 0}function Sa(n){if(n!==void 0)return n}function ku(n){let t=2*Math.PI/n;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function Nu(n){let t=n===void 0?qn(5):n;return function(e,i){return i||e===void 0?e:Math.abs(e)<=t?0:e}}var Vs=v(()=>{xt()});function Ia(n){return Math.pow(n,3)}function Re(n){return 1-Ia(1-n)}function Gu(n){return 3*n*n-2*n*n*n}function Xu(n){return n}var Ui=v(()=>{});function re(n,t,e,i,r,s){s=s||[];let o=0;for(let a=t;a{});var Yu,La,Uu,ju=v(()=>{Fe();wt();De();rt();Yt();Ht();ji();Yu=kt(),La=class extends St{constructor(){super(),this.extent_=Tt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Es((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);let r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return H()}closestPointXY(t,e,i,r){return H()}containsXY(t,e){let i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return H()}getExtent(t){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&hn(e),this.extentRevision_=this.getRevision()}return Xc(this.extent_,t)}rotate(t,e){H()}scale(t,e,i){H()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return H()}getType(){return H()}applyTransform(t){H()}intersectsExtent(t){return H()}translate(t,e){H()}transform(t,e){let i=ft(t),r=i.getUnits()=="tile-pixels"?function(s,o,a){let l=i.getExtent(),h=i.getWorldExtent(),c=Lt(h)/Lt(l);return zt(Yu,h[0],h[3],c,-c,0,0,0),re(s,0,s.length,a,Yu,o),Yi(i,e)(s,o,a)}:Yi(i,e);return this.applyTransform(r),this}},Uu=La});function Lm(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function Bu(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function Ku(n,t,e){let i=n.getFlatCoordinates();if(!i)return null;let r=n.getStride();return re(i,0,i.length,r,t,e)}var ba,sr,Xr=v(()=>{ju();wt();rt();ji();ba=class extends Uu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Bn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return H()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fr&&(r=h),s=a,o=l}return r}function Zu(n,t,e,i,r){for(let s=0,o=e.length;s{xt()});function Hu(n,t,e,i){for(let r=0,s=e.length;r{});function Wr(n,t,e,i,r,s,o){let a=(e-t)/i;if(a<3){for(;t0;){let u=h.pop(),d=h.pop(),f=0,g=n[d],m=n[d+1],p=n[u],_=n[u+1];for(let y=d+i;yf&&(c=y,f=T)}f>r&&(l[(c-t)/i]=1,d+i0&&m>f)&&(g<0&&p0&&p>g)){h=u,c=d;continue}s[o++]=h,s[o++]=c,a=h,l=c,h=u,c=d}return s[o++]=h,s[o++]=c,o}function Hs(n,t,e,i,r,s,o,a){for(let l=0,h=e.length;l{xt()});function Ki(n,t,e,i,r){r=r!==void 0?r:[];let s=0;for(let o=t;o{});function Da(n,t,e,i){let r=0,s=n[e-i],o=n[e-i+1];for(;t{});var Na,Ga,td=v(()=>{Xr();Pa();rt();qs();zr();$s();ka();Na=class n extends sr{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new n(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,r){return rar});var Xa,ar,Js=v(()=>{Xr();rt();qs();xt();Xa=class n extends sr{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){let t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,r){let s=this.flatCoordinates,o=gi(t,e,s[0],s[1]);if(os&&(h-a)*(s-l)-(r-a)*(c-l)>0&&o++:c<=s&&(h-a)*(s-l)-(r-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function Qs(n,t,e,i,r,s){if(e.length===0||!Vi(n,t,e[0],i,r,s))return!1;for(let o=1,a=e.length;o{rt()});function Yr(n,t,e,i,r,s,o){let a,l,h,c,u,d,f,g=r[s+1],m=[];for(let y=0,C=e.length;y_&&(h=(c+u)/2,Qs(n,t,e,i,h,g)&&(p=h,_=y)),c=u}return isNaN(p)&&(p=r[s]),o?(o.push(p,g,_),o):[p,g,_]}function nd(n,t,e,i,r){let s=[];for(let o=0,a=e.length;o{Ct();to()});function rd(n,t,e,i,r){let s;for(t+=i;t{});function od(n,t,e,i,r){let s=$o(Tt(),n,t,e,i);return yt(r,s)?ui(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:rd(n,t,e,i,function(o,a){return Wc(r,o,a)}):!1}function za(n,t,e,i,r){return!!(od(n,t,e,i,r)||Vi(n,t,e,i,r[0],r[1])||Vi(n,t,e,i,r[0],r[3])||Vi(n,t,e,i,r[2],r[1])||Vi(n,t,e,i,r[2],r[3]))}function ad(n,t,e,i,r){if(!za(n,t,e[0],i,r))return!1;if(e.length===1)return!0;for(let s=1,o=e.length;s{rt();sd();to()});function ld(n,t,e,i){for(;t{});function Ua(n,t,e,i){let r=0,s=n[e-i],o=n[e-i+1];for(;t0}function cd(n,t,e,i,r){r=r!==void 0?r:!1;for(let s=0,o=e.length;s{hd()});function Ka(n){if(Wi(n))throw new Error("Cannot create polygon from empty extent");let t=n[0],e=n[1],i=n[2],r=n[3],s=[t,e,t,r,i,r,i,e,t,e];return new eo(s,"XY",[s.length])}var eo,dd,Va=v(()=>{td();Js();Xr();Pa();rt();qs();Ct();Wa();$s();Ya();Ba();ka();to();zr();eo=class n extends sr{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Nn(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new n(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,r){return r{Fe();Xs();ou();Yt();Ht();_i();Zt();Pu();xt();Du();Vs();Ui();rt();Ct();Va();Za=0,Ha=class extends St{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Gr(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&js(),t.center&&(t.center=Te(t.center,this.projection_)),t.extent&&(t.extent=ve(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){let e=Object.assign({},t);for(let a in we)delete e[a];this.setProperties(e,!0);let i=Mm(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;let r=Am(t),s=i.constraint,o=Pm(t);this.constraints_={center:r,resolution:s,rotation:o},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)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;let i=this.getCenterInternal();if(i){let r=t||[0,0,0,0];e=e||[0,0,0,0];let s=this.getResolution(),o=s/2*(r[3]-e[3]+e[1]-r[1]),a=s/2*(r[0]-e[0]+e[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(t){let e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let e=new Array(arguments.length);for(let i=0;i1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let r=0;for(;r0}getInteracting(){return this.hints_[Pt.INTERACTING]>0}cancelAnimations(){this.setHint(Pt.ANIMATING,-this.hints_[Pt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){let r=this.animations_[i],s=!0;for(let o=0,a=r.length;o0?h/l.duration:1;c>=1?(l.complete=!0,c=1):s=!1;let u=l.easing(c);if(l.sourceCenter){let d=l.sourceCenter[0],f=l.sourceCenter[1],g=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;let p=d+u*(g-d),_=f+u*(m-f);this.targetCenter_=[p,_]}if(l.sourceResolution&&l.targetResolution){let d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){let f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){let d=u===1?ke(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){let f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(Pt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let o=r[0].callback;o&&io(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i,r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-e[0],r[1]-e[1]],tr(i,t-this.getRotation()),xu(i,e)),i}calculateCenterZoom(t,e){let i,r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){let o=e[0]-t*(e[0]-r[0])/s,a=e[1]-t*(e[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(t){let e=this.viewportSize_;if(t){let i=e[0],r=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){let t=this.getCenterInternal();return t&&nr(t,this.getProjection())}getCenterInternal(){return this.get(we.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){let e=this.calculateExtentInternal(t);return yn(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();let e=this.getCenterInternal();z(e,"The view center is not defined");let i=this.getResolution();z(i!==void 0,"The view resolution is not defined");let r=this.getRotation();return z(r!==void 0,"The view rotation is not defined"),Mr(e,i,r,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(we.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(ve(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();let i=$(t)/e[0],r=Lt(t)/e[1];return Math.max(i,r)}getResolutionForValueFunction(t){t=t||2;let e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(e/i)/Math.log(t);return function(s){return e/Math.pow(t,s*r)}}getRotation(){return this.get(we.ROTATION)}getValueForResolutionFunction(t){let e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/e;return function(o){return Math.log(i/o)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){let t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),s=this.padding_;if(s){let o=this.getViewportSizeMinusPadding_();r=qa(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],e,i)}return{center:r.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t,e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,r;if(this.resolutions_){let s=kn(this.resolutions_,t,1);e=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return e+Math.log(i/t)/Math.log(r)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;let e=ot(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,ot(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(z(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){z(!Wi(t),"Cannot fit empty extent provided as `geometry`");let r=ve(t,this.getProjection());i=Ka(r)}else if(t.getType()==="Circle"){let r=ve(t.getExtent(),this.getProjection());i=Ka(r),i.rotate(this.getRotation(),Ee(r))}else{let r=_n();r?i=t.clone().transform(r,this.getProjection()):i=t}this.fitInternal(i,e)}rotatedExtentForGeometry(t){let e=this.getRotation(),i=Math.cos(e),r=Math.sin(-e),s=t.getFlatCoordinates(),o=t.getStride(),a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=s.length;u=n.maxResolution)return!1;let i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}var $a,xn,lr=v(()=>{ha();pt();aa();$n();no();Zt();rt();fe();$a=class extends Gs{constructor(t){let e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(lt.SOURCE,this.handleSourcePropertyChange_);let i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(lt.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){let t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(et(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;let t=this.getSource();t&&(this.sourceChangeKey_=U(t,D.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e,i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof me?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;e.layerStatesArray?r=e.layerStatesArray.find(o=>o.layer===this):r=this.getLayerState();let s=this.getExtent();return Ur(r,e.viewState)&&(!s||yt(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e,i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];let r=t instanceof me?t.getViewStateAndExtent():t,s=e(r);return Array.isArray(s)||(s=[s]),s}render(t,e){let i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(lt.MAP,t)}getMapInternal(){return this.get(lt.MAP)}setMap(t){this.mapPrecomposeKey_&&(et(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(et(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=U(t,Jt.PRECOMPOSE,function(e){let r=e.frameState.layerStatesArray,s=this.getLayerState(!1);z(!r.some(function(o){return o.layer===s.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),r.push(s)},this),this.mapRenderKey_=U(this,D.CHANGE,t.render,t),this.changed())}setSource(t){this.set(lt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}};xn=$a});var Qa,ro,tl=v(()=>{je();Qa=class extends Ft{constructor(t,e,i,r){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=r}},ro=Qa});var jr,Zi,hr,el,Dm,md,il,cr=v(()=>{jr="ol-hidden",Zi="ol-unselectable",hr="ol-control",el="ol-collapsed",Dm=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"),md=["style","variant","weight","size","lineHeight","family"],il=function(n){let t=n.match(Dm);if(!t)return null;let e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,r=md.length;i{ci()});function xd(n,t){return ur||(ur=gt(1,1)),n!=rl&&(ur.font=n,rl=ur.font),ur.measureText(t)}function so(n,t){return xd(n,t).width}function ol(n,t,e){if(t in e)return e[t];let i=t.split(` +`).reduce((r,s)=>Math.max(r,so(n,s)),0);return e[t]=i,i}function Ed(n,t){let e=[],i=[],r=[],s=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){let u=t[h];if(u===` +`||h===c){s=Math.max(s,o),r.push(o),o=0,a+=l;continue}let d=t[h+1]||n.font,f=so(d,u);e.push(f),o+=f;let g=km(d);i.push(g),l=Math.max(l,g)}return{width:s,height:a,widths:e,heights:i,lineWidths:r}}function Cd(n,t,e,i,r,s,o,a,l,h,c){n.save(),e!==1&&(n.globalAlpha*=e),t&&n.transform.apply(n,t),i.contextInstructions?(n.translate(l,h),n.scale(c[0],c[1]),Nm(i,n)):c[0]<0||c[1]<0?(n.translate(l,h),n.scale(c[0],c[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,h,o*c[0],a*c[1]),n.restore()}function Nm(n,t){let e=n.contextInstructions;for(let i=0,r=e.length;i{Fe();ci();Oe();te();cr();oo="10px sans-serif",Ot="#000",qe="round",se=[],oe=0,He="round",xi=10,Ei="#000",qi="center",Cn="middle",Ci=[0,0,0,0],wi=1,Ze=new St,ur=null,sl={},yd=function(){let t="32px ",e=["monospace","serif"],i=e.length,r="wmytzilWMYTZIL@#/&?$%10\uF013",s,o;function a(h,c,u){let d=!0;for(let f=0;f{si={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"}});var Bd={};zi(Bd,{default:()=>Ai});var Al,Ai,_r=S(()=>{ze();Ll();Jt();_e();ie();Al=class extends bt{constructor(t){super();let e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){Qr(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&Qr(this.element);for(let e=0,i=this.listenerKeys.length;e0&&n[1]>0}function ff(n,t,e){return e===void 0&&(e=[0,0]),e[0]=n[0]*t+.5|0,e[1]=n[1]*t+.5|0,e}function Pt(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}var Pi=S(()=>{});var ct,Er=S(()=>{ct={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}});function xf(n,t,e){let i=n,r=!0,s=!1,o=!1,a=[Vn(i,A.LOAD,function(){o=!0,s||t()})];return i.src&&aa?(s=!0,i.decode().then(function(){r&&t()}).catch(function(l){r&&(o?t():e())})):a.push(Vn(i,A.ERROR,e)),function(){r=!1,a.forEach(et)}}function sp(n,t){return new Promise((e,i)=>{function r(){o(),e(n)}function s(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",r),n.removeEventListener("error",s)}n.addEventListener("load",r),n.addEventListener("error",s),t&&(n.src=t)})}function Ef(n,t){return t&&(n.src=t),n.src&&aa?new Promise((e,i)=>n.decode().then(()=>e(n)).catch(r=>n.complete&&n.width?e(n):i(r))):sp(n)}var eh=S(()=>{gt();pi();_e()});function Af(n){return n?Array.isArray(n)?function(t){return n}:typeof n=="function"?n:function(t){return[n]}:null}var ch,Ao,uh=S(()=>{ze();Wt();ch=class extends bt{constructor(t){super(),this.projection=ft(t.projection),this.attributions_=Af(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;let e=this;this.viewPromise_=new Promise(function(i,r){e.viewResolver=i,e.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Af(t),this.changed()}setState(t){this.state_=t,this.changed()}};Ao=ch});var Eh,Bf,Uf=S(()=>{gt();Er();na();wt();Eh=class extends Os{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return H()}getData(t){return null}prepareFrame(t){return H()}renderFrame(t,e){return H()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(r,s)=>{let o=this.loadedTileCallback.bind(this,i,r);return t.forEachLoadedTile(e,r,s,o)}}forEachFeatureAtCoordinate(t,e,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){let e=t.target;(e.getState()===ct.LOADED||e.getState()===ct.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=ct.LOADED&&e!=ct.ERROR&&t.addEventListener(A.CHANGE,this.boundHandleImageChange_),e==ct.IDLE&&(t.load(),e=t.getState()),e==ct.LOADED}renderIfReadyAndVisible(){let t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}},Bf=Eh});function mp(){wr=pt(1,1,void 0,{willReadFrequently:!0})}var wh,wr,Ch,No,Th=S(()=>{Uf();ml();rr();Ye();Ci();ie();Ct();it();wh=[],wr=null;Ch=class extends Bf{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Xt(),this.pixelTransform=Xt(),this.inversePixelTransform=Xt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){wr||mp(),wr.clearRect(0,0,1,1);let r;try{wr.drawImage(t,e,i,1,1,0,0,1,1),r=wr.getImageData(0,0,1,1).data}catch{return wr=null,null}return r}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){let r=this.getLayer().getClassName(),s,o;if(t&&t.className===r&&(!i||t&&t.style.backgroundColor&&Nt(wn(t.style.backgroundColor),wn(i)))){let a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=pt();let l=o.canvas;s.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){let r=Le(i),s=er(i),o=tr(i),a=Qn(i);yt(e.coordinateToPixelTransform,r),yt(e.coordinateToPixelTransform,s),yt(e.coordinateToPixelTransform,o),yt(e.coordinateToPixelTransform,a);let l=this.inversePixelTransform;yt(l,r),yt(l,s),yt(l,o),yt(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}dispatchRenderEvent_(t,e,i){let r=this.getLayer();if(r.hasListener(t)){let s=new mo(t,this.inversePixelTransform,i,e);r.dispatchEvent(s)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(Qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(Qt.POSTRENDER,t,e)}getRenderTransform(t,e,i,r,s,o,a){let l=s/2,h=o/2,c=r/e,u=-c,d=-t[0]+a,f=-t[1];return jt(this.tempTransform,l,h,c,u,-i,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}},No=Ch});var Zf={};zi(Zf,{createStyleFunction:()=>Kf,default:()=>Pn});function Kf(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(Y(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}var Rh,Pn,Go=S(()=>{ze();gt();Ht();_e();Rh=class n extends bt{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){let e=t;this.setGeometry(e)}else{let e=t;this.setProperties(e)}}clone(){let t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let e=this.getGeometry();e&&t.setGeometry(e.clone());let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(et(this.geometryChangeKey_),this.geometryChangeKey_=null);let t=this.getGeometry();t&&(this.geometryChangeKey_=U(t,A.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Kf(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}};Pn=Rh});var Ih,cn,Xo=S(()=>{Ih=class n{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){let t=this.getColor();return new n({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}},cn=Ih});function Lh(n,t,e,i,r,s,o){let a,l,h=(e-t)/i;if(h===1)a=t;else if(h===2)a=t,l=r;else if(h!==0){let c=n[t],u=n[t+1],d=0,f=[0];for(let p=t+i;p1?o:2,s=s||new Array(o);for(let c=0;c{Ct();mt()});function Hf(n,t,e,i){let r=n[t],s=n[t+1],o=0;for(let a=t+i;a{});var bh,On,Mh=S(()=>{bh=class n{constructor(t){t=t||{},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}clone(){let t=this.getColor();return new n({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}},On=bh});var Ah,Wo,Ph=S(()=>{wt();Pi();Ah=class n{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Pt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){let t=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return H()}getImage(t){return H()}getHitDetectionImage(){return H()}getPixelRatio(t){return 1}getImageState(){return H()}getImageSize(){return H()}getOrigin(){return H()}getSize(){return H()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Pt(t)}listenImageChange(t){H()}load(){H()}unlistenImageChange(t){H()}},Wo=Ah});function ue(n){return Array.isArray(n)?_a(n):n}var as=S(()=>{Ci()});var Oh,zo,Fh=S(()=>{Er();Ph();Ci();as();ie();Mi();Oh=class n extends Wo{constructor(t){let e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,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],declutterMode:t.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.render()}clone(){let t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){let t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){let i=this.renderOptions_,r=pt(i.size*t,i.size*t);this.draw_(i,r,t),e=r.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return ct.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r{Fh();Dh=class n extends zo{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){let t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}},ls=Dh});var Qf={};zi(Qf,{createDefaultStyle:()=>Xh,createEditingStyle:()=>Wh,default:()=>ai,toFunction:()=>Gh});function Gh(n){let t;if(typeof n=="function")t=n;else{let e;Array.isArray(n)?e=n:(Y(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[n]),t=function(){return e}}return t}function Xh(n,t){if(!Nh){let e=new cn({color:"rgba(255,255,255,0.4)"}),i=new On({color:"#3399CC",width:1.25});Nh=[new un({image:new ls({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return Nh}function Wh(){let n={},t=[255,255,255,1],e=[0,153,255,1],i=3;return n.Polygon=[new un({fill:new cn({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new un({stroke:new On({color:t,width:i+2})}),new un({stroke:new On({color:e,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new un({image:new ls({radius:i*2,fill:new cn({color:e}),stroke:new On({color:t,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function Jf(n){return n.getGeometry()}var un,Nh,ai,Tr=S(()=>{kh();Xo();Mh();Ht();un=class n{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Jf,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}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new n({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Jf,this.geometry_=t}setZIndex(t){this.zIndex_=t}};Nh=null;ai=un});var pp,zh,tg,eg=S(()=>{Xo();Pi();pp="#333",zh=class n{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Pt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new cn({color:pp}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"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}clone(){let t=this.getScale();return new n({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),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})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Pt(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}},tg=zh});function Yh(n,t,e,i,r){ig(n,t,e||0,i||n.length-1,r||_p)}function ig(n,t,e,i,r){for(;i>e;){if(i-e>600){var s=i-e+1,o=t-e+1,a=Math.log(s),l=.5*Math.exp(2*a/3),h=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1),c=Math.max(e,Math.floor(t-o*l/s+h)),u=Math.min(i,Math.floor(t+(s-o)*l/s+h));ig(n,t,c,u,r)}var d=n[t],f=e,g=i;for(hs(n,e,t),r(n[i],d)>0&&hs(n,e,i);f0;)g--}r(n[e],d)===0?hs(n,e,g):(g++,hs(n,g,i)),g<=t&&(e=g+1),t<=g&&(i=g-1)}}function hs(n,t,e){var i=n[t];n[t]=n[e],n[e]=i}function _p(n,t){return nt?1:0}var ng=S(()=>{});function yp(n,t,e){if(!e)return t.indexOf(n);for(let i=0;i=n.minX&&t.maxY>=n.minY}function vr(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rg(n,t,e,i,r){let s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=i)continue;let o=t+Math.ceil((e-t)/i/2)*i;Yh(n,o,t,e,r),s.push(t,o,o,e)}}var Fn,jh=S(()=>{ng();Fn=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data,i=[];if(!Bo(t,e))return i;let r=this.toBBox,s=[];for(;e;){for(let o=0;o=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)}_split(t,e){let i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);let o=this._chooseSplitIndex(i,s,r),a=vr(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Sr(i,this.toBBox),Sr(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=vr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Sr(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let r,s=1/0,o=1/0;for(let a=e;a<=i-e;a++){let l=cs(t,0,a,this.toBBox),h=cs(t,a,i,this.toBBox),c=wp(l,h),u=Bh(l)+Bh(h);c=e;h--){let c=t.children[h];us(a,t.leaf?s(c):c),l+=Yo(a)}return l}_adjustParentBBoxes(t,e,i){for(let r=i;r>=0;r--)us(e[r],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():Sr(t[e],this.toBBox)}}});function sg(n,t,e,i,r){let s=t===void 0?void 0:nr.get(t,e,r);return s||(s=new Vh(n,n instanceof HTMLImageElement?n.src||void 0:t,e,i,r),nr.set(t,e,r,s)),s}var ds,Vh,og=S(()=>{Dr();gt();Er();Ci();ie();eh();xa();ds=null,Vh=class extends Bi{constructor(t,e,i,r,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=r===void 0?ct.IDLE:r,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ct.LOADED){ds||(ds=pt(1,1,void 0,{willReadFrequently:!0})),ds.drawImage(this.image_,0,0);try{ds.getImageData(0,0,1,1),this.tainted_=!1}catch{ds=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(A.CHANGE)}handleImageError_(){this.imageState_=ct.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ct.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let t=this.size_[0],e=this.size_[1],i=pt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ct.IDLE){this.image_||this.initializeImage_(),this.imageState_=ct.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Ef(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==ct.LOADED)return;let e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);let r=i.getContext("2d");r.scale(t,t),r.drawImage(e,0,0),r.globalCompositeOperation="multiply",r.fillStyle=Ks(this.color_),r.fillRect(0,0,i.width/t,i.height/t),r.globalCompositeOperation="destination-in",r.drawImage(e,0,0),this.canvas_[t]=i}}});var lg={};zi(lg,{default:()=>dn});function ag(n,t,e,i){return e!==void 0&&i!==void 0?[e/n,i/t]:e!==void 0?e/n:i!==void 0?i/t:1}var Kh,dn,Uo=S(()=>{gt();Er();Ph();Ci();Ht();og();wt();Kh=class n extends Wo{constructor(t){t=t||{};let e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,r=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:r,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;let o=t.img!==void 0?t.img:null,a=t.src;Y(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||z(o)),Y(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Y(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=ct.IDLE:o!==void 0&&(o instanceof HTMLImageElement?o.complete?l=o.src?ct.LOADED:ct.IDLE:l=ct.LOADING:l=ct.LOADED),this.color_=t.color!==void 0?wn(t.color):null,this.iconImage_=sg(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{let u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;let d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;let f=this.iconImage_.getSize();this.setScale(ag(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(ag(h,c,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new n({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;let r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=r[0]),this.anchorYUnits_=="fraction"&&(t[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+r[1])}this.normalizedAnchor_=t}let e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){let e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==ct.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){let t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==ct.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(A.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(A.CHANGE,t)}},dn=Kh});function Kt(n){let t=[];for(let e of Tp)Sp(n,e)&&t.push(cg[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function Sp(n,t){return(n&t)===t}function je(n,t){return!!(n&t)}function jo(n,t){return n===t}function qh(){return{variables:new Set,properties:new Set,featureId:!1,style:{}}}function vp(n){switch(n){case"string":return Oe;case"color":return zt;case"number":return G;case"boolean":return Tt;case"number[]":return Oi;default:throw new Error(`Unrecognized type hint: ${n}`)}}function dt(n,t,e){switch(typeof n){case"boolean":return new Ue(Tt,n);case"number":return new Ue(G,n);case"string":{let r=Oe;return xu(n)&&(r|=zt),jo(r&e,Ir)||(r&=e),new Ue(r,n)}default:}if(!Array.isArray(n))throw new Error("Expression must be an array or a primitive value");if(n.length===0)throw new Error("Empty expression");if(typeof n[0]=="string")return kp(n,t,e);for(let r of n)if(typeof r!="number")throw new Error("Expected an array of numbers");let i=Oi;return(n.length===3||n.length===4)&&(i|=zt),e&&(i&=e),new Ue(i,n)}function Ip(n,t){let e=dt(n[1],t);if(!(e instanceof Ue))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");if(t.properties.add(e.value),n.length===3){let i=dt(n[2],t);return[e,i]}return[e]}function Lp(n,t,e,i){let r=n[1];if(typeof r!="string")throw new Error("Expected a string argument for var operation");if(t.variables.add(r),!("variables"in t.style)||t.style.variables[r]===void 0)return[new Ue(de,r)];let s=t.style.variables[r],o=dt(s,t);if(o.value=r,i&&!je(i,o.type))throw new Error(`The variable ${r} has type ${Kt(o.type)} but the following type was expected: ${Kt(i)}`);return[o]}function bp(n,t){t.featureId=!0}function fs(n,t){let e=n[0];if(n.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function J(n,t){return function(e,i){let r=e[0],s=e.length-1;if(n===t){if(s!==n){let o=n===1?"":"s";throw new Error(`Expected ${n} argument${o} for ${r}, got ${s}`)}}else if(st){let o=t===1/0?`${n} or more`:`${n} to ${t}`;throw new Error(`Expected ${o} arguments for ${r}, got ${s}`)}}}function ut(n){return function(t,e){let i=t[0],r=t.length-1,s=new Array(r);for(let o=0;o{Ct();Ci();Rr=0,Ir=0,Tt=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette"},Rp={[R.Get]:K(([n,t])=>t!==void 0?vp(t.value):de,J(1,2),Ip),[R.Var]:K(([n])=>n.type,J(1,1),Lp),[R.Id]:K(G|Oe,fs,bp),[R.Concat]:K(Oe,J(2,1/0),ut(de)),[R.GeometryType]:K(Oe,fs),[R.Resolution]:K(G,fs),[R.Zoom]:K(G,fs),[R.Time]:K(G,fs),[R.Any]:K(Tt,J(2,1/0),ut(Tt)),[R.All]:K(Tt,J(2,1/0),ut(Tt)),[R.Not]:K(Tt,J(1,1),ut(Tt)),[R.Equal]:K(Tt,J(2,2),ut(de),Dn),[R.NotEqual]:K(Tt,J(2,2),ut(de),Dn),[R.GreaterThan]:K(Tt,J(2,2),ut(de),Dn),[R.GreaterThanOrEqualTo]:K(Tt,J(2,2),ut(de),Dn),[R.LessThan]:K(Tt,J(2,2),ut(de),Dn),[R.LessThanOrEqualTo]:K(Tt,J(2,2),ut(de),Dn),[R.Multiply]:K(n=>{let t=G|zt;for(let e=0;e{let t=de;for(let e=2;e{let t=zt|G;for(let e=3;e{let t=de;for(let e=1;en.length===3||n.length===4?Oi|zt:Oi,J(1,1/0),ut(G)),[R.Color]:K(zt,J(3,4),ut(G)),[R.Band]:K(G,J(1,3),ut(G)),[R.Palette]:K(zt,J(2,2),Dp)}});function $h(){return{variables:{},properties:{},resolution:NaN,featureId:null}}function Di(n,t,e){let i=dt(n,e);if(!je(t,i.type)){let r=Kt(t),s=Kt(i.type);throw new Error(`Expected expression to be of type ${r}, got ${s}`)}return Fi(i,e)}function Fi(n,t){if(n instanceof Ue){if(n.type===zt&&typeof n.value=="string"){let i=Zs(n.value);return function(){return i}}return function(){return n.value}}let e=n.operator;switch(e){case R.Number:case R.String:return Np(n,t);case R.Get:case R.Var:return Gp(n,t);case R.Id:return i=>i.featureId;case R.Concat:{let i=n.args.map(r=>Fi(r,t));return r=>"".concat(...i.map(s=>s(r).toString()))}case R.Resolution:return i=>i.resolution;case R.Any:case R.All:case R.Not:return Wp(n,t);case R.Equal:case R.NotEqual:case R.LessThan:case R.LessThanOrEqualTo:case R.GreaterThan:case R.GreaterThanOrEqualTo:return Xp(n,t);case R.Multiply:case R.Divide:case R.Add:case R.Subtract:case R.Clamp:case R.Mod:case R.Pow:case R.Abs:case R.Floor:case R.Ceil:case R.Round:case R.Sin:case R.Cos:case R.Atan:case R.Sqrt:return zp(n,t);case R.Match:return Yp(n,t);case R.Interpolate:return Bp(n,t);default:throw new Error(`Unsupported operator ${e}`)}}function Np(n,t){let e=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{for(let o=0;or.properties[i];case R.Var:return r=>r.variables[i];default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function Xp(n,t){let e=n.operator,i=Fi(n.args[0],t),r=Fi(n.args[1],t);switch(e){case R.Equal:return s=>i(s)===r(s);case R.NotEqual:return s=>i(s)!==r(s);case R.LessThan:return s=>i(s)i(s)<=r(s);case R.GreaterThan:return s=>i(s)>r(s);case R.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${e}`)}}function Wp(n,t){let e=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{for(let o=0;o{for(let o=0;o!r[0](s);default:throw new Error(`Unsupported logical operator ${e}`)}}function zp(n,t){let e=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{let o=1;for(let a=0;ar[0](s)/r[1](s);case R.Add:return s=>{let o=0;for(let a=0;ar[0](s)-r[1](s);case R.Clamp:return s=>{let o=r[0](s),a=r[1](s);if(ol?l:o};case R.Mod:return s=>r[0](s)%r[1](s);case R.Pow:return s=>Math.pow(r[0](s),r[1](s));case R.Abs:return s=>Math.abs(r[0](s));case R.Floor:return s=>Math.floor(r[0](s));case R.Ceil:return s=>Math.ceil(r[0](s));case R.Round:return s=>Math.round(r[0](s));case R.Sin:return s=>Math.sin(r[0](s));case R.Cos:return s=>Math.cos(r[0](s));case R.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case R.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${e}`)}}function Yp(n,t){let e=n.args.length,i=new Array(e);for(let r=0;r{let s=i[0](r);for(let o=1;o{let s=i[0](r),o=i[1](r),a,l;for(let h=2;h=o)return h===2?u:d?Up(s,o,a,l,c,u):gs(s,o,a,l,c,u);a=c,l=u}return l}}function gs(n,t,e,i,r,s){let o=r-e;if(o===0)return i;let a=t-e,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(s-i)}function Up(n,t,e,i,r,s){if(r-e===0)return i;let a=ma(i),l=ma(s),h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);let c=[gs(n,t,e,a[0],r,l[0]),gs(n,t,e,a[1],r,l[1]),a[2]+gs(n,t,e,0,r,h),gs(n,t,e,i[3],r,s[3])];return pa(yu(c))}var ug=S(()=>{Hh();Ci()});function jp(n){return!0}function gg(n){let t=qh(),e=Vp(n,t),i=$h();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,t.featureId){let o=r.getId();o!==void 0?i.featureId=o:i.featureId=null}return e(i)}}function Qh(n){let t=qh(),e=n.length,i=new Array(e);for(let o=0;o4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function i_(n,t){if(typeof n=="number")return n;let e=ys(n,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}var Eg=S(()=>{kh();Xo();Uo();Fh();Mh();Tr();eg();Hh();ug();We();Pi()});function n_(n){if(n===void 0)return Xh;if(!n)return null;if(typeof n=="function"||n instanceof ai)return n;if(!Array.isArray(n))return Qh([n]);if(n.length===0)return[];let t=n.length,e=n[0];if(e instanceof ai){let r=new Array(t);for(let s=0;s{fr();jh();Tr();Eg();Cg={RENDER_ORDER:"renderOrder"},ec=class extends Rn{constructor(t){t=t||{};let e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Cg.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new Fn(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(Cg.RENDER_ORDER,t)}setStyle(t){this.style_=n_(t),this.styleFunction_=t===null?void 0:Gh(this.style_),this.changed()}};wg=ec});var xs,Es,li,ki,ic,X,kn=S(()=>{xs={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},Es=[xs.FILL],li=[xs.STROKE],ki=[xs.BEGIN_PATH],ic=[xs.CLOSE_PATH],X=xs});var nc,Zo,rc=S(()=>{nc=class{drawCustom(t,e,i,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}},Zo=nc});var sc,hi,br=S(()=>{kn();la();rc();as();it();Mi();Ct();lo();sc=class extends Zo{constructor(t,e,i,r){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){let e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){let i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates,o=s.length;for(let a=0,l=t.length;aa&&(this.instructions.push([X.CUSTOM,a,h,t,i,en]),this.hitDetectionInstructions.push([X.CUSTOM,a,h,t,r||i,en]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),h=this.coordinates.length,this.instructions.push([X.CUSTOM,a,h,t,i]),this.hitDetectionInstructions.push([X.CUSTOM,a,h,t,r||i]);break;default:}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[X.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[X.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let t=this.hitDetectionInstructions;t.reverse();let e,i=t.length,r,s,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){let e=t.fillStyle,i=[X.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[X.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){let i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){let i=t.strokeStyle,r=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||s!=t.currentLineDash&&!Nt(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let e=[X.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xs(this.maxExtent),this.maxLineWidth>0)){let t=this.resolution*(this.maxLineWidth+1)/2;ji(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},hi=sc});var oc,Sg,vg=S(()=>{br();kn();oc=class extends hi{constructor(t,e,i,r){super(t,e,i,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);let i=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([X.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([X.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);let i=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([X.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([X.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){let i=t.getAnchor(),r=t.getSize(),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}},Sg=oc});var ac,Rg,Ig=S(()=>{br();kn();Mi();ac=class extends hi{constructor(t,e,i,r){super(t,e,i,r)}drawFlatCoordinates_(t,e,i,r){let s=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,r,!1,!1),a=[X.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(t,e){let i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,he,ce],ki);let o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(li),this.endGeometry(e)}drawMultiLineString(t,e){let i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,he,ce],ki);let o=t.getEnds(),a=t.getFlatCoordinates(),l=t.getStride(),h=0;for(let c=0,u=o.length;c{br();kn();Mi();Kr();lc=class extends hi{constructor(t,e,i,r){super(t,e,i,r)}drawFlatCoordinatess_(t,e,i,r){let s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,l=i.length;this.instructions.push(ki),this.hitDetectionInstructions.push(ki);for(let h=0;h=n){let g=(n-a+f)/f,m=$t(h,u,g),p=$t(c,d,g);l.push(m,p),s.push(l),l=[m,p],a==n&&(o+=r),a=0}else if(a0&&s.push(l),s}var Mg=S(()=>{mt()});function Ag(n,t,e,i,r){let s=e,o=e,a=0,l=0,h=e,c,u,d,f,g,m,p,_,y,C;for(u=e;un&&(l>a&&(a=l,s=h,o=u),l=0,h=u-r)),d=f,p=y,_=C),g=w,m=T}return l+=f,l>a?[h,u]:[s,o]}var Pg=S(()=>{});var Cs,cc,Og,uc=S(()=>{br();kn();as();Mi();wt();it();Mg();Pg();Cs={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},cc=class extends hi{constructor(t,e,i,r){super(t,e,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[kt]={fillStyle:kt},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){let t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){let i=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!i&&!r)return;let o=this.coordinates,a=o.length,l=t.getType(),h=null,c=t.getStride();if(s.placement==="line"&&(l=="LineString"||l=="MultiLineString"||l=="Polygon"||l=="MultiPolygon")){if(!xt(this.getBufferedMaxExtent(),t.getExtent()))return;let u;if(h=t.getFlatCoordinates(),l=="LineString")u=[h.length];else if(l=="MultiLineString")u=t.getEnds();else if(l=="Polygon")u=t.getEnds().slice(0,1);else if(l=="MultiPolygon"){let m=t.getEndss();u=[];for(let p=0,_=m.length;p<_;++p)u.push(m[p][0])}this.beginGeometry(t,e);let d=s.repeat,f=d?void 0:s.textAlign,g=0;for(let m=0,p=u.length;m{let w=o[(_+C)*2]===h[C*c]&&o[(_+C)*2+1]===h[C*c+1];return w||--_,w})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&this.updateFillStyle(this.state,this.createFill),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let f=s.padding;if(f!=Li&&(s.scale[0]<0||s.scale[1]<0)){let _=s.padding[0],y=s.padding[1],C=s.padding[2],w=s.padding[3];s.scale[0]<0&&(y=-y,w=-w),s.scale[1]<0&&(_=-_,C=-C),f=[_,y,C,w]}let g=this.pixelRatio;this.instructions.push([X.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,f==Li?Li:f.map(function(_){return _*g}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]);let m=1/g,p=this.state.fillStyle;s.backgroundFill&&(this.state.fillStyle=kt,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([X.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,f,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?kt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]),s.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){let t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));let s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||sn,justify:e.justify,textBaseline:e.textBaseline||Ln,scale:e.scale});let o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){let i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();let l=this.pixelRatio,h=Cs[r.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([X.DRAW_CHARS,t,e,h,r.overflow,a,r.maxAngle,l,c,s,d*l,u,o,1]),this.hitDetectionInstructions.push([X.DRAW_CHARS,t,e,h,r.overflow,a&&kt,r.maxAngle,l,c,s,d*l,u,o,1/l])}setTextStyle(t,e){let i,r,s;if(!t)this.text_="";else{let o=t.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=ue(o.getColor()||kt)):(r=null,this.textFillState_=r);let a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);let g=a.getLineDash(),m=a.getLineDashOffset(),p=a.getWidth(),_=a.getMiterLimit();s.lineCap=a.getLineCap()||ii,s.lineDash=g?g.slice():he,s.lineDashOffset=m===void 0?ce:m,s.lineJoin=a.getLineJoin()||ni,s.lineWidth=p===void 0?bi:p,s.miterLimit=_===void 0?Ri:_,s.strokeStyle=ue(a.getColor()||Ii)}i=this.textState_;let l=t.getFont()||_o;Fd(l);let h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Ln,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Li,i.scale=h===void 0?[1,1]:h;let c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:z(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=r?typeof r.fillStyle=="string"?r.fillStyle:"|"+z(r.fillStyle):""}this.declutterImageWithText_=e}},Og=cc});var r_,dc,fc,Fg=S(()=>{br();vg();Ig();Lg();uc();r_={Circle:hc,Default:hi,Image:Sg,LineString:Rg,Polygon:hc,Text:Og},dc=class{constructor(t,e,i,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){let t={};for(let e in this.buildersByZIndex_){t[e]=t[e]||{};let i=this.buildersByZIndex_[e];for(let r in i){let s=i[r].finish();t[e][r]=s}}return t}getBuilder(t,e){let i=t!==void 0?t.toString():"0",r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[e];if(s===void 0){let o=r_[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=s}return s}},fc=dc});function Dg(n,t,e,i,r,s,o,a,l,h,c,u){let d=n[t],f=n[t+1],g=0,m=0,p=0,_=0;function y(){g=d,m=f,t+=i,d=n[t],f=n[t+1],_+=p,p=Math.sqrt((d-g)*(d-g)+(f-m)*(f-m))}do y();while(tD[2]}else Z=w>F;let nt=Math.PI,j=[],_t=v+i===t;t=v,p=0,_=b,d=n[t],f=n[t+1];let B;if(_t){y(),B=Math.atan2(f-m,d-g),Z&&(B+=B>0?-nt:nt);let D=(F+w)/2,O=(W+T)/2;return j[0]=[D,O,(M-s)/2,B,r],j}r=r.replace(/\n/g," ");for(let D=0,O=r.length;D0?-nt:nt),B!==void 0){let q=N-B;if(q+=q>nt?-2*nt:q<-nt?2*nt:0,Math.abs(q)>o)return null}B=N;let rt=D,lt=0;for(;D{mt();Qi()});function Ng(n){return n[3].declutterBox}function gc(n,t){return t==="start"?t=Gg.test(n)?"right":"left":t==="end"&&(t=Gg.test(n)?"left":"right"),Cs[t]}function s_(n,t,e){return e>0&&n.push(` -`,""),n.push(t,""),n}var Mr,gn,Ni,Gi,mn,Gg,mc,Xg,Wg=S(()=>{kn();uc();Ye();it();Mi();kg();Ct();$f();Qi();Mr=vt(),gn=[],Ni=[],Gi=[],mn=[];Gg=new RegExp("[\u0591-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFC\u0800-\u0FFF\uE800-\uEFFF]");mc=class{constructor(t,e,i,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Xt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,r){let s=t+e+i+r;if(this.labels_[s])return this.labels_[s];let o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=Array.isArray(t),d=l.justify?Cs[l.justify]:gc(Array.isArray(t)?t[0]:t,l.textAlign||sn),f=r&&o.lineWidth?o.lineWidth:0,g=u?t:t.split(` -`).reduce(s_,[]),{width:m,height:p,widths:_,heights:y,lineWidths:C}=kd(l,g),w=m+f,T=[],v=(w+2)*c[0],b=(p+f)*c[1],M={width:v<0?Math.floor(v):Math.ceil(v),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:T};(c[0]!=1||c[1]!=1)&&T.push("scale",c),r&&(T.push("strokeStyle",o.strokeStyle),T.push("lineWidth",f),T.push("lineCap",o.lineCap),T.push("lineJoin",o.lineJoin),T.push("miterLimit",o.miterLimit),T.push("setLineDash",[o.lineDash]),T.push("lineDashOffset",o.lineDashOffset)),i&&T.push("fillStyle",a.fillStyle),T.push("textBaseline","middle"),T.push("textAlign","center");let F=.5-d,W=d*w+F*f,Z=[],nt=[],j=0,_t=0,B=0,D=0,O;for(let N=0,rt=g.length;Nt?t-h:s,w=o+c>e?e-c:o,T=g[3]+C*d[0]+g[1],v=g[0]+w*d[1]+g[2],b=_-g[3],M=y-g[0];(m||u!==0)&&(gn[0]=b,mn[0]=b,gn[1]=M,Ni[1]=M,Ni[0]=b+T,Gi[0]=Ni[0],Gi[1]=M+v,mn[1]=Gi[1]);let F;return u!==0?(F=jt(Xt(),i,r,1,1,u,-i,-r),yt(F,gn),yt(F,Ni),yt(F,Gi),yt(F,mn),xe(Math.min(gn[0],Ni[0],Gi[0],mn[0]),Math.min(gn[1],Ni[1],Gi[1],mn[1]),Math.max(gn[0],Ni[0],Gi[0],mn[0]),Math.max(gn[1],Ni[1],Gi[1],mn[1]),Mr)):xe(Math.min(b,b+T),Math.min(M,M+v),Math.max(b,b+T),Math.max(M,M+v),Mr),f&&(_=Math.round(_),y=Math.round(y)),{drawImageX:_,drawImageY:y,drawImageW:C,drawImageH:w,originX:h,originY:c,declutterBox:{minX:Mr[0],minY:Mr[1],maxX:Mr[2],maxY:Mr[3],value:p},canvasTransform:F,scale:d}}replayImageOrLabel_(t,e,i,r,s,o,a){let l=!!(o||a),h=r.declutterBox,c=t.canvas,u=a?a[2]*r.scale[0]/2:0;return h.minX-u<=c.width/e&&h.maxX+u>=0&&h.minY-u<=c.height/e&&h.maxY+u>=0&&(l&&this.replayTextBackground_(t,gn,Ni,Gi,mn,o,a),Nd(t,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(t){if(this.alignFill_){let e=yt(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,r){let s=this.textStates[e],o=this.createLabel(t,e,r,i),a=this.strokeStates[i],l=this.pixelRatio,h=gc(Array.isArray(t)?t[0]:t,s.textAlign||sn),c=Cs[s.textBaseline||Ln],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],f=h*d+2*(.5-h)*u,g=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:f,anchorY:g}}execute_(t,e,i,r,s,o,a,l){let h;this.pixelCoordinates_&&Nt(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=le(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Hc(this.renderedTransform_,i));let c=0,u=r.length,d=0,f,g,m,p,_,y,C,w,T,v,b,M,F=0,W=0,Z=null,nt=null,j=this.coordinateCache_,_t=this.viewRotation_,B=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:_t},O=this.instructions!=r||this.overlaps?0:200,N,rt,lt,Ot;for(;cO&&(this.fill_(t),F=0),W>O&&(t.stroke(),W=0),!F&&!W&&(t.beginPath(),p=NaN,_=NaN),++c;break;case X.CIRCLE:d=I[1];let q=h[d],st=h[d+1],Te=h[d+2],Yt=h[d+3],re=Te-q,Se=Yt-st,ci=Math.sqrt(re*re+Se*Se);t.moveTo(q+ci,st),t.arc(q,st,ci,0,2*Math.PI,!0),++c;break;case X.CLOSE_PATH:t.closePath(),++c;break;case X.CUSTOM:d=I[1],f=I[2];let _n=I[3],tt=I[4],Fe=I.length==6?I[5]:void 0;D.geometry=_n,D.feature=N,c in j||(j[c]=[]);let Ze=j[c];Fe?Fe(h,d,f,2,Ze):(Ze[0]=h[d],Ze[1]=h[d+1],Ze.length=2),tt(Ze,D),++c;break;case X.DRAW_IMAGE:d=I[1],f=I[2],w=I[3],g=I[4],m=I[5];let Xi=I[6],qe=I[7],Nn=I[8],Gn=I[9],Xn=I[10],Wi=I[11],Ft=I[12],Zt=I[13],Bt=I[14],L=I[15];if(!w&&I.length>=20){T=I[19],v=I[20],b=I[21],M=I[22];let ge=this.drawLabelWithPointPlacement_(T,v,b,M);w=ge.label,I[3]=w;let zn=I[23];g=(ge.anchorX-zn)*this.pixelRatio,I[4]=g;let ve=I[24];m=(ge.anchorY-ve)*this.pixelRatio,I[5]=m,Xi=w.height,I[6]=Xi,Zt=w.width,I[13]=Zt}let x;I.length>25&&(x=I[25]);let E,P,V;I.length>17?(E=I[16],P=I[17],V=I[18]):(E=Li,P=!1,V=!1),Xn&&B?Wi+=_t:!Xn&&!B&&(Wi-=_t);let Q=0;for(;de)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+s)*t+(n+o))*4+3),s>0&&l.push(((n-s)*t+(n+o))*4+3),o>0&&(l.push(((n+s)*t+(n-o))*4+3),s>0&&l.push(((n-s)*t+(n-o))*4+3))}let r=[];for(let s=0,o=i.length;s{Wg();Ct();it();Ye();ie();We();Qi();pc=["Polygon","Circle","LineString","Image","Text","Default"],yc=class{constructor(t,e,i,r,s,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Xt(),this.createExecutors_(s)}clip(t,e){let i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(let e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);let r=t[e];for(let s in r){let o=r[s];i[s]=new Xg(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}}hasExecutors(t){for(let e in this.executorsByZIndex_){let i=this.executorsByZIndex_[e];for(let r=0,s=t.length;r0){if(!o||f!=="Image"&&f!=="Text"||o.includes(T)){let W=(d[M]-3)/4,Z=r-W%a,nt=r-(W/a|0),j=s(T,v,Z*Z+nt*nt);if(j)return j}c.clearRect(0,0,a,a);break}}let m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(pe);let p,_,y,C,w;for(p=m.length-1;p>=0;--p){let T=m[p].toString();for(y=this.executorsByZIndex_[T],_=pc.length-1;_>=0;--_)if(f=pc[_],C=y[f],C!==void 0&&(w=C.executeHitDetection(c,l,i,g,u),w))return w}}getClipCoords(t){let e=this.maxExtent_;if(!e)return null;let i=e[0],r=e[1],s=e[2],o=e[3],a=[i,r,i,o,s,o,s,r];return le(a,0,8,2,t,a),a}isEmpty(){return Xe(this.executorsByZIndex_)}execute(t,e,i,r,s,o,a){let l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(pe),this.maxExtent_&&(t.save(),this.clip(t,i)),o=o||pc;let h,c,u,d,f,g;for(a&&l.reverse(),h=0,c=l.length;h{rc();as();Ye();Mi();Ct();it();mt();Qi();jr();Ec=class extends Zo{constructor(t,e,i,r,s,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=r,this.transformRotation_=r?Vs(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Xt()}drawImages_(t,e,i,r){if(!this.image_)return;let s=le(t,e,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let c=0,u=s.length;cu*this.pixelRatio_),lineDashOffset:(o||ce)*this.pixelRatio_,lineJoin:a!==void 0?a:ni,lineWidth:(l!==void 0?l:bi)*this.pixelRatio_,miterLimit:h!==void 0?h:Ri,strokeStyle:ue(i||Ii)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}let i=t.getPixelRatio(this.pixelRatio_),r=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*i,this.imageAnchorY_=r[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();let o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{let e=t.getFill();if(!e)this.textFillState_=null;else{let f=e.getColor();this.textFillState_={fillStyle:ue(f||kt)}}let i=t.getStroke();if(!i)this.textStrokeState_=null;else{let f=i.getColor(),g=i.getLineCap(),m=i.getLineDash(),p=i.getLineDashOffset(),_=i.getLineJoin(),y=i.getWidth(),C=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:ii,lineDash:m||he,lineDashOffset:p||ce,lineJoin:_!==void 0?_:ni,lineWidth:y!==void 0?y:bi,miterLimit:C!==void 0?C:Ri,strokeStyle:ue(f||Ii)}}let r=t.getFont(),s=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:r!==void 0?r:_o,textAlign:u!==void 0?u:sn,textBaseline:d!==void 0?d:Ln},this.text_=c!==void 0?Array.isArray(c)?c.reduce((f,g,m)=>f+=m%2?" ":g,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}},Yg=Ec});var Cc=S(()=>{Uo();Tr()});function Ug(n,t,e,i,r,s,o){let a=n[0]*Ve,l=n[1]*Ve,h=pt(a,l);h.imageSmoothingEnabled=!1;let c=h.canvas,u=new Yg(h,Ve,r,null,o),d=e.length,f=Math.floor((256*256*256-1)/d),g={};for(let p=1;p<=d;++p){let _=e[p-1],y=_.getStyleFunction()||i;if(!y)continue;let C=y(_,s);if(!C)continue;Array.isArray(C)||(C=[C]);let T=(p*f).toString(16).padStart(7,"#00000");for(let v=0,b=C.length;v{Bg();Cc();Ct();mt();ie();it();Ve=.5});function Zg(n,t){return parseInt(z(n),10)-parseInt(z(t),10)}function qg(n,t){let e=qo(n,t);return e*e}function qo(n,t){return a_*n/t}function l_(n,t,e,i,r){let s=e.getFill(),o=e.getStroke();if(s||o){let l=n.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(s,o),l.drawCircle(t,i)}let a=e.getText();if(a&&a.getText()){let l=(r||n).getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,i)}}function wc(n,t,e,i,r,s,o){let a=!1,l=e.getImage();if(l){let h=l.getImageState();h==ct.LOADED||h==ct.ERROR?l.unlistenImageChange(r):(h==ct.IDLE&&l.load(),l.listenImageChange(r),a=!0)}return h_(n,t,e,i,s,o),a}function h_(n,t,e,i,r,s){let o=e.getGeometryFunction()(t);if(!o)return;let a=o.simplifyTransformed(i,r);if(e.getRenderer())Hg(n,a,e,t);else{let h=Kg[a.getType()];h(n,a,e,t,s)}}function Hg(n,t,e,i){if(t.getType()=="GeometryCollection"){let s=t.getGeometries();for(let o=0,a=s.length;o{Er();wt();a_=.5,Kg={Point:g_,LineString:u_,Polygon:p_,MultiPoint:m_,MultiLineString:d_,MultiPolygon:f_,GeometryCollection:c_,Circle:l_}});var Tc,Jg,Qg=S(()=>{Fg();Th();zg();rr();Hs();Vg();Ye();it();ie();$g();Ct();Wt();wt();Je();Tc=class extends No{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=vt(),this.wrappedRenderedExtent_=vt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){let r=e.extent,s=e.viewState,o=s.center,a=s.resolution,l=s.projection,h=s.rotation,c=l.getExtent(),u=this.getLayer().getSource(),d=e.pixelRatio,f=e.viewHints,g=!(f[Dt.ANIMATING]||f[Dt.INTERACTING]),m=this.compositionContext_,p=Math.round(e.size[0]*d),_=Math.round(e.size[1]*d),y=u.getWrapX()&&l.canWrapX(),C=y?$(c):null,w=y?Math.ceil((r[2]-c[2])/C)+1:1,T=y?Math.floor((r[0]-c[0])/C):0;do{let v=this.getRenderTransform(o,a,h,d,p,_,T*C);t.execute(m,1,v,h,g,void 0,i)}while(++T{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let i=[this.context.canvas.width,this.context.canvas.height];yt(this.pixelTransform,i);let r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=i[0]*Ve,d=i[1]*Ve;c.push(this.getRenderTransform(r,s,o,Ve,u,d,0).slice());let f=h.getSource(),g=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!_i(g,l)){let m=l[0],p=$(g),_=0,y;for(;mg[2];)++_,y=p*_,c.push(this.getRenderTransform(r,s,o,Ve,u,d,y).slice()),m-=p}this.hitDetectionImageData_=Ug(i,c,this.renderedFeatures_,h.getStyleFunction(),l,s,o)}e(jg(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,r,s){if(!this.replayGroup_)return;let o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(f,g,m){let p=z(f),_=h[p];if(_){if(_!==!0&&m<_.distanceSq){if(m===0)return h[p]=!0,s.splice(s.lastIndexOf(_),1),r(f,l,g);_.geometry=g,_.distanceSq=m}}else{if(m===0)return h[p]=!0,r(f,l,g);s.push(h[p]={feature:f,layer:l,geometry:g,distanceSq:m,callback:r})}},u,d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some(f=>u=f.forEachFeatureAtCoordinate(t,o,a,i,c,f===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(g=>g.value):null)),u}handleFontsChanged(){let t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){let e=this.getLayer(),i=e.getSource();if(!i)return!1;let r=t.viewHints[Dt.ANIMATING],s=t.viewHints[Dt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,f=e.getRevision(),g=e.getRenderBuffer(),m=e.getRenderOrder();m===void 0&&(m=Zg);let p=h.center.slice(),_=ji(l,g*u),y=_.slice(),C=[_.slice()],w=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!_i(w,t.extent)){let D=$(w),O=Math.max($(_)/2,D);_[0]=w[0]-O,_[2]=w[2]+O,hr(p,c);let N=ua(C[0],c);N[0]w[0]&&N[2]>w[2]&&C.push([N[0]-D,N[1],N[2]-D,N[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&_i(this.wrappedRenderedExtent_,_))return Nt(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=p,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let T=new fc(qo(u,d),_,u,d),v;this.getLayer().getDeclutter()&&(v=new fc(qo(u,d),_,u,d));let b=Ce(),M;if(b){for(let D=0,O=C.length;D{let O,N=D.getStyleFunction()||e.getStyleFunction();if(N&&(O=N(D,u)),O){let rt=this.renderFeature(D,F,O,T,M,v);W=W&&!rt}},nt=vi(_,c),j=i.getFeaturesInExtent(nt);m&&j.sort(m);for(let D=0,O=j.length;Dws});var Sc,ws,Ho=S(()=>{Tg();Qg();Sc=class extends wg{constructor(t){super(t)}createRenderer(){return new Jg(this)}},ws=Sc});var vc,Ts,Rc=S(()=>{jh();it();wt();We();vc=class{constructor(t){this.rbush_=new Fn(t),this.items_={}}insert(t,e){let i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[z(e)]=i}load(t,e){let i=new Array(e.length);for(let r=0,s=e.length;r{it()});var nm=S(()=>{Zr()});var rm,Ss,pn,sm=S(()=>{Ye();it();Kr();Ct();el();Wt();ol();qf();im();Jt();Qi();rm=Xt(),Ss=class n{constructor(t,e,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?Ki(this.flatCoordinates_):Jn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let t=Ie(this.getExtent());this.flatInteriorPoints_=qr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let t=Id(this.flatCoordinates_,this.ends_),e=em(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=xd(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Lh(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let t=this.flatCoordinates_,e=0,i=this.ends_;for(let r=0,s=i.length;r{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);let i=this.simplifiedGeometry_.getFlatCoordinates(),r;switch(this.type_){case"LineString":i.length=Vr(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=gd(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,r);break;case"Polygon":r=[],i.length=ao(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,r);break;default:}return r&&(this.simplifiedGeometry_=new n(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};Ss.prototype.getFlatCoordinates=Ss.prototype.getOrientedFlatCoordinates;pn=Ss});var ne,Ic=S(()=>{ne={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"}});function om(n,t){return[[-1/0,-1/0,1/0,1/0]]}var am=S(()=>{Wt()});function y_(n,t,e,i,r,s,o){let a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(e,i,r):n,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=__,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){let h=t.getType(),c;h=="json"?c=JSON.parse(a.responseText):h=="text"?c=a.responseText:h=="xml"?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):h=="arraybuffer"&&(c=a.response),c?s(t.readFeatures(c,{extent:e,featureProjection:r}),t.readProjection(c)):o()}else o()},a.onerror=o,a.send()}function Lc(n,t){return function(e,i,r,s,o){let a=this;y_(n,t,e,i,r,function(l,h){a.addFeatures(l),s!==void 0&&s(l)},o||Ge)}}var __,lm=S(()=>{Jt();__=!1});var hm={};zi(hm,{VectorSourceEvent:()=>Ke,default:()=>vs});var Ke,bc,vs,$o=S(()=>{yn();Zn();ke();gt();Yn();Rc();sm();uh();Ic();Jt();am();Ht();it();Ct();wt();We();_e();lm();Ke=class extends Lt{constructor(t,e,i){super(t),this.feature=e,this.features=i}},bc=class extends Ao{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ge,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(Y(this.format_,"`format` must be set when `url` is set"),this.loader_=Lc(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:om;let e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Ts:null,this.loadedExtentsRtree_=new Ts,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,r;Array.isArray(t.features)?r=t.features:t.features&&(i=t.features,r=i.getArray()),!e&&i===void 0&&(i=new Gt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){let e=z(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);let i=t.getGeometry();if(i){let r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ke(ne.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof pn||(this.featureChangeKeys_[t]=[U(e,A.CHANGE,this.handleFeatureChange_,this),U(e,Ne.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){let r=String(e.getId());if(!(r in this.idIndex_))this.idIndex_[r]=e;else if(e instanceof pn){let s=this.idIndex_[r];s instanceof pn?Array.isArray(s)?s.push(e):this.idIndex_[r]=[s,e]:i=!1}else i=!1}return i&&(Y(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){let e=[],i=[],r=[];for(let s=0,o=t.length;s{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(St.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(let i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(et);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){let i=r=>{this.removeFeatureInternal(r)};this.featuresRtree_.forEach(i);for(let r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let e=new Ke(ne.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){let i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(r){let s=r.getGeometry();if(s instanceof pn||s.intersectsCoordinate(t))return e(r)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){let r=i.getGeometry();if(r instanceof pn||r.intersectsExtent(t)){let s=e(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Xe(this.nullGeometryFeatures_)||jn(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){let e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);let r=nu(t,e);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){let i=t[0],r=t[1],s=null,o=[NaN,NaN],a=1/0,l=[-1/0,-1/0,1/0,1/0];return e=e||gi,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){let c=h.getGeometry(),u=a;if(a=c instanceof pn?0:c.closestPointXY(i,r,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new Ke(ne.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Ke(ne.FEATURESLOADERROR))}),r.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){let e=this.loadedExtentsRtree_,i;e.forEachInExtent(t,function(r){if(yi(r.extent,t))return i=r,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;let e=z(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){let e=z(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(et),delete this.featureChangeKeys_[e];let r=t.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ke(ne.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(let i in this.idIndex_){let r=this.idIndex_[i];if(t instanceof pn&&Array.isArray(r)&&r.includes(t))r.splice(r.indexOf(t),1);else if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){Y(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Lc(t,this.format_))}},vs=bc});var gm=Wc((Oc,Fc)=>{(function(n,t){typeof Oc=="object"&&typeof Fc<"u"?Fc.exports=t((_r(),Yi(Bd)),(Tr(),Yi(Qf)),(Uo(),Yi(lg)),(Ho(),Yi(tm)),($o(),Yi(hm)),(Zr(),Yi(_d)),(Go(),Yi(Zf)),(Wt(),Yi(Vu))):typeof define=="function"&&define.amd?define(["ol/control/Control","ol/style/Style","ol/style/Icon","ol/layer/Vector","ol/source/Vector","ol/geom/Point","ol/Feature","ol/proj"],t):(n=typeof globalThis<"u"?globalThis:n||self).Geocoder=t(n.ol.control.Control,n.ol.style.Style,n.ol.style.Icon,n.ol.layer.Vector,n.ol.source.Vector,n.ol.geom.Point,n.ol.Feature,n.ol.proj)})(Oc,function(n,t,e,i,r,s,o,a){"use strict";function l(L){return L&&typeof L=="object"&&"default"in L?L:{default:L}}function h(L){if(L&&L.__esModule)return L;var x=Object.create(null);return L&&Object.keys(L).forEach(function(E){if(E!=="default"){var P=Object.getOwnPropertyDescriptor(L,E);Object.defineProperty(x,E,P.get?P:{enumerable:!0,get:function(){return L[E]}})}}),x.default=L,Object.freeze(x)}var c=l(n),u=l(t),d=l(e),f=l(i),g=l(r),m=l(s),p=l(o),_=h(a),y="gcd-container",C="gcd-button-control",w="gcd-input-query",T="gcd-input-label",v="gcd-input-search",b={namespace:"ol-geocoder",spin:"gcd-pseudo-rotate",hidden:"gcd-hidden",address:"gcd-address",country:"gcd-country",city:"gcd-city",road:"gcd-road",olControl:"ol-control",glass:{container:"gcd-gl-container",control:"gcd-gl-control",button:"gcd-gl-btn",input:"gcd-gl-input",expanded:"gcd-gl-expanded",search:"gcd-gl-search",result:"gcd-gl-result"},inputText:{container:"gcd-txt-container",control:"gcd-txt-control",label:"gcd-txt-label",input:"gcd-txt-input",search:"gcd-txt-search",icon:"gcd-txt-glass",result:"gcd-txt-result"}},M={containerId:y,buttonControlId:C,inputQueryId:w,inputLabelId:T,inputSearchId:v,cssClasses:b};let F=Object.freeze({__proto__:null,containerId:y,buttonControlId:C,inputQueryId:w,inputLabelId:T,inputSearchId:v,cssClasses:b,default:M}),W="addresschosen",Z="nominatim",nt="reverse",j="glass-button",_t="text-input",B="osm",D="mapquest",O="photon",N="bing",rt="opencage",lt={provider:B,label:"",placeholder:"Search for an address",featureStyle:null,targetType:j,lang:"en-US",limit:5,keepOpen:!1,preventDefault:!1,preventPanning:!1,preventMarker:!1,defaultFlyResolution:10,debug:!1};function Ot(L,x="Assertion failed"){if(!L)throw typeof Error<"u"?new Error(x):x}function I(L){let x=function(){if("performance"in window==0&&(window.performance={}),"now"in window.performance==0){let E=Date.now();performance.timing&&performance.timing.navigationStart&&(E=performance.timing.navigationStart),window.performance.now=()=>Date.now()-E}return window.performance.now()}().toString(36);return L?L+x:x}function Rt(L){return/^\d+$/u.test(L)}function q(L,x,E){if(Array.isArray(L))return void L.forEach(Q=>q(Q,x));let P=Array.isArray(x)?x:x.split(/\s+/u),V=P.length;for(;V--;)Te(L,P[V])||ci(L,P[V],E)}function st(L,x,E){if(Array.isArray(L))return void L.forEach(Q=>st(Q,x,E));let P=Array.isArray(x)?x:x.split(/\s+/u),V=P.length;for(;V--;)Te(L,P[V])&&_n(L,P[V],E)}function Te(L,x){return L.classList?L.classList.contains(x):Se(x).test(L.className)}function Yt(L,x){return L.replace(/\{\s*([\w-]+)\s*\}/gu,(E,P)=>{let V=x[P]===void 0?"":x[P];return String(V).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")})}function re(L,x){let E;if(Array.isArray(L)){if(E=document.createElement(L[0]),L[1].id&&(E.id=L[1].id),L[1].classname&&(E.className=L[1].classname),L[1].attr){let{attr:V}=L[1];if(Array.isArray(V)){let Q=-1;for(;++Q_n(L,x),E)}function _n(L,x,E){L.classList?L.classList.remove(x):L.className=L.className.replace(Se(x)," ").trim(),E&&Rt(E)&&window.setTimeout(()=>ci(L,x),E)}let tt=F.cssClasses;class Fe{constructor(x){this.options=x,this.els=this.createControl()}createControl(){let x,E,P;return this.options.targetType===_t?(E=`${tt.namespace} ${tt.inputText.container}`,x=re(["div",{id:F.containerId,classname:E}],Fe.input),P={container:x,control:x.querySelector(`.${tt.inputText.control}`),label:x.querySelector(`.${tt.inputText.label}`),input:x.querySelector(`.${tt.inputText.input}`),search:x.querySelector(`.${tt.inputText.search}`),result:x.querySelector(`.${tt.inputText.result}`)},P.label.innerHTML=this.options.label):(E=`${tt.namespace} ${tt.glass.container}`,x=re(["div",{id:F.containerId,classname:E}],Fe.glass),P={container:x,control:x.querySelector(`.${tt.glass.control}`),button:x.querySelector(`.${tt.glass.button}`),input:x.querySelector(`.${tt.glass.input}`),search:x.querySelector(`.${tt.glass.search}`),result:x.querySelector(`.${tt.glass.result}`)}),P.input.placeholder=this.options.placeholder,P}}function Ze(L){return new Promise((x,E)=>{let P=function(Q,Ut){return Ut&&typeof Ut=="object"&&(Q+=(/\?/u.test(Q)?"&":"?")+Xi(Ut)),Q}(L.url,L.data),V={method:"GET",mode:"cors",credentials:"same-origin"};L.jsonp?function(Q,Ut,It){let{head:De}=document,qt=document.createElement("script"),ui=`f${Math.round(Math.random()*Date.now())}`;qt.setAttribute("src",`${Q+(Q.indexOf("?")>0?"&":"?")+Ut}=${ui}`),window[ui]=Wn=>{window[ui]=void 0,setTimeout(()=>De.removeChild(qt),0),It(Wn)},De.append(qt)}(P,L.callbackName,x):fetch(P,V).then(Q=>Q.json()).then(x).catch(E)})}function Xi(L){return Object.keys(L).reduce((x,E)=>(x.push(typeof L[E]=="object"?Xi(L[E]):`${encodeURIComponent(E)}=${encodeURIComponent(L[E])}`),x),[]).join("&")}Fe.glass=` +`+g;Ze.get(m)===void 0&&(Ze.set(m,100,!0),a(c.style,c.weight,g)||(Ze.set(m,0,!0),s===void 0&&(s=setInterval(l,32))))}}}(),km=function(){let n;return function(t){let e=sl[t];if(e==null){if(Yn){let i=il(t),r=xd(t,"\u017Dg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=t,document.body.appendChild(n),e=n.offsetHeight,document.body.removeChild(n);sl[t]=e}return e}}()});var Je,fl=v(()=>{Je={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"}});var Id={};Fi(Id,{default:()=>vi});var pl,vi,dr=v(()=>{Fe();fl();Ht();fe();te();pl=class extends St{constructor(t){super();let e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){Br(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&Br(this.element);for(let e=0,i=this.listenerKeys.length;e0&&n[1]>0}function Hd(n,t,e){return e===void 0&&(e=[0,0]),e[0]=n[0]*t+.5|0,e[1]=n[1]*t+.5|0,e}function bt(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}var Ri=v(()=>{});var ht,mr=v(()=>{ht={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}});function nf(n,t,e){let i=n,r=!0,s=!1,o=!1,a=[Gn(i,D.LOAD,function(){o=!0,s||t()})];return i.src&&Vo?(s=!0,i.decode().then(function(){r&&t()}).catch(function(l){r&&(o?t():e())})):a.push(Gn(i,D.ERROR,e)),function(){r=!1,a.forEach(et)}}function Wm(n,t){return new Promise((e,i)=>{function r(){o(),e(n)}function s(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",r),n.removeEventListener("error",s)}n.addEventListener("load",r),n.addEventListener("error",s),t&&(n.src=t)})}function rf(n,t){return t&&(n.src=t),n.src&&Vo?new Promise((e,i)=>n.decode().then(()=>e(n)).catch(r=>n.complete&&n.width?e(n):i(r))):Wm(n)}var Wl=v(()=>{pt();ci();fe()});function mf(n){return n?Array.isArray(n)?function(t){return n}:typeof n=="function"?n:function(t){return[n]}:null}var ql,xo,Hl=v(()=>{Fe();Yt();ql=class extends St{constructor(t){super(),this.projection=ft(t.projection),this.attributions_=mf(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;let e=this;this.viewPromise_=new Promise(function(i,r){e.viewResolver=i,e.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=mf(t),this.changed()}setState(t){this.state_=t,this.changed()}};xo=ql});var sh,If,Lf=v(()=>{pt();mr();Uo();wt();sh=class extends Cs{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return H()}getData(t){return null}prepareFrame(t){return H()}renderFrame(t,e){return H()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(r,s)=>{let o=this.loadedTileCallback.bind(this,i,r);return t.forEachLoadedTile(e,r,s,o)}}forEachFeatureAtCoordinate(t,e,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){let e=t.target;(e.getState()===ht.LOADED||e.getState()===ht.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=ht.LOADED&&e!=ht.ERROR&&t.addEventListener(D.CHANGE,this.boundHandleImageChange_),e==ht.IDLE&&(t.load(),e=t.getState()),e==ht.LOADED}renderIfReadyAndVisible(){let t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}},If=sh});function Hm(){_r=gt(1,1,void 0,{willReadFrequently:!0})}var ah,_r,oh,Ro,lh=v(()=>{Lf();tl();$n();De();mi();te();Ct();rt();ah=[],_r=null;oh=class extends If{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=kt(),this.pixelTransform=kt(),this.inversePixelTransform=kt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){_r||Hm(),_r.clearRect(0,0,1,1);let r;try{_r.drawImage(t,e,i,1,1,0,0,1,1),r=_r.getImageData(0,0,1,1).data}catch{return _r=null,null}return r}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){let r=this.getLayer().getClassName(),s,o;if(t&&t.className===r&&(!i||t&&t.style.backgroundColor&&Vt(dn(t.style.backgroundColor),dn(i)))){let a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=gt();let l=o.canvas;s.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){let r=Ce(i),s=Zn(i),o=Vn(i),a=Kn(i);_t(e.coordinateToPixelTransform,r),_t(e.coordinateToPixelTransform,s),_t(e.coordinateToPixelTransform,o),_t(e.coordinateToPixelTransform,a);let l=this.inversePixelTransform;_t(l,r),_t(l,s),_t(l,o),_t(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}dispatchRenderEvent_(t,e,i){let r=this.getLayer();if(r.hasListener(t)){let s=new ro(t,this.inversePixelTransform,i,e);r.dispatchEvent(s)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(Jt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(Jt.POSTRENDER,t,e)}getRenderTransform(t,e,i,r,s,o,a){let l=s/2,h=o/2,c=r/e,u=-c,d=-t[0]+a,f=-t[1];return zt(this.tempTransform,l,h,c,u,-i,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}},Ro=oh});var Pf={};Fi(Pf,{createStyleFunction:()=>Mf,default:()=>So});function Mf(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(z(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}var uh,So,dh=v(()=>{Fe();pt();Zt();fe();uh=class n extends St{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){let e=t;this.setGeometry(e)}else{let e=t;this.setProperties(e)}}clone(){let t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let e=this.getGeometry();e&&t.setGeometry(e.clone());let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(et(this.geometryChangeKey_),this.geometryChangeKey_=null);let t=this.getGeometry();t&&(this.geometryChangeKey_=U(t,D.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Mf(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}};So=uh});var fh,tn,Io=v(()=>{fh=class n{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){let t=this.getColor();return new n({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}},tn=fh});function gh(n,t,e,i,r,s,o){let a,l,h=(e-t)/i;if(h===1)a=t;else if(h===2)a=t,l=r;else if(h!==0){let c=n[t],u=n[t+1],d=0,f=[0];for(let p=t+i;p1?o:2,s=s||new Array(o);for(let c=0;c{Ct();xt()});function Ff(n,t,e,i){let r=n[t],s=n[t+1],o=0;for(let a=t+i;a{});var mh,Rn,ph=v(()=>{mh=class n{constructor(t){t=t||{},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}clone(){let t=this.getColor();return new n({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}},Rn=mh});var _h,Lo,yh=v(()=>{wt();Ri();_h=class n{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=bt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){let t=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return H()}getImage(t){return H()}getHitDetectionImage(){return H()}getPixelRatio(t){return 1}getImageState(){return H()}getImageSize(){return H()}getOrigin(){return H()}getSize(){return H()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=bt(t)}listenImageChange(t){H()}load(){H()}unlistenImageChange(t){H()}},Lo=_h});function ae(n){return Array.isArray(n)?ra(n):n}var Qr=v(()=>{mi()});var xh,bo,Eh=v(()=>{mr();yh();mi();Qr();te();Ti();xh=class n extends Lo{constructor(t){let e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,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],declutterMode:t.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.render()}clone(){let t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){let t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){let i=this.renderOptions_,r=gt(i.size*t,i.size*t);this.draw_(i,r,t),e=r.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return ht.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r{Eh();Ch=class n extends bo{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){let t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}},ts=Ch});var Nf={};Fi(Nf,{createDefaultStyle:()=>Rh,createEditingStyle:()=>$m,default:()=>ei,toFunction:()=>vh});function vh(n){let t;if(typeof n=="function")t=n;else{let e;Array.isArray(n)?e=n:(z(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[n]),t=function(){return e}}return t}function Rh(n,t){if(!Th){let e=new tn({color:"rgba(255,255,255,0.4)"}),i=new Rn({color:"#3399CC",width:1.25});Th=[new en({image:new ts({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return Th}function $m(){let n={},t=[255,255,255,1],e=[0,153,255,1],i=3;return n.Polygon=[new en({fill:new tn({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new en({stroke:new Rn({color:t,width:i+2})}),new en({stroke:new Rn({color:e,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new en({image:new ts({radius:i*2,fill:new tn({color:e}),stroke:new Rn({color:t,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function kf(n){return n.getGeometry()}var en,Th,ei,es=v(()=>{wh();Io();ph();Zt();en=class n{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=kf,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}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new n({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=kf,this.geometry_=t}setZIndex(t){this.zIndex_=t}};Th=null;ei=en});var Jm,Sh,Gf,Xf=v(()=>{Io();Ri();Jm="#333",Sh=class n{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=bt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new tn({color:Jm}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"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}clone(){let t=this.getScale();return new n({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),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})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=bt(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}},Gf=Sh});function Ih(n,t,e,i,r){Wf(n,t,e||0,i||n.length-1,r||Qm)}function Wf(n,t,e,i,r){for(;i>e;){if(i-e>600){var s=i-e+1,o=t-e+1,a=Math.log(s),l=.5*Math.exp(2*a/3),h=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1),c=Math.max(e,Math.floor(t-o*l/s+h)),u=Math.min(i,Math.floor(t+(s-o)*l/s+h));Wf(n,t,c,u,r)}var d=n[t],f=e,g=i;for(is(n,e,t),r(n[i],d)>0&&is(n,e,i);f0;)g--}r(n[e],d)===0?is(n,e,g):(g++,is(n,g,i)),g<=t&&(e=g+1),t<=g&&(i=g-1)}}function is(n,t,e){var i=n[t];n[t]=n[e],n[e]=i}function Qm(n,t){return nt?1:0}var zf=v(()=>{});function tp(n,t,e){if(!e)return t.indexOf(n);for(let i=0;i=n.minX&&t.maxY>=n.minY}function xr(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Yf(n,t,e,i,r){let s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=i)continue;let o=t+Math.ceil((e-t)/i/2)*i;Ih(n,o,t,e,r),s.push(t,o,o,e)}}var Sn,Ah=v(()=>{zf();Sn=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data,i=[];if(!Mo(t,e))return i;let r=this.toBBox,s=[];for(;e;){for(let o=0;o=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)}_split(t,e){let i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);let o=this._chooseSplitIndex(i,s,r),a=xr(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,yr(i,this.toBBox),yr(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=xr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,yr(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let r,s=1/0,o=1/0;for(let a=e;a<=i-e;a++){let l=ns(t,0,a,this.toBBox),h=ns(t,a,i,this.toBBox),c=rp(l,h),u=Lh(l)+Lh(h);c=e;h--){let c=t.children[h];rs(a,t.leaf?s(c):c),l+=Ao(a)}return l}_adjustParentBBoxes(t,e,i){for(let r=i;r>=0;r--)rs(e[r],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():yr(t[e],this.toBBox)}}});function Uf(n,t,e,i,r){let s=t===void 0?void 0:Hn.get(t,e,r);return s||(s=new Mh(n,n instanceof HTMLImageElement?n.src||void 0:t,e,i,r),Hn.set(t,e,r,s)),s}var ss,Mh,jf=v(()=>{Lr();pt();mr();mi();te();Wl();oa();ss=null,Mh=class extends ki{constructor(t,e,i,r,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=r===void 0?ht.IDLE:r,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ht.LOADED){ss||(ss=gt(1,1,void 0,{willReadFrequently:!0})),ss.drawImage(this.image_,0,0);try{ss.getImageData(0,0,1,1),this.tainted_=!1}catch{ss=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(D.CHANGE)}handleImageError_(){this.imageState_=ht.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ht.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let t=this.size_[0],e=this.size_[1],i=gt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ht.IDLE){this.image_||this.initializeImage_(),this.imageState_=ht.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&rf(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==ht.LOADED)return;let e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);let r=i.getContext("2d");r.scale(t,t),r.drawImage(e,0,0),r.globalCompositeOperation="multiply",r.fillStyle=ks(this.color_),r.fillRect(0,0,i.width/t,i.height/t),r.globalCompositeOperation="destination-in",r.drawImage(e,0,0),this.canvas_[t]=i}}});var Kf={};Fi(Kf,{default:()=>nn});function Bf(n,t,e,i){return e!==void 0&&i!==void 0?[e/n,i/t]:e!==void 0?e/n:i!==void 0?i/t:1}var Ph,nn,Po=v(()=>{pt();mr();yh();mi();Zt();jf();wt();Ph=class n extends Lo{constructor(t){t=t||{};let e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,r=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:r,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;let o=t.img!==void 0?t.img:null,a=t.src;z(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||K(o)),z(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),z(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=ht.IDLE:o!==void 0&&(o instanceof HTMLImageElement?o.complete?l=o.src?ht.LOADED:ht.IDLE:l=ht.LOADING:l=ht.LOADED),this.color_=t.color!==void 0?dn(t.color):null,this.iconImage_=Uf(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{let u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;let d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;let f=this.iconImage_.getSize();this.setScale(Bf(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(Bf(h,c,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new n({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;let r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=r[0]),this.anchorYUnits_=="fraction"&&(t[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+r[1])}this.normalizedAnchor_=t}let e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){let e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==ht.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){let t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==ht.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(D.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(D.CHANGE,t)}},nn=Ph});function jt(n){let t=[];for(let e of sp)op(n,e)&&t.push(Zf[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function op(n,t){return(n&t)===t}function Xe(n,t){return!!(n&t)}function Oo(n,t){return n===t}function Fh(){return{variables:new Set,properties:new Set,featureId:!1,style:{}}}function ap(n){switch(n){case"string":return Se;case"color":return Nt;case"number":return G;case"boolean":return Et;case"number[]":return Si;default:throw new Error(`Unrecognized type hint: ${n}`)}}function ut(n,t,e){switch(typeof n){case"boolean":return new Ge(Et,n);case"number":return new Ge(G,n);case"string":{let r=Se;return ru(n)&&(r|=Nt),Oo(r&e,Cr)||(r&=e),new Ge(r,n)}default:}if(!Array.isArray(n))throw new Error("Expression must be an array or a primitive value");if(n.length===0)throw new Error("Empty expression");if(typeof n[0]=="string")return yp(n,t,e);for(let r of n)if(typeof r!="number")throw new Error("Expected an array of numbers");let i=Si;return(n.length===3||n.length===4)&&(i|=Nt),e&&(i&=e),new Ge(i,n)}function hp(n,t){let e=ut(n[1],t);if(!(e instanceof Ge))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");if(t.properties.add(e.value),n.length===3){let i=ut(n[2],t);return[e,i]}return[e]}function cp(n,t,e,i){let r=n[1];if(typeof r!="string")throw new Error("Expected a string argument for var operation");if(t.variables.add(r),!("variables"in t.style)||t.style.variables[r]===void 0)return[new Ge(le,r)];let s=t.style.variables[r],o=ut(s,t);if(o.value=r,i&&!Xe(i,o.type))throw new Error(`The variable ${r} has type ${jt(o.type)} but the following type was expected: ${jt(i)}`);return[o]}function up(n,t){t.featureId=!0}function os(n,t){let e=n[0];if(n.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function J(n,t){return function(e,i){let r=e[0],s=e.length-1;if(n===t){if(s!==n){let o=n===1?"":"s";throw new Error(`Expected ${n} argument${o} for ${r}, got ${s}`)}}else if(st){let o=t===1/0?`${n} or more`:`${n} to ${t}`;throw new Error(`Expected ${o} arguments for ${r}, got ${s}`)}}}function ct(n){return function(t,e){let i=t[0],r=t.length-1,s=new Array(r);for(let o=0;o{Ct();mi();Er=0,Cr=0,Et=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette"},lp={[S.Get]:V(([n,t])=>t!==void 0?ap(t.value):le,J(1,2),hp),[S.Var]:V(([n])=>n.type,J(1,1),cp),[S.Id]:V(G|Se,os,up),[S.Concat]:V(Se,J(2,1/0),ct(le)),[S.GeometryType]:V(Se,os),[S.Resolution]:V(G,os),[S.Zoom]:V(G,os),[S.Time]:V(G,os),[S.Any]:V(Et,J(2,1/0),ct(Et)),[S.All]:V(Et,J(2,1/0),ct(Et)),[S.Not]:V(Et,J(1,1),ct(Et)),[S.Equal]:V(Et,J(2,2),ct(le),In),[S.NotEqual]:V(Et,J(2,2),ct(le),In),[S.GreaterThan]:V(Et,J(2,2),ct(le),In),[S.GreaterThanOrEqualTo]:V(Et,J(2,2),ct(le),In),[S.LessThan]:V(Et,J(2,2),ct(le),In),[S.LessThanOrEqualTo]:V(Et,J(2,2),ct(le),In),[S.Multiply]:V(n=>{let t=G|Nt;for(let e=0;e{let t=le;for(let e=2;e{let t=Nt|G;for(let e=3;e{let t=le;for(let e=1;en.length===3||n.length===4?Si|Nt:Si,J(1,1/0),ct(G)),[S.Color]:V(Nt,J(3,4),ct(G)),[S.Band]:V(G,J(1,3),ct(G)),[S.Palette]:V(Nt,J(2,2),_p)}});function kh(){return{variables:{},properties:{},resolution:NaN,featureId:null}}function Li(n,t,e){let i=ut(n,e);if(!Xe(t,i.type)){let r=jt(t),s=jt(i.type);throw new Error(`Expected expression to be of type ${r}, got ${s}`)}return Ii(i,e)}function Ii(n,t){if(n instanceof Ge){if(n.type===Nt&&typeof n.value=="string"){let i=Ns(n.value);return function(){return i}}return function(){return n.value}}let e=n.operator;switch(e){case S.Number:case S.String:return xp(n,t);case S.Get:case S.Var:return Ep(n,t);case S.Id:return i=>i.featureId;case S.Concat:{let i=n.args.map(r=>Ii(r,t));return r=>"".concat(...i.map(s=>s(r).toString()))}case S.Resolution:return i=>i.resolution;case S.Any:case S.All:case S.Not:return wp(n,t);case S.Equal:case S.NotEqual:case S.LessThan:case S.LessThanOrEqualTo:case S.GreaterThan:case S.GreaterThanOrEqualTo:return Cp(n,t);case S.Multiply:case S.Divide:case S.Add:case S.Subtract:case S.Clamp:case S.Mod:case S.Pow:case S.Abs:case S.Floor:case S.Ceil:case S.Round:case S.Sin:case S.Cos:case S.Atan:case S.Sqrt:return Tp(n,t);case S.Match:return vp(n,t);case S.Interpolate:return Rp(n,t);default:throw new Error(`Unsupported operator ${e}`)}}function xp(n,t){let e=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{for(let o=0;or.properties[i];case S.Var:return r=>r.variables[i];default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function Cp(n,t){let e=n.operator,i=Ii(n.args[0],t),r=Ii(n.args[1],t);switch(e){case S.Equal:return s=>i(s)===r(s);case S.NotEqual:return s=>i(s)!==r(s);case S.LessThan:return s=>i(s)i(s)<=r(s);case S.GreaterThan:return s=>i(s)>r(s);case S.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${e}`)}}function wp(n,t){let e=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{for(let o=0;o{for(let o=0;o!r[0](s);default:throw new Error(`Unsupported logical operator ${e}`)}}function Tp(n,t){let e=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{let o=1;for(let a=0;ar[0](s)/r[1](s);case S.Add:return s=>{let o=0;for(let a=0;ar[0](s)-r[1](s);case S.Clamp:return s=>{let o=r[0](s),a=r[1](s);if(ol?l:o};case S.Mod:return s=>r[0](s)%r[1](s);case S.Pow:return s=>Math.pow(r[0](s),r[1](s));case S.Abs:return s=>Math.abs(r[0](s));case S.Floor:return s=>Math.floor(r[0](s));case S.Ceil:return s=>Math.ceil(r[0](s));case S.Round:return s=>Math.round(r[0](s));case S.Sin:return s=>Math.sin(r[0](s));case S.Cos:return s=>Math.cos(r[0](s));case S.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case S.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${e}`)}}function vp(n,t){let e=n.args.length,i=new Array(e);for(let r=0;r{let s=i[0](r);for(let o=1;o{let s=i[0](r),o=i[1](r),a,l;for(let h=2;h=o)return h===2?u:d?Sp(s,o,a,l,c,u):as(s,o,a,l,c,u);a=c,l=u}return l}}function as(n,t,e,i,r,s){let o=r-e;if(o===0)return i;let a=t-e,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(s-i)}function Sp(n,t,e,i,r,s){if(r-e===0)return i;let a=ia(i),l=ia(s),h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);let c=[as(n,t,e,a[0],r,l[0]),as(n,t,e,a[1],r,l[1]),a[2]+as(n,t,e,0,r,h),as(n,t,e,i[3],r,s[3])];return na(nu(c))}var qf=v(()=>{Dh();mi()});function Ip(n){return!0}function Jf(n){let t=Fh(),e=Lp(n,t),i=kh();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,t.featureId){let o=r.getId();o!==void 0?i.featureId=o:i.featureId=null}return e(i)}}function Gh(n){let t=Fh(),e=n.length,i=new Array(e);for(let o=0;o4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Gp(n,t){if(typeof n=="number")return n;let e=us(n,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}var rg=v(()=>{wh();Io();Po();Eh();ph();es();Xf();Dh();qf();Oe();Ri()});function Xp(n){if(n===void 0)return Rh;if(!n)return null;if(typeof n=="function"||n instanceof ei)return n;if(!Array.isArray(n))return Gh([n]);if(n.length===0)return[];let t=n.length,e=n[0];if(e instanceof ei){let r=new Array(t);for(let s=0;s{lr();Ah();es();rg();sg={RENDER_ORDER:"renderOrder"},Wh=class extends xn{constructor(t){t=t||{};let e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(sg.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new Sn(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(sg.RENDER_ORDER,t)}setStyle(t){this.style_=Xp(t),this.styleFunction_=t===null?void 0:vh(this.style_),this.changed()}};og=Wh});var ds,fs,ii,bi,zh,X,Ln=v(()=>{ds={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},fs=[ds.FILL],ii=[ds.STROKE],bi=[ds.BEGIN_PATH],zh=[ds.CLOSE_PATH],X=ds});var Yh,ko,Uh=v(()=>{Yh=class{drawCustom(t,e,i,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}},ko=Yh});var jh,ni,Tr=v(()=>{Ln();Zo();Uh();Qr();rt();Ti();Ct();$s();jh=class extends ko{constructor(t,e,i,r){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){let e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){let i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates,o=s.length;for(let a=0,l=t.length;aa&&(this.instructions.push([X.CUSTOM,a,h,t,i,Ki]),this.hitDetectionInstructions.push([X.CUSTOM,a,h,t,r||i,Ki]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),h=this.coordinates.length,this.instructions.push([X.CUSTOM,a,h,t,i]),this.hitDetectionInstructions.push([X.CUSTOM,a,h,t,r||i]);break;default:}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[X.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[X.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let t=this.hitDetectionInstructions;t.reverse();let e,i=t.length,r,s,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){let e=t.fillStyle,i=[X.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[X.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){let i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){let i=t.strokeStyle,r=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||s!=t.currentLineDash&&!Vt(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let e=[X.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Is(this.maxExtent),this.maxLineWidth>0)){let t=this.resolution*(this.maxLineWidth+1)/2;jn(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},ni=jh});var Bh,lg,hg=v(()=>{Tr();Ln();Bh=class extends ni{constructor(t,e,i,r){super(t,e,i,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);let i=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([X.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([X.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);let i=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([X.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([X.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){let i=t.getAnchor(),r=t.getSize(),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}},lg=Bh});var Kh,cg,ug=v(()=>{Tr();Ln();Ti();Kh=class extends ni{constructor(t,e,i,r){super(t,e,i,r)}drawFlatCoordinates_(t,e,i,r){let s=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,r,!1,!1),a=[X.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(t,e){let i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,se,oe],bi);let o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(ii),this.endGeometry(e)}drawMultiLineString(t,e){let i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,se,oe],bi);let o=t.getEnds(),a=t.getFlatCoordinates(),l=t.getStride(),h=0;for(let c=0,u=o.length;c{Tr();Ln();Ti();zr();Vh=class extends ni{constructor(t,e,i,r){super(t,e,i,r)}drawFlatCoordinatess_(t,e,i,r){let s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,l=i.length;this.instructions.push(bi),this.hitDetectionInstructions.push(bi);for(let h=0;h=n){let g=(n-a+f)/f,m=qt(h,u,g),p=qt(c,d,g);l.push(m,p),s.push(l),l=[m,p],a==n&&(o+=r),a=0}else if(a0&&s.push(l),s}var gg=v(()=>{xt()});function mg(n,t,e,i,r){let s=e,o=e,a=0,l=0,h=e,c,u,d,f,g,m,p,_,y,C;for(u=e;un&&(l>a&&(a=l,s=h,o=u),l=0,h=u-r)),d=f,p=y,_=C),g=w,m=T}return l+=f,l>a?[h,u]:[s,o]}var pg=v(()=>{});var gs,qh,_g,Hh=v(()=>{Tr();Ln();Qr();Ti();wt();rt();gg();pg();gs={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},qh=class extends ni{constructor(t,e,i,r){super(t,e,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Ot]={fillStyle:Ot},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){let t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){let i=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!i&&!r)return;let o=this.coordinates,a=o.length,l=t.getType(),h=null,c=t.getStride();if(s.placement==="line"&&(l=="LineString"||l=="MultiLineString"||l=="Polygon"||l=="MultiPolygon")){if(!yt(this.getBufferedMaxExtent(),t.getExtent()))return;let u;if(h=t.getFlatCoordinates(),l=="LineString")u=[h.length];else if(l=="MultiLineString")u=t.getEnds();else if(l=="Polygon")u=t.getEnds().slice(0,1);else if(l=="MultiPolygon"){let m=t.getEndss();u=[];for(let p=0,_=m.length;p<_;++p)u.push(m[p][0])}this.beginGeometry(t,e);let d=s.repeat,f=d?void 0:s.textAlign,g=0;for(let m=0,p=u.length;m{let w=o[(_+C)*2]===h[C*c]&&o[(_+C)*2+1]===h[C*c+1];return w||--_,w})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&this.updateFillStyle(this.state,this.createFill),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let f=s.padding;if(f!=Ci&&(s.scale[0]<0||s.scale[1]<0)){let _=s.padding[0],y=s.padding[1],C=s.padding[2],w=s.padding[3];s.scale[0]<0&&(y=-y,w=-w),s.scale[1]<0&&(_=-_,C=-C),f=[_,y,C,w]}let g=this.pixelRatio;this.instructions.push([X.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,f==Ci?Ci:f.map(function(_){return _*g}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]);let m=1/g,p=this.state.fillStyle;s.backgroundFill&&(this.state.fillStyle=Ot,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([X.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,f,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Ot:this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]),s.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){let t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));let s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||qi,justify:e.justify,textBaseline:e.textBaseline||Cn,scale:e.scale});let o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){let i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();let l=this.pixelRatio,h=gs[r.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([X.DRAW_CHARS,t,e,h,r.overflow,a,r.maxAngle,l,c,s,d*l,u,o,1]),this.hitDetectionInstructions.push([X.DRAW_CHARS,t,e,h,r.overflow,a&&Ot,r.maxAngle,l,c,s,d*l,u,o,1/l])}setTextStyle(t,e){let i,r,s;if(!t)this.text_="";else{let o=t.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=ae(o.getColor()||Ot)):(r=null,this.textFillState_=r);let a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);let g=a.getLineDash(),m=a.getLineDashOffset(),p=a.getWidth(),_=a.getMiterLimit();s.lineCap=a.getLineCap()||qe,s.lineDash=g?g.slice():se,s.lineDashOffset=m===void 0?oe:m,s.lineJoin=a.getLineJoin()||He,s.lineWidth=p===void 0?wi:p,s.miterLimit=_===void 0?xi:_,s.strokeStyle=ae(a.getColor()||Ei)}i=this.textState_;let l=t.getFont()||oo;yd(l);let h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Cn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Ci,i.scale=h===void 0?[1,1]:h;let c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:K(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=r?typeof r.fillStyle=="string"?r.fillStyle:"|"+K(r.fillStyle):""}this.declutterImageWithText_=e}},_g=qh});var Wp,$h,Jh,yg=v(()=>{Tr();hg();ug();dg();Hh();Wp={Circle:Zh,Default:ni,Image:lg,LineString:cg,Polygon:Zh,Text:_g},$h=class{constructor(t,e,i,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){let t={};for(let e in this.buildersByZIndex_){t[e]=t[e]||{};let i=this.buildersByZIndex_[e];for(let r in i){let s=i[r].finish();t[e][r]=s}}return t}getBuilder(t,e){let i=t!==void 0?t.toString():"0",r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[e];if(s===void 0){let o=Wp[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=s}return s}},Jh=$h});function xg(n,t,e,i,r,s,o,a,l,h,c,u){let d=n[t],f=n[t+1],g=0,m=0,p=0,_=0;function y(){g=d,m=f,t+=i,d=n[t],f=n[t+1],_+=p,p=Math.sqrt((d-g)*(d-g)+(f-m)*(f-m))}do y();while(tF[2]}else Z=w>O;let it=Math.PI,j=[],mt=R+i===t;t=R,p=0,_=A,d=n[t],f=n[t+1];let Y;if(mt){y(),Y=Math.atan2(f-m,d-g),Z&&(Y+=Y>0?-it:it);let F=(O+w)/2,P=(W+T)/2;return j[0]=[F,P,(b-s)/2,Y,r],j}r=r.replace(/\n/g," ");for(let F=0,P=r.length;F0?-it:it),Y!==void 0){let q=N-Y;if(q+=q>it?-2*it:q<-it?2*it:0,Math.abs(q)>o)return null}Y=N;let nt=F,at=0;for(;F{xt();ji()});function Cg(n){return n[3].declutterBox}function Qh(n,t){return t==="start"?t=wg.test(n)?"right":"left":t==="end"&&(t=wg.test(n)?"left":"right"),gs[t]}function zp(n,t,e){return e>0&&n.push(` +`,""),n.push(t,""),n}var vr,sn,Ai,Mi,on,wg,tc,Tg,vg=v(()=>{Ln();Hh();De();rt();Ti();Eg();Ct();Df();ji();vr=Tt(),sn=[],Ai=[],Mi=[],on=[];wg=new RegExp("[\u0591-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFC\u0800-\u0FFF\uE800-\uEFFF]");tc=class{constructor(t,e,i,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=kt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,r){let s=t+e+i+r;if(this.labels_[s])return this.labels_[s];let o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=Array.isArray(t),d=l.justify?gs[l.justify]:Qh(Array.isArray(t)?t[0]:t,l.textAlign||qi),f=r&&o.lineWidth?o.lineWidth:0,g=u?t:t.split(` +`).reduce(zp,[]),{width:m,height:p,widths:_,heights:y,lineWidths:C}=Ed(l,g),w=m+f,T=[],R=(w+2)*c[0],A=(p+f)*c[1],b={width:R<0?Math.floor(R):Math.ceil(R),height:A<0?Math.floor(A):Math.ceil(A),contextInstructions:T};(c[0]!=1||c[1]!=1)&&T.push("scale",c),r&&(T.push("strokeStyle",o.strokeStyle),T.push("lineWidth",f),T.push("lineCap",o.lineCap),T.push("lineJoin",o.lineJoin),T.push("miterLimit",o.miterLimit),T.push("setLineDash",[o.lineDash]),T.push("lineDashOffset",o.lineDashOffset)),i&&T.push("fillStyle",a.fillStyle),T.push("textBaseline","middle"),T.push("textAlign","center");let O=.5-d,W=d*w+O*f,Z=[],it=[],j=0,mt=0,Y=0,F=0,P;for(let N=0,nt=g.length;Nt?t-h:s,w=o+c>e?e-c:o,T=g[3]+C*d[0]+g[1],R=g[0]+w*d[1]+g[2],A=_-g[3],b=y-g[0];(m||u!==0)&&(sn[0]=A,on[0]=A,sn[1]=b,Ai[1]=b,Ai[0]=A+T,Mi[0]=Ai[0],Mi[1]=b+R,on[1]=Mi[1]);let O;return u!==0?(O=zt(kt(),i,r,1,1,u,-i,-r),_t(O,sn),_t(O,Ai),_t(O,Mi),_t(O,on),ge(Math.min(sn[0],Ai[0],Mi[0],on[0]),Math.min(sn[1],Ai[1],Mi[1],on[1]),Math.max(sn[0],Ai[0],Mi[0],on[0]),Math.max(sn[1],Ai[1],Mi[1],on[1]),vr)):ge(Math.min(A,A+T),Math.min(b,b+R),Math.max(A,A+T),Math.max(b,b+R),vr),f&&(_=Math.round(_),y=Math.round(y)),{drawImageX:_,drawImageY:y,drawImageW:C,drawImageH:w,originX:h,originY:c,declutterBox:{minX:vr[0],minY:vr[1],maxX:vr[2],maxY:vr[3],value:p},canvasTransform:O,scale:d}}replayImageOrLabel_(t,e,i,r,s,o,a){let l=!!(o||a),h=r.declutterBox,c=t.canvas,u=a?a[2]*r.scale[0]/2:0;return h.minX-u<=c.width/e&&h.maxX+u>=0&&h.minY-u<=c.height/e&&h.maxY+u>=0&&(l&&this.replayTextBackground_(t,sn,Ai,Mi,on,o,a),Cd(t,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(t){if(this.alignFill_){let e=_t(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,r){let s=this.textStates[e],o=this.createLabel(t,e,r,i),a=this.strokeStates[i],l=this.pixelRatio,h=Qh(Array.isArray(t)?t[0]:t,s.textAlign||qi),c=gs[s.textBaseline||Cn],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],f=h*d+2*(.5-h)*u,g=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:f,anchorY:g}}execute_(t,e,i,r,s,o,a,l){let h;this.pixelCoordinates_&&Vt(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=re(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Dc(this.renderedTransform_,i));let c=0,u=r.length,d=0,f,g,m,p,_,y,C,w,T,R,A,b,O=0,W=0,Z=null,it=null,j=this.coordinateCache_,mt=this.viewRotation_,Y=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,F={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:mt},P=this.instructions!=r||this.overlaps?0:200,N,nt,at,At;for(;cP&&(this.fill_(t),O=0),W>P&&(t.stroke(),W=0),!O&&!W&&(t.beginPath(),p=NaN,_=NaN),++c;break;case X.CIRCLE:d=I[1];let q=h[d],st=h[d+1],pe=h[d+2],Gt=h[d+3],ee=pe-q,_e=Gt-st,ri=Math.sqrt(ee*ee+_e*_e);t.moveTo(q+ri,st),t.arc(q,st,ri,0,2*Math.PI,!0),++c;break;case X.CLOSE_PATH:t.closePath(),++c;break;case X.CUSTOM:d=I[1],f=I[2];let ln=I[3],tt=I[4],Le=I.length==6?I[5]:void 0;F.geometry=ln,F.feature=N,c in j||(j[c]=[]);let Ye=j[c];Le?Le(h,d,f,2,Ye):(Ye[0]=h[d],Ye[1]=h[d+1],Ye.length=2),tt(Ye,F),++c;break;case X.DRAW_IMAGE:d=I[1],f=I[2],w=I[3],g=I[4],m=I[5];let Pi=I[6],Ue=I[7],bn=I[8],An=I[9],Mn=I[10],Oi=I[11],Mt=I[12],Bt=I[13],Xt=I[14],L=I[15];if(!w&&I.length>=20){T=I[19],R=I[20],A=I[21],b=I[22];let ce=this.drawLabelWithPointPlacement_(T,R,A,b);w=ce.label,I[3]=w;let On=I[23];g=(ce.anchorX-On)*this.pixelRatio,I[4]=g;let ye=I[24];m=(ce.anchorY-ye)*this.pixelRatio,I[5]=m,Pi=w.height,I[6]=Pi,Bt=w.width,I[13]=Bt}let x;I.length>25&&(x=I[25]);let E,M,B;I.length>17?(E=I[16],M=I[17],B=I[18]):(E=Ci,M=!1,B=!1),Mn&&Y?Oi+=mt:!Mn&&!Y&&(Oi-=mt);let Q=0;for(;de)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+s)*t+(n+o))*4+3),s>0&&l.push(((n-s)*t+(n+o))*4+3),o>0&&(l.push(((n+s)*t+(n-o))*4+3),s>0&&l.push(((n-s)*t+(n-o))*4+3))}let r=[];for(let s=0,o=i.length;s{vg();Ct();rt();De();te();Oe();ji();ec=["Polygon","Circle","LineString","Image","Text","Default"],nc=class{constructor(t,e,i,r,s,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=kt(),this.createExecutors_(s)}clip(t,e){let i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(let e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);let r=t[e];for(let s in r){let o=r[s];i[s]=new Tg(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}}hasExecutors(t){for(let e in this.executorsByZIndex_){let i=this.executorsByZIndex_[e];for(let r=0,s=t.length;r0){if(!o||f!=="Image"&&f!=="Text"||o.includes(T)){let W=(d[b]-3)/4,Z=r-W%a,it=r-(W/a|0),j=s(T,R,Z*Z+it*it);if(j)return j}c.clearRect(0,0,a,a);break}}let m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(de);let p,_,y,C,w;for(p=m.length-1;p>=0;--p){let T=m[p].toString();for(y=this.executorsByZIndex_[T],_=ec.length-1;_>=0;--_)if(f=ec[_],C=y[f],C!==void 0&&(w=C.executeHitDetection(c,l,i,g,u),w))return w}}getClipCoords(t){let e=this.maxExtent_;if(!e)return null;let i=e[0],r=e[1],s=e[2],o=e[3],a=[i,r,i,o,s,o,s,r];return re(a,0,8,2,t,a),a}isEmpty(){return Pe(this.executorsByZIndex_)}execute(t,e,i,r,s,o,a){let l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(de),this.maxExtent_&&(t.save(),this.clip(t,i)),o=o||ec;let h,c,u,d,f,g;for(a&&l.reverse(),h=0,c=l.length;h{Uh();Qr();De();Ti();Ct();rt();xt();ji();Xr();sc=class extends ko{constructor(t,e,i,r,s,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=r,this.transformRotation_=r?Ds(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=kt()}drawImages_(t,e,i,r){if(!this.image_)return;let s=re(t,e,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let c=0,u=s.length;cu*this.pixelRatio_),lineDashOffset:(o||oe)*this.pixelRatio_,lineJoin:a!==void 0?a:He,lineWidth:(l!==void 0?l:wi)*this.pixelRatio_,miterLimit:h!==void 0?h:xi,strokeStyle:ae(i||Ei)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}let i=t.getPixelRatio(this.pixelRatio_),r=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*i,this.imageAnchorY_=r[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();let o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{let e=t.getFill();if(!e)this.textFillState_=null;else{let f=e.getColor();this.textFillState_={fillStyle:ae(f||Ot)}}let i=t.getStroke();if(!i)this.textStrokeState_=null;else{let f=i.getColor(),g=i.getLineCap(),m=i.getLineDash(),p=i.getLineDashOffset(),_=i.getLineJoin(),y=i.getWidth(),C=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:qe,lineDash:m||se,lineDashOffset:p||oe,lineJoin:_!==void 0?_:He,lineWidth:y!==void 0?y:wi,miterLimit:C!==void 0?C:xi,strokeStyle:ae(f||Ei)}}let r=t.getFont(),s=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:r!==void 0?r:oo,textAlign:u!==void 0?u:qi,textBaseline:d!==void 0?d:Cn},this.text_=c!==void 0?Array.isArray(c)?c.reduce((f,g,m)=>f+=m%2?" ":g,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}},Sg=sc});var oc=v(()=>{Po();es()});function Lg(n,t,e,i,r,s,o){let a=n[0]*We,l=n[1]*We,h=gt(a,l);h.imageSmoothingEnabled=!1;let c=h.canvas,u=new Sg(h,We,r,null,o),d=e.length,f=Math.floor((256*256*256-1)/d),g={};for(let p=1;p<=d;++p){let _=e[p-1],y=_.getStyleFunction()||i;if(!y)continue;let C=y(_,s);if(!C)continue;Array.isArray(C)||(C=[C]);let T=(p*f).toString(16).padStart(7,"#00000");for(let R=0,A=C.length;R{Ig();oc();Ct();xt();te();rt();We=.5});function Pg(n,t){return parseInt(K(n),10)-parseInt(K(t),10)}function Og(n,t){let e=No(n,t);return e*e}function No(n,t){return Up*n/t}function jp(n,t,e,i,r){let s=e.getFill(),o=e.getStroke();if(s||o){let l=n.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(s,o),l.drawCircle(t,i)}let a=e.getText();if(a&&a.getText()){let l=(r||n).getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,i)}}function ac(n,t,e,i,r,s,o){let a=!1,l=e.getImage();if(l){let h=l.getImageState();h==ht.LOADED||h==ht.ERROR?l.unlistenImageChange(r):(h==ht.IDLE&&l.load(),l.listenImageChange(r),a=!0)}return Bp(n,t,e,i,s,o),a}function Bp(n,t,e,i,r,s){let o=e.getGeometryFunction()(t);if(!o)return;let a=o.simplifyTransformed(i,r);if(e.getRenderer())Fg(n,a,e,t);else{let h=Mg[a.getType()];h(n,a,e,t,s)}}function Fg(n,t,e,i){if(t.getType()=="GeometryCollection"){let s=t.getGeometries();for(let o=0,a=s.length;o{mr();wt();Up=.5,Mg={Point:Hp,LineString:Vp,Polygon:Jp,MultiPoint:$p,MultiLineString:Zp,MultiPolygon:qp,GeometryCollection:Kp,Circle:jp}});var lc,kg,Ng=v(()=>{yg();lh();Rg();$n();Xs();Ag();De();rt();te();Dg();Ct();Yt();wt();_i();lc=class extends Ro{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Tt(),this.wrappedRenderedExtent_=Tt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){let r=e.extent,s=e.viewState,o=s.center,a=s.resolution,l=s.projection,h=s.rotation,c=l.getExtent(),u=this.getLayer().getSource(),d=e.pixelRatio,f=e.viewHints,g=!(f[Pt.ANIMATING]||f[Pt.INTERACTING]),m=this.compositionContext_,p=Math.round(e.size[0]*d),_=Math.round(e.size[1]*d),y=u.getWrapX()&&l.canWrapX(),C=y?$(c):null,w=y?Math.ceil((r[2]-c[2])/C)+1:1,T=y?Math.floor((r[0]-c[0])/C):0;do{let R=this.getRenderTransform(o,a,h,d,p,_,T*C);t.execute(m,1,R,h,g,void 0,i)}while(++T{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let i=[this.context.canvas.width,this.context.canvas.height];_t(this.pixelTransform,i);let r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=i[0]*We,d=i[1]*We;c.push(this.getRenderTransform(r,s,o,We,u,d,0).slice());let f=h.getSource(),g=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!ui(g,l)){let m=l[0],p=$(g),_=0,y;for(;mg[2];)++_,y=p*_,c.push(this.getRenderTransform(r,s,o,We,u,d,y).slice()),m-=p}this.hitDetectionImageData_=Lg(i,c,this.renderedFeatures_,h.getStyleFunction(),l,s,o)}e(bg(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,r,s){if(!this.replayGroup_)return;let o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(f,g,m){let p=K(f),_=h[p];if(_){if(_!==!0&&m<_.distanceSq){if(m===0)return h[p]=!0,s.splice(s.lastIndexOf(_),1),r(f,l,g);_.geometry=g,_.distanceSq=m}}else{if(m===0)return h[p]=!0,r(f,l,g);s.push(h[p]={feature:f,layer:l,geometry:g,distanceSq:m,callback:r})}},u,d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some(f=>u=f.forEachFeatureAtCoordinate(t,o,a,i,c,f===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(g=>g.value):null)),u}handleFontsChanged(){let t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){let e=this.getLayer(),i=e.getSource();if(!i)return!1;let r=t.viewHints[Pt.ANIMATING],s=t.viewHints[Pt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,f=e.getRevision(),g=e.getRenderBuffer(),m=e.getRenderOrder();m===void 0&&(m=Pg);let p=h.center.slice(),_=jn(l,g*u),y=_.slice(),C=[_.slice()],w=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!ui(w,t.extent)){let F=$(w),P=Math.max($(_)/2,F);_[0]=w[0]-P,_[2]=w[2]+P,er(p,c);let N=Jo(C[0],c);N[0]w[0]&&N[2]>w[2]&&C.push([N[0]-F,N[1],N[2]-F,N[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&ui(this.wrappedRenderedExtent_,_))return Vt(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=p,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let T=new Jh(No(u,d),_,u,d),R;this.getLayer().getDeclutter()&&(R=new Jh(No(u,d),_,u,d));let A=_n(),b;if(A){for(let F=0,P=C.length;F{let P,N=F.getStyleFunction()||e.getStyleFunction();if(N&&(P=N(F,u)),P){let nt=this.renderFeature(F,O,P,T,b,R);W=W&&!nt}},it=yn(_,c),j=i.getFeaturesInExtent(it);m&&j.sort(m);for(let F=0,P=j.length;Fcc});var hc,cc,uc=v(()=>{ag();Ng();hc=class extends og{constructor(t){super(t)}createRenderer(){return new kg(this)}},cc=hc});var dc,fc,Xg=v(()=>{Ah();rt();wt();Oe();dc=class{constructor(t){this.rbush_=new Sn(t),this.items_={}}insert(t,e){let i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[K(e)]=i}load(t,e){let i=new Array(e.length);for(let r=0,s=e.length;r{rt()});var Yg=v(()=>{Js()});var Ug,ms,an,jg=v(()=>{De();rt();zr();Ct();Wa();Yt();Ba();Of();zg();Ht();ji();Ug=kt(),ms=class n{constructor(t,e,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?bs(this.flatCoordinates_):Bn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let t=Ee(this.getExtent());this.flatInteriorPoints_=Yr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let t=ud(this.flatCoordinates_,this.ends_),e=Wg(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=nd(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=gh(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let t=this.flatCoordinates_,e=0,i=this.ends_;for(let r=0,s=i.length;r{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);let i=this.simplifiedGeometry_.getFlatCoordinates(),r;switch(this.type_){case"LineString":i.length=Wr(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Ju(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,r);break;case"Polygon":r=[],i.length=Hs(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,r);break;default:}return r&&(this.simplifiedGeometry_=new n(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};ms.prototype.getFlatCoordinates=ms.prototype.getOrientedFlatCoordinates;an=ms});var Ie,Bg=v(()=>{Ie={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"}});function Kg(n,t){return[[-1/0,-1/0,1/0,1/0]]}var Vg=v(()=>{Yt()});function t_(n,t,e,i,r,s,o){let a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(e,i,r):n,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=Qp,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){let h=t.getType(),c;h=="json"?c=JSON.parse(a.responseText):h=="text"?c=a.responseText:h=="xml"?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):h=="arraybuffer"&&(c=a.response),c?s(t.readFeatures(c,{extent:e,featureProjection:r}),t.readProjection(c)):o()}else o()},a.onerror=o,a.send()}function gc(n,t){return function(e,i,r,s,o){let a=this;t_(n,t,e,i,r,function(l,h){a.addFeatures(l),s!==void 0&&s(l)},o||Me)}}var Qp,Zg=v(()=>{Ht();Qp=!1});var qg={};Fi(qg,{VectorSourceEvent:()=>ze,default:()=>pc});var ze,mc,pc,_c=v(()=>{zn();br();je();pt();Fn();Xg();jg();Hl();Bg();Ht();Vg();Zt();rt();Ct();wt();Oe();fe();Zg();ze=class extends Ft{constructor(t,e,i){super(t),this.feature=e,this.features=i}},mc=class extends xo{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Me,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(z(this.format_,"`format` must be set when `url` is set"),this.loader_=gc(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:Kg;let e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new fc:null,this.loadedExtentsRtree_=new fc,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,r;Array.isArray(t.features)?r=t.features:t.features&&(i=t.features,r=i.getArray()),!e&&i===void 0&&(i=new $t(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){let e=K(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);let i=t.getGeometry();if(i){let r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new ze(Ie.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof an||(this.featureChangeKeys_[t]=[U(e,D.CHANGE,this.handleFeatureChange_,this),U(e,Ae.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){let r=String(e.getId());if(!(r in this.idIndex_))this.idIndex_[r]=e;else if(e instanceof an){let s=this.idIndex_[r];s instanceof an?Array.isArray(s)?s.push(e):this.idIndex_[r]=[s,e]:i=!1}else i=!1}return i&&(z(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){let e=[],i=[],r=[];for(let s=0,o=t.length;s{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(Dt.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(let i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(et);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){let i=r=>{this.removeFeatureInternal(r)};this.featuresRtree_.forEach(i);for(let r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let e=new ze(Ie.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){let i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(r){let s=r.getGeometry();if(s instanceof an||s.intersectsCoordinate(t))return e(r)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){let r=i.getGeometry();if(r instanceof an||r.intersectsExtent(t)){let s=e(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Pe(this.nullGeometryFeatures_)||Nn(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){let e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);let r=Yc(t,e);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){let i=t[0],r=t[1],s=null,o=[NaN,NaN],a=1/0,l=[-1/0,-1/0,1/0,1/0];return e=e||li,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){let c=h.getGeometry(),u=a;if(a=c instanceof an?0:c.closestPointXY(i,r,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new ze(Ie.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new ze(Ie.FEATURESLOADERROR))}),r.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){let e=this.loadedExtentsRtree_,i;e.forEachInExtent(t,function(r){if(di(r.extent,t))return i=r,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;let e=K(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){let e=K(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(et),delete this.featureChangeKeys_[e];let r=t.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new ze(Ie.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(let i in this.idIndex_){let r=this.idIndex_[i];if(t instanceof an&&Array.isArray(r)&&r.includes(t))r.splice(r.indexOf(t),1);else if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){z(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(gc(t,this.format_))}},pc=mc});var Hg=Rc((yc,xc)=>{(function(n,t){typeof yc=="object"&&typeof xc<"u"?xc.exports=t((dr(),Di(Id)),(es(),Di(Nf)),(Po(),Di(Kf)),(uc(),Di(Gg)),(_c(),Di(qg)),(Js(),Di(ed)),(dh(),Di(Pf)),(Yt(),Di(Au))):typeof define=="function"&&define.amd?define(["ol/control/Control","ol/style/Style","ol/style/Icon","ol/layer/Vector","ol/source/Vector","ol/geom/Point","ol/Feature","ol/proj"],t):(n=typeof globalThis<"u"?globalThis:n||self).Geocoder=t(n.ol.control.Control,n.ol.style.Style,n.ol.style.Icon,n.ol.layer.Vector,n.ol.source.Vector,n.ol.geom.Point,n.ol.Feature,n.ol.proj)})(yc,function(n,t,e,i,r,s,o,a){"use strict";function l(L){return L&&typeof L=="object"&&"default"in L?L:{default:L}}function h(L){if(L&&L.__esModule)return L;var x=Object.create(null);return L&&Object.keys(L).forEach(function(E){if(E!=="default"){var M=Object.getOwnPropertyDescriptor(L,E);Object.defineProperty(x,E,M.get?M:{enumerable:!0,get:function(){return L[E]}})}}),x.default=L,Object.freeze(x)}var c=l(n),u=l(t),d=l(e),f=l(i),g=l(r),m=l(s),p=l(o),_=h(a),y="gcd-container",C="gcd-button-control",w="gcd-input-query",T="gcd-input-label",R="gcd-input-search",A={namespace:"ol-geocoder",spin:"gcd-pseudo-rotate",hidden:"gcd-hidden",address:"gcd-address",country:"gcd-country",city:"gcd-city",road:"gcd-road",olControl:"ol-control",glass:{container:"gcd-gl-container",control:"gcd-gl-control",button:"gcd-gl-btn",input:"gcd-gl-input",expanded:"gcd-gl-expanded",search:"gcd-gl-search",result:"gcd-gl-result"},inputText:{container:"gcd-txt-container",control:"gcd-txt-control",label:"gcd-txt-label",input:"gcd-txt-input",search:"gcd-txt-search",icon:"gcd-txt-glass",result:"gcd-txt-result"}},b={containerId:y,buttonControlId:C,inputQueryId:w,inputLabelId:T,inputSearchId:R,cssClasses:A};let O=Object.freeze({__proto__:null,containerId:y,buttonControlId:C,inputQueryId:w,inputLabelId:T,inputSearchId:R,cssClasses:A,default:b}),W="addresschosen",Z="nominatim",it="reverse",j="glass-button",mt="text-input",Y="osm",F="mapquest",P="photon",N="bing",nt="opencage",at={provider:Y,label:"",placeholder:"Search for an address",featureStyle:null,targetType:j,lang:"en-US",limit:5,keepOpen:!1,preventDefault:!1,preventPanning:!1,preventMarker:!1,defaultFlyResolution:10,debug:!1};function At(L,x="Assertion failed"){if(!L)throw typeof Error<"u"?new Error(x):x}function I(L){let x=function(){if("performance"in window==0&&(window.performance={}),"now"in window.performance==0){let E=Date.now();performance.timing&&performance.timing.navigationStart&&(E=performance.timing.navigationStart),window.performance.now=()=>Date.now()-E}return window.performance.now()}().toString(36);return L?L+x:x}function vt(L){return/^\d+$/u.test(L)}function q(L,x,E){if(Array.isArray(L))return void L.forEach(Q=>q(Q,x));let M=Array.isArray(x)?x:x.split(/\s+/u),B=M.length;for(;B--;)pe(L,M[B])||ri(L,M[B],E)}function st(L,x,E){if(Array.isArray(L))return void L.forEach(Q=>st(Q,x,E));let M=Array.isArray(x)?x:x.split(/\s+/u),B=M.length;for(;B--;)pe(L,M[B])&&ln(L,M[B],E)}function pe(L,x){return L.classList?L.classList.contains(x):_e(x).test(L.className)}function Gt(L,x){return L.replace(/\{\s*([\w-]+)\s*\}/gu,(E,M)=>{let B=x[M]===void 0?"":x[M];return String(B).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")})}function ee(L,x){let E;if(Array.isArray(L)){if(E=document.createElement(L[0]),L[1].id&&(E.id=L[1].id),L[1].classname&&(E.className=L[1].classname),L[1].attr){let{attr:B}=L[1];if(Array.isArray(B)){let Q=-1;for(;++Qln(L,x),E)}function ln(L,x,E){L.classList?L.classList.remove(x):L.className=L.className.replace(_e(x)," ").trim(),E&&vt(E)&&window.setTimeout(()=>ri(L,x),E)}let tt=O.cssClasses;class Le{constructor(x){this.options=x,this.els=this.createControl()}createControl(){let x,E,M;return this.options.targetType===mt?(E=`${tt.namespace} ${tt.inputText.container}`,x=ee(["div",{id:O.containerId,classname:E}],Le.input),M={container:x,control:x.querySelector(`.${tt.inputText.control}`),label:x.querySelector(`.${tt.inputText.label}`),input:x.querySelector(`.${tt.inputText.input}`),search:x.querySelector(`.${tt.inputText.search}`),result:x.querySelector(`.${tt.inputText.result}`)},M.label.innerHTML=this.options.label):(E=`${tt.namespace} ${tt.glass.container}`,x=ee(["div",{id:O.containerId,classname:E}],Le.glass),M={container:x,control:x.querySelector(`.${tt.glass.control}`),button:x.querySelector(`.${tt.glass.button}`),input:x.querySelector(`.${tt.glass.input}`),search:x.querySelector(`.${tt.glass.search}`),result:x.querySelector(`.${tt.glass.result}`)}),M.input.placeholder=this.options.placeholder,M}}function Ye(L){return new Promise((x,E)=>{let M=function(Q,Wt){return Wt&&typeof Wt=="object"&&(Q+=(/\?/u.test(Q)?"&":"?")+Pi(Wt)),Q}(L.url,L.data),B={method:"GET",mode:"cors",credentials:"same-origin"};L.jsonp?function(Q,Wt,Rt){let{head:be}=document,Kt=document.createElement("script"),si=`f${Math.round(Math.random()*Date.now())}`;Kt.setAttribute("src",`${Q+(Q.indexOf("?")>0?"&":"?")+Wt}=${si}`),window[si]=Pn=>{window[si]=void 0,setTimeout(()=>be.removeChild(Kt),0),Rt(Pn)},be.append(Kt)}(M,L.callbackName,x):fetch(M,B).then(Q=>Q.json()).then(x).catch(E)})}function Pi(L){return Object.keys(L).reduce((x,E)=>(x.push(typeof L[E]=="object"?Pi(L[E]):`${encodeURIComponent(E)}=${encodeURIComponent(L[E])}`),x),[]).join("&")}Le.glass=`
- - - + + +
    -`,Fe.input=` +`,Le.input=`
    - - + + - +
      -`;class qe{constructor(){this.settings={url:"https://photon.komoot.io/api/",params:{q:"",limit:10,lang:"en"},langs:["de","it","fr","en"]}}getParameters(x){return x.lang=x.lang.toLowerCase(),{url:this.settings.url,params:{q:x.query,limit:x.limit||this.settings.params.limit,lang:this.settings.langs.includes(x.lang)?x.lang:this.settings.params.lang}}}handleResponse(x){return x.features.length===0?[]:x.features.map(E=>({lon:E.geometry.coordinates[0],lat:E.geometry.coordinates[1],address:{name:E.properties.name,postcode:E.properties.postcode,city:E.properties.city,state:E.properties.state,country:E.properties.country},original:{formatted:E.properties.name,details:E.properties}}))}}class Nn{constructor(x){this.settings={url:"https://nominatim.openstreetmap.org/search",...x,params:{q:"",format:"json",addressdetails:1,limit:10,countrycodes:"",viewbox:"","accept-language":"en-US"}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,format:this.settings.params.format,addressdetails:this.settings.params.addressdetails,limit:x.limit||this.settings.params.limit,countrycodes:x.countrycodes||this.settings.params.countrycodes,viewbox:x.viewbox||this.settings.params.viewbox,"accept-language":x.lang||this.settings.params["accept-language"]}}}handleResponse(x){return x.length===0?[]:x.map(E=>({lon:E.lon,lat:E.lat,bbox:E.boundingbox,address:{name:E.display_name,road:E.address.road||"",houseNumber:E.address.house_number||"",postcode:E.address.postcode,city:E.address.city||E.address.town,state:E.address.state,country:E.address.country},original:{formatted:E.display_name,details:E.address}}))}}class Gn{constructor(){this.settings={url:"https://open.mapquestapi.com/nominatim/v1/search.php",params:{q:"",key:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,key:x.key,format:"json",addressdetails:1,limit:x.limit||this.settings.params.limit,countrycodes:x.countrycodes||this.settings.params.countrycodes,"accept-language":x.lang||this.settings.params["accept-language"]}}}handleResponse(x){return x.length===0?[]:x.map(E=>({lon:E.lon,lat:E.lat,address:{name:E.address.neighbourhood||"",road:E.address.road||"",postcode:E.address.postcode,city:E.address.city||E.address.town,state:E.address.state,country:E.address.country},original:{formatted:E.display_name,details:E.address}}))}}class Xn{constructor(){this.settings={url:"https://dev.virtualearth.net/REST/v1/Locations",callbackName:"jsonp",params:{query:"",key:"",includeNeighborhood:0,maxResults:10}}}getParameters(x){return{url:this.settings.url,callbackName:this.settings.callbackName,params:{query:x.query,key:x.key,includeNeighborhood:x.includeNeighborhood||this.settings.params.includeNeighborhood,maxResults:x.maxResults||this.settings.params.maxResults}}}handleResponse(x){let{resources:E}=x.resourceSets[0];return E.length===0?[]:E.map(P=>({lon:P.point.coordinates[1],lat:P.point.coordinates[0],address:{name:P.name},original:{formatted:P.address.formattedAddress,details:P.address}}))}}class Wi{constructor(){this.settings={url:"https://api.opencagedata.com/geocode/v1/json?",params:{q:"",key:"",limit:10,countrycode:"",pretty:1,no_annotations:1}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,key:x.key,limit:x.limit||this.settings.params.limit,countrycode:x.countrycodes||this.settings.params.countrycodes}}}handleResponse(x){return x.results.length===0?[]:x.results.map(E=>({lon:E.geometry.lng,lat:E.geometry.lat,address:{name:E.components.house_number||"",road:E.components.road||"",postcode:E.components.postcode,city:E.components.city||E.components.town,state:E.components.state,country:E.components.country},original:{formatted:E.formatted,details:E.components}}))}}let Ft=F.cssClasses;class Zt{constructor(x,E){this.Base=x,this.layerName=I("geocoder-layer-"),this.layer=new f.default({name:this.layerName,source:new g.default,displayInLayerSwitcher:!1}),this.options=x.options,this.options.provider=typeof this.options.provider=="string"?this.options.provider.toLowerCase():this.options.provider,this.provider=this.newProvider(),this.els=E,this.lastQuery="",this.container=this.els.container,this.registeredListeners={mapClick:!1},this.setListeners()}setListeners(){let x=E=>{E.stopPropagation(),Te(this.els.control,Ft.glass.expanded)?this.collapse():this.expand()};this.els.input.addEventListener("keypress",E=>{let P=E.target.value.trim();(E.key?E.key==="Enter":E.which?E.which===13:E.keyCode&&E.keyCode===13)&&(E.preventDefault(),this.query(P))},!1),this.els.input.addEventListener("click",E=>E.stopPropagation(),!1),this.els.input.addEventListener("input",E=>{E.target.value.trim().length!==0?st(this.els.search,Ft.hidden):q(this.els.search,Ft.hidden)},!1),this.els.search.addEventListener("click",()=>{this.els.input.focus(),this.query(this.els.input.value)},!1),this.options.targetType===j&&this.els.button.addEventListener("click",x,!1)}query(x){this.provider||(this.provider=this.newProvider());let E=this.provider.getParameters({query:x,key:this.options.key,lang:this.options.lang,countrycodes:this.options.countrycodes,viewbox:this.options.viewbox,limit:this.options.limit});if(this.lastQuery===x&&this.els.result.firstChild)return;this.lastQuery=x,this.clearResults(),q(this.els.search,Ft.spin);let P={url:E.url,data:E.params};E.callbackName&&(P.jsonp=!0,P.callbackName=E.callbackName),Ze(P).then(V=>{this.options.debug&&console.info(V),st(this.els.search,Ft.spin);let Q=this.provider.handleResponse(V);Q&&(this.createList(Q),this.listenMapClick())}).catch(()=>{st(this.els.search,Ft.spin);let V=re("li","
      Error! No internet connection?
      ");this.els.result.append(V)})}createList(x){let E=this.els.result;x.forEach(P=>{let V;if(this.options.provider===B?V=`${P.address.name}`:V=this.addressTemplate(P.address),x.length==1)this.chosen(P,V,P.address,P.original);else{let Q=re("li",`${V}`);Q.addEventListener("click",Ut=>{Ut.preventDefault(),this.chosen(P,V,P.address,P.original)},!1),E.append(Q)}})}chosen(x,E,P,V){let Q=this.Base.getMap(),Ut=[Number.parseFloat(x.lon),Number.parseFloat(x.lat)],It=Q.getView().getProjection(),De=_.transform(Ut,"EPSG:4326",It),{bbox:qt}=x;qt&&(qt=_.transformExtent([parseFloat(qt[2]),parseFloat(qt[0]),parseFloat(qt[3]),parseFloat(qt[1])],"EPSG:4326",It));let ui={formatted:E,details:P,original:V};if(this.options.keepOpen===!1&&this.clearResults(!0),this.options.preventDefault===!0||this.options.preventMarker===!0)this.Base.dispatchEvent({type:W,address:ui,coordinate:De,bbox:qt,place:x});else{let Wn=this.createFeature(De,ui);this.Base.dispatchEvent({type:W,address:ui,feature:Wn,coordinate:De,bbox:qt,place:x})}this.options.preventDefault!==!0&&this.options.preventPanning!==!0&&(qt?Q.getView().fit(qt,{duration:500}):Q.getView().animate({center:De,resolution:this.options.defaultFlyResolution,duration:500}))}createFeature(x){let E=new p.default(new m.default(x));return this.addLayer(),E.setStyle(this.options.featureStyle),E.setId(I("geocoder-ft-")),this.getSource().addFeature(E),E}addressTemplate(x){let E=[];return x.name&&E.push(['{name}'].join("")),(x.road||x.building||x.house_number)&&E.push(['{building} {road} {house_number}'].join("")),(x.city||x.town||x.village)&&E.push(['{postcode} {city} {town} {village}'].join("")),(x.state||x.country)&&E.push(['{state} {country}'].join("")),Yt(E.join("
      "),x)}newProvider(){switch(this.options.provider){case B:return new Nn(this.options);case D:return new Gn;case O:return new qe;case N:return new Xn;case rt:return new Wi;default:return this.options.provider}}expand(){st(this.els.input,Ft.spin),q(this.els.control,Ft.glass.expanded),window.setTimeout(()=>this.els.input.focus(),100),this.listenMapClick()}collapse(){this.els.input.value="",this.els.input.blur(),q(this.els.search,Ft.hidden),st(this.els.control,Ft.glass.expanded),this.clearResults()}listenMapClick(){if(this.registeredListeners.mapClick)return;let x=this,E=this.Base.getMap().getTargetElement();this.registeredListeners.mapClick=!0,E.addEventListener("click",{handleEvent(P){x.clearResults(!0),E.removeEventListener(P.type,this,!1),x.registeredListeners.mapClick=!1}},!1)}clearResults(x){x&&this.options.targetType===j?this.collapse():function(E){for(;E.firstChild;)E.firstChild.remove()}(this.els.result)}getSource(){return this.layer.getSource()}addLayer(){let x=!1,E=this.Base.getMap();E.getLayers().forEach(P=>{P===this.layer&&(x=!0)}),x||E.addLayer(this.layer)}}class Bt extends c.default{constructor(x=Z,E){Ot(typeof x=="string","@param `type` should be string!"),Ot(x===Z||x===nt,`@param 'type' should be '${Z}' - or '${nt}'!`);let P={...lt,featureStyle:[new u.default({image:new d.default({scale:.7,src:"//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png"})})],...E},V,Q,Ut=new Fe(P);if(x===Z&&(V=Ut.els.container),super({element:V,...P}),!(this instanceof Bt))return new Bt;this.options=P,this.container=V,x===Z&&(Q=new Zt(this,Ut.els),this.layer=Q.layer)}getLayer(){return this.layer}getSource(){return this.getLayer().getSource()}setProvider(x){this.options.provider=x}setProviderKey(x){this.options.key=x}}return Bt})});ze();yn();Zn();As();Jt();wt();Ye();it();xa();fr();Je();var fl=class extends Bn{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){H()}calculateMatrices2D(t){let e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;jt(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),$n(r,i)}forEachFeatureAtCoordinate(t,e,i,r,s,o,a,l){let h,c=e.viewState;function u(w,T,v,b){return s.call(o,T,w?v:null,b)}let d=c.projection,f=hr(t.slice(),d),g=[[0,0]];if(d.canWrapX()&&r){let w=d.getExtent(),T=$(w);g.push([-T,0],[T,0])}let m=e.layerStatesArray,p=m.length,_=[],y=[];for(let w=0;w=0;--T){let v=m[T],b=v.layer;if(b.hasRenderer()&&$r(v,c)&&a.call(l,b)){let M=b.getRenderer(),F=b.getSource();if(M&&F){let W=F.getWrapX()?f:t,Z=u.bind(null,v.managed);y[0]=W[0]+g[w][0],y[1]=W[1]+g[w][1],h=M.forEachFeatureAtCoordinate(y,e,i,Z,_)}if(h)return h}}if(_.length===0)return;let C=1/_.length;return _.forEach((w,T)=>w.distanceSq+=T*C),_.sort((w,T)=>w.distanceSq-T.distanceSq),_.some(w=>h=w.callback(w.feature,w.layer,w.geometry)),h}hasFeatureAtCoordinate(t,e,i,r,s,o){return this.forEachFeatureAtCoordinate(t,e,i,r,gi,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(t){H()}flushDeclutterItems(t){}scheduleExpireIconCache(t){nr.canExpireCache()&&t.postRenderFunctions.push(Qm)}};function Qm(n,t){nr.expire()}var Md=fl;Yn();ml();rr();mr();Mi();fr();_e();ie();var wl=class extends Md{constructor(t){super(t),this.fontChangeListenerKey_=U(ei,Ne.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");let e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=rn+" ol-layers";let i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){let i=this.getMap();if(i.hasListener(t)){let r=new mo(t,void 0,e);i.dispatchEvent(r)}}disposeInternal(){et(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Qt.PRECOMPOSE,t);let e=t.layerStatesArray.sort(function(o,a){return o.zIndex-a.zIndex}),i=t.viewState;this.children_.length=0;let r=this.declutterLayers_;r.length=0;let s=null;for(let o=0,a=e.length;o=0;--i)e[i].renderDeclutter(t);e.length=0}},Gd=wl;gt();fr();wa();yn();Zn();ke();gt();Yn();Ht();We();it();wt();_e();var Be=class extends Lt{constructor(t,e){super(t),this.layer=e}},Tl={LAYERS:"layers"},Sl=class n extends qs{constructor(t){t=t||{};let e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Tl.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Gt(i.slice(),{unique:!0}):Y(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Gt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(et),this.layersListenerKeys_.length=0;let t=this.getLayers();this.layersListenerKeys_.push(U(t,St.ADD,this.handleLayersAdd_,this),U(t,St.REMOVE,this.handleLayersRemove_,this));for(let i in this.listenerKeys_)this.listenerKeys_[i].forEach(et);He(this.listenerKeys_);let e=t.getArray();for(let i=0,r=e.length;i{this.clickTimeoutId_=void 0;let i=new ri(ot.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){let e=t,i=e.pointerId;if(e.type==ot.POINTERUP||e.type==ot.POINTERCANCEL){delete this.trackedTouches_[i];for(let r in this.trackedTouches_)if(this.trackedTouches_[r].target!==e.target){delete this.trackedTouches_[r];break}}else(e.type==ot.POINTERDOWN||e.type==ot.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);let e=new ri(ot.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);let e=new ri(ot.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){let i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(U(i,ot.POINTERMOVE,this.handlePointerMove_,this),U(i,ot.POINTERUP,this.handlePointerUp_,this),U(this.element_,ot.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(U(this.element_.getRootNode(),ot.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;let e=new ri(ot.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;let e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new ri(ot.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){let e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(et(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(A.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(et(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},Xd=Il;Ll();var Vt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};Yn();rr();gt();Ht();We();var es=1/0,bl=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,He(this.queuedElements_)}dequeue(){let t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));let r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(t){Y(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let e=this.priorityFunction_(t);return e!=es?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){let e=this.elements_,i=this.priorities_,r=e.length,s=e[t],o=i[t],a=t;for(;t>1;){let l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=ht;){let a=this.getParentIndex_(e);if(r[a]>o)i[e]=i[a],r[e]=r[a],e=a;else break}i[e]=s,r[e]=o}reprioritize(){let t=this.priorityFunction_,e=this.elements_,i=this.priorities_,r=0,s=e.length,o,a,l;for(a=0;a0;)s=this.dequeue()[0],o=s.getKey(),r=s.getState(),r===k.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++i,s.load())}},zd=Ml;function Yd(n,t,e,i,r){if(!n||!(e in n.wantedTiles))return es;if(!n.wantedTiles[e][t.getKey()])return es;let s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}go();Hs();pi();Jt();Ye();Ht();it();_r();gt();mr();Ct();ie();var Pl=class extends Ai{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);let e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",r=t.expandClassName!==void 0?t.expandClassName:e+"-expand",s=t.collapseLabel!==void 0?t.collapseLabel:"\u203A",o=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;let a=t.label!==void 0?t.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;let l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(A.CLICK,this.handleClick_.bind(this),!1);let h=e+" "+rn+" "+gr+(this.collapsed_&&this.collapsible_?" "+pl:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){let e=Array.from(new Set(this.getMap().getAllLayers().flatMap(r=>r.getAttributions(t)))),i=!this.getMap().getAllLayers().some(r=>r.getSource()&&r.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}let e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Nt(e,this.renderedAttributions_)){Pd(this.ulElement_);for(let r=0,s=e.length;r0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Me}):e.setRotation(0))}render(t){let e=t.frameState;if(!e)return;let i=e.viewState.rotation;if(i!=this.rotation_){let r="rotate("+i+"rad)";if(this.autoHide_){let s=this.element.classList.contains(Jr);!s&&i===0?this.element.classList.add(Jr):s&&i!==0&&this.element.classList.remove(Jr)}this.label_.style.transform=r}this.rotation_=i}},jd=Ol;_r();gt();mr();Ji();var Fl=class extends Ai{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});let e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,r=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",s=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"\u2013",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",h=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=r,c.setAttribute("type","button"),c.title=l,c.appendChild(typeof o=="string"?document.createTextNode(o):o),c.addEventListener(A.CLICK,this.handleClick_.bind(this,i),!1);let u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=h,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(A.CLICK,this.handleClick_.bind(this,-i),!1);let d=e+" "+rn+" "+gr,f=this.element;f.className=d,f.appendChild(c),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){let i=this.getMap().getView();if(!i)return;let r=i.getZoom();if(r!==void 0){let s=i.getConstrainedZoom(r+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Me})):i.setZoom(s)}}},Vd=Fl;function is(n){n=n||{};let t=new Gt;return(n.zoom!==void 0?n.zoom:!0)&&t.push(new Vd(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&t.push(new jd(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&t.push(new Ud(n.attributionOptions)),t}yn();ze();var Dl={ACTIVE:"active"};Ji();var kl=class extends bt{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Dl.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(Dl.ACTIVE,t)}setMap(t){this.map_=t}};function Kd(n,t,e){let i=n.getCenterInternal();if(i){let r=[i[0]+t[0],i[1]+t[1]];n.animateInternal({duration:e!==void 0?e:250,easing:ed,center:n.getConstrainedCenter(r)})}}function yr(n,t,e,i){let r=n.getZoom();if(r===void 0)return;let s=n.getConstrainedZoom(r+t),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:e,duration:i!==void 0?i:250,easing:Me})}var oi=kl;var Nl=class extends oi{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==ot.DBLCLICK){let i=t.originalEvent,r=t.map,s=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();yr(a,o,s,this.duration_),i.preventDefault(),e=!0}return!e}},Zd=Nl;var Gl=class extends oi{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ot.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ot.POINTERUP){let i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==ot.POINTERDOWN){let i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==ot.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}};function xr(n){let t=n.length,e=0,i=0;for(let r=0;r0&&this.condition_(t)){let i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},tf=Xl;Jt();ro();var Wl=class extends Pe{constructor(t){t=t||{},super({stopDown:mi}),this.condition_=t.condition?t.condition:Hd,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!To(t))return;let e=t.map,i=e.getView();if(i.getConstraints().rotation===cr)return;let r=e.getSize(),s=t.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){let a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return To(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return To(t)&&Eo(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},ef=Wl;ke();As();uo();var zl=class extends Bn{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let t=this.startPixel_,e=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(t[0],e[0])+i,r.top=Math.min(t[1],e[1])+i,r.width=Math.abs(e[0]-t[0])+i,r.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){let t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Ld([r])}getGeometry(){return this.geometry_}},nf=zl;var vo={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},rs=class extends Lt{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}},Yl=class extends Pe{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new nf(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:Eo,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){let r=i[0]-e[0],s=i[1]-e[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new rs(vo.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);let e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new rs(e?vo.BOXEND:vo.BOXCANCEL,t.coordinate,t)),!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new rs(vo.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}},rf=Yl;Ji();var Bl=class extends rf{constructor(t){t=t||{};let e=t.condition?t.condition:Qd;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){let i=this.getMap().getView(),r=this.getGeometry();if(this.out_){let s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Me})}},sf=Bl;gt();var ln={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};Je();var Ul=class extends oi{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return Co(e)&&wo(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==A.KEYDOWN){let i=t.originalEvent,r=i.key;if(this.condition_(t)&&(r==ln.DOWN||r==ln.LEFT||r==ln.RIGHT||r==ln.UP)){let o=t.map.getView(),a=o.getResolution()*this.pixelDelta_,l=0,h=0;r==ln.DOWN?h=-a:r==ln.LEFT?l=-a:r==ln.RIGHT?l=a:h=a;let c=[l,h];ar(c,o.getRotation()),Kd(o,c,this.duration_),i.preventDefault(),e=!0}}return!e}},of=Ul;gt();var jl=class extends oi{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Jd(e)&&wo(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==A.KEYDOWN||t.type==A.KEYPRESS){let i=t.originalEvent,r=i.key;if(this.condition_(t)&&(r==="+"||r==="-")){let s=t.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();yr(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}},af=jl;var Vl=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;let t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;let r=this.points_[e+2]-this.points_[i+2];if(r<1e3/60)return!1;let s=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},lf=Vl;gt();pi();mt();var Kl=class extends oi{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;let e=t.condition?t.condition:xo;this.condition_=t.onFocusOnly?ns(yo,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)||t.type!==A.WHEEL)return!0;let i=t.map,r=t.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let s;if(t.type==A.WHEEL&&(s=r.deltaY,Kc&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Ds),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;let o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");let a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=s;let l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(t){let e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-at(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),yr(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}},hf=Kl;Jt();ro();var Zl=class extends Pe{constructor(t){t=t||{};let e=t;e.stopDown||(e.stopDown=mi),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0,i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){let l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=s;let o=t.map,a=o.getView();a.getConstraints().rotation!==cr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(xr(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},cf=Zl;Jt();var ql=class extends Pe{constructor(t){t=t||{};let e=t;e.stopDown||(e.stopDown=mi),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1,i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;let l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(xr(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){let i=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},uf=ql;function df(n){n=n||{};let t=new Gt,e=new lf(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&t.push(new ef),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&t.push(new Zd({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&t.push(new tf({onFocusOnly:n.onFocusOnly,kinetic:e})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&t.push(new cf),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&t.push(new uf({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(t.push(new of),t.push(new af({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&t.push(new hf({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&t.push(new sf({duration:n.zoomDuration})),t}Ct();Wt();wt();Pi();_e();ie();Aa();function gf(n){if(n instanceof Rn){n.setMapInternal(null);return}n instanceof ts&&n.getLayers().forEach(gf)}function mf(n,t){if(n instanceof Rn){n.setMapInternal(t);return}if(n instanceof ts){let e=n.getLayers().getArray();for(let i=0,r=e.length;ithis.updateSize()),this.controls=e.controls||is(),this.interactions=e.interactions||df({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new zd(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Vt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Vt.VIEW,this.handleViewChanged_),this.addChangeListener(Vt.SIZE,this.handleSizeChanged_),this.addChangeListener(Vt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);let i=this;t.view&&!(t.view instanceof we)&&t.view.then(function(r){i.setView(new we(r))}),this.controls.addEventListener(St.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(St.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(St.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(St.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(St.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(St.REMOVE,r=>{let s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){mf(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){let e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};let s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:gi,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,e,null,o,null)}getFeaturesAtPixel(t,e){let i=[];return this.forEachFeatureAtPixel(t,function(r){i.push(r)},e),i}getAllLayers(){let t=[];function e(i){i.forEach(function(r){r instanceof ts?e(r.getLayers()):t.push(r)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;let i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};let r=e.layerFilter!==void 0?e.layerFilter:gi,s=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){let i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(Vt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return ti(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){let e=this.frameState_;return e?yt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){let e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Vt.LAYERGROUP)}setLayers(t){let e=this.getLayerGroup();if(t instanceof Gt){e.setLayers(t);return}let i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;s--){let o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){let t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let r=this.maxTilesLoading_,s=r;if(t){let o=t.viewHints;if(o[Dt.ANIMATING]||o[Dt.INTERACTING]){let a=Date.now()-t.time>8;r=a?0:8,s=a?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){let e=this.getLayerGroup();e&&this.handleLayerRemove_(new Be("removelayer",e)),this.set(Vt.LAYERGROUP,t)}setSize(t){this.set(Vt.SIZE,t)}setTarget(t){this.set(Vt.TARGET,t)}setView(t){if(!t||t instanceof we){this.set(Vt.VIEW,t);return}this.set(Vt.VIEW,new we);let e=this;t.then(function(i){e.setView(new we(i))})}updateSize(){let t=this.getTargetElement(),e;if(t){let r=getComputedStyle(t),s=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),o=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(s)&&!isNaN(o)&&(e=[s,o],!Hl(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&to("No map visible because the map container's width or height are 0."))}let i=this.getSize();e&&(!i||!Nt(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){let e=this.getView();e&&e.setViewportSize(t)}};function rp(n){let t=null;n.keyboardEventTarget!==void 0&&(t=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);let e={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new ts({layers:n.layers});e[Vt.LAYERGROUP]=i,e[Vt.TARGET]=n.target,e[Vt.VIEW]=n.view instanceof we?n.view:new we;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Gt(n.controls.slice()):(Y(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new Gt(n.interactions.slice()):(Y(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new Gt(n.overlays.slice()):(Y(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Gt,{controls:r,interactions:s,keyboardEventTarget:t,overlays:o,values:e}}var pf=$l;_r();Wt();_e();Je();var Jl="projection",_f="coordinateFormat",Ql=class extends Ai{constructor(t){t=t||{};let e=document.createElement("div");e.className=t.className!==void 0?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(Jl,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=t.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=t.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(_f)}getProjection(){return this.get(Jl)}handleMouseMove(t){let e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){let e=t.getViewport();this.listenerKeys.push(U(e,an.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(U(e,an.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(_f,t)}setProjection(t){this.set(Jl,ft(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){let s=this.getProjection();s?this.transform_=Qe(this.mapProjection_,s):this.transform_=Br}let r=this.getMap().getCoordinateFromPixelInternal(t);if(r){let s=Ce();if(s&&(this.transform_=Qe(this.mapProjection_,s)),this.transform_(r,r),this.wrapX_){let a=s||this.getProjection()||this.mapProjection_;hr(r,a)}let o=this.getCoordinateFormat();o?e=o(r):e=r.toString()}}(!this.renderedHTML_||e!==this.renderedHTML_)&&(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){let e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}},yf=Ql;gt();Dr();gt();wt();Ji();var th=class extends Bi{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(A.CHANGE)}release(){this.state===k.ERROR&&this.setState(k.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){let t=this.interimTile;if(!t)return this;do{if(t.getState()==k.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){let t=this.interimTile;if(!t)return;let e=this;do{if(t.getState()==k.LOADED){t.interimTile=null;break}t.getState()==k.LOADING?e=t:t.getState()==k.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==k.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){H()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;let r=e-i+1e3/60;return r>=this.transition_?1:Ya(r/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}},Ro=th;ie();eh();var ih=class extends Ro{constructor(t,e,i,r,s,o){super(t,e,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=k.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=k.ERROR,this.unlistenImage_(),this.image_=op(),this.changed()}handleImageLoad_(){let t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=k.LOADED:this.state=k.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==k.ERROR&&(this.state=k.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==k.IDLE&&(this.state=k.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=xf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}};function op(){let n=pt(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}var Io=ih;gt();it();Wt();mt();var ap=10,Cf=.25,nh=class{constructor(t,e,i,r,s,o){this.sourceProj_=t,this.targetProj_=e;let a={},l=$i(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){let C=y[0]+"/"+y[1];return a[C]||(a[C]=l(y)),a[C]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&$(r)>=$(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?$(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?$(this.targetProj_.getExtent()):null;let h=Le(i),c=er(i),u=tr(i),d=Qn(i),f=this.transformInv_(h),g=this.transformInv_(c),m=this.transformInv_(u),p=this.transformInv_(d),_=ap+(o?Math.max(0,Math.ceil(Math.log2(kr(i)/(o*o*256*256)))):0);if(this.addQuad_(h,c,u,d,f,g,m,p,_),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(C,w,T){y=Math.min(y,C.source[0][0],C.source[1][0],C.source[2][0])}),this.triangles_.forEach(C=>{if(Math.max(C.source[0][0],C.source[1][0],C.source[2][0])-y>this.sourceWorldWidth_/2){let w=[[C.source[0][0],C.source[0][1]],[C.source[1][0],C.source[1][1]],[C.source[2][0],C.source[2][1]]];w[0][0]-y>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-y>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-y>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);let T=Math.min(w[0][0],w[1][0],w[2][0]);Math.max(w[0][0],w[1][0],w[2][0])-T.5&&u<1,g=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){let p=ye([t,e,i,r]);g=$(p)/this.targetWorldWidth_>Cf||g}!f&&this.sourceProj_.isGlobal()&&u&&(g=u>Cf||g)}if(!g&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!xt(c,this.maxSourceExtent_))return;let m=0;if(!g&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)g=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(h>0){if(!g){let p=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(p),y;f?y=(Ee(s[0],d)+Ee(a[0],d))/2-Ee(_[0],d):y=(s[0]+a[0])/2-_[0];let C=(s[1]+a[1])/2-_[1];g=y*y+C*C>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){let p=[(e[0]+i[0])/2,(e[1]+i[1])/2],_=this.transformInv_(p),y=[(r[0]+t[0])/2,(r[1]+t[1])/2],C=this.transformInv_(y);this.addQuad_(t,e,p,y,s,o,_,C,h-1),this.addQuad_(y,p,i,r,C,_,a,l,h-1)}else{let p=[(t[0]+e[0])/2,(t[1]+e[1])/2],_=this.transformInv_(p),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],C=this.transformInv_(y);this.addQuad_(t,p,y,r,s,_,C,l,h-1),this.addQuad_(p,e,i,y,_,o,a,C,h-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(t,i,r,s,a,l),m&14||this.addTriangle_(t,i,e,s,a,o),m&&(m&13||this.addTriangle_(e,r,t,o,l,s),m&7||this.addTriangle_(e,r,i,o,l,a))}calculateSourceExtent(){let t=vt();return this.triangles_.forEach(function(e,i,r){let s=e.source;En(t,s[0]),En(t,s[1]),En(t,s[2])}),t}getTriangles(){return this.triangles_}},wf=nh;it();ie();Wt();mt();var rh,bn=[];function Tf(n,t,e,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(t,e),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,i)+1,Math.max(e,r)),n.restore()}function sh(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function lp(){if(rh===void 0){let n=pt(6,6,bn);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Tf(n,4,5,4,0),Tf(n,4,5,0,5);let t=n.getImageData(0,0,3,3).data;rh=sh(t,0)||sh(t,4)||sh(t,8),In(n),bn.push(n.canvas)}return rh}function Sf(n,t,e,i){let r=vn(e,t,n),s=no(t,i,e),o=t.getMetersPerUnit();o!==void 0&&(s*=o);let a=n.getMetersPerUnit();a!==void 0&&(s/=a);let l=n.getExtent();if(!l||Vi(l,r)){let h=no(n,s,r)/s;isFinite(h)&&h>0&&(s/=h)}return s}function vf(n,t,e,i){let r=Ie(e),s=Sf(n,t,r,i);return(!isFinite(s)||s<=0)&&zs(e,function(o){return s=Sf(n,t,o,i),isFinite(s)&&s>0}),s}function Rf(n,t,e,i,r,s,o,a,l,h,c,u,d){let f=pt(Math.round(e*n),Math.round(e*t),bn);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(e,e);function g(y){return Math.round(y*e)/e}f.globalCompositeOperation="lighter";let m=vt();l.forEach(function(y,C,w){Jc(m,y.extent)});let p;if(!d||l.length!==1||h!==0){let y=$(m),C=At(m);p=pt(Math.round(e*y/i),Math.round(e*C/i),bn),u||(p.imageSmoothingEnabled=!1);let w=e/i;l.forEach(function(T,v,b){let M=T.extent[0]-m[0],F=-(T.extent[3]-m[3]),W=$(T.extent),Z=At(T.extent);T.image.width>0&&T.image.height>0&&p.drawImage(T.image,h,h,T.image.width-2*h,T.image.height-2*h,M*w,F*w,W*w,Z*w)})}let _=Le(o);return a.getTriangles().forEach(function(y,C,w){let T=y.source,v=y.target,b=T[0][0],M=T[0][1],F=T[1][0],W=T[1][1],Z=T[2][0],nt=T[2][1],j=g((v[0][0]-_[0])/s),_t=g(-(v[0][1]-_[1])/s),B=g((v[1][0]-_[0])/s),D=g(-(v[1][1]-_[1])/s),O=g((v[2][0]-_[0])/s),N=g(-(v[2][1]-_[1])/s),rt=b,lt=M;b=0,M=0,F-=rt,W-=lt,Z-=rt,nt-=lt;let Ot=[[F,W,0,0,B-j],[Z,nt,0,0,O-j],[0,0,F,W,D-_t],[0,0,Z,nt,N-_t]],I=pu(Ot);if(!I)return;if(f.save(),f.beginPath(),lp()||!u){f.moveTo(B,D);let q=4,st=j-B,Te=_t-D;for(let Yt=0;Yt{e&&e.getState()==k.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=k.ERROR;else{let e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Rf(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=k.LOADED}this.changed()}load(){if(this.state==k.IDLE){this.state=k.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{let i=e.getState();if(i==k.IDLE||i==k.LOADING){t++;let r=U(e,A.CHANGE,function(s){let o=e.getState();(o==k.LOADED||o==k.ERROR||o==k.EMPTY)&&(et(r),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(r)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,r){e.getState()==k.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(et),this.sourcesListenerKeys_=null}release(){this.canvas_&&(In(this.canvas_.getContext("2d")),bn.push(this.canvas_),this.canvas_=null),super.release()}},ss=oh;Ht();var ah=class{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){let i=this.entries_[t];return Y(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){let e=this.entries_[t];return Y(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){let t=new Array(this.count_),e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){let t=new Array(this.count_),e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){let t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){Y(!(t in this.entries_),"Tried to set a value for a key that is used already");let i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}},If=ah;function lh(n,t,e,i){return i!==void 0?(i[0]=n,i[1]=t,i[2]=e,i):[n,t,e]}function Mn(n,t,e){return n+"/"+t+"/"+e}function Lo(n){return Mn(n[0],n[1],n[2])}function Lf(n){return n.split("/").map(Number)}function bf(n){return(n[1]<e||e>t.getMaxZoom())return!1;let s=t.getFullTileRange(e);return s?s.containsXY(i,r):!0}var hh=class extends If{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;let t=this.peekFirstKey(),i=Lf(t)[0];this.forEach(r=>{r.tileCoord[0]!==i&&(this.remove(Lo(r.tileCoord)),r.release())})}},bo=hh;var Mo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};ke();uh();wt();Ht();Wt();var Po=class{constructor(t,e,i,r){this.minX=t,this.maxX=e,this.minY=i,this.maxY=r}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}};function An(n,t,e,i,r){return r!==void 0?(r.minX=n,r.maxX=t,r.minY=e,r.maxY=i,r):new Po(n,t,e,i)}var Oo=Po;Ht();mt();it();nl();Ct();Pi();var Cr=[0,0,0],hn=5,dh=class{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,Y(jc(this.resolutions_,(r,s)=>s-r,!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let r=0,s=this.resolutions_.length-1;r{let o=new Oo(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){let a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){let r=this.getTileRangeForExtentAndZ(t,e);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([e,s,a])}forEachTileCoordParentTileRange(t,e,i,r){let s,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,r);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=An(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,h,i),e(h,s))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e0?i:Math.max(s/e[0],r/e[1]);let o=t+1,a=new Array(o);for(let l=0;li.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,r){}},ko=class extends Lt{constructor(t,e){super(t),this.tile=e}},Df=gh;mt();function up(n,t){let e=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return n.replace(e,o[0].toString()).replace(i,o[1].toString()).replace(r,o[2].toString()).replace(s,function(){let h=o[0],c=t.getFullTileRange(h);if(!c)throw new Error("The {-y} placeholder requires a tile grid with extent");return(c.getHeight()-o[2]-1).toString()})}}function kf(n,t){let e=n.length,i=new Array(e);for(let r=0;rthis.getTileInternal(p,_,y,C,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=u,h?(m.interimTile=h,m.refreshInterimChain(),a.replace(c,m)):a.set(c,m),m}getTileInternal(t,e,i,r,s){let o=null,a=Mn(t,e,i),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(t,e,i,r,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){let h=o;o=this.createTile_(t,e,i,r,s,l),h.getState()==k.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(let e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){let i=ft(t);if(i){let r=z(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}}clear(){super.clear();for(let t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}};function fp(n,t){n.getImage().src=t}var Xf=ph;var _h=class extends Xf{constructor(t){t=t||{};let e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:Of({extent:Do(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}},Wf=_h;var gp='© OpenStreetMap contributors.',yh=class extends Wf{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[gp];let i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",r=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:r,wrapX:t.wrapX,zDirection:t.zDirection})}},zf=yh;fr();var os={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var xh=class extends Rn{constructor(t){t=t||{};let e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(os.PRELOAD)}setPreload(t){this.set(os.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(os.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(os.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}},Yf=xh;Th();Ye();Ct();it();Wt();wt();Pi();var Sh=class extends No{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=vt(),this.tmpTileRange_=new Oo(0,0,0,0)}isDrawableTile(t){let e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==k.LOADED||i==k.EMPTY||i==k.ERROR&&!r}getTile(t,e,i,r){let s=r.pixelRatio,o=r.viewState.projection,a=this.getLayer(),h=a.getSource().getTile(t,e,i,s,o);return h.getState()==k.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(h)||(h=h.getInterimTile()),h}getData(t){let e=this.frameState;if(!e)return null;let i=this.getLayer(),r=yt(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!Vi(s,r))return null;let o=e.pixelRatio,a=e.viewState.projection,l=e.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(l.projection),u=h.getTilePixelRatio(e.pixelRatio);for(let d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){let f=c.getTileCoordForCoordAndZ(r,d),g=h.getTile(d,f[1],f[2],o,a);if(!(g instanceof Io||g instanceof ss)||g instanceof ss&&g.getState()===k.EMPTY)return null;if(g.getState()!==k.LOADED)continue;let m=c.getOrigin(d),p=Pt(c.getTileSize(d)),_=c.getResolution(d),y=Math.floor(u*((r[0]-m[0])/_-f[1]*p[0])),C=Math.floor(u*((m[1]-r[1])/_-f[2]*p[1])),w=Math.round(u*h.getGutterForProjection(l.projection));return this.getImageData(g.getImage(),y+w,C+w)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){let i=t.layerStatesArray[t.layerIndex],r=t.viewState,s=r.projection,o=r.resolution,a=r.center,l=r.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),f=u.getTileGridForProjection(s),g=f.getZForResolution(o,u.zDirection),m=f.getResolution(g),p=t.extent,_=t.viewState.resolution,y=u.getTilePixelRatio(h),C=Math.round($(p)/_*h),w=Math.round(At(p)/_*h),T=i.extent&&ae(i.extent,s);T&&(p=Zi(p,ae(i.extent,s)));let v=m*C/2/y,b=m*w/2/y,M=[a[0]-v,a[1]-b,a[0]+v,a[1]+b],F=f.getTileRangeForExtentAndZ(p,g),W={};W[g]={};let Z=this.createLoadedTileFinder(u,s,W),nt=this.tmpExtent,j=this.tmpTileRange_;this.newTiles_=!1;let _t=l?Ys(r.center,_,l,t.size):void 0;for(let Rt=F.minX;Rt<=F.maxX;++Rt)for(let q=F.minY;q<=F.maxY;++q){if(l&&!f.tileCoordIntersectsViewport([g,Rt,q],_t))continue;let st=this.getTile(g,Rt,q,t);if(this.isDrawableTile(st)){let re=z(this);if(st.getState()==k.LOADED){W[g][st.tileCoord.toString()]=st;let Se=st.inTransition(re);Se&&i.opacity!==1&&(st.endTransition(re),Se=!1),!this.newTiles_&&(Se||!this.renderedTiles.includes(st))&&(this.newTiles_=!0)}if(st.getAlpha(re,t.time)===1)continue}let Te=f.getTileCoordChildTileRange(st.tileCoord,j,nt),Yt=!1;Te&&(Yt=Z(g+1,Te)),Yt||f.forEachTileCoordParentTileRange(st.tileCoord,Z,j,nt)}let B=m/o*h/y;jt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,l,-C/2,-w/2);let D=Ns(this.pixelTransform);this.useContainer(e,D,this.getBackground(t));let O=this.context,N=O.canvas;$n(this.inversePixelTransform,this.pixelTransform),jt(this.tempTransform,C/2,w/2,B,B,0,-C/2,-w/2),N.width!=C||N.height!=w?(N.width=C,N.height=w):this.containerReused||O.clearRect(0,0,C,w),T&&this.clipUnrotated(O,t,T),u.getInterpolate()||(O.imageSmoothingEnabled=!1),this.preRender(O,t),this.renderedTiles.length=0;let rt=Object.keys(W).map(Number);rt.sort(pe);let lt,Ot,I;i.opacity===1&&(!this.containerReused||u.getOpaque(t.viewState.projection))?rt=rt.reverse():(lt=[],Ot=[]);for(let Rt=rt.length-1;Rt>=0;--Rt){let q=rt[Rt],st=u.getTilePixelSize(q,h,s),Yt=f.getResolution(q)/m,re=st[0]*Yt*B,Se=st[1]*Yt*B,ci=f.getTileCoordForCoordAndZ(Le(M),q),_n=f.getTileCoordExtent(ci),tt=yt(this.tempTransform,[y*(_n[0]-M[0])/m,y*(M[3]-_n[3])/m]),Fe=y*u.getGutterForProjection(s),Ze=W[q];for(let Xi in Ze){let qe=Ze[Xi],Nn=qe.tileCoord,Gn=ci[1]-Nn[1],Xn=Math.round(tt[0]-(Gn-1)*re),Wi=ci[2]-Nn[2],Ft=Math.round(tt[1]-(Wi-1)*Se),Zt=Math.round(tt[0]-Gn*re),Bt=Math.round(tt[1]-Wi*Se),L=Xn-Zt,x=Ft-Bt,E=g===q,P=E&&qe.getAlpha(z(this),t.time)!==1,V=!1;if(!P)if(lt){I=[Zt,Bt,Zt+L,Bt,Zt+L,Bt+x,Zt,Bt+x];for(let Q=0,Ut=lt.length;Q=0;--r){let s=i[r];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);e.remove(s)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){let e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){let i=e.getCoordinates(),r={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)}writeMultiPointGeometry_(t,e){let i=e.getCoordinates();for(let r=0,s=i.length;r=0;--c)this.insertVertex_(s[c],o)}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){let i=this.dragSegments_[e][0],r=i.geometry;if(r.getType()==="Circle"){let s=r.getCenter(),o=i.featureSegments[0],a=i.featureSegments[1];o.segment[0]=s,o.segment[1]=s,a.segment[0]=s,a.segment[1]=s,this.rBush_.update(Ki(s),o);let l=r,h=Ce();if(h){let c=t.map.getView().getProjection();l=l.clone().transform(h,c),l=ll(l).transform(c,h)}this.rBush_.update(l.getExtent(),a)}else this.rBush_.update(ye(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Is(Mc.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)}handlePointerAtPixel_(t,e,i){let r=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection(),o=function(h,c){return dm(r,h,s)-dm(r,c,s)},a,l;if(this.hitDetection_){let h=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;e.forEachFeatureAtPixel(t,(c,u,d)=>{d&&d.getType()==="Point"&&(d=new Ae(ti(d.getCoordinates(),s)));let f=d||c.getGeometry();if(c instanceof Pn&&this.features_.getArray().includes(c)){l=f;let g=c.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:c,geometry:l,segment:[g,g]}]}return!0},{layerFilter:h})}if(!a){let h=ae(Ki(r,um),s),c=e.getView().getResolution()*this.pixelTolerance_,u=vi(ji(h,c,um),s);a=this.rBush_.getInExtent(u)}if(a&&a.length>0){let h=a.sort(o)[0],c=h.segment,u=fm(r,h,s),d=e.getPixelFromCoordinate(u),f=La(t,d);if(l||f<=this.pixelTolerance_){let g={};if(g[z(c)]=!0,this.snapToPointer_||(this.delta_[0]=u[0]-r[0],this.delta_[1]=u[1]-r[1]),h.geometry.getType()==="Circle"&&h.index===Rs)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(u,[h.feature],[h.geometry]);else{let m=e.getPixelFromCoordinate(c[0]),p=e.getPixelFromCoordinate(c[1]),_=lr(d,m),y=lr(d,p);f=Math.sqrt(Math.min(_,y)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(u=_>y?c[1]:c[0]),this.createOrUpdateVertexFeature_(u,[h.feature],[h.geometry]);let C={};C[z(h.geometry)]=!0;for(let w=1,T=a.length;w=0;--l)o=t[l],f=o[0],g=z(f.feature),f.depth&&(g+="-"+f.depth.join("-")),g in e||(e[g]={}),o[1]===0?(e[g].right=f,e[g].index=f.index):o[1]==1&&(e[g].left=f,e[g].index=f.index+1);for(g in e){switch(d=e[g].right,c=e[g].left,h=e[g].index,u=h-1,c!==void 0?f=c:f=d,u<0&&(u=0),a=f.geometry,s=a.getCoordinates(),r=s,i=!1,a.getType()){case"MultiLineString":s[f.depth[0]].length>2&&(s[f.depth[0]].splice(h,1),i=!0);break;case"LineString":s.length>2&&(s.splice(h,1),i=!0);break;case"MultiPolygon":r=r[f.depth[1]];case"Polygon":r=r[f.depth[0]],r.length>4&&(h==r.length-1&&(h=0),r.splice(h,1),i=!0,h===0&&(r.pop(),r.push(r[0]),u=r.length-1));break;default:}if(i){this.setGeometryCoordinates_(a,s);let m=[];if(c!==void 0&&(this.rBush_.remove(c),m.push(c.segment[0])),d!==void 0&&(this.rBush_.remove(d),m.push(d.segment[1])),c!==void 0&&d!==void 0){let p={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:m};this.rBush_.insert(ye(p.segment),p)}this.updateSegmentIndices_(a,h,f.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return i}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,i,r){this.rBush_.forEachInExtent(t.getExtent(),function(s){s.geometry===t&&(i===void 0||s.depth===void 0||Nt(s.depth,i))&&s.index>e&&(s.index+=r)})}};function x_(n,t){return n.index-t.index}function dm(n,t,e){let i=t.geometry;if(i.getType()==="Circle"){let s=i;if(t.index===Rs){let o=Ce();o&&(s=s.clone().transform(o,e));let a=lr(s.getCenter(),Et(n,e)),l=Math.sqrt(a)-s.getRadius();return l*l}}let r=Et(n,e);return Ar[0]=Et(t.segment[0],e),Ar[1]=Et(t.segment[1],e),Nu(r,Ar)}function fm(n,t,e){let i=t.geometry;if(i.getType()==="Circle"&&t.index===Rs){let s=i,o=Ce();return o&&(s=s.clone().transform(o,e)),ti(s.getClosestPoint(Et(n,e)),e)}let r=Et(n,e);return Ar[0]=Et(t.segment[0],e),Ar[1]=Et(t.segment[1],e),ti(Ia(r,Ar),e)}function E_(){let n=Wh();return function(t,e){return n.Point}}var Pc=Ac;nm();var mm=Yc(gm(),1);Cc();var Dc=class{constructor(t,e,i){this.point=t;this.projection=e;this.view=i}onChange(t){this.point.on("change",()=>{let[e,i]=this.getCoordinates();t(e,i)})}getCoordinates(){let t=this.point.getGeometry();return t===null?[null,null]:(t.setProperties({projection:this.projection}),t.getCoordinates())}setCoordinates(t,e){this.point.setGeometry(new Ae(Ti([t,e],this.projection))),this.view.setCenter(Ti([t,e],this.projection))}};function C_(n,t=0,e=0){let i="EPSG:4326",r=new yf({coordinateFormat:Du(4),projection:i,className:`mouse-position-${n}`,target:document.getElementById(`OSMap-${n}`)}),s=new Pn({projection:i,geometry:new Ae(Ti([t,e],i))}),o=new vs({features:[s]}),a=new ws({source:o}),l=new Vf({source:new zf}),h=document.getElementById(`OSMap-${n}`),c=new we({projection:i,center:Ti([t,e],i),zoom:10}),u=new pf({controls:is().extend([r]),layers:[l,a],target:h,view:c}),d=new Pc({hitDetection:a,source:o});d.on(["modifystart","modifyend"],function(m){h.style.cursor=m.type==="modifystart"?"grabbing":"pointer"}),d.getOverlay().getSource().on(["addfeature","removefeature"],function(m){h.style.cursor=m.type==="addfeature"?"pointer":""}),u.addInteraction(d),document.getElementById(`OSMap-${n}`)?.addEventListener("contextmenu",function(m){m.preventDefault();let p=document.getElementsByClassName(`mouse-position-${n}`);if(p.length===0){console.log("no mouse position");return}let _=p[0].innerText||null;if(_===null){console.log("no mouse position");return}let[y,C]=_.split(",").map(w=>parseFloat(w));return s.setGeometry(new Ae(Ti([y,C],i))),!1});let g=new mm.default("nominatim",{provider:"osm",lang:"ru-RU",placeholder:"\u041F\u043E\u0438\u0441\u043A...",limit:5,autoComplete:!0,keepOpen:!0});return u.addControl(g),g.on("addresschosen",function(m){console.log(m);let p=m.feature,_=m.coordinate;p.setStyle(new ai({image:new dn({color:"rgba(0, 0, 0, 0)",crossOrigin:"anonymous",src:"https://openlayers.org/en/latest/examples/data/dot.png",scale:.01})})),c.setCenter(Ti([_[0],_[1]],i)),s.setGeometry(new Ae(Ti([_[0],_[1]],i)))}),h.classList.add("map-done"),new Dc(s,i,c)}window.traineratwot={};window.traineratwot.GetPointMap=C_; +`;class Ue{constructor(){this.settings={url:"https://photon.komoot.io/api/",params:{q:"",limit:10,lang:"en"},langs:["de","it","fr","en"]}}getParameters(x){return x.lang=x.lang.toLowerCase(),{url:this.settings.url,params:{q:x.query,limit:x.limit||this.settings.params.limit,lang:this.settings.langs.includes(x.lang)?x.lang:this.settings.params.lang}}}handleResponse(x){return x.features.length===0?[]:x.features.map(E=>({lon:E.geometry.coordinates[0],lat:E.geometry.coordinates[1],address:{name:E.properties.name,postcode:E.properties.postcode,city:E.properties.city,state:E.properties.state,country:E.properties.country},original:{formatted:E.properties.name,details:E.properties}}))}}class bn{constructor(x){this.settings={url:"https://nominatim.openstreetmap.org/search",...x,params:{q:"",format:"json",addressdetails:1,limit:10,countrycodes:"",viewbox:"","accept-language":"en-US"}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,format:this.settings.params.format,addressdetails:this.settings.params.addressdetails,limit:x.limit||this.settings.params.limit,countrycodes:x.countrycodes||this.settings.params.countrycodes,viewbox:x.viewbox||this.settings.params.viewbox,"accept-language":x.lang||this.settings.params["accept-language"]}}}handleResponse(x){return x.length===0?[]:x.map(E=>({lon:E.lon,lat:E.lat,bbox:E.boundingbox,address:{name:E.display_name,road:E.address.road||"",houseNumber:E.address.house_number||"",postcode:E.address.postcode,city:E.address.city||E.address.town,state:E.address.state,country:E.address.country},original:{formatted:E.display_name,details:E.address}}))}}class An{constructor(){this.settings={url:"https://open.mapquestapi.com/nominatim/v1/search.php",params:{q:"",key:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,key:x.key,format:"json",addressdetails:1,limit:x.limit||this.settings.params.limit,countrycodes:x.countrycodes||this.settings.params.countrycodes,"accept-language":x.lang||this.settings.params["accept-language"]}}}handleResponse(x){return x.length===0?[]:x.map(E=>({lon:E.lon,lat:E.lat,address:{name:E.address.neighbourhood||"",road:E.address.road||"",postcode:E.address.postcode,city:E.address.city||E.address.town,state:E.address.state,country:E.address.country},original:{formatted:E.display_name,details:E.address}}))}}class Mn{constructor(){this.settings={url:"https://dev.virtualearth.net/REST/v1/Locations",callbackName:"jsonp",params:{query:"",key:"",includeNeighborhood:0,maxResults:10}}}getParameters(x){return{url:this.settings.url,callbackName:this.settings.callbackName,params:{query:x.query,key:x.key,includeNeighborhood:x.includeNeighborhood||this.settings.params.includeNeighborhood,maxResults:x.maxResults||this.settings.params.maxResults}}}handleResponse(x){let{resources:E}=x.resourceSets[0];return E.length===0?[]:E.map(M=>({lon:M.point.coordinates[1],lat:M.point.coordinates[0],address:{name:M.name},original:{formatted:M.address.formattedAddress,details:M.address}}))}}class Oi{constructor(){this.settings={url:"https://api.opencagedata.com/geocode/v1/json?",params:{q:"",key:"",limit:10,countrycode:"",pretty:1,no_annotations:1}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,key:x.key,limit:x.limit||this.settings.params.limit,countrycode:x.countrycodes||this.settings.params.countrycodes}}}handleResponse(x){return x.results.length===0?[]:x.results.map(E=>({lon:E.geometry.lng,lat:E.geometry.lat,address:{name:E.components.house_number||"",road:E.components.road||"",postcode:E.components.postcode,city:E.components.city||E.components.town,state:E.components.state,country:E.components.country},original:{formatted:E.formatted,details:E.components}}))}}let Mt=O.cssClasses;class Bt{constructor(x,E){this.Base=x,this.layerName=I("geocoder-layer-"),this.layer=new f.default({name:this.layerName,source:new g.default,displayInLayerSwitcher:!1}),this.options=x.options,this.options.provider=typeof this.options.provider=="string"?this.options.provider.toLowerCase():this.options.provider,this.provider=this.newProvider(),this.els=E,this.lastQuery="",this.container=this.els.container,this.registeredListeners={mapClick:!1},this.setListeners()}setListeners(){let x=E=>{E.stopPropagation(),pe(this.els.control,Mt.glass.expanded)?this.collapse():this.expand()};this.els.input.addEventListener("keypress",E=>{let M=E.target.value.trim();(E.key?E.key==="Enter":E.which?E.which===13:E.keyCode&&E.keyCode===13)&&(E.preventDefault(),this.query(M))},!1),this.els.input.addEventListener("click",E=>E.stopPropagation(),!1),this.els.input.addEventListener("input",E=>{E.target.value.trim().length!==0?st(this.els.search,Mt.hidden):q(this.els.search,Mt.hidden)},!1),this.els.search.addEventListener("click",()=>{this.els.input.focus(),this.query(this.els.input.value)},!1),this.options.targetType===j&&this.els.button.addEventListener("click",x,!1)}query(x){this.provider||(this.provider=this.newProvider());let E=this.provider.getParameters({query:x,key:this.options.key,lang:this.options.lang,countrycodes:this.options.countrycodes,viewbox:this.options.viewbox,limit:this.options.limit});if(this.lastQuery===x&&this.els.result.firstChild)return;this.lastQuery=x,this.clearResults(),q(this.els.search,Mt.spin);let M={url:E.url,data:E.params};E.callbackName&&(M.jsonp=!0,M.callbackName=E.callbackName),Ye(M).then(B=>{this.options.debug&&console.info(B),st(this.els.search,Mt.spin);let Q=this.provider.handleResponse(B);Q&&(this.createList(Q),this.listenMapClick())}).catch(()=>{st(this.els.search,Mt.spin);let B=ee("li","
      Error! No internet connection?
      ");this.els.result.append(B)})}createList(x){let E=this.els.result;x.forEach(M=>{let B;if(this.options.provider===Y?B=`${M.address.name}`:B=this.addressTemplate(M.address),x.length==1)this.chosen(M,B,M.address,M.original);else{let Q=ee("li",`${B}`);Q.addEventListener("click",Wt=>{Wt.preventDefault(),this.chosen(M,B,M.address,M.original)},!1),E.append(Q)}})}chosen(x,E,M,B){let Q=this.Base.getMap(),Wt=[Number.parseFloat(x.lon),Number.parseFloat(x.lat)],Rt=Q.getView().getProjection(),be=_.transform(Wt,"EPSG:4326",Rt),{bbox:Kt}=x;Kt&&(Kt=_.transformExtent([parseFloat(Kt[2]),parseFloat(Kt[0]),parseFloat(Kt[3]),parseFloat(Kt[1])],"EPSG:4326",Rt));let si={formatted:E,details:M,original:B};if(this.options.keepOpen===!1&&this.clearResults(!0),this.options.preventDefault===!0||this.options.preventMarker===!0)this.Base.dispatchEvent({type:W,address:si,coordinate:be,bbox:Kt,place:x});else{let Pn=this.createFeature(be,si);this.Base.dispatchEvent({type:W,address:si,feature:Pn,coordinate:be,bbox:Kt,place:x})}this.options.preventDefault!==!0&&this.options.preventPanning!==!0&&(Kt?Q.getView().fit(Kt,{duration:500}):Q.getView().animate({center:be,resolution:this.options.defaultFlyResolution,duration:500}))}createFeature(x){let E=new p.default(new m.default(x));return this.addLayer(),E.setStyle(this.options.featureStyle),E.setId(I("geocoder-ft-")),this.getSource().addFeature(E),E}addressTemplate(x){let E=[];return x.name&&E.push(['{name}'].join("")),(x.road||x.building||x.house_number)&&E.push(['{building} {road} {house_number}'].join("")),(x.city||x.town||x.village)&&E.push(['{postcode} {city} {town} {village}'].join("")),(x.state||x.country)&&E.push(['{state} {country}'].join("")),Gt(E.join("
      "),x)}newProvider(){switch(this.options.provider){case Y:return new bn(this.options);case F:return new An;case P:return new Ue;case N:return new Mn;case nt:return new Oi;default:return this.options.provider}}expand(){st(this.els.input,Mt.spin),q(this.els.control,Mt.glass.expanded),window.setTimeout(()=>this.els.input.focus(),100),this.listenMapClick()}collapse(){this.els.input.value="",this.els.input.blur(),q(this.els.search,Mt.hidden),st(this.els.control,Mt.glass.expanded),this.clearResults()}listenMapClick(){if(this.registeredListeners.mapClick)return;let x=this,E=this.Base.getMap().getTargetElement();this.registeredListeners.mapClick=!0,E.addEventListener("click",{handleEvent(M){x.clearResults(!0),E.removeEventListener(M.type,this,!1),x.registeredListeners.mapClick=!1}},!1)}clearResults(x){x&&this.options.targetType===j?this.collapse():function(E){for(;E.firstChild;)E.firstChild.remove()}(this.els.result)}getSource(){return this.layer.getSource()}addLayer(){let x=!1,E=this.Base.getMap();E.getLayers().forEach(M=>{M===this.layer&&(x=!0)}),x||E.addLayer(this.layer)}}class Xt extends c.default{constructor(x=Z,E){At(typeof x=="string","@param `type` should be string!"),At(x===Z||x===it,`@param 'type' should be '${Z}' + or '${it}'!`);let M={...at,featureStyle:[new u.default({image:new d.default({scale:.7,src:"//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png"})})],...E},B,Q,Wt=new Le(M);if(x===Z&&(B=Wt.els.container),super({element:B,...M}),!(this instanceof Xt))return new Xt;this.options=M,this.container=B,x===Z&&(Q=new Bt(this,Wt.els),this.layer=Q.layer)}getLayer(){return this.layer}getSource(){return this.getLayer().getSource()}setProvider(x){this.options.provider=x}setProviderKey(x){this.options.key=x}}return Xt})});Fe();zn();br();xs();Ht();wt();De();rt();oa();lr();_i();var Ja=class extends Dn{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){H()}calculateMatrices2D(t){let e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;zt(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Un(r,i)}forEachFeatureAtCoordinate(t,e,i,r,s,o,a,l){let h,c=e.viewState;function u(w,T,R,A){return s.call(o,T,w?R:null,A)}let d=c.projection,f=er(t.slice(),d),g=[[0,0]];if(d.canWrapX()&&r){let w=d.getExtent(),T=$(w);g.push([-T,0],[T,0])}let m=e.layerStatesArray,p=m.length,_=[],y=[];for(let w=0;w=0;--T){let R=m[T],A=R.layer;if(A.hasRenderer()&&Ur(R,c)&&a.call(l,A)){let b=A.getRenderer(),O=A.getSource();if(b&&O){let W=O.getWrapX()?f:t,Z=u.bind(null,R.managed);y[0]=W[0]+g[w][0],y[1]=W[1]+g[w][1],h=b.forEachFeatureAtCoordinate(y,e,i,Z,_)}if(h)return h}}if(_.length===0)return;let C=1/_.length;return _.forEach((w,T)=>w.distanceSq+=T*C),_.sort((w,T)=>w.distanceSq-T.distanceSq),_.some(w=>h=w.callback(w.feature,w.layer,w.geometry)),h}hasFeatureAtCoordinate(t,e,i,r,s,o){return this.forEachFeatureAtCoordinate(t,e,i,r,li,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(t){H()}flushDeclutterItems(t){}scheduleExpireIconCache(t){Hn.canExpireCache()&&t.postRenderFunctions.push(Fm)}};function Fm(n,t){Hn.expire()}var gd=Ja;Fn();tl();$n();cr();Ti();lr();fe();te();var al=class extends gd{constructor(t){super(t),this.fontChangeListenerKey_=U(Ze,Ae.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");let e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=Zi+" ol-layers";let i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){let i=this.getMap();if(i.hasListener(t)){let r=new ro(t,void 0,e);i.dispatchEvent(r)}}disposeInternal(){et(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Jt.PRECOMPOSE,t);let e=t.layerStatesArray.sort(function(o,a){return o.zIndex-a.zIndex}),i=t.viewState;this.children_.length=0;let r=this.declutterLayers_;r.length=0;let s=null;for(let o=0,a=e.length;o=0;--i)e[i].renderDeclutter(t);e.length=0}},wd=al;pt();lr();ha();zn();br();je();pt();Fn();Zt();Oe();rt();wt();fe();var Ne=class extends Ft{constructor(t,e){super(t),this.layer=e}},ll={LAYERS:"layers"},hl=class n extends Gs{constructor(t){t=t||{};let e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(ll.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new $t(i.slice(),{unique:!0}):z(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new $t(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(et),this.layersListenerKeys_.length=0;let t=this.getLayers();this.layersListenerKeys_.push(U(t,Dt.ADD,this.handleLayersAdd_,this),U(t,Dt.REMOVE,this.handleLayersRemove_,this));for(let i in this.listenerKeys_)this.listenerKeys_[i].forEach(et);Be(this.listenerKeys_);let e=t.getArray();for(let i=0,r=e.length;i{this.clickTimeoutId_=void 0;let i=new $e(dt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){let e=t,i=e.pointerId;if(e.type==dt.POINTERUP||e.type==dt.POINTERCANCEL){delete this.trackedTouches_[i];for(let r in this.trackedTouches_)if(this.trackedTouches_[r].target!==e.target){delete this.trackedTouches_[r];break}}else(e.type==dt.POINTERDOWN||e.type==dt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);let e=new $e(dt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);let e=new $e(dt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){let i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(U(i,dt.POINTERMOVE,this.handlePointerMove_,this),U(i,dt.POINTERUP,this.handlePointerUp_,this),U(this.element_,dt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(U(this.element_.getRootNode(),dt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;let e=new $e(dt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;let e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new $e(dt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){let e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(et(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(D.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(et(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},Td=dl;fl();var Ut={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};Fn();$n();pt();Zt();Oe();var Vr=1/0,gl=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Be(this.queuedElements_)}dequeue(){let t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));let r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(t){z(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let e=this.priorityFunction_(t);return e!=Vr?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){let e=this.elements_,i=this.priorities_,r=e.length,s=e[t],o=i[t],a=t;for(;t>1;){let l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=ht;){let a=this.getParentIndex_(e);if(r[a]>o)i[e]=i[a],r[e]=r[a],e=a;else break}i[e]=s,r[e]=o}reprioritize(){let t=this.priorityFunction_,e=this.elements_,i=this.priorities_,r=0,s=e.length,o,a,l;for(a=0;a0;)s=this.dequeue()[0],o=s.getKey(),r=s.getState(),r===k.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++i,s.load())}},Rd=ml;function Sd(n,t,e,i,r){if(!n||!(e in n.wantedTiles))return Vr;if(!n.wantedTiles[e][t.getKey()])return Vr;let s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}no();Xs();ci();Ht();De();Zt();rt();dr();pt();cr();Ct();te();var _l=class extends vi{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);let e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",r=t.expandClassName!==void 0?t.expandClassName:e+"-expand",s=t.collapseLabel!==void 0?t.collapseLabel:"\u203A",o=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;let a=t.label!==void 0?t.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;let l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(D.CLICK,this.handleClick_.bind(this),!1);let h=e+" "+Zi+" "+hr+(this.collapsed_&&this.collapsible_?" "+el:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){let e=Array.from(new Set(this.getMap().getAllLayers().flatMap(r=>r.getAttributions(t)))),i=!this.getMap().getAllLayers().some(r=>r.getSource()&&r.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}let e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Vt(e,this.renderedAttributions_)){pd(this.ulElement_);for(let r=0,s=e.length;r0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Re}):e.setRotation(0))}render(t){let e=t.frameState;if(!e)return;let i=e.viewState.rotation;if(i!=this.rotation_){let r="rotate("+i+"rad)";if(this.autoHide_){let s=this.element.classList.contains(jr);!s&&i===0?this.element.classList.add(jr):s&&i!==0&&this.element.classList.remove(jr)}this.label_.style.transform=r}this.rotation_=i}},bd=yl;dr();pt();cr();Ui();var xl=class extends vi{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});let e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,r=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",s=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"\u2013",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",h=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=r,c.setAttribute("type","button"),c.title=l,c.appendChild(typeof o=="string"?document.createTextNode(o):o),c.addEventListener(D.CLICK,this.handleClick_.bind(this,i),!1);let u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=h,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(D.CLICK,this.handleClick_.bind(this,-i),!1);let d=e+" "+Zi+" "+hr,f=this.element;f.className=d,f.appendChild(c),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){let i=this.getMap().getView();if(!i)return;let r=i.getZoom();if(r!==void 0){let s=i.getConstrainedZoom(r+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Re})):i.setZoom(s)}}},Ad=xl;function Zr(n){n=n||{};let t=new $t;return(n.zoom!==void 0?n.zoom:!0)&&t.push(new Ad(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&t.push(new bd(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&t.push(new Ld(n.attributionOptions)),t}zn();Fe();var El={ACTIVE:"active"};Ui();var Cl=class extends St{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(El.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(El.ACTIVE,t)}setMap(t){this.map_=t}};function Md(n,t,e){let i=n.getCenterInternal();if(i){let r=[i[0]+t[0],i[1]+t[1]];n.animateInternal({duration:e!==void 0?e:250,easing:Xu,center:n.getConstrainedCenter(r)})}}function fr(n,t,e,i){let r=n.getZoom();if(r===void 0)return;let s=n.getConstrainedZoom(r+t),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:e,duration:i!==void 0?i:250,easing:Re})}var Qe=Cl;var wl=class extends Qe{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==dt.DBLCLICK){let i=t.originalEvent,r=t.map,s=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();fr(a,o,s,this.duration_),i.preventDefault(),e=!0}return!e}},Pd=wl;var Tl=class extends Qe{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==dt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==dt.POINTERUP){let i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==dt.POINTERDOWN){let i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==dt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}};function gr(n){let t=n.length,e=0,i=0;for(let r=0;r0&&this.condition_(t)){let i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},Gd=vl;Ht();Vs();var Rl=class extends ti{constructor(t){t=t||{},super({stopDown:hi}),this.condition_=t.condition?t.condition:Od,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!uo(t))return;let e=t.map,i=e.getView();if(i.getConstraints().rotation===rr)return;let r=e.getSize(),s=t.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){let a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return uo(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return uo(t)&&lo(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},Xd=Rl;je();xs();Va();var Sl=class extends Dn{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let t=this.startPixel_,e=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(t[0],e[0])+i,r.top=Math.min(t[1],e[1])+i,r.width=Math.abs(e[0]-t[0])+i,r.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){let t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new dd([r])}getGeometry(){return this.geometry_}},Wd=Sl;var fo={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Hr=class extends Ft{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}},Il=class extends ti{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new Wd(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:lo,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){let r=i[0]-e[0],s=i[1]-e[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Hr(fo.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);let e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Hr(e?fo.BOXEND:fo.BOXCANCEL,t.coordinate,t)),!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Hr(fo.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}},zd=Il;Ui();var Ll=class extends zd{constructor(t){t=t||{};let e=t.condition?t.condition:kd;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){let i=this.getMap().getView(),r=this.getGeometry();if(this.out_){let s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Re})}},Yd=Ll;pt();var Ji={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};_i();var bl=class extends Qe{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return ho(e)&&co(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==D.KEYDOWN){let i=t.originalEvent,r=i.key;if(this.condition_(t)&&(r==Ji.DOWN||r==Ji.LEFT||r==Ji.RIGHT||r==Ji.UP)){let o=t.map.getView(),a=o.getResolution()*this.pixelDelta_,l=0,h=0;r==Ji.DOWN?h=-a:r==Ji.LEFT?l=-a:r==Ji.RIGHT?l=a:h=a;let c=[l,h];tr(c,o.getRotation()),Md(o,c,this.duration_),i.preventDefault(),e=!0}}return!e}},Ud=bl;pt();var Al=class extends Qe{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Dd(e)&&co(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==D.KEYDOWN||t.type==D.KEYPRESS){let i=t.originalEvent,r=i.key;if(this.condition_(t)&&(r==="+"||r==="-")){let s=t.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();fr(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}},jd=Al;var Ml=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;let t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;let r=this.points_[e+2]-this.points_[i+2];if(r<1e3/60)return!1;let s=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Bd=Ml;pt();ci();xt();var Pl=class extends Qe{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;let e=t.condition?t.condition:Fd;this.condition_=t.onFocusOnly?qr(ao,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)||t.type!==D.WHEEL)return!0;let i=t.map,r=t.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let s;if(t.type==D.WHEEL&&(s=r.deltaY,Pc&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Ts),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;let o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");let a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=s;let l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(t){let e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-ot(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),fr(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}},Kd=Pl;Ht();Vs();var Ol=class extends ti{constructor(t){t=t||{};let e=t;e.stopDown||(e.stopDown=hi),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0,i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){let l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=s;let o=t.map,a=o.getView();a.getConstraints().rotation!==rr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(gr(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},Vd=Ol;Ht();var Fl=class extends ti{constructor(t){t=t||{};let e=t;e.stopDown||(e.stopDown=hi),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1,i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;let l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(gr(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){let i=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},Zd=Fl;function qd(n){n=n||{};let t=new $t,e=new Bd(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&t.push(new Xd),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&t.push(new Pd({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&t.push(new Gd({onFocusOnly:n.onFocusOnly,kinetic:e})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&t.push(new Vd),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&t.push(new Zd({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(t.push(new Ud),t.push(new jd({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&t.push(new Kd({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&t.push(new Yd({duration:n.zoomDuration})),t}Ct();Yt();wt();Ri();fe();te();pa();function $d(n){if(n instanceof xn){n.setMapInternal(null);return}n instanceof Kr&&n.getLayers().forEach($d)}function Jd(n,t){if(n instanceof xn){n.setMapInternal(t);return}if(n instanceof Kr){let e=n.getLayers().getArray();for(let i=0,r=e.length;ithis.updateSize()),this.controls=e.controls||Zr(),this.interactions=e.interactions||qd({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Rd(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Ut.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Ut.VIEW,this.handleViewChanged_),this.addChangeListener(Ut.SIZE,this.handleSizeChanged_),this.addChangeListener(Ut.TARGET,this.handleTargetChanged_),this.setProperties(e.values);let i=this;t.view&&!(t.view instanceof me)&&t.view.then(function(r){i.setView(new me(r))}),this.controls.addEventListener(Dt.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(Dt.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(Dt.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(Dt.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(Dt.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(Dt.REMOVE,r=>{let s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){Jd(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){let e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};let s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:li,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,e,null,o,null)}getFeaturesAtPixel(t,e){let i=[];return this.forEachFeatureAtPixel(t,function(r){i.push(r)},e),i}getAllLayers(){let t=[];function e(i){i.forEach(function(r){r instanceof Kr?e(r.getLayers()):t.push(r)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;let i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};let r=e.layerFilter!==void 0?e.layerFilter:li,s=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){let i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(Ut.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return nr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){let e=this.frameState_;return e?_t(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){let e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Ut.LAYERGROUP)}setLayers(t){let e=this.getLayerGroup();if(t instanceof $t){e.setLayers(t);return}let i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;s--){let o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){let t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let r=this.maxTilesLoading_,s=r;if(t){let o=t.viewHints;if(o[Pt.ANIMATING]||o[Pt.INTERACTING]){let a=Date.now()-t.time>8;r=a?0:8,s=a?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){let e=this.getLayerGroup();e&&this.handleLayerRemove_(new Ne("removelayer",e)),this.set(Ut.LAYERGROUP,t)}setSize(t){this.set(Ut.SIZE,t)}setTarget(t){this.set(Ut.TARGET,t)}setView(t){if(!t||t instanceof me){this.set(Ut.VIEW,t);return}this.set(Ut.VIEW,new me);let e=this;t.then(function(i){e.setView(new me(i))})}updateSize(){let t=this.getTargetElement(),e;if(t){let r=getComputedStyle(t),s=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),o=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(s)&&!isNaN(o)&&(e=[s,o],!Dl(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Us("No map visible because the map container's width or height are 0."))}let i=this.getSize();e&&(!i||!Vt(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){let e=this.getView();e&&e.setViewportSize(t)}};function Xm(n){let t=null;n.keyboardEventTarget!==void 0&&(t=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);let e={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Kr({layers:n.layers});e[Ut.LAYERGROUP]=i,e[Ut.TARGET]=n.target,e[Ut.VIEW]=n.view instanceof me?n.view:new me;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new $t(n.controls.slice()):(z(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new $t(n.interactions.slice()):(z(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new $t(n.overlays.slice()):(z(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new $t,{controls:r,interactions:s,keyboardEventTarget:t,overlays:o,values:e}}var Qd=kl;dr();Yt();fe();_i();var Nl="projection",tf="coordinateFormat",Gl=class extends vi{constructor(t){t=t||{};let e=document.createElement("div");e.className=t.className!==void 0?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(Nl,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=t.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=t.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(tf)}getProjection(){return this.get(Nl)}handleMouseMove(t){let e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){let e=t.getViewport();this.listenerKeys.push(U(e,$i.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(U(e,$i.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(tf,t)}setProjection(t){this.set(Nl,ft(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){let s=this.getProjection();s?this.transform_=Ve(this.mapProjection_,s):this.transform_=Nr}let r=this.getMap().getCoordinateFromPixelInternal(t);if(r){let s=_n();if(s&&(this.transform_=Ve(this.mapProjection_,s)),this.transform_(r,r),this.wrapX_){let a=s||this.getProjection()||this.mapProjection_;er(r,a)}let o=this.getCoordinateFormat();o?e=o(r):e=r.toString()}}(!this.renderedHTML_||e!==this.renderedHTML_)&&(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){let e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}},ef=Gl;pt();Lr();pt();wt();Ui();var Xl=class extends ki{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(D.CHANGE)}release(){this.state===k.ERROR&&this.setState(k.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){let t=this.interimTile;if(!t)return this;do{if(t.getState()==k.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){let t=this.interimTile;if(!t)return;let e=this;do{if(t.getState()==k.LOADED){t.interimTile=null;break}t.getState()==k.LOADING?e=t:t.getState()==k.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==k.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){H()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;let r=e-i+1e3/60;return r>=this.transition_?1:Ia(r/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}},go=Xl;te();Wl();var zl=class extends go{constructor(t,e,i,r,s,o){super(t,e,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=k.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=k.ERROR,this.unlistenImage_(),this.image_=zm(),this.changed()}handleImageLoad_(){let t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=k.LOADED:this.state=k.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==k.ERROR&&(this.state=k.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==k.IDLE&&(this.state=k.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=nf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}};function zm(){let n=gt(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}var mo=zl;pt();rt();Yt();xt();var Ym=10,sf=.25,Yl=class{constructor(t,e,i,r,s,o){this.sourceProj_=t,this.targetProj_=e;let a={},l=Yi(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){let C=y[0]+"/"+y[1];return a[C]||(a[C]=l(y)),a[C]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&$(r)>=$(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?$(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?$(this.targetProj_.getExtent()):null;let h=Ce(i),c=Zn(i),u=Vn(i),d=Kn(i),f=this.transformInv_(h),g=this.transformInv_(c),m=this.transformInv_(u),p=this.transformInv_(d),_=Ym+(o?Math.max(0,Math.ceil(Math.log2(Ar(i)/(o*o*256*256)))):0);if(this.addQuad_(h,c,u,d,f,g,m,p,_),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(C,w,T){y=Math.min(y,C.source[0][0],C.source[1][0],C.source[2][0])}),this.triangles_.forEach(C=>{if(Math.max(C.source[0][0],C.source[1][0],C.source[2][0])-y>this.sourceWorldWidth_/2){let w=[[C.source[0][0],C.source[0][1]],[C.source[1][0],C.source[1][1]],[C.source[2][0],C.source[2][1]]];w[0][0]-y>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-y>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-y>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);let T=Math.min(w[0][0],w[1][0],w[2][0]);Math.max(w[0][0],w[1][0],w[2][0])-T.5&&u<1,g=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){let p=qo([t,e,i,r]);g=$(p)/this.targetWorldWidth_>sf||g}!f&&this.sourceProj_.isGlobal()&&u&&(g=u>sf||g)}if(!g&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!yt(c,this.maxSourceExtent_))return;let m=0;if(!g&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)g=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(h>0){if(!g){let p=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(p),y;f?y=(ke(s[0],d)+ke(a[0],d))/2-ke(_[0],d):y=(s[0]+a[0])/2-_[0];let C=(s[1]+a[1])/2-_[1];g=y*y+C*C>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){let p=[(e[0]+i[0])/2,(e[1]+i[1])/2],_=this.transformInv_(p),y=[(r[0]+t[0])/2,(r[1]+t[1])/2],C=this.transformInv_(y);this.addQuad_(t,e,p,y,s,o,_,C,h-1),this.addQuad_(y,p,i,r,C,_,a,l,h-1)}else{let p=[(t[0]+e[0])/2,(t[1]+e[1])/2],_=this.transformInv_(p),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],C=this.transformInv_(y);this.addQuad_(t,p,y,r,s,_,C,l,h-1),this.addQuad_(p,e,i,y,_,o,a,C,h-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(t,i,r,s,a,l),m&14||this.addTriangle_(t,i,e,s,a,o),m&&(m&13||this.addTriangle_(e,r,t,o,l,s),m&7||this.addTriangle_(e,r,i,o,l,a))}calculateSourceExtent(){let t=Tt();return this.triangles_.forEach(function(e,i,r){let s=e.source;cn(t,s[0]),cn(t,s[1]),cn(t,s[2])}),t}getTriangles(){return this.triangles_}},of=Yl;rt();te();Yt();xt();var Ul,wn=[];function af(n,t,e,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(t,e),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,i)+1,Math.max(e,r)),n.restore()}function jl(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function Um(){if(Ul===void 0){let n=gt(6,6,wn);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",af(n,4,5,4,0),af(n,4,5,0,5);let t=n.getImageData(0,0,3,3).data;Ul=jl(t,0)||jl(t,4)||jl(t,8),En(n),wn.push(n.canvas)}return Ul}function lf(n,t,e,i){let r=pn(e,t,n),s=Ks(t,i,e),o=t.getMetersPerUnit();o!==void 0&&(s*=o);let a=n.getMetersPerUnit();a!==void 0&&(s/=a);let l=n.getExtent();if(!l||Gi(l,r)){let h=Ks(n,s,r)/s;isFinite(h)&&h>0&&(s/=h)}return s}function hf(n,t,e,i){let r=Ee(e),s=lf(n,t,r,i);return(!isFinite(s)||s<=0)&&As(e,function(o){return s=lf(n,t,o,i),isFinite(s)&&s>0}),s}function cf(n,t,e,i,r,s,o,a,l,h,c,u,d){let f=gt(Math.round(e*n),Math.round(e*t),wn);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(e,e);function g(y){return Math.round(y*e)/e}f.globalCompositeOperation="lighter";let m=Tt();l.forEach(function(y,C,w){Nc(m,y.extent)});let p;if(!d||l.length!==1||h!==0){let y=$(m),C=Lt(m);p=gt(Math.round(e*y/i),Math.round(e*C/i),wn),u||(p.imageSmoothingEnabled=!1);let w=e/i;l.forEach(function(T,R,A){let b=T.extent[0]-m[0],O=-(T.extent[3]-m[3]),W=$(T.extent),Z=Lt(T.extent);T.image.width>0&&T.image.height>0&&p.drawImage(T.image,h,h,T.image.width-2*h,T.image.height-2*h,b*w,O*w,W*w,Z*w)})}let _=Ce(o);return a.getTriangles().forEach(function(y,C,w){let T=y.source,R=y.target,A=T[0][0],b=T[0][1],O=T[1][0],W=T[1][1],Z=T[2][0],it=T[2][1],j=g((R[0][0]-_[0])/s),mt=g(-(R[0][1]-_[1])/s),Y=g((R[1][0]-_[0])/s),F=g(-(R[1][1]-_[1])/s),P=g((R[2][0]-_[0])/s),N=g(-(R[2][1]-_[1])/s),nt=A,at=b;A=0,b=0,O-=nt,W-=at,Z-=nt,it-=at;let At=[[O,W,0,0,Y-j],[Z,it,0,0,P-j],[0,0,O,W,F-mt],[0,0,Z,it,N-mt]],I=eu(At);if(!I)return;if(f.save(),f.beginPath(),Um()||!u){f.moveTo(Y,F);let q=4,st=j-Y,pe=mt-F;for(let Gt=0;Gt{e&&e.getState()==k.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=k.ERROR;else{let e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=cf(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=k.LOADED}this.changed()}load(){if(this.state==k.IDLE){this.state=k.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{let i=e.getState();if(i==k.IDLE||i==k.LOADING){t++;let r=U(e,D.CHANGE,function(s){let o=e.getState();(o==k.LOADED||o==k.ERROR||o==k.EMPTY)&&(et(r),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(r)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,r){e.getState()==k.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(et),this.sourcesListenerKeys_=null}release(){this.canvas_&&(En(this.canvas_.getContext("2d")),wn.push(this.canvas_),this.canvas_=null),super.release()}},$r=Bl;Zt();var Kl=class{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){let i=this.entries_[t];return z(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){let e=this.entries_[t];return z(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){let t=new Array(this.count_),e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){let t=new Array(this.count_),e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){let t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){z(!(t in this.entries_),"Tried to set a value for a key that is used already");let i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}},uf=Kl;function Vl(n,t,e,i){return i!==void 0?(i[0]=n,i[1]=t,i[2]=e,i):[n,t,e]}function Tn(n,t,e){return n+"/"+t+"/"+e}function po(n){return Tn(n[0],n[1],n[2])}function df(n){return n.split("/").map(Number)}function ff(n){return(n[1]<e||e>t.getMaxZoom())return!1;let s=t.getFullTileRange(e);return s?s.containsXY(i,r):!0}var Zl=class extends uf{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;let t=this.peekFirstKey(),i=df(t)[0];this.forEach(r=>{r.tileCoord[0]!==i&&(this.remove(po(r.tileCoord)),r.release())})}},_o=Zl;var yo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};je();Hl();wt();Zt();Yt();var Eo=class{constructor(t,e,i,r){this.minX=t,this.maxX=e,this.minY=i,this.maxY=r}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}};function vn(n,t,e,i,r){return r!==void 0?(r.minX=n,r.maxX=t,r.minY=e,r.maxY=i,r):new Eo(n,t,e,i)}var Co=Eo;Zt();xt();rt();Ya();Ct();Ri();var pr=[0,0,0],Qi=5,$l=class{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,z(Ac(this.resolutions_,(r,s)=>s-r,!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let r=0,s=this.resolutions_.length-1;r{let o=new Co(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){let a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){let r=this.getTileRangeForExtentAndZ(t,e);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([e,s,a])}forEachTileCoordParentTileRange(t,e,i,r){let s,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,r);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=vn(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,h,i),e(h,s))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e0?i:Math.max(s/e[0],r/e[1]);let o=t+1,a=new Array(o);for(let l=0;li.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,r){}},vo=class extends Ft{constructor(t,e){super(t),this.tile=e}},xf=Ql;xt();function Km(n,t){let e=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return n.replace(e,o[0].toString()).replace(i,o[1].toString()).replace(r,o[2].toString()).replace(s,function(){let h=o[0],c=t.getFullTileRange(h);if(!c)throw new Error("The {-y} placeholder requires a tile grid with extent");return(c.getHeight()-o[2]-1).toString()})}}function Ef(n,t){let e=n.length,i=new Array(e);for(let r=0;rthis.getTileInternal(p,_,y,C,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=u,h?(m.interimTile=h,m.refreshInterimChain(),a.replace(c,m)):a.set(c,m),m}getTileInternal(t,e,i,r,s){let o=null,a=Tn(t,e,i),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(t,e,i,r,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){let h=o;o=this.createTile_(t,e,i,r,s,l),h.getState()==k.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(let e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){let i=ft(t);if(i){let r=K(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}}clear(){super.clear();for(let t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}};function Zm(n,t){n.getImage().src=t}var Tf=eh;var ih=class extends Tf{constructor(t){t=t||{};let e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:_f({extent:To(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}},vf=ih;var qm='© OpenStreetMap contributors.',nh=class extends vf{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[qm];let i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",r=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:r,wrapX:t.wrapX,zDirection:t.zDirection})}},Rf=nh;lr();var Jr={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var rh=class extends xn{constructor(t){t=t||{};let e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(Jr.PRELOAD)}setPreload(t){this.set(Jr.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Jr.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Jr.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}},Sf=rh;lh();De();Ct();rt();Yt();wt();Ri();var hh=class extends Ro{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=Tt(),this.tmpTileRange_=new Co(0,0,0,0)}isDrawableTile(t){let e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==k.LOADED||i==k.EMPTY||i==k.ERROR&&!r}getTile(t,e,i,r){let s=r.pixelRatio,o=r.viewState.projection,a=this.getLayer(),h=a.getSource().getTile(t,e,i,s,o);return h.getState()==k.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(h)||(h=h.getInterimTile()),h}getData(t){let e=this.frameState;if(!e)return null;let i=this.getLayer(),r=_t(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!Gi(s,r))return null;let o=e.pixelRatio,a=e.viewState.projection,l=e.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(l.projection),u=h.getTilePixelRatio(e.pixelRatio);for(let d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){let f=c.getTileCoordForCoordAndZ(r,d),g=h.getTile(d,f[1],f[2],o,a);if(!(g instanceof mo||g instanceof $r)||g instanceof $r&&g.getState()===k.EMPTY)return null;if(g.getState()!==k.LOADED)continue;let m=c.getOrigin(d),p=bt(c.getTileSize(d)),_=c.getResolution(d),y=Math.floor(u*((r[0]-m[0])/_-f[1]*p[0])),C=Math.floor(u*((m[1]-r[1])/_-f[2]*p[1])),w=Math.round(u*h.getGutterForProjection(l.projection));return this.getImageData(g.getImage(),y+w,C+w)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){let i=t.layerStatesArray[t.layerIndex],r=t.viewState,s=r.projection,o=r.resolution,a=r.center,l=r.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),f=u.getTileGridForProjection(s),g=f.getZForResolution(o,u.zDirection),m=f.getResolution(g),p=t.extent,_=t.viewState.resolution,y=u.getTilePixelRatio(h),C=Math.round($(p)/_*h),w=Math.round(Lt(p)/_*h),T=i.extent&&ve(i.extent,s);T&&(p=Xi(p,ve(i.extent,s)));let R=m*C/2/y,A=m*w/2/y,b=[a[0]-R,a[1]-A,a[0]+R,a[1]+A],O=f.getTileRangeForExtentAndZ(p,g),W={};W[g]={};let Z=this.createLoadedTileFinder(u,s,W),it=this.tmpExtent,j=this.tmpTileRange_;this.newTiles_=!1;let mt=l?Ms(r.center,_,l,t.size):void 0;for(let vt=O.minX;vt<=O.maxX;++vt)for(let q=O.minY;q<=O.maxY;++q){if(l&&!f.tileCoordIntersectsViewport([g,vt,q],mt))continue;let st=this.getTile(g,vt,q,t);if(this.isDrawableTile(st)){let ee=K(this);if(st.getState()==k.LOADED){W[g][st.tileCoord.toString()]=st;let _e=st.inTransition(ee);_e&&i.opacity!==1&&(st.endTransition(ee),_e=!1),!this.newTiles_&&(_e||!this.renderedTiles.includes(st))&&(this.newTiles_=!0)}if(st.getAlpha(ee,t.time)===1)continue}let pe=f.getTileCoordChildTileRange(st.tileCoord,j,it),Gt=!1;pe&&(Gt=Z(g+1,pe)),Gt||f.forEachTileCoordParentTileRange(st.tileCoord,Z,j,it)}let Y=m/o*h/y;zt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,l,-C/2,-w/2);let F=Rs(this.pixelTransform);this.useContainer(e,F,this.getBackground(t));let P=this.context,N=P.canvas;Un(this.inversePixelTransform,this.pixelTransform),zt(this.tempTransform,C/2,w/2,Y,Y,0,-C/2,-w/2),N.width!=C||N.height!=w?(N.width=C,N.height=w):this.containerReused||P.clearRect(0,0,C,w),T&&this.clipUnrotated(P,t,T),u.getInterpolate()||(P.imageSmoothingEnabled=!1),this.preRender(P,t),this.renderedTiles.length=0;let nt=Object.keys(W).map(Number);nt.sort(de);let at,At,I;i.opacity===1&&(!this.containerReused||u.getOpaque(t.viewState.projection))?nt=nt.reverse():(at=[],At=[]);for(let vt=nt.length-1;vt>=0;--vt){let q=nt[vt],st=u.getTilePixelSize(q,h,s),Gt=f.getResolution(q)/m,ee=st[0]*Gt*Y,_e=st[1]*Gt*Y,ri=f.getTileCoordForCoordAndZ(Ce(b),q),ln=f.getTileCoordExtent(ri),tt=_t(this.tempTransform,[y*(ln[0]-b[0])/m,y*(b[3]-ln[3])/m]),Le=y*u.getGutterForProjection(s),Ye=W[q];for(let Pi in Ye){let Ue=Ye[Pi],bn=Ue.tileCoord,An=ri[1]-bn[1],Mn=Math.round(tt[0]-(An-1)*ee),Oi=ri[2]-bn[2],Mt=Math.round(tt[1]-(Oi-1)*_e),Bt=Math.round(tt[0]-An*ee),Xt=Math.round(tt[1]-Oi*_e),L=Mn-Bt,x=Mt-Xt,E=g===q,M=E&&Ue.getAlpha(K(this),t.time)!==1,B=!1;if(!M)if(at){I=[Bt,Xt,Bt+L,Xt,Bt+L,Xt+x,Bt,Xt+x];for(let Q=0,Wt=at.length;Q{let[e,i]=this.getCoordinates();t(e,i)})}getCoordinates(){return this.view.getCenter()}setCoordinates(t,e){this.view.setCenter(ir([t,e],this.projection))}};function e_(n,t=0,e=0){let i="EPSG:4326",r=new ef({coordinateFormat:Eu(4),projection:i,className:`mouse-position-${n}`,target:document.getElementById(`OSMap-${n}`)}),s=new So({projection:i,geometry:new ar(ir([t,e],i))}),o=new pc({features:[s]}),a=new cc({source:o}),l=new Af({source:new Rf}),h=document.getElementById(`OSMap-${n}`),c=new me({projection:i,center:ir([t,e],i),zoom:10}),u=new Qd({controls:Zr().extend([r]),layers:[l,a],target:h,view:c}),d=new $g.default("nominatim",{provider:"osm",lang:"ru-RU",placeholder:"\u041F\u043E\u0438\u0441\u043A...",limit:5,keepOpen:!0});u.addControl(d),d.on("addresschosen",function(g){console.log(g);let m=g.feature,p=g.coordinate;m.setStyle(new ei({image:new nn({color:"rgba(0, 0, 0, 0)",crossOrigin:"anonymous",src:"https://openlayers.org/en/latest/examples/data/dot.png",scale:.01})})),c.setCenter(ir([p[0],p[1]],i))});function f(){let[g,m]=u.getView().getCenter();s.getGeometry().setCoordinates([g,m])}return u.on("movestart",f),u.on("moveend",f),h.classList.add("map-done"),new Ec(c,i)}window.traineratwot={};window.traineratwot.GetPointMap=e_; /*! Bundled license information: ol-geocoder/dist/ol-geocoder.js: diff --git a/resources/js/index.ts b/resources/js/index.ts index 5e6e0b2..ea0f055 100644 --- a/resources/js/index.ts +++ b/resources/js/index.ts @@ -9,36 +9,27 @@ import { Feature } from 'ol' import { fromLonLat, ProjectionLike } from 'ol/proj' import VectorSource from 'ol/source/Vector' import VectorLayer from 'ol/layer/Vector' -import { Modify } from 'ol/interaction' import { Point } from 'ol/geom' import Geocoder from 'ol-geocoder' import { Icon, Style } from 'ol/style' class mPoint { - constructor(public point: Feature, public projection: ProjectionLike, public view: View) { + constructor(public view: View, public projection: ProjectionLike) { } public onChange(callback: (lon: number, lat: number) => void) { - this.point.on('change', () => { + this.view.on('change', () => { const [lat, lon] = this.getCoordinates() callback(lat, lon) }) } public getCoordinates() { - const geom = this.point.getGeometry() - if (geom === null) { - return [null, null] - } - geom.setProperties({ - projection: this.projection, - }) - return geom.getCoordinates() + return this.view.getCenter() } public setCoordinates(lat: number, lon: number) { - this.point.setGeometry(new Point(fromLonLat([lat, lon], this.projection))) this.view.setCenter(fromLonLat([lat, lon], this.projection)) } } @@ -81,37 +72,6 @@ function GetPointMap(id: string, lat: number = 0, lon: number = 0) { target:target, view: view, }) - - const modify = new Modify({ - hitDetection: vectorLayer, - source: vectorSource, - }); - modify.on(['modifystart', 'modifyend'], function (evt) { - target.style.cursor = evt.type === 'modifystart' ? 'grabbing' : 'pointer'; - }); - const overlaySource = modify.getOverlay().getSource(); - overlaySource.on(['addfeature', 'removefeature'], function (evt: { type: string }) { - target.style.cursor = evt.type === 'addfeature' ? 'pointer' : ''; - }); - - map.addInteraction(modify); - document.getElementById(`OSMap-${id}`)?.addEventListener('contextmenu', function(event) { - event.preventDefault() - const div = document.getElementsByClassName( `mouse-position-${id}`) as HTMLCollectionOf - if (div.length === 0) { - console.log('no mouse position') - return - } - const coordsText = div[0].innerText || null - if (coordsText === null) { - console.log('no mouse position') - return - } - const [lat, lon] = coordsText.split(',').map((s) => parseFloat(s)) - point.setGeometry(new Point(fromLonLat([lat, lon], projection))) - return false - }) - const geocoder = new Geocoder('nominatim', { provider: 'osm', lang: 'ru-RU', //en-US, fr-FR @@ -134,10 +94,19 @@ function GetPointMap(id: string, lat: number = 0, lon: number = 0) { })) // application specific view.setCenter(fromLonLat([coordinate[0], coordinate[1]], projection)) - point.setGeometry(new Point(fromLonLat([coordinate[0], coordinate[1]], projection))) }) + + function updateCenter() { + // Получаем новые координаты центра карты + const [lat, lon] = map.getView().getCenter() + // Обновляем координаты точки + point.getGeometry().setCoordinates([lat, lon]) + } + + map.on('movestart', updateCenter) + map.on('moveend', updateCenter) target.classList.add('map-done') - return new mPoint(point, projection, view) + return new mPoint(view, projection) } window['traineratwot'] = {} diff --git a/resources/views/forms/components/map.blade.php b/resources/views/forms/components/map.blade.php index 8a63c32..d4254dc 100644 --- a/resources/views/forms/components/map.blade.php +++ b/resources/views/forms/components/map.blade.php @@ -30,7 +30,6 @@ {{ $getLabel() }} - class(['fi-fo-textarea overflow-hidden']) " + > -
      +
      +
      +
      +