xgis-ol
Version:
基于openlayers + ol-ext库进行封装
1 lines • 1.04 MB
JavaScript
import{Fragment as t,Teleport as e,Transition as i,computed as n,createBlock as r,createCommentVNode as s,createElementBlock as o,createElementVNode as a,createVNode as l,defineComponent as h,getCurrentInstance as c,h as u,inject as d,markRaw as p,nextTick as g,normalizeStyle as f,onActivated as m,onBeforeUnmount as y,onBeforeUpdate as v,onDeactivated as _,onMounted as x,onUnmounted as w,openBlock as b,reactive as S,ref as M,renderList as E,renderSlot as C,resolveComponent as T,toDisplayString as k,toRaw as P,unref as L,vShow as I,watch as R,withCtx as A,withDirectives as F,withKeys as z,withModifiers as O}from"vue";import{Icon as G,addCollection as D}from"@iconify/vue";var N="add",j="remove",q="propertychange";function B(t){for(const e in t)delete t[e]}function V(t){let e;for(e in t)return!1;return!e}function $(t,e,i,n,r){if(r){const r=i;i=function(s){return t.removeEventListener(e,i),r.call(n??this,s)}}else n&&n!==t&&(i=i.bind(n));const s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function U(t,e,i,n){return $(t,e,i,n,!0)}function W(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),B(t))}var H="change",X="error",K="contextmenu",Z="click",Y="keydown",J="keypress",Q="touchmove",tt="wheel",et=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function it(t,e){return t>e?1:t<e?-1:0}function nt(t,e){return t<e?1:t>e?-1:0}function rt(t,e,i){if(t[0]<=e)return 0;const n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let r=1;r<n;++r){const n=t[r];if(n===e)return r;if(n<e)return i(e,t[r-1],n)>0?r-1:r}return n-1}if(i>0){for(let i=1;i<n;++i)if(t[i]<e)return i-1;return n-1}if(i<0){for(let i=1;i<n;++i)if(t[i]<=e)return i;return n-1}for(let r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return n-1}function st(t,e,i){for(;e<i;){const n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function ot(t,e){const i=Array.isArray(e)?e:[e],n=i.length;for(let r=0;r<n;r++)t[t.length]=i[r]}function at(t,e){const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function lt(){return!0}function ht(){return!1}function ct(){}function ut(t){let e,i,n;return function(){const r=Array.prototype.slice.call(arguments);return i&&this===n&&at(r,i)||(n=this,i=r,e=t.apply(this,arguments)),e}}function dt(t){return function(){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}()}var pt=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},gt=class extends et{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e="string"==typeof t,i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const r=e?new pt(t):t;r.target||(r.target=this.eventTarget_||this);const s=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});let a;i in s||(s[i]=0,o[i]=0),++s[i];for(let l=0,h=n.length;l<h;++l)if(a="handleEvent"in n[l]?n[l].handleEvent(r):n[l].call(this,r),!1===a||r.propagationStopped){a=!1;break}if(0==--s[i]){let t=o[i];for(delete o[i];t--;)this.removeEventListener(i,ct);delete s[i]}return a}disposeInternal(){this.listeners_&&B(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)}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=ct,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},ft=class extends gt{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(H)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=$(this,t[r],e);return n}return $(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let r=0;r<n;++r)i[r]=U(this,t[r],e)}else i=U(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)mt(i);else if(Array.isArray(t))for(let n=0,r=t.length;n<r;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}};function mt(t){if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)W(t[e]);else W(t)}function yt(){throw new Error("Unimplemented abstract method.")}ft.prototype.on,ft.prototype.once,ft.prototype.un;var vt=0;function _t(t){return t.ol_uid||(t.ol_uid=String(++vt))}var xt=class extends pt{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}},wt=class extends ft{constructor(t){super(),this.on,this.once,this.un,_t(this),this.values_=null,void 0!==t&&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 xt(i,t,e)),i=q,this.hasListener(i)&&this.dispatchEvent(new xt(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],V(this.values_)&&(this.values_=null),e||this.notify(t,i)}}},bt="length",St=class extends pt{constructor(t,e,i){super(t),this.element=e,this.index=i}},Mt=class extends wt{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=1,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){const 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(bt)}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 St(N,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const 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;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new St(j,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new St(j,i,t)),this.dispatchEvent(new St(N,e,t))}updateLength_(){this.set(bt,this.array_.length)}assertUnique_(t,e){const i=this.array_;for(let n=0,r=i.length;n<r;++n)if(i[n]===t&&n!==e)throw new Error("Duplicate item added to a unique collection")}},Et=class extends pt{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}},Ct=class extends Et{constructor(t,e,i,n,r,s){super(t,e,r),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==n&&n,this.activePointers=s}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}},Tt={SINGLECLICK:"singleclick",CLICK:Z,DBLCLICK:"dblclick",POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},kt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Pt=(kt.includes("safari")&&!kt.includes("chrom")&&(kt.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(kt)),kt.includes("webkit")&&!kt.includes("edge")),Lt=kt.includes("macintosh"),It="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Rt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,At="undefined"!=typeof Image&&Image.prototype.decode,Ft="function"==typeof createImageBitmap,zt=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}(),Ot="pointerdown",Gt=class extends gt{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=$(i,Ot,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=$(i,"pointermove",this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(Q,this.boundHandleTouchMove_,!!zt&&{passive:!1})}emulateClick_(t){let e=new Ct(Tt.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Ct(Tt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout((()=>{this.clickTimeoutId_=void 0;const e=new Ct(Tt.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}),250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==Tt.POINTERUP||e.type==Tt.POINTERCANCEL){delete this.trackedTouches_[i];for(const t in this.trackedTouches_)if(this.trackedTouches_[t].target!==e.target){delete this.trackedTouches_[t];break}}else e.type!=Tt.POINTERDOWN&&e.type!=Tt.POINTERMOVE||(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Ct(Tt.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_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(W),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);const e=new Ct(Tt.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}),0===this.dragListenerKeys_.length){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push($(t,Tt.POINTERMOVE,this.handlePointerMove_,this),$(t,Tt.POINTERUP,this.handlePointerUp_,this),$(this.element_,Tt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push($(this.element_.getRootNode(),Tt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Ct(Tt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Ct(Tt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||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_&&(W(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Q,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(W(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(W),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},Dt="postrender",Nt="loadstart",jt="loadend",qt="layergroup",Bt="size",Vt="target",$t="view";function Ut(t,e){if(!t)throw new Error(e)}var Wt=1/0,Ht=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,B(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){Ut(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+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 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,r=e[t],s=i[t],o=t;for(;t<n>>1;){const r=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),o=s<n&&i[s]<i[r]?s:r;e[t]=e[o],i[t]=i[o],t=o}e[t]=r,i[t]=s,this.siftDown_(o,t)}siftDown_(t,e){const i=this.elements_,n=this.priorities_,r=i[e],s=n[e];for(;e>t;){const t=this.getParentIndex_(e);if(!(n[t]>s))break;i[e]=i[t],n[e]=n[t],e=t}i[e]=r,n[e]=s}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const r=e.length;let s,o,a;for(o=0;o<r;++o)s=e[o],a=t(s),a==1/0?delete this.queuedElements_[this.keyFunction_(s)]:(i[n]=a,e[n++]=s);e.length=n,i.length=n,this.heapify_()}},Xt=class extends Ht{constructor(t,e){super((e=>t.apply(null,e)),(t=>t[0].getKey())),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(H,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(2===i||3===i||4===i){3!==i&&e.removeEventListener(H,this.boundHandleTileChange_);const t=e.getKey();t in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[t],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;){const t=this.dequeue()[0],e=t.getKey();0!==t.getState()||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++i,t.load())}}},Kt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Zt(t,e,i){return Math.min(Math.max(t,e),i)}function Yt(t,e,i,n,r,s){const o=r-i,a=s-n;if(0!==o||0!==a){const l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return Jt(t,e,i,n)}function Jt(t,e,i,n){const r=i-t,s=n-e;return r*r+s*s}function Qt(t){return 180*t/Math.PI}function te(t){return t*Math.PI/180}function ee(t,e){const i=t%e;return i*e<0?i+e:i}function ie(t,e,i){return t+i*(e-t)}function ne(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function re(t,e){return Math.round(ne(t,e))}function se(t,e){return Math.floor(ne(t,e))}function oe(t,e){return Math.ceil(ne(t,e))}function ae(t,e,i){if(t>=e&&t<i)return t;const n=i-e;return((t-e)%n+n)%n+e}function le(t,e,i){return function(n,r,s,o,a){if(!n)return;if(!r&&!e)return n;const l=e?0:s[0]*r,h=e?0:s[1]*r,c=a?a[0]:0,u=a?a[1]:0;let d=t[0]+l/2+c,p=t[2]-l/2+c,g=t[1]+h/2+u,f=t[3]-h/2+u;d>p&&(d=(p+d)/2,p=d),g>f&&(g=(f+g)/2,f=g);let m=Zt(n[0],d,p),y=Zt(n[1],g,f);if(o&&i&&r){const t=30*r;m+=-t*Math.log(1+Math.max(0,d-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-p)/t),y+=-t*Math.log(1+Math.max(0,g-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-f)/t)}return[m,y]}}function he(t){return t}function ce(t){const e=[1/0,1/0,-1/0,-1/0];for(let i=0,n=t.length;i<n;++i)Me(e,t[i]);return e}function ue(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function de(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function pe(t,e,i){let n,r;return n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0,r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0,n*n+r*r}function ge(t,e){return me(t,e[0],e[1])}function fe(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function me(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function ye(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1];let l=0;return o<i?l|=16:o>r&&(l|=4),a<n?l|=8:a>s&&(l|=2),0===l&&(l=1),l}function ve(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function _e(t){return ve(1/0,1/0,-1/0,-1/0,t)}function xe(t,e){const i=t[0],n=t[1];return ve(i,n,i,n,e)}function we(t,e,i,n,r){return Ee(_e(r),t,e,i,n)}function be(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Se(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Me(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function Ee(t,e,i,n,r){for(;i<n;i+=r)Ce(t,e[i],e[i+1]);return t}function Ce(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function Te(t,e){let i;return i=e(Pe(t)),i||(i=e(Le(t)),i||(i=e(De(t)),i||(i=e(Ge(t)),i||!1)))}function ke(t){let e=0;return qe(t)||(e=Ne(t)*ze(t)),e}function Pe(t){return[t[0],t[1]]}function Le(t){return[t[2],t[1]]}function Ie(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Re(t,e){let i;if("bottom-left"===e)i=Pe(t);else if("bottom-right"===e)i=Le(t);else if("top-left"===e)i=Ge(t);else{if("top-right"!==e)throw new Error("Invalid corner");i=De(t)}return i}function Ae(t,e,i,n,r){const[s,o,a,l,h,c,u,d]=Fe(t,e,i,n);return ve(Math.min(s,a,h,u),Math.min(o,l,c,d),Math.max(s,a,h,u),Math.max(o,l,c,d),r)}function Fe(t,e,i,n){const r=e*n[0]/2,s=e*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=r*o,h=r*a,c=s*o,u=s*a,d=t[0],p=t[1];return[d-l+u,p-h-c,d-l-u,p-h+c,d+l-u,p+h+c,d+l+u,p+h-c,d-l+u,p-h-c]}function ze(t){return t[3]-t[1]}function Oe(t,e,i){const n=i||[1/0,1/0,-1/0,-1/0];return je(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):_e(n),n}function Ge(t){return[t[0],t[3]]}function De(t){return[t[2],t[3]]}function Ne(t){return t[2]-t[0]}function je(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function qe(t){return t[2]<t[0]||t[3]<t[1]}function Be(t,e,i,n){if(qe(t))return _e(i);let r=[];if(n>1){const e=t[2]-t[0],i=t[3]-t[1];for(let s=0;s<n;++s)r.push(t[0]+e*s/n,t[1],t[2],t[1]+i*s/n,t[2]-e*s/n,t[3],t[0],t[3]-i*s/n)}else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);const s=[],o=[];for(let a=0,l=r.length;a<l;a+=2)s.push(r[a]),o.push(r[a+1]);return function(t,e,i){return ve(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(s,o,i)}function Ve(t,e){const i=e.getExtent(),n=Ie(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const e=Ne(i),r=Math.floor((n[0]-i[0])/e)*e;t[0]-=r,t[2]-=r}return t}function $e(t,e,i){if(e.canWrapX()){const n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];Ve(t,e);const r=Ne(n);if(Ne(t)>r&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}function Ue(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function We(t,e){const i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,s=t[1]*i+t[0]*n;return t[0]=r,t[1]=s,t}function He(t,e){const i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function Xe(t,e){return Math.sqrt(He(t,e))}function Ke(t,e){return function(t,e,i){return t?"{x}, {y}".replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}(t,0,e)}function Ze(t,e){if(e.canWrapX()){const i=Ne(e.getExtent()),n=Ye(t,e,i);n&&(t[0]-=n*i)}return t}function Ye(t,e,i){const n=e.getExtent();let r=0;return e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])&&(i=i||Ne(n),r=Math.floor((t[0]-n[0])/i)),r}function Je(t){return Math.pow(t,3)}function Qe(t){return 1-Je(1-t)}function ti(t){return 3*t*t-2*t*t*t}function ei(t){return t}function ii(t,e,i){i=i||6371008.8;const n=te(t[1]),r=te(e[1]),s=(r-n)/2,o=te(e[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function ni(t,e){let i=0;for(let n=0,r=t.length;n<r-1;++n)i+=ii(t[n],t[n+1],e);return i}function ri(t,e){const i=(e=e||{}).radius||6371008.8,n=e.projection||"EPSG:3857",r=t.getType();"GeometryCollection"!==r&&(t=t.clone().transform(n,"EPSG:4326"));let s,o,a,l,h,c,u=0;switch(r){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":s=t.getCoordinates(),u=ni(s,i);break;case"MultiLineString":case"Polygon":for(s=t.getCoordinates(),a=0,l=s.length;a<l;++a)u+=ni(s[a],i);break;case"MultiPolygon":for(s=t.getCoordinates(),a=0,l=s.length;a<l;++a)for(o=s[a],h=0,c=o.length;h<c;++h)u+=ni(o[h],i);break;case"GeometryCollection":{const i=t.getGeometries();for(a=0,l=i.length;a<l;++a)u+=ri(i[a],e);break}default:throw new Error("Unsupported geometry type: "+r)}return u}function si(t,e){let i=0;const n=t.length;let r=t[n-1][0],s=t[n-1][1];for(let o=0;o<n;o++){const e=t[o][0],n=t[o][1];i+=te(e-r)*(2+Math.sin(te(s))+Math.sin(te(n))),r=e,s=n}return i*e*e/2}function oi(t,e){const i=(e=e||{}).radius||6371008.8,n=e.projection||"EPSG:3857",r=t.getType();"GeometryCollection"!==r&&(t=t.clone().transform(n,"EPSG:4326"));let s,o,a,l,h,c,u=0;switch(r){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(s=t.getCoordinates(),u=Math.abs(si(s[0],i)),a=1,l=s.length;a<l;++a)u-=Math.abs(si(s[a],i));break;case"MultiPolygon":for(s=t.getCoordinates(),a=0,l=s.length;a<l;++a)for(o=s[a],u+=Math.abs(si(o[0],i)),h=1,c=o.length;h<c;++h)u-=Math.abs(si(o[h],i));break;case"GeometryCollection":{const i=t.getGeometries();for(a=0,l=i.length;a<l;++a)u+=oi(i[a],e);break}default:throw new Error("Unsupported geometry type: "+r)}return u}function ai(...t){console.warn(...t)}var li={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},hi=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,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_||li[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_}},ci=6378137,ui=Math.PI*ci,di=[-ui,-ui,ui,ui],pi=[-180,-85,180,85],gi=ci*Math.log(Math.tan(Math.PI/2)),fi=class extends hi{constructor(t){super({code:t,units:"m",extent:di,global:!0,worldExtent:pi,getPointResolution:function(t,e){return t/Math.cosh(e[1]/ci)}})}},mi=[new fi("EPSG:3857"),new fi("EPSG:102100"),new fi("EPSG:102113"),new fi("EPSG:900913"),new fi("http://www.opengis.net/def/crs/EPSG/0/3857"),new fi("http://www.opengis.net/gml/srs/epsg.xml#3857")];var yi=[-180,-90,180,90],vi=6378137*Math.PI/180,_i=class extends hi{constructor(t,e){super({code:t,units:"degrees",extent:yi,axisOrientation:e,global:!0,metersPerUnit:vi,worldExtent:yi})}},xi=[new _i("CRS:84"),new _i("EPSG:4326","neu"),new _i("urn:ogc:def:crs:OGC:1.3:CRS84"),new _i("urn:ogc:def:crs:OGC:2:84"),new _i("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new _i("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new _i("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],wi={};function bi(t){return wi[t]||wi[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}var Si={};function Mi(t,e,i){const n=t.getCode(),r=e.getCode();n in Si||(Si[n]={}),Si[n][r]=i}function Ei(t,e){return t in Si&&e in Si[t]?Si[t][e]:null}var Ci=.9996,Ti=.00669438,ki=Ti*Ti,Pi=ki*Ti,Li=Ti/(1-Ti),Ii=Math.sqrt(1-Ti),Ri=(1-Ii)/(1+Ii),Ai=Ri*Ri,Fi=Ai*Ri,zi=Fi*Ri,Oi=zi*Ri,Gi=.9983242984503243,Di=15*ki/256+45*Pi/1024,Ni=35*Pi/3072,ji=1.5*Ri-27/32*Fi+269/512*Oi,qi=21/16*Ai-55/32*zi,Bi=151/96*Fi-417/128*Oi,Vi=1097/512*zi,$i=6378137;function Ui(t,e,i){const n=t-5e5,r=(i.north?e:e-1e7)/Ci/($i*Gi),s=r+ji*Math.sin(2*r)+qi*Math.sin(4*r)+Bi*Math.sin(6*r)+Vi*Math.sin(8*r),o=Math.sin(s),a=o*o,l=Math.cos(s),h=o/l,c=h*h,u=c*c,d=1-Ti*a,p=$i/Math.sqrt(1-Ti*a),g=Li*l**2,f=g*g,m=n/(p*Ci),y=m*m,v=y*m,_=v*m,x=_*m,w=s-h/((1-Ti)/d)*(y/2-_/24*(5+3*c+10*g-4*f-9*Li))+x*m/720*(61+90*c+298*g+45*u-252*Li-3*f);let b=(m-v/6*(1+2*c+g)+x/120*(5-2*g+28*c-3*f+8*Li+24*u))/l;return b=ae(b+te(Hi(i.number)),-Math.PI,Math.PI),[Qt(b),Qt(w)]}function Wi(t,e,i){t=ae(t,-180,180),e<-80?e=-80:e>84&&(e=84);const n=te(e),r=Math.sin(n),s=Math.cos(n),o=r/s,a=o*o,l=a*a,h=te(t),c=te(Hi(i.number)),u=$i/Math.sqrt(1-Ti*r**2),d=Li*s**2,p=s*ae(h-c,-Math.PI,Math.PI),g=p*p,f=g*p,m=f*p,y=m*p,v=y*p,_=$i*(Gi*n-.002514607064228144*Math.sin(2*n)+Di*Math.sin(4*n)-Ni*Math.sin(6*n)),x=Ci*u*(p+f/6*(1-a+d)+y/120*(5-18*a+l+72*d-58*Li))+5e5;let w=Ci*(_+u*o*(g/2+m/24*(5-a+9*d+4*d**2)+v/720*(61-58*a+l+600*d-330*Li)));return i.north||(w+=1e7),[x,w]}function Hi(t){return 6*(t-1)-180+3}var Xi=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Ki(t){let e=0;for(const r of Xi){const i=t.match(r);if(i){e=parseInt(i[1]);break}}if(!e)return null;let i=0,n=!1;return e>32700&&e<32761?i=e-32700:e>32600&&e<32661&&(n=!0,i=e-32600),i?{number:i,north:n}:null}function Zi(t,e){return function(i,n,r,s){const o=i.length;r=r>1?r:2,s=s??r,n||(n=r>2?i.slice():new Array(o));for(let a=0;a<o;a+=s){const r=i[a],s=i[a+1],o=t(r,s,e);n[a]=o[0],n[a+1]=o[1]}return n}}var Yi=[function(t){const e=Ki(t.getCode());return e?{forward:Zi(Wi,e),inverse:Zi(Ui,e)}:null}],Ji=[function(t){return Ki(t)?new hi({code:t,units:"m"}):null}],Qi=!0;function tn(t){Qi=!(void 0===t||t)}function en(t,e){if(void 0!==e)for(let i=0,n=t.length;i<n;++i)e[i]=t[i];else e=t.slice();return e}function nn(t){!function(t,e){wi[t]=e}(t.getCode(),t),Mi(t,t,en)}function rn(t){if("string"!=typeof t)return t;const e=bi(t);if(e)return e;for(const i of Ji){const e=i(t);if(e)return e}return null}function sn(t,e,i,n){let r;const s=(t=rn(t)).getPointResolutionFunc();if(s){if(r=s(e,i),n&&n!==t.getUnits()){const e=t.getMetersPerUnit();e&&(r=r*e/li[n])}}else{const s=t.getUnits();if("degrees"==s&&!n||"degrees"==n)r=e;else{const o=dn(t,rn("EPSG:4326"));if(o||"degrees"===s){let t=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];t=o(t,t,2),r=(ii(t.slice(0,2),t.slice(2,4))+ii(t.slice(4,6),t.slice(6,8)))/2}else r=e*t.getMetersPerUnit();const a=n?li[n]:t.getMetersPerUnit();void 0!==a&&(r/=a)}}return r}function on(t){!function(t){t.forEach(nn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Mi(e,t,en)}))}))}function an(t,e){return t?"string"==typeof t?rn(t):t:rn(e)}function ln(t){return function(e,i,n,r){const s=e.length;n=void 0!==n?n:2,r=r??n,i=void 0!==i?i:new Array(s);for(let o=0;o<s;o+=r){const s=t(e.slice(o,o+n)),a=s.length;for(let t=0,n=r;t<n;++t)i[o+t]=t>=a?e[o+t]:s[t]}return i}}function hn(t,e,i,n){const r=rn(t),s=rn(e);Mi(r,s,ln(i)),Mi(s,r,ln(n))}function cn(t,e){return tn(),fn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function un(t,e){if(t===e)return!0;const i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||dn(t,e)===en)&&i}function dn(t,e){const i=t.getCode(),n=e.getCode();let r=Ei(i,n);if(r)return r;let s=null,o=null;for(const l of Yi)s||(s=l(t)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=pn(s.inverse,o.forward);else{const t=Ei(i,a);t&&(r=pn(t,o.forward))}else{const t=Ei(a,n);t&&(r=pn(s.inverse,t))}return r&&(nn(t),nn(e),Mi(t,e,r)),r}function pn(t,e){return function(i,n,r,s){return n=t(i,n,r,s),e(n,n,r,s)}}function gn(t,e){return dn(rn(t),rn(e))}function fn(t,e,i){const n=gn(e,i);if(!n){const t=rn(e).getCode(),n=rn(i).getCode();throw new Error(`No transform available between ${t} and ${n}`)}return n(t,void 0,t.length)}function mn(t,e,i,n){return Be(t,gn(e,i),void 0,n)}var yn,vn,_n;function xn(t,e){return t}function wn(t,e){return Qi&&!Ue(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Qi=!1,ai("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function bn(t,e){return t}function Sn(t,e){return t}function Mn(t,e,i){return function(n){let r,s;if(t.canWrapX()){const e=t.getExtent(),o=Ne(e);s=Ye(n=n.slice(0),t,o),s&&(n[0]=n[0]-s*o),n[0]=Zt(n[0],e[0],e[2]),n[1]=Zt(n[1],e[1],e[3]),r=i(n)}else r=i(n);return s&&e.canWrapX()&&(r[0]+=s*Ne(e.getExtent())),r}}on(mi),on(xi),yn=mi,vn=function(t,e,i,n){const r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(r));for(let s=0;s<r;s+=n){e[s]=ui*t[s]/180;let i=ci*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));i>gi?i=gi:i<-gi&&(i=-gi),e[s+1]=i}return e},_n=function(t,e,i,n){const r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(r));for(let s=0;s<r;s+=n)e[s]=180*t[s]/ui,e[s+1]=360*Math.atan(Math.exp(t[s+1]/ci))/Math.PI-90;return e},xi.forEach((function(t){yn.forEach((function(e){Mi(t,e,vn),Mi(e,t,_n)}))}));var En=new Array(6);function Cn(t){return kn(t,1,0,0,1,0,0)}function Tn(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],d=e[4],p=e[5];return t[0]=i*l+r*h,t[1]=n*l+s*h,t[2]=i*c+r*u,t[3]=n*c+s*u,t[4]=i*d+r*p+o,t[5]=n*d+s*p+a,t}function kn(t,e,i,n,r,s,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t}function Pn(t,e){const i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Ln(t,e,i){return Tn(t,kn(En,e,0,0,i,0,0))}function In(t,e,i,n,r,s,o,a){const l=Math.sin(s),h=Math.cos(s);return t[0]=n*h,t[1]=r*l,t[2]=-n*l,t[3]=r*h,t[4]=o*n*h-a*n*l+e,t[5]=o*r*l+a*r*h+i,t}function Rn(t,e){const i=(n=e)[0]*n[3]-n[1]*n[2];var n;Ut(0!==i,"Transformation matrix cannot be inverted");const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],h=e[5];return t[0]=a/i,t[1]=-s/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*h-a*l)/i,t[5]=-(r*h-s*l)/i,t}var An=[1e5,1e5,1e5,1e5,2,2];function Fn(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}function zn(t,e,i,n,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<i;l+=n){const e=t[l],i=t[l+1];s[a++]=r[0]*e+r[2]*i+r[4],s[a++]=r[1]*e+r[3]*i+r[5];for(let n=2;n<o;n++)s[a++]=t[l+n]}return s&&s.length!=a&&(s.length=a),s}function On(t,e,i,n,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),h=s[0],c=s[1];let u=0;for(let d=e;d<i;d+=n){const e=t[d]-h,i=t[d+1]-c;o[u++]=h+e*a-i*l,o[u++]=c+e*l+i*a;for(let r=d+2;r<d+n;++r)o[u++]=t[r]}return o&&o.length!=u&&(o.length=u),o}var Gn=[1,0,0,1,0,0],Dn=[NaN,NaN],Nn=class extends wt{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ut(((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return yt()}closestPointXY(t,e,i,n){return yt()}containsXY(t,e){return 0===this.closestPointXY(t,e,Dn,Number.MIN_VALUE)}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 yt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&_e(t),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)}rotate(t,e){yt()}scale(t,e,i){yt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return yt()}getType(){return yt()}applyTransform(t){yt()}intersectsExtent(t){return yt()}translate(t,e){yt()}transform(t,e){const i=rn(t),n="tile-pixels"==i.getUnits()?function(t,n,r){const s=i.getExtent(),o=i.getWorldExtent(),a=ze(o)/ze(s);In(Gn,o[0],o[3],a,-a,0,0,0);const l=zn(t,0,t.length,r,Gn,n),h=gn(i,e);return h?h(l,l,r):l}:gn(i,e);return this.applyTransform(n),this}},jn=class extends Nn{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return we(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return yt()}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||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=Bn(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){yt()}setLayout(t,e,i){let n;if(t)n=Bn(t);else{for(let t=0;t<i;++t){if(0===e.length)return this.layout="XY",void(this.stride=2);e=e[0]}n=e.length,t=qn(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();On(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){void 0===e&&(e=t),i||(i=Ie(this.getExtent()));const n=this.getFlatCoordinates();if(n){const r=this.getStride();!function(t,e,i,n,r,s,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=0;u<i;u+=n){const e=t[u]-l,i=t[u+1]-h;a[c++]=l+r*e,a[c++]=h+s*i;for(let r=u+2;r<u+n;++r)a[c++]=t[r]}a&&a.length!=c&&(a.length=c)}(n,0,n.length,r,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();!function(t,e,i,n,r,s,o){o=o||[];let a=0;for(let l=0;l<i;l+=n){o[a++]=t[l]+r,o[a++]=t[l+1]+s;for(let e=l+2;e<l+n;++e)o[a++]=t[e]}o&&o.length!=a&&(o.length=a)}(i,0,i.length,n,t,e,i),this.changed()}}};function qn(t){let e;return 2==t?e="XY":3==t?e="XYZ":4==t&&(e="XYZM"),e}function Bn(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function Vn(t,e,i,n){let r=0;const s=t[i-n],o=t[i-n+1];let a=0,l=0;for(;e<i;e+=n){const i=t[e]-s,n=t[e+1]-o;r+=l*i-a*n,a=i,l=n}return r/2}function $n(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=Vn(t,e,o,n),e=o}return r}function Un(t,e,i,n,r,s,o){const a=t[e],l=t[e+1],h=t[i]-a,c=t[i+1]-l;let u;if(0===h&&0===c)u=e;else{const d=((r-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=i;else{if(d>0){for(let r=0;r<n;++r)o[r]=ie(t[e+r],t[i+r],d);return void(o.length=n)}u=e}}for(let d=0;d<n;++d)o[d]=t[u+d];o.length=n}function Wn(t,e,i,n,r){let s=t[e],o=t[e+1];for(e+=n;e<i;e+=n){const i=t[e],n=t[e+1],a=Jt(s,o,i,n);a>r&&(r=a),s=i,o=n}return r}function Hn(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=Wn(t,e,o,n,r),e=o}return r}function Xn(t,e,i,n,r,s,o,a,l,h,c){if(e==i)return h;let u,d;if(0===r){if(d=Jt(o,a,t[e],t[e+1]),d<h){for(u=0;u<n;++u)l[u]=t[e+u];return l.length=n,d}return h}c=c||[NaN,NaN];let p=e+n;for(;p<i;)if(Un(t,p-n,p,n,o,a,c),d=Jt(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n,p+=n}else p+=n*Math.max((Math.sqrt(d)-Math.sqrt(h))/r|0,1);if(s&&(Un(t,i-n,e,n,o,a,c),d=Jt(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n}return h}function Kn(t,e,i,n,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=i.length;u<d;++u){const d=i[u];h=Xn(t,e,d,n,r,s,o,a,l,h,c),e=d}return h}function Zn(t,e,i,n){for(let r=0,s=i.length;r<s;++r)t[e++]=i[r];return e}function Yn(t,e,i,n){for(let r=0,s=i.length;r<s;++r){const s=i[r];for(let i=0;i<n;++i)t[e++]=s[i]}return e}function Jn(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=Yn(t,e,i[o],n);r[s++]=a,e=a}return r.length=s,r}function Qn(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=Jn(t,e,i[o],n,r[s]);0===a.length&&(a[0]=e),r[s++]=a,e=a[a.length-1]}return r.length=s,r}function tr(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=e;o<i;o+=n)r[s++]=t.slice(o,o+n);return r.length=s,r}function er(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=i[o];r[s++]=tr(t,e,a,n,r[s]),e=a}return r.length=s,r}function ir(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=i[o];r[s++]=1===a.length&&a[0]===e?[]:er(t,e,a,n,r[s]),e=a[a.length-1]}return r.length=s,r}function nr(t,e,i,n,r,s,o){const a=(i-e)/n;if(a<3){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[e,i-n];let c=0;for(;h.length>0;){const i=h.pop(),s=h.pop();let o=0;const a=t[s],u=t[s+1],d=t[i],p=t[i+1];for(let e=s+n;e<i;e+=n){const i=Yt(t[e],t[e+1],a,u,d,p);i>o&&(c=e,o=i)}o>r&&(l[(c-e)/n]=1,s+n<c&&h.push(s,c),c+n<i&&h.push(c,i))}for(let u=0;u<a;++u)l[u]&&(s[o++]=t[e+u*n],s[o++]=t[e+u*n+1]);return o}function rr(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=nr(t,e,h,n,r,s,o),a.push(o),e=h}return o}function sr(t,e){return e*Math.round(t/e)}function or(t,e,i,n,r,s,o){if(e==i)return o;let a,l,h=sr(t[e],r),c=sr(t[e+1],r);e+=n,s[o++]=h,s[o++]=c;do{if(a=sr(t[e],r),l=sr(t[e+1],r),(e+=n)==i)return s[o++]=a,s[o++]=l,o}while(a==h&&l==c);for(;e<i;){const i=sr(t[e],r),u=sr(t[e+1],r);if(e+=n,i==a&&u==l)continue;const d=a-h,p=l-c,g=i-h,f=u-c;d*f==p*g&&(d<0&&g<d||d==g||d>0&&g>d)&&(p<0&&f<p||p==f||p>0&&f>p)?(a=i,l=u):(s[o++]=a,s[o++]=l,h=a,c=l,a=i,l=u)}return s[o++]=a,s[o++]=l,o}function ar(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=or(t,e,h,n,r,s,o),a.push(o),e=h}return o}var lr=class t extends jn{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new t(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(Wn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return Vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return tr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const i=[];return i.length=nr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Yn(this.flatCoordinates,0,t,this.stride),this.changed()}},hr=class t extends jn{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const e=new t(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(t,e,i,n){const r=this.flatCoordinates,s=Jt(t,e,r[0],r[1]);if(s<n){const t=this.stride;for(let e=0;e<t;++e)i[e]=r[e];return i.length=t,s}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return xe(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return me(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zn(this.flatCoordinates,0,t,this.stride),this.changed()}};function cr(t,e,i,n,r){return!Te(r,(function(r){return!ur(t,e,i,n,r[0],r[1])}))}function ur(t,e,i,n,r,s){let o=0,a=t[i-n],l=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];l<=s?n>s&&(i-a)*(s-l)-(r-a)*(n-l)>0&&o++:n<=s&&(i-a)*(s-l)-(r-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function dr(t,e,i,n,r,s){if(0===i.length)return!1;if(!ur(t,e,i[0],n,r,s))return!1;for(let o=1,a=i.length;o<a;++o)if(ur(t,i[o-1],i[o],n,r,s))return!1;return!0}function pr(t,e,i,n,r,s,o){let a,l,h,c,u,d,p;const g=r[s+1],f=[];for(let v=0,_=i.length;v<_;++v){const r=i[v];for(c=t[r-n],d=t[r-n+1],a=e;a<r;a+=n)u=t[a],p=t[a+1],(g<=d&&p<=g||d<=g&&g<=p)&&(h=(g-d)/(p-d)*(u-c)+c,f.push(h)),c=u,d=p}let m=NaN,y=-1/0;for(f.sort(it),c=f[0],a=1,l=f.length;a<l;++a){u=f[a];const r=Math.abs(u-c);r>y&&(h=(c+u)/2,dr(t,e,i,n,h,g)&&(m=h,y=r)),c=u}return isNaN(m)&&(m=r[s]),o?(o.push(m,g,y),o):[m,g,y]}function gr(t,e,i,n,r){let s=[];for(let o=0,a=i.length;o<a;++o){const a=i[o];s=pr(t,e,a,n,r,2*o,s),e=a[a.length-1]}return s}function fr(t,e,i,n,r){let s;for(e+=n;e<i;e+=n)if(s=r(t.slice(e-n,e),t.slice(e,e+n)),s)return s;return!1}function mr(t,e,i,n,r,s){return s=s??Ee([1/0,1/0,-1/0,-1/0],t,e,i,n),!!je(r,s)&&(s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]||fr(t,e,i,n,(function(t,e){return function(t,e,i){let n=!1;const r=ye(t,e),s=ye(t,i);if(1===r||1===s)n=!0;else{const o=t[0],a=t[1],l=t[2],h=t[3],c=e[0],u=e[1],d=i[0],p=i[1],g=(p-u)/(d-c);let f,m;2&s&&!(2&r)&&(f=d-(p-h)/g,n=f>=o&&f<=l),n||!(4&s)||4&r||(m=p-(d-l)*g,n=m>=a&&m<=h),n||!(8&s)||8&r||(f=d-(p-a)/g,n=f>=o&&f<=l),n||!(16&s)||16&r||(m=p-(d-o)*g,n=m>=a&&m<=h)}return n}(r,t,e)})))}function yr(t,e,i,n,r){return!!(mr(t,e,i,n,r)||ur(t,e,i,n,r[0],r[1])||ur(t,e,i,n,r[0],r[3])||ur(t,e,i,n,r[2],r[1])||ur(t,e,i,n,r[2],r[3]))}function vr(t,e,i,n,r){if(!yr(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(let s=1,o=i.length;s<o;++s)if(cr(t,i[s-1],i[s],n,r)&&!mr(t,i[s-1],i[s],n,r))return!1;return!0}function _r(t,e,i,n){for(;e<i-n;){for(let r=0;r<n;++r){const s=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=s}e+=n,i-=n}}function xr(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];r+=(i-s)*(n+o),s=i,o=n}return 0===r?void 0:r>0}function wr(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=xr(t,e,o,n);if(0===s){if(r&&a||!r&&!a)return!1}else if(r&&!a||!r&&a)return!1;e=o}return!0}function br(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(!wr(t,e,o,n,r))return!1;o.length&&(e=o[o.length-1])}return!0}function Sr(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=xr(t,e,o,n);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&_r(t,e,o,n),e=o}return e}function Mr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s)e=Sr(t,e,i[s],n,r);return e}function Er(t,e){const i=[];let n,r=0,s=0;for(let o=0,a=e.length;o<a;++o){const a=e[o],l=xr(t,r,a,2);if(void 0===n&&(n=l),l===n)i.push(e.slice(s,o+1));else{if(0===i.length)continue;i[i.length-1].push(e[s])}s=o+1,r=a}return i}var Cr=class t extends jn{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,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?ot(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(t,e,i,n){return n<pe(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Hn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Kn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return dr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return $n(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Sr(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,er(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ie(this.getExtent());this.flatInteriorPoint_=pr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new hr(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new lr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=new lr(e.slice(r,o),t);n.push(a),r=o}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;wr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Sr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const i=[],n=[];return i.length=ar(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,n),new t(i,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return vr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Jn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}};function Tr(t){if(qe(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],i=t[1],n=t[2],r=t[3],s=[e,i,e,r,n,r,n,i,e,i];return new Cr(s,"XY",[s.length])}function kr(t,e,i,n){const r=Ne(e)/i[0],s=ze(e)/i[1];return n?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function Pr(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Zt(n,i/2,2*e)}function Lr(t,e,i,n,r){return i=void 0===i||i,function(s,o,a,l){if(void 0!==s){const o=n?kr(t,n,a,r):t;return i&&l?Pr(s,o,e):Zt(s,e,o)}}}function Ir(t){if(void 0!==t)return 0}function Rr(t){if(void 0!==t)return t}var Ar=class extends wt{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=an(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&&tn(),t.center&&(t.center=wn(t.center,this.projection_)),t.extent&&(t.extent=Sn(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const o in Kt)delete e[o];this.setProperties(e,!0);const i=function(t){let e,i,n;let r=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:28;const o=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,c=an(t.projection,"EPSG:3857"),u=c.getExtent();let d=t.constrainOnlyCenter,p=t.extent;if(a||p||!c.isGlobal()||(d=!1,p=u),void 0!==t.resolutions){const o=t.resolutions;i=o[r],n=void 0!==o[s]?o[s]:o[o.length-1],e=t.constrainResolution?function(t,e,i,n){return e=void 0===e||e,function(r,s,o,a){if(void 0!==r){const l=t[0],h=t[t.length-1],c=i?kr(l,i,o,n):l;if(a)return e?Pr(r,c,h):Zt(r,h,c);const u=Math.floor(rt(t,Math.min(c,r),s));return t[u]>c&&u<t.length-1?t[u+1]:t[u]}}}(o,l,!d&&p,h):Lr(i,n,l,!d&&p,h)}else{const a=(u?Math.max(Ne(u),ze(u)):360*li.degrees/c.getMetersPerUnit())/256/Math.pow(2,0),g=a/Math.pow(2,28);i=t.maxResolution,void 0!==i?r=0:i=a/Math.pow(o,r),n=t.minResolution,void 0===n&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(o,s):a/Math.pow(o,s):g),s=r+Math.floor(Math.log(i/n)/Math.log(o)),n=i/Math.pow(o