UNPKG

ole

Version:

OpenLayers Editor

1 lines 580 kB
var ole=(()=>{var yp=Object.create;var Ja=Object.defineProperty;var xp=Object.getOwnPropertyDescriptor;var Ep=Object.getOwnPropertyNames;var Ip=Object.getPrototypeOf,Cp=Object.prototype.hasOwnProperty;var Th=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),io=(r,t)=>{for(var e in t)Ja(r,e,{get:t[e],enumerable:!0})},Of=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ep(t))!Cp.call(r,n)&&n!==e&&Ja(r,n,{get:()=>t[n],enumerable:!(i=xp(t,n))||i.enumerable});return r};var $a=(r,t,e)=>(e=r!=null?yp(Ip(r)):{},Of(t||!r||!r.__esModule?Ja(e,"default",{value:r,enumerable:!0}):e,r)),Sp=r=>Of(Ja({},"__esModule",{value:!0}),r);var Yh=Th((Gh,Bh)=>{(function(r,t){typeof Gh=="object"&&typeof Bh<"u"?Bh.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(Gh,function(){"use strict";function r(d,m,x,I,S){(function w(C,R,v,P,B){for(;P>v;){if(P-v>600){var q=P-v+1,W=R-v+1,J=Math.log(q),Tt=.5*Math.exp(2*J/3),Q=.5*Math.sqrt(J*Tt*(q-Tt)/q)*(W-q/2<0?-1:1),Y=Math.max(v,Math.floor(R-W*Tt/q+Q)),tt=Math.min(P,Math.floor(R+(q-W)*Tt/q+Q));w(C,R,Y,tt,B)}var V=C[R],at=v,it=P;for(t(C,v,R),B(C[P],V)>0&&t(C,v,P);at<it;){for(t(C,at,it),at++,it--;B(C[at],V)<0;)at++;for(;B(C[it],V)>0;)it--}B(C[v],V)===0?t(C,v,it):t(C,++it,P),it<=R&&(v=it+1),R<=it&&(P=it-1)}})(d,m,x||0,I||d.length-1,S||e)}function t(d,m,x){var I=d[m];d[m]=d[x],d[x]=I}function e(d,m){return d<m?-1:d>m?1:0}var i=function(d){d===void 0&&(d=9),this._maxEntries=Math.max(4,d),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(d,m,x){if(!x)return m.indexOf(d);for(var I=0;I<m.length;I++)if(x(d,m[I]))return I;return-1}function s(d,m){o(d,0,d.children.length,m,d)}function o(d,m,x,I,S){S||(S=p(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var w=m;w<x;w++){var C=d.children[w];a(S,d.leaf?I(C):C)}return S}function a(d,m){return d.minX=Math.min(d.minX,m.minX),d.minY=Math.min(d.minY,m.minY),d.maxX=Math.max(d.maxX,m.maxX),d.maxY=Math.max(d.maxY,m.maxY),d}function l(d,m){return d.minX-m.minX}function h(d,m){return d.minY-m.minY}function u(d){return(d.maxX-d.minX)*(d.maxY-d.minY)}function c(d){return d.maxX-d.minX+(d.maxY-d.minY)}function f(d,m){return d.minX<=m.minX&&d.minY<=m.minY&&m.maxX<=d.maxX&&m.maxY<=d.maxY}function g(d,m){return m.minX<=d.maxX&&m.minY<=d.maxY&&m.maxX>=d.minX&&m.maxY>=d.minY}function p(d){return{children:d,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(d,m,x,I,S){for(var w=[m,x];w.length;)if(!((x=w.pop())-(m=w.pop())<=I)){var C=m+Math.ceil((x-m)/I/2)*I;r(d,C,m,x,S),w.push(m,C,C,x)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(d){var m=this.data,x=[];if(!g(d,m))return x;for(var I=this.toBBox,S=[];m;){for(var w=0;w<m.children.length;w++){var C=m.children[w],R=m.leaf?I(C):C;g(d,R)&&(m.leaf?x.push(C):f(d,R)?this._all(C,x):S.push(C))}m=S.pop()}return x},i.prototype.collides=function(d){var m=this.data;if(!g(d,m))return!1;for(var x=[];m;){for(var I=0;I<m.children.length;I++){var S=m.children[I],w=m.leaf?this.toBBox(S):S;if(g(d,w)){if(m.leaf||f(d,w))return!0;x.push(S)}}m=x.pop()}return!1},i.prototype.load=function(d){if(!d||!d.length)return this;if(d.length<this._minEntries){for(var m=0;m<d.length;m++)this.insert(d[m]);return this}var x=this._build(d.slice(),0,d.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var I=this.data;this.data=x,x=I}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},i.prototype.insert=function(d){return d&&this._insert(d,this.data.height-1),this},i.prototype.clear=function(){return this.data=p([]),this},i.prototype.remove=function(d,m){if(!d)return this;for(var x,I,S,w=this.data,C=this.toBBox(d),R=[],v=[];w||R.length;){if(w||(w=R.pop(),I=R[R.length-1],x=v.pop(),S=!0),w.leaf){var P=n(d,w.children,m);if(P!==-1)return w.children.splice(P,1),R.push(w),this._condense(R),this}S||w.leaf||!f(w,C)?I?(x++,w=I.children[x],S=!1):w=null:(R.push(w),v.push(x),x=0,I=w,w=w.children[0])}return this},i.prototype.toBBox=function(d){return d},i.prototype.compareMinX=function(d,m){return d.minX-m.minX},i.prototype.compareMinY=function(d,m){return d.minY-m.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(d){return this.data=d,this},i.prototype._all=function(d,m){for(var x=[];d;)d.leaf?m.push.apply(m,d.children):x.push.apply(x,d.children),d=x.pop();return m},i.prototype._build=function(d,m,x,I){var S,w=x-m+1,C=this._maxEntries;if(w<=C)return s(S=p(d.slice(m,x+1)),this.toBBox),S;I||(I=Math.ceil(Math.log(w)/Math.log(C)),C=Math.ceil(w/Math.pow(C,I-1))),(S=p([])).leaf=!1,S.height=I;var R=Math.ceil(w/C),v=R*Math.ceil(Math.sqrt(C));y(d,m,x,v,this.compareMinX);for(var P=m;P<=x;P+=v){var B=Math.min(P+v-1,x);y(d,P,B,R,this.compareMinY);for(var q=P;q<=B;q+=R){var W=Math.min(q+R-1,B);S.children.push(this._build(d,q,W,I-1))}}return s(S,this.toBBox),S},i.prototype._chooseSubtree=function(d,m,x,I){for(;I.push(m),!m.leaf&&I.length-1!==x;){for(var S=1/0,w=1/0,C=void 0,R=0;R<m.children.length;R++){var v=m.children[R],P=u(v),B=(q=d,W=v,(Math.max(W.maxX,q.maxX)-Math.min(W.minX,q.minX))*(Math.max(W.maxY,q.maxY)-Math.min(W.minY,q.minY))-P);B<w?(w=B,S=P<S?P:S,C=v):B===w&&P<S&&(S=P,C=v)}m=C||m.children[0]}var q,W;return m},i.prototype._insert=function(d,m,x){var I=x?d:this.toBBox(d),S=[],w=this._chooseSubtree(I,this.data,m,S);for(w.children.push(d),a(w,I);m>=0&&S[m].children.length>this._maxEntries;)this._split(S,m),m--;this._adjustParentBBoxes(I,S,m)},i.prototype._split=function(d,m){var x=d[m],I=x.children.length,S=this._minEntries;this._chooseSplitAxis(x,S,I);var w=this._chooseSplitIndex(x,S,I),C=p(x.children.splice(w,x.children.length-w));C.height=x.height,C.leaf=x.leaf,s(x,this.toBBox),s(C,this.toBBox),m?d[m-1].children.push(C):this._splitRoot(x,C)},i.prototype._splitRoot=function(d,m){this.data=p([d,m]),this.data.height=d.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(d,m,x){for(var I,S,w,C,R,v,P,B=1/0,q=1/0,W=m;W<=x-m;W++){var J=o(d,0,W,this.toBBox),Tt=o(d,W,x,this.toBBox),Q=(S=J,w=Tt,C=void 0,R=void 0,v=void 0,P=void 0,C=Math.max(S.minX,w.minX),R=Math.max(S.minY,w.minY),v=Math.min(S.maxX,w.maxX),P=Math.min(S.maxY,w.maxY),Math.max(0,v-C)*Math.max(0,P-R)),Y=u(J)+u(Tt);Q<B?(B=Q,I=W,q=Y<q?Y:q):Q===B&&Y<q&&(q=Y,I=W)}return I||x-m},i.prototype._chooseSplitAxis=function(d,m,x){var I=d.leaf?this.compareMinX:l,S=d.leaf?this.compareMinY:h;this._allDistMargin(d,m,x,I)<this._allDistMargin(d,m,x,S)&&d.children.sort(I)},i.prototype._allDistMargin=function(d,m,x,I){d.children.sort(I);for(var S=this.toBBox,w=o(d,0,m,S),C=o(d,x-m,x,S),R=c(w)+c(C),v=m;v<x-m;v++){var P=d.children[v];a(w,d.leaf?S(P):P),R+=c(w)}for(var B=x-m-1;B>=m;B--){var q=d.children[B];a(C,d.leaf?S(q):q),R+=c(C)}return R},i.prototype._adjustParentBBoxes=function(d,m,x){for(var I=x;I>=0;I--)a(m[I],d)},i.prototype._condense=function(d){for(var m=d.length-1,x=void 0;m>=0;m--)d[m].children.length===0?m>0?(x=d[m-1].children).splice(x.indexOf(d[m]),1):this.clear():s(d[m],this.toBBox)},i})});var Mm=Th((TO,Nm)=>{"use strict";var y0=function(r,t){return r<t};function Xt(r){if(!(this instanceof Xt))return new Xt(r);this.array=[],this.size=0,this.compare=r||y0}Xt.prototype.clone=function(){var r=new Xt(this.compare);return r.size=this.size,r.array=this.array.slice(0,this.size),r};Xt.prototype.add=function(r){var t=this.size;this.array[this.size]=r,this.size+=1;for(var e,i;t>0&&(e=t-1>>1,i=this.array[e],!!this.compare(r,i));)this.array[t]=i,t=e;this.array[t]=r};Xt.prototype.heapify=function(r){this.array=r,this.size=r.length;var t;for(t=this.size>>1;t>=0;t--)this._percolateDown(t)};Xt.prototype._percolateUp=function(r,t){for(var e=this.array[r],i,n;r>0&&(i=r-1>>1,n=this.array[i],!(!t&&!this.compare(e,n)));)this.array[r]=n,r=i;this.array[r]=e};Xt.prototype._percolateDown=function(r){for(var t=this.size,e=this.size>>>1,i=this.array[r],n,s,o;r<e&&(n=(r<<1)+1,s=n+1,o=this.array[n],s<t&&this.compare(this.array[s],o)&&(n=s,o=this.array[s]),!!this.compare(o,i));)this.array[r]=o,r=n;this.array[r]=i};Xt.prototype._removeAt=function(r){if(!(r>this.size-1||r<0))return this._percolateUp(r,!0),this.poll()};Xt.prototype.remove=function(r){for(var t=0;t<this.size;t++)if(!this.compare(this.array[t],r)&&!this.compare(r,this.array[t]))return this._removeAt(t),!0;return!1};Xt.prototype.removeOne=function(r){if(typeof r=="function"){for(var t=0;t<this.size;t++)if(r(this.array[t]))return this._removeAt(t)}};Xt.prototype.removeMany=function(r,t){if(typeof r!="function"||this.size<1)return[];t=t?Math.min(t,this.size):this.size;for(var e=0,i=new Array(t),n=0,s=new Array(this.size);e<t&&!this.isEmpty();){var o=this.poll();r(o)?i[e++]=o:s[n++]=o}i.length=e;for(var a=0;a<n;)this.add(s[a++]);return i};Xt.prototype.peek=function(){if(this.size!=0)return this.array[0]};Xt.prototype.poll=function(){if(this.size!=0){var r=this.array[0];return this.size>1?(this.array[0]=this.array[--this.size],this._percolateDown(0)):this.size-=1,r}};Xt.prototype.replaceTop=function(r){if(this.size!=0){var t=this.array[0];return this.array[0]=r,this._percolateDown(0),t}};Xt.prototype.trim=function(){this.array=this.array.slice(0,this.size)};Xt.prototype.isEmpty=function(){return this.size===0};Xt.prototype.forEach=function(r){if(!(this.isEmpty()||typeof r!="function"))for(var t=0,e=this.clone();!e.isEmpty();)r(e.poll(),t++)};Xt.prototype.kSmallest=function(r){if(this.size==0||r<=0)return[];r=Math.min(this.size,r);let t=Math.min(this.size,2**(r-1)+1);if(t<2)return[this.peek()];let e=new Xt(this.compare);e.size=t,e.array=this.array.slice(0,t);let i=new Array(r);for(let n=0;n<r;n++)i[n]=e.poll();return i};Nm.exports=Xt});var Zm=Th((HU,Hm)=>{var jm="Expected a function",Vm=NaN,O0="[object Symbol]",D0=/^\s+|\s+$/g,F0=/^[-+]0x[0-9a-f]+$/i,k0=/^0b[01]+$/i,G0=/^0o[0-7]+$/i,B0=parseInt,Y0=typeof global=="object"&&global&&global.Object===Object&&global,X0=typeof self=="object"&&self&&self.Object===Object&&self,z0=Y0||X0||Function("return this")(),U0=Object.prototype,q0=U0.toString,V0=Math.max,W0=Math.min,of=function(){return z0.Date.now()};function j0(r,t,e){var i,n,s,o,a,l,h=0,u=!1,c=!1,f=!0;if(typeof r!="function")throw new TypeError(jm);t=Wm(t)||0,gh(e)&&(u=!!e.leading,c="maxWait"in e,s=c?V0(Wm(e.maxWait)||0,t):s,f="trailing"in e?!!e.trailing:f);function g(C){var R=i,v=n;return i=n=void 0,h=C,o=r.apply(v,R),o}function p(C){return h=C,a=setTimeout(m,t),u?g(C):o}function y(C){var R=C-l,v=C-h,P=t-R;return c?W0(P,s-v):P}function d(C){var R=C-l,v=C-h;return l===void 0||R>=t||R<0||c&&v>=s}function m(){var C=of();if(d(C))return x(C);a=setTimeout(m,y(C))}function x(C){return a=void 0,f&&i?g(C):(i=n=void 0,o)}function I(){a!==void 0&&clearTimeout(a),h=0,i=l=n=a=void 0}function S(){return a===void 0?o:x(of())}function w(){var C=of(),R=d(C);if(i=arguments,n=this,l=C,R){if(a===void 0)return p(l);if(c)return a=setTimeout(m,t),g(l)}return a===void 0&&(a=setTimeout(m,t)),o}return w.cancel=I,w.flush=S,w}function H0(r,t,e){var i=!0,n=!0;if(typeof r!="function")throw new TypeError(jm);return gh(e)&&(i="leading"in e?!!e.leading:i,n="trailing"in e?!!e.trailing:n),j0(r,t,{leading:i,maxWait:t,trailing:n})}function gh(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function Z0(r){return!!r&&typeof r=="object"}function K0(r){return typeof r=="symbol"||Z0(r)&&q0.call(r)==O0}function Wm(r){if(typeof r=="number")return r;if(K0(r))return Vm;if(gh(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=gh(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(D0,"");var e=k0.test(r);return e||G0.test(r)?B0(r.slice(2),e?2:8):F0.test(r)?Vm:+r}Hm.exports=H0});var ry={};io(ry,{Editor:()=>zf,control:()=>_f,helper:()=>ef,interaction:()=>xf,service:()=>yf});var Lh=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}};var wt=Lh;var Qa={PROPERTYCHANGE:"propertychange"};var vh=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}},Df=vh;function Ff(r,t,e){let i,n;e=e||ji;let s=0,o=r.length,a=!1;for(;s<o;)i=s+(o-s>>1),n=+e(r[i],t),n<0?s=i+1:(o=i,a=!n);return a?s:~s}function ji(r,t){return r>t?1:r<t?-1:0}function tl(r,t,e){if(r[0]<=t)return 0;let i=r.length;if(t<=r[i-1])return i-1;if(typeof e=="function"){for(let n=1;n<i;++n){let s=r[n];if(s===t)return n;if(s<t)return e(t,r[n-1],s)>0?n-1:n}return i-1}if(e>0){for(let n=1;n<i;++n)if(r[n]<t)return n-1;return i-1}if(e<0){for(let n=1;n<i;++n)if(r[n]<=t)return n;return i-1}for(let n=1;n<i;++n){if(r[n]==t)return n;if(r[n]<t)return r[n-1]-t<t-r[n]?n-1:n}return i-1}function kf(r,t,e){for(;t<e;){let i=r[t];r[t]=r[e],r[e]=i,++t,--e}}function zt(r,t){let e=Array.isArray(t)?t:[t],i=e.length;for(let n=0;n<i;n++)r[r.length]=e[n]}function Me(r,t){let e=r.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(r[i]!==t[i])return!1;return!0}function Ci(){return!0}function rs(){return!1}function Si(){}function el(r){let t=!1,e,i,n;return function(){let s=Array.prototype.slice.call(arguments);return(!t||this!==n||!Me(s,i))&&(t=!0,n=this,i=s,e=r.apply(this,arguments)),e}}function Bn(r){for(let t in r)delete r[t]}function wi(r){let t;for(t in r)return!1;return!t}var Nh=class extends Df{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_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){let e=typeof t=="string",i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;let s=e?new wt(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,u=n.length;h<u;++h)if("handleEvent"in n[h]?l=n[h].handleEvent(s):l=n[h].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let h=a[i];for(delete a[i];h--;)this.removeEventListener(i,Si);delete o[i]}return l}disposeInternal(){this.listeners_&&Bn(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;let i=this.listeners_[t];if(!i)return;let n=i.indexOf(e);n!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=Si,++this.pendingRemovals_[t]):(i.splice(n,1),i.length===0&&delete this.listeners_[t]))}},il=Nh;var lt={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 Mt(r,t,e,i,n){if(i&&i!==r&&(e=e.bind(i)),n){let o=e;e=function(){r.removeEventListener(t,e),o.apply(this,arguments)}}let s={target:r,type:t,listener:e};return r.addEventListener(t,e),s}function Mh(r,t,e,i){return Mt(r,t,e,i,!0)}function Ut(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),Bn(r))}var ss=class extends il{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(lt.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){let i=t.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=Mt(this,t[s],e);return n}return Mt(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){let n=t.length;i=new Array(n);for(let s=0;s<n;++s)i[s]=Mh(this,t[s],e)}else i=Mh(this,t,e);return e.ol_key=i,i}unInternal(t,e){let i=e.ol_key;if(i)Ph(i);else if(Array.isArray(t))for(let n=0,s=t.length;n<s;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}};ss.prototype.on;ss.prototype.once;ss.prototype.un;function Ph(r){if(Array.isArray(r))for(let t=0,e=r.length;t<e;++t)Ut(r[t]);else Ut(r)}var nl=ss;function nt(){throw new Error("Unimplemented abstract method.")}var wp=0;function H(r){return r.ol_uid||(r.ol_uid=String(++wp))}var rl=class extends wt{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}},bh=class extends nl{constructor(t){super(),this.on,this.once,this.un,H(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 rl(i,t,e)),i=Qa.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new rl(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){let n=this.values_||(this.values_={});if(i)n[t]=e;else{let s=n[t];n[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],wi(this.values_)&&(this.values_=null),e||this.notify(t,i)}}},Qt=bh;var Jt={ADD:"add",REMOVE:"remove"};var Gf={LENGTH:"length"},os=class extends wt{constructor(t,e,i){super(t),this.element=e,this.index=i}},Ah=class extends Qt{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,n=this.array_.length;i<n;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){let e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(Gf.LENGTH)}insertAt(t,e){if(t<0||t>this.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 os(Jt.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,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;let e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new os(Jt.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 n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new os(Jt.REMOVE,n,t)),this.dispatchEvent(new os(Jt.ADD,e,t))}updateLength_(){this.set(Gf.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}},Ke=Ah;var Bf={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"};var Yn=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Gy=Yn.includes("firefox"),Rp=Yn.includes("safari")&&!Yn.includes("chrom"),By=Rp&&(Yn.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Yn)),Yy=Yn.includes("webkit")&&!Yn.includes("edge"),Xy=Yn.includes("macintosh");var as=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Yf=typeof Image<"u"&&Image.prototype.decode;var zy=function(){let r=!1;try{let t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r}();function te(r,t,e,i){let n;return e&&e.length?n=e.shift():as?n=new OffscreenCanvas(r||300,t||300):n=document.createElement("canvas"),r&&(n.width=r),t&&(n.height=t),n.getContext("2d",i)}function Xf(r){let t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}function Oh(r){return r&&r.parentNode?r.parentNode.removeChild(r):null}var Dh=class extends Qt{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(){Oh(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&Oh(this.element);for(let e=0,i=this.listenerKeys.length;e<i;++e)Ut(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Si&&this.listenerKeys.push(Mt(t,Bf.POSTRENDER,this.render,this)),t.render())}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}},sl=Dh;var Fh=class extends sl{constructor(t,e,i){let n=document.createElement("div");n.setAttribute("id","ole-toolbar"),super({element:i||n}),this.controls=e,this.map=t,i||this.map.getTargetElement().appendChild(this.element),this.load(),this.controls.on("change:length",this.load.bind(this))}load(){for(let t=0;t<this.controls.getLength();t+=1){let e=this.controls.item(t).getElement();this.element&&e&&this.element.appendChild(e)}}destroy(){for(let t=0;t<this.controls.getLength();t+=1){let e=this.controls.item(t).getElement();this.element&&e&&this.element.removeChild(e)}}},al=Fh;var kh=class{constructor(t,e){this.map=t,this.controls=new Ke,this.activeControls=new Ke,this.services=new Ke,this.options=e||{},this.editFeature=null,typeof this.options.showToolbar>"u"&&(this.options.showToolbar=!0),this.options.showToolbar&&(this.toolbar=new al(this.map,this.controls,this.options.target)),this.activeStateChange=this.activeStateChange.bind(this)}addControl(t){t.setMap(this.map),t.setEditor(this),t.addEventListener("change:active",this.activeStateChange),this.controls.push(t)}removeControl(t){t.deactivate(),this.controls.remove(t),t.removeEventListener("change:active",this.activeStateChange),t.setEditor(),t.setMap()}addService(t){t.setMap(this.map),t.setEditor(this),t.activate(),this.services.push(t)}addControls(t){let e=t instanceof Ke?t:new Ke(t);for(let i=0;i<e.getLength();i+=1)this.addControl(e.item(i))}remove(){[...this.controls.getArray()].forEach(e=>{this.removeControl(e)}),this.toolbar&&this.toolbar.destroy()}getControls(){return this.controls}getActiveControls(){return this.activeControls}setEditFeature(t){this.editFeature=t}getEditFeature(){return this.editFeature}setDrawFeature(t){this.drawFeature=t}getDrawFeature(){return this.drawFeature}activeStateChange(t){let e=t.detail.control;if(e.getActive()&&e.standalone)for(let i=0;i<this.controls.getLength();i+=1){let n=this.controls.item(i);n!==e&&n.getActive()&&n.standalone&&(n.deactivate(),this.activeControls.remove(n))}e.getActive()?this.activeControls.push(e):this.activeControls.remove(e)}},zf=kh;var _f={};io(_f,{Buffer:()=>Qm,CAD:()=>km,Control:()=>De,Difference:()=>sp,Draw:()=>qm,Intersection:()=>np,Modify:()=>$m,Rotate:()=>Ym,Toolbar:()=>al,Union:()=>ep});var Jf=$a(Yh(),1);var qt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function pe(r){let t=_e();for(let e=0,i=r.length;e<i;++e)Xh(t,r[e]);return t}function Tp(r,t,e){let i=Math.min.apply(null,r),n=Math.min.apply(null,t),s=Math.max.apply(null,r),o=Math.max.apply(null,t);return Ri(i,n,s,o,e)}function Hi(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function Uf(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function Pe(r,t,e){let i,n;return t<r[0]?i=r[0]-t:r[2]<t?i=t-r[2]:i=0,e<r[1]?n=r[1]-e:r[3]<e?n=e-r[3]:n=0,i*i+n*n}function qf(r,t){return no(r,t[0],t[1])}function dn(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function no(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function ll(r,t){let e=r[0],i=r[1],n=r[2],s=r[3],o=t[0],a=t[1],l=qt.UNKNOWN;return o<e?l=l|qt.LEFT:o>n&&(l=l|qt.RIGHT),a<i?l=l|qt.BELOW:a>s&&(l=l|qt.ABOVE),l===qt.UNKNOWN&&(l=qt.INTERSECTING),l}function _e(){return[1/0,1/0,-1/0,-1/0]}function Ri(r,t,e,i,n){return n?(n[0]=r,n[1]=t,n[2]=e,n[3]=i,n):[r,t,e,i]}function ls(r){return Ri(1/0,1/0,-1/0,-1/0,r)}function Xn(r,t){let e=r[0],i=r[1];return Ri(e,i,e,i,t)}function hs(r,t,e,i,n){let s=ls(n);return zh(s,r,t,e,i)}function hl(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Vf(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function Xh(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function zh(r,t,e,i,n){for(;e<i;e+=n)Lp(r,t[e],t[e+1]);return r}function Lp(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function ul(r,t){let e;return e=t(cl(r)),e||(e=t(fl(r)),e)||(e=t(dl(r)),e)||(e=t(gl(r)),e)?e:!1}function cl(r){return[r[0],r[1]]}function fl(r){return[r[2],r[1]]}function be(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function Wf(r,t,e,i,n){let[s,o,a,l,h,u,c,f]=vp(r,t,e,i);return Ri(Math.min(s,a,h,c),Math.min(o,l,u,f),Math.max(s,a,h,c),Math.max(o,l,u,f),n)}function vp(r,t,e,i){let n=t*i[0]/2,s=t*i[1]/2,o=Math.cos(e),a=Math.sin(e),l=n*o,h=n*a,u=s*o,c=s*a,f=r[0],g=r[1];return[f-l+c,g-h-u,f-l-c,g-h+u,f+l-c,g+h+u,f+l+c,g+h-u,f-l+c,g-h-u]}function Ti(r){return r[3]-r[1]}function gl(r){return[r[0],r[3]]}function dl(r){return[r[2],r[3]]}function le(r){return r[2]-r[0]}function Vt(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function ro(r){return r[2]<r[0]||r[3]<r[1]}function jf(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function Hf(r,t,e){let i=!1,n=ll(r,t),s=ll(r,e);if(n===qt.INTERSECTING||s===qt.INTERSECTING)i=!0;else{let o=r[0],a=r[1],l=r[2],h=r[3],u=t[0],c=t[1],f=e[0],g=e[1],p=(g-c)/(f-u),y,d;s&qt.ABOVE&&!(n&qt.ABOVE)&&(y=f-(g-h)/p,i=y>=o&&y<=l),!i&&s&qt.RIGHT&&!(n&qt.RIGHT)&&(d=g-(f-l)*p,i=d>=a&&d<=h),!i&&s&qt.BELOW&&!(n&qt.BELOW)&&(y=f-(g-a)/p,i=y>=o&&y<=l),!i&&s&qt.LEFT&&!(n&qt.LEFT)&&(d=g-(f-o)*p,i=d>=a&&d<=h)}return i}function Zf(r,t,e,i){if(ro(r))return ls(e);let n=[];if(i>1){let a=r[2]-r[0],l=r[3]-r[1];for(let h=0;h<i;++h)n.push(r[0]+a*h/i,r[1],r[2],r[1]+l*h/i,r[2]-a*h/i,r[3],r[0],r[3]-l*h/i)}else n=[r[0],r[1],r[2],r[1],r[2],r[3],r[0],r[3]];t(n,n,2);let s=[],o=[];for(let a=0,l=n.length;a<l;a+=2)s.push(n[a]),o.push(n[a+1]);return Tp(s,o,e)}function Uh(r,t){let e=t.getExtent(),i=be(r);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){let n=le(e),o=Math.floor((i[0]-e[0])/n)*n;r[0]-=o,r[2]-=o}return r}function Kf(r,t){if(t.canWrapX()){let e=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[e[0],r[1],e[2],r[3]]];Uh(r,t);let i=le(e);if(le(r)>i)return[[e[0],r[1],e[2],r[3]]];if(r[0]<e[0])return[[r[0]+i,r[1],e[2],r[3]],[e[0],r[1],r[2],r[3]]];if(r[2]>e[2])return[[r[0],r[1],e[2],r[3]],[e[0],r[1],r[2]-i,r[3]]]}return[r]}var qh=class{constructor(t){this.rbush_=new Jf.default(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_[H(e)]=i}load(t,e){let i=new Array(e.length);for(let n=0,s=e.length;n<s;n++){let o=t[n],a=e[n],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[n]=l,this.items_[H(a)]=l}this.rbush_.load(i)}remove(t){let e=H(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){let i=this.items_[H(e)],n=[i.minX,i.minY,i.maxX,i.maxY];hl(n,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){let e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(n){return n.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,s=t.length;n<s;n++)if(i=e(t[n]),i)return i;return i}isEmpty(){return wi(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){let e=this.rbush_.toJSON();return Ri(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(let e in t.items_)this.items_[e]=t.items_[e]}},gr=qh;function St(r,t){if(!r)throw new Error(t)}var Vh=class r extends Qt{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 r(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_&&(Ut(this.geometryChangeKey_),this.geometryChangeKey_=null);let t=this.getGeometry();t&&(this.geometryChangeKey_=Mt(t,lt.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Np(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}};function Np(r){if(typeof r=="function")return r;let t;return Array.isArray(r)?t=r:(St(typeof r.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[r]),function(){return t}}var Wt=Vh;var yx=new Array(6);function Ie(){return[1,0,0,1,0,0]}function Mp(r,t,e,i,n,s,o){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r[4]=s,r[5]=o,r}function Qf(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function he(r,t){let e=t[0],i=t[1];return t[0]=r[0]*e+r[2]*i+r[4],t[1]=r[1]*e+r[3]*i+r[5],t}function tg(r,t,e){return Mp(r,t,0,0,e,0,0)}function hi(r,t,e,i,n,s,o,a){let l=Math.sin(s),h=Math.cos(s);return r[0]=i*h,r[1]=n*l,r[2]=-i*l,r[3]=n*h,r[4]=o*i*h-a*i*l+t,r[5]=o*n*l+a*n*h+e,r}function eg(r,t){let e=Pp(t);St(e!==0,"Transformation matrix cannot be inverted");let i=t[0],n=t[1],s=t[2],o=t[3],a=t[4],l=t[5];return r[0]=o/e,r[1]=-n/e,r[2]=-s/e,r[3]=i/e,r[4]=(s*l-o*a)/e,r[5]=-(i*l-n*a)/e,r}function Pp(r){return r[0]*r[3]-r[1]*r[2]}var $f;function ig(r){let t="matrix("+r.join(", ")+")";if(as)return t;let e=$f||($f=document.createElement("div"));return e.style.transform=t,e.style.transform}var so={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};var Wh=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_||so[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_}},ml=Wh;var oo=6378137,us=Math.PI*oo,bp=[-us,-us,us,us],Ap=[-180,-85,180,85],pl=oo*Math.log(Math.tan(Math.PI/2)),zn=class extends ml{constructor(t){super({code:t,units:"m",extent:bp,global:!0,worldExtent:Ap,getPointResolution:function(e,i){return e/Math.cosh(i[1]/oo)}})}},jh=[new zn("EPSG:3857"),new zn("EPSG:102100"),new zn("EPSG:102113"),new zn("EPSG:900913"),new zn("http://www.opengis.net/def/crs/EPSG/0/3857"),new zn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function ng(r,t,e){let i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e){t[n]=us*r[n]/180;let s=oo*Math.log(Math.tan(Math.PI*(+r[n+1]+90)/360));s>pl?s=pl:s<-pl&&(s=-pl),t[n+1]=s}return t}function rg(r,t,e){let i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e)t[n]=180*r[n]/us,t[n+1]=360*Math.atan(Math.exp(r[n+1]/oo))/Math.PI-90;return t}var Op=6378137,sg=[-180,-90,180,90],Dp=Math.PI*Op/180,mn=class extends ml{constructor(t,e){super({code:t,units:"degrees",extent:sg,axisOrientation:e,global:!0,metersPerUnit:Dp,worldExtent:sg})}},Hh=[new mn("CRS:84"),new mn("EPSG:4326","neu"),new mn("urn:ogc:def:crs:OGC:1.3:CRS84"),new mn("urn:ogc:def:crs:OGC:2:84"),new mn("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new mn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new mn("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];var Zh={};function og(r){return Zh[r]||Zh[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function ag(r,t){Zh[r]=t}var cs={};function ao(r,t,e){let i=r.getCode(),n=t.getCode();i in cs||(cs[i]={}),cs[i][n]=e}function lg(r,t){let e;return r in cs&&t in cs[r]&&(e=cs[r][t]),e}function Lt(r,t,e){return Math.min(Math.max(r,t),e)}function hg(r,t,e,i,n,s){let o=n-e,a=s-i;if(o!==0||a!==0){let l=((r-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=n,i=s):l>0&&(e+=o*l,i+=a*l)}return Ae(r,t,e,i)}function Ae(r,t,e,i){let n=e-r,s=i-t;return n*n+s*s}function ug(r){return r*Math.PI/180}function lo(r,t){let e=r%t;return e*t<0?e+t:e}function ue(r,t,e){return r+e*(t-r)}function _l(r,t){let e=Math.pow(10,t);return Math.round(r*e)/e}function cg(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function fg(r,t){let e=t.getRadius(),i=t.getCenter(),n=i[0],s=i[1],o=r[0],a=r[1],l=o-n,h=a-s;l===0&&h===0&&(l=1);let u=Math.sqrt(l*l+h*h),c=n+e*l/u,f=s+e*h/u;return[c,f]}function ho(r,t){let e=r[0],i=r[1],n=t[0],s=t[1],o=n[0],a=n[1],l=s[0],h=s[1],u=l-o,c=h-a,f=u===0&&c===0?0:(u*(e-o)+c*(i-a))/(u*u+c*c||0),g,p;return f<=0?(g=o,p=a):f>=1?(g=l,p=h):(g=o+f*u,p=a+f*c),[g,p]}function Ce(r,t){let e=!0;for(let i=r.length-1;i>=0;--i)if(r[i]!=t[i]){e=!1;break}return e}function gg(r,t){let e=Math.cos(t),i=Math.sin(t),n=r[0]*e-r[1]*i,s=r[1]*e+r[0]*i;return r[0]=n,r[1]=s,r}function ui(r,t){let e=r[0]-t[0],i=r[1]-t[1];return e*e+i*i}function fs(r,t){return Math.sqrt(ui(r,t))}function dg(r,t){return ui(r,ho(r,t))}function mg(r,t){if(t.canWrapX()){let e=le(t.getExtent()),i=pg(r,t,e);i&&(r[0]-=i*e)}return r}function pg(r,t,e){let i=t.getExtent(),n=0;return t.canWrapX()&&(r[0]<i[0]||r[0]>i[2])&&(e=e||le(i),n=Math.floor((r[0]-i[0])/e)),n}var _g={info:1,warn:2,error:3,none:4},Fp=_g.info;function yg(...r){Fp>_g.warn||console.warn(...r)}var Kh=!0;function Eg(r){Kh=!(r===void 0?!0:r)}function Ig(r,t){if(t!==void 0){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];t=t}else t=r.slice();return t}function kp(r,t){if(t!==void 0&&r!==t){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];r=t}return r}function Gp(r){ag(r.getCode(),r),ao(r,r,Ig)}function Bp(r){r.forEach(Gp)}function Li(r){return typeof r=="string"?og(r):r||null}function xg(r){Bp(r),r.forEach(function(t){r.forEach(function(e){t!==e&&ao(t,e,Ig)})})}function Yp(r,t,e,i){r.forEach(function(n){t.forEach(function(s){ao(n,s,e),ao(s,n,i)})})}function yl(r,t){return r?typeof r=="string"?Li(r):r:Li(t)}function Jh(r,t){let e=r.getCode(),i=t.getCode(),n=lg(e,i);return n||(n=kp),n}function uo(r,t){let e=Li(r),i=Li(t);return Jh(e,i)}function Cg(r,t,e){return uo(t,e)(r,void 0,r.length)}function Sg(r,t,e,i){let n=uo(t,e);return Zf(r,n,void 0,i)}var vi=null;function Se(){return vi}function pn(r,t){return vi?Cg(r,t,vi):r}function xt(r,t){return vi?Cg(r,vi,t):(Kh&&!Ce(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(Kh=!1,yg("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r)}function Zi(r,t){return vi?Sg(r,t,vi):r}function Ki(r,t){return vi?Sg(r,vi,t):r}function wg(r,t){if(!vi)return r;let e=Li(t).getMetersPerUnit(),i=vi.getMetersPerUnit();return e&&i?r*e/i:r}function Xp(){xg(jh),xg(Hh),Yp(Hh,jh,ng,rg)}Xp();function Oe(r,t,e,i,n,s){s=s||[];let o=0;for(let a=t;a<e;a+=i){let l=r[a],h=r[a+1];s[o++]=n[0]*l+n[2]*h+n[4],s[o++]=n[1]*l+n[3]*h+n[5]}return s&&s.length!=o&&(s.length=o),s}function gs(r,t,e,i,n,s,o){o=o||[];let a=Math.cos(n),l=Math.sin(n),h=s[0],u=s[1],c=0;for(let f=t;f<e;f+=i){let g=r[f]-h,p=r[f+1]-u;o[c++]=h+g*a-p*l,o[c++]=u+g*l+p*a;for(let y=f+2;y<f+i;++y)o[c++]=r[y]}return o&&o.length!=c&&(o.length=c),o}function Rg(r,t,e,i,n,s,o,a){a=a||[];let l=o[0],h=o[1],u=0;for(let c=t;c<e;c+=i){let f=r[c]-l,g=r[c+1]-h;a[u++]=l+n*f,a[u++]=h+s*g;for(let p=c+2;p<c+i;++p)a[u++]=r[p]}return a&&a.length!=u&&(a.length=u),a}function Tg(r,t,e,i,n,s,o){o=o||[];let a=0;for(let l=t;l<e;l+=i){o[a++]=r[l]+n,o[a++]=r[l+1]+s;for(let h=l+2;h<l+i;++h)o[a++]=r[h]}return o&&o.length!=a&&(o.length=a),o}var Lg=Ie(),$h=class extends Qt{constructor(){super(),this.extent_=_e(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=el((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);let n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return nt()}closestPointXY(t,e,i,n){return nt()}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 nt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ls(e),this.extentRevision_=this.getRevision()}return jf(this.extent_,t)}rotate(t,e){nt()}scale(t,e,i){nt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return nt()}getType(){return nt()}applyTransform(t){nt()}intersectsExtent(t){return nt()}translate(t,e){nt()}transform(t,e){let i=Li(t),n=i.getUnits()=="tile-pixels"?function(s,o,a){let l=i.getExtent(),h=i.getWorldExtent(),u=Ti(h)/Ti(l);return hi(Lg,h[0],h[3],u,-u,0,0,0),Oe(s,0,s.length,a,Lg,o),uo(i,e)(s,o,a)}:uo(i,e);return this.applyTransform(n),this}},xl=$h;var Qh=class extends xl{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return hs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return nt()}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().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=co(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){nt()}setLayout(t,e,i){let n;if(t)n=co(t);else{for(let s=0;s<i;++s){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}n=e.length,t=zp(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){let i=this.getFlatCoordinates();if(i){let n=this.getStride();gs(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=be(this.getExtent()));let n=this.getFlatCoordinates();if(n){let s=this.getStride();Rg(n,0,n.length,s,t,e,i,n),this.changed()}}translate(t,e){let i=this.getFlatCoordinates();if(i){let n=this.getStride();Tg(i,0,i.length,n,t,e,i),this.changed()}}};function zp(r){let t;return r==2?t="XY":r==3?t="XYZ":r==4&&(t="XYZM"),t}function co(r){let t;return r=="XY"?t=2:r=="XYZ"||r=="XYM"?t=3:r=="XYZM"&&(t=4),t}function vg(r,t,e){let i=r.getFlatCoordinates();if(!i)return null;let n=r.getStride();return Oe(i,0,i.length,n,t,e)}var ye=Qh;function El(r,t,e,i){for(let n=0,s=e.length;n<s;++n)r[t++]=e[n];return t}function dr(r,t,e,i){for(let n=0,s=e.length;n<s;++n){let o=e[n];for(let a=0;a<i;++a)r[t++]=o[a]}return t}function fo(r,t,e,i,n){n=n||[];let s=0;for(let o=0,a=e.length;o<a;++o){let l=dr(r,t,e[o],i);n[s++]=l,t=l}return n.length=s,n}function Ng(r,t,e,i,n){n=n||[];let s=0;for(let o=0,a=e.length;o<a;++o){let l=fo(r,t,e[o],i,n[s]);l.length===0&&(l[0]=t),n[s++]=l,t=l[l.length-1]}return n.length=s,n}var Il=class r extends ye{constructor(t,e,i){super(),i!==void 0&&e===void 0?this.setFlatCoordinates(i,t):(e=e||0,this.setCenterAndRadius(t,e,i))}clone(){let t=new r(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){let s=this.flatCoordinates,o=t-s[0],a=e-s[1],l=o*o+a*a;if(l<n){if(l===0)for(let h=0;h<this.stride;++h)i[h]=s[h];else{let h=this.getRadius()/Math.sqrt(l);i[0]=s[0]+h*o,i[1]=s[1]+h*a;for(let u=2;u<this.stride;++u)i[u]=s[u]}return i.length=this.stride,l}return n}containsXY(t,e){let i=this.flatCoordinates,n=t-i[0],s=e-i[1];return n*n+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(t){let e=this.flatCoordinates,i=e[this.stride]-e[0];return Ri(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e}getType(){return"Circle"}intersectsExtent(t){let e=this.getExtent();if(Vt(t,e)){let i=this.getCenter();return t[0]<=i[0]&&t[2]>=i[0]||t[1]<=i[1]&&t[3]>=i[1]?!0:ul(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){let e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(let s=1;s<e;++s)n[e+s]=t[s];this.setFlatCoordinates(this.layout,n),this.changed()}setCenterAndRadius(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);let n=this.flatCoordinates,s=El(n,0,t,this.stride);n[s++]=n[0]+e;for(let o=1,a=this.stride;o<a;++o)n[s++]=n[o];n.length=s,this.changed()}getCoordinates(){return null}setCoordinates(t,e){}setRadius(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()}rotate(t,e){let i=this.getCenter(),n=this.getStride();this.setCenter(gs(i,0,i.length,n,t,e,i)),this.changed()}};Il.prototype.transform;var mr=Il;var tu=class r extends xl{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Ut),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Mt(this.geometries_[t],lt.CHANGE,this.changed,this))}clone(){let t=new r(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Pe(this.getExtent(),t,e))return n;let s=this.geometries_;for(let o=0,a=s.length;o<a;++o)n=s[o].closestPointXY(t,e,i,n);return n}containsXY(t,e){let i=this.geometries_;for(let n=0,s=i.length;n<s;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){ls(t);let e=this.geometries_;for(let i=0,n=e.length;i<n;++i)Vf(t,e[i].getExtent());return t}getGeometries(){return Mg(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[],e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let e=[],i=this.geometries_,n=!1;for(let s=0,o=i.length;s<o;++s){let a=i[s],l=a.getSimplifiedGeometry(t);e.push(l),l!==a&&(n=!0)}if(n){let s=new r(null);return s.setGeometriesArray(e),s}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){let e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){let i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=be(this.getExtent()));let n=this.geometries_;for(let s=0,o=n.length;s<o;++s)n[s].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Mg(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){let e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){let i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function Mg(r){let t=[];for(let e=0,i=r.length;e<i;++e)t.push(r[e].clone());return t}var Cl=tu;function Pg(r,t,e,i,n,s,o){let a=r[t],l=r[t+1],h=r[e]-a,u=r[e+1]-l,c;if(h===0&&u===0)c=t;else{let f=((n-a)*h+(s-l)*u)/(h*h+u*u);if(f>1)c=e;else if(f>0){for(let g=0;g<i;++g)o[g]=ue(r[t+g],r[e+g],f);o.length=i;return}else c=t}for(let f=0;f<i;++f)o[f]=r[c+f];o.length=i}function go(r,t,e,i,n){let s=r[t],o=r[t+1];for(t+=i;t<e;t+=i){let a=r[t],l=r[t+1],h=Ae(s,o,a,l);h>n&&(n=h),s=a,o=l}return n}function mo(r,t,e,i,n){for(let s=0,o=e.length;s<o;++s){let a=e[s];n=go(r,t,a,i,n),t=a}return n}function bg(r,t,e,i,n){for(let s=0,o=e.length;s<o;++s){let a=e[s];n=mo(r,t,a,i,n),t=a[a.length-1]}return n}function po(r,t,e,i,n,s,o,a,l,h,u){if(t==e)return h;let c,f;if(n===0){if(f=Ae(o,a,r[t],r[t+1]),f<h){for(c=0;c<i;++c)l[c]=r[t+c];return l.length=i,f}return h}u=u||[NaN,NaN];let g=t+i;for(;g<e;)if(Pg(r,g-i,g,i,o,a,u),f=Ae(o,a,u[0],u[1]),f<h){for(h=f,c=0;c<i;++c)l[c]=u[c];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(f)-Math.sqrt(h))/n|0,1);if(s&&(Pg(r,e-i,t,i,o,a,u),f=Ae(o,a,u[0],u[1]),f<h)){for(h=f,c=0;c<i;++c)l[c]=u[c];l.length=i}return h}function _o(r,t,e,i,n,s,o,a,l,h,u){u=u||[NaN,NaN];for(let c=0,f=e.length;c<f;++c){let g=e[c];h=po(r,t,g,i,n,s,o,a,l,h,u),t=g}return h}function Ag(r,t,e,i,n,s,o,a,l,h,u){u=u||[NaN,NaN];for(let c=0,f=e.length;c<f;++c){let g=e[c];h=_o(r,t,g,i,n,s,o,a,l,h,u),t=g[g.length-1]}return h}function pr(r,t,e,i,n,s,o){let a=(e-t)/i;if(a<3){for(;t<e;t+=i)s[o++]=r[t],s[o++]=r[t+1];return o}let l=new Array(a);l[0]=1,l[a-1]=1;let h=[t,e-i],u=0;for(;h.length>0;){let c=h.pop(),f=h.pop(),g=0,p=r[f],y=r[f+1],d=r[c],m=r[c+1];for(let x=f+i;x<c;x+=i){let I=r[x],S=r[x+1],w=hg(I,S,p,y,d,m);w>g&&(u=x,g=w)}g>n&&(l[(u-t)/i]=1,f+i<u&&h.push(f,u),u+i<c&&h.push(u,c))}for(let c=0;c<a;++c)l[c]&&(s[o++]=r[t+c*i],s[o++]=r[t+c*i+1]);return o}function Sl(r,t,e,i,n,s,o,a){for(let l=0,h=e.length;l<h;++l){let u=e[l];o=pr(r,t,u,i,n,s,o),a.push(o),t=u}return o}function Un(r,t){return t*Math.round(r/t)}function Up(r,t,e,i,n,s,o){if(t==e)return o;let a=Un(r[t],n),l=Un(r[t+1],n);t+=i,s[o++]=a,s[o++]=l;let h,u;do if(h=Un(r[t],n),u=Un(r[t+1],n),t+=i,t==e)return s[o++]=h,s[o++]=u,o;while(h==a&&u==l);for(;t<e;){let c=Un(r[t],n),f=Un(r[t+1],n);if(t+=i,c==h&&f==u)continue;let g=h-a,p=u-l,y=c-a,d=f-l;if(g*d==p*y&&(g<0&&y<g||g==y||g>0&&y>g)&&(p<0&&d<p||p==d||p>0&&d>p)){h=c,u=f;continue}s[o++]=h,s[o++]=u,a=h,l=u,h=c,u=f}return s[o++]=h,s[o++]=u,o}function yo(r,t,e,i,n,s,o,a){for(let l=0,h=e.length;l<h;++l){let u=e[l];o=Up(r,t,u,i,n,s,o),a.push(o),t=u}return o}function Og(r,t,e,i,n,s,o,a){for(let l=0,h=e.length;l<h;++l){let u=e[l],c=[];o=yo(r,t,u,i,n,s,o,c),a.push(c),t=u[u.length-1]}return o}function ci(r,t,e,i,n){n=n!==void 0?n:[];let s=0;for(let o=t;o<e;o+=i)n[s++]=r.slice(o,o+i);return n.length=s,n}function qn(r,t,e,i,n){n=n!==void 0?n:[];let s=0;for(let o=0,a=e.length;o<a;++o){let l=e[o];n[s++]=ci(r,t,l,i,n[s]),t=l}return n.length=s,n}function xo(r,t,e,i,n){n=n!==void 0?n:[];let s=0;for(let o=0,a=e.length;o<a;++o){let l=e[o];n[s++]=l.length===1&&l[0]===t?[]:qn(r,t,l,i,n[s]),t=l[l.length-1]}return n.length=s,n}function eu(r,t,e,i){let n=0,s=r[e-i],o=r[e-i+1];for(;t<e;t+=i){let a=r[t],l=r[t+1];n+=o*a-s*l,s=a,o=l}return n/2}function iu(r,t,e,i){let n=0;for(let s=0,o=e.length;s<o;++s){let a=e[s];n+=eu(r,t,a,i),t=a}return n}function Dg(r,t,e,i){let n=0;for(let s=0,o=e.length;s<o;++s){let a=e[s];n+=iu(r,t,a,i),t=a[a.length-1]}return n}var nu=class r extends ye{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 r(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Pe(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(go(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),po(this.flatCoordinates,0,this.flatCoordinat