mirage2d 1.2.12 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/128.ico +0 -0
- package/dist/64.ico +0 -0
- package/dist/Enum/typeEnum.d.ts +1 -0
- package/dist/Layer/graphicLayer/KmlLayer.d.ts +35 -0
- package/dist/Layer/index.d.ts +1 -0
- package/dist/base/baseGraphicLayer.d.ts +1 -1
- package/dist/config/json/mapConfig.json +3 -6
- package/dist/favicon.ico +0 -0
- package/dist/mirage2d.cjs.js +3 -3
- package/dist/mirage2d.umd.js +3 -3
- package/package.json +1 -1
- package/dist/MirageHttp.es.js +0 -5268
- package/dist/MirageHttp.es.js.map +0 -205
- package/dist/MirageHttp.umd.js +0 -2
- package/dist/MirageHttp.umd.js.map +0 -1263
package/dist/mirage2d.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";var t=Object.defineProperty,e=(e,r,n)=>(((e,r,n)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n})(e,"symbol"!=typeof r?r+"":r,n),n);function r(t,e){for(var r=0;r<e.length;r++){const n=e[r];if("string"!=typeof n&&!Array.isArray(n))for(const e in n)if("default"!==e&&!(e in t)){const r=Object.getOwnPropertyDescriptor(n,e);r&&Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function n(){return function(){throw new Error("Unimplemented abstract method.")}()}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=0;function o(t){return t.ol_uid||(t.ol_uid=String(++i))}var s,a="6.15.1",l=globalThis&&globalThis.__extends||(s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});const u=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/v"+a.split("-")[0]+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return l(e,t),e}(Error),h=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),c={PROPERTYCHANGE:"propertychange"},A=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function f(t,e){return t>e?1:t<e?-1:0}function p(t,e){return t.indexOf(e)>=0}function d(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof r?r(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return n-1}function g(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r],t[r]=n,++e,--r}}function y(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function m(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function v(){return!0}function _(){return!1}function w(){}var b="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n<i;++n){var o=arguments[n];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])}return r};function x(t){for(var e in t)delete t[e]}var E="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function C(t){var e;for(e in t)return!1;return!e}var S=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),B=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return S(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_||(this.listeners_={}),n=r[t]||(r[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,r=e?t:t.type,n=this.listeners_&&this.listeners_[r];if(n){var i=e?new h(t):t;i.target||(i.target=this.eventTarget_||this);var o,s=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});r in s||(s[r]=0,a[r]=0),++s[r];for(var l=0,u=n.length;l<u;++l)if(!1===(o="handleEvent"in n[l]?n[l].handleEvent(i):n[l].call(this,i))||i.propagationStopped){o=!1;break}if(0==--s[r]){var c=a[r];for(delete a[r];c--;)this.removeEventListener(r,w);delete s[r]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&x(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=w,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(A);const I=B,T={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 P(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var s={target:t,type:e,listener:r};return t.addEventListener(e,r),s}function F(t,e,r,n){return P(t,e,r,n,!0)}function L(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var M=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return M(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(T.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=P(this,t[i],e);return n}return P(this,t,e)},e.prototype.onceInternal=function(t,e){var r;if(Array.isArray(t)){var n=t.length;r=new Array(n);for(var i=0;i<n;++i)r[i]=F(this,t[i],e)}else r=F(this,t,e);return e.ol_key=r,r},e.prototype.unInternal=function(t,e){var r=e.ol_key;if(r)k(r);else if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(I);function k(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)L(t[e]);else L(t)}O.prototype.on,O.prototype.once,O.prototype.un;var N=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),R=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return N(e,t),e}(h),U=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,o(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return N(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&b({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var r;r="change:".concat(t),this.hasListener(r)&&this.dispatchEvent(new R(r,t,e)),r=c.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new R(r,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,r){var n=this.values_||(this.values_={});if(r)n[t]=e;else{var i=n[t];n[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.applyProperties=function(t){t.values_&&b(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],C(this.values_)&&(this.values_=null),e||this.notify(t,r)}},e}(O);const D=U,Q={ADD:"add",REMOVE:"remove"};var G=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),j="length",H=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return G(e,t),e}(h),z=function(t){function e(e,r){var n=t.call(this)||this;n.on,n.once,n.un;var i=r||{};if(n.unique_=!!i.unique,n.array_=e||[],n.unique_)for(var o=0,s=n.array_.length;o<s;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return G(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(j)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new H(Q.ADD,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new H(Q.REMOVE,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new H(Q.REMOVE,n,t)),this.dispatchEvent(new H(Q.ADD,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(j,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new u(58)},e}(D);const V=z;function K(t,e){if(!t)throw new u(e)}var q=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),W=function(t){function e(e){var r=t.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return q(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(L(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=P(t,T.CHANGE,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){var e,r;this.style_=t,this.styleFunction_=t?"function"==typeof(e=t)?e:(Array.isArray(e)?r=e:(K("function"==typeof e.getZIndex,41),r=[e]),function(){return r}):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(D);const X=W,Y={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Z={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},J={9001:Z.METERS,9002:Z.FEET,9003:Z.USFEET,9101:Z.RADIANS,9102:Z.DEGREES};function $(t){return J[t]}var tt={};tt[Z.RADIANS]=6370997/(2*Math.PI),tt[Z.DEGREES]=2*Math.PI*6370997/360,tt[Z.FEET]=.3048,tt[Z.METERS]=1,tt[Z.USFEET]=1200/3937;const et=Z;var rt,nt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",it=-1!==nt.indexOf("firefox"),ot=-1!==nt.indexOf("safari")&&-1==nt.indexOf("chrom")&&!!(nt.indexOf("version/15.4")>=0||nt.match(/cpu (os|iphone os) 15_4 like mac os x/)),st=-1!==nt.indexOf("webkit")&&-1==nt.indexOf("edge"),at=-1!==nt.indexOf("macintosh"),lt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ut="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ht="undefined"!=typeof Image&&Image.prototype.decode,ct=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(r){}return t}(),At=new Array(6);function ft(t){return dt(t,1,0,0,1,0,0)}function pt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],A=e[4],f=e[5];return t[0]=r*l+i*u,t[1]=n*l+o*u,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*A+i*f+s,t[5]=n*A+o*f+a,t}function dt(t,e,r,n,i,o,s){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t}function gt(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function yt(t,e){var r=Math.cos(e),n=Math.sin(e);return pt(t,dt(At,r,n,-n,r,0,0))}function mt(t,e,r){return pt(t,dt(At,e,0,0,r,0,0))}function vt(t,e,r){return pt(t,dt(At,1,0,0,1,e,r))}function _t(t,e,r,n,i,o,s,a){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=i*l,t[2]=-n*l,t[3]=i*u,t[4]=s*n*u-a*n*l+e,t[5]=s*i*l+a*i*u+r,t}function wt(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];K(0!==n,32);var i=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=i/n,t[4]=(s*u-a*l)/n,t[5]=-(i*u-o*l)/n,t}function bt(t){var e="matrix("+t.join(", ")+")";if(ut)return e;var r=rt||(rt=document.createElement("div"));return r.style.transform=e,r.style.transform}const xt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Et(t){for(var e=[1/0,1/0,-1/0,-1/0],r=0,n=t.length;r<n;++r)Ut(e,t[r]);return e}function Ct(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function St(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Bt(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function It(t,e){return Pt(t,e[0],e[1])}function Tt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Pt(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function Ft(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],s=e[0],a=e[1],l=xt.UNKNOWN;return s<r?l|=xt.LEFT:s>i&&(l|=xt.RIGHT),a<n?l|=xt.BELOW:a>o&&(l|=xt.ABOVE),l===xt.UNKNOWN&&(l=xt.INTERSECTING),l}function Lt(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function Mt(t){return Lt(1/0,1/0,-1/0,-1/0,t)}function Ot(t,e){var r=t[0],n=t[1];return Lt(r,n,r,n,e)}function kt(t,e,r,n,i){return Dt(Mt(i),t,e,r,n)}function Nt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Rt(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 Ut(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 Dt(t,e,r,n,i){for(;r<n;r+=i)Qt(t,e[r],e[r+1]);return t}function Qt(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function Gt(t,e){var r;return(r=e(Ht(t)))||(r=e(zt(t)))||(r=e(Jt(t)))?r:(r=e(Zt(t)))||!1}function jt(t){var e=0;return ee(t)||(e=$t(t)*Xt(t)),e}function Ht(t){return[t[0],t[1]]}function zt(t){return[t[2],t[1]]}function Vt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Kt(t,e){var r;return"bottom-left"===e?r=Ht(t):"bottom-right"===e?r=zt(t):"top-left"===e?r=Zt(t):"top-right"===e?r=Jt(t):K(!1,13),r}function qt(t,e,r,n,i){var o=Wt(t,e,r,n),s=o[0],a=o[1],l=o[2],u=o[3],h=o[4],c=o[5],A=o[6],f=o[7];return Lt(Math.min(s,l,h,A),Math.min(a,u,c,f),Math.max(s,l,h,A),Math.max(a,u,c,f),i)}function Wt(t,e,r,n){var i=e*n[0]/2,o=e*n[1]/2,s=Math.cos(r),a=Math.sin(r),l=i*s,u=i*a,h=o*s,c=o*a,A=t[0],f=t[1];return[A-l+c,f-u-h,A-l-c,f-u+h,A+l-c,f+u+h,A+l+c,f+u-h,A-l+c,f-u-h]}function Xt(t){return t[3]-t[1]}function Yt(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return te(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]):Mt(n),n}function Zt(t){return[t[0],t[3]]}function Jt(t){return[t[2],t[3]]}function $t(t){return t[2]-t[0]}function te(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ee(t){return t[2]<t[0]||t[3]<t[1]}function re(t,e){var r=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=r,t[2]+=r,t[1]-=n,t[3]+=n}function ne(t,e,r,n){var i=[];if(n>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<n;++a)i.push(t[0]+o*a/n,t[1],t[2],t[1]+s*a/n,t[2]-o*a/n,t[3],t[0],t[3]-s*a/n);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var l=[],u=[],h=(a=0,i.length);a<h;a+=2)l.push(i[a]),u.push(i[a+1]);return function(t,e,r){return Lt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(l,u,r)}function ie(t,e){var r=e.getExtent(),n=Vt(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var i=$t(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}var oe=function(){function t(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}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||tt[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();const se=oe;function ae(t,e,r){return Math.min(Math.max(t,e),r)}var le="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},ue="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function he(t,e,r,n,i,o){var s=i-r,a=o-n;if(0!==s||0!==a){var l=((t-r)*s+(e-n)*a)/(s*s+a*a);l>1?(r=i,n=o):l>0&&(r+=s*l,n+=a*l)}return ce(t,e,r,n)}function ce(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function Ae(t){return t*Math.PI/180}function fe(t,e){var r=t%e;return r*e<0?r+e:r}function pe(t,e,r){return t+r*(e-t)}function de(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function ge(t,e){return Math.round(de(t,e))}function ye(t,e){return Math.floor(de(t,e))}function me(t,e){return Math.ceil(de(t,e))}var ve=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_e=6378137,we=Math.PI*_e,be=[-we,-we,we,we],xe=[-180,-85,180,85],Ee=_e*Math.log(Math.tan(Math.PI/2)),Ce=function(t){function e(e){return t.call(this,{code:e,units:et.METERS,extent:be,global:!0,worldExtent:xe,getPointResolution:function(t,e){return t/le(e[1]/_e)}})||this}return ve(e,t),e}(se),Se=[new Ce("EPSG:3857"),new Ce("EPSG:102100"),new Ce("EPSG:102113"),new Ce("EPSG:900913"),new Ce("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ce("http://www.opengis.net/gml/srs/epsg.xml#3857")],Be=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ie=[-180,-90,180,90],Te=6378137*Math.PI/180,Pe=function(t){function e(e,r){return t.call(this,{code:e,units:et.DEGREES,extent:Ie,axisOrientation:r,global:!0,metersPerUnit:Te,worldExtent:Ie})||this}return Be(e,t),e}(se),Fe=[new Pe("CRS:84"),new Pe("EPSG:4326","neu"),new Pe("urn:ogc:def:crs:OGC:1.3:CRS84"),new Pe("urn:ogc:def:crs:OGC:2:84"),new Pe("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Pe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Pe("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Le={},Me={};function Oe(t,e,r){var n=t.getCode(),i=e.getCode();n in Me||(Me[n]={}),Me[n][i]=r}function ke(t,e){var r;return t in Me&&e in Me[t]&&(r=Me[t][e]),r}function Ne(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),s=parseInt(n[i]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}function Re(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Ue(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],s=t[0]-i,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[i+r*s/l,o+r*a/l]}function De(t,e){var r,n,i=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],A=h-l,f=c-u,p=0===A&&0===f?0:(A*(i-l)+f*(o-u))/(A*A+f*f||0);return p<=0?(r=l,n=u):p>=1?(r=h,n=c):(r=l+p*A,n=u+p*f),[r,n]}function Qe(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function Ge(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function je(t,e){return t[0]*=e,t[1]*=e,t}function He(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function ze(t,e){return Math.sqrt(He(t,e))}function Ve(t,e){if(e.canWrapX()){var r=$t(e.getExtent()),n=Ke(t,e,r);n&&(t[0]-=n*r)}return t}function Ke(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=r||$t(n);i=Math.floor((t[0]-n[0])/o)}return i}var qe=6371008.8;function We(t,e,r){var n=r||qe,i=Ae(t[1]),o=Ae(e[1]),s=(o-i)/2,a=Ae(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Xe(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=We(t[n],t[n+1],e);return r}function Ye(t,e){var r=e||{},n=r.radius||qe,i=r.projection||"EPSG:3857",o=t.getType();"GeometryCollection"!==o&&(t=t.clone().transform(i,"EPSG:4326"));var s,a,l,u,h,c,A=0;switch(o){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":A=Xe(s=t.getCoordinates(),n);break;case"MultiLineString":case"Polygon":for(l=0,u=(s=t.getCoordinates()).length;l<u;++l)A+=Xe(s[l],n);break;case"MultiPolygon":for(l=0,u=(s=t.getCoordinates()).length;l<u;++l)for(h=0,c=(a=s[l]).length;h<c;++h)A+=Xe(a[h],n);break;case"GeometryCollection":var f=t.getGeometries();for(l=0,u=f.length;l<u;++l)A+=Ye(f[l],e);break;default:throw new Error("Unsupported geometry type: "+o)}return A}function Ze(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],s=0;s<n;s++){var a=t[s][0],l=t[s][1];r+=Ae(a-i)*(2+Math.sin(Ae(o))+Math.sin(Ae(l))),i=a,o=l}return r*e*e/2}function Je(t,e){var r=e||{},n=r.radius||qe,i=r.projection||"EPSG:3857",o=t.getType();"GeometryCollection"!==o&&(t=t.clone().transform(i,"EPSG:4326"));var s,a,l,u,h,c,A=0;switch(o){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(s=t.getCoordinates(),A=Math.abs(Ze(s[0],n)),l=1,u=s.length;l<u;++l)A-=Math.abs(Ze(s[l],n));break;case"MultiPolygon":for(l=0,u=(s=t.getCoordinates()).length;l<u;++l)for(a=s[l],A+=Math.abs(Ze(a[0],n)),h=1,c=a.length;h<c;++h)A-=Math.abs(Ze(a[h],n));break;case"GeometryCollection":var f=t.getGeometries();for(l=0,u=f.length;l<u;++l)A+=Je(f[l],e);break;default:throw new Error("Unsupported geometry type: "+o)}return A}var $e=!0;function tr(t){$e=!(void 0===t||t)}function er(t,e,r){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function rr(t,e,r){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function nr(t){!function(t,e){Le[t]=e}(t.getCode(),t),Oe(t,t,er)}function ir(t){return"string"==typeof t?Le[e=t]||Le[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function or(t,e,r,n){var i,o=(t=ir(t)).getPointResolutionFunc();if(o)i=o(e,r),n&&n!==t.getUnits()&&(a=t.getMetersPerUnit())&&(i=i*a/tt[n]);else{var s=t.getUnits();if(s==et.DEGREES&&!n||n==et.DEGREES)i=e;else{var a,l=fr(t,ir("EPSG:4326"));if(l===rr&&s!==et.DEGREES)i=e*t.getMetersPerUnit();else{var u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(We((u=l(u,u,2)).slice(0,2),u.slice(2,4))+We(u.slice(4,6),u.slice(6,8)))/2}void 0!==(a=n?tt[n]:t.getMetersPerUnit())&&(i/=a)}}return i}function sr(t){!function(t){t.forEach(nr)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Oe(e,t,er)}))}))}function ar(t,e){return t?"string"==typeof t?ir(t):t:ir(e)}function lr(t){return function(e,r,n){for(var i=e.length,o=void 0!==n?n:2,s=void 0!==r?r:new Array(i),a=0;a<i;a+=o)for(var l=t(e.slice(a,a+o)),u=l.length,h=0,c=o;h<c;++h)s[a+h]=h>=u?e[a+h]:l[h];return s}}function ur(t,e,r,n){var i=ir(t),o=ir(e);Oe(i,o,lr(r)),Oe(o,i,lr(n))}function hr(t,e){return tr(),dr(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function cr(t,e){var r=dr(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=fe(n+180,360)-180),r}function Ar(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||fr(t,e)===er)&&r}function fr(t,e){var r=ke(t.getCode(),e.getCode());return r||(r=rr),r}function pr(t,e){return fr(ir(t),ir(e))}function dr(t,e,r){return pr(e,r)(t,void 0,t.length)}function gr(t,e,r,n){return ne(t,pr(e,r),void 0,n)}var yr,mr,vr,_r=null;function wr(){return _r}function br(t,e){return t}function xr(t,e){return $e&&!Qe(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&($e=!1),t}function Er(t,e){return t}function Cr(t,e){return t}function Sr(t,e,r){return function(n){var i,o;if(t.canWrapX()){var s=t.getExtent(),a=$t(s);(o=Ke(n=n.slice(0),t,a))&&(n[0]=n[0]-o*a),n[0]=ae(n[0],s[0],s[2]),n[1]=ae(n[1],s[1],s[3]),i=r(n)}else i=r(n);return o&&e.canWrapX()&&(i[0]+=o*$t(e.getExtent())),i}}function Br(t,e,r,n,i,o){for(var s=o||[],a=0,l=e;l<r;l+=n){var u=t[l],h=t[l+1];s[a++]=i[0]*u+i[2]*h+i[4],s[a++]=i[1]*u+i[3]*h+i[5]}return o&&s.length!=a&&(s.length=a),s}function Ir(t,e,r,n,i,o,s){for(var a=s||[],l=Math.cos(i),u=Math.sin(i),h=o[0],c=o[1],A=0,f=e;f<r;f+=n){var p=t[f]-h,d=t[f+1]-c;a[A++]=h+p*l-d*u,a[A++]=c+p*u+d*l;for(var g=f+2;g<f+n;++g)a[A++]=t[g]}return s&&a.length!=A&&(a.length=A),a}function Tr(t,e,r,n,i,o,s){for(var a=s||[],l=0,u=e;u<r;u+=n){a[l++]=t[u]+i,a[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)a[l++]=t[h]}return s&&a.length!=l&&(a.length=l),a}sr(Se),sr(Fe),yr=Se,mr=function(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var s=0;s<n;s+=i){o[s]=we*t[s]/180;var a=_e*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Ee?a=Ee:a<-Ee&&(a=-Ee),o[s+1]=a}return o},vr=function(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var s=0;s<n;s+=i)o[s]=180*t[s]/we,o[s+1]=360*Math.atan(Math.exp(t[s+1]/_e))/Math.PI-90;return o},Fe.forEach((function(t){yr.forEach((function(e){Oe(t,e,mr),Oe(e,t,vr)}))}));var Pr=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fr=[1,0,0,1,0,0],Lr=function(t){function e(){var e=t.call(this)||this;return e.extent_=[1/0,1/0,-1/0,-1/0],e.extentRevision_=-1,e.simplifiedGeometryMaxMinSquaredTolerance=0,e.simplifiedGeometryRevision=0,e.simplifyTransformedInternal=function(t){var e,r,n,i=!1;return function(){var o=Array.prototype.slice.call(arguments);return i&&this===n&&m(o,r)||(i=!0,n=this,r=o,e=t.apply(this,arguments)),e}}((function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)})),e}return Pr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return n()},e.prototype.closestPointXY=function(t,e,r,i){return n()},e.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},e.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return n()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Mt(e),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)},e.prototype.rotate=function(t,e){n()},e.prototype.scale=function(t,e,r){n()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return n()},e.prototype.getType=function(){return n()},e.prototype.applyTransform=function(t){n()},e.prototype.intersectsExtent=function(t){return n()},e.prototype.translate=function(t,e){n()},e.prototype.transform=function(t,e){var r=ir(t),n=r.getUnits()==et.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),s=r.getWorldExtent(),a=Xt(s)/Xt(o);return _t(Fr,s[0],s[3],a,-a,0,0,0),Br(t,0,t.length,i,Fr,n),pr(r,e)(t,n,i)}:pr(r,e);return this.applyTransform(n),this},e}(D);const Mr=Lr;var Or=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kr=function(t){function e(){var e=t.call(this)||this;return e.layout=Y.XY,e.stride=2,e.flatCoordinates=null,e}return Or(e,t),e.prototype.computeExtent=function(t){return kt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return n()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=Nr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){n()},e.prototype.setLayout=function(t,e,r){var n;if(t)n=Nr(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=Y.XY,void(this.stride=2);e=e[0]}t=function(t){var e;return 2==t?e=Y.XY:3==t?e=Y.XYZ:4==t&&(e=Y.XYZM),e}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Ir(r,0,r.length,n,t,e,r),this.changed()}},e.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=Vt(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,r,n,i,o,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,A=0;A<r;A+=n){var f=t[A]-u,p=t[A+1]-h;l[c++]=u+i*f,l[c++]=h+o*p;for(var d=A+2;d<A+n;++d)l[c++]=t[d]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,s,t,n,i,o),this.changed()}},e.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Tr(r,0,r.length,n,t,e,r),this.changed()}},e}(Mr);function Nr(t){var e;return t==Y.XY?e=2:t==Y.XYZ||t==Y.XYM?e=3:t==Y.XYZM&&(e=4),e}const Rr=kr;function Ur(t,e,r,n,i,o,s){var a,l=t[e],u=t[e+1],h=t[r]-l,c=t[r+1]-u;if(0===h&&0===c)a=e;else{var A=((i-l)*h+(o-u)*c)/(h*h+c*c);if(A>1)a=r;else{if(A>0){for(var f=0;f<n;++f)s[f]=pe(t[e+f],t[r+f],A);return void(s.length=n)}a=e}}for(f=0;f<n;++f)s[f]=t[a+f];s.length=n}function Dr(t,e,r,n,i){var o=t[e],s=t[e+1];for(e+=n;e<r;e+=n){var a=t[e],l=t[e+1],u=ce(o,s,a,l);u>i&&(i=u),o=a,s=l}return i}function Qr(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o){var a=r[o];i=Dr(t,e,a,n,i),e=a}return i}function Gr(t,e,r,n,i,o,s,a,l,u,h){if(e==r)return u;var c,A;if(0===i){if((A=ce(s,a,t[e],t[e+1]))<u){for(c=0;c<n;++c)l[c]=t[e+c];return l.length=n,A}return u}for(var f=h||[NaN,NaN],p=e+n;p<r;)if(Ur(t,p-n,p,n,s,a,f),(A=ce(s,a,f[0],f[1]))<u){for(u=A,c=0;c<n;++c)l[c]=f[c];l.length=n,p+=n}else p+=n*Math.max((Math.sqrt(A)-Math.sqrt(u))/i|0,1);if(o&&(Ur(t,r-n,e,n,s,a,f),(A=ce(s,a,f[0],f[1]))<u)){for(u=A,c=0;c<n;++c)l[c]=f[c];l.length=n}return u}function jr(t,e,r,n,i,o,s,a,l,u,h){for(var c=h||[NaN,NaN],A=0,f=r.length;A<f;++A){var p=r[A];u=Gr(t,e,p,n,i,o,s,a,l,u,c),e=p}return u}function Hr(t,e,r,n){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function zr(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var s=r[i],a=0;a<n;++a)t[e++]=s[a];return e}function Vr(t,e,r,n,i){for(var o=i||[],s=0,a=0,l=r.length;a<l;++a){var u=zr(t,e,r[a],n);o[s++]=u,e=u}return o.length=s,o}function Kr(t,e,r,n,i,o,s){var a=(r-e)/n;if(a<3){for(;e<r;e+=n)o[s++]=t[e],o[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,r-n],h=0;u.length>0;){for(var c=u.pop(),A=u.pop(),f=0,p=t[A],d=t[A+1],g=t[c],y=t[c+1],m=A+n;m<c;m+=n){var v=he(t[m],t[m+1],p,d,g,y);v>f&&(h=m,f=v)}f>i&&(l[(h-e)/n]=1,A+n<h&&u.push(A,h),h+n<c&&u.push(h,c))}for(m=0;m<a;++m)l[m]&&(o[s++]=t[e+m*n],o[s++]=t[e+m*n+1]);return s}function qr(t,e){return e*Math.round(t/e)}function Wr(t,e,r,n,i,o,s){if(e==r)return s;var a,l,u=qr(t[e],i),h=qr(t[e+1],i);e+=n,o[s++]=u,o[s++]=h;do{if(a=qr(t[e],i),l=qr(t[e+1],i),(e+=n)==r)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<r;){var c=qr(t[e],i),A=qr(t[e+1],i);if(e+=n,c!=a||A!=l){var f=a-u,p=l-h,d=c-u,g=A-h;f*g==p*d&&(f<0&&d<f||f==d||f>0&&d>f)&&(p<0&&g<p||p==g||p>0&&g>p)?(a=c,l=A):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=A)}}return o[s++]=a,o[s++]=l,s}function Xr(t,e,r,n,i,o,s,a){for(var l=0,u=r.length;l<u;++l){var h=r[l];s=Wr(t,e,h,n,i,o,s),a.push(s),e=h}return s}function Yr(t,e,r,n,i){for(var o=void 0!==i?i:[],s=0,a=e;a<r;a+=n)o[s++]=t.slice(a,a+n);return o.length=s,o}function Zr(t,e,r,n,i){for(var o=void 0!==i?i:[],s=0,a=0,l=r.length;a<l;++a){var u=r[a];o[s++]=Yr(t,e,u,n,o[s]),e=u}return o.length=s,o}function Jr(t,e,r,n,i){for(var o=void 0!==i?i:[],s=0,a=0,l=r.length;a<l;++a){var u=r[a];o[s++]=Zr(t,e,u,n,o[s]),e=u[u.length-1]}return o.length=s,o}function $r(t,e,r,n){for(var i=0,o=t[r-n],s=t[r-n+1];e<r;e+=n){var a=t[e],l=t[e+1];i+=s*a-o*l,o=a,s=l}return i/2}function tn(t,e,r,n){for(var i=0,o=0,s=r.length;o<s;++o){var a=r[o];i+=$r(t,e,a,n),e=a}return i}var en=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const rn=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return en(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<Bt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Dr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return $r(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Yr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Kr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,Y.XY)},e.prototype.getType=function(){return"LinearRing"},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Rr);var nn=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const on=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return nn(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=ce(t,e,i[0],i[1]);if(o<n){for(var s=this.stride,a=0;a<s;++a)r[a]=i[a];return r.length=s,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return Ot(this.flatCoordinates,t)},e.prototype.getType=function(){return"Point"},e.prototype.intersectsExtent=function(t){return Pt(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Hr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Rr);function sn(t,e,r,n,i){return!Gt(i,(function(i){return!an(t,e,r,n,i[0],i[1])}))}function an(t,e,r,n,i,o){for(var s=0,a=t[r-n],l=t[r-n+1];e<r;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(u-a)*(o-l)-(i-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(i-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function ln(t,e,r,n,i,o){if(0===r.length)return!1;if(!an(t,e,r[0],n,i,o))return!1;for(var s=1,a=r.length;s<a;++s)if(an(t,r[s-1],r[s],n,i,o))return!1;return!0}function un(t,e,r,n,i,o,s){for(var a,l,u,h,c,A,p,d=i[o+1],g=[],y=0,m=r.length;y<m;++y){var v=r[y];for(h=t[v-n],A=t[v-n+1],a=e;a<v;a+=n)c=t[a],p=t[a+1],(d<=A&&p<=d||A<=d&&d<=p)&&(u=(d-A)/(p-A)*(c-h)+h,g.push(u)),h=c,A=p}var _=NaN,w=-1/0;for(g.sort(f),h=g[0],a=1,l=g.length;a<l;++a){c=g[a];var b=Math.abs(c-h);b>w&&ln(t,e,r,n,u=(h+c)/2,d)&&(_=u,w=b),h=c}return isNaN(_)&&(_=i[o]),s?(s.push(_,d,w),s):[_,d,w]}function hn(t,e,r,n,i){for(var o=[],s=0,a=r.length;s<a;++s){var l=r[s];o=un(t,e,l,n,i,2*s,o),e=l[l.length-1]}return o}function cn(t,e,r,n,i){var o;for(e+=n;e<r;e+=n)if(o=i(t.slice(e-n,e),t.slice(e,e+n)))return o;return!1}function An(t,e,r,n,i){var o=Dt([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!te(i,o)&&(!!Tt(i,o)||o[0]>=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]||cn(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=Ft(t,e),o=Ft(t,r);if(i===xt.INTERSECTING||o===xt.INTERSECTING)n=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],A=r[0],f=r[1],p=(f-c)/(A-h),d=void 0,g=void 0;o&xt.ABOVE&&!(i&xt.ABOVE)&&(n=(d=A-(f-u)/p)>=s&&d<=l),n||!(o&xt.RIGHT)||i&xt.RIGHT||(n=(g=f-(A-l)*p)>=a&&g<=u),n||!(o&xt.BELOW)||i&xt.BELOW||(n=(d=A-(f-a)/p)>=s&&d<=l),n||!(o&xt.LEFT)||i&xt.LEFT||(n=(g=f-(A-s)*p)>=a&&g<=u)}return n}(i,t,e)})))}function fn(t,e,r,n,i){return!!(An(t,e,r,n,i)||an(t,e,r,n,i[0],i[1])||an(t,e,r,n,i[0],i[3])||an(t,e,r,n,i[2],i[1])||an(t,e,r,n,i[2],i[3]))}function pn(t,e,r,n,i){if(!fn(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,s=r.length;o<s;++o)if(sn(t,r[o-1],r[o],n,i)&&!An(t,r[o-1],r[o],n,i))return!1;return!0}function dn(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i],t[r-n+i]=o}e+=n,r-=n}}function gn(t,e,r,n){for(var i=0,o=t[r-n],s=t[r-n+1];e<r;e+=n){var a=t[e],l=t[e+1];i+=(a-o)*(l+s),o=a,s=l}return 0===i?void 0:i>0}function yn(t,e,r,n,i){for(var o=void 0!==i&&i,s=0,a=r.length;s<a;++s){var l=r[s],u=gn(t,e,l,n);if(0===s){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function mn(t,e,r,n,i){for(var o=void 0!==i&&i,s=0,a=r.length;s<a;++s){var l=r[s],u=gn(t,e,l,n);(0===s?o&&u||!o&&!u:o&&!u||!o&&u)&&dn(t,e,l,n),e=l}return e}function vn(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o)e=mn(t,e,r[o],n,i);return e}function _n(t,e){for(var r=[],n=0,i=0,o=0,s=e.length;o<s;++o){var a=e[o];if(gn(t,n,a,2)){if(0===r.length)continue;r[r.length-1].push(e[i])}else r.push(e.slice(i,o+1));i=o+1,n=a}return r}var wn=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bn=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return wn(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?y(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<Bt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return ln(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return tn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?mn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Zr(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Vt(this.getExtent());this.flatInteriorPoint_=un(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new on(this.getFlatInteriorPoint(),Y.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new rn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,s=r.length;o<s;++o){var a=r[o],l=new rn(e.slice(i,a),t);n.push(l),i=a}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;yn(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=mn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=Xr(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,Y.XY,n)},e.prototype.getType=function(){return"Polygon"},e.prototype.intersectsExtent=function(t){return pn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=Vr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(Rr);const xn=bn;function En(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new bn(o,Y.XY,[o.length])}function Cn(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=i*(n+1),l=new Array(a),u=0;u<a;u+=i){l[u]=0,l[u+1]=0;for(var h=2;h<i;h++)l[u+h]=s[h]}var c=[l.length],A=new bn(l,o,c);return function(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),s=i.length/o-1,a=n||0,l=0;l<=s;++l){var u=l*o,h=a+2*fe(l,s)*Math.PI/s;i[u]=e[0]+r*Math.cos(h),i[u+1]=e[1]+r*Math.sin(h)}t.changed()}(A,s,t.getRadius(),r),A}const Sn="prerender",Bn="postrender",In="precompose",Tn="postcompose",Pn="rendercomplete",Fn=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();function Ln(t,e,r,n,i,o,s){var a,l,u=(r-e)/n;if(1===u)a=e;else if(2===u)a=e,l=i;else if(0!==u){for(var h=t[e],c=t[e+1],A=0,p=[0],d=e+n;d<r;d+=n){var g=t[d],y=t[d+1];A+=Math.sqrt((g-h)*(g-h)+(y-c)*(y-c)),p.push(A),h=g,c=y}var m=i*A,v=function(t,e,r){for(var n,i,o=f,s=0,a=t.length,l=!1;s<a;)(i=+o(t[n=s+(a-s>>1)],e))<0?s=n+1:(a=n,l=!i);return l?s:~s}(p,m);v<0?(l=(m-p[-v-2])/(p[-v-1]-p[-v-2]),a=e+(-v-2)*n):a=e+v*n}var _=s>1?s:2,w=o||new Array(_);for(d=0;d<_;++d)w[d]=void 0===a?NaN:void 0===l?t[a+d]:pe(t[a+d],t[a+n+d],l);return w}function Mn(t,e,r,n,i,o){if(r==e)return null;var s;if(i<t[e+n-1])return o?((s=t.slice(e,e+n))[n-1]=i,s):null;if(t[r-1]<i)return o?((s=t.slice(r-n,r))[n-1]=i,s):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var a=e/n,l=r/n;a<l;){var u=a+l>>1;i<t[(u+1)*n-1]?l=u:a=u+1}var h=t[a*n-1];if(i==h)return t.slice((a-1)*n,(a-1)*n+n);var c=(i-h)/(t[(a+1)*n-1]-h);s=[];for(var A=0;A<n-1;++A)s.push(pe(t[(a-1)*n+A],t[a*n+A],c));return s.push(i),s}function On(t,e,r,n){for(var i=t[e],o=t[e+1],s=0,a=e+n;a<r;a+=n){var l=t[a],u=t[a+1];s+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return s}var kn=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Nn=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return kn(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?y(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<Bt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Dr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.forEachSegment=function(t){return cn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Y.XYM&&this.layout!=Y.XYZM)return null;var r=void 0!==e&&e;return Mn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return Yr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Ln(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return On(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Kr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,Y.XY)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(t){return An(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Rr),Rn=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Un={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Dn(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function Qn(t){return t[0]>0&&t[1]>0}function Gn(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function jn(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}const Hn=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=jn(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return n()},t.prototype.getImage=function(t){return n()},t.prototype.getHitDetectionImage=function(){return n()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return n()},t.prototype.getImageSize=function(){return n()},t.prototype.getOrigin=function(){return n()},t.prototype.getSize=function(){return n()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=jn(t)},t.prototype.listenImageChange=function(t){n()},t.prototype.load=function(){n()},t.prototype.unlistenImageChange=function(t){n()},t}();var zn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Vn=/^([a-z]*)$|^hsla?\(.*\)$/i;function Kn(t){return"string"==typeof t?t:$n(t)}function qn(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var Wn,Xn,Yn=(Wn={},Xn=0,function(t){var e;if(Wn.hasOwnProperty(t))e=Wn[t];else{if(Xn>=1024){var r=0;for(var n in Wn)0==(3&r++)&&(delete Wn[n],--Xn)}e=function(t){var e,r,n,i,o;if(Vn.exec(t)&&(t=qn(t)),zn.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),r=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),i=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,l&&(i=(i<<4)+i)),o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?Jn(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Jn(o)):K(!1,14);return o}(t),Wn[t]=e,++Xn}return e});function Zn(t){return Array.isArray(t)?t:Yn(t)}function Jn(t){return t[0]=ae(t[0]+.5|0,0,255),t[1]=ae(t[1]+.5|0,0,255),t[2]=ae(t[2]+.5|0,0,255),t[3]=ae(t[3],0,1),t}function $n(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function ti(t){return Array.isArray(t)?$n(t):t}function ei(t,e,r,n){var i;return i=r&&r.length?r.shift():ut?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",n)}function ri(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function ni(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+(parseInt(r.marginLeft,10)+parseInt(r.marginRight,10))}function ii(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+(parseInt(r.marginTop,10)+parseInt(r.marginBottom,10))}function oi(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function si(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function ai(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var li="ol-hidden",ui="ol-selectable",hi="ol-unselectable",ci="ol-control",Ai="ol-collapsed",fi=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),pi=["style","variant","weight","size","lineHeight","family"],di=function(t){var e=t.match(fi);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=pi.length;n<i;++n){var o=e[n+1];void 0!==o&&(r[pi[n]]=o)}return r.families=r.family.split(/,\s?/),r},gi="10px sans-serif",yi="#000",mi="round",vi=[],_i="round",wi="#000",bi="center",xi="middle",Ei=[0,0,0,0],Ci=new D;(new I).setSize=function(){};var Si,Bi,Ii=null,Ti={},Pi=function(){var t,e,r=100,n="32px ",i=["monospace","serif"],o=i.length,s="wmytzilWMYTZIL@#/&?$%10";function a(t,r,a){for(var l=!0,u=0;u<o;++u){var h=i[u];if(e=Mi(t+" "+r+" "+n+h,s),a!=h){var c=Mi(t+" "+r+" "+n+a+","+h,s);l=l&&c!=e}}return!!l}function l(){for(var e=!0,n=Ci.getKeys(),i=0,o=n.length;i<o;++i){var s=n[i];Ci.get(s)<r&&(a.apply(this,s.split("\n"))?(x(Ti),Ii=null,Si=void 0,Ci.set(s,r)):(Ci.set(s,Ci.get(s)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=di(e);if(n)for(var i=n.families,o=0,s=i.length;o<s;++o){var u=i[o],h=n.style+"\n"+n.weight+"\n"+u;void 0===Ci.get(h)&&(Ci.set(h,r,!0),a(n.style,n.weight,u)||(Ci.set(h,0,!0),void 0===t&&(t=setInterval(l,32))))}}}(),Fi=function(t){var e=Ti[t];if(null==e){if(ut){var r=di(t),n=Li(t,"Žg");e=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else Bi||((Bi=document.createElement("div")).innerHTML="M",Bi.style.minHeight="0",Bi.style.maxHeight="none",Bi.style.height="auto",Bi.style.padding="0",Bi.style.border="none",Bi.style.position="absolute",Bi.style.display="block",Bi.style.left="-99999px"),Bi.style.font=t,document.body.appendChild(Bi),e=Bi.offsetHeight,document.body.removeChild(Bi);Ti[t]=e}return e};function Li(t,e){return Ii||(Ii=ei(1,1)),t!=Si&&(Ii.font=t,Si=Ii.font),Ii.measureText(e)}function Mi(t,e){return Li(t,e).width}function Oi(t,e,r){if(e in r)return r[e];var n=e.split("\n").reduce((function(e,r){return Math.max(e,Mi(t,r))}),0);return r[e]=n,n}var ki=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ni=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})||this).canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return ki(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var r=this.renderOptions_,n=ei(r.size*t,r.size*t);this.draw_(r,n,t),e=n.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Un.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(t){this.stroke_=t,this.render()},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,r){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,i=void 0===this.radius2_?n:this.radius2_;if(n<i){var o=n;n=i,i=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=i*Math.sin(a),u=n-Math.sqrt(i*i-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=r)return c*e;var A=e/2/c,f=e/2*(u/h),p=Math.sqrt((n+A)*(n+A)+f*f)-n;if(void 0===this.radius2_||"bevel"===t)return 2*p;var d=n*Math.sin(a),g=i-Math.sqrt(n*n-d*d),y=Math.sqrt(d*d+g*g)/d;if(y<=r){var m=y*e/2-i-n;return 2*Math.max(p,m)}return 2*p},e.prototype.createRenderOptions=function(){var t,e=_i,r=0,n=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=wi),t=ti(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=_i),void 0===(r=this.stroke_.getMiterLimit())&&(r=10));var s=this.calculateLineJoinSize_(e,o,r),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:n,lineDashOffset:i,lineJoin:e,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,r){if(e.scale(r,r),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n=yi),e.fillStyle=ti(n),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=Zn(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=ei(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,r=this.radius_;if(e===1/0)t.arc(0,0,r,0,2*Math.PI);else{var n=void 0===this.radius2_?r:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=i+s*o,l=s%2==0?r:n;t.lineTo(l*Math.cos(a),l*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=yi,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Hn);const Ri=Ni;var Ui=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Di=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:void 0!==r.scale?r.scale:1,rotation:void 0!==r.rotation?r.rotation:0,rotateWithView:void 0!==r.rotateWithView&&r.rotateWithView,displacement:void 0!==r.displacement?r.displacement:[0,0],declutterMode:r.declutterMode})||this}return Ui(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Ri);var Qi=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=zi,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=zi,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}(),Gi=null;function ji(t,e){if(!Gi){var r=new Fn({color:"rgba(255,255,255,0.4)"}),n=new Rn({color:"#3399CC",width:1.25});Gi=[new Qi({image:new Di({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return Gi}function Hi(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t.Polygon=[new Qi({fill:new Fn({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Qi({stroke:new Rn({color:e,width:5})}),new Qi({stroke:new Rn({color:r,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Qi({image:new Di({radius:6,fill:new Fn({color:r}),stroke:new Rn({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function zi(t){return t.getGeometry()}const Vi=Qi,Ki={POINT:"point",LINE:"line"};var qi="#333";const Wi=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=jn(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Fn({color:qi}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Ki.POINT,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getJustify=function(){return this.justify_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=jn(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setJustify=function(t){this.justify_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Xi={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var Yi=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Zi=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un,r.background_=e.background;var n=b({},e);return"object"==typeof e.properties&&(delete n.properties,b(n,e.properties)),n[Xi.OPACITY]=void 0!==e.opacity?e.opacity:1,K("number"==typeof n[Xi.OPACITY],64),n[Xi.VISIBLE]=void 0===e.visible||e.visible,n[Xi.Z_INDEX]=e.zIndex,n[Xi.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,n[Xi.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,n[Xi.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,n[Xi.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?n.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return Yi(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=ae(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r||e.managed?r:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return n()},e.prototype.getLayerStatesArray=function(t){return n()},e.prototype.getExtent=function(){return this.get(Xi.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(Xi.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(Xi.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(Xi.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(Xi.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(Xi.OPACITY)},e.prototype.getSourceState=function(){return n()},e.prototype.getVisible=function(){return this.get(Xi.VISIBLE)},e.prototype.getZIndex=function(){return this.get(Xi.Z_INDEX)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(Xi.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(Xi.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(Xi.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(Xi.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(Xi.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){K("number"==typeof t,64),this.set(Xi.OPACITY,t)},e.prototype.setVisible=function(t){this.set(Xi.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(Xi.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(D);var Ji=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function $i(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const to=function(t){function e(e){var r=this,n=b({},e);delete n.source,(r=t.call(this,n)||this).on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addChangeListener(Xi.SOURCE,r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return Ji(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Xi.SOURCE)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(L(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=P(t,T.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return this.rendered=!0,r.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Xi.MAP,t)},e.prototype.getMapInternal=function(){return this.get(Xi.MAP)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(L(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(L(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=P(t,In,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);K(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=P(this,T.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xi.SOURCE,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Zi);function eo(t,e,r,n,i){ro(t,e,r||0,n||t.length-1,i||io)}function ro(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,s=e-r+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);ro(t,e,Math.max(r,Math.floor(e-s*l/o+u)),Math.min(n,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=r,A=n;for(no(t,r,e),i(t[n],h)>0&&no(t,r,n);c<A;){for(no(t,c,A),c++,A--;i(t[c],h)<0;)c++;for(;i(t[A],h)>0;)A--}0===i(t[r],h)?no(t,r,A):no(t,++A,n),A<=e&&(r=A+1),e<=A&&(n=A-1)}}function no(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function io(t,e){return t<e?-1:t>e?1:0}let oo=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const r=[];if(!yo(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;yo(t,a)&&(e.leaf?r.push(s):go(t,a)?this._all(s,r):i.push(s))}e=i.pop()}return r}collides(t){let e=this.data;if(!yo(t,e))return!1;const r=[];for(;e;){for(let n=0;n<e.children.length;n++){const i=e.children[n],o=e.leaf?this.toBBox(i):i;if(yo(t,o)){if(e.leaf||go(t,o))return!0;r.push(i)}}e=r.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=mo([]),this}remove(t,e){if(!t)return this;let r=this.data;const n=this.toBBox(t),i=[],o=[];let s,a,l;for(;r||i.length;){if(r||(r=i.pop(),a=i[i.length-1],s=o.pop(),l=!0),r.leaf){const n=so(t,r.children,e);if(-1!==n)return r.children.splice(n,1),i.push(r),this._condense(i),this}l||r.leaf||!go(r,n)?a?(s++,r=a.children[s],l=!1):r=null:(i.push(r),o.push(s),s=0,a=r,r=r.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const r=[];for(;t;)t.leaf?e.push(...t.children):r.push(...t.children),t=r.pop();return e}_build(t,e,r,n){const i=r-e+1;let o,s=this._maxEntries;if(i<=s)return o=mo(t.slice(e,r+1)),ao(o,this.toBBox),o;n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,n-1))),o=mo([]),o.leaf=!1,o.height=n;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));vo(t,e,r,l,this.compareMinX);for(let u=e;u<=r;u+=l){const e=Math.min(u+l-1,r);vo(t,u,e,a,this.compareMinY);for(let r=u;r<=e;r+=a){const i=Math.min(r+a-1,e);o.children.push(this._build(t,r,i,n-1))}}return ao(o,this.toBBox),o}_chooseSubtree(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){let r,n=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=Ao(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<s?(s=h,n=u<n?u:n,r=l):h===s&&u<n&&(n=u,r=l)}e=r||e.children[0]}var i,o;return e}_insert(t,e,r){const n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),uo(o,n);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)}_split(t,e){const r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n),s=mo(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,ao(r,this.toBBox),ao(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)}_splitRoot(t,e){this.data=mo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ao(this.data,this.toBBox)}_chooseSplitIndex(t,e,r){let n,i=1/0,o=1/0;for(let s=e;s<=r-e;s++){const e=lo(t,0,s,this.toBBox),a=lo(t,s,r,this.toBBox),l=po(e,a),u=Ao(e)+Ao(a);l<i?(i=l,n=s,o=u<o?u:o):l===i&&u<o&&(o=u,n=s)}return n||r-e}_chooseSplitAxis(t,e,r){const n=t.leaf?this.compareMinX:ho,i=t.leaf?this.compareMinY:co;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);const i=this.toBBox,o=lo(t,0,e,i),s=lo(t,r-e,r,i);let a=fo(o)+fo(s);for(let l=e;l<r-e;l++){const e=t.children[l];uo(o,t.leaf?i(e):e),a+=fo(o)}for(let l=r-e-1;l>=e;l--){const e=t.children[l];uo(s,t.leaf?i(e):e),a+=fo(s)}return a}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)uo(e[n],t)}_condense(t){for(let e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():ao(t[r],this.toBBox)}};function so(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function ao(t,e){lo(t,0,t.children.length,e,t)}function lo(t,e,r,n,i){i||(i=mo(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<r;o++){const e=t.children[o];uo(i,t.leaf?n(e):e)}return i}function uo(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function ho(t,e){return t.minX-e.minX}function co(t,e){return t.minY-e.minY}function Ao(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function fo(t){return t.maxX-t.minX+(t.maxY-t.minY)}function po(t,e){const r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function go(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function yo(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function mo(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function vo(t,e,r,n,i){const o=[e,r];for(;o.length;){if((r=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((r-e)/n/2)*n;eo(t,s,e,r,i),o.push(e,s,s,r)}}const _o=Object.freeze(Object.defineProperty({__proto__:null,default:oo},Symbol.toStringTag,{value:"Module"}));var wo=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bo="renderOrder";const xo=function(t){function e(e){var r=this,n=e||{},i=b({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return wo(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(bo)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new oo(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(bo,t)},e.prototype.setStyle=function(t){var e,r,n;this.style_=void 0!==t?t:ji,this.styleFunction_=null===t?void 0:("function"==typeof(e=this.style_)?r=e:(Array.isArray(e)?n=e:(K("function"==typeof e.getZIndex,41),n=[e]),r=function(){return n}),r),this.changed()},e}(to);var Eo={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Co=[Eo.FILL],So=[Eo.STROKE],Bo=[Eo.BEGIN_PATH],Io=[Eo.CLOSE_PATH];const To=Eo,Po=function(){function t(){}return t.prototype.drawCustom=function(t,e,r,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}();var Fo=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lo=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Fo(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var r=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;s<a;s+=e)n[0]=t[s],n[1]=t[s+1],It(r,n)&&(i[o++]=n[0],i[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,r,n,i,o){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,A=t[e],f=t[e+1],p=this.tmpCoordinate_,d=!0;for(u=e+n;u<r;u+=n)p[0]=t[u],p[1]=t[u+1],(c=Ft(l,p))!==h?(d&&(s[a++]=A,s[a++]=f,d=!1),s[a++]=p[0],s[a++]=p[1]):c===xt.INTERSECTING?(s[a++]=p[0],s[a++]=p[1],d=!1):d=!0,A=p[0],f=p[1],h=c;return(i&&d||u===e+n)&&(s[a++]=A,s[a++]=f),a},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o){var a=r[o],l=this.appendFlatLineCoordinates(t,e,a,n,!1,!1);i.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,r,n){this.beginGeometry(t,e);var i,o,s,a,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case"MultiPolygon":i=t.getOrientedFlatCoordinates(),a=[];var A=t.getEndss();l=0;for(var f=0,p=A.length;f<p;++f){var d=[];l=this.drawCustomCoordinates_(i,l,A[f],h,d),a.push(d)}this.instructions.push([To.CUSTOM,c,a,t,r,Jr]),this.hitDetectionInstructions.push([To.CUSTOM,c,a,t,n||r,Jr]);break;case"Polygon":case"MultiLineString":s=[],i="Polygon"==u?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(i,0,t.getEnds(),h,s),this.instructions.push([To.CUSTOM,c,s,t,r,Zr]),this.hitDetectionInstructions.push([To.CUSTOM,c,s,t,n||r,Zr]);break;case"LineString":case"Circle":i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,h,!1,!1),this.instructions.push([To.CUSTOM,c,o,t,r,Yr]),this.hitDetectionInstructions.push([To.CUSTOM,c,o,t,n||r,Yr]);break;case"MultiPoint":i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,h))>c&&(this.instructions.push([To.CUSTOM,c,o,t,r,Yr]),this.hitDetectionInstructions.push([To.CUSTOM,c,o,t,n||r,Yr]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([To.CUSTOM,c,o,t,r]),this.hitDetectionInstructions.push([To.CUSTOM,c,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[To.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[To.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,n,i=e.length,o=-1;for(t=0;t<i;++t)(n=(r=e[t])[0])==To.END_GEOMETRY?o=t:n==To.BEGIN_GEOMETRY&&(r[2]=t,g(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=ti(n||yi)}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=ti(i||wi);var o=e.getLineCap();r.lineCap=void 0!==o?o:mi;var s=e.getLineDash();r.lineDash=s?s.slice():vi;var a=e.getLineDashOffset();r.lineDashOffset=a||0;var l=e.getLineJoin();r.lineJoin=void 0!==l?l:_i;var u=e.getWidth();r.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[To.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[To.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!m(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[To.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=St(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Ct(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Po);const Mo=Lo;var Oo=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const ko=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return Oo(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([To.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([To.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([To.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([To.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(Mo);var No=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ro=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return No(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,r,n,!1,!1),s=[To.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([To.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,vi,0],Bo);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(So),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([To.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Bo);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(So),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(So),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(So),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Bo)},e}(Mo);const Uo=Ro;var Do=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qo=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return Do(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,a=r.length;this.instructions.push(Bo),this.hitDetectionInstructions.push(Bo);for(var l=0;l<a;++l){var u=r[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!s),A=[To.MOVE_TO_LINE_TO,h,c];this.instructions.push(A),this.hitDetectionInstructions.push(A),s&&(this.instructions.push(Io),this.hitDetectionInstructions.push(Io)),e=u}return o&&(this.instructions.push(Co),this.hitDetectionInstructions.push(Co)),s&&(this.instructions.push(So),this.hitDetectionInstructions.push(So)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([To.SET_FILL_STYLE,yi]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([To.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var l=[To.CIRCLE,a];this.instructions.push(Bo,l),this.hitDetectionInstructions.push(Bo,l),void 0!==r.fillStyle&&(this.instructions.push(Co),this.hitDetectionInstructions.push(Co)),void 0!==r.strokeStyle&&(this.instructions.push(So),this.hitDetectionInstructions.push(So)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([To.SET_FILL_STYLE,yi]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([To.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([To.SET_FILL_STYLE,yi]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([To.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=qr(r[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Mo);const Go=Qo;function jo(t,e,r,n,i){var o,s,a,l,u,h,c,A,f,p=r,d=r,g=0,y=0,m=r;for(o=r;o<n;o+=i){var v=e[o],_=e[o+1];void 0!==l&&(A=v-l,f=_-u,a=Math.sqrt(A*A+f*f),void 0!==h&&(y+=s,Math.acos((h*A+c*f)/(s*a))>t&&(y>g&&(g=y,p=m,d=o),y=0,m=o-i)),s=a,h=A,c=f),l=v,u=_}return(y+=a)>g?[m,o]:[p,d]}var Ho=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zo={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Vo=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return Ho(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,u=t.getStride();if(i.placement!==Ki.LINE||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var h=i.overflow?null:[];switch(a){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),u=2;break;case"Polygon":l=t.getFlatInteriorPoint(),i.overflow||h.push(l[2]/this.resolution),u=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();for(l=[],b=0,x=c.length;b<x;b+=3)i.overflow||h.push(c[b+2]/this.resolution),l.push(c[b],c[b+1]);if(0===l.length)return;u=2}if((P=this.appendFlatPointCoordinates(l,u))===s)return;if(h&&(P-s)/2!=l.length/u){var A=s/2;h=h.filter((function(t,e){var r=o[2*(A+e)]===l[e*u]&&o[2*(A+e)+1]===l[e*u+1];return r||--A,r}))}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=i.padding;if(f!=Ei&&(i.scale[0]<0||i.scale[1]<0)){var p=i.padding[0],d=i.padding[1],g=i.padding[2],y=i.padding[3];i.scale[0]<0&&(d=-d,y=-y),i.scale[1]<0&&(p=-p,g=-g),f=[p,d,g,y]}var m=this.pixelRatio;this.instructions.push([To.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,f==Ei?Ei:f.map((function(t){return t*m})),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var v=1/m;this.hitDetectionInstructions.push([To.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[v,v],NaN,void 0,this.declutterImageWithText_,f,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!te(this.getBufferedMaxExtent(),t.getExtent()))return;var _=void 0;if(l=t.getFlatCoordinates(),"LineString"==a)_=[l.length];else if("MultiLineString"==a)_=t.getEnds();else if("Polygon"==a)_=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var w=t.getEndss();_=[];for(var b=0,x=w.length;b<x;++b)_.push(w[b][0])}this.beginGeometry(t,e);for(var E=i.textAlign,C=0,S=void 0,B=0,I=_.length;B<I;++B){if(null==E){var T=jo(i.maxAngle,l,C,_[B],u);C=T[0],S=T[1]}else S=_[B];for(b=C;b<S;b+=u)o.push(l[b],l[b+1]);var P=o.length;C=_[B],this.drawChars_(s,P),s=P}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||bi,justify:e.justify,textBaseline:e.textBaseline||xi,scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e){var r=this.textStrokeState_,n=this.textState_,i=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=zo[n.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=r?r.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([To.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,a,u,i,c*a,h,o,1]),this.hitDetectionInstructions.push([To.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,1,u,i,c,h,o,1/a])},e.prototype.setTextStyle=function(t,e){var r,n,i;if(t){var s=t.getFill();s?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=ti(s.getColor()||yi)):(n=null,this.textFillState_=n);var a=t.getStroke();if(a){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var l=a.getLineDash(),u=a.getLineDashOffset(),h=a.getWidth(),c=a.getMiterLimit();i.lineCap=a.getLineCap()||mi,i.lineDash=l?l.slice():vi,i.lineDashOffset=void 0===u?0:u,i.lineJoin=a.getLineJoin()||_i,i.lineWidth=void 0===h?1:h,i.miterLimit=void 0===c?10:c,i.strokeStyle=ti(a.getColor()||wi)}else i=null,this.textStrokeState_=i;r=this.textState_;var A=t.getFont()||gi;Pi(A);var f=t.getScaleArray();r.overflow=t.getOverflow(),r.font=A,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.justify=t.getJustify(),r.textBaseline=t.getTextBaseline()||xi,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Ei,r.scale=void 0===f?[1,1]:f;var p=t.getOffsetX(),d=t.getOffsetY(),g=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===y?0:y,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:o(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.justify||"?")+(r.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+o(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Mo),Ko={Circle:Go,Default:Mo,Image:ko,LineString:Uo,Polygon:Go,Text:Vo};const qo=function(){function t(t,e,r,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];return void 0===i&&(i=new(0,Ko[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i),i},t}();var Wo=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Xo=function(t){function e(e){var r=t.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r.declutterExecutorGroup=null,r}return Wo(e,t),e.prototype.getFeatures=function(t){return n()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return n()},e.prototype.renderFrame=function(t,e){return n()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){},e.prototype.getDataAtPixel=function(t,e,r){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Un.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Un.LOADED&&e!=Un.ERROR&&t.addEventListener(T.CHANGE,this.boundHandleImageChange_),e==Un.IDLE&&(t.load(),e=t.getState()),e==Un.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(O);var Yo=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Zo=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Yo(e,t),e}(h);var Jo=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$o=[],ts=null,es=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return Jo(e,t),e.prototype.getImageData=function(t,e,r){var n,i;ts||((n=document.createElement("canvas")).width=1,n.height=1,ts=n.getContext("2d")),ts.clearRect(0,0,1,1);try{ts.drawImage(t,e,r,1,1,0,0,1,1),i=ts.getImageData(0,0,1,1).data}catch(o){return ts=null,null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,r){var n,i,o=this.getLayer().getClassName();if(t&&t.className===o&&(!r||t&&t.style.backgroundColor&&m(Zn(t.style.backgroundColor),Zn(r)))&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(i=a.getContext("2d")),i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(n=document.createElement("div")).className=o;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(i=ei()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=i}this.containerReused||!r||this.container.style.backgroundColor||(this.container.style.backgroundColor=r)},e.prototype.clipUnrotated=function(t,e,r){var n=Zt(r),i=Jt(r),o=zt(r),s=Ht(r);gt(e.coordinateToPixelTransform,n),gt(e.coordinateToPixelTransform,i),gt(e.coordinateToPixelTransform,o),gt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;gt(a,n),gt(a,i),gt(a,o),gt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){var i=new Zo(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(Sn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Bn,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,s){var a=i/2,l=o/2,u=n/e,h=-u,c=-t[0]+s,A=-t[1];return _t(this.tempTransform,a,l,u,h,-r,c,A)},e.prototype.getDataAtPixel=function(t,e,r){var n=gt(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!It(o,gt(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(n[0]),l=Math.round(n[1]),u=this.pixelContext_;if(!u){var h=document.createElement("canvas");h.width=1,h.height=1,u=h.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(i.canvas,a,l,1,1,0,0,1,1),s=u.getImageData(0,0,1,1).data}catch(c){return"SecurityError"===c.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Xo);const rs=es;function ns(t,e,r,n,i,o,s,a,l,u,h,c){var A=t[e],f=t[e+1],p=0,d=0,g=0,y=0;function m(){p=A,d=f,A=t[e+=n],f=t[e+1],y+=g,g=Math.sqrt((A-p)*(A-p)+(f-d)*(f-d))}do{m()}while(e<r-n&&y+g<o);for(var v=0===g?0:(o-y)/g,_=pe(p,A,v),w=pe(d,f,v),b=e-n,x=y,E=o+a*l(u,i,h);e<r-n&&y+g<E;)m();var C,S=pe(p,A,v=0===g?0:(E-y)/g),B=pe(d,f,v);if(c){var I=[_,w,S,B];Ir(I,0,4,2,c,I,I),C=I[0]>I[2]}else C=_>S;var T,P=Math.PI,F=[],L=b+n===e;if(g=0,y=x,A=t[e=b],f=t[e+1],L){m(),T=Math.atan2(f-d,A-p),C&&(T+=T>0?-P:P);var M=(S+_)/2,O=(B+w)/2;return F[0]=[M,O,(E-o)/2,T,i],F}for(var k=0,N=(i=i.replace(/\n/g," ")).length;k<N;){m();var R=Math.atan2(f-d,A-p);if(C&&(R+=R>0?-P:P),void 0!==T){var U=R-T;if(U+=U>P?-2*P:U<-P?2*P:0,Math.abs(U)>s)return null}T=R;for(var D=k,Q=0;k<N;++k){var G=a*l(u,i[C?N-k-1:k],h);if(e+n<r&&y+g<o+Q+G/2)break;Q+=G}if(k!==D){var j=C?i.substring(N-D,N-k):i.substring(D,k);M=pe(p,A,v=0===g?0:(o+Q/2-y)/g),O=pe(d,f,v),F.push([M,O,Q/2,R,j]),o+=Q}}return F}var is=[1/0,1/0,-1/0,-1/0],os=[],ss=[],as=[],ls=[];function us(t){return t[3].declutterBox}var hs=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function cs(t,e){return"start"!==e&&"end"!==e||hs.test(t)||(e="start"===e?"left":"right"),zo[e]}function As(t,e,r){return r>0&&t.push("\n",""),t.push(e,""),t}var fs=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,s=r?this.fillStates[r]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Array.isArray(t),c=a.justify?zo[a.justify]:cs(Array.isArray(t)?t[0]:t,a.textAlign||bi),A=n&&o.lineWidth?o.lineWidth:0,f=h?t:t.split("\n").reduce(As,[]),p=function(t,e){for(var r=[],n=[],i=[],o=0,s=0,a=0,l=0,u=0,h=e.length;u<=h;u+=2){var c=e[u];if("\n"!==c&&u!==h){var A=e[u+1]||t.font,f=Mi(A,c);r.push(f),s+=f;var p=Fi(A);n.push(p),l=Math.max(l,p)}else o=Math.max(o,s),i.push(s),s=0,a+=l}return{width:o,height:a,widths:r,heights:n,lineWidths:i}}(a,f),d=p.width,g=p.height,y=p.widths,m=p.heights,v=p.lineWidths,_=d+A,w=[],b=(_+2)*u[0],x=(g+A)*u[1],E={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:w};1==u[0]&&1==u[1]||w.push("scale",u),n&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",A),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(ut?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset))),r&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var C,S=.5-c,B=c*_+S*A,I=[],T=[],P=0,F=0,L=0,M=0,O=0,k=f.length;O<k;O+=2){var N=f[O];if("\n"!==N){var R=f[O+1]||a.font;R!==C&&(n&&I.push("font",R),r&&T.push("font",R),C=R),P=Math.max(P,m[L]);var U=[N,B+S*y[L]+c*(y[L]-v[M]),.5*(A+P)+F];B+=y[L],n&&I.push("strokeText",U),r&&T.push("fillText",U),++L}else F+=P,P=0,B=c*_+S*A,++M}return Array.prototype.push.apply(w,I),Array.prototype.push.apply(w,T),this.labels_[i]=E,E},t.prototype.replayTextBackground_=function(t,e,r,n,i,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,r,n,i,o,s,a,l,u,h,c,A,f,p,d){var g,y=r-(s*=c[0]),m=n-(a*=c[1]),v=i+l>t?t-l:i,_=o+u>e?e-u:o,w=f[3]+v*c[0]+f[1],b=f[0]+_*c[1]+f[2],x=y-f[3],E=m-f[0];return(p||0!==h)&&(os[0]=x,ls[0]=x,os[1]=E,ss[1]=E,ss[0]=x+w,as[0]=ss[0],as[1]=E+b,ls[1]=as[1]),0!==h?(gt(g=_t([1,0,0,1,0,0],r,n,1,1,h,-r,-n),os),gt(g,ss),gt(g,as),gt(g,ls),Lt(Math.min(os[0],ss[0],as[0],ls[0]),Math.min(os[1],ss[1],as[1],ls[1]),Math.max(os[0],ss[0],as[0],ls[0]),Math.max(os[1],ss[1],as[1],ls[1]),is)):Lt(Math.min(x,x+w),Math.min(E,E+b),Math.max(x,x+w),Math.max(E,E+b),is),A&&(y=Math.round(y),m=Math.round(m)),{drawImageX:y,drawImageY:m,drawImageW:v,drawImageH:_,originX:l,originY:u,declutterBox:{minX:is[0],minY:is[1],maxX:is[2],maxY:is[3],value:d},canvasTransform:g,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,s){var a=!(!o&&!s),l=n.declutterBox,u=t.canvas,h=s?s[2]*n.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(a&&this.replayTextBackground_(t,os,ss,as,ls,o,s),function(t,e,r,n,i,o,s,a,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;n<i;n+=2)Array.isArray(r[n+1])?e[r[n]].apply(e,r[n+1]):e[r[n]]=r[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,i,o,s,a,0,0,s,a)):t.drawImage(n,i,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}(t,n.canvasTransform,i,r,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=gt(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,n){var i=this.textStates[e],o=this.createLabel(t,e,n,r),s=this.strokeStates[r],a=this.pixelRatio,l=cs(Array.isArray(t)?t[0]:t,i.textAlign||bi),u=zo[i.textBaseline||xi],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*i.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,n,i,o,s,a){var l,u,h;this.pixelCoordinates_&&m(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Br(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),h=r,(u=this.renderedTransform_)[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,A,f,p,d,g,y,v,_,w,b,x,E,C,S,B,I=0,T=n.length,P=0,F=0,L=0,M=null,O=null,k=this.coordinateCache_,N=this.viewRotation_,R=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,U={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},D=this.instructions!=n||this.overlaps?0:200;I<T;){var Q=n[I];switch(Q[0]){case To.BEGIN_GEOMETRY:E=Q[1],B=Q[3],E.getGeometry()?void 0===s||te(s,B.getExtent())?++I:I=Q[2]+1:I=Q[2];break;case To.BEGIN_PATH:F>D&&(this.fill_(t),F=0),L>D&&(t.stroke(),L=0),F||L||(t.beginPath(),p=NaN,d=NaN),++I;break;case To.CIRCLE:var G=l[P=Q[1]],j=l[P+1],H=l[P+2]-G,z=l[P+3]-j,V=Math.sqrt(H*H+z*z);t.moveTo(G+V,j),t.arc(G,j,V,0,2*Math.PI,!0),++I;break;case To.CLOSE_PATH:t.closePath(),++I;break;case To.CUSTOM:P=Q[1],c=Q[2];var K=Q[3],q=Q[4],W=6==Q.length?Q[5]:void 0;U.geometry=K,U.feature=E,I in k||(k[I]=[]);var X=k[I];W?W(l,P,c,2,X):(X[0]=l[P],X[1]=l[P+1],X.length=2),q(X,U),++I;break;case To.DRAW_IMAGE:P=Q[1],c=Q[2],v=Q[3],A=Q[4],f=Q[5];var Y=Q[6],Z=Q[7],J=Q[8],$=Q[9],tt=Q[10],et=Q[11],rt=Q[12],nt=Q[13],it=Q[14],ot=Q[15];if(!v&&Q.length>=20){_=Q[19],w=Q[20],b=Q[21],x=Q[22];var st=this.drawLabelWithPointPlacement_(_,w,b,x);v=st.label,Q[3]=v;var at=Q[23];A=(st.anchorX-at)*this.pixelRatio,Q[4]=A;var lt=Q[24];f=(st.anchorY-lt)*this.pixelRatio,Q[5]=f,Y=v.height,Q[6]=Y,nt=v.width,Q[13]=nt}var ut=void 0;Q.length>25&&(ut=Q[25]);var ht=void 0,ct=void 0,At=void 0;Q.length>17?(ht=Q[16],ct=Q[17],At=Q[18]):(ht=Ei,ct=!1,At=!1),tt&&R?et+=N:tt||R||(et-=N);for(var ft=0;P<c;P+=2)if(!(ut&&ut[ft++]<nt/this.pixelRatio)){var pt=[t,e,v,Gt=this.calculateImageOrLabelDimensions_(v.width,v.height,l[P],l[P+1],nt,Y,A,f,J,$,et,rt,i,ht,ct||At,E),Z,ct?M:null,At?O:null];if(a){if("none"===it)continue;if("obstacle"===it){a.insert(Gt.declutterBox);continue}var dt=void 0,gt=void 0;if(ot){var yt=c-P;if(!ot[yt]){ot[yt]=pt;continue}if(dt=ot[yt],delete ot[yt],gt=us(dt),a.collides(gt))continue}if(a.collides(Gt.declutterBox))continue;dt&&(a.insert(gt),this.replayImageOrLabel_.apply(this,dt)),a.insert(Gt.declutterBox)}this.replayImageOrLabel_.apply(this,pt)}++I;break;case To.DRAW_CHARS:var mt=Q[1],vt=Q[2],_t=Q[3],wt=Q[4];x=Q[5];var bt=Q[6],xt=Q[7],Et=Q[8];b=Q[9];var Ct=Q[10];_=Q[11],w=Q[12];var St=[Q[13],Q[13]],Bt=this.textStates[w],It=Bt.font,Tt=[Bt.scale[0]*xt,Bt.scale[1]*xt],Pt=void 0;It in this.widths_?Pt=this.widths_[It]:(Pt={},this.widths_[It]=Pt);var Ft=On(l,mt,vt,2),Lt=Math.abs(Tt[0])*Oi(It,_,Pt);if(wt||Lt<=Ft){var Mt=this.textStates[w].textAlign,Ot=ns(l,mt,vt,2,_,(Ft-Lt)*zo[Mt],bt,Math.abs(Tt[0]),Oi,It,Pt,R?0:this.viewRotation_);t:if(Ot){var kt=[],Nt=void 0,Rt=void 0,Ut=void 0,Dt=void 0,Qt=void 0;if(b)for(Nt=0,Rt=Ot.length;Nt<Rt;++Nt){Ut=(Qt=Ot[Nt])[4],Dt=this.createLabel(Ut,w,"",b),A=Qt[2]+(Tt[0]<0?-Ct:Ct),f=_t*Dt.height+2*(.5-_t)*Ct*Tt[1]/Tt[0]-Et;var Gt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,Qt[0],Qt[1],Dt.width,Dt.height,A,f,0,0,Qt[3],St,!1,Ei,!1,E);if(a&&a.collides(Gt.declutterBox))break t;kt.push([t,e,Dt,Gt,1,null,null])}if(x)for(Nt=0,Rt=Ot.length;Nt<Rt;++Nt){if(Ut=(Qt=Ot[Nt])[4],Dt=this.createLabel(Ut,w,x,""),A=Qt[2],f=_t*Dt.height-Et,Gt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,Qt[0],Qt[1],Dt.width,Dt.height,A,f,0,0,Qt[3],St,!1,Ei,!1,E),a&&a.collides(Gt.declutterBox))break t;kt.push([t,e,Dt,Gt,1,null,null])}a&&a.load(kt.map(us));for(var jt=0,Ht=kt.length;jt<Ht;++jt)this.replayImageOrLabel_.apply(this,kt[jt])}}++I;break;case To.END_GEOMETRY:if(void 0!==o){var zt=o(E=Q[1],B);if(zt)return zt}++I;break;case To.FILL:D?F++:this.fill_(t),++I;break;case To.MOVE_TO_LINE_TO:for(P=Q[1],c=Q[2],C=l[P],y=(S=l[P+1])+.5|0,(g=C+.5|0)===p&&y===d||(t.moveTo(C,S),p=g,d=y),P+=2;P<c;P+=2)g=(C=l[P])+.5|0,y=(S=l[P+1])+.5|0,P!=c-2&&g===p&&y===d||(t.lineTo(C,S),p=g,d=y);++I;break;case To.SET_FILL_STYLE:M=Q,this.alignFill_=Q[2],F&&(this.fill_(t),F=0,L&&(t.stroke(),L=0)),t.fillStyle=Q[1],++I;break;case To.SET_STROKE_STYLE:O=Q,L&&(t.stroke(),L=0),this.setStrokeStyle_(t,Q),++I;break;case To.STROKE:D?L++:t.stroke(),++I;break;default:++I}}F&&this.fill_(t),L&&t.stroke()},t.prototype.execute=function(t,e,r,n,i,o){this.viewRotation_=n,this.execute_(t,e,r,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,i)},t}();const ps=fs;var ds=["Polygon","Circle","LineString","Image","Text","Default"],gs=function(){function t(t,e,r,n,i,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new ps(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var s=2*(n=Math.round(n))+1,a=_t(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=ei(s,s));var u,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(Ut(u=[1/0,1/0,-1/0,-1/0],t),Ct(u,e*(this.renderBuffer_+n),u));var c,A=function(t){if(void 0!==ys[t])return ys[t];for(var e=2*t+1,r=t*t,n=new Array(r+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var s=i*i+o*o;if(s>r)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,n.length);i<u;++i)n[i]&&l.push.apply(l,n[i]);return ys[t]=l,l}(n);function p(t,e){for(var r=h.getImageData(0,0,s,s).data,a=0,l=A.length;a<l;a++)if(r[A[a]]>0){if(!o||"Image"!==c&&"Text"!==c||-1!==o.indexOf(t)){var u=(A[a]-3)/4,f=n-u%s,p=n-(u/s|0),d=i(t,e,f*f+p*p);if(d)return d}h.clearRect(0,0,s,s);break}}var d,g,y,m,v,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(f),d=_.length-1;d>=0;--d){var w=_[d].toString();for(y=this.executorsByZIndex_[w],g=ds.length-1;g>=0;--g)if(void 0!==(m=y[c=ds[g]])&&(v=m.executeHitDetection(h,a,r,p,u)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],s=[r,n,r,o,i,o,i,n];return Br(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return C(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(f),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,h,c,A,p,d=o||ds;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var g=a[l].toString();for(A=this.executorsByZIndex_[g],h=0,c=d.length;h<c;++h)void 0!==(p=A[d[h]])&&p.execute(t,e,r,n,i,s)}this.maxExtent_&&t.restore()},t}(),ys={};const ms=gs,vs={ANIMATING:0,INTERACTING:1};var _s=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ws=function(t){function e(e,r,n,i,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=r,l.extent_=n,l.transform_=i,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return _s(e,t),e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=Br(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=i.length;u<h;u+=2){var c=i[u]-this.imageAnchorX_,A=i[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,p=A+this.imageAnchorY_;_t(s,f,p,1,1,l,-f,-p),o.setTransform.apply(o,s),o.translate(f,p),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,A,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=Br(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<r;e+=n){var a=i[e]+this.textOffsetX_,l=i[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=_t(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,s=Br(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;i&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(te(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return Br(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&te(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),te(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(te(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),s=t.getStride();r.beginPath();for(var a=0,l=o.length;a<l;++a)i=this.moveToLineTo_(n,i,o[a],s,!1);r.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),te(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),te(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=i.length;s<a;++s){var l=i[s];n=this.drawRings_(r,n,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(m(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,n=t.textAlign?t.textAlign:bi;r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var r=this;if(t){var n=t.getColor();this.fillState_={fillStyle:ti(n||yi)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||vi;this.strokeState_={lineCap:void 0!==o?o:mi,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*r.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:_i,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:ti(i||wi)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var r=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*this.pixelRatio_,this.imageAnchorY_=r[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:ti(r||yi)}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:mi,lineDash:s||vi,lineDashOffset:a||0,lineJoin:void 0!==l?l:_i,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:ti(i||wi)}}else this.textStrokeState_=null;var c=t.getFont(),A=t.getOffsetX(),f=t.getOffsetY(),p=t.getRotateWithView(),d=t.getRotation(),g=t.getScaleArray(),y=t.getText(),m=t.getTextAlign(),v=t.getTextBaseline();this.textState_={font:void 0!==c?c:gi,textAlign:void 0!==m?m:bi,textBaseline:void 0!==v?v:xi},this.text_=void 0!==y?Array.isArray(y)?y.reduce((function(t,e,r){return t+(r%2?" ":e)}),""):y:"",this.textOffsetX_=void 0!==A?this.pixelRatio_*A:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==p&&p,this.textRotation_=void 0!==d?d:0,this.textScale_=[this.pixelRatio_*g[0],this.pixelRatio_*g[1]]}else this.text_=""},e}(Po);const bs=ws,xs={FRACTION:"fraction",PIXELS:"pixels"},Es={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Cs=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=Ss(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=Ss(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function Ss(t,e,r){return e+":"+t+":"+(r?Kn(r):"null")}var Bs=new Cs,Is=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Ts=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return Is(e,t),e.prototype.changed=function(){this.dispatchEvent(T.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return n()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){n()},e}(I);var Ps=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fs=function(t){function e(e,r,n,i,o,s){var a=t.call(this,e,r,n,Un.IDLE)||this;return a.src_=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Un.IDLE,a.imageLoadFunction_=s,a}return Ps(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Un.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Xt(this.extent)/this.image_.height),this.state=Un.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Un.IDLE&&this.state!=Un.ERROR||(this.state=Un.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ls(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Xt(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ts);function Ls(t,e,r){var n=t,i=!0,o=!1,s=!1,a=[F(n,T.LOAD,(function(){s=!0,o||e()}))];return n.src&&ht?(o=!0,n.decode().then((function(){i&&e()})).catch((function(t){i&&(s?e():r())}))):a.push(F(n,T.ERROR,r)),function(){i=!1,a.forEach(L)}}var Ms=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Os=null,ks=function(t){function e(e,r,n,i,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==i&&(a.image_.crossOrigin=i),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=n,a.src_=r,a.tainted_,a}return Ms(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Un.LOADED){Os||(Os=ei(1,1)),Os.drawImage(this.image_,0,0);try{Os.getImageData(0,0,1,1),this.tainted_=!1}catch(TX){Os=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(T.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Un.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Un.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],r=ei(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Un.IDLE){this.imageState_=Un.LOADING;try{this.image_.src=this.src_}catch(TX){this.handleImageError_()}this.unlisten_=Ls(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Un.LOADED){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),r.globalCompositeOperation="multiply","multiply"===r.globalCompositeOperation||this.isTainted_())r.fillStyle=Kn(this.color_),r.fillRect(0,0,e.width/t,e.height/t),r.globalCompositeOperation="destination-in",r.drawImage(this.image_,0,0);else{for(var n=r.getImageData(0,0,e.width,e.height),i=n.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],u=0,h=i.length;u<h;u+=4)i[u]*=o,i[u+1]*=s,i[u+2]*=a,i[u+3]*=l;r.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(I);const Ns=ks;var Rs=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Us=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.opacity?n.opacity:1,s=void 0!==n.rotation?n.rotation:0,a=void 0!==n.scale?n.scale:1,l=void 0!==n.rotateWithView&&n.rotateWithView;(r=t.call(this,{opacity:i,rotation:s,scale:a,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:l,declutterMode:n.declutterMode})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:Es.TOP_LEFT,r.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:xs.FRACTION,r.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:xs.FRACTION,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var u=void 0!==n.img?n.img:null;r.imgSize_=n.imgSize;var h=n.src;K(!(void 0!==h&&u),4),K(!u||u&&r.imgSize_,5),void 0!==h&&0!==h.length||!u||(h=u.src||o(u)),K(void 0!==h&&h.length>0,6);var c=void 0!==n.src?Un.IDLE:Un.LOADED;return r.color_=void 0!==n.color?Zn(n.color):null,r.iconImage_=function(t,e,r,n,i,o){var s=Bs.get(e,n,o);return s||(s=new ks(t,e,r,n,i,o),Bs.set(e,n,o,s)),s}(u,h,void 0!==r.imgSize_?r.imgSize_:null,r.crossOrigin_,c,r.color_),r.offset_=void 0!==n.offset?n.offset:[0,0],r.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Es.TOP_LEFT,r.origin_=null,r.size_=void 0!==n.size?n.size:null,r}return Rs(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==xs.FRACTION||this.anchorYUnits_==xs.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==xs.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==xs.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Es.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Es.TOP_RIGHT&&this.anchorOrigin_!=Es.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Es.BOTTOM_LEFT&&this.anchorOrigin_!=Es.BOTTOM_RIGHT||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Es.TOP_LEFT){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=Es.TOP_RIGHT&&this.offsetOrigin_!=Es.BOTTOM_RIGHT||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=Es.BOTTOM_LEFT&&this.offsetOrigin_!=Es.BOTTOM_RIGHT||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(T.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(T.CHANGE,t)},e}(Hn),Ds=Object.freeze(Object.defineProperty({__proto__:null,Circle:Di,Fill:Fn,Icon:Us,IconImage:Ns,Image:Hn,RegularShape:Ri,Stroke:Rn,Style:Vi,Text:Wi},Symbol.toStringTag,{value:"Module"}));var Qs=.5;function Gs(t,e,r,n,i,o,s){var a=ei(t[0]*Qs,t[1]*Qs);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new bs(a,Qs,i,null,s),h=r.length,c=Math.floor(16777215/h),A={},p=1;p<=h;++p){var d=r[p-1],g=d.getStyleFunction()||n;if(n){var y=g(d,o);if(y){Array.isArray(y)||(y=[y]);for(var m="#"+("000000"+(p*c).toString(16)).slice(-6),v=0,_=y.length;v<_;++v){var w=y[v],b=w.getGeometryFunction()(d);if(b&&te(i,b.getExtent())){var x=w.clone(),E=x.getFill();E&&E.setColor(m);var C=x.getStroke();C&&(C.setColor(m),C.setLineDash(null)),x.setText(void 0);var S=w.getImage();if(S&&0!==S.getOpacity()){var B=S.getImageSize();if(!B)continue;var I=ei(B[0],B[1],void 0,{alpha:!1}),T=I.canvas;I.fillStyle=m,I.fillRect(0,0,T.width,T.height),x.setImage(new Us({img:T,imgSize:B,anchor:S.getAnchor(),anchorXUnits:xs.PIXELS,anchorYUnits:xs.PIXELS,offset:S.getOrigin(),opacity:1,size:S.getSize(),scale:S.getScale(),rotation:S.getRotation(),rotateWithView:S.getRotateWithView()}))}var P=x.getZIndex()||0;(M=A[P])||(M={},A[P]=M,M.Polygon=[],M.Circle=[],M.LineString=[],M.Point=[]),M[b.getType().replace("Multi","")].push(b,x)}}}}}for(var F=Object.keys(A).map(Number).sort(f),L=(p=0,F.length);p<L;++p){var M=A[F[p]];for(var O in M){var k=M[O];for(v=0,_=k.length;v<_;v+=2){u.setStyle(k[v+1]);for(var N=0,R=e.length;N<R;++N)u.setTransform(e[N]),u.drawGeometry(k[v])}}}return a.getImageData(0,0,l.width,l.height)}function js(t,e,r){var n=[];if(r){var i=Math.floor(Math.round(t[0])*Qs),o=Math.floor(Math.round(t[1])*Qs),s=4*(ae(i,0,r.width-1)+ae(o,0,r.height-1)*r.width),a=r.data[s],l=r.data[s+1],u=r.data[s+2]+256*(l+256*a),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Hs=.5,zs={Point:function(t,e,r,n,i){var o,s=r.getImage(),a=r.getText();if(s){if(s.getImageState()!=Un.LOADED)return;var l=t;if(i){var u=s.getDeclutterMode();if("none"!==u)if(l=i,"obstacle"===u){var h=t.getBuilder(r.getZIndex(),"Image");h.setImageStyle(s,o),h.drawPoint(e,n)}else a&&a.getText()&&(o={})}var c=l.getBuilder(r.getZIndex(),"Image");c.setImageStyle(s,o),c.drawPoint(e,n)}if(a&&a.getText()){var A=t;i&&(A=i);var f=A.getBuilder(r.getZIndex(),"Text");f.setTextStyle(a,o),f.drawText(e,n)}},LineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var s=t.getBuilder(r.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawLineString(e,n)}var a=r.getText();if(a&&a.getText()){var l=(i||t).getBuilder(r.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,r,n,i){var o=r.getFill(),s=r.getStroke();if(o||s){var a=t.getBuilder(r.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,r,n,i){var o,s=r.getImage(),a=r.getText();if(s){if(s.getImageState()!=Un.LOADED)return;var l=t;if(i){var u=s.getDeclutterMode();if("none"!==u)if(l=i,"obstacle"===u){var h=t.getBuilder(r.getZIndex(),"Image");h.setImageStyle(s,o),h.drawMultiPoint(e,n)}else a&&a.getText()&&(o={})}var c=l.getBuilder(r.getZIndex(),"Image");c.setImageStyle(s,o),c.drawMultiPoint(e,n)}if(a&&a.getText()){var A=t;i&&(A=i);var f=A.getBuilder(r.getZIndex(),"Text");f.setTextStyle(a,o),f.drawText(e,n)}},MultiLineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var s=t.getBuilder(r.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,n)}var a=r.getText();if(a&&a.getText()){var l=(i||t).getBuilder(r.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,r,n,i){var o=r.getFill(),s=r.getStroke();if(s||o){var a=t.getBuilder(r.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,r,n,i){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o)(0,zs[a[o].getType()])(t,a[o],r,n,i)},Circle:function(t,e,r,n,i){var o=r.getFill(),s=r.getStroke();if(o||s){var a=t.getBuilder(r.getZIndex(),"Circle");a.setFillStrokeStyle(o,s),a.drawCircle(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,n)}}};function Vs(t,e){return parseInt(o(t),10)-parseInt(o(e),10)}function Ks(t,e){var r=qs(t,e);return r*r}function qs(t,e){return Hs*t/e}function Ws(t,e,r,n,i,o,s){var a=!1,l=r.getImage();if(l){var u=l.getImageState();u==Un.LOADED||u==Un.ERROR?l.unlistenImageChange(i):(u==Un.IDLE&&l.load(),l.listenImageChange(i),a=!0)}return function(t,e,r,n,i,o){var s=r.getGeometryFunction()(e);if(s){var a=s.simplifyTransformed(n,i);r.getRenderer()?Xs(t,a,r,e):(0,zs[a.getType()])(t,a,r,e,o)}}(t,e,r,n,o,s),a}function Xs(t,e,r,n){if("GeometryCollection"!=e.getType())t.getBuilder(r.getZIndex(),"Default").drawCustom(e,n,r.getRenderer(),r.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,s=i.length;o<s;++o)Xs(t,i[o],r,n)}var Ys=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zs=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r.compositionContext_=null,r.opacity_=1,r}return Ys(e,t),e.prototype.renderWorlds=function(t,e,r){var n=e.extent,i=e.viewState,o=i.center,s=i.resolution,a=i.projection,l=i.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,A=e.viewHints,f=!(A[vs.ANIMATING]||A[vs.INTERACTING]),p=this.compositionContext_,d=Math.round(e.size[0]*c),g=Math.round(e.size[1]*c),y=h.getWrapX()&&a.canWrapX(),m=y?$t(u):null,v=y?Math.ceil((n[2]-u[2])/m)+1:1,_=y?Math.floor((n[0]-u[0])/m):0;do{var w=this.getRenderTransform(o,s,l,c,d,g,_*m);t.execute(p,1,w,l,f,void 0,r)}while(++_<v)},e.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=ei(this.context.canvas.width,this.context.canvas.height,$o);this.compositionContext_=t}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,ri(this.compositionContext_),$o.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){dt(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),wt(this.inversePixelTransform,this.pixelTransform);var i=bt(this.pixelTransform);this.useContainer(e,i,this.getBackground(t));var o=this.context,s=o.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*r),h=Math.round(t.size[1]*r);s.width!=u||s.height!=h?(s.width=u,s.height=h,s.style.transform!==i&&(s.style.transform=i)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection,this.opacity_=n.opacity,this.setupCompositionContext_();var A=!1,f=!0;if(n.extent&&this.clipping){var p=Cr(n.extent);(A=(f=te(p,t.extent))&&!Tt(p,t.extent))&&this.clipUnrotated(this.compositionContext_,t,p)}return f&&this.renderWorlds(a,t),A&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];gt(this.pixelTransform,r);var n=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=r[0]*Qs,c=r[1]*Qs;u.push(this.getRenderTransform(n,i,o,Qs,h,c,0).slice());var A=l.getSource(),f=s.getExtent();if(A.getWrapX()&&s.canWrapX()&&!Tt(f,a)){for(var p=a[0],d=$t(f),g=0,y=void 0;p<f[0];)y=d*--g,u.push(this.getRenderTransform(n,i,o,Qs,h,c,y).slice()),p+=d;for(g=0,p=a[2];p>f[2];)y=d*++g,u.push(this.getRenderTransform(n,i,o,Qs,h,c,y).slice()),p-=d}this.hitDetectionImageData_=Gs(r,u,this.renderedFeatures_,l.getStyleFunction(),a,i,o)}e(js(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var s=this;if(this.replayGroup_){var a,l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},A=function(t,e,r){var s=o(t),a=c[s];if(a){if(!0!==a&&r<a.distanceSq){if(0===r)return c[s]=!0,i.splice(i.lastIndexOf(a),1),n(t,h,e);a.geometry=e,a.distanceSq=r}}else{if(0===r)return c[s]=!0,n(t,h,e);i.push(c[s]={feature:t,layer:h,geometry:e,distanceSq:r,callback:n})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some((function(n){return a=n.forEachFeatureAtCoordinate(t,l,u,r,A,n===s.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var n=t.viewHints[vs.ANIMATING],i=t.viewHints[vs.INTERACTING],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!o&&n||!s&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,A=e.getRevision(),f=e.getRenderBuffer(),p=e.getRenderOrder();void 0===p&&(p=Vs);var d=l.center.slice(),g=Ct(a,f*h),y=g.slice(),v=[g.slice()],_=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!Tt(_,t.extent)){var w=$t(_),b=Math.max($t(g)/2,w);g[0]=_[0]-b,g[2]=_[2]+b,Ve(d,u);var x=ie(v[0],u);x[0]<_[0]&&x[2]<_[2]?v.push([x[0]+w,x[1],x[2]+w,x[3]]):x[0]>_[0]&&x[2]>_[2]&&v.push([x[0]-w,x[1],x[2]-w,x[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==A&&this.renderedRenderOrder_==p&&Tt(this.wrappedRenderedExtent_,g))return m(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=d,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var E,C=new qo(qs(h,c),g,h,c);this.getLayer().getDeclutter()&&(E=new qo(qs(h,c),g,h,c));for(var S=0,B=v.length;S<B;++S)r.loadFeatures(v[S],h,u);var I=Ks(h,c),T=!0,P=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,I,r,C,void 0,E);T=T&&!i}}.bind(this),F=Er(g),L=r.getFeaturesInExtent(F);for(p&&L.sort(p),S=0,B=L.length;S<B;++S)P(L[S]);this.renderedFeatures_=L,this.ready=T;var M=C.finish(),O=new ms(g,h,c,r.getOverlaps(),M,e.getRenderBuffer());return E&&(this.declutterExecutorGroup=new ms(g,h,c,r.getOverlaps(),E.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=A,this.renderedRenderOrder_=p,this.renderedExtent_=y,this.wrappedRenderedExtent_=g,this.renderedCenter_=d,this.renderedProjection_=u,this.replayGroup_=O,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i,o){if(!r)return!1;var s=!1;if(Array.isArray(r))for(var a=0,l=r.length;a<l;++a)s=Ws(n,t,r[a],e,this.boundHandleStyleImageChange_,i,o)||s;else s=Ws(n,t,r,e,this.boundHandleStyleImageChange_,i,o);return s},e}(rs);const Js=Zs;var $s=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const ta=function(t){function e(e){return t.call(this,e)||this}return $s(e,t),e.prototype.createRenderer=function(){return new Js(this)},e}(xo);var ea=function(){function t(t){this.rbush_=new oo(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[o(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++){var s=t[n],a=e[n],l={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:a};r[n]=l,this.items_[o(a)]=l}this.rbush_.load(r)},t.prototype.remove=function(t){var e=o(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[o(e)];Nt([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return C(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Lt(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}();const ra=ea;var na=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ia(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const oa=function(t){function e(e){var r=t.call(this)||this;r.projection=ir(e.projection),r.attributions_=ia(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:"ready",r.wrapX_=void 0!==e.wrapX&&e.wrapX,r.interpolate_=!!e.interpolate,r.viewResolver=null,r.viewRejector=null;var n=r;return r.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),r}return na(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return n()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=ia(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(D),sa={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function aa(t,e){return[[-1/0,-1/0,1/0,1/0]]}var la=!1;function ua(t,e,r,n,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(r,n,i):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=la,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==n&&(l=a.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}function ha(t,e){return function(r,n,i,o,s){var a=this;ua(t,e,r,n,i,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||w)}}var ca=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Aa=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return ca(e,t),e}(h),fa=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=w,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(K(r.format_,7),r.loader_=ha(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:aa;var i,o,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=s?new ra:null,r.loadedExtentsRtree_=new ra,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),s||void 0!==i||(i=new V(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return ca(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=o(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Aa(sa.ADDFEATURE,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[P(e,T.CHANGE,this.handleFeatureChange_,this),P(e,c.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(K(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],n=[],i=0,s=t.length;i<s;i++){var a=o(u=t[i]);this.addToIndex_(a,u)&&r.push(u)}i=0;for(var l=r.length;i<l;i++){var u;a=o(u=r[i]),this.setupChangeEvents_(a,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),n.push(u)}else this.nullGeometryFeatures_[a]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(sa.ADDFEATURE)){i=0;for(var A=r.length;i<A;i++)this.dispatchEvent(new Aa(sa.ADDFEATURE,r[i]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(sa.ADDFEATURE,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(sa.REMOVEFEATURE,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(Q.ADD,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Q.REMOVE,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(L);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var r=function(t){this.removeFeatureInternal(t)}.bind(this);for(var n in this.featuresRtree_.forEach(r),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Aa(sa.CLEAR);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),C(this.nullGeometryFeatures_)||y(t,E(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t,e){var r=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var n=function(t,e){if(e.canWrapX()){var r=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[r[0],t[1],r[2],t[3]]];ie(t,e);var n=$t(r);if($t(t)>n)return[[r[0],t[1],r[2],t[3]]];if(t[0]<r[0])return[[t[0]+n,t[1],r[2],t[3]],[r[0],t[1],t[2],t[3]]];if(t[2]>r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-n,t[3]]]}return[t]}(t,e);return[].concat.apply([],n.map((function(t){return r.featuresRtree_.getInExtent(t)})))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||v;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(r,n,o,s))<u){i=t;var h=Math.sqrt(s);a[0]=r-h,a[1]=n-h,a[2]=r+h,a[3]=n+h}}})),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=o(e),n=e.getGeometry();if(n){var i=n.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var s=e.getId();if(void 0!==s){var a=s.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new Aa(sa.CHANGEFEATURE,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:o(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&C(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,r){for(var n=this.loadedExtentsRtree_,i=this.strategy_(t,e,r),o=function(t,o){var a=i[t];n.forEachInExtent(a,(function(t){return Tt(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new Aa(sa.FEATURESLOADSTART)),s.loader_.call(s,a,e,r,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Aa(sa.FEATURESLOADEND,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Aa(sa.FEATURESLOADERROR))}.bind(s)),n.insert(a,{extent:a.slice()}))},s=this,a=0,l=i.length;a<l;++a)o(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(Nt(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=o(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=o(t),r=this.featureChangeKeys_[e];if(r){r.forEach(L),delete this.featureChangeKeys_[e];var n=t.getId();return void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Aa(sa.REMOVEFEATURE,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){K(this.format_,7),this.url_=t,this.setLoader(ha(t,this.format_))},e}(oa);const pa=fa;var da=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const ga=function(t){function e(e,r,n,i,o){var s=this,a=void 0!==o?Un.IDLE:Un.LOADED;return(s=t.call(this,e,r,n,a)||this).loader_=void 0!==o?o:null,s.canvas_=i,s.error_=null,s}return da(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Un.ERROR):this.state=Un.LOADED,this.changed()},e.prototype.load=function(){this.state==Un.IDLE&&(this.state=Un.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(Ts),ya={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ma(t){return Math.pow(t,3)}function va(t){return 1-ma(1-t)}function _a(t){return 3*t*t-2*t*t*t}function wa(t){return t}var ba=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xa=function(t){function e(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return ba(e,t),e.prototype.changed=function(){this.dispatchEvent(T.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==ya.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==ya.LOADED){t.interimTile=null;break}t.getState()==ya.LOADING?e=t:t.getState()==ya.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==ya.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){n()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:ma(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(I);const Ea=xa;var Ca=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Sa=function(t){function e(e,r,n,i,o,s){var a=t.call(this,e,r,s)||this;return a.crossOrigin_=i,a.src_=n,a.key=n,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return Ca(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=ya.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=ya.ERROR,this.unlistenImage_(),this.image_=((t=ei(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=ya.LOADED:this.state=ya.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==ya.ERROR&&(this.state=ya.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ya.IDLE&&(this.state=ya.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ls(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ea),Ba=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var r=e-3;r>0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var Ia=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ta=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r}return Ia(e,t),e.prototype.dispatchRenderEvent=function(t,e){n()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;_t(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),wt(n,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,s,a){var l,u=e.viewState;function h(t,e,r,n){return i.call(o,e,t?r:null,n)}var c=u.projection,A=Ve(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var p=$t(c.getExtent());f.push([-p,0],[p,0])}for(var d=e.layerStatesArray,g=d.length,y=[],m=[],v=0;v<f.length;v++)for(var _=g-1;_>=0;--_){var w=d[_],b=w.layer;if(b.hasRenderer()&&$i(w,u)&&s.call(a,b)){var x=b.getRenderer(),E=b.getSource();if(x&&E){var C=E.getWrapX()?A:t,S=h.bind(null,w.managed);m[0]=C[0]+f[v][0],m[1]=C[1]+f[v][1],l=x.forEachFeatureAtCoordinate(m,e,r,S,y)}if(l)return l}}if(0!==y.length){var B=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*B})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,r,i,o){return n()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,v,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){n()},e.prototype.scheduleExpireIconCache=function(t){Bs.canExpireCache()&&t.postRenderFunctions.push(Pa)},e}(A);function Pa(t,e){Bs.expire()}const Fa=Ta;var La=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ma=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=P(Ci,c.PROPERTYCHANGE,e.redrawText.bind(e)),r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",r.element_.className=hi+" ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return La(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new Zo(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){L(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(In,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),r=t.viewState;this.children_.length=0;for(var n=[],i=null,o=0,s=e.length;o<s;++o){var a=e[o];t.layerIndex=o;var l=a.layer,u=l.getSourceState();if(!$i(a,r)||"ready"!=u&&"undefined"!=u)l.unrender();else{var h=l.render(t,i);h&&(h!==i&&(this.children_.push(h),i=h),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;o>=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Tn,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&$i(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(u,h);if(c)return c}}}},e}(Fa);const Oa=Ma;var ka=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Na=function(t){function e(e,r){var n=t.call(this,e)||this;return n.layer=r,n}return ka(e,t),e}(h),Ra={LAYERS:"layers"},Ua=function(t){function e(e){var r=this,n=e||{},i=b({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(Ra.LAYERS,r.handleLayersChanged_),o?Array.isArray(o)?o=new V(o.slice(),{unique:!0}):K("function"==typeof o.getArray,43):o=new V(void 0,{unique:!0}),r.setLayers(o),r}return ka(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(L),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(P(t,Q.ADD,this.handleLayersAdd_,this),P(t,Q.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(L);x(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var o=r[n];this.registerLayerListeners_(o),this.dispatchEvent(new Na("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[P(t,c.PROPERTYCHANGE,this.handleLayerChange_,this),P(t,T.CHANGE,this.handleLayerChange_,this)];t instanceof e&&r.push(P(t,"addlayer",this.handleLayerGroupAdd_,this),P(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[o(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new Na("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new Na("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Na("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,r=o(e);this.listenerKeys_[r].forEach(L),delete this.listenerKeys_[r],this.dispatchEvent(new Na("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Ra.LAYERS)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var r=e.getArray(),n=0,i=r.length;n<i;++n)this.dispatchEvent(new Na("removelayer",r[n]));this.set(Ra.LAYERS,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),i=n.zIndex;t||void 0!==n.zIndex||(i=0);for(var o=r,s=e.length;o<s;o++){var a=e[o];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=Yt(a.extent,n.extent):a.extent=n.extent),void 0===a.zIndex&&(a.zIndex=i)}return e},e.prototype.getSourceState=function(){return"ready"},e}(Zi);const Da=Ua;var Qa=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Ga=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return Qa(e,t),e}(h);var ja=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Ha=function(t){function e(e,r,n,i,o,s){var a=t.call(this,e,r,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a.activePointers=s,a}return ja(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(Ga),za={SINGLECLICK:"singleclick",CLICK:T.CLICK,DBLCLICK:T.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Va={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var Ka=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qa=function(t){function e(e,r){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===r?1:r,n.down_=null;var i=n.map_.getViewport();return n.activePointers_=[],n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=P(i,Va.POINTERDOWN,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=P(i,Va.POINTERMOVE,n.relayMoveEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(T.TOUCHMOVE,n.boundHandleTouchMove_,!!ct&&{passive:!1}),n}return Ka(e,t),e.prototype.emulateClick_=function(t){var e=new Ha(za.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Ha(za.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Ha(za.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t,r=e.pointerId;if(e.type==za.POINTERUP||e.type==za.POINTERCANCEL){for(var n in delete this.trackedTouches_[r],this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else e.type!=za.POINTERDOWN&&e.type!=za.POINTERMOVE||(this.trackedTouches_[r]=e);this.activePointers_=E(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Ha(za.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(L),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);var e=new Ha(za.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);for(var r in this.dispatchEvent(e),this.down_={},t){var n=t[r];this.down_[r]="function"==typeof n?w:n}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(P(i,za.POINTERMOVE,this.handlePointerMove_,this),P(i,za.POINTERUP,this.handlePointerUp_,this),P(this.element_,za.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(P(this.element_.getRootNode(),za.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var e=new Ha(za.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Ha(za.POINTERMOVE,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(L(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(T.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(L(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(L),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(I);const Wa=qa,Xa="postrender",Ya="loadstart",Za="loadend",Ja={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var $a=1/0,tl=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,x(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){K(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=$a&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,n=e.length,i=e[t],o=r[t],s=t;t<n>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&r[l]<r[a]?l:a;e[t]=e[u],r[t]=r[u],t=u}e[t]=i,r[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){var s=this.getParentIndex_(e);if(!(n[s]>o))break;r[e]=r[s],n[e]=n[s],e=s}r[e]=i,n[e]=o},t.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,s=0,a=i.length;for(e=0;e<a;++e)(r=n(t=i[e]))==$a?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=r,i[s++]=t);i.length=s,o.length=s,this.heapify_()},t}();const el=tl;var rl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const nl=function(t){function e(e,r){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return rl(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);return r&&e[0].addEventListener(T.CHANGE,this.boundHandleTileChange_),r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(r===ya.LOADED||r===ya.ERROR||r===ya.EMPTY){e.removeEventListener(T.CHANGE,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,n,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==ya.IDLE||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}(el),il={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var sl=42,al=256;function ll(t,e,r){return function(n,i,o,s,a){if(n){if(!i&&!e)return n;var l=e?0:o[0]*i,u=e?0:o[1]*i,h=a?a[0]:0,c=a?a[1]:0,A=t[0]+l/2+h,f=t[2]-l/2+h,p=t[1]+u/2+c,d=t[3]-u/2+c;A>f&&(f=A=(f+A)/2),p>d&&(d=p=(d+p)/2);var g=ae(n[0],A,f),y=ae(n[1],p,d);if(s&&r&&i){var m=30*i;g+=-m*Math.log(1+Math.max(0,A-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-f)/m),y+=-m*Math.log(1+Math.max(0,p-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-d)/m)}return[g,y]}}}function ul(t){return t}function hl(t,e,r,n){var i=$t(e)/r[0],o=Xt(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function cl(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),ae(n,r/2,2*e)}function Al(t,e,r,n,i){return function(o,s,a,l){if(void 0!==o){var u=n?hl(t,n,a,i):t;return(void 0===r||r)&&l?cl(o,u,e):ae(o,e,u)}}}function fl(t){return void 0!==t?0:void 0}function pl(t){return void 0!==t?t:void 0}var dl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gl=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=b({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=ar(n.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,n.projection&&tr(),n.center&&(n.center=xr(n.center,r.projection_)),n.extent&&(n.extent=Cr(n.extent,r.projection_)),r.applyOptions_(n),r}return dl(e,t),e.prototype.applyOptions_=function(t){var e=b({},t);for(var r in il)delete e[r];this.setProperties(e,!0);var n=function(t){var e,r,n,i=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,u=void 0!==t.showFullExtent&&t.showFullExtent,h=ar(t.projection,"EPSG:3857"),c=h.getExtent(),A=t.constrainOnlyCenter,f=t.extent;if(a||f||!h.isGlobal()||(A=!1,f=c),void 0!==t.resolutions){var p=t.resolutions;r=p[i],n=void 0!==p[o]?p[o]:p[p.length-1],e=t.constrainResolution?function(t,e,r,n){return function(i,o,s,a){if(void 0!==i){var l=t[0],u=t[t.length-1],h=r?hl(l,r,s,n):l;if(a)return void 0===e||e?cl(i,h,u):ae(i,u,h);var c=Math.min(h,i),A=Math.floor(d(t,c,o));return t[A]>h&&A<t.length-1?t[A+1]:t[A]}}}(p,l,!A&&f,u):Al(r,n,l,!A&&f,u)}else{var g=(c?Math.max($t(c),Xt(c)):360*tt[et.DEGREES]/h.getMetersPerUnit())/al/Math.pow(2,0),y=g/Math.pow(2,28);void 0!==(r=t.maxResolution)?i=0:r=g/Math.pow(s,i),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(s,o):g/Math.pow(s,o):y),o=i+Math.floor(Math.log(r/n)/Math.log(s)),n=r/Math.pow(s,o-i),e=t.constrainResolution?function(t,e,r,n,i,o){return function(s,a,l,u){if(void 0!==s){var h=i?hl(e,i,l,o):e,c=void 0!==r?r:0;if(u)return void 0===n||n?cl(s,h,c):ae(s,c,h);var A=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-a*(.5-1e-9)+.5,p=Math.min(h,s),d=Math.floor(Math.log(e/p)/Math.log(t)+f),g=Math.max(A,d);return ae(e/Math.pow(t,g),c,h)}}}(s,r,n,l,!A&&f,u):Al(r,n,l,!A&&f,u)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:i,zoomFactor:s}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return ll(t.extent,t.constrainOnlyCenter,e)}var r=ar(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,ll(n,!1,!1)}return ul}(t),o=n.constraint,s=function(t){var e,r,n;if(void 0===t.enableRotation||t.enableRotation){var i=t.constrainRotation;return void 0===i||!0===i?(n=Ae(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=n?0:t:void 0}):!1===i?pl:"number"==typeof i?(e=i,r=2*Math.PI/e,function(t,e){return e?t:void 0!==t?t=Math.floor(t/r+.5)*r:void 0}):pl}return fl}(t);this.constraints_={center:i,resolution:o,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var r=this.getCenter();if(r){var n=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(n[3]-e[3]+e[1]-n[1]),s=i/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([r[0]+o,r[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),b({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=b({},n)).center=xr(n.center,this.getProjection())),n.anchor&&((n=b({},n)).anchor=xr(n.anchor,this.getProjection())),e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n<r&&!this.isDef();++n){var i=arguments[n];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(n!==r){for(var o=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_,u=[];n<r;++n){var h=arguments[n],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||_a,callback:e};if(h.center&&(c.sourceCenter=s,c.targetCenter=h.center.slice(),s=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=c.targetResolution),void 0!==h.rotation){c.sourceRotation=l;var A=fe(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+A,l=c.targetRotation}ml(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(vs.ANIMATING,1),this.updateAnimations_()}else e&&yl(e,!0)},e.prototype.getAnimating=function(){return this.hints_[vs.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[vs.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(vs.ANIMATING,-this.hints_[vs.ANIMATING]);for(var e=0,r=this.animations_.length;e<r;++e){var n=this.animations_[e];if(n[0].callback&&yl(n[0].callback,!1),!t)for(var i=0,o=n.length;i<o;++i){var s=n[i];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,s=n.length;o<s;++o){var a=n[o];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):i=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],A=a.sourceCenter[1],f=a.targetCenter[0],p=a.targetCenter[1];this.nextCenter_=a.targetCenter;var d=c+h*(f-c),g=A+h*(p-A);this.targetCenter_=[d,g]}if(a.sourceResolution&&a.targetResolution){var y=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var m=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(y,0,m,!0);this.targetCenter_=this.calculateCenterZoom(v,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var _=1===h?fe(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var w=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(w,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(i){this.animations_[r]=null,this.setHint(vs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var b=n[0].callback;b&&yl(b,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,n=this.getCenterInternal();return void 0!==n&&(Ge(r=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Re(r,e)),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();return void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]),r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],n=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?br(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(il.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Er(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();K(r,1);var n=this.getResolution();K(void 0!==n,2);var i=this.getRotation();return K(void 0!==i,3),qt(r,n,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(il.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Cr(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),n=$t(t)/r[0],i=Xt(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(il.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/e;return function(t){return Math.log(r/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),r=this.padding_;return r&&(e=[e[0]-r[1]-r[3],e[1]-r[0]-r[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),r=this.getRotation(),n=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();n=vl(n,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,r)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:r,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,n=this.minZoom_||0;if(this.resolutions_){var i=d(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=ae(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,ae(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(K(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))K(!ee(t),25),r=En(n=Cr(t,this.getProjection()));else if("Circle"===t.getType()){var n;(r=En(n=Cr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Vt(n))}else{var i=wr();r=i?t.clone().transform(i,this.getProjection()):t}this.fitInternal(r,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),r=Math.cos(e),n=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,l=-1/0,u=-1/0,h=0,c=i.length;h<c;h+=o){var A=i[h]*r-i[h+1]*n,f=i[h]*n+i[h+1]*r;s=Math.min(s,A),a=Math.min(a,f),l=Math.max(l,A),u=Math.max(u,f)}return[s,a,l,u]},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getViewportSizeMinusPadding_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],s=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,s?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),A=Vt(a);A[0]+=(o[1]-o[3])/2*l,A[1]+=(o[0]-o[2])/2*l;var f=A[0]*c-A[1]*h,p=A[1]*c+A[0]*h,d=this.getConstrainedCenter([f,p],l),g=r.callback?r.callback:w;void 0!==r.duration?this.animateInternal({resolution:l,center:d,duration:r.duration,easing:r.easing},g):(this.targetResolution_=l,this.targetCenter_=d,this.applyTargetState_(!1,!0),yl(g,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(xr(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){this.setCenterInternal(vl(t,e,r,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,r,n){var i,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-r),a=vl(t,n,[s[0]/2+o[3],s[1]/2+o[0]],e,r);i=[t[0]-a[0],t[1]-a[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=br(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&xr(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=xr(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?xr(t,this.getProjection()):t)},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),s=this.constraints_.center(this.targetCenter_,o,i,r,this.calculateCenterShift(this.targetCenter_,o,n,i));this.get(il.ROTATION)!==n&&this.set(il.ROTATION,n),this.get(il.RESOLUTION)!==o&&(this.set(il.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),s&&this.get(il.CENTER)&&Qe(this.get(il.CENTER),s)||this.set(il.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,i,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=r||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&Qe(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:a,duration:n,easing:va,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(vs.INTERACTING,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&xr(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(vs.INTERACTING,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(D);function yl(t,e){setTimeout((function(){t(e)}),0)}function ml(t){return!(t.sourceCenter&&t.targetCenter&&!Qe(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation}function vl(t,e,r,n,i){var o=Math.cos(-i),s=Math.sin(-i),a=t[0]*o-t[1]*s,l=t[1]*o+t[0]*s;return[(a+=(e[0]/2-r[0])*n)*o-(l+=(r[1]-e[1]/2)*n)*(s=-s),l*o+a*s]}const _l=gl;var wl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function bl(t){t instanceof to?t.setMapInternal(null):t instanceof Da&&t.getLayers().forEach(bl)}function xl(t,e){if(t instanceof to)t.setMapInternal(e);else if(t instanceof Da)for(var r=t.getLayers().getArray(),n=0,i=r.length;n<i;++n)xl(r[n],e)}var El=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Da({layers:t.layers});return o[Ja.LAYERGROUP]=s,o[Ja.TARGET]=t.target,o[Ja.VIEW]=t.view instanceof _l?t.view:new _l,void 0!==t.controls&&(Array.isArray(t.controls)?r=new V(t.controls.slice()):(K("function"==typeof t.controls.getArray,47),r=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new V(t.interactions.slice()):(K("function"==typeof t.interactions.getArray,48),n=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?i=new V(t.overlays.slice()):(K("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new V,{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:lt,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=e.moveTolerance,r.keyboardEventTarget_=n.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=n.controls||new V,r.interactions=n.interactions||new V,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new nl(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Ja.LAYERGROUP,r.handleLayerGroupChanged_),r.addChangeListener(Ja.VIEW,r.handleViewChanged_),r.addChangeListener(Ja.SIZE,r.handleSizeChanged_),r.addChangeListener(Ja.TARGET,r.handleTargetChanged_),r.setProperties(n.values);var i=r;return!e.view||e.view instanceof _l||e.view.then((function(t){i.setView(new _l(t))})),r.controls.addEventListener(Q.ADD,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(Q.REMOVE,function(t){t.element.setMap(null)}.bind(r)),r.interactions.addEventListener(Q.ADD,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(Q.REMOVE,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(Q.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(Q.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return wl(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){xl(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance:0,o=void 0!==r.layerFilter?r.layerFilter:v,s=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.getAllLayers=function(){var t=[];return function e(r){r.forEach((function(r){r instanceof Da?e(r.getLayers()):t.push(r)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||v;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:v,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Ja.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return br(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?gt(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Ja.LAYERGROUP)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof V)e.setLayers(t);else{var r=e.getLayers();r.clear(),r.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e];if(n.visible){var i=n.layer.getRenderer();if(i&&!i.ready)return!0;var o=n.layer.getSource();if(o&&o.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=xr(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?gt(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Ja.SIZE)},e.prototype.getView=function(){return this.get(Ja.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,r,n){return function(t,e,r,n,i){if(!t||!(r in t.wantedTiles))return $a;if(!t.wantedTiles[r][e.getKey()])return $a;var o=t.viewState.center,s=n[0]-o[0],a=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}(this.frameState_,t,e,r,n)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new Ha(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,r=e.type;if(r===Va.POINTERDOWN||r===T.WHEEL||r===T.KEYDOWN){var n=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===n?n.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement()&&(!l.handleEvent(t)||t.propagationStopped))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[vs.ANIMATING]||i[vs.INTERACTING]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Pn)&&this.renderer_.dispatchRenderEvent(Pn,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Ga(Za,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Ga(Ya,this,t))));for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)L(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(T.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(T.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,si(this.viewport_)}var r=this.getTargetElement();if(r){for(var n in r.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Wa(this,this.moveTolerance_),za)this.mapBrowserEventHandler_.addEventListener(za[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(T.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(T.WHEEL,this.boundHandleBrowserEvent_,!!ct&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:r;this.targetChangeHandlerKeys_=[P(o,T.KEYDOWN,this.handleBrowserEvent,this),P(o,T.KEYPRESS,this.handleBrowserEvent,this),P(i,T.RESIZE,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(L(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(L(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=P(t,c.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=P(t,T.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(L),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Na("addlayer",t)),this.layerGroupPropertyListenerKeys_=[P(t,c.PROPERTYCHANGE,this.render,this),P(t,T.CHANGE,this.render,this),P(t,"addlayer",this.handleLayerAdd_,this),P(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){bl(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,r=this.getSize(),n=this.getView(),i=this.frameState_,s=null;if(void 0!==r&&Qn(r)&&n&&n.isDef()){var a=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=n.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:qt(l.center,l.resolution,l.rotation,r),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:l,viewHints:a,wantedTiles:{},mapId:o(this),renderTargets:{}},l.nextCenter&&l.nextResolution){var u=isNaN(l.nextRotation)?l.rotation:l.nextRotation;s.nextExtent=qt(l.nextCenter,l.nextResolution,u,r)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),i&&(!this.previousExtent_||!ee(this.previousExtent_)&&!Nt(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Ga("movestart",this,i)),this.previousExtent_=Mt(this.previousExtent_)),this.previousExtent_&&!s.viewHints[vs.ANIMATING]&&!s.viewHints[vs.INTERACTING]&&!Nt(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Ga("moveend",this,s)),St(s.extent,this.previousExtent_))),this.dispatchEvent(new Ga(Xa,this,s)),this.renderComplete_=this.hasListener(Ya)||this.hasListener(Za)||this.hasListener(Pn)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new Na("removelayer",e)),this.set(Ja.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(Ja.SIZE,t)},e.prototype.setTarget=function(t){this.set(Ja.TARGET,t)},e.prototype.setView=function(t){if(!t||t instanceof _l)this.set(Ja.VIEW,t);else{this.set(Ja.VIEW,new _l);var e=this;t.then((function(t){e.setView(new _l(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var r=getComputedStyle(t),n=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),i=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);isNaN(n)||isNaN(i)||!Qn(e=[n,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(D);const Cl=El;var Sl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Bl=function(t){function e(e){var r=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),r.element=n||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return Sl(e,t),e.prototype.disposeInternal=function(){si(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&si(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)L(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==w&&this.listenerKeys.push(P(t,Xa,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(D);var Il=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tl=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===n.collapsed||n.collapsed,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=void 0!==n.collapsible,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",s=void 0!==n.expandClassName?n.expandClassName:i+"-expand",a=void 0!==n.collapseLabel?n.collapseLabel:"›",l=void 0!==n.collapseClassName?n.collapseClassName:i+"-collapse";"string"==typeof a?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=a,r.collapseLabel_.className=l):r.collapseLabel_=a;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(r.label_=document.createElement("span"),r.label_.textContent=u,r.label_.className=s):r.label_=u;var h=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(h),r.toggleButton_.addEventListener(T.CLICK,r.handleClick_.bind(r),!1);var c=i+" "+hi+" "+ci+(r.collapsed_&&r.collapsible_?" "+Ai:"")+(r.collapsible_?"":" ol-uncollapsible"),A=r.element;return A.className=c,A.appendChild(r.toggleButton_),A.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return Il(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=!0,i=t.layerStatesArray,o=0,s=i.length;o<s;++o){var a=i[o];if($i(a,t.viewState)){var l=a.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(n=n&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,A=h.length;c<A;++c)h[c]in e||(r.push(h[c]),e[h[c]]=!0);else h in e||(r.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!m(e,this.renderedAttributions_)){ai(this.ulElement_);for(var n=0,i=e.length;n<i;++n){var o=document.createElement("li");o.innerHTML=e[n],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(Ai),this.collapsed_?oi(this.collapseLabel_,this.label_):oi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(Bl);const Pl=Tl;var Fl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ll=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",s=void 0!==n.compassClassName?n.compassClassName:"ol-compass";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className=s,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(s));var a=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=i+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(r.label_),l.addEventListener(T.CLICK,r.handleClick_.bind(r),!1);var u=i+" "+hi+" "+ci,h=r.element;return h.className=u,h.appendChild(l),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(li),r}return Fl(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:va}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains(li);i||0!==r?i&&0!==r&&this.element.classList.remove(li):this.element.classList.add(li)}this.label_.style.transform=n}this.rotation_=r}},e}(Bl);const Ml=Ll;var Ol=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kl=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:i+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:i+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",u=void 0!==n.zoomOutLabel?n.zoomOutLabel:"–",h=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",A=document.createElement("button");A.className=s,A.setAttribute("type","button"),A.title=h,A.appendChild("string"==typeof l?document.createTextNode(l):l),A.addEventListener(T.CLICK,r.handleClick_.bind(r,o),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(T.CLICK,r.handleClick_.bind(r,-o),!1);var p=i+" "+hi+" "+ci,d=r.element;return d.className=p,d.appendChild(A),d.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return Ol(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:va})):e.setZoom(n)}}},e}(Bl);const Nl=kl;var Rl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ul={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};const Dl=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un,r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container "+ui,r.element.style.position="absolute",r.element.style.pointerEvents="auto";var n=e.autoPan;return n&&"object"!=typeof n&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),r.autoPan=n||!1,r.rendered={transform_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addChangeListener(Ul.ELEMENT,r.handleElementChanged),r.addChangeListener(Ul.MAP,r.handleMapChanged),r.addChangeListener(Ul.OFFSET,r.handleOffsetChanged),r.addChangeListener(Ul.POSITION,r.handlePositionChanged),r.addChangeListener(Ul.POSITIONING,r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(e.positioning||"top-left"),void 0!==e.position&&r.setPosition(e.position),r}return Rl(e,t),e.prototype.getElement=function(){return this.get(Ul.ELEMENT)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Ul.MAP)||null},e.prototype.getOffset=function(){return this.get(Ul.OFFSET)},e.prototype.getPosition=function(){return this.get(Ul.POSITION)},e.prototype.getPositioning=function(){return this.get(Ul.POSITIONING)},e.prototype.handleElementChanged=function(){ai(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(si(this.element),L(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=P(t,Xa,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Ul.ELEMENT,t)},e.prototype.setMap=function(t){this.set(Ul.MAP,t)},e.prototype.setOffset=function(t){this.set(Ul.OFFSET,t)},e.prototype.setPosition=function(t){this.set(Ul.POSITION,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Ul.POSITION)){var r=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),i=this.getRect(n,[ni(n),ii(n)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!Tt(r,i)){var a=i[0]-r[0],l=r[2]-i[2],u=i[1]-r[1],h=r[3]-i[3],c=[0,0];if(a<0?c[0]=a-s:l<0&&(c[0]=Math.abs(l)+s),u<0?c[1]=u-s:h<0&&(c[1]=Math.abs(h)+s),0!==c[0]||0!==c[1]){var A=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(A);if(!f)return;var p=[f[0]+c[0],f[1]+c[1]],d=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(p),duration:d.duration,easing:d.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),n=r.left+window.pageXOffset,i=r.top+window.pageYOffset;return[n,i,n+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(Ul.POSITIONING,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(r,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,n=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+n[0])+"px",s=Math.round(t[1]+n[1])+"px",a="0%",l="0%";"bottom-right"==i||"center-right"==i||"top-right"==i?a="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(a="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?l="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(l="-50%");var u="translate(".concat(a,", ").concat(l,") translate(").concat(o,", ").concat(s,")");this.rendered.transform_!=u&&(this.rendered.transform_=u,r.transform=u,r.msTransform=u)},e.prototype.getOptions=function(){return this.options},e}(D);var Ql=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ql(e,t),e.prototype.createRenderer=function(){return new Oa(this)},e}(Cl),jl=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).boundHandleRotationChanged_=r.handleRotationChanged_.bind(r),r.collapsed_=void 0===n.collapsed||n.collapsed,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1),r.rotateWithView_=void 0!==n.rotateWithView&&n.rotateWithView,r.viewExtent_=void 0;var i=void 0!==n.className?n.className:"ol-overviewmap",o=void 0!==n.tipLabel?n.tipLabel:"Overview map",s=void 0!==n.collapseLabel?n.collapseLabel:"‹";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s):r.collapseLabel_=s;var a=void 0!==n.label?n.label:"›";"string"==typeof a?(r.label_=document.createElement("span"),r.label_.textContent=a):r.label_=a;var l=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,u=document.createElement("button");u.setAttribute("type","button"),u.title=o,u.appendChild(l),u.addEventListener(T.CLICK,r.handleClick_.bind(r),!1),r.ovmapDiv_=document.createElement("div"),r.ovmapDiv_.className="ol-overviewmap-map",r.view_=n.view,r.ovmap_=new Gl({view:n.view});var h=r.ovmap_;n.layers&&n.layers.forEach((function(t){h.addLayer(t)}));var c=document.createElement("div");c.className="ol-overviewmap-box",c.style.boxSizing="border-box",r.boxOverlay_=new Dl({position:[0,0],positioning:"center-center",element:c}),r.ovmap_.addOverlay(r.boxOverlay_);var A=i+" "+hi+" "+ci+(r.collapsed_&&r.collapsible_?" "+Ai:"")+(r.collapsible_?"":" ol-uncollapsible"),f=r.element;f.className=A,f.appendChild(r.ovmapDiv_),f.appendChild(u);var p=r,d=r.boxOverlay_,g=r.boxOverlay_.getElement(),y=function(t){var e,r={clientX:(e=t).clientX,clientY:e.clientY},n=h.getEventCoordinateInternal(r);d.setPosition(n)},m=function(t){var e=h.getEventCoordinateInternal(t);p.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",m)};return g.addEventListener("mousedown",(function(){window.addEventListener("mousemove",y),window.addEventListener("mouseup",m)})),r}return Ql(e,t),e.prototype.setMap=function(e){var r=this.getMap();if(e!==r){if(r){var n=r.getView();n&&this.unbindView_(n),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(P(e,c.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===Ja.VIEW){var e=t.oldValue;e&&this.unbindView_(e);var r=this.getMap().getView();this.bindView_(r)}else this.ovmap_.isRendered()||t.key!==Ja.TARGET&&t.key!==Ja.SIZE||this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var e=new _l({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(il.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(il.ROTATION,this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView().calculateExtentInternal(r);if(!this.viewExtent_||!Nt(n,this.viewExtent_)){this.viewExtent_=n;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),s=e.getPixelFromCoordinateInternal(Zt(n)),a=e.getPixelFromCoordinateInternal(zt(n)),l=Math.abs(s[0]-a[0]),u=Math.abs(s[1]-a[1]),h=i[0],c=i[1];l<.1*h||u<.1*c||l>.75*h||u>.75*c?this.resetExtent_():Tt(o,n)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),n=t.getView().calculateExtentInternal(r),i=e.getView(),o=Math.log(7.5)/Math.LN2;re(n,1/(.1*Math.pow(2,o/2))),i.fitInternal(En(n))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-n.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),l=n.getCenterInternal(),u=n.getResolution(),h=i.getResolution(),c=r[0]*u/h,A=r[1]*u/h;if(s.setPosition(l),a){a.style.width=c+"px",a.style.height=A+"px";var f="rotate("+o+"rad)";a.style.transform=f}}},e.prototype.updateBoxAfterOvmapIsRendered_=function(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=F(this.ovmap_,Xa,(function(t){delete this.ovmapPostrenderKey_,this.updateBox_()}),this))},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(Ai),this.collapsed_?oi(this.collapseLabel_,this.label_):oi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(Bl);const Hl=jl;var zl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vl="units",Kl={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},ql=[1,2,5],Wl=25.4/.28;const Xl=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+hi,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.maxWidth_=n.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(Vl,r.handleUnitsChanged_),r.setUnits(n.units||Kl.METRIC),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return zl(e,t),e.prototype.getUnits=function(){return this.get(Vl)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Vl,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==Kl.DEGREES?et.DEGREES:et.METERS,o=or(r,t.resolution,e,i),s=this.minWidth_*(this.dpi_||Wl)/Wl,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||Wl)/Wl:void 0,l=s*o,u="";if(n==Kl.DEGREES){var h=tt[et.DEGREES];(l*=h)<h/60?(u="″",o*=3600):l<h?(u="′",o*=60):u="°"}else n==Kl.IMPERIAL?l<.9144?(u="in",o/=.0254):l<1609.344?(u="ft",o/=.3048):(u="mi",o/=1609.344):n==Kl.NAUTICAL?(o/=1852,u="NM"):n==Kl.METRIC?l<.001?(u="μm",o*=1e6):l<1?(u="mm",o*=1e3):l<1e3?u="m":(u="km",o/=1e3):n==Kl.US?l<.9144?(u="in",o*=39.37):l<1609.344?(u="ft",o/=.30480061):(u="mi",o/=1609.3472):K(!1,33);for(var c,A,f,p,d,g,y,m=3*Math.floor(Math.log(s*o)/Math.log(10));;){f=Math.floor(m/3);var v=Math.pow(10,f);if(c=ql[(m%3+3)%3]*v,A=Math.round(c/o),isNaN(A))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==a&&A>=a){c=p,A=d,f=g;break}if(A>=s)break;p=c,d=A,g=f,++m}y=this.scaleBar_?this.createScaleBar(A,c,u):c.toFixed(f<0?-f:0)+" "+u,this.renderedHTML_!=y&&(this.innerElement_.innerHTML=y,this.renderedHTML_=y),this.renderedWidth_!=A&&(this.innerElement_.style.width=A+"px",this.renderedWidth_=A),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,s="ol-scale-singlebar-odd",a=0;a<this.scaleBarSteps_;a++)0===a&&i.push(this.createMarker("absolute",a)),i.push('<div><div class="ol-scale-singlebar '+s+'" style="width: '+o+'px;"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,r):"")+"</div>"),a===this.scaleBarSteps_-1&&i.push(this.createStepText(a+1,t,!0,e,r)),s="ol-scale-singlebar-odd"===s?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=or(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,et.METERS),e=this.dpi_||Wl;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(Bl);function Yl(t){var e=t||{},r=new V;return(void 0===e.zoom||e.zoom)&&r.push(new Nl(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Ml(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new Pl(e.attributionOptions)),r}const Zl={ACTIVE:"active"};var Jl=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function $l(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:r,duration:void 0!==n?n:250,easing:va})}}const tu=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Jl(e,t),e.prototype.getActive=function(){return this.get(Zl.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Zl.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(D);var eu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const ru=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return eu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==za.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;$l(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(tu);var nu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function iu(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}const ou=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return nu(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==za.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==za.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==za.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==za.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(tu);function su(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n<i&&(r=r&&e[n](t));++n);return r}}var au=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},lu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},uu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),r=t.map.getOwnerDocument().activeElement;return e.contains(r)}(t)},hu=v,cu=function(t){var e=t.originalEvent;return 0==e.button&&!(st&&at&&e.ctrlKey)},Au=_,fu=function(t){return"pointermove"==t.type},pu=function(t){return t.type==za.SINGLECLICK},du=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},gu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},yu=function(t){var e=t.originalEvent,r=e.target.tagName;return"INPUT"!==r&&"SELECT"!==r&&"TEXTAREA"!==r&&!e.target.isContentEditable},mu=function(t){var e=t.originalEvent;return K(void 0!==e,56),"mouse"==e.pointerType},vu=function(t){var e=t.originalEvent;return K(void 0!==e,56),e.isPrimary&&0===e.button},_u=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wu=function(t){function e(e){var r=t.call(this,{stopDown:_})||this,n=e||{};r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var i=n.condition?n.condition:su(du,vu);return r.condition_=n.onFocusOnly?su(uu,i):i,r.noKinetic_=!1,r}return _u(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=iu(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();je(n,i.getResolution()),Ge(n,i.getRotation()),i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-n*Math.cos(i),s[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(a),duration:500,easing:va})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(ou);const bu=wu;var xu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eu=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:_})||this).condition_=n.condition?n.condition:lu,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return xu(e,t),e.prototype.handleDragEvent=function(t){if(mu(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==fl){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;r.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!mu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!(!mu(t)||!cu(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))},e}(ou);const Cu=Eu;var Su=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Bu=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return Su(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+r,n.top=Math.min(t[1],e[1])+r,n.width=Math.abs(e[0]-t[0])+r,n.height=Math.abs(e[1]-t[1])+r},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new xn([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(A);var Iu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tu=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return Iu(e,t),e}(h);const Pu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new Bu(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(r.onBoxEnd=n.onBoxEnd),r.startPixel_=null,r.condition_=n.condition?n.condition:cu,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return Iu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Tu("boxdrag",t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Tu(e?"boxend":"boxcancel",t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Tu("boxstart",t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(ou);var Fu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lu=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:gu;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return Fu(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),r=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(r),i=e.getResolutionForExtentInternal(n),o=e.getResolution()/i;(r=r.clone()).scale(o*o)}e.fitInternal(r,{duration:this.duration_,easing:va})},e}(Pu);const Mu=Lu;var Ou=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ku=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return du(t)&&yu(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Ou(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==T.KEYDOWN){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(40==n||37==n||39==n||38==n)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,s=0,a=0;40==n?a=-o:37==n?s=-o:39==n?s=o:a=o;var l=[s,a];Ge(l,i.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:wa,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(tu);const Nu=ku;var Ru=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Uu=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:yu,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Ru(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==T.KEYDOWN||t.type==T.KEYPRESS){var r=t.originalEvent,n=r.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var i=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;$l(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(tu);var Du=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qu="trackpad",Gu=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var i=n.condition?n.condition:hu;return r.condition_=n.onFocusOnly?su(uu,i):i,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return Du(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==T.WHEEL)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==T.WHEEL&&(e=n.deltaY,it&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=lt),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Qu:"wheel");var o=r.getView();if(this.mode_===Qu&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-ae(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),$l(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(tu);const ju=Gu;var Hu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zu=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=_),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return Hu(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==fl){var l=s.getViewport().getBoundingClientRect(),u=iu(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(ou);const Vu=zu;var Ku=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qu=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=_),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Ku(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,s=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=iu(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(ou);const Wu=qu;var Xu=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yu=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return Xu(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],s=e-i[1],a=o*o+s*s;if(a<n){if(0===a)for(var l=0;l<this.stride;++l)r[l]=i[l];else{var u=this.getRadius()/Math.sqrt(a);for(r[0]=i[0]+u*o,r[1]=i[1]+u*s,l=2;l<this.stride;++l)r[l]=i[l]}return r.length=this.stride,a}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return Lt(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){if(te(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||t[1]<=e[1]&&t[3]>=e[1]||Gt(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=Hr(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,s=this.stride;o<s;++o)n[i++]=n[o];n.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(Ir(r,0,r.length,n,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(Tr(r,0,r.length,n,t,e,r)),this.changed()},e}(Rr);Yu.prototype.transform;const Zu=Yu;var Ju=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$u=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout()),y(a,c.getFlatCoordinates()),l.push(a.length)}i.setFlatCoordinates(o,a),i.ends_=l}return i}return Ju(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?y(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<Bt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=Y.XYM&&this.layout!=Y.XYZM||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,s){if(s)return Mn(t,e,r[r.length-1],n,i,o);var a;if(i<t[n-1])return o?((a=t.slice(0,n))[n-1]=i,a):null;if(t[t.length-1]<i)return o?((a=t.slice(t.length-n))[n-1]=i,a):null;for(var l=0,u=r.length;l<u;++l){var h=r[l];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return Mn(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return Zr(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Nn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,n=[],i=0,o=0,s=e.length;o<s;++o){var a=e[o],l=new Nn(t.slice(i,a),r);n.push(l),i=a}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,s=n.length;o<s;++o){var a=n[o];y(t,Ln(e,r,a,i,.5)),r=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,s,a){for(var l=0,u=r.length;l<u;++l){var h=r[l];s=Kr(t,e,h,n,i,o,s),a.push(s),e=h}return s}(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,Y.XY,n)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o){if(An(t,e,r[o],n,i))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=Vr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(Rr);const th=$u;var eh=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rh=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return eh(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?y(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<Bt(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,s=0,a=i.length;s<a;s+=o){var l=ce(t,e,i[s],i[s+1]);if(l<n){n=l;for(var u=0;u<o;++u)r[u]=i[s+u];r.length=o}}return n},e.prototype.getCoordinates=function(){return Yr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new on(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var s=new on(t.slice(i,i+r),e);n.push(s)}return n},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r)if(Pt(t,e[n],e[n+1]))return!0;return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Rr);const nh=rh;function ih(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=r.length;s<a;++s){var l=r[s];o=kt(t,e,l[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var oh=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sh=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout());for(var A=a.length,f=c.getEnds(),p=0,d=f.length;p<d;++p)f[p]+=A;y(a,c.getFlatCoordinates()),l.push(f)}r=o,e=a,n=l}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return oh(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;y(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();var i=new e(this.flatCoordinates.slice(),this.layout,r);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,r,n){return n<Bt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o){var a=r[o];i=Qr(t,e,a,n,i),e=a[a.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,s,a,l,u,h){for(var c=[NaN,NaN],A=0,f=r.length;A<f;++A){var p=r[A];u=jr(t,e,p,n,i,!0,s,a,l,u,c),e=p[p.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var s=0,a=r.length;s<a;++s){var l=r[s];if(ln(t,e,l,n,i,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,s=r.length;o<s;++o){var a=r[o];i+=tn(t,e,a,n),e=a[a.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?vn(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Jr(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=ih(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=hn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new nh(this.getFlatInteriorPoints().slice(),Y.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o){var a=r[o];if(!yn(t,e,a,n,void 0))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=vn(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,s,a){for(var l=0,u=r.length;l<u;++l){var h=r[l],c=[];s=Xr(t,e,h,n,i,o,s,c),a.push(c),e=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,Y.XY,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,s=n.length;o<s;++o)n[o]-=e;return new xn(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,s=r.length;o<s;++o){var a=r[o].slice(),l=a[a.length-1];if(0!==i)for(var u=0,h=a.length;u<h;++u)a[u]-=i;var c=new xn(e.slice(i,l),t,a);n.push(c),i=l}return n},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,s=r.length;o<s;++o){var a=r[o];if(pn(t,e,a,n,i))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,n,i){for(var o=i||[],s=0,a=0,l=r.length;a<l;++a){var u=Vr(t,e,r[a],n,o[s]);o[s++]=u,e=u[u.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(Rr);const ah=sh;var lh=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uh={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},hh="drawstart",ch=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return lh(e,t),e}(h),Ah=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=_),(r=t.call(this,n)||this).on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){switch(t){case"Point":case"MultiPoint":return uh.POINT;case"LineString":case"MultiLineString":return uh.LINE_STRING;case"Polygon":case"MultiPolygon":return uh.POLYGON;case"Circle":return uh.CIRCLE;default:throw new Error("Invalid type: "+t)}}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===uh.POLYGON?3:2,r.maxPoints_=r.mode_===uh.CIRCLE?2:e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:v,r.geometryLayout_=e.geometryLayout?e.geometryLayout:Y.XY;var i,o=e.geometryFunction;if(!o){var s,a=r.mode_;a===uh.CIRCLE?o=function(t,e,r){var n=e||new Zu([NaN,NaN]),i=xr(t[0]),o=He(i,xr(t[t.length-1]));return n.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_),n}:(a===uh.POINT?s=on:a===uh.LINE_STRING?s=Nn:a===uh.POLYGON&&(s=xn),o=function(t,e,r){return e?a===uh.POLYGON?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new s(t,this.geometryLayout_),e})}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new ta({source:new pa({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Hi(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:du,r.freehandCondition_,e.freehand?r.freehandCondition_=hu:r.freehandCondition_=e.freehandCondition?e.freehandCondition:gu,r.addChangeListener(Zl.ACTIVE,r.updateState_),r}return lh(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===T.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==uh.POINT&&this.freehandCondition_(e);var r=e.type===za.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===za.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===za.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===za.POINTERDOWN?n=!1:r&&this.getPointerCount()<2?(n=e.type===za.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===za.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===za.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Ha(za.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var r=!this.finishCoordinate_;r&&this.startDrawing_(t.coordinate),!r&&this.freehand_?this.finishDrawing():this.freehand_||r&&this.mode_!==uh.POINT||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_],i=this.mode_;if(i===uh.POINT)e=!0;else if(i===uh.CIRCLE)e=2===this.sketchCoords_.length;else if(i===uh.LINE_STRING)r=this.sketchCoords_.length>this.minPoints_;else if(i===uh.POLYGON){var o=this.sketchCoords_;r=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(r)for(var s=this.getMap(),a=0,l=n.length;a<l;a++){var u=n[a],h=s.getPixelFromCoordinate(u),c=t[0]-h[0],A=t[1]-h[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+A*A)<=f){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new X(new on(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new X);var e=t.getLinearRing(0),r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),r.changed()):(r=new Nn(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(r))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),r=Nr(this.geometryLayout_);t.length<r;)t.push(0);this.finishCoordinate_=t,this.mode_===uh.POINT?this.sketchCoords_=t.slice():this.mode_===uh.POLYGON?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new X(new Nn(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new X,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new ch(hh,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,r,n=this.getMap(),i=this.sketchFeature_.getGeometry(),o=n.getView().getProjection(),s=Nr(this.geometryLayout_);t.length<s;)t.push(0);this.mode_===uh.POINT?r=this.sketchCoords_:this.mode_===uh.POLYGON?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=t[0],r[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(t),"Polygon"===i.getType()&&this.mode_!==uh.POLYGON?this.createOrUpdateCustomSketchLine_(i):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===uh.LINE_STRING||o===uh.CIRCLE?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):o===uh.POLYGON&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,n,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),n=this.mode_;if(n===uh.LINE_STRING||n===uh.CIRCLE){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,r),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===uh.POLYGON){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();t.length>=2&&(i=t[t.length-2].slice(),t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)),o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===uh.LINE_STRING?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===uh.POLYGON&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new nh([e])):"MultiLineString"===this.type_?t.setGeometry(new th([e])):"MultiPolygon"===this.type_&&t.setGeometry(new ah([e])),this.dispatchEvent(new ch("drawend",t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new ch("drawabort",t))},e.prototype.appendCoordinates=function(t){var e,r=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),r===uh.LINE_STRING||r===uh.CIRCLE)e=this.sketchCoords_;else{if(r!==uh.POLYGON)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new X(new on(r)),this.updateSketchFeatures_(),this.dispatchEvent(new ch(hh,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(ou);const fh=Ah;var ph=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dh=1,gh=[0,0,0,0],yh=[],mh="modifyend",vh=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return ph(e,t),e}(h),_h=function(t){function e(e){var r,n,i=t.call(this,e)||this;if(i.on,i.once,i.un,i.boundHandleFeatureChange_=i.handleFeatureChange_.bind(i),i.condition_=e.condition?e.condition:vu,i.defaultDeleteCondition_=function(t){return au(t)&&pu(t)},i.deleteCondition_=e.deleteCondition?e.deleteCondition:i.defaultDeleteCondition_,i.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:hu,i.vertexFeature_=null,i.vertexSegments_=null,i.lastPixel_=[0,0],i.ignoreNextSingleClick_=!1,i.featuresBeingModified_=null,i.rBush_=new ra,i.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,i.snappedToVertex_=!1,i.changingFeature_=!1,i.dragSegments_=[],i.overlay_=new ta({source:new pa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(r=Hi(),function(t,e){return r.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i)},i.source_=null,i.hitDetection_=null,e.features?n=e.features:e.source&&(i.source_=e.source,n=new V(i.source_.getFeatures()),i.source_.addEventListener(sa.ADDFEATURE,i.handleSourceAdd_.bind(i)),i.source_.addEventListener(sa.REMOVEFEATURE,i.handleSourceRemove_.bind(i))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(i.hitDetection_=e.hitDetection),i.features_=n,i.features_.forEach(i.addFeature_.bind(i)),i.features_.addEventListener(Q.ADD,i.handleFeatureAdd_.bind(i)),i.features_.addEventListener(Q.REMOVE,i.handleFeatureRemove_.bind(i)),i.lastPointerEvent_=null,i.delta_=[0,0],i.snapToPointer_=void 0===e.snapToPointer?!i.hitDetection_:e.snapToPointer,i}return ph(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(T.CHANGE,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new V;for(var r=this.featuresBeingModified_.getArray(),n=0,i=e.length;n<i;++n)for(var o=e[n],s=0,a=o.length;s<a;++s){var l=o[s].feature;l&&-1===r.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new vh("modifystart",this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(T.CHANGE,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Et(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Et(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Et(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),A={feature:t,geometry:e,depth:[s,n],index:u,segment:c};this.rBush_.insert(Et(c),A)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:dh,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert(Ot(r),n);var s=e;this.rBush_.insert(s.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,r){var n=this.vertexFeature_;return n?n.getGeometry().setCoordinates(t):(n=new X(new on(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n)),n.set("features",e),n.set("geometries",r),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=za.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=za.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==za.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],r=[],n=[],i=0,o=this.dragSegments_.length;i<o;++i){var s=this.dragSegments_[i],a=s[0],l=a.feature;-1===r.indexOf(l)&&r.push(l);var u=a.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=a.depth,c=void 0,A=a.segment,f=s[1];e.length<u.getStride();)e.push(A[f][e.length]);switch(u.getType()){case"Point":c=e,A[0]=e,A[1]=e;break;case"MultiPoint":(c=u.getCoordinates())[a.index]=e,A[0]=e,A[1]=e;break;case"LineString":(c=u.getCoordinates())[a.index+f]=e,A[f]=e;break;case"MultiLineString":case"Polygon":(c=u.getCoordinates())[h[0]][a.index+f]=e,A[f]=e;break;case"MultiPolygon":(c=u.getCoordinates())[h[1]][h[0]][a.index+f]=e,A[f]=e;break;case"Circle":if(A[0]=e,A[1]=e,0===a.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var p=t.map.getView().getProjection(),d=ze(xr(u.getCenter()),xr(e)),g=wr();if(g){var y=u.clone().transform(g,p);y.setRadius(d),d=y.transform(p,g).getRadius()}u.setRadius(d),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,r,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var r=this.vertexFeature_;if(r){var n=t.map.getView().getProjection(),i=[],s=r.getGeometry().getCoordinates(),a=Et([s]),l=this.rBush_.getInExtent(a),u={};l.sort(wh);for(var h=0,c=l.length;h<c;++h){var A=l[h],f=A.segment,p=o(A.geometry),d=A.depth;if(d&&(p+="-"+d.join("-")),u[p]||(u[p]=new Array(2)),"Circle"!==A.geometry.getType()||A.index!==dh)if(!Qe(f[0],s)||u[p][0])if(!Qe(f[1],s)||u[p][1])o(f)in this.vertexSegments_&&!u[p][0]&&!u[p][1]&&this.insertVertexCondition_(t)&&i.push(A);else{if(u[p][0]&&0===u[p][0].index){var g=A.geometry.getCoordinates();switch(A.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":g=g[d[1]];case"Polygon":if(A.index!==g[d[0]].length-2)continue}}this.dragSegments_.push([A,1]),u[p][1]=A}else this.dragSegments_.push([A,0]),u[p][0]=A;else Qe(xh(e,A,n),s)&&!u[p][0]&&(this.dragSegments_.push([A,0]),u[p][0]=A)}i.length&&this.willModifyFeatures_(t,[i]);for(var y=i.length-1;y>=0;--y)this.insertVertex_(i[y],s)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if("Circle"===n.getType()){var i=n.getCenter(),o=r.featureSegments[0],s=r.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update(Ot(i),o);var a=n,l=wr();if(l){var u=t.map.getView().getProjection();a=Cn(a=a.clone().transform(l,u)).transform(u,l)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Et(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new vh(mh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var n,i,s=this,a=r||e.getCoordinateFromPixel(t),l=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===s.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,r){if("Point"===(r=r||t.getGeometry()).getType()&&p(s.features_.getArray(),t)){i=r;var o=r.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:r,segment:[o,o]}]}return!0}),{layerFilter:u})}if(!n){var h=Er(Ct(Cr(Ot(a,gh)),e.getView().getResolution()*this.pixelTolerance_,gh));n=this.rBush_.getInExtent(h)}if(n&&n.length>0){var c=n.sort((function(t,e){return bh(a,t,l)-bh(a,e,l)}))[0],A=c.segment,f=xh(a,c,l),d=e.getPixelFromCoordinate(f),g=ze(t,d);if(i||g<=this.pixelTolerance_){var y={};if(y[o(A)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-a[0],this.delta_[1]=f[1]-a[1]),"Circle"===c.geometry.getType()&&c.index===dh)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var m=e.getPixelFromCoordinate(A[0]),v=e.getPixelFromCoordinate(A[1]),_=He(d,m),w=He(d,v);g=Math.sqrt(Math.min(_,w)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(f=_>w?A[1]:A[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var b={};b[o(c.geometry)]=!0;for(var x=1,E=n.length;x<E;++x){var C=n[x].segment;if(!(Qe(A[0],C[0])&&Qe(A[1],C[1])||Qe(A[0],C[1])&&Qe(A[1],C[0])))break;var S=o(n[x].geometry);S in b||(b[S]=!0,y[o(C)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(r=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(r=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(r=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,a,s,1);var u={segment:[n[0],e],feature:i,geometry:o,depth:s,index:a};l.insert(Et(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:s,index:a+1};l.insert(Et(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=za.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new vh(mh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,n,i,s,a,l,u,h,c,A=this.dragSegments_,f={},p=!1;for(i=A.length-1;i>=0;--i)c=o((h=(r=A[i])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,a=f[c].left,(l=(s=f[c].index)-1)<0&&(l=0),t=e=(n=(h=void 0!==a?a:u).geometry).getCoordinates(),p=!1,n.getType()){case"MultiLineString":e[h.depth[0]].length>2&&(e[h.depth[0]].splice(s,1),p=!0);break;case"LineString":e.length>2&&(e.splice(s,1),p=!0);break;case"MultiPolygon":t=t[h.depth[1]];case"Polygon":(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),p=!0,0===s&&(t.pop(),t.push(t[0]),l=t.length-1))}if(p){this.setGeometryCoordinates_(n,e);var d=[];if(void 0!==a&&(this.rBush_.remove(a),d.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),d.push(u.segment[1])),void 0!==a&&void 0!==u){var g={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:d};this.rBush_.insert(Et(g.segment),g)}this.updateSegmentIndices_(n,s,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),A.length=0}}return p},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||m(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(ou);function wh(t,e){return t.index-e.index}function bh(t,e,r){var n=e.geometry;if("Circle"===n.getType()){var i=n;if(e.index===dh){var o=wr();o&&(i=i.clone().transform(o,r));var s=He(i.getCenter(),xr(t)),a=Math.sqrt(s)-i.getRadius();return a*a}}var l=xr(t);return yh[0]=xr(e.segment[0]),yh[1]=xr(e.segment[1]),function(t,e){return He(t,De(t,yh))}(l)}function xh(t,e,r){var n=e.geometry;if("Circle"===n.getType()&&e.index===dh){var i=n,o=wr();return o&&(i=i.clone().transform(o,r)),br(i.getClosestPoint(xr(t)))}var s=xr(t);return yh[0]=xr(e.segment[0]),yh[1]=xr(e.segment[1]),br(De(s,yh))}const Eh=_h;var Ch=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sh=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return Ch(e,t),e}(h),Bh={},Ih=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n,i,o=e||{};if(r.boundAddFeature_=r.addFeature_.bind(r),r.boundRemoveFeature_=r.removeFeature_.bind(r),r.condition_=o.condition?o.condition:pu,r.addCondition_=o.addCondition?o.addCondition:Au,r.removeCondition_=o.removeCondition?o.removeCondition:Au,r.toggleCondition_=o.toggleCondition?o.toggleCondition:gu,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:v,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(y((n=Hi()).Polygon,n.LineString),y(n.GeometryCollection,n.LineString),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new V,o.layers)if("function"==typeof o.layers)i=o.layers;else{var s=o.layers;i=function(t){return p(s,t)}}else i=v;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return Ch(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(Q.ADD,this.boundAddFeature_),this.features_.addEventListener(Q.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(Q.ADD,this.boundAddFeature_),this.features_.removeEventListener(Q.REMOVE,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){var r=this.getMap().getAllLayers().find((function(t){if(t instanceof ta&&t.getSource()&&t.getSource().hasFeature(e))return t}));r&&this.addFeatureLayerAssociation_(e,r)}},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=o(t);e in Bh||(Bh[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var r=this.getMap().getInteractions().getArray(),n=r.length-1;n>=0;--n){var i=r[n];if(i!==this&&i instanceof e&&i.getStyle()&&-1!==i.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(i.getStyle())}var s=o(t);t.setStyle(Bh[s]),delete Bh[s]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,s=this.getFeatures(),a=[],l=[];if(i){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=s.getLength()-1;u>=0;--u){var h=s.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(s.remove(h),a.push(h))}0!==l.length&&s.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||p(s.getArray(),t)?(r||n)&&p(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(this.addFeatureLayerAssociation_(t,i),l.push(t)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var A=a.length-1;A>=0;--A)s.remove(a[A]);s.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new Sh("select",l,a,t)),!0},e}(tu);const Th=Ih;var Ph=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Fh(t){return t.feature?t.feature:t.element?t.element:void 0}var Lh=[],Mh=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=v),i.stopDown||(i.stopDown=_),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new ra,r.GEOMETRY_SEGMENTERS_={Point:r.segmentPointGeometry_.bind(r),LineString:r.segmentLineStringGeometry_.bind(r),LinearRing:r.segmentLineStringGeometry_.bind(r),Polygon:r.segmentPolygonGeometry_.bind(r),MultiPoint:r.segmentMultiPointGeometry_.bind(r),MultiLineString:r.segmentMultiLineStringGeometry_.bind(r),MultiPolygon:r.segmentMultiPolygonGeometry_.bind(r),GeometryCollection:r.segmentGeometryCollectionGeometry_.bind(r),Circle:r.segmentCircleGeometry_.bind(r)},r}return Ph(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,n=o(t),i=t.getGeometry();if(i){var s=this.GEOMETRY_SEGMENTERS_[i.getType()];if(s){this.indexedFeaturesExtents_[n]=i.getExtent([1/0,1/0,-1/0,-1/0]);var a=[];if(s(a,i),1===a.length)this.rBush_.insert(Et(a[0]),{feature:t,segment:a[0]});else if(a.length>1){var l=a.map((function(t){return Et(t)})),u=a.map((function(e){return{feature:t,segment:e}}));this.rBush_.load(l,u)}}}r&&(this.featureChangeListenerKeys_[n]=P(t,T.CHANGE,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Fh(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Fh(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=o(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=E(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,n=o(t),i=this.indexedFeaturesExtents_[n];if(i){var s=this.rBush_,a=[];s.forEachInExtent(i,(function(e){t===e.feature&&a.push(e)}));for(var l=a.length-1;l>=0;--l)s.remove(a[l])}r&&(L(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(L),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(P(this.features_,Q.ADD,this.handleFeatureAdd_,this),P(this.features_,Q.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(P(this.source_,sa.ADDFEATURE,this.handleFeatureAdd_,this),P(this.source_,sa.REMOVEFEATURE,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=Et([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n),o=i.length;if(0===o)return null;var s,a=r.getView().getProjection(),l=xr(e),u=1/0,h=this.pixelTolerance_*this.pixelTolerance_,c=function(){if(s){var e=r.getPixelFromCoordinate(s);if(He(t,e)<=h)return{vertex:s,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var A=0;A<o;++A)"Circle"!==(f=i[A]).feature.getGeometry().getType()&&f.segment.forEach((function(t){var e=xr(t),r=He(l,e);r<u&&(s=t,u=r)}));if(w=c())return w}if(this.edge_){for(A=0;A<o;++A){var f,p=null;if("Circle"===(f=i[A]).feature.getGeometry().getType()){var d=f.feature.getGeometry(),g=wr();g&&(d=d.clone().transform(g,a)),p=br(Ue(l,d))}else{var y=f.segment,m=y[0],v=y[1];v&&(Lh[0]=xr(m),Lh[1]=xr(v),p=De(l,Lh))}if(p){var _=He(l,p);_<u&&(s=p,u=_)}}var w;if(w=c())return w}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var r=Cn(e).getCoordinates()[0],n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.GEOMETRY_SEGMENTERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.segmentLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e.prototype.segmentMultiPointGeometry_=function(t,e){e.getCoordinates().forEach((function(e){t.push([e])}))},e.prototype.segmentMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u)t.push(l.slice(u,u+2))},e.prototype.segmentPointGeometry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e}(ou);const Oh=Mh;var kh=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nh=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;return s.features=r,s.coordinate=n,s.startCoordinate=i,s.mapBrowserEvent=o,s}return kh(e,t),e}(h);const Rh=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).on,n.once,n.un,n.lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers&&!n.features_)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return p(o,t)}}else r=v;return n.layerFilter_=r,n.filter_=i.filter&&!n.features_?i.filter:v,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.condition_=i.condition?i.condition:hu,n.lastFeature_=null,n.addChangeListener(Zl.ACTIVE,n.handleActiveChanged_),n}return kh(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new V([this.lastFeature_]);return this.dispatchEvent(new Nh("translatestart",e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new V([this.lastFeature_]);return this.dispatchEvent(new Nh("translateend",e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new V([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(r,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new Nh("translating",i,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||p(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(ou);function Uh(t){var e=t||{},r=new V,n=new Ba(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new Cu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new ru({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new bu({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Vu),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new Wu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new Nu),r.push(new Uu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new ju({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Mu({duration:e.zoomDuration})),r}var Dh=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Qh=function(t){function e(e){return(e=b({},e)).controls||(e.controls=Yl()),e.interactions||(e.interactions=Uh({onFocusOnly:!0})),t.call(this,e)||this}return Dh(e,t),e.prototype.createRenderer=function(){return new Oa(this)},e}(Cl);var Gh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return K(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return K(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){K(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();const jh=Gh;function Hh(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function zh(t,e,r){return t+"/"+e+"/"+r}function Vh(t){return zh(t[0],t[1],t[2])}function Kh(t){return t.split("/").map(Number)}function qh(t){return(t[1]<<t[0])+t[2]}var Wh=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Xh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Kh(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Vh(e.tileCoord)),e.release())}.bind(this))}},e}(jh);var Yh=function(){function t(t,e,r,n){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Zh(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new Yh(t,e,r,n)}const Jh=Yh;var $h=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tc=[],ec=function(t){function e(e,r,n,i){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=n,o}return $h(e,t),e.prototype.getContext=function(t){var e=o(t);return e in this.context_||(this.context_[e]=ei(1,1,tc)),this.context_[e]},e.prototype.hasContext=function(t){return o(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=o(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_){var r=this.context_[e];ri(r),tc.push(r.canvas),delete this.context_[e]}t.prototype.release.call(this)},e}(Ea);const rc=ec;var nc=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const ic=function(t){function e(e,r,n,i,o,s){var a=t.call(this,e,r,s)||this;return a.extent=null,a.format_=i,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=n,a.key=n,a}return nc(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==ya.IDLE&&(this.setState(ya.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(ya.ERROR)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(ya.LOADED)},e.prototype.setLoader=function(t){this.loader_=t},e}(Ea);var oc=34962,sc=34963,ac=35044,lc=35048,uc=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function hc(t,e){for(var r=b({preserveDrawingBuffer:!0,antialias:!ot},e),n=uc.length,i=0;i<n;++i)try{var o=t.getContext(uc[i],r);if(o)return o}catch(TX){}return null}var cc={STATIC_DRAW:ac,STREAM_DRAW:35040,DYNAMIC_DRAW:lc},Ac=function(){function t(t,e){this.array=null,this.type=t,K(t===oc||t===sc,62),this.usage=void 0!==e?e:cc.STATIC_DRAW}return t.prototype.ofSize=function(t){this.array=new(fc(this.type))(t)},t.prototype.fromArray=function(t){var e=fc(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(fc(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function fc(t){switch(t){case oc:return Float32Array;case sc:return Uint32Array;default:return Float32Array}}const pc=Ac,dc={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var gc="\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n",yc="\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n";const mc=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||gc),e.compileShader(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||yc),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,i,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e,r,n){var i=this.getGL(),s=t.size;if(i.bindFramebuffer(i.FRAMEBUFFER,e?e.getFrameBuffer():null),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,this.renderTargetTexture_),!e){var a=o(i.canvas);if(!t.renderTargets[a]){var l=i.getContextAttributes();l&&l.preserveDrawingBuffer&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT)),t.renderTargets[a]=!0}}i.enable(i.BLEND),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),i.bindBuffer(i.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),i.useProgram(this.renderTargetProgram_),i.enableVertexAttribArray(this.renderTargetAttribLocation_),i.vertexAttribPointer(this.renderTargetAttribLocation_,2,i.FLOAT,!1,0,0),i.uniform2f(this.renderTargetUniformLocation_,s[0],s[1]),i.uniform1i(this.renderTargetTextureLocation_,0);var u=t.layerStatesArray[t.layerIndex].opacity;i.uniform1f(this.renderTargetOpacityLocation_,u),this.applyUniforms(t),r&&r(i,t),i.drawArrays(i.TRIANGLES,0,6),n&&n(i,t)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)}))},t}();function vc(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var _c=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wc={PROJECTION_MATRIX:"u_projectionMatrix",OFFSET_SCALE_MATRIX:"u_offsetScaleMatrix",OFFSET_ROTATION_MATRIX:"u_offsetRotateMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution"},bc={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},xc={};function Ec(t){return"shared/"+t}var Cc=0,Sc=function(t){function e(e){var r=t.call(this)||this,n=e||{};r.boundHandleWebGLContextLost_=r.handleWebGLContextLost.bind(r),r.boundHandleWebGLContextRestored_=r.handleWebGLContextRestored.bind(r),r.canvasCacheKey_=n.canvasCacheKey?Ec(n.canvasCacheKey):function(){var t="unique/"+Cc;return Cc+=1,t}(),r.canvas_=function(t){var e=xc[t];if(!e){var r=document.createElement("canvas");r.style.position="absolute",r.style.left="0",e={users:0,canvas:r},xc[t]=e}return e.users+=1,e.canvas}(r.canvasCacheKey_),r.gl_=hc(r.canvas_),r.bufferCache_={},r.extensionCache_={},r.currentProgram_=null,r.canvas_.addEventListener(dc.LOST,r.boundHandleWebGLContextLost_),r.canvas_.addEventListener(dc.RESTORED,r.boundHandleWebGLContextRestored_),r.offsetRotateMatrix_=[1,0,0,1,0,0],r.offsetScaleMatrix_=[1,0,0,1,0,0],r.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.uniformLocations_={},r.attribLocations_={},r.uniforms_=[],n.uniforms&&r.setUniforms(n.uniforms);var i=r.getGL();return r.postProcessPasses_=n.postProcesses?n.postProcesses.map((function(t){return new mc({webGlContext:i,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new mc({webGlContext:i})],r.shaderCompileErrors_=null,r.startTime_=Date.now(),r}return _c(e,t),e.prototype.setUniforms=function(t){for(var e in this.uniforms_=[],t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===Ec(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e},e.prototype.bindBuffer=function(t){var e=this.getGL(),r=o(t),n=this.bufferCache_[r];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=n),e.bindBuffer(t.getType(),n.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=o(t),n=this.bufferCache_[r];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(dc.LOST,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(dc.RESTORED,this.boundHandleWebGLContextRestored_),function(t){var e=xc[t];if(e&&(e.users-=1,!(e.users>0))){var r=hc(e.canvas).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete xc[t]}}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var r=this.getGL(),n=this.getCanvas(),i=t.size,o=t.pixelRatio;n.width=i[0]*o,n.height=i[1]*o,n.style.width=i[0]+"px",n.style.height=i[1]+"px",r.useProgram(this.currentProgram_);for(var s=this.postProcessPasses_.length-1;s>=0;s--)this.postProcessPasses_[s].init(t);r.bindTexture(r.TEXTURE_2D,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,e?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,i[0],i[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL();this.getExtension("OES_element_index_uint");var n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t,e,r){for(var n=0,i=this.postProcessPasses_.length;n<i;n++)n===i-1?this.postProcessPasses_[n].apply(t,null,e,r):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=ft(this.offsetScaleMatrix_);mt(n,2/e[0],2/e[1]);var i=ft(this.offsetRotateMatrix_);0!==r&&yt(i,-r),this.setUniformMatrixValue(wc.OFFSET_SCALE_MATRIX,vc(this.tmpMat4_,n)),this.setUniformMatrixValue(wc.OFFSET_ROTATION_MATRIX,vc(this.tmpMat4_,i)),this.setUniformFloatValue(wc.TIME,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(wc.ZOOM,t.viewState.zoom),this.setUniformFloatValue(wc.RESOLUTION,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,vc(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getShaderParameter(n,r.COMPILE_STATUS)){var s="Fragment shader compliation failed: ".concat(r.getShaderInfoLog(n));throw new Error(s)}if(r.deleteShader(n),!r.getShaderParameter(i,r.COMPILE_STATUS))throw s="Vertex shader compilation failed: ".concat(r.getShaderInfoLog(i)),new Error(s);if(r.deleteShader(i),!r.getProgramParameter(o,r.LINK_STATUS))throw s="GL program linking failed: ".concat(r.getShaderInfoLog(i)),new Error(s);return o},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return ft(e),_t(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformFloatVec4=function(t,e){this.getGL().uniform4fv(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*Bc(n.type)}return e}(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r),r+=i.size*Bc(i.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,s=n.RGBA,a=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,o,s,a,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,s,a,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i},e}(A);function Bc(t){switch(t){case bc.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case bc.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case bc.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case bc.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var Ic=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tc={GENERATE_BUFFERS:"GENERATE_BUFFERS"},Pc=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.inversePixelTransform_=[1,0,0,1,0,0],n.pixelContext_=null,n.postProcesses_=i.postProcesses,n.uniforms_=i.uniforms,n.helper,e.addChangeListener(Xi.MAP,n.removeHelper.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return Ic(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(In)){var n=new Zo(In,void 0,e,t);r.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Tn)){var n=new Zo(Tn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var r=!0,n=-1,i=void 0,o=0,s=t.layerStatesArray.length;o<s;o++){var a=t.layerStatesArray[o].layer,l=a.getRenderer();if(l instanceof e){var u=a.getClassName();if((r||u!==i)&&(n+=1,r=!1),i=u,l===this)break}else r=!0}var h="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(h)||(this.removeHelper(),this.helper=new Sc({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:h}),i&&(this.helper.getCanvas().className=i),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){_t(this.inversePixelTransform_,0,0,r.pixelRatio,-r.pixelRatio,0,0,-r.size[1]);var i=new Zo(t,this.inversePixelTransform_,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Sn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Bn,t,e)},e.prototype.getDataAtPixel=function(t,e,r){var n=gt([e.pixelRatio,0,0,e.pixelRatio,0,0],t.slice()),i=this.helper.getGL();if(!i)return null;var o=this.getLayer().getExtent();if(o&&!It(o,gt(e.pixelToCoordinateTransform,t.slice())))return null;var s=i.getContextAttributes();if(!s||!s.preserveDrawingBuffer)return new Uint8Array;var a,l=Math.round(n[0]),u=Math.round(n[1]),h=this.pixelContext_;if(!h){var c=document.createElement("canvas");c.width=1,c.height=1,h=c.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);try{h.drawImage(i.canvas,l,u,1,1,0,0,1,1),a=h.getImageData(0,0,1,1).data}catch(A){return a}return 0===a[3]?null:a},e}(Xo);function Fc(t,e){var r=e||[],n=256,i=255;return r[0]=Math.floor(t/n/n/n)/i,r[1]=Math.floor(t/n/n)%n/i,r[2]=Math.floor(t/n)%n/i,r[3]=t%n/i,r}const Lc=Pc;var Mc=new Uint8Array(4),Oc=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){m(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Mc[0]=0,Mc[1]=0,Mc[2]=0,Mc[3]=0,Mc;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Mc[0]=this.data_[4*r],Mc[1]=this.data_[4*r+1],Mc[2]=this.data_[4*r+2],Mc[3]=this.data_[4*r+3],Mc},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}();const kc=Oc;var Nc=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rc=function(t){function e(e,r){var n=this,i=r.uniforms||{},s=[1,0,0,1,0,0];i[wc.PROJECTION_MATRIX]=s,(n=t.call(this,e,{uniforms:i,postProcesses:r.postProcesses})||this).ready=!1,n.sourceRevision_=-1,n.verticesBuffer_=new pc(oc,lc),n.hitVerticesBuffer_=new pc(oc,lc),n.indicesBuffer_=new pc(sc,lc),n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.program_,n.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),n.hitVertexShader_=r.hitVertexShader,n.hitFragmentShader_=r.hitFragmentShader,n.hitProgram_;var a=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:bc.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:bc.FLOAT},{name:"a_index",size:1,type:bc.FLOAT}].concat(a),n.hitDetectionAttributes=[{name:"a_position",size:2,type:bc.FLOAT},{name:"a_index",size:1,type:bc.FLOAT},{name:"a_hitColor",size:4,type:bc.FLOAT},{name:"a_featureUid",size:1,type:bc.FLOAT}].concat(a),n.customAttributes=r.attributes?r.attributes:[],n.previousExtent_=[1/0,1/0,-1/0,-1/0],n.currentTransform_=s,n.renderTransform_=[1,0,0,1,0,0],n.invertRenderTransform_=[1,0,0,1,0,0],n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_,n.generateBuffersRun_=0,n.worker_=function(){var t='const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";n.indexOf("firefox");-1!==n.indexOf("safari")&&-1==n.indexOf("chrom")&&(n.indexOf("version/15.4")>=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t<d.length;t++)d[t]=e[n+2+t];let g=c?c.vertexPosition:0,x=c?c.indexPosition:0;const h=g/l;return i(t,g,a,u,0),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,1),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,2),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,3),d.length&&t.set(d,g+3),g+=l,s[x++]=h,s[x++]=h+1,s[x++]=h+3,s[x++]=h+1,s[x++]=h+2,s[x++]=h+3,r.vertexPosition=g,r.indexPosition=x,r}const f=self;f.onmessage=n=>{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;e<c.length;e+=i)g=s(c,e,d,u,r,g);const x=e({vertexBuffer:d.buffer,indexBuffer:u.buffer,renderInstructions:c.buffer},o);f.postMessage(x,[d.buffer,u.buffer,c.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),n.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===Tc.GENERATE_BUFFERS){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,wt(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):(this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(n)),n.featureCache_={},n.featureCount_=0;var l=n.getLayer().getSource();return n.sourceListenKeys_=[P(l,sa.ADDFEATURE,n.handleSourceFeatureAdded_,n),P(l,sa.CHANGEFEATURE,n.handleSourceFeatureChanged_,n),P(l,sa.REMOVEFEATURE,n.handleSourceFeatureDelete_,n),P(l,sa.CLEAR,n.handleSourceFeatureClear_,n)],l.forEachFeature(function(t){this.featureCache_[o(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(n)),n}return Nc(e,t),e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new kc(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[o(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState.projection,n=this.getLayer().getSource().getWrapX()&&r.canWrapX(),i=r.getExtent(),o=t.extent,s=n?$t(i):null,a=n?Math.ceil((o[2]-i[2])/s)+1:1,l=n?Math.floor((o[0]-i[0])/s):0,u=l,h=this.indicesBuffer_.getSize();do{this.helper.makeProjectionTransform(t,this.currentTransform_),vt(this.currentTransform_,u*s,0),pt(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.drawElements(0,h)}while(++u<a);this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var c=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t,l,a,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),c},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[vs.ANIMATING]&&!t.viewHints[vs.INTERACTING],o=!Nt(this.previousExtent_,t.extent),s=this.sourceRevision_<r.getRevision();if(s&&(this.sourceRevision_=r.getRevision()),i&&(o||s)){var a=n.projection,l=n.resolution,u=e instanceof xo?e.getRenderBuffer():0,h=Ct(t.extent,u*l);r.loadFeatures(h,l,a),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var s,a=[],l=[],u=0,h=0;for(var c in this.featureCache_)if((n=(r=this.featureCache_[c]).geometry)&&"Point"===n.getType()){a[0]=n.getFlatCoordinates()[0],a[1]=n.getFlatCoordinates()[1],gt(e,a),s=Fc(h+6,l),this.renderInstructions_[u++]=a[0],this.renderInstructions_[u++]=a[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=a[0],this.hitRenderInstructions_[h++]=a[1],this.hitRenderInstructions_[h++]=s[0],this.hitRenderInstructions_[h++]=s[1],this.hitRenderInstructions_[h++]=s[2],this.hitRenderInstructions_[h++]=s[3],this.hitRenderInstructions_[h++]=Number(c));for(var A=void 0,f=0;f<this.customAttributes.length;f++)A=this.customAttributes[f].callback(r.feature,r.properties),this.renderInstructions_[u++]=A,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=A)}var p={type:Tc.GENERATE_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(p.projectionTransform=e,p.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(p,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var d={type:Tc.GENERATE_BUFFERS,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};d.projectionTransform=e,d.hitDetection=!0,this.worker_.postMessage(d,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(K(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=gt(e.coordinateToPixelTransform,t.slice()),s=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),a=function(t){var e=0,r=256,n=255;return e+=Math.round(t[0]*r*r*r*n),e+=Math.round(t[1]*r*r*n),(e+=Math.round(t[2]*r*n))+Math.round(t[3]*n)}([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),l=this.hitRenderInstructions_[a],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?n(h,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t,e,r,n){if(this.hitVerticesBuffer_.getSize()){var i=e;this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),vt(this.currentTransform_,i*n,0),pt(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t);var o=this.indicesBuffer_.getSize();this.helper.drawElements(0,o)}while(++i<r)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){L(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(Lc);const Uc=Rc;var Dc=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qc={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},Gc=["#00f","#0ff","#0f0","#ff0","#f00"];const jc=function(t){function e(e){var r=this,n=e||{},i=b({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(r=t.call(this,i)||this).gradient_=null,r.addChangeListener(Qc.GRADIENT,r.handleGradientChanged_),r.setGradient(n.gradient?n.gradient:Gc),r.setBlur(void 0!==n.blur?n.blur:15),r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Dc(e,t),e.prototype.getBlur=function(){return this.get(Qc.BLUR)},e.prototype.getGradient=function(){return this.get(Qc.GRADIENT)},e.prototype.getRadius=function(){return this.get(Qc.RADIUS)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=ei(1,256),r=e.createLinearGradient(0,0,1,256),n=1/(t.length-1),i=0,o=t.length;i<o;++i)r.addColorStop(i*n,t[i]);return e.fillStyle=r,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Qc.BLUR,t)},e.prototype.setGradient=function(t){this.set(Qc.GRADIENT,t)},e.prototype.setRadius=function(t){this.set(Qc.RADIUS,t)},e.prototype.createRenderer=function(){return new Uc(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?ae(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Qc.RADIUS)+this.get(Qc.BLUR))}.bind(this),u_blurSlope:function(){return this.get(Qc.RADIUS)/Math.max(1,this.get(Qc.BLUR))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(xo);var Hc=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const zc=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return Hc(e,t),e}(to);var Vc=.5,Kc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},qc={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Wc=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Xc=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return Wc(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=Yt(a,Cr(e.extent,n.projection))),!s[vs.ANIMATING]&&!s[vs.INTERACTING]&&!ee(a))if(o){var l=n.projection,u=o.getImage(a,i,r,l);u&&(this.loadImage(u)?this.image_=u:u.getState()===Un.EMPTY&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=gt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!It(i,n))return null;var o=this.image_.getExtent(),s=this.image_.getImage(),a=$t(o),l=Math.floor(s.width*((n[0]-o[0])/a));if(l<0||l>=s.width)return null;var u=Xt(o),h=Math.floor(s.height*((o[3]-n[1])/u));return h<0||h>=s.height?null:this.getImageData(s,l,h)},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,l=t.viewState,u=l.center,h=a*i/(l.resolution*o),c=t.extent,A=l.resolution,f=l.rotation,p=Math.round($t(c)/A*a),d=Math.round(Xt(c)/A*a);_t(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,f,-p/2,-d/2),wt(this.inversePixelTransform,this.pixelTransform);var g=bt(this.pixelTransform);this.useContainer(e,g,this.getBackground(t));var y=this.context,m=y.canvas;m.width!=p||m.height!=d?(m.width=p,m.height=d):this.containerReused||y.clearRect(0,0,p,d);var v=!1,_=!0;if(s.extent){var w=Cr(s.extent,l.projection);(v=(_=te(w,t.extent))&&!Tt(w,t.extent))&&this.clipUnrotated(y,t,w)}var x=r.getImage(),E=_t(this.tempTransform,p/2,d/2,h,h,0,o*(n[0]-u[0])/i,o*(u[1]-n[3])/i);this.renderedResolution=i*a/o;var C=x.width*E[0],S=x.height*E[3];if(this.getLayer().getSource().getInterpolate()||b(y,Kc),this.preRender(y,t),_&&C>=.5&&S>=.5){var B=E[4],I=E[5],T=s.opacity,P=void 0;1!==T&&(P=y.globalAlpha,y.globalAlpha=T),y.drawImage(x,0,0,+x.width,+x.height,B,I,C,S),1!==T&&(y.globalAlpha=P)}return this.postRender(y,t),v&&y.restore(),b(y,qc),g!==m.style.transform&&(m.style.transform=g),this.container},e}(rs);var Yc=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Zc=function(t){function e(e){return t.call(this,e)||this}return Yc(e,t),e.prototype.createRenderer=function(){return new Xc(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(zc),Jc=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?ir(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===et.TILE_PIXELS&&(n=ir(n)).setWorldExtent(e.extent),r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return b({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return n()},t.prototype.readFeature=function(t,e){return n()},t.prototype.readFeatures=function(t,e){return n()},t.prototype.readGeometry=function(t,e){return n()},t.prototype.readProjection=function(t){return n()},t.prototype.writeFeature=function(t,e){return n()},t.prototype.writeFeatures=function(t,e){return n()},t.prototype.writeGeometry=function(t,e){return n()},t}();function $c(t,e,r){var n,i=r?ir(r.featureProjection):null,o=r?ir(r.dataProjection):null;if(n=i&&o&&!Ar(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var s=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return n}var tA="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function eA(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(e,r))}return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}var rA={
|
|
2
2
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
-
read:function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=r?i-1:0,A=r?-1:1,f=t[e+c];for(c+=A,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=A,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=A,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,A=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?A/l:A*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+f]=255&s,f+=p,s/=256,u-=8);t[r+f-p]|=128*d}},nA=oA,iA=rA;function oA(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}oA.Varint=0,oA.Fixed64=1,oA.Bytes=2,oA.Fixed32=5;var sA=4294967296,aA=1/sA,lA="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function uA(t){return t.type===oA.Bytes?t.readVarint()+t.pos:t.pos+1}function hA(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function cA(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function AA(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function fA(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function pA(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function dA(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function gA(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function yA(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function mA(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function vA(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function _A(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function wA(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function bA(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function xA(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}oA.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=wA(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=xA(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=wA(this.buf,this.pos)+wA(this.buf,this.pos+4)*sA;return this.pos+=8,t},readSFixed64:function(){var t=wA(this.buf,this.pos)+xA(this.buf,this.pos+4)*sA;return this.pos+=8,t},readFloat:function(){var t=iA.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=iA.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return hA(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return hA(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&lA?function(t,e,r){return lA.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==oA.Bytes)return t.push(this.readVarint(e));var r=uA(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==oA.Bytes)return t.push(this.readSVarint());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==oA.Bytes)return t.push(this.readBoolean());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==oA.Bytes)return t.push(this.readFloat());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==oA.Bytes)return t.push(this.readDouble());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==oA.Bytes)return t.push(this.readFixed32());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==oA.Bytes)return t.push(this.readSFixed32());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==oA.Bytes)return t.push(this.readFixed64());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==oA.Bytes)return t.push(this.readSFixed64());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===oA.Varint)for(;this.buf[this.pos++]>127;);else if(e===oA.Bytes)this.pos=this.readVarint()+this.pos;else if(e===oA.Fixed32)this.pos+=4;else{if(e!==oA.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),bA(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),bA(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),bA(this.buf,-1&t,this.pos),bA(this.buf,Math.floor(t*aA),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),bA(this.buf,-1&t,this.pos),bA(this.buf,Math.floor(t*aA),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&cA(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),iA.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),iA.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&cA(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,oA.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,AA,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,fA,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,gA,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pA,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dA,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,yA,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,mA,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,vA,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_A,e)},writeBytesField:function(t,e){this.writeTag(t,oA.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,oA.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,oA.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,oA.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,oA.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,oA.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,oA.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,oA.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,oA.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,oA.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var EA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function CA(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}const SA=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return EA(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(L),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(P(this.geometries_[t],T.CHANGE,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<Bt(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,s=i.length;o<s;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){Mt(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)Rt(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return CA(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,s=n.length;o<s;++o){var a=n[o],l=a.getSimplifiedGeometry(t);r.push(l),l!==a&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return"GeometryCollection"},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=Vt(this.getExtent()));for(var i=this.geometries_,o=0,s=i.length;o<s;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(CA(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Mr);var BA=[1,0,0,1,0,0],IA=function(){function t(t,e,r,n,i){this.styleFunction,this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_="Point"===this.type_?Ot(this.flatCoordinates_):kt(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Vt(this.getExtent());this.flatInteriorPoints_=un(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ih(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=hn(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Ln(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],s=Ln(t,e,o,2,.5);y(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=ir(t)).getExtent(),r=t.getWorldExtent();if(e&&r){var n=Xt(r)/Xt(e);_t(BA,r[0],r[3],n,-n,0,0,0),Br(this.flatCoordinates_,0,this.flatCoordinates_.length,2,BA,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();function TA(t,e){var r=t.getId(),n=function(t){var e=t.getType();switch(e){case"Point":return new on(t.getFlatCoordinates());case"MultiPoint":return new nh(t.getFlatCoordinates(),Y.XY);case"LineString":return new Nn(t.getFlatCoordinates(),Y.XY);case"MultiLineString":return new th(t.getFlatCoordinates(),Y.XY,t.getEnds());case"Polygon":var r=t.getFlatCoordinates(),n=t.getEnds(),i=_n(r,n);return i.length>1?new ah(r,Y.XY,i):new xn(r,Y.XY,n);default:throw new Error("Invalid geometry type:"+e)}}(t),i=t.getProperties(),o=new X;return void 0!==e&&o.setGeometryName(e),o.setGeometry(n),void 0!==r&&o.setId(r),o.setProperties(i,!0),o}IA.prototype.getEndss=IA.prototype.getEnds,IA.prototype.getFlatCoordinates=IA.prototype.getOrientedFlatCoordinates;const PA=IA;var FA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),LA=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new se({code:"",units:et.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:PA,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return FA(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<i;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),r.push(a,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):K(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var r;return 1===t?r=1===e?"Point":"MultiPoint":2===t?r=1===e?"LineString":"MultiLineString":3===t&&(r="Polygon"),r}(i,l.length);if(this.featureClass_===PA)(n=new this.featureClass_(u,a,l,s,o)).transform(r.dataProjection);else{var h=void 0;if("Polygon"==u){var c=_n(a,l);h=c.length>1?new ah(a,Y.XY,c):new xn(a,Y.XY,l)}else h="Point"===u?new on(a,Y.XY):"LineString"===u?new Nn(a,Y.XY):"MultiPoint"===u?new nh(a,Y.XY):"MultiLineString"===u?new th(a,Y.XY,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var A=$c(h,!1,r);n.setGeometry(A),void 0!==o&&n.setId(o),n.setProperties(s,!0)}return n},e.prototype.getType=function(){return"arraybuffer"},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=ir(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new nA(t),s=o.readFields(MA,{}),a=[];for(var l in s)if(!r||-1!=r.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;i.setExtent(h);for(var c=0,A=u.length;c<A;++c){var f=NA(o,u,c),p=this.createFeature_(o,f,n);null!==p&&a.push(p)}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Jc);function MA(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(OA,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function OA(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1==(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function kA(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function NA(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(kA,i,n),i}const RA=LA;var UA=10,DA=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=pr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&$t(n)==$t(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?$t(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?$t(this.targetProj_.getExtent()):null;var l=Zt(r),u=Jt(r),h=zt(r),c=Ht(r),A=this.transformInv_(l),f=this.transformInv_(u),p=this.transformInv_(h),d=this.transformInv_(c),g=UA+(o?Math.max(0,Math.ceil(ue(jt(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,A,f,p,d,g),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,r){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,s,a,l){var u=Et([i,o,s,a]),h=this.sourceWorldWidth_?$t(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,A=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(f=$t(Et([t,e,r,n]))/this.targetWorldWidth_>.25||f),!A&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)),!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||te(u,this.maxSourceExtent_)){var p=0;if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(p=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=p&&4!=p&&8!=p)return;if(l>0){if(!f){var d,g=[(t[0]+r[0])/2,(t[1]+r[1])/2],y=this.transformInv_(g);d=A?(fe(i[0],c)+fe(s[0],c))/2-fe(y[0],c):(i[0]+s[0])/2-y[0];var m=(i[1]+s[1])/2-y[1];f=d*d+m*m>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var v=[(e[0]+r[0])/2,(e[1]+r[1])/2],_=this.transformInv_(v),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,v,w,i,o,_,b,l-1),this.addQuad_(w,v,r,n,b,_,s,a,l-1)}else{var x=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(x),C=[(r[0]+n[0])/2,(r[1]+n[1])/2],S=this.transformInv_(C);this.addQuad_(t,x,C,n,i,E,S,a,l-1),this.addQuad_(x,e,r,C,E,o,s,S,l-1)}return}}if(A){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&p)&&this.addTriangle_(t,r,n,i,s,a),0==(14&p)&&this.addTriangle_(t,r,e,i,s,o),p&&(0==(13&p)&&this.addTriangle_(e,n,t,o,a,i),0==(7&p)&&this.addTriangle_(e,n,r,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;Ut(t,i[0]),Ut(t,i[1]),Ut(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();const QA=DA;var GA,jA=[];function HA(t,e,r,n,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(n,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(r,i)),t.restore()}function zA(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function VA(t,e,r,n){var i=dr(r,e,t),o=or(e,n,r),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||It(l,i)){var u=or(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function KA(t,e,r,n,i,o,s,a,l,u,h,c){var A=ei(Math.round(r*t),Math.round(r*e),jA);if(c||b(A,Kc),0===l.length)return A.canvas;function f(t){return Math.round(t*r)/r}A.scale(r,r),A.globalCompositeOperation="lighter";var p=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){Rt(p,t.extent)}));var d=$t(p),g=Xt(p),y=ei(Math.round(r*d/n),Math.round(r*g/n));c||b(y,Kc);var m=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-p[0],i=-(t.extent[3]-p[3]),o=$t(t.extent),s=Xt(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*m,i*m,o*m,s*m)}));var v=Zt(s);return a.getTriangles().forEach((function(t,e,i){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],d=s[1][1],g=s[2][0],m=s[2][1],_=f((a[0][0]-v[0])/o),w=f(-(a[0][1]-v[1])/o),b=f((a[1][0]-v[0])/o),x=f(-(a[1][1]-v[1])/o),E=f((a[2][0]-v[0])/o),C=f(-(a[2][1]-v[1])/o),S=l,B=u;l=0,u=0;var I=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var s=Math.abs(t[o][r]);s>i&&(i=s,n=o)}if(0===i)return null;var a=t[n];t[n]=t[r],t[r]=a;for(var l=r+1;l<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][h]}for(var c=new Array(e),A=e-1;A>=0;A--){c[A]=t[A][e]/t[A][A];for(var f=A-1;f>=0;f--)t[f][e]-=t[f][A]*c[A]}return c}([[h-=S,d-=B,0,0,b-_],[g-=S,m-=B,0,0,E-_],[0,0,h,d,x-w],[0,0,g,m,C-w]]);if(I){if(A.save(),A.beginPath(),function(){if(void 0===GA){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",HA(t,4,5,4,0),HA(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;GA=zA(e,0)||zA(e,4)||zA(e,8)}return GA}()||!c){A.moveTo(b,x);for(var T=_-b,P=w-x,F=0;F<4;F++)A.lineTo(b+f((F+1)*T/4),x+f(F*P/3)),3!=F&&A.lineTo(b+f((F+1)*T/4),x+f((F+1)*P/3));A.lineTo(E,C)}else A.moveTo(b,x),A.lineTo(_,w),A.lineTo(E,C);A.clip(),A.transform(I[0],I[2],I[1],I[3],_,w),A.translate(p[0]-S,p[3]-B),A.scale(n/r,-n/r),A.drawImage(y.canvas,0,0),A.restore()}})),h&&(A.save(),A.globalCompositeOperation="source-over",A.strokeStyle="black",A.lineWidth=1,a.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-v[0])/o,s=-(n[0][1]-v[1])/o,a=(n[1][0]-v[0])/o,l=-(n[1][1]-v[1])/o,u=(n[2][0]-v[0])/o,h=-(n[2][1]-v[1])/o;A.beginPath(),A.moveTo(a,l),A.lineTo(i,s),A.lineTo(u,h),A.closePath(),A.stroke()})),A.restore()),A.canvas}var qA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const WA=function(t){function e(e,r,n,i,o,s,a,l,u,h,c,A){var f=t.call(this,o,ya.IDLE,{interpolate:!!A})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=r,f.targetTileGrid_=i,f.wrappedTileCoord_=s||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var p=i.getTileCoordExtent(f.wrappedTileCoord_),d=f.targetTileGrid_.getExtent(),g=f.sourceTileGrid_.getExtent(),y=d?Yt(p,d):p;if(0===jt(y))return f.state=ya.EMPTY,f;var m=e.getExtent();m&&(g=g?Yt(g,m):m);var v=i.getResolution(f.wrappedTileCoord_[0]),_=function(t,e,r,n){var i=Vt(r),o=VA(t,e,i,n);return(!isFinite(o)||o<=0)&&Gt(r,(function(r){return o=VA(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,y,v);if(!isFinite(_)||_<=0)return f.state=ya.EMPTY,f;var w=void 0!==h?h:Vc;if(f.triangulation_=new QA(e,n,y,g,_*w,v),0===f.triangulation_.getTriangles().length)return f.state=ya.EMPTY,f;f.sourceZ_=r.getZForResolution(_);var b=f.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(b[1]=ae(b[1],g[1],g[3]),b[3]=ae(b[3],g[1],g[3])):b=Yt(b,g)),jt(b)){for(var x=r.getTileRangeForExtentAndZ(b,f.sourceZ_),E=x.minX;E<=x.maxX;E++)for(var C=x.minY;C<=x.maxY;C++){var S=u(f.sourceZ_,E,C,a);S&&f.sourceTiles_.push(S)}0===f.sourceTiles_.length&&(f.state=ya.EMPTY)}else f.state=ya.EMPTY;return f}return qA(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==ya.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=ya.ERROR;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=KA(n,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=ya.LOADED}this.changed()},e.prototype.load=function(){if(this.state==ya.IDLE){this.state=ya.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==ya.IDLE||i==ya.LOADING){t++;var o=P(e,T.CHANGE,(function(r){var n=e.getState();n!=ya.LOADED&&n!=ya.ERROR&&n!=ya.EMPTY||(L(o),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,r){t.getState()==ya.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(L),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(ri(this.canvas_.getContext("2d")),jA.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(Ea);var XA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const YA=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Jh(0,0,0,0),r}return XA(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ya.LOADED||r==ya.EMPTY||r==ya.ERROR&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,r,i,o);return a.getState()==ya.ERROR&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(ya.LOADED)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=gt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!It(i,n))return null;for(var o=e.pixelRatio,s=e.viewState.projection,a=e.viewState,l=r.getRenderSource(),u=l.getTileGridForProjection(a.projection),h=l.getTilePixelRatio(e.pixelRatio),c=u.getZForResolution(a.resolution);c>=u.getMinZoom();--c){var A=u.getTileCoordForCoordAndZ(n,c),f=l.getTile(c,A[1],A[2],o,s);if(!(f instanceof Sa||f instanceof WA))return null;if(f.getState()===ya.LOADED){var p=u.getOrigin(c),d=jn(u.getTileSize(c)),g=u.getResolution(c),y=Math.floor(h*((n[0]-p[0])/g-A[1]*d[0])),m=Math.floor(h*((p[1]-n[1])/g-A[2]*d[1])),v=Math.round(h*l.getGutterForProjection(a.projection));return this.getImageData(f.getImage(),y+v,m+v)}}return null},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],n=t.viewState,i=n.projection,s=n.resolution,a=n.center,l=n.rotation,u=t.pixelRatio,h=this.getLayer(),c=h.getSource(),A=c.getRevision(),p=c.getTileGridForProjection(i),d=p.getZForResolution(s,c.zDirection),g=p.getResolution(d),y=t.extent,m=t.viewState.resolution,v=c.getTilePixelRatio(u),_=Math.round($t(y)/m*u),w=Math.round(Xt(y)/m*u),x=r.extent&&Cr(r.extent);x&&(y=Yt(y,Cr(r.extent)));var E=g*_/2/v,C=g*w/2/v,S=[a[0]-E,a[1]-C,a[0]+E,a[1]+C],B=p.getTileRangeForExtentAndZ(y,d),I={};I[d]={};var T=this.createLoadedTileFinder(c,i,I),P=this.tmpExtent,F=this.tmpTileRange_;this.newTiles_=!1;for(var L=l?Wt(n.center,m,l,t.size):void 0,M=B.minX;M<=B.maxX;++M)for(var O=B.minY;O<=B.maxY;++O)if(!l||p.tileCoordIntersectsViewport([d,M,O],L)){var k=this.getTile(d,M,O,t);if(this.isDrawableTile(k)){var N=o(this);if(k.getState()==ya.LOADED&&(I[d][k.tileCoord.toString()]=k,(ot=k.inTransition(N))&&1!==r.opacity&&(k.endTransition(N),ot=!1),this.newTiles_||!ot&&-1!==this.renderedTiles.indexOf(k)||(this.newTiles_=!0)),1===k.getAlpha(N,t.time))continue}var R=p.getTileCoordChildTileRange(k.tileCoord,F,P),U=!1;R&&(U=T(d+1,R)),U||p.forEachTileCoordParentTileRange(k.tileCoord,T,F,P)}var D=g/s*u/v;_t(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,l,-_/2,-w/2);var Q=bt(this.pixelTransform);this.useContainer(e,Q,this.getBackground(t));var G=this.context,j=G.canvas;wt(this.inversePixelTransform,this.pixelTransform),_t(this.tempTransform,_/2,w/2,D,D,0,-_/2,-w/2),j.width!=_||j.height!=w?(j.width=_,j.height=w):this.containerReused||G.clearRect(0,0,_,w),x&&this.clipUnrotated(G,t,x),c.getInterpolate()||b(G,Kc),this.preRender(G,t),this.renderedTiles.length=0;var H,z,V,K=Object.keys(I).map(Number);K.sort(f),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(H=[],z=[]):K=K.reverse();for(var q=K.length-1;q>=0;--q){var W=K[q],X=c.getTilePixelSize(W,u,i),Y=p.getResolution(W)/g,Z=X[0]*Y*D,J=X[1]*Y*D,$=p.getTileCoordForCoordAndZ(Zt(S),W),tt=p.getTileCoordExtent($),et=gt(this.tempTransform,[v*(tt[0]-S[0])/g,v*(S[3]-tt[3])/g]),rt=v*c.getGutterForProjection(i),nt=I[W];for(var it in nt){var ot,st=(k=nt[it]).tileCoord,at=$[1]-st[1],lt=Math.round(et[0]-(at-1)*Z),ut=$[2]-st[2],ht=Math.round(et[1]-(ut-1)*J),ct=lt-(M=Math.round(et[0]-at*Z)),At=ht-(O=Math.round(et[1]-ut*J)),ft=d===W,pt=!1;if(!(ot=ft&&1!==k.getAlpha(o(this),t.time)))if(H){V=[M,O,M+ct,O,M+ct,O+At,M,O+At];for(var dt=0,yt=H.length;dt<yt;++dt)if(d!==W&&W<z[dt]){var mt=H[dt];te([M,O,M+ct,O+At],[mt[0],mt[3],mt[4],mt[7]])&&(pt||(G.save(),pt=!0),G.beginPath(),G.moveTo(V[0],V[1]),G.lineTo(V[2],V[3]),G.lineTo(V[4],V[5]),G.lineTo(V[6],V[7]),G.moveTo(mt[6],mt[7]),G.lineTo(mt[4],mt[5]),G.lineTo(mt[2],mt[3]),G.lineTo(mt[0],mt[1]),G.clip())}H.push(V),z.push(W)}else G.clearRect(M,O,ct,At);this.drawTileImage(k,t,M,O,ct,At,rt,ft),H&&!ot?(pt&&G.restore(),this.renderedTiles.unshift(k)):this.renderedTiles.push(k),this.updateUsedTiles(t.usedTiles,c,k)}}return this.renderedRevision=A,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Nt(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=u,this.renderedProjection=i,this.manageTilePyramid(t,c,p,u,i,y,d,h.getPreload()),this.scheduleExpireCache(t,c),this.postRender(G,t),r.extent&&G.restore(),b(G,qc),Q!==j.style.transform&&(j.style.transform=Q),this.container},e.prototype.drawTileImage=function(t,e,r,n,i,s,a,l){var u=this.getTileImage(t);if(u){var h=o(this),c=e.layerStatesArray[e.layerIndex],A=c.opacity*(l?t.getAlpha(h,e.time):1),f=A!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=A),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,r,n,i,s),f&&this.context.restore(),A!==c.opacity?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var n=o(t);n in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var n=o(e);n in t||(t[n]={}),t[n][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,n,i,s,a,l,u){var h=o(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,A,f,p,d,g,y=t.wantedTiles[h],m=t.tileQueue,v=r.getMinZoom(),_=t.viewState.rotation,w=_?Wt(t.viewState.center,t.viewState.resolution,_,t.size):void 0,b=0;for(g=v;g<=a;++g)for(A=r.getTileRangeForExtentAndZ(s,g,A),f=r.getResolution(g),p=A.minX;p<=A.maxX;++p)for(d=A.minY;d<=A.maxY;++d)_&&!r.tileCoordIntersectsViewport([g,p,d],w)||(a-g<=l?(++b,(c=e.getTile(g,p,d,n,i)).getState()==ya.IDLE&&(y[c.getKey()]=!0,m.isKeyQueued(c.getKey())||m.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(g,p,d,i));e.updateCacheSize(b,i)},e}(rs),ZA={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var JA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$A={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},tf={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]},ef=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return JA(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return i!==ya.LOADED&&i!==ya.ERROR||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,s=i.viewState,a=s.resolution,l=s.projection,u=this.getLayer(),h=u.getSource().getTile(e,r,n,o,l),c=i.viewHints,A=!(c[vs.ANIMATING]||c[vs.INTERACTING]);return!A&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,l)&&(A||Date.now()-i.time<8)&&u.getRenderMode()!==ZA.VECTOR&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===ZA.VECTOR?o(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!==r&&(this.renderedLayerRevision_=r,this.renderedTiles.length=0),t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var n=this.getLayer(),i=n.getRevision(),s=n.getRenderOrder()||null,a=t.wantedResolution,l=t.getReplayState(n);if(l.dirty||l.renderedResolution!==a||l.renderedRevision!=i||l.renderedRenderOrder!=s){var u=n.getSource(),h=n.getDeclutter(),c=u.getTileGrid(),A=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,r,t),p=o(n);delete t.hitDetectionImageData[p],t.executorGroups[p]=[],h&&(t.declutterExecutorGroups[p]=[]),l.dirty=!1;for(var d=function(r,i){var o=f[r];if(o.getState()!=ya.LOADED)return"continue";var d=o.tileCoord,y=c.getTileCoordExtent(d),m=Yt(A,y),v=Ct(m,n.getRenderBuffer()*a,g.tmpExtent),_=Nt(y,m)?null:v,w=new qo(0,v,a,e),b=h?new qo(0,m,a,e):void 0,x=Ks(a,e),E=function(t){var e,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(e=r(t,a)),e){var i=this.renderFeature(t,x,e,w,b);l.dirty=l.dirty||i}},C=o.getFeatures();s&&s!==l.renderedRenderOrder&&C.sort(s);for(var S=0,B=C.length;S<B;++S){var I=C[S];_&&!te(_,I.getGeometry().getExtent())||E.call(g,I)}var T=w.finish(),P=n.getRenderMode()!==ZA.VECTOR&&h&&1===f.length?null:m,F=new ms(P,a,e,u.getOverlaps(),T,n.getRenderBuffer());if(t.executorGroups[p].push(F),b){var L=new ms(null,a,e,u.getOverlaps(),b.finish(),n.getRenderBuffer());t.declutterExecutorGroups[p].push(L)}},g=this,y=0,m=f.length;y<m;++y)d(y);l.renderedRevision=i,l.renderedRenderOrder=s,l.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var s=e.viewState.resolution,a=e.viewState.rotation;r=null==r?0:r;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=Et([t]);Ct(h,s*r,h);for(var c,A={},f=function(t,e,r){var s=t.getId();void 0===s&&(s=o(t));var a=A[s];if(a){if(!0!==a&&r<a.distanceSq){if(0===r)return A[s]=!0,i.splice(i.lastIndexOf(a),1),n(t,l,e);a.geometry=e,a.distanceSq=r}}else{if(0===r)return A[s]=!0,n(t,l,e);i.push(A[s]={feature:t,layer:l,geometry:e,distanceSq:r,callback:n})}},p=this.renderedTiles,d=function(n,i){var A=p[n];if(!te(u.getTileCoordExtent(A.wrappedTileCoord),h))return"continue";var d=o(l),g=[A.executorGroups[d]],y=A.declutterExecutorGroups[d];y&&g.push(y),g.some((function(n){for(var i=n===y?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=n.length;o<l;++o){var u=n[o];if(c=u.forEachFeatureAtCoordinate(t,s,a,r,f,i))return!0}}))},g=0,y=p.length;!c&&g<y;++g)d(g);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var n,i=this.getLayer(),s=o(i),a=i.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=a.getTileGridForProjection(l),A=gt(this.renderedPixelToCoordinateTransform_,t.slice()),f=c.getTileCoordForCoordAndResolution(A,h),p=0,d=this.renderedTiles.length;p<d;++p)if(f.toString()===this.renderedTiles[p].tileCoord.toString()){if((n=this.renderedTiles[p]).getState()===ya.LOADED){var g=c.getTileCoordExtent(n.tileCoord);a.getWrapX()&&l.canWrapX()&&!Tt(u,g)&&Ve(A,l);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var y=Zt(c.getTileCoordExtent(n.wrappedTileCoord)),m=[(A[0]-y[0])/h,(y[1]-A[1])/h],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=n.hitDetectionImageData[s];if(!_&&!this.animatingOrInteracting_){var w=jn(c.getTileSize(c.getZForResolution(h,a.zDirection))),b=this.renderedRotation_;_=Gs(w,[this.getRenderTransform(c.getTileCoordCenter(n.wrappedTileCoord),h,0,Qs,w[0]*Qs,w[1]*Qs,0)],v,i.getStyleFunction(),c.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,b),n.hitDetectionImageData[s]=_}e(js(m,v,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,i=!(n[vs.ANIMATING]||n[vs.INTERACTING]),s=this.renderedTiles,a=0,l=s.length;a<l;++a){var u=s[a],h=u.declutterExecutorGroups[o(this.getLayer())];if(h)for(var c=h.length-1;c>=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,s=n.rotation,a=e.size,l=Math.round(a[0]*r),u=Math.round(a[1]*r),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,A=h.getTileCoordExtent(t.wrappedTileCoord),f=h.getTileCoordExtent(c,this.tmpExtent)[0]-A[0];return pt(mt(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,s,r,l,u,f))},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[vs.ANIMATING]||n[vs.INTERACTING]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=s.getOpacity();for(var h=tf[a],c=e.viewState,A=c.rotation,f=s.getSource(),p=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),d=this.renderedTiles,g=[],y=[],m=!0,v=d.length-1;v>=0;--v){var _=d[v];m=m&&!_.getReplayState(s).dirty;var w=_.executorGroups[o(s)].filter((function(t){return t.hasExecutors(h)}));if(0!==w.length){var b=this.getTileRenderTransform(_,e),x=_.tileCoord[0],E=!1,C=w[0].getClipCoords(b);if(C){for(var S=0,B=g.length;S<B;++S)if(p!==x&&x<y[S]){var I=g[S];te([C[0],C[3],C[4],C[7]],[I[0],I[3],I[4],I[7]])&&(E||(l.save(),E=!0),l.beginPath(),l.moveTo(C[0],C[1]),l.lineTo(C[2],C[3]),l.lineTo(C[4],C[5]),l.lineTo(C[6],C[7]),l.moveTo(I[6],I[7]),l.lineTo(I[4],I[5]),l.lineTo(I[2],I[3]),l.lineTo(I[0],I[1]),l.clip())}g.push(C),y.push(x)}for(var T=0,P=w.length;T<P;++T)w[T].execute(l,1,b,A,i,h);E&&l.restore()}}return l.globalAlpha=u,this.ready=m,this.container},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=0,a=r.length;s<a;++s)o=Ws(n,t,r[s],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Ws(n,t,r,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===ZA.VECTOR)return!1;var r=t.getReplayState(e),n=e.getRevision(),i=t.wantedResolution;return r.renderedTileResolution!==i||r.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),n=t.getReplayState(r),i=r.getRevision(),s=t.executorGroups[o(r)];n.renderedTileRevision=i;var a=t.wrappedTileCoord,l=a[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,A=u.getTileGridForProjection(c),f=A.getResolution(t.tileCoord[0]),p=e.pixelRatio/t.wantedResolution*f,d=A.getResolution(l),g=t.getContext(r);h=Math.round(Math.max(h,p/h));var y=u.getTilePixelSize(l,h,c);g.canvas.width=y[0],g.canvas.height=y[1];var m=h/p;if(1!==m){var v=ft(this.tmpTransform_);mt(v,m,m),g.setTransform.apply(g,v)}var _=A.getTileCoordExtent(a,this.tmpExtent),w=p/d,b=ft(this.tmpTransform_);mt(b,w,-w),vt(b,-_[0],-_[3]);for(var x=0,E=s.length;x<E;++x)s[x].execute(g,m,b,0,!0,$A[r.getRenderMode()]);n.renderedTileResolution=t.wantedResolution},e}(YA);const rf=ef,nf="preload",of="useInterimTilesOnError";var sf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const af=function(t){function e(e){var r=this,n=e||{},i=b({},n);delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,n.renderMode===ZA.IMAGE&&(n.renderMode=void 0);var o=n.renderMode||ZA.HYBRID;return K(o==ZA.HYBRID||o==ZA.VECTOR,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r.getBackground,r.setBackground,r}return sf(e,t),e.prototype.createRenderer=function(){return new rf(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(nf)},e.prototype.getUseInterimTilesOnError=function(){return this.get(of)},e.prototype.setPreload=function(t){this.set(nf,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(of,t)},e}(xo);var lf=[0,0,0],uf=function(){function t(t){var e,r,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,K((e=this.resolutions_,r=function(t,e){return e-t}||f,e.every((function(t,n){if(0===n)return!0;var i=r(e[n-1],t);return!(i>0||0===i)}))),17),!t.origins)for(var i=0,o=this.resolutions_.length-1;i<o;++i)if(n){if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}else n=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,K(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Zt(s)),K(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,K(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:al,K(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var r=new Jh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var n=this.getTileRangeForExtentAndZ(s,e);r.minX=Math.max(n.minX,r.minX),r.maxX=Math.min(n.maxX,r.maxX),r.minY=Math.max(n.minY,r.minY),r.maxY=Math.min(n.maxY,r.maxY)}return r}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var s=n.minY,a=n.maxY;s<=a;++s)r([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,n);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Zh(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(s,a,r)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return Zh(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,r){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],i=t[1],o=t[2];if(e===n)return Zh(i,o,i,o,r);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-n),a=Math.floor(i*s),l=Math.floor(o*s);return e<n?Zh(a,a,l,l,r):Zh(a,Math.floor(s*(i+1))-1,l,Math.floor(s*(o+1))-1,r)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,r)},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=jn(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*o[0]*i,a=n[0]+(e.maxX+1)*o[0]*i;return Lt(s,n[1]+e.minY*o[1]*i,a,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=lf;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Zh(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=jn(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=jn(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,s=r[1]-(t[2]+1)*i[1]*n;return Lt(o,s,o+i[0]*n,s+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),s=r/this.getResolution(o),a=this.getOrigin(o),l=jn(this.getTileSize(o),this.tmpSize_),u=s*(t-a[0])/r/l[0],h=s*(a[1]-e)/r/l[1];return n?(u=me(u,5)-1,h=me(h,5)-1):(u=ye(u,5),h=ye(h,5)),Hh(o,u,h,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),s=this.getResolution(r),a=jn(this.getTileSize(r),this.tmpSize_),l=(t-o[0])/s/a[0],u=(o[1]-e)/s/a[1];return n?(l=me(l,5)-1,u=me(u,5)-1):(l=ye(l,5),u=ye(u,5)),Hh(r,l,u,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return ae(d(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return fn(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}();const hf=uf,cf="tileloadstart",Af="tileloadend",ff="tileloaderror";function pf(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,r,n){return function(t,e,r,n){var i=gf(t,void 0,r);return new hf({extent:t,origin:Kt(t,"top-left"),resolutions:i,tileSize:r})}(yf(t),0,void 0)}(t),t.setDefaultTileGrid(e)),e}function df(t){var e=t||{},r=e.extent||ir("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:gf(r,e.maxZoom,e.tileSize,e.maxResolution)};return new hf(n)}function gf(t,e,r,n){for(var i=void 0!==e?e:sl,o=Xt(t),s=$t(t),a=jn(void 0!==r?r:al),l=n>0?n:Math.max(s/a[0],o/a[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function yf(t){var e=(t=ir(t)).getExtent();if(!e){var r=180*tt[et.DEGREES]/t.getMetersPerUnit();e=Lt(-r,-r,r,r)}return e}var mf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vf=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;return r.on,r.once,r.un,r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null,r.tileGrid&&jn(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),[256,256]),r.tileCache=new Xh(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition,interpolate:e.interpolate},r.zDirection=e.zDirection?e.zDirection:0,r}return mf(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)s=zh(e,u,h),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===ya.LOADED)&&(a=!1!==n(o)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,r,i,o){return n()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:pf(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return K(null===e||Ar(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=jn(n.getTileSize(t),this.tmpSize);return 1==i?o:Gn(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=yf(r);if(It(o,i))return e;var s=$t(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,e,r,n){},e}(oa),_f=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return mf(e,t),e}(h);const wf=vf;function bf(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(r,s[0].toString()).replace(n,s[1].toString()).replace(i,s[2].toString()).replace(o,(function(){var t=s[0],r=e.getFullTileRange(t);return K(r,55),(r.getHeight()-s[2]-1).toString()})):void 0}}function xf(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=fe(qh(e),t.length);return t[i](e,r,n)}}}function Ef(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(r[2],10),a=parseInt(r[1],10);a<=s;a++)e.push(t.replace(r[0],a.toString()));return e}return e.push(t),e}var Cf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sf=function(t){function e(r){var n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,interpolate:r.interpolate,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(n.tileUrlFunction=r.tileUrlFunction),n.urls=null,r.urls?n.setUrls(r.urls):r.url&&n.setUrl(r.url),n.tileLoadingKeys_={},n}return Cf(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=o(r),i=r.getState();i==ya.LOADING?(this.tileLoadingKeys_[n]=!0,e=cf):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=i==ya.ERROR?ff:i==ya.LOADED?Af:void 0),null!=e&&this.dispatchEvent(new _f(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=Ef(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=bf(t[i],e);return xf(n)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var n=zh(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(wf);const Bf=Sf;var If=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tf=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||yf(n),o=e.tileGrid||df({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ff,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.sourceTileCache=new Xh(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:ic,r.tileGrids_={},r}return If(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=Kh(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===ya.LOADED)for(var o=r.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],u=l.tileCoord;if(te(t,i.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,A=h.length;c<A;++c){var f=h[c],p=f.getGeometry();te(t,p.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){var n=this.getTileCacheForProjection(e),i=Object.keys(r).reduce((function(t,e){var r,i,o=zh((i=(r=e).substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number))[0],i[1],i[2]),s=n.peek(o);if(s)for(var a=s.sourceTiles,l=0,u=a.length;l<u;++l)t[a[l].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,r){var n=this;if(r.getState()===ya.IDLE){r.setState(ya.LOADING);var i=r.wrappedTileCoord,o=this.getTileGridForProjection(e),s=o.getTileCoordExtent(i),a=i[0],l=o.getResolution(a);Ct(s,-l,s);var u=this.tileGrid,h=u.getExtent();h&&Yt(s,h,s);var c=u.getZForResolution(l,this.zDirection);u.forEachTileCoord(s,c,(function(i){var o=n.tileUrlFunction(i,t,e),s=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(i,o?ya.IDLE:ya.EMPTY,o,n.format_,n.tileLoadFunction);r.sourceTiles.push(s);var a=s.getState();if(a<ya.LOADED){var l=function(t){n.handleTileChange(t);var e=s.getState();if(e===ya.LOADED||e===ya.ERROR){var i=s.getKey();i in r.errorTileKeys?s.getState()===ya.LOADED&&delete r.errorTileKeys[i]:r.loadingSourceTiles--,e===ya.ERROR?r.errorTileKeys[i]=!0:s.removeEventListener(T.CHANGE,l),0===r.loadingSourceTiles&&r.setState(C(r.errorTileKeys)?ya.LOADED:ya.ERROR)}};s.addEventListener(T.CHANGE,l),r.loadingSourceTiles++}a===ya.IDLE&&(s.extent=u.getTileCoordExtent(i),s.projection=e,s.resolution=u.getResolution(i[0]),n.sourceTileCache.set(o,s),s.load())})),r.loadingSourceTiles||r.setState(r.sourceTiles.some((function(t){return t.getState()===ya.ERROR}))?ya.ERROR:ya.LOADED)}return r.sourceTiles},e.prototype.getTile=function(t,e,r,n,i){var o,s=zh(t,e,r),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(u&&h){var A=c.getTileCoordExtent(u);Ct(A,-c.getResolution(t),A),te(h,A)||(u=null)}var f=!0;if(null!==u){var p=this.tileGrid,d=c.getResolution(t),g=p.getZForResolution(d,1),y=c.getTileCoordExtent(u);Ct(y,-d,y),p.forEachTileCoord(y,g,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var m=new rc(l,f?ya.EMPTY:ya.IDLE,u,this.getSourceTiles.bind(this,n,i));return m.key=a,o?(m.interimTile=o,m.refreshInterimChain(),this.tileCache.replace(s,m)):this.tileCache.set(s,m),m},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){for(var n=this.tileGrid,i=n.getResolutions().slice(),o=i.map((function(t,e){return n.getOrigin(e)})),s=i.map((function(t,e){return n.getTileSize(e)})),a=sl+1,l=i.length;l<a;++l)i.push(i[l-1]/2),o.push(o[l-1]),s.push(s[l-1]);r=new hf({extent:n.getExtent(),origins:o,resolutions:i,tileSizes:s}),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=jn(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(Bf);const Pf=Tf;function Ff(t,e){t.setLoader((function(r,n,i){ua(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Lf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Mf(t){return"string"==typeof t?JSON.parse(t)||null:null!==t?t:null}const Of=function(t){function e(){return t.call(this)||this}return Lf(e,t),e.prototype.getType=function(){return"json"},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Mf(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Mf(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return n()},e.prototype.readFeaturesFromObject=function(t,e){return n()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Mf(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return n()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(Mf(t))},e.prototype.readProjectionFromObject=function(t){return n()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return n()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return n()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return n()},e}(Jc);var kf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nf=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=ir(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=ir(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return kf(e,t),e.prototype.readFeatureFromObject=function(t,e){var r,n=Rf((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new X;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return Rf(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=ir(r.properties.name):"EPSG"===r.type?e=ir("EPSG:"+r.properties.code):K(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(r.id=n),!t.hasProperties())return r;var i=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=Uf(o,e),delete i[t.getGeometryName()]),C(i)||(r.properties=i),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return Uf(t,this.adaptOptions(e))},e}(Of);function Rf(t,e){if(!t)return null;var r;switch(t.type){case"Point":r=function(t){return new on(t.coordinates)}(t);break;case"LineString":r=function(t){return new Nn(t.coordinates)}(t);break;case"Polygon":r=function(t){return new xn(t.coordinates)}(t);break;case"MultiPoint":r=function(t){return new nh(t.coordinates)}(t);break;case"MultiLineString":r=function(t){return new th(t.coordinates)}(t);break;case"MultiPolygon":r=function(t){return new ah(t.coordinates)}(t);break;case"GeometryCollection":r=function(t,e){var r=t.geometries.map((function(t){return Rf(t,void 0)}));return new SA(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return $c(r,!1,e)}function Uf(t,e){var r,n=(t=$c(t,!0,e)).getType();switch(n){case"Point":r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case"LineString":r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case"Polygon":r=function(t,e){var r;return e&&(r=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case"MultiPoint":r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case"MultiLineString":r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case"MultiPolygon":r=function(t,e){var r;return e&&(r=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case"GeometryCollection":r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=b({},e);return delete r.featureProjection,Uf(t,r)}))}}(t,e);break;case"Circle":r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}const Df=Nf;var Qf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gf=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:jf,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:Sa,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Qf(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Ar(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Ar(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Ar(e,t)){var r=o(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=pf(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Ar(e,t))return this.tileCache;var r=o(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Xh(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var s=[t,e,r],a=this.getTileCoordForTileUrlFunction(s,i),l=a?this.tileUrlFunction(a,n,i):void 0,u=new this.tileClass(s,void 0!==l?ya.IDLE:ya.EMPTY,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(T.CHANGE,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Ar(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,r],l=void 0,u=Vh(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),A=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(a,i),p=new WA(o,c,i,A,a,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return p.key=h,l?(p.interimTile=l,p.refreshInterimChain(),s.replace(u,p)):s.set(u,p),p}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,s=zh(t,e,r),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,r,n,i,a),l.getState()==ya.IDLE?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,r,n,i,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=ir(t);if(r){var n=o(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Bf);function jf(t,e){t.getImage().src=e}const Hf=Gf;var zf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Vf=function(t){function e(e){var r=this,n=e||{},i=b({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,r.setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return zf(e,t),e.prototype.getPreload=function(){return this.get(nf)},e.prototype.setPreload=function(t){this.set(nf,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(of)},e.prototype.setUseInterimTilesOnError=function(t){this.set(of,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(to);var Kf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const qf=function(t){function e(e){return t.call(this,e)||this}return Kf(e,t),e.prototype.createRenderer=function(){return new YA(this)},e}(Vf);var Wf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Xf=function(t){function e(e){var r=t.call(this,e)||this;return r.vectorRenderer_=new Js(e),r.layerImageRatio_=e.getImageRatio(),r.coordinateToVectorPixelTransform_=[1,0,0,1,0,0],r.renderedPixelToCoordinateTransform_=null,r}return Wf(e,t),e.prototype.disposeInternal=function(){this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getFeatures=function(t){if(!this.vectorRenderer_)return new Promise((function(t){return t([])}));var e=gt(this.coordinateToVectorPixelTransform_,gt(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)},e.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},e.prototype.prepareFrame=function(t){var e=t.pixelRatio,r=t.viewState,n=r.resolution,i=t.viewHints,o=this.vectorRenderer_,s=t.extent;1!==this.layerImageRatio_&&re(s=s.slice(0),this.layerImageRatio_);var a=$t(s)/n,l=Xt(s)/n;if(!i[vs.ANIMATING]&&!i[vs.INTERACTING]&&!ee(s)){o.useContainer(null,null);var u=o.context,h=t.layerStatesArray[t.layerIndex];u.globalAlpha=h.opacity;var c=b({},h,{opacity:1}),A=b({},t,{declutterTree:new oo(9),extent:s,size:[a,l],viewState:b({},t.viewState,{rotation:0}),layerStatesArray:[c],layerIndex:0}),f=!0,p=new ga(s,n,e,u.canvas,(function(t){o.prepareFrame(A)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(A,null)&&(o.renderDeclutter(A),f=!1),t())}));p.addEventListener(T.CHANGE,function(){if(p.getState()===Un.LOADED){this.image_=f?null:p;var t=p.getResolution(),n=p.getPixelRatio(),i=t*e/n;this.renderedResolution=i,this.coordinateToVectorPixelTransform_=_t(this.coordinateToVectorPixelTransform_,a/2,l/2,1/i,-1/i,0,-r.center[0],-r.center[1])}}.bind(this)),p.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_},e.prototype.preRender=function(){},e.prototype.postRender=function(){},e.prototype.renderDeclutter=function(){},e.prototype.forEachFeatureAtCoordinate=function(e,r,n,i,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,r,n,i,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,r,n,i,o)},e}(Xc);var Yf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Zf=function(t){function e(e){var r=this,n=e||{},i=b({},n);return delete i.imageRatio,(r=t.call(this,i)||this).imageRatio_=void 0!==n.imageRatio?n.imageRatio:1,r}return Yf(e,t),e.prototype.getImageRatio=function(){return this.imageRatio_},e.prototype.createRenderer=function(){return new Xf(this)},e}(xo);var Jf=function(){function t(t,e){this.name=t,this.data=e,this.texture_=null}return t.prototype.getTexture=function(t){if(!this.texture_){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_},t}();const $f=Jf;var tp=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ep=function(t){function e(e){var r=this,n=ya.IDLE;return(r=t.call(this,e.tileCoord,n,{transition:e.transition,interpolate:e.interpolate})||this).loader_=e.loader,r.data_=null,r.error_=null,r.size_=e.size||[256,256],r}return tp(e,t),e.prototype.getSize=function(){return this.size_},e.prototype.getData=function(){return this.data_},e.prototype.getError=function(){return this.error_},e.prototype.load=function(){if(this.state===ya.IDLE||this.state===ya.ERROR){this.state=ya.LOADING,this.changed();var t=this;this.loader_().then((function(e){t.data_=e,t.state=ya.LOADED,t.changed()})).catch((function(e){t.error_=e,t.state=ya.ERROR,t.changed()}))}},e}(Ea);const rp=ep;var np=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ip(t,e,r){var n=r?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function op(t,e,r,n,i,o){var s,a,l=t.getGL();r instanceof Float32Array?(s=l.FLOAT,t.getExtension("OES_texture_float"),a=null!==t.getExtension("OES_texture_float_linear")):(s=l.UNSIGNED_BYTE,a=!0),ip(l,e,o&&a);var u,h=r.byteLength/n[1],c=1;switch(h%8==0?c=8:h%4==0?c=4:h%2==0&&(c=2),i){case 1:u=l.LUMINANCE;break;case 2:u=l.LUMINANCE_ALPHA;break;case 3:u=l.RGB;break;case 4:u=l.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(i))}var A=l.getParameter(l.UNPACK_ALIGNMENT);l.pixelStorei(l.UNPACK_ALIGNMENT,c),l.texImage2D(l.TEXTURE_2D,0,u,n[0],n[1],0,u,s,r),l.pixelStorei(l.UNPACK_ALIGNMENT,A)}var sp=null,ap=function(t){function e(e){var r=t.call(this)||this;r.tile,r.textures=[],r.handleTileChange_=r.handleTileChange_.bind(r),r.renderSize_=jn(e.grid.getTileSize(e.tile.tileCoord[0])),r.gutter_=e.gutter||0,r.bandCount=NaN,r.helper_=e.helper;var n=new pc(oc,ac);return n.fromArray([0,1,1,1,1,0,0,0]),r.helper_.flushBufferData(n),r.coords=n,r.setTile(e.tile),r}return np(e,t),e.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(T.CHANGE,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===ya.LOADED,this.loaded)this.uploadTile_();else{if(t instanceof Sa){var e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(T.CHANGE,this.handleTileChange_)}},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof Sa||r instanceof WA){var n=e.createTexture();return this.textures.push(n),this.bandCount=4,void function(t,e,r,n){ip(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,n,r.getImage(),r.interpolate)}var i=r.getSize(),o=[i[0]+2*this.gutter_,i[1]+2*this.gutter_],s=r.getData(),a=s instanceof Float32Array,l=o[0]*o[1],u=a?Float32Array:Uint8Array,h=u.BYTES_PER_ELEMENT,c=s.byteLength/o[1];this.bandCount=Math.floor(c/h/o[0]);var A=Math.ceil(this.bandCount/4);if(1===A)return n=e.createTexture(),this.textures.push(n),void op(t,n,s,o,this.bandCount,r.interpolate);for(var f=new Array(A),p=0;p<A;++p){n=e.createTexture(),this.textures.push(n);var d=p<A-1?4:this.bandCount%4;f[p]=new u(l*d)}for(var g=0,y=0,m=o[0]*this.bandCount,v=0;v<o[1];++v){for(var _=0;_<m;++_){var w=s[y+_],b=Math.floor(g/this.bandCount),x=_%this.bandCount;(E=f[p=Math.floor(x/4)])[b*(d=E.length/l)+x%4]=w,++g}y+=c/h}for(p=0;p<A;++p){var E;op(t,n=this.textures[p],E=f[p],o,d=E.length/l,r.interpolate)}},e.prototype.handleTileChange_=function(){this.tile.getState()===ya.LOADED&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(T.CHANGE))},e.prototype.disposeInternal=function(){var t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(var e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(T.CHANGE,this.handleTileChange_)},e.prototype.getPixelData=function(t,e){if(!this.loaded)return null;var r,n=this.renderSize_[0],i=this.renderSize_[1],o=this.gutter_;if(this.tile instanceof rp){var s=this.tile.getSize(),a=s[0],l=s[1],u=a+2*o,h=l+2*o,c=o+Math.floor(a*(t/n)),A=o+Math.floor(l*(e/i)),f=this.tile.getData();if(f instanceof DataView){var p=f.byteLength/(u*h),d=p*(A*u+c),g=f.buffer.slice(d,d+p);return new DataView(g)}var y=this.bandCount*(A*u+c);return f.slice(y,y+this.bandCount)}sp||((r=document.createElement("canvas")).width=1,r.height=1,sp=r.getContext("2d")),sp.clearRect(0,0,1,1);var m,v=this.tile.getImage(),_=v.width-2*o,w=v.height-2*o,b=o+Math.floor(_*(t/n)),x=o+Math.floor(w*(e/i));try{sp.drawImage(v,b,x,1,1,0,0,1,1),m=sp.getImageData(0,0,1,1).data}catch(E){return sp=null,null}return m},e}(I);const lp=ap;var up=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hp={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},cp={TEXTURE_COORD:"a_textureCoord"},Ap=[{name:cp.TEXTURE_COORD,size:2,type:bc.FLOAT}],fp={};function pp(t){return 2*(1-1/(t+1))-1}function dp(t,e,r){r in t||(t[r]=[]),t[r].push(e)}function gp(t,e){var r=t.layerStatesArray[t.layerIndex];r.extent&&(e=Yt(e,Cr(r.extent,t.viewState.projection)));var n=r.layer.getRenderSource();if(!n.getWrapX()){var i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=Yt(e,i))}return e}function yp(t,e){return"".concat(t.getKey(),",").concat(Vh(e))}var mp=function(t){function e(e,r){var n=t.call(this,e,{uniforms:r.uniforms})||this;n.renderComplete=!1,n.tileTransform_=[1,0,0,1,0,0],n.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.tempTileRange_=new Jh(0,0,0,0),n.tempTileCoord_=Hh(0,0,0),n.tempSize_=[0,0],n.program_,n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.indices_=new pc(sc,ac),n.indices_.fromArray([0,1,3,1,2,3]);var i=void 0!==r.cacheSize?r.cacheSize:512;return n.tileTextureCache_=new jh(i),n.paletteTextures_=r.paletteTextures||[],n.frameState_=null,n}return up(e,t),e.prototype.reset=function(e){t.prototype.reset.call(this,{uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))},e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)},e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ya.LOADED||r==ya.EMPTY||r==ya.ERROR&&!n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer().getRenderSource();return!!e&&!ee(gp(t,t.extent))&&"ready"===e.getState()},e.prototype.enqueueTiles=function(t,e,r,n){var i=t.viewState,s=this.getLayer(),a=s.getRenderSource(),l=a.getTileGridForProjection(i.projection),u=a.getGutterForProjection(i.projection),h=o(a);h in t.wantedTiles||(t.wantedTiles[h]={});for(var c=t.wantedTiles[h],A=this.tileTextureCache_,f=Math.max(r-s.getPreload(),l.getMinZoom(),s.getMinZoom()),p=r;p>=f;--p)for(var d=l.getTileRangeForExtentAndZ(e,p,this.tempTileRange_),g=l.getResolution(p),y=d.minX;y<=d.maxX;++y)for(var m=d.minY;m<=d.maxY;++m){var v=Hh(p,y,m,this.tempTileCoord_),_=yp(a,v),w=void 0,b=void 0;if(A.containsKey(_)&&(b=(w=A.get(_)).tile),!w||w.tile.key!==a.getKey())if(b=a.getTile(p,y,m,t.pixelRatio,i.projection),w)if(this.isDrawableTile_(b))w.setTile(b);else{var x=b.getInterimTile();w.setTile(x)}else w=new lp({tile:b,grid:l,helper:this.helper,gutter:u}),A.set(_,w);dp(n,w,p);var E=b.getKey();c[E]=!0,b.getState()===ya.IDLE&&(t.tileQueue.isKeyQueued(E)||t.tileQueue.enqueue([b,h,l.getTileCoordCenter(v),g]))}},e.prototype.renderFrame=function(t){this.frameState_=t,this.renderComplete=!0;var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,n=this.getLayer().getRenderSource(),i=n.getTileGridForProjection(r.projection),s=n.getGutterForProjection(r.projection),a=gp(t,t.extent),l=i.getZForResolution(r.resolution,n.zDirection),u={};if(t.nextExtent){var h=i.getZForResolution(r.nextResolution,n.zDirection),c=gp(t,t.nextExtent);this.enqueueTiles(t,c,h,u)}this.enqueueTiles(t,a,l,u);for(var A={},p=o(this),d=t.time,g=!1,y=u[l],m=0,v=y.length;m<v;++m){var _=(Q=(tt=y[m]).tile).tileCoord;if(tt.loaded){if(1===(G=Q.getAlpha(p,d))){Q.endTransition(p);continue}g=!0,A[j=Vh(_)]=G}if(this.renderComplete=!1,!this.findAltTiles_(i,_,l+1,u))for(var w=i.getMinZoom(),b=l-1;b>=w&&!this.findAltTiles_(i,_,b,u);--b);}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!g);for(var x=Object.keys(u).map(Number).sort(f),E=r.center[0],C=r.center[1],S=0,B=x.length;S<B;++S){var I=x[S],T=i.getResolution(I),P=jn(i.getTileSize(I),this.tempSize_),F=i.getOrigin(I),L=P[0]+2*s,M=P[1]+2*s,O=L/M,k=(E-F[0])/(P[0]*T),N=(F[1]-C)/(P[1]*T),R=r.resolution/T,U=pp(I),D=u[I];for(m=0,v=D.length;m<v;++m)if((tt=D[m]).loaded){var Q,G,j=Vh(_=(Q=tt.tile).tileCoord),H=_[1],z=_[2];ft(this.tileTransform_),mt(this.tileTransform_,2/(t.size[0]*R/L),-2/(t.size[1]*R/L)),yt(this.tileTransform_,r.rotation),mt(this.tileTransform_,1,1/O),vt(this.tileTransform_,(P[0]*(H-k)-s)/L,(P[1]*(z-N)-s)/M),this.helper.setUniformMatrixValue(hp.TILE_TRANSFORM,vc(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(tt.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(Ap);for(var V=0;V<tt.textures.length;){var K="TEXTURE"+V,q="".concat(hp.TILE_TEXTURE_ARRAY,"[").concat(V,"]");e.activeTexture(e[K]),e.bindTexture(e.TEXTURE_2D,tt.textures[V]),e.uniform1i(this.helper.getUniformLocation(q),V),++V}for(var W=0;W<this.paletteTextures_.length;++W){var X=this.paletteTextures_[W];e.activeTexture(e["TEXTURE"+V]);var Y=X.getTexture(e);e.bindTexture(e.TEXTURE_2D,Y),e.uniform1i(this.helper.getUniformLocation(X.name),V),++V}(G=j in A?A[j]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(hp.TRANSITION_ALPHA,G),this.helper.setUniformFloatValue(hp.DEPTH,U),this.helper.setUniformFloatValue(hp.TEXTURE_PIXEL_WIDTH,L),this.helper.setUniformFloatValue(hp.TEXTURE_PIXEL_HEIGHT,M),this.helper.setUniformFloatValue(hp.TEXTURE_RESOLUTION,T),this.helper.setUniformFloatValue(hp.TEXTURE_ORIGIN_X,F[0]+H*P[0]*T-s*T),this.helper.setUniformFloatValue(hp.TEXTURE_ORIGIN_Y,F[1]-z*P[1]*T+s*T);var Z=a;s>0&&Yt(Z=i.getTileCoordExtent(_),a,Z),this.helper.setUniformFloatVec4(hp.RENDER_EXTENT,Z),this.helper.setUniformFloatValue(hp.RESOLUTION,r.resolution),this.helper.setUniformFloatValue(hp.ZOOM,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var J=this.helper.getCanvas(),$=this.tileTextureCache_;$.canExpireCache();){var tt;(tt=$.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){n.expireCache(e.viewState.projection,fp)})),this.postRender(e,t),J},e.prototype.getData=function(t){if(!this.helper.getGL())return null;var e=this.frameState_;if(!e)return null;var r=this.getLayer(),n=gt(e.pixelToCoordinateTransform,t.slice()),i=e.viewState,o=r.getExtent();if(o&&!It(Cr(o,i.projection),n))return null;var s,a,l,u=r.getSources(Et([n]),i.resolution);for(s=u.length-1;s>=0;--s)if("ready"===(a=u[s]).getState()){if(l=a.getTileGridForProjection(i.projection),a.getWrapX())break;var h=l.getExtent();if(!h||It(h,n))break}if(s<0)return null;for(var c=this.tileTextureCache_,A=l.getZForResolution(i.resolution);A>=l.getMinZoom();--A){var f=l.getTileCoordForCoordAndZ(n,A),p=yp(a,f);if(c.containsKey(p)){var d=c.get(p);if(d.loaded){var g=l.getOrigin(A),y=jn(l.getTileSize(A)),m=l.getResolution(A),v=(n[0]-g[0])/m-f[1]*y[0],_=(g[1]-n[1])/m-f[2]*y[1];return d.getPixelData(v,_)}}}return null},e.prototype.findAltTiles_=function(t,e,r,n){var i=t.getTileRangeForTileCoordAndZ(e,r,this.tempTileRange_);if(!i)return!1;for(var o=!0,s=this.tileTextureCache_,a=this.getLayer().getRenderSource(),l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u){var h=yp(a,[r,l,u]),c=!1;if(s.containsKey(h)){var A=s.get(h);A.loaded&&(dp(n,A,r),c=!0)}c||(o=!1)}return o},e.prototype.removeHelper=function(){if(this.helper){var e=this.tileTextureCache_;e.forEach((function(t){return t.dispose()})),e.clear()}t.prototype.removeHelper.call(this)},e.prototype.disposeInternal=function(){var e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_)),t.prototype.disposeInternal.call(this),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_},e}(Lc);const vp=mp;var _p={NUMBER:1,STRING:2,COLOR:4,BOOLEAN:8,NUMBER_ARRAY:16,ANY:31,NONE:0},wp={};function bp(t){if("number"==typeof t)return _p.NUMBER;if("boolean"==typeof t)return _p.BOOLEAN;if("string"==typeof t)return e=t,Vn.test(e)&&(e=qn(e)),zn.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?_p.COLOR|_p.STRING:_p.STRING;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var r=t;if(r.every((function(t){return"number"==typeof t})))return 3===r.length||4===r.length?_p.COLOR|_p.NUMBER_ARRAY:_p.NUMBER_ARRAY;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(r)));var n=wp[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(r)));return n.getReturnType(r.slice(1))}function xp(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Ep(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(xp).join(", "),")")}function Cp(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Sp(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=wp[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(e)));return n.toGlsl(t,e.slice(1),r)}var i,o=bp(e);if((o&_p.NUMBER)>0)return xp(e);if((o&_p.BOOLEAN)>0)return e.toString();if((o&_p.STRING)>0&&(void 0===r||r==_p.STRING))return function(t,e){return xp(Cp(t,e))}(t,e.toString());if((o&_p.COLOR)>0&&(void 0===r||r==_p.COLOR))return(i=Zn(e).slice()).length<4&&i.push(1),Ep(i.map((function(t,e){return e<3?t/255:t})));if((o&_p.NUMBER_ARRAY)>0)return Ep(e);throw new Error("Unexpected expression ".concat(e," (expected type ").concat(r,")"))}function Bp(t){if(!(bp(t)&_p.NUMBER))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ip(t){for(var e=0;e<t.length;e++)Bp(t[e])}function Tp(t){if(!(bp(t)&_p.STRING))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function Pp(t){if(!(bp(t)&_p.BOOLEAN))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function Fp(t,e){if(t.length!==e)throw new Error("Exactly ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Lp(t,e){if(t.length<e)throw new Error("At least ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Mp(t,e){if(t.length>e)throw new Error("At most ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Op(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function kp(t,e){if(ue(e)%1!=0)throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function Np(t){return"u_var_"+t}wp.get={getReturnType:function(t){return _p.ANY},toGlsl:function(t,e){Fp(e,1),Tp(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},wp.var={getReturnType:function(t){return _p.ANY},toGlsl:function(t,e){Fp(e,1),Tp(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),Np(r)}};var Rp="u_paletteTextures";wp.palette={getReturnType:function(t){return _p.COLOR},toGlsl:function(t,e){Fp(e,2),Bp(e[0]);var r=Sp(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");for(var i=n.length,o=new Uint8Array(4*i),s=0;s<i;s++){var a=n[s],l=void 0;if("string"==typeof a)l=Yn(a);else{if(!Array.isArray(a))throw new Error("The second argument of palette must be an array of strings or colors");var u=a.length;if(4===u)l=a;else{if(3!==u)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(u));l=[a[0],a[1],a[2],1]}}var h=4*s;o[h]=l[0],o[h+1]=l[1],o[h+2]=l[2],o[h+3]=255*l[3]}t.paletteTextures||(t.paletteTextures=[]);var c="".concat(Rp,"[").concat(t.paletteTextures.length,"]"),A=new $f(c,o);return t.paletteTextures.push(A),"texture2D(".concat(c,", vec2((").concat(r," + 0.5) / ").concat(i,".0, 0.5))")}};var Up="getBandValue";function Dp(t){return{getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(e,r){Fp(r,2);for(var n=_p.ANY,i=0;i<r.length;i++)n&=bp(r[i]);if(n===_p.NONE)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(r)," instead"));return n&=~_p.COLOR,"(".concat(Sp(e,r[0],n)," ").concat(t," ").concat(Sp(e,r[1],n),")")}}}function Qp(t){return{getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(e,r){Lp(r,2);for(var n=0;n<r.length;n++)Pp(r[n]);var i;return i=r.map((function(t){return Sp(e,t)})).join(" ".concat(t," ")),"(".concat(i,")")}}}wp.band={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){Lp(e,1),Mp(e,3);var r=e[0];if(!(Up in t.functions)){for(var n="",i=t.bandCount||1,o=0;o<i;o++){var s=Math.floor(o/4),a=o%4;a===i-1&&1===a&&(a=3);var l="".concat(hp.TILE_TEXTURE_ARRAY,"[").concat(s,"]");n+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(l,", v_textureCoord + vec2(dx, dy))[").concat(a,"];\n }\n ")}t.functions[Up]="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(hp.TEXTURE_PIXEL_WIDTH,";\n float dy = yOffset / ").concat(hp.TEXTURE_PIXEL_HEIGHT,";\n ").concat(n,"\n }\n ")}var u=Sp(t,r),h=Sp(t,e[1]||0),c=Sp(t,e[2]||0);return"".concat(Up,"(").concat(u,", ").concat(h,", ").concat(c,")")}},wp.time={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,0),"u_time"}},wp.zoom={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,0),"u_zoom"}},wp.resolution={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,0),"u_resolution"}},wp["*"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," * ").concat(Sp(t,e[1]),")")}},wp["/"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," / ").concat(Sp(t,e[1]),")")}},wp["+"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," + ").concat(Sp(t,e[1]),")")}},wp["-"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," - ").concat(Sp(t,e[1]),")")}},wp.clamp={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){Fp(e,3),Ip(e);var r=Sp(t,e[1]),n=Sp(t,e[2]);return"clamp(".concat(Sp(t,e[0]),", ").concat(r,", ").concat(n,")")}},wp["%"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"mod(".concat(Sp(t,e[0]),", ").concat(Sp(t,e[1]),")")}},wp["^"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"pow(".concat(Sp(t,e[0]),", ").concat(Sp(t,e[1]),")")}},wp.abs={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"abs(".concat(Sp(t,e[0]),")")}},wp.floor={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"floor(".concat(Sp(t,e[0]),")")}},wp.round={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"floor(".concat(Sp(t,e[0])," + 0.5)")}},wp.ceil={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"ceil(".concat(Sp(t,e[0]),")")}},wp.sin={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"sin(".concat(Sp(t,e[0]),")")}},wp.cos={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"cos(".concat(Sp(t,e[0]),")")}},wp.atan={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Lp(e,1),Mp(e,2),Ip(e),2===e.length?"atan(".concat(Sp(t,e[0]),", ").concat(Sp(t,e[1]),")"):"atan(".concat(Sp(t,e[0]),")")}},wp[">"]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," > ").concat(Sp(t,e[1]),")")}},wp[">="]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," >= ").concat(Sp(t,e[1]),")")}},wp["<"]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," < ").concat(Sp(t,e[1]),")")}},wp["<="]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," <= ").concat(Sp(t,e[1]),")")}},wp["=="]=Dp("=="),wp["!="]=Dp("!="),wp["!"]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,1),Pp(e[0]),"(!".concat(Sp(t,e[0]),")")}},wp.all=Qp("&&"),wp.any=Qp("||"),wp.between={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){Fp(e,3),Ip(e);var r=Sp(t,e[1]),n=Sp(t,e[2]),i=Sp(t,e[0]);return"(".concat(i," >= ").concat(r," && ").concat(i," <= ").concat(n,")")}},wp.array={getReturnType:function(t){return _p.NUMBER_ARRAY},toGlsl:function(t,e){Lp(e,2),Mp(e,4),Ip(e);var r=e.map((function(e){return Sp(t,e,_p.NUMBER)}));return"vec".concat(e.length,"(").concat(r.join(", "),")")}},wp.color={getReturnType:function(t){return _p.COLOR},toGlsl:function(t,e){Lp(e,3),Mp(e,4),Ip(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Sp(t,e,_p.NUMBER)+(r<3?" / 255.0":"")}));return"vec".concat(e.length,"(").concat(n.join(", "),")")}},wp.interpolate={getReturnType:function(t){for(var e=_p.COLOR|_p.NUMBER,r=3;r<t.length;r+=2)e&=bp(t[r]);return e},toGlsl:function(t,e,r){Op(e),Lp(e,6);var n,i=e[0];switch(i[0]){case"linear":n=1;break;case"exponential":n=i[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(i)));var o=void 0!==r?r:_p.ANY,s=wp.interpolate.getReturnType(e)&o;kp(e,s);for(var a=Sp(t,e[1]),l=xp(n),u="",h=2;h<e.length-2;h+=2){var c=Sp(t,e[h]),A=u||Sp(t,e[h+1],s),f=Sp(t,e[h+2]),p=Sp(t,e[h+3],s);u="mix(".concat(A,", ").concat(p,", pow(clamp((").concat(a," - ").concat(c,") / (").concat(f," - ").concat(c,"), 0.0, 1.0), ").concat(l,"))")}return u}},wp.match={getReturnType:function(t){for(var e=_p.ANY,r=2;r<t.length;r+=2)e&=bp(t[r]);return e&bp(t[t.length-1])},toGlsl:function(t,e,r){Op(e),Lp(e,4);var n=void 0!==r?r:_p.ANY,i=wp.match.getReturnType(e)&n;kp(e,i);for(var o=Sp(t,e[0]),s=Sp(t,e[e.length-1],i),a=null,l=e.length-3;l>=1;l-=2){var u=Sp(t,e[l]),h=Sp(t,e[l+1],i);a="(".concat(o," == ").concat(u," ? ").concat(h," : ").concat(a||s,")")}return a}},wp.case={getReturnType:function(t){for(var e=_p.ANY,r=1;r<t.length;r+=2)e&=bp(t[r]);return e&bp(t[t.length-1])},toGlsl:function(t,e,r){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(e),Lp(e,3);var n=void 0!==r?r:_p.ANY,i=wp.case.getReturnType(e)&n;kp(e,i);for(var o=0;o<e.length-1;o+=2)Pp(e[o]);var s=Sp(t,e[e.length-1],i),a=null;for(o=e.length-3;o>=0;o-=2){var l=Sp(t,e[o]),u=Sp(t,e[o+1],i);a="(".concat(l," ? ").concat(u," : ").concat(a||s,")")}return a}};var Gp=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,r){return this.varyings.push({name:t,type:e,expression:r}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",r=this.attributes,n=this.varyings;return t&&(r=r.concat("vec4 a_hitColor"),n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(r.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(e,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(n.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",r=this.varyings;return t&&(r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(e,"\n}")},t}(),jp=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Hp=function(t){function e(e){var r=this,n=b({},e);return(r=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,r=void 0!==e.size?e.size:1,n=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],s=void 0!==e.opacity?e.opacity:1,a=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=Sp(l,r,_p.NUMBER_ARRAY|_p.NUMBER),h=Sp(l,o,_p.NUMBER_ARRAY),c=Sp(l,i,_p.NUMBER_ARRAY),A=Sp(l,a,_p.NUMBER),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},p=Sp(f,n,_p.COLOR),d=Sp(f,s,_p.NUMBER),g="1.0",y="vec2(".concat(Sp(f,r,_p.NUMBER_ARRAY|_p.NUMBER),").x");switch(e.symbolType){case"square":case"image":break;case"circle":g="(1.0-smoothstep(1.-4./".concat(y,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var m="(v_quadCoord*2.-1.)",v="(atan(".concat(m,".x,").concat(m,".y))");g="(1.0-smoothstep(.5-3./".concat(y,",.5,cos(floor(.5+").concat(v,"/2.094395102)*2.094395102-").concat(v,")*length(").concat(m,")))");break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var _=(new Gp).setSizeExpression("vec2(".concat(u,")")).setRotationExpression(A).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4(".concat(p,".rgb, ").concat(p,".a * ").concat(d," * ").concat(g,")"));if(t.filter){var w=Sp(f,t.filter,_p.BOOLEAN);_.setFragmentDiscardExpression("!".concat(w))}var b={};if(f.variables.forEach((function(e){var r=Np(e);_.addUniform("float ".concat(r)),b[r]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: ".concat(e));var r=t.variables[e];return"string"==typeof r&&(r=Cp(l,r)),void 0!==r?r:-9999999}})),"image"===e.symbolType&&e.src){var x=new Image;x.crossOrigin=void 0===e.crossOrigin?"anonymous":e.crossOrigin,x.src=e.src,_.addUniform("sampler2D u_texture").setColorExpression(_.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),b.u_texture=x}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),_.addVarying("v_".concat(t),"float","a_".concat(t))})),l.attributes.forEach((function(t){_.addAttribute("float a_".concat(t))})),{builder:_,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,r){var n=r[t];return"string"==typeof n&&(n=Cp(l,n)),void 0!==n?n:-9999999}}})),uniforms:b}}(e.style),r.styleVariables_=e.style.variables||{},r.hitDetectionDisabled_=!!e.disableHitDetection,r}return jp(e,t),e.prototype.createRenderer=function(){return new Uc(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.updateStyleVariables=function(t){b(this.styleVariables_,t),this.changed()},e}(to);var zp=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Vp(t,e){var r="\n attribute vec2 ".concat(cp.TEXTURE_COORD,";\n uniform mat4 ").concat(hp.TILE_TRANSFORM,";\n uniform float ").concat(hp.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(hp.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(hp.TEXTURE_RESOLUTION,";\n uniform float ").concat(hp.TEXTURE_ORIGIN_X,";\n uniform float ").concat(hp.TEXTURE_ORIGIN_Y,";\n uniform float ").concat(hp.DEPTH,";\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ").concat(cp.TEXTURE_COORD,";\n v_mapCoord = vec2(\n ").concat(hp.TEXTURE_ORIGIN_X," + ").concat(hp.TEXTURE_RESOLUTION," * ").concat(hp.TEXTURE_PIXEL_WIDTH," * v_textureCoord[0],\n ").concat(hp.TEXTURE_ORIGIN_Y," - ").concat(hp.TEXTURE_RESOLUTION," * ").concat(hp.TEXTURE_PIXEL_HEIGHT," * v_textureCoord[1]\n );\n gl_Position = ").concat(hp.TILE_TRANSFORM," * vec4(").concat(cp.TEXTURE_COORD,", ").concat(hp.DEPTH,", 1.0);\n }\n "),n={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:e},i=[];if(void 0!==t.color){var o=Sp(n,t.color,_p.COLOR);i.push("color = ".concat(o,";"))}if(void 0!==t.contrast){var s=Sp(n,t.contrast,_p.NUMBER);i.push("color.rgb = clamp((".concat(s," + 1.0) * color.rgb - (").concat(s," / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.exposure){var a=Sp(n,t.exposure,_p.NUMBER);i.push("color.rgb = clamp((".concat(a," + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.saturation){var l=Sp(n,t.saturation,_p.NUMBER);i.push("\n float saturation = ".concat(l," + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n "))}if(void 0!==t.gamma){var u=Sp(n,t.gamma,_p.NUMBER);i.push("color.rgb = pow(color.rgb, vec3(1.0 / ".concat(u,"));"))}if(void 0!==t.brightness){var h=Sp(n,t.brightness,_p.NUMBER);i.push("color.rgb = clamp(color.rgb + ".concat(h,", vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}var c={},A=n.variables.length;if(A>1&&!t.variables)throw new Error("Missing variables in style (expected ".concat(n.variables,")"));for(var f=function(e){var r=n.variables[e];if(!(r in t.variables))throw new Error("Missing '".concat(r,"' in style variables"));var i=Np(r);c[i]=function(){var e=t.variables[r];return"string"==typeof e&&(e=Cp(n,e)),void 0!==e?e:-9999999}},p=0;p<A;++p)f(p);var d=Object.keys(c).map((function(t){return"uniform float ".concat(t,";")})),g=Math.ceil(e/4);d.push("uniform sampler2D ".concat(hp.TILE_TEXTURE_ARRAY,"[").concat(g,"];")),n.paletteTextures&&d.push("uniform sampler2D ".concat(Rp,"[").concat(n.paletteTextures.length,"];"));var y=Object.keys(n.functions).map((function(t){return n.functions[t]}));return{vertexShader:r,fragmentShader:"\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n uniform vec4 ".concat(hp.RENDER_EXTENT,";\n uniform float ").concat(hp.TRANSITION_ALPHA,";\n uniform float ").concat(hp.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(hp.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(hp.RESOLUTION,";\n uniform float ").concat(hp.ZOOM,";\n\n ").concat(d.join("\n"),"\n\n ").concat(y.join("\n"),"\n\n void main() {\n if (\n v_mapCoord[0] < ").concat(hp.RENDER_EXTENT,"[0] ||\n v_mapCoord[1] < ").concat(hp.RENDER_EXTENT,"[1] ||\n v_mapCoord[0] > ").concat(hp.RENDER_EXTENT,"[2] ||\n v_mapCoord[1] > ").concat(hp.RENDER_EXTENT,"[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(").concat(hp.TILE_TEXTURE_ARRAY,"[0], v_textureCoord);\n\n ").concat(i.join("\n"),"\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ").concat(hp.TRANSITION_ALPHA,";\n }"),uniforms:c,paletteTextures:n.paletteTextures}}var Kp=function(t){function e(e){var r=this,n=e?b({},e):{},i=n.style||{};delete n.style;var o=n.cacheSize;return delete n.cacheSize,(r=t.call(this,n)||this).sources_=n.sources,r.renderedSource_=null,r.renderedResolution_=NaN,r.style_=i,r.cacheSize_=o,r.styleVariables_=r.style_.variables||{},r.addChangeListener(Xi.SOURCE,r.handleSourceUpdate_),r}return zp(e,t),e.prototype.getSources=function(t,e){var r=this.getSource();return this.sources_?"function"==typeof this.sources_?this.sources_(t,e):this.sources_:r?[r]:[]},e.prototype.getRenderSource=function(){return this.renderedSource_||this.getSource()},e.prototype.getSourceState=function(){var t=this.getRenderSource();return t?t.getState():"undefined"},e.prototype.handleSourceUpdate_=function(){this.getSource()&&this.setStyle(this.style_)},e.prototype.getSourceBandCount_=function(){var t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4},e.prototype.createRenderer=function(){var t=Vp(this.style_,this.getSourceBandCount_());return new vp(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.cacheSize_,paletteTextures:t.paletteTextures})},e.prototype.renderSources=function(t,e){for(var r,n=this.getRenderer(),i=0,o=e.length;i<o;++i)this.renderedSource_=e[i],n.prepareFrame(t)&&(r=n.renderFrame(t));return r},e.prototype.render=function(t,e){var r=this;this.rendered=!0;for(var n=t.viewState,i=this.getSources(t.extent,n.resolution),o=!0,s=function(t,e){var n=i[t],s=n.getState();if("loading"==s){var a=function(){"ready"==n.getState()&&(n.removeEventListener("change",a),r.changed())};n.addEventListener("change",a)}o=o&&"ready"==s},a=0,l=i.length;a<l;++a)s(a);var u=this.renderSources(t,i);if(this.getRenderer().renderComplete&&o)return this.renderedResolution_=n.resolution,u;if(this.renderedResolution_>.5*n.resolution){var h=this.getSources(t.extent,this.renderedResolution_).filter((function(t){return!i.includes(t)}));if(h.length>0)return this.renderSources(t,h)}return u},e.prototype.setStyle=function(t){this.styleVariables_=t.variables||{},this.style_=t;var e=Vp(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,paletteTextures:e.paletteTextures}),this.changed()},e.prototype.updateStyleVariables=function(t){b(this.styleVariables_,t),this.changed()},e}(Vf);Kp.prototype.dispose;const qp=Kp;var Wp=1,Xp=2,Yp=3,Zp=4,Jp=5,$p=6378137,td=6356752.314,ed=.0066943799901413165,rd=484813681109536e-20,nd=Math.PI/2,id=.16666666666666666,od=.04722222222222222,sd=.022156084656084655,ad=1e-10,ld=.017453292519943295,ud=57.29577951308232,hd=Math.PI/4,cd=2*Math.PI,Ad=3.14159265359,fd={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const pd={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var dd=/[\s_\-\/\(\)]/g;function gd(t,e){if(t[e])return t[e];for(var r,n=Object.keys(t),i=e.toLowerCase().replace(dd,""),o=-1;++o<n.length;)if((r=n[o]).toLowerCase().replace(dd,"")===i)return t[r]}function yd(t){var e,r,n,i={},o=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var r=e.split("=");return r.push(!0),t[r[0].toLowerCase()]=r[1],t}),{}),s={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*ld},lat_1:function(t){i.lat1=t*ld},lat_2:function(t){i.lat2=t*ld},lat_ts:function(t){i.lat_ts=t*ld},lon_0:function(t){i.long0=t*ld},lon_1:function(t){i.long1=t*ld},lon_2:function(t){i.long2=t*ld},alpha:function(t){i.alpha=parseFloat(t)*ld},gamma:function(t){i.rectified_grid_angle=parseFloat(t)},lonc:function(t){i.longc=t*ld},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r_a:function(){i.R_A=!0},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=!0},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var e=gd(pd,t);e&&(i.to_meter=e.to_meter)},from_greenwich:function(t){i.from_greenwich=t*ld},pm:function(t){var e=gd(fd,t);i.from_greenwich=(e||parseFloat(t))*ld},nadgrids:function(t){"@null"===t?i.datumCode="none":i.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(i.axis=t)},approx:function(){i.approx=!0}};for(e in o)r=o[e],e in s?"function"==typeof(n=s[e])?n(r):i[n]=r:i[e]=r;return"string"==typeof i.datumCode&&"WGS84"!==i.datumCode&&(i.datumCode=i.datumCode.toLowerCase()),i}var md=1,vd=/\s/,_d=/[A-Za-z]/,wd=/[A-Za-z84_]/,bd=/[,\]]/,xd=/[\d\.E\-\+]/;function Ed(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=md}function Cd(t,e,r){Array.isArray(e)&&(r.unshift(e),e=null);var n=e?{}:t,i=r.reduce((function(t,e){return Sd(e,t),t}),n);e&&(t[e]=i)}function Sd(t,e){if(Array.isArray(t)){var r=t.shift();if("PARAMETER"===r&&(r=t.shift()),1===t.length)return Array.isArray(t[0])?(e[r]={},void Sd(t[0],e[r])):void(e[r]=t[0]);if(t.length)if("TOWGS84"!==r){if("AXIS"===r)return r in e||(e[r]=[]),void e[r].push(t);var n;switch(Array.isArray(r)||(e[r]={}),r){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[r]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&Sd(t[2],e[r]));case"SPHEROID":case"ELLIPSOID":return e[r]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&Sd(t[3],e[r]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void Cd(e,r,t);default:for(n=-1;++n<t.length;)if(!Array.isArray(t[n]))return Sd(t,e[r]);return Cd(e,r,t)}}else e[r]=t;else e[r]=!0}else e[t]=!0}Ed.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;vd.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case md:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Ed.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(bd.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Ed.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=md)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=md,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Ed.prototype.number=function(t){if(!xd.test(t)){if(bd.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Ed.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Ed.prototype.keyword=function(t){if(wd.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=md)}if(!bd.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Ed.prototype.neutral=function(t){if(_d.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(xd.test(t))return this.word=t,void(this.state=3);if(!bd.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Ed.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Bd,Id=.017453292519943295;function Td(t){return t*Id}function Pd(t){var e=new Ed(t).output(),r=e.shift(),n=e.shift();e.unshift(["name",n]),e.unshift(["type",r]);var i={};return Sd(e,i),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",r=0,n=t.AXIS.length;r<n;++r){var i=[t.AXIS[r][0].toLowerCase(),t.AXIS[r][1].toLowerCase()];-1!==i[0].indexOf("north")||("y"===i[0]||"lat"===i[0])&&"north"===i[1]?e+="n":-1!==i[0].indexOf("south")||("y"===i[0]||"lat"===i[0])&&"south"===i[1]?e+="s":-1!==i[0].indexOf("east")||("x"===i[0]||"lon"===i[0])&&"east"===i[1]?e+="e":-1===i[0].indexOf("west")&&("x"!==i[0]&&"lon"!==i[0]||"west"!==i[1])||(e+="w")}2===e.length&&(e+="u"),3===e.length&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function s(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Td],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Td],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",Td],["lat0","latitude_of_origin",Td],["lat0","standard_parallel_1",Td],["lat1","standard_parallel_1",Td],["lat2","standard_parallel_2",Td],["azimuth","Azimuth"],["alpha","azimuth",Td],["srsCode","name"]].forEach((function(e){return r=t,i=(n=e)[0],o=n[1],void(!(i in r)&&o in r&&(r[i]=r[o],3===n.length&&(r[i]=n[2](r[i]))));var r,n,i,o})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=Td(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i}function Fd(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?Fd[t]=yd(arguments[1]):Fd[t]=Pd(arguments[1]):Fd[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?Fd.apply(e,t):Fd(t)}));if("string"==typeof t){if(t in Fd)return Fd[t]}else"EPSG"in t?Fd["EPSG:"+t.EPSG]=t:"ESRI"in t?Fd["ESRI:"+t.ESRI]=t:"IAU2000"in t&&(Fd["IAU2000:"+t.IAU2000]=t);return}}(Bd=Fd)("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),Bd("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),Bd("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),Bd.WGS84=Bd["EPSG:4326"],Bd["EPSG:3785"]=Bd["EPSG:3857"],Bd.GOOGLE=Bd["EPSG:3857"],Bd["EPSG:900913"]=Bd["EPSG:3857"],Bd["EPSG:102113"]=Bd["EPSG:3857"];var Ld=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],Md=["3857","900913","3785","102113"];function Od(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}function kd(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}function Nd(t){return t<0?-1:1}function Rd(t){return Math.abs(t)<=Ad?t:t-Nd(t)*cd}function Ud(t,e,r){var n=t*r,i=.5*t;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(nd-e))/n}function Dd(t,e){for(var r,n,i=.5*t,o=nd-2*Math.atan(e),s=0;s<=15;s++)if(r=t*Math.sin(o),o+=n=nd-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999}function Qd(t){return t}var Gd=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=kd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,i=t.y;if(i*ud>90&&i*ud<-90&&n*ud>180&&n*ud<-180)return null;if(Math.abs(Math.abs(i)-nd)<=ad)return null;if(this.sphere)e=this.x0+this.a*this.k0*Rd(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(hd+.5*i));else{var o=Math.sin(i),s=Ud(this.e,i,o);e=this.x0+this.a*this.k0*Rd(n-this.long0),r=this.y0-this.a*this.k0*Math.log(s)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=nd-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=Dd(this.e,o)))return null}return e=Rd(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Qd,inverse:Qd,names:["longlat","identity"]}],jd={},Hd=[];function zd(t,e){var r=Hd.length;return!t.names||(Hd[r]=t,t.names.forEach((function(t){jd[t.toLowerCase()]=r})),this)}const Vd={start:function(){Gd.forEach(zd)},add:zd,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==jd[e]&&Hd[jd[e]]?Hd[jd[e]]:void 0}};var Kd={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},qd=Kd.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Kd.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Wd={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Xd={};function Yd(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Xd[t]||null,isNull:!1}}function Zd(t){return t/3600*Math.PI/180}function Jd(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function $d(t){return t.map((function(t){return[Zd(t.longitudeShift),Zd(t.latitudeShift)]}))}function tg(t,e,r){return{name:Jd(t,e+8,e+16).trim(),parent:Jd(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function eg(t,e,r,n){for(var i=e+176,o=[],s=0;s<r.gridNodeCount;s++){var a={latitudeShift:t.getFloat32(i+16*s,n),longitudeShift:t.getFloat32(i+16*s+4,n),latitudeAccuracy:t.getFloat32(i+16*s+8,n),longitudeAccuracy:t.getFloat32(i+16*s+12,n)};o.push(a)}return o}function rg(t,e){if(!(this instanceof rg))return new rg(t);e=e||function(t){if(t)throw t};var r=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in Fd}(t))return Fd[t];if(function(t){return Ld.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=Pd(t);if(function(t){var e=gd(t,"authority");if(e){var r=gd(e,"epsg");return r&&Md.indexOf(r)>-1}}(e))return Fd["EPSG:3857"];var r=function(t){var e=gd(t,"extension");if(e)return gd(e,"proj4")}(e);return r?yd(r):e}return function(t){return"+"===t[0]}(t)?yd(t):void 0}(t);if("object"==typeof r){var n=rg.projections.get(r.projName);if(n){if(r.datumCode&&"none"!==r.datumCode){var i=gd(Wd,r.datumCode);i&&(r.datum_params=r.datum_params||(i.towgs84?i.towgs84.split(","):null),r.ellps=i.ellipse,r.datumName=i.datumName?i.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o,s,a,l,u,h,c=function(t,e,r,n,i){if(!t){var o=gd(Kd,n);o||(o=qd),t=o.a,e=o.b,r=o.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)<ad)&&(i=!0,e=t),{a:t,b:e,rf:r,sphere:i}}(r.a,r.b,r.rf,r.ellps,r.sphere),A=(o=c.a,s=c.b,c.rf,u=((a=o*o)-(l=s*s))/a,h=0,r.R_A?(a=(o*=1-u*(id+u*(od+u*sd)))*o,u=0):h=Math.sqrt(u),{es:u,e:h,ep2:(a-l)/l}),f=function(t){return void 0===t?null:t.split(",").map(Yd)}(r.nadgrids),p=r.datum||function(t,e,r,n,i,o,s){var a={};return a.datum_type=void 0===t||"none"===t?Jp:Zp,e&&(a.datum_params=e.map(parseFloat),0===a.datum_params[0]&&0===a.datum_params[1]&&0===a.datum_params[2]||(a.datum_type=Wp),a.datum_params.length>3&&(0===a.datum_params[3]&&0===a.datum_params[4]&&0===a.datum_params[5]&&0===a.datum_params[6]||(a.datum_type=Xp,a.datum_params[3]*=rd,a.datum_params[4]*=rd,a.datum_params[5]*=rd,a.datum_params[6]=a.datum_params[6]/1e6+1))),s&&(a.datum_type=Yp,a.grids=s),a.a=r,a.b=n,a.es=i,a.ep2=o,a}(r.datumCode,r.datum_params,c.a,c.b,A.es,A.ep2,f);Od(this,r),Od(this,n),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=A.es,this.e=A.e,this.ep2=A.ep2,this.datum=p,this.init(),e(null,this)}else e(t)}else e(t)}function ng(t,e,r){var n,i,o,s,a=t.x,l=t.y,u=t.z?t.z:0;if(l<-nd&&l>-1.001*nd)l=-nd;else if(l>nd&&l<1.001*nd)l=nd;else{if(l<-nd)return{x:-1/0,y:-1/0,z:t.z};if(l>nd)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),i=Math.sin(l),s=Math.cos(l),o=i*i,{x:((n=r/Math.sqrt(1-e*o))+u)*s*Math.cos(a),y:(n+u)*s*Math.sin(a),z:(n*(1-e)+u)*i}}function ig(t,e,r,n){var i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v=t.x,_=t.y,w=t.z?t.z:0;if(i=Math.sqrt(v*v+_*_),o=Math.sqrt(v*v+_*_+w*w),i/r<1e-12){if(y=0,o/r<1e-12)return m=-n,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(_,v);s=w/o,c=(a=i/o)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),A=s*l,g=0;do{g++,u=e*(h=r/Math.sqrt(1-e*A*A))/(h+(m=i*c+w*A-h*(1-e*A*A))),d=(p=s*(l=1/Math.sqrt(1-u*(2-u)*a*a)))*c-(f=a*(1-u)*l)*A,c=f,A=p}while(d*d>1e-24&&g<30);return{x:y,y:Math.atan(p/Math.abs(f)),z:m}}function og(t){return t===Wp||t===Xp}function sg(t,e,r){if(null===t.grids||0===t.grids.length)return-1;for(var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[],s=0;s<t.grids.length;s++){var a=t.grids[s];if(o.push(a.name),a.isNull){i=n;break}if(a.mandatory,null!==a.grid){var l=a.grid.subgrids[0],u=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,h=l.ll[0]-u,c=l.ll[1]-u,A=l.ll[0]+(l.lim[0]-1)*l.del[0]+u,f=l.ll[1]+(l.lim[1]-1)*l.del[1]+u;if(!(c>n.y||h>n.x||f<n.y||A<n.x||(i=ag(n,e,l),isNaN(i.x))))break}else if(a.mandatory)return-1}return isNaN(i.x)?-1:(r.x=-i.x,r.y=i.y,0)}function ag(t,e,r){var n={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return n;var i={x:t.x,y:t.y};i.x-=r.ll[0],i.y-=r.ll[1],i.x=Rd(i.x-Math.PI)+Math.PI;var o=lg(i,r);if(e){if(isNaN(o.x))return n;o.x=i.x-o.x,o.y=i.y-o.y;var s,a,l=9;do{if(a=lg(o,r),isNaN(a.x))break;s={x:i.x-(a.x+o.x),y:i.y-(a.y+o.y)},o.x+=s.x,o.y+=s.y}while(l--&&Math.abs(s.x)>1e-12&&Math.abs(s.y)>1e-12);if(l<0)return n;n.x=Rd(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=t.x+o.x,n.y=t.y+o.y);return n}function lg(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),s=n.x-1*i,a=n.y-1*o,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return l;if(o<0||o>=e.lim[1])return l;r=o*e.lim[0]+i;var u=e.cvs[r][0],h=e.cvs[r][1];r++;var c=e.cvs[r][0],A=e.cvs[r][1];r+=e.lim[0];var f=e.cvs[r][0],p=e.cvs[r][1];r--;var d=e.cvs[r][0],g=e.cvs[r][1],y=s*a,m=s*(1-a),v=(1-s)*(1-a),_=(1-s)*a;return l.x=v*u+m*c+_*d+y*f,l.y=v*h+m*A+_*g+y*p,l}function ug(t,e,r){var n,i,o,s=r.x,a=r.y,l=r.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=s,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(n=a,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(n=l,i="z"),t.axis[o]){case"e":case"n":u[i]=n;break;case"w":case"s":u[i]=-n;break;case"u":void 0!==r[i]&&(u.z=n);break;case"d":void 0!==r[i]&&(u.z=-n);break;default:return null}return u}function hg(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function cg(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Ag(t,e,r,n){var i,o=void 0!==(r=Array.isArray(r)?hg(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){cg(t.x),cg(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===Wp||t.datum.datum_type===Xp||t.datum.datum_type===Yp)&&"WGS84"!==e.datumCode||(e.datum.datum_type===Wp||e.datum.datum_type===Xp||e.datum.datum_type===Yp)&&"WGS84"!==t.datumCode}(t,e)&&(r=Ag(t,i=new rg("WGS84"),r,n),t=i),n&&"enu"!==t.axis&&(r=ug(t,!1,r)),"longlat"===t.projName)r={x:r.x*ld,y:r.y*ld,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===Wp?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==Xp||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===Jp||e.datum_type===Jp)return r;var n=t.a,i=t.es;if(t.datum_type===Yp){if(0!==sg(t,!1,r))return;n=$p,i=ed}var o=e.a,s=e.b,a=e.es;return e.datum_type===Yp&&(o=$p,s=td,a=ed),i!==a||n!==o||og(t.datum_type)||og(e.datum_type)?(r=ng(r,i,n),og(t.datum_type)&&(r=function(t,e,r){if(e===Wp)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===Xp){var n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],u=r[6];return{x:u*(t.x-l*t.y+a*t.z)+n,y:u*(l*t.x+t.y-s*t.z)+i,z:u*(-a*t.x+s*t.y+t.z)+o}}}(r,t.datum_type,t.datum_params)),og(e.datum_type)&&(r=function(t,e,r){if(e===Wp)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===Xp){var n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],u=r[6],h=(t.x-n)/u,c=(t.y-i)/u,A=(t.z-o)/u;return{x:h+l*c-a*A,y:-l*h+c+s*A,z:a*h-s*c+A}}}(r,e.datum_type,e.datum_params)),r=ig(r,a,o,s),e.datum_type!==Yp||0===sg(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*ud,y:r.y*ud,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),n&&"enu"!==e.axis?ug(e,!0,r):(o||delete r.z,r)}rg.projections=Vd,rg.projections.start();var fg=rg("WGS84");function pg(t,e,r,n){var i,o,s;return Array.isArray(r)?(i=Ag(t,e,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(o=Ag(t,e,r,n),2===(s=Object.keys(r)).length||s.forEach((function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;o[n]=r[n]})),o)}function dg(t){return t instanceof rg?t:t.oProj?t.oProj:rg(t)}function gg(t,e,r){t=dg(t);var n,i=!1;return void 0===e?(e=t,t=fg,i=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=fg,i=!0),e=dg(e),r?pg(t,e,r):(n={forward:function(r,n){return pg(t,e,r,n)},inverse:function(r,n){return pg(e,t,r,n)}},i&&(n.oProj=e),n)}var yg=6,mg="AJSAJS",vg="AFAFAF",_g=65,wg=73,bg=79,xg=86,Eg=90;const Cg={forward:Sg,inverse:function(t){var e=Pg(Lg(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Bg};function Sg(t,e){return e=e||5,function(t,e){var r,n,i,o,s,a,l,u,h,c,A,f="00000"+t.easting,p="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,c=t.northing,A=Fg(t.zoneNumber),r=Math.floor(h/1e5),n=Math.floor(c/1e5)%20,i=A-1,o=mg.charCodeAt(i),s=vg.charCodeAt(i),u=!1,(a=o+r-1)>Eg&&(a=a-Eg+_g-1,u=!0),(a===wg||o<wg&&a>wg||(a>wg||o<wg)&&u)&&a++,(a===bg||o<bg&&a>bg||(a>bg||o<bg)&&u)&&++a===wg&&a++,a>Eg&&(a=a-Eg+_g-1),(l=s+n)>xg?(l=l-xg+_g-1,u=!0):u=!1,(l===wg||s<wg&&l>wg||(l>wg||s<wg)&&u)&&l++,(l===bg||s<bg&&l>bg||(l>bg||s<bg)&&u)&&++l===wg&&l++,l>xg&&(l=l-xg+_g-1),String.fromCharCode(a)+String.fromCharCode(l))+f.substr(f.length-5,e)+p.substr(p.length-5,e)}(function(t){var e,r,n,i,o,s,a,l=t.lat,u=t.lon,h=6378137,c=.9996,A=Ig(l),f=Ig(u);a=Math.floor((u+180)/6)+1,180===u&&(a=60),l>=56&&l<64&&u>=3&&u<12&&(a=32),l>=72&&l<84&&(u>=0&&u<9?a=31:u>=9&&u<21?a=33:u>=21&&u<33?a=35:u>=33&&u<42&&(a=37)),s=Ig(6*(a-1)-180+3),e=.006739496752268451,r=h/Math.sqrt(1-.00669438*Math.sin(A)*Math.sin(A)),n=Math.tan(A)*Math.tan(A),i=e*Math.cos(A)*Math.cos(A);var p,d,g=c*r*((o=Math.cos(A)*(f-s))+(1-n+i)*o*o*o/6+(5-18*n+n*n+72*i-58*e)*o*o*o*o*o/120)+5e5,y=c*(h*(.9983242984503243*A-.002514607064228144*Math.sin(2*A)+2639046602129982e-21*Math.sin(4*A)-3.418046101696858e-9*Math.sin(6*A))+r*Math.tan(A)*(o*o/2+(5-n+9*i+4*i*i)*o*o*o*o/24+(61-58*n+n*n+600*i-2.2240339282485886)*o*o*o*o*o*o/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(g),zoneNumber:a,zoneLetter:(p=l,d="Z",84>=p&&p>=72?d="X":72>p&&p>=64?d="W":64>p&&p>=56?d="V":56>p&&p>=48?d="U":48>p&&p>=40?d="T":40>p&&p>=32?d="S":32>p&&p>=24?d="R":24>p&&p>=16?d="Q":16>p&&p>=8?d="P":8>p&&p>=0?d="N":0>p&&p>=-8?d="M":-8>p&&p>=-16?d="L":-16>p&&p>=-24?d="K":-24>p&&p>=-32?d="J":-32>p&&p>=-40?d="H":-40>p&&p>=-48?d="G":-48>p&&p>=-56?d="F":-56>p&&p>=-64?d="E":-64>p&&p>=-72?d="D":-72>p&&p>=-80&&(d="C"),d)}}({lat:t[1],lon:t[0]}),e)}function Bg(t){var e=Pg(Lg(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ig(t){return t*(Math.PI/180)}function Tg(t){return t/Math.PI*180}function Pg(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,s,a,l,u,h,c,A,f,p=.9996,d=6378137,g=.00669438,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=r-5e5,v=e;n<"N"&&(v-=1e7),c=6*(i-1)-180+3,o=.006739496752268451,f=(A=v/p/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*A)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*A)+151*y*y*y/96*Math.sin(6*A),s=d/Math.sqrt(1-g*Math.sin(f)*Math.sin(f)),a=Math.tan(f)*Math.tan(f),l=o*Math.cos(f)*Math.cos(f),u=.99330562*d/Math.pow(1-g*Math.sin(f)*Math.sin(f),1.5),h=m/(s*p);var _=f-s*Math.tan(f)/u*(h*h/2-(5+3*a+10*l-4*l*l-9*o)*h*h*h*h/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*h*h*h*h*h*h/720);_=Tg(_);var w,b=(h-(1+2*a+l)*h*h*h/6+(5-2*l+28*a-3*l*l+8*o+24*a*a)*h*h*h*h*h/120)/Math.cos(f);if(b=c+Tg(b),t.accuracy){var x=Pg({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:x.lat,right:x.lon,bottom:_,left:b}}else w={lat:_,lon:b};return w}function Fg(t){var e=t%yg;return 0===e&&(e=yg),e}function Lg(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var s=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(o++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(o,o+=2);for(var l=Fg(s),u=function(t,e){for(var r=mg.charCodeAt(e-1),n=1e5,i=!1;r!==t.charCodeAt(0);){if(++r===wg&&r++,r===bg&&r++,r>Eg){if(i)throw"Bad character: "+t;r=_g,i=!0}n+=1e5}return n}(n.charAt(0),l),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=vg.charCodeAt(e-1),n=0,i=!1;r!==t.charCodeAt(0);){if(++r===wg&&r++,r===bg&&r++,r>xg){if(i)throw"Bad character: "+t;r=_g,i=!0}n+=1e5}return n}(n.charAt(1),l);h<Mg(a);)h+=2e6;var c=r-o;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var A,f,p,d=c/2,g=0,y=0;return d>0&&(A=1e5/Math.pow(10,d),f=t.substring(o,o+d),g=parseFloat(f)*A,p=t.substring(o+d),y=parseFloat(p)*A),{easting:g+u,northing:y+h,zoneLetter:a,zoneNumber:s,accuracy:A}}function Mg(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Og(t,e,r){if(!(this instanceof Og))return new Og(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0}Og.fromMGRS=function(t){return new Og(Bg(t))},Og.prototype.toMGRS=function(t){return Sg([this.x,this.y],t)};var kg=1,Ng=.25,Rg=.046875,Ug=.01953125,Dg=.01068115234375,Qg=.75,Gg=.46875,jg=.013020833333333334,Hg=.007120768229166667,zg=.3645833333333333,Vg=.005696614583333333,Kg=.3076171875;function qg(t){var e=[];e[0]=kg-t*(Ng+t*(Rg+t*(Ug+t*Dg))),e[1]=t*(Qg-t*(Rg+t*(Ug+t*Dg)));var r=t*t;return e[2]=r*(Gg-t*(jg+t*Hg)),r*=t,e[3]=r*(zg-t*Vg),e[4]=r*t*Kg,e}function Wg(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var Xg=20;function Yg(t,e,r){for(var n=1/(1-e),i=t,o=Xg;o;--o){var s=Math.sin(i),a=1-e*s*s;if(i-=a=(Wg(i,s,Math.cos(i),r)-t)*(a*Math.sqrt(a))*n,Math.abs(a)<ad)return i}return i}const Zg={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=qg(this.es),this.ml0=Wg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,r,n,i=t.x,o=t.y,s=Rd(i-this.long0),a=Math.sin(o),l=Math.cos(o);if(this.es){var u=l*s,h=Math.pow(u,2),c=this.ep2*Math.pow(l,2),A=Math.pow(c,2),f=Math.abs(l)>ad?Math.tan(o):0,p=Math.pow(f,2),d=Math.pow(p,2);e=1-this.es*Math.pow(a,2),u/=Math.sqrt(e);var g=Wg(o,a,l,this.en);r=this.a*(this.k0*u*(1+h/6*(1-p+c+h/20*(5-18*p+d+14*c-58*p*c+h/42*(61+179*d-d*p-479*p)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+a*s*u/2*(1+h/12*(5-p+9*c+4*A+h/30*(61+d-58*p+270*c-330*p*c+h/56*(1385+543*d-d*p-3111*p))))))+this.y0}else{var y=l*Math.sin(s);if(Math.abs(Math.abs(y)-1)<ad)return 93;if(r=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,n=l*Math.cos(s)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(n))>=1){if(y-1>ad)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,i,o=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Yg(e=this.ml0+s/this.k0,this.es,this.en),Math.abs(r)<nd){var a=Math.sin(r),l=Math.cos(r),u=Math.abs(l)>ad?Math.tan(r):0,h=this.ep2*Math.pow(l,2),c=Math.pow(h,2),A=Math.pow(u,2),f=Math.pow(A,2);e=1-this.es*Math.pow(a,2);var p=o*Math.sqrt(e)/this.k0,d=Math.pow(p,2);n=r-(e*=u)*d/(1-this.es)*.5*(1-d/12*(5+3*A-9*h*A+h-4*c-d/30*(61+90*A-252*h*A+45*f+46*h-d/56*(1385+3633*A+4095*f+1574*f*A)))),i=Rd(this.long0+p*(1-d/6*(1+2*A+h-d/20*(5+28*A+24*f+8*h*A+6*h-d/42*(61+662*A+1320*f+720*f*A))))/l)}else n=nd*Nd(s),i=0;else{var g=Math.exp(o/this.k0),y=.5*(g-1/g),m=this.lat0+s/this.k0,v=Math.cos(m);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(y,2))),n=Math.asin(e),s<0&&(n=-n),i=0===y&&0===v?0:Rd(Math.atan2(y,v)+this.long0)}return t.x=i,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Jg(t){var e=Math.exp(t);return(e-1/e)/2}function $g(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function ty(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,o=t[i],s=0;--i>=0;)r=n*o-s+t[i],s=o,o=r;return e+r*Math.sin(2*e)}function ey(t,e,r){for(var n,i,o=Math.sin(e),s=Math.cos(e),a=Jg(r),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(r),u=2*s*l,h=-2*o*a,c=t.length-1,A=t[c],f=0,p=0,d=0;--c>=0;)n=p,i=f,A=u*(p=A)-n-h*(f=d)+t[c],d=h*p-i+u*f;return[(u=o*l)*A-(h=s*a)*d,u*d+h*A]}const ry={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Zg.init.apply(this),this.forward=Zg.forward,this.inverse=Zg.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var n=ty(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,o=t[i],s=0;--i>=0;)r=n*o-s+t[i],s=o,o=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=Rd(t.x-this.long0),r=t.y;r=ty(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(e),s=Math.cos(e);r=Math.atan2(n,s*i),e=Math.atan2(o*i,$g(n,i*s)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/($g(1,e)+1))),t<0?-e:e}(Math.tan(e));var a,l,u=ey(this.gtu,2*r,2*e);return r+=u[0],e+=u[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=ey(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(Jg(n));var s=Math.sin(i),a=Math.cos(i),l=Math.sin(n),u=Math.cos(n);i=Math.atan2(s*u,$g(l,u*a)),e=Rd((n=Math.atan2(l,u*a))+this.long0),r=ty(this.cgb,i)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ny={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Rd(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*ld,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ry.init.apply(this),this.forward=ry.forward,this.inverse=ry.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function iy(t,e){return Math.pow((1-t)/(1+t),e)}const oy={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+hd)/(Math.pow(Math.tan(.5*this.lat0+hd),this.C)*iy(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+hd),this.C)*iy(this.e*Math.sin(r),this.ratexp))-nd,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+hd)/this.K,1/this.C),i=20;i>0&&(r=2*Math.atan(n*iy(this.e*Math.sin(t.y),-.5*this.e))-nd,!(Math.abs(r-t.y)<1e-14));--i)t.y=r;return i?(t.x=e,t.y=r,t):null},names:["gauss"]},sy={init:function(){oy.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,i;return t.x=Rd(t.x-this.long0),oy.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var s=2*Math.atan2(o,this.R2);e=Math.sin(s),r=Math.cos(s),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/o),n=Math.atan2(t.x*e,o*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,n=0;return t.x=n,t.y=i,oy.inverse.apply(this,[t]),t.x=Rd(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ay={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ad&&(this.k0=.5*(1+Nd(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=ad&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ad&&(this.k0=.5*this.cons*kd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ud(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=kd(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-nd,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,i,o,s,a=t.x,l=t.y,u=Math.sin(l),h=Math.cos(l),c=Rd(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=ad&&Math.abs(l+this.lat0)<=ad?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*u+this.coslat0*h*Math.cos(c)),t.x=this.a*e*h*Math.sin(c)+this.x0,t.y=this.a*e*(this.coslat0*u-this.sinlat0*h*Math.cos(c))+this.y0,t):(r=2*Math.atan(this.ssfn_(l,u,this.e))-nd,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=ad?(o=Ud(this.e,l*this.con,this.con*u),s=2*this.a*this.k0*o/this.cons,t.x=this.x0+s*Math.sin(a-this.long0),t.y=this.y0-this.con*s*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)<ad?(e=2*this.a*this.k0/(1+i*Math.cos(c)),t.y=e*n):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*i*Math.cos(c))),t.y=e*(this.cosX0*n-this.sinX0*i*Math.cos(c))+this.y0),t.x=e*i*Math.sin(c)+this.x0,t))},inverse:function(t){var e,r,n,i,o;t.x-=this.x0,t.y-=this.y0;var s=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(s/(2*this.a*this.k0));return e=this.long0,r=this.lat0,s<=ad?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/s),e=Math.abs(this.coslat0)<ad?this.lat0>0?Rd(this.long0+Math.atan2(t.x,-1*t.y)):Rd(this.long0+Math.atan2(t.x,t.y)):Rd(this.long0+Math.atan2(t.x*Math.sin(a),s*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=ad){if(s<=ad)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=s*this.cons/(2*this.a*this.k0),r=this.con*Dd(this.e,n),e=this.con*Rd(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=ad?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/s),e=Rd(this.long0+Math.atan2(t.x*Math.sin(i),s*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*Dd(this.e,Math.tan(.5*(nd+o)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(nd+t))*Math.pow((1-e)/(1+e),.5*r)}},ly={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*a+this.alpha*o/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*s+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),s=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+s/this.alpha,l=0,u=o,h=-1e3,c=0;Math.abs(u-h)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),h=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=u,t},names:["somerc"]};var uy=1e-7;const hy={init:function(){var t,e,r,n,i,o,s,a,l,u,h,c,A,f=0,p=0,d=0,g=0,y=0,m=0,v=0;this.no_off=(A="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var _=!1;"alpha"in this&&(_=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),_&&(v=this.alpha),w&&(f=this.rectified_grid_angle*ld),_||w)p=this.longc;else if(d=this.long1,y=this.lat1,g=this.long2,m=this.lat2,Math.abs(y-m)<=uy||(t=Math.abs(y))<=uy||Math.abs(t-nd)<=uy||Math.abs(Math.abs(this.lat0)-nd)<=uy||Math.abs(Math.abs(m)-nd)<=uy)throw new Error;var b=1-this.es;e=Math.sqrt(b),Math.abs(this.lat0)>ad?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*e/t,(i=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(Ud(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=i=1),_||w?(_?(h=Math.asin(Math.sin(v)/n),w||(f=v)):(h=f,v=Math.asin(n*Math.sin(h))),this.lam0=p-Math.asin(.5*(i-1/i)*Math.tan(h))/this.B):(o=Math.pow(Ud(this.e,y,Math.sin(y)),this.B),s=Math.pow(Ud(this.e,m,Math.sin(m)),this.B),i=this.E/o,l=(s-o)/(s+o),u=((u=this.E*this.E)-s*o)/(u+s*o),(t=d-g)<-Math.pi?g-=cd:t>Math.pi&&(g+=cd),this.lam0=Rd(.5*(d+g)-Math.atan(u*Math.tan(.5*this.B*(d-g))/l)/this.B),h=Math.atan(2*Math.sin(this.B*Rd(d-this.lam0))/(i-1/i)),f=v=Math.asin(n*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(v))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(hd-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(hd+i))},forward:function(t){var e,r,n,i,o,s,a,l,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-nd)>ad){if(e=.5*((o=this.E/Math.pow(Ud(this.e,t.y,Math.sin(t.y)),this.B))-(s=1/o)),r=.5*(o+s),i=Math.sin(this.B*t.x),n=(e*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)<ad)throw new Error;l=.5*this.ArB*Math.log((1-n)/(1+n)),s=Math.cos(this.B*t.x),a=Math.abs(s)<uy?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+i*this.singam,s)}else l=t.y>0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(u.x=a,u.y=l):(a-=this.u_0,u.x=l*this.cosrot+a*this.sinrot,u.y=a*this.cosrot-l*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var e,r,n,i,o,s,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),a=((s=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(a)-1)<ad)l.x=0,l.y=a<0?-nd:nd;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=Dd(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-s*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},cy={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<ad)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),n=kd(this.e,e,r),i=Ud(this.e,this.lat1,e),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=kd(this.e,o,s),l=Ud(this.e,this.lat2,o),u=Ud(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>ad?this.ns=Math.log(n/a)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=ad&&(r=Nd(r)*(nd-2*ad));var n,i,o=Math.abs(Math.abs(r)-nd);if(o>ad)n=Ud(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var s=this.ns*Rd(e-this.long0);return t.x=this.k0*(i*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(s))+this.y0,t},inverse:function(t){var e,r,n,i,o,s=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+a*a),r=1):(e=-Math.sqrt(s*s+a*a),r=-1);var l=0;if(0!==e&&(l=Math.atan2(r*s,r*a)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(i=Dd(this.e,n)))return null}else i=-nd;return o=Rd(l/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Ay={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,i,o,s,a,l=t.x,u=t.y,h=Rd(l-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),n=-h*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=a*Math.cos(s)/1,t.x=a*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,i,o,s,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,s=e,a=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(a=1),s=t.y,u+=1}while(0===a&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function fy(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function py(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function dy(t){return.375*t*(1+.25*t*(1+.46875*t))}function gy(t){return.05859375*t*t*(1+.75*t)}function yy(t){return t*t*t*(35/3072)}function my(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}function vy(t){return Math.abs(t)<nd?t:t-Nd(t)*Math.PI}function _y(t,e,r,n,i){var o,s;o=t/e;for(var a=0;a<15;a++)if(o+=s=(t-(e*o-r*Math.sin(2*o)+n*Math.sin(4*o)-i*Math.sin(6*o)))/(e-2*r*Math.cos(2*o)+4*n*Math.cos(4*o)-6*i*Math.cos(6*o)),Math.abs(s)<=1e-10)return o;return NaN}const wy={init:function(){this.sphere||(this.e0=py(this.es),this.e1=dy(this.es),this.e2=gy(this.es),this.e3=yy(this.es),this.ml0=this.a*fy(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,r,n=t.x,i=t.y;if(n=Rd(n-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(n)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var o=Math.sin(i),s=Math.cos(i),a=my(this.a,this.e,o),l=Math.tan(i)*Math.tan(i),u=n*Math.cos(i),h=u*u,c=this.es*s*s/(1-this.es);e=a*u*(1-h*l*(1/6-(8-l+8*c)*h/120)),r=this.a*fy(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+a*o/s*h*(.5+(5-l+6*c)*h/24)}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n=t.x/this.a,i=t.y/this.a;if(this.sphere){var o=i+this.lat0;e=Math.asin(Math.sin(o)*Math.cos(n)),r=Math.atan2(Math.tan(n),Math.cos(o))}else{var s=_y(this.ml0/this.a+i,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-nd)<=ad)return t.x=this.long0,t.y=nd,i<0&&(t.y*=-1),t;var a=my(this.a,this.e,Math.sin(s)),l=a*a*a/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(s),2),h=n*this.a/a,c=h*h;e=s-a*Math.tan(s)/l*h*h*(.5-(1+3*u)*h*h/24),r=h*(1-c*(u/3+(1+3*u)*u*c/15))/Math.cos(s)}return t.x=Rd(r+this.long0),t.y=vy(e),t},names:["Cassini","Cassini_Soldner","cass"]};function by(t,e){var r;return t>1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}const xy={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-nd)<ad?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<ad?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=by(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=by(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,i,o,s,a,l,u,h,c=t.x,A=t.y;if(c=Rd(c-this.long0),this.sphere){if(o=Math.sin(A),h=Math.cos(A),n=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+h*n:1+this.sinph0*o+this.cosph0*h*n)<=ad)return null;e=(r=Math.sqrt(2/r))*h*Math.sin(c),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(A+this.lat0)<ad)return null;r=hd-.5*A,e=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(c),r*=n}}else{switch(a=0,l=0,u=0,n=Math.cos(c),i=Math.sin(c),o=Math.sin(A),s=by(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(a=s/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:u=1+this.sinb1*a+this.cosb1*l*n;break;case this.EQUIT:u=1+l*n;break;case this.N_POLE:u=nd+A,s=this.qp-s;break;case this.S_POLE:u=A-nd,s=this.qp+s}if(Math.abs(u)<ad)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),r=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*a-this.sinb1*l*n):(u=Math.sqrt(2/(1+l*n)))*a*this.ymf,e=this.xmf*u*l*i;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(u=Math.sqrt(s))*i,r=n*(this.mode===this.S_POLE?u:-u)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,i,o,s,a,l,u,h,c=t.x/this.a,A=t.y/this.a;if(this.sphere){var f,p=0,d=0;if((r=.5*(f=Math.sqrt(c*c+A*A)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(r),p=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(f)<=ad?0:Math.asin(A*d/f),c*=d,A=p*f;break;case this.OBLIQ:r=Math.abs(f)<=ad?this.lat0:Math.asin(p*this.sinph0+A*d*this.cosph0/f),c*=d*this.cosph0,A=(p-Math.sin(r)*this.sinph0)*f;break;case this.N_POLE:A=-A,r=nd-r;break;case this.S_POLE:r-=nd}e=0!==A||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,A):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,A*=this.dd,(s=Math.sqrt(c*c+A*A))<ad)return t.x=this.long0,t.y=this.lat0,t;i=2*Math.asin(.5*s/this.rq),n=Math.cos(i),c*=i=Math.sin(i),this.mode===this.OBLIQ?(a=n*this.sinb1+A*i*this.cosb1/s,o=this.qp*a,A=s*this.cosb1*n-A*this.sinb1*i):(a=A*i/s,o=this.qp*a,A=s*n)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(A=-A),!(o=c*c+A*A))return t.x=this.long0,t.y=this.lat0,t;a=1-o/this.qp,this.mode===this.S_POLE&&(a=-a)}e=Math.atan2(c,A),h=(l=Math.asin(a))+l,r=l+(u=this.apa)[0]*Math.sin(h)+u[1]*Math.sin(h+h)+u[2]*Math.sin(h+h+h)}return t.x=Rd(this.long0+e),t.y=r,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Ey(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const Cy={init:function(){Math.abs(this.lat1+this.lat2)<ad||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=kd(this.e3,this.sin_po,this.cos_po),this.qs1=by(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=kd(this.e3,this.sin_po,this.cos_po),this.qs2=by(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=by(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>ad?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=by(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*Rd(e-this.long0),s=i*Math.sin(o)+this.x0,a=this.rh-i*Math.cos(o)+this.y0;return t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i,o,s;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),i=0,0!==e&&(i=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,s=this.phi1z(this.e3,r)),o=Rd(i/this.ns0+this.long0),t.x=o,t.y=s,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,i,o,s=Ey(.5*e);if(t<ad)return s;for(var a=t*t,l=1;l<=25;l++)if(s+=o=.5*(i=1-(n=t*(r=Math.sin(s)))*n)*i/Math.cos(s)*(e/(1-a)-r/i+.5/t*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return s;return null}},Sy={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,r,n,i,o,s,a,l=t.x,u=t.y;return n=Rd(l-this.long0),e=Math.sin(u),r=Math.cos(u),i=Math.cos(n),(o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=ad?(s=this.x0+1*this.a*r*Math.sin(n)/o,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)/o):(s=this.x0+this.infinity_dist*r*Math.sin(n),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i,o,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),s=Ey((n=Math.cos(i))*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),o=Rd(this.long0+o)):(s=this.phic0,o=0),t.x=o,t.y=s,t},names:["gnom"]},By={init:function(){this.sphere||(this.k0=kd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,i=t.y,o=Rd(n-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var s=by(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,r=this.y0+this.a*s*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Rd(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*nd:nd;for(var n,i,o,s,a=Math.asin(.5*e),l=0;l<30;l++)if(i=Math.sin(a),o=Math.cos(a),s=t*i,a+=n=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-i/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(n)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=Rd(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},Iy={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=Rd(e-this.long0),i=vy(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,r=t.y;return t.x=Rd(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=vy(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ty={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=py(this.es),this.e1=dy(this.es),this.e2=gy(this.es),this.e3=yy(this.es),this.ml0=this.a*fy(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,i=t.x,o=t.y,s=Rd(i-this.long0);if(n=s*Math.sin(o),this.sphere)Math.abs(o)<=ad?(e=this.a*s,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(o),r=this.a*(vy(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=ad)e=this.a*s,r=-1*this.ml0;else{var a=my(this.a,this.e,Math.sin(o))/Math.tan(o);e=a*Math.sin(n),r=this.a*fy(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+a*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,i,o,s,a,l,u;if(n=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=ad)e=Rd(n/this.a+this.long0),r=0;else{var h;for(s=this.lat0+i/this.a,a=n*n/this.a/this.a+s*s,l=s,o=20;o;--o)if(l+=u=-1*(s*(l*(h=Math.tan(l))+1)-l-.5*(l*l+a)*h)/((l-s)/h-1),Math.abs(u)<=ad){r=l;break}e=Rd(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=ad)r=0,e=Rd(this.long0+n/this.a);else{var c,A,f,p,d;for(s=(this.ml0+i)/this.a,a=n*n/this.a/this.a+s*s,l=s,o=20;o;--o)if(d=this.e*Math.sin(l),c=Math.sqrt(1-d*d)*Math.tan(l),A=this.a*fy(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=u=(s*(c*(p=A/this.a)+1)-p-.5*c*(p*p+a))/(this.es*Math.sin(2*l)*(p*p+a-2*s*p)/(4*c)+(s-p)*(c*f-2/Math.sin(2*l))-f),Math.abs(u)<=ad){r=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=Rd(this.long0+Math.asin(n*c/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Py={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,i=r-this.long0,o=n/rd*1e-5,s=i,a=1,l=0;for(e=1;e<=10;e++)a*=o,l+=this.A[e]*a;var u,h=l,c=s,A=1,f=0,p=0,d=0;for(e=1;e<=6;e++)u=f*h+A*c,A=A*h-f*c,f=u,p=p+this.B_re[e]*A-this.B_im[e]*f,d=d+this.B_im[e]*A+this.B_re[e]*f;return t.x=d*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,i=t.y,o=n-this.x0,s=(i-this.y0)/this.a,a=o/this.a,l=1,u=0,h=0,c=0;for(e=1;e<=6;e++)r=u*s+l*a,l=l*s-u*a,u=r,h=h+this.C_re[e]*l-this.C_im[e]*u,c=c+this.C_im[e]*l+this.C_re[e]*u;for(var A=0;A<this.iterations;A++){var f,p=h,d=c,g=s,y=a;for(e=2;e<=6;e++)f=d*h+p*c,p=p*h-d*c,d=f,g+=(e-1)*(this.B_re[e]*p-this.B_im[e]*d),y+=(e-1)*(this.B_im[e]*p+this.B_re[e]*d);p=1,d=0;var m=this.B_re[1],v=this.B_im[1];for(e=2;e<=6;e++)f=d*h+p*c,p=p*h-d*c,d=f,m+=e*(this.B_re[e]*p-this.B_im[e]*d),v+=e*(this.B_im[e]*p+this.B_re[e]*d);var _=m*m+v*v;h=(g*m+y*v)/_,c=(y*m-g*v)/_}var w=h,b=c,x=1,E=0;for(e=1;e<=9;e++)x*=w,E+=this.D[e]*x;var C=this.lat0+E*rd*1e5,S=this.long0+b;return t.x=S,t.y=C,t},names:["New_Zealand_Map_Grid","nzmg"]},Fy={init:function(){},forward:function(t){var e=t.x,r=t.y,n=Rd(e-this.long0),i=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return t.x=i,t.y=o,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=Rd(this.long0+t.x/this.a),r=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=r,t},names:["Miller_Cylindrical","mill"]},Ly={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=qg(this.es)},forward:function(t){var e,r,n=t.x,i=t.y;if(n=Rd(n-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(i),s=20;s;--s){var a=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=a,Math.abs(a)<ad)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;e=this.a*this.C_x*n*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var l=Math.sin(i),u=Math.cos(i);r=this.a*Wg(i,l,u,this.en),e=this.a*n*u/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,r/=this.C_x*(this.m+Math.cos(e)),this.m?e=Ey((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=Ey(Math.sin(e)/this.n)),r=Rd(r+this.long0),e=vy(e)):(e=Yg(t.y/this.a,this.es,this.en),(n=Math.abs(e))<nd?(n=Math.sin(e),r=Rd(this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(e)))):n-ad<nd&&(r=this.long0)),t.x=r,t.y=e,t},names:["Sinusoidal","sinu"]},My={init:function(){},forward:function(t){for(var e=t.x,r=t.y,n=Rd(e-this.long0),i=r,o=Math.PI*Math.sin(r);;){var s=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=s,Math.abs(s)<ad)break}i/=2,Math.PI/2-Math.abs(r)<ad&&(n=0);var a=.900316316158*this.a*n*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=a,t.y=l,t},inverse:function(t){var e,r;t.x-=this.x0,t.y-=this.y0,r=t.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),e=Math.asin(r);var n=Rd(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=n,t.y=i,t},names:["Mollweide","moll"]},Oy={init:function(){Math.abs(this.lat1+this.lat2)<ad||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=py(this.es),this.e1=dy(this.es),this.e2=gy(this.es),this.e3=yy(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=kd(this.e,this.sinphi,this.cosphi),this.ml1=fy(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<ad?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=kd(this.e,this.sinphi,this.cosphi),this.ml2=fy(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=fy(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,r=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var i=fy(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-i)}var o=this.ns*Rd(r-this.long0),s=this.x0+e*Math.sin(o),a=this.y0+this.rh-e*Math.cos(o);return t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==r&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=Rd(this.long0+o/this.ns),n=vy(this.g-r/this.a),t.x=i,t.y=n,t):(n=_y(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=Rd(this.long0+o/this.ns),t.x=i,t.y=n,t)},names:["Equidistant_Conic","eqdc"]},ky={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,i=t.y,o=Rd(n-this.long0);Math.abs(i)<=ad&&(e=this.x0+this.R*o,r=this.y0);var s=Ey(2*Math.abs(i/Math.PI));(Math.abs(o)<=ad||Math.abs(Math.abs(i)-nd)<=ad)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var a=.5*Math.abs(Math.PI/o-o/Math.PI),l=a*a,u=Math.sin(s),h=Math.cos(s),c=h/(u+h-1),A=c*c,f=c*(2/u-1),p=f*f,d=Math.PI*this.R*(a*(c-p)+Math.sqrt(l*(c-p)*(c-p)-(p+l)*(A-p)))/(p+l);o<0&&(d=-d),e=this.x0+d;var g=l+c;return d=Math.PI*this.R*(f*g-a*Math.sqrt((p+l)*(l+1)-g*g))/(p+l),r=i>=0?this.y0+d:this.y0-d,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,i,o,s,a,l,u,h,c,A;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,o=(n=t.x/c)*n+(i=t.y/c)*i,c=3*(i*i/(l=-2*(s=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(a=s-2*i*i+n*n)*a*a/l/l/l-9*s*a/l/l)/27)/(u=(s-a*a/3/l)/l)/(h=2*Math.sqrt(-u/3)),Math.abs(c)>1&&(c=c>=0?1:-1),A=Math.acos(c)/3,r=t.y>=0?(-h*Math.cos(A+Math.PI/3)-a/3/l)*Math.PI:-(-h*Math.cos(A+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(n)<ad?this.long0:Rd(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-i*i)+o*o))/2/n),t.x=e,t.y=r,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},Ny={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x=t.x,E=t.y,C=Math.sin(t.y),S=Math.cos(t.y),B=Rd(x-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=ad?(t.x=this.x0+this.a*(nd-E)*Math.sin(B),t.y=this.y0-this.a*(nd-E)*Math.cos(B),t):Math.abs(this.sin_p12+1)<=ad?(t.x=this.x0+this.a*(nd+E)*Math.sin(B),t.y=this.y0+this.a*(nd+E)*Math.cos(B),t):(m=this.sin_p12*C+this.cos_p12*S*Math.cos(B),y=(g=Math.acos(m))?g/Math.sin(g):1,t.x=this.x0+this.a*y*S*Math.sin(B),t.y=this.y0+this.a*y*(this.cos_p12*C-this.sin_p12*S*Math.cos(B)),t):(e=py(this.es),r=dy(this.es),n=gy(this.es),i=yy(this.es),Math.abs(this.sin_p12-1)<=ad?(o=this.a*fy(e,r,n,i,nd),s=this.a*fy(e,r,n,i,E),t.x=this.x0+(o-s)*Math.sin(B),t.y=this.y0-(o-s)*Math.cos(B),t):Math.abs(this.sin_p12+1)<=ad?(o=this.a*fy(e,r,n,i,nd),s=this.a*fy(e,r,n,i,E),t.x=this.x0+(o+s)*Math.sin(B),t.y=this.y0+(o+s)*Math.cos(B),t):(a=C/S,l=my(this.a,this.e,this.sin_p12),u=my(this.a,this.e,C),h=Math.atan((1-this.es)*a+this.es*l*this.sin_p12/(u*S)),v=0===(c=Math.atan2(Math.sin(B),this.cos_p12*Math.tan(h)-this.sin_p12*Math.cos(B)))?Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.abs(Math.abs(c)-Math.PI)<=ad?-Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.asin(Math.sin(B)*Math.cos(h)/Math.sin(c)),A=this.e*this.sin_p12/Math.sqrt(1-this.es),g=l*v*(1-(_=v*v)*(d=(f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*f)*(1-d)/6+(w=_*v)/8*(p=A*f)*(1-2*d)+(b=w*v)/120*(d*(4-7*d)-3*A*A*(1-7*d))-b*v/48*p),t.x=this.x0+g*Math.sin(c),t.y=this.y0+g*Math.cos(c),t))},inverse:function(t){var e,r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*nd*this.a)return;return r=e/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(e)<=ad?s=this.lat0:(s=Ey(i*this.sin_p12+t.y*n*this.cos_p12/e),a=Math.abs(this.lat0)-nd,o=Math.abs(a)<=ad?this.lat0>=0?Rd(this.long0+Math.atan2(t.x,-t.y)):Rd(this.long0-Math.atan2(-t.x,t.y)):Rd(this.long0+Math.atan2(t.x*n,e*this.cos_p12*i-t.y*this.sin_p12*n))),t.x=o,t.y=s,t}return l=py(this.es),u=dy(this.es),h=gy(this.es),c=yy(this.es),Math.abs(this.sin_p12-1)<=ad?(s=_y(((A=this.a*fy(l,u,h,c,nd))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,u,h,c),o=Rd(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=s,t):Math.abs(this.sin_p12+1)<=ad?(A=this.a*fy(l,u,h,c,nd),s=_y(((e=Math.sqrt(t.x*t.x+t.y*t.y))-A)/this.a,l,u,h,c),o=Rd(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.x,t.y),f=my(this.a,this.e,this.sin_p12),g=Math.cos(d),m=-(y=this.e*this.cos_p12*g)*y/(1-this.es),v=3*this.es*(1-m)*this.sin_p12*this.cos_p12*g/(1-this.es),b=1-m*(w=(_=e/f)-m*(1+m)*Math.pow(_,3)/6-v*(1+3*m)*Math.pow(_,4)/24)*w/2-_*w*w*w/6,p=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*g),o=Rd(this.long0+Math.asin(Math.sin(d)*Math.sin(w)/Math.cos(p))),x=Math.sin(p),s=Math.atan2((x-this.es*b*this.sin_p12)*Math.tan(p),x*(1-this.es)),t.x=o,t.y=s,t)},names:["Azimuthal_Equidistant","aeqd"]},Ry={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,s,a,l=t.x,u=t.y;return n=Rd(l-this.long0),e=Math.sin(u),r=Math.cos(u),i=Math.cos(n),((o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=ad)&&(s=1*this.a*r*Math.sin(n),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i,o,s,a;return t.x-=this.x0,t.y-=this.y0,r=Ey((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),n=Math.sin(r),i=Math.cos(r),s=this.long0,Math.abs(e)<=ad?(a=this.lat0,t.x=s,t.y=a,t):(a=Ey(i*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-nd,Math.abs(o)<=ad?(s=this.lat0>=0?Rd(this.long0+Math.atan2(t.x,-t.y)):Rd(this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=a,t):(s=Rd(this.long0+Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n)),t.x=s,t.y=a,t))},names:["ortho"]};var Uy={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Dy(t,e,r,n){var i;return t<ad?(n.value=Uy.AREA_0,i=0):(i=Math.atan2(e,r),Math.abs(i)<=hd?n.value=Uy.AREA_0:i>hd&&i<=nd+hd?(n.value=Uy.AREA_1,i-=nd):i>nd+hd||i<=-(nd+hd)?(n.value=Uy.AREA_2,i=i>=0?i-Ad:i+Ad):(n.value=Uy.AREA_3,i+=nd)),i}function Qy(t,e){var r=t+e;return r<-Ad?r+=cd:r>+Ad&&(r-=cd),r}const Gy={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=nd-hd/2?this.face=5:this.lat0<=-(nd-hd/2)?this.face=6:Math.abs(this.long0)<=hd?this.face=1:Math.abs(this.long0)<=nd+hd?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,i,o,s,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)i=nd-e,r>=hd&&r<=nd+hd?(l.value=Uy.AREA_0,n=r-nd):r>nd+hd||r<=-(nd+hd)?(l.value=Uy.AREA_1,n=r>0?r-Ad:r+Ad):r>-(nd+hd)&&r<=-hd?(l.value=Uy.AREA_2,n=r+nd):(l.value=Uy.AREA_3,n=r);else if(6===this.face)i=nd+e,r>=hd&&r<=nd+hd?(l.value=Uy.AREA_0,n=-r+nd):r<hd&&r>=-hd?(l.value=Uy.AREA_1,n=-r):r<-hd&&r>=-(nd+hd)?(l.value=Uy.AREA_2,n=-r-nd):(l.value=Uy.AREA_3,n=r>0?-r+Ad:-r-Ad);else{var u,h,c,A,f,p;2===this.face?r=Qy(r,+nd):3===this.face?r=Qy(r,+Ad):4===this.face&&(r=Qy(r,-nd)),A=Math.sin(e),f=Math.cos(e),p=Math.sin(r),u=f*Math.cos(r),h=f*p,c=A,1===this.face?n=Dy(i=Math.acos(u),c,h,l):2===this.face?n=Dy(i=Math.acos(h),c,-u,l):3===this.face?n=Dy(i=Math.acos(-u),c,-h,l):4===this.face?n=Dy(i=Math.acos(-h),c,u,l):(i=n=0,l.value=Uy.AREA_0)}return s=Math.atan(12/Ad*(n+Math.acos(Math.sin(n)*Math.cos(hd))-nd)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===Uy.AREA_1?s+=nd:l.value===Uy.AREA_2?s+=Ad:l.value===Uy.AREA_3&&(s+=1.5*Ad),a.x=o*Math.cos(s),a.y=o*Math.sin(s),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,r,n,i,o,s,a,l,u,h,c,A,f={lam:0,phi:0},p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=Uy.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=Uy.AREA_1,e-=nd):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Uy.AREA_2,e=e<0?e+Ad:e-Ad):(p.value=Uy.AREA_3,e+=nd),u=Ad/12*Math.tan(e),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),s=Math.atan(o),(a=1-(n=Math.cos(e))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?a=-1:a>1&&(a=1),5===this.face)l=Math.acos(a),f.phi=nd-l,p.value===Uy.AREA_0?f.lam=s+nd:p.value===Uy.AREA_1?f.lam=s<0?s+Ad:s-Ad:p.value===Uy.AREA_2?f.lam=s-nd:f.lam=s;else if(6===this.face)l=Math.acos(a),f.phi=l-nd,p.value===Uy.AREA_0?f.lam=-s+nd:p.value===Uy.AREA_1?f.lam=-s:p.value===Uy.AREA_2?f.lam=-s-nd:f.lam=s<0?-s-Ad:-s+Ad;else{var d,g,y;u=(d=a)*d,g=(u+=(y=u>=1?0:Math.sqrt(1-u)*Math.sin(s))*y)>=1?0:Math.sqrt(1-u),p.value===Uy.AREA_1?(u=g,g=-y,y=u):p.value===Uy.AREA_2?(g=-g,y=-y):p.value===Uy.AREA_3&&(u=g,g=y,y=-u),2===this.face?(u=d,d=-g,g=u):3===this.face?(d=-d,g=-g):4===this.face&&(u=d,d=g,g=-u),f.phi=Math.acos(-y)-nd,f.lam=Math.atan2(g,d),2===this.face?f.lam=Qy(f.lam,-nd):3===this.face?f.lam=Qy(f.lam,-Ad):4===this.face&&(f.lam=Qy(f.lam,+nd))}return 0!==this.es&&(h=f.phi<0?1:0,c=Math.tan(f.phi),A=this.b/Math.sqrt(c*c+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-A*A)/(this.one_minus_f*A)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var jy=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Hy=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],zy=.8487,Vy=1.3523,Ky=ud/5,qy=1/Ky,Wy=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const Xy={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Rd(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*Ky);n<0?n=0:n>=18&&(n=17);var i={x:Wy(jy[n],r=ud*(r-qy*n))*e,y:Wy(Hy[n],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*zy+this.x0,i.y=i.y*this.a*Vy+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*zy),y:Math.abs(t.y-this.y0)/(this.a*Vy)};if(e.y>=1)e.x/=jy[18][0],e.y=t.y<0?-nd:nd;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(Hy[r][0]>e.y)--r;else{if(!(Hy[r+1][0]<=e.y))break;++r}var n=Hy[r],i=5*(e.y-n[0])/(Hy[r+1][0]-n[0]);i=function(t,e,r,n){for(var i=e;n;--n){var o=t(i);if(i-=o,Math.abs(o)<r)break}return i}((function(t){return(Wy(n,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(n,t)}),i,ad,100),e.x/=Wy(jy[r],i),e.y=(5*r+i)*ld,t.y<0&&(e.y=-e.y)}return e.x=Rd(e.x+this.long0),e},names:["Robinson","robin"]},Yy={init:function(){this.name="geocent"},forward:function(t){return ng(t,this.es,this.a)},inverse:function(t){return ig(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Zy={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const Jy={init:function(){if(Object.keys(Zy).forEach(function(t){if(void 0===this[t])this[t]=Zy[t].def;else{if(Zy[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Zy[t].num&&(this[t]=parseFloat(this[t]))}Zy[t].degrees&&(this[t]=this[t]*ld)}.bind(this)),Math.abs(Math.abs(this.lat0)-nd)<ad?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<ad?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,r,n,i,o=Math.sin(t.y),s=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*o+this.cosph0*s*a;break;case 2:r=s*a;break;case 1:r=-o;break;case 0:r=o}switch(e=(r=this.pn1/(this.p-r))*s*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*o-this.sinph0*s*a;break;case 2:r*=o;break;case 0:r*=-s*a;break;case 1:r*=s*a}return i=1/((n=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*i,r=n*i,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,n,i={x:t.x,y:t.y};n=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*n,r=this.pn1*t.y*this.cw*n,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var o=$g(t.x,t.y);if(Math.abs(o)<ad)i.x=0,i.y=t.y;else{var s,a;switch(a=1-o*o*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/o+o/this.pn1),s=Math.sqrt(1-a*a),this.mode){case 3:i.y=Math.asin(s*this.sinph0+t.y*a*this.cosph0/o),t.y=(s-this.sinph0*Math.sin(i.y))*o,t.x*=a*this.cosph0;break;case 2:i.y=Math.asin(t.y*a/o),t.y=s*o,t.x*=a;break;case 0:i.y=Math.asin(s),t.y=-t.y;break;case 1:i.y=-Math.asin(s)}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t},names:["Tilted_Perspective","tpers"]},$y={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,n,i,o=t.x,s=t.y;if(o-=this.long0,"ellipse"===this.shape){s=Math.atan(this.radius_p2*Math.tan(s));var a=this.radius_p/$g(this.radius_p*Math.cos(s),Math.sin(s));if(r=a*Math.cos(o)*Math.cos(s),n=a*Math.sin(o)*Math.cos(s),i=a*Math.sin(s),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/$g(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/$g(n,e)))}else"sphere"===this.shape&&(e=Math.cos(s),r=Math.cos(o)*e,n=Math.sin(o)*e,i=Math.sin(s),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/$g(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/$g(n,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,n,i,o=-1,s=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*$g(1,a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*$g(1,s));var l=a/this.radius_p;if(e=s*s+l*l+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,s*=i,a*=i,t.x=Math.atan2(s,o),t.y=Math.atan(a*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),e=s*s+a*a+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,s*=i,a*=i,t.x=Math.atan2(s,o),t.y=Math.atan(a*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var tm;function em(){gg.defs("EPSG:2327","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2328","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2329","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2330","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2331","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2332","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2333","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2334","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2335","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2336","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2337","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2338","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2339","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2340","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2341","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2342","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2343","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2344","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2345","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2346","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2347","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2348","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2349","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2350","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2351","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2352","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2353","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2354","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2355","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2356","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2357","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2358","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2359","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2360","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2361","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2362","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2363","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2364","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2365","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2366","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2367","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2368","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2369","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2370","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2371","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2372","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2373","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2374","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2375","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2376","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2377","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2378","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2379","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2380","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2381","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2382","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2383","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2384","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2385","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2386","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2387","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2388","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2389","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2390","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2401","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2402","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2403","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2404","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2405","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2406","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2407","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2408","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2409","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2410","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2411","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2412","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2413","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2414","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2415","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2416","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2417","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2418","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2419","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2420","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2421","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2422","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2423","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2424","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2425","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2426","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2427","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2428","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2429","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2430","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2431","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2432","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2433","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2434","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2435","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2436","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2437","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2438","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2439","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2440","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2441","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2442","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21413","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21414","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21415","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21416","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21417","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21418","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21419","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21420","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21421","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21422","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21423","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:4491","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4492","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4493","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4494","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4495","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4496","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4497","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4498","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4499","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4500","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4501","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4502","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4503","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4504","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4505","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4506","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4507","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4508","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4509","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4510","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4511","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4512","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4513","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4514","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4515","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4516","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4517","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4518","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4519","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4520","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4521","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4522","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4523","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4524","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4525","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4526","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4527","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4528","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4529","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4530","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4531","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4532","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4533","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4534","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4535","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4536","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4537","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4538","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4539","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4540","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4541","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4542","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4543","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4544","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4545","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4546","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4547","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4548","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4549","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4550","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4551","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4552","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4553","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4554","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:5223","+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=500000 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:5523","+proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=1500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32601","+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32602","+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32603","+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32604","+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32605","+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32606","+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32607","+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32608","+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32609","+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32610","+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32611","+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32612","+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32613","+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32614","+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32615","+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32616","+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32617","+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32618","+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32619","+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32620","+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32621","+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32622","+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32623","+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32624","+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32625","+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32626","+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32627","+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32628","+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32629","+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32630","+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32631","+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32632","+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32633","+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32634","+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32635","+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32636","+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32637","+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32638","+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32639","+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32640","+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32641","+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32642","+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32643","+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32644","+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32645","+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32646","+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32647","+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32648","+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32649","+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32650","+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32651","+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32652","+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32653","+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32654","+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32655","+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32656","+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32657","+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32658","+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32659","+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32660","+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32701","+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32702","+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32703","+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32704","+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32705","+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32706","+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32707","+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32708","+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32709","+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32710","+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32711","+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32712","+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32713","+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32714","+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32715","+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32716","+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32717","+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32718","+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32719","+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32720","+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32721","+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32722","+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32723","+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32724","+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32725","+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32726","+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32727","+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32728","+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32729","+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32730","+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32731","+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32732","+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32733","+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32734","+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32735","+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32736","+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32737","+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32738","+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32739","+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32740","+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32741","+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32742","+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32743","+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32744","+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32745","+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32746","+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32747","+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32748","+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32749","+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32750","+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32751","+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32752","+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32753","+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32754","+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32755","+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32756","+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32757","+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32758","+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32759","+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32760","+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs")}function rm(t){var e,r,n=Object.keys(t.defs),i=n.length;for(e=0;e<i;++e){var o=n[e];if(!ir(o)){var s=t.defs(o),a=s.units;a||"longlat"!==s.projName||(a=et.DEGREES),nr(new se({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:a}))}}for(e=0;e<i;++e){var l=n[e],u=ir(l);for(r=0;r<i;++r){var h=n[r],c=ir(h);if(!ke(l,h))if(t.defs[l]===t.defs[h])sr([u,c]);else{var A=t(l,h);ur(u,c,Sr(u,c,A.forward),Sr(c,u,A.inverse))}}}}gg.defaultDatum="WGS84",gg.Proj=rg,gg.WGS84=new gg.Proj("WGS84"),gg.Point=Og,gg.toPoint=hg,gg.defs=Fd,gg.nadgrid=function(t,e){var r=new DataView(e),n=function(t){var e=t.getInt32(8,!1);return 11!==e&&(e=t.getInt32(8,!0),!0)}(r),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Jd(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,n);i.nSubgrids;var o=function(t,e,r){for(var n=[],i=0;i<e.nSubgrids;i++){var o=tg(t,176,r),s=eg(t,176,o,r),a=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),l=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);n.push({ll:[Zd(o.lowerLongitude),Zd(o.lowerLatitude)],del:[Zd(o.longitudeInterval),Zd(o.latitudeInterval)],lim:[a,l],count:o.gridNodeCount,cvs:$d(s)})}return n}(r,i,n),s={header:i,subgrids:o};return Xd[t]=s,s},gg.transform=Ag,gg.mgrs=Cg,gg.version="__VERSION__",(tm=gg).Proj.projections.add(Zg),tm.Proj.projections.add(ry),tm.Proj.projections.add(ny),tm.Proj.projections.add(sy),tm.Proj.projections.add(ay),tm.Proj.projections.add(ly),tm.Proj.projections.add(hy),tm.Proj.projections.add(cy),tm.Proj.projections.add(Ay),tm.Proj.projections.add(wy),tm.Proj.projections.add(xy),tm.Proj.projections.add(Cy),tm.Proj.projections.add(Sy),tm.Proj.projections.add(By),tm.Proj.projections.add(Iy),tm.Proj.projections.add(Ty),tm.Proj.projections.add(Py),tm.Proj.projections.add(Fy),tm.Proj.projections.add(Ly),tm.Proj.projections.add(My),tm.Proj.projections.add(Oy),tm.Proj.projections.add(ky),tm.Proj.projections.add(Ny),tm.Proj.projections.add(Ry),tm.Proj.projections.add(Gy),tm.Proj.projections.add(Xy),tm.Proj.projections.add(Yy),tm.Proj.projections.add(Jy),tm.Proj.projections.add($y);class nm{constructor(){e(this,"handlers"),this.handlers={}}_on(t,e){return this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(e),this}off(t,e){let r=this.handlers[t];for(let n=0;n<r.length;n++)if(r[n]===e){r.splice(n,1);break}return this}onec(t,e,r){let n=this;return this._on(t,(function i(){n.off(t,i),e.apply(r||n,arguments)})),this}trigger(t,e){this.handlers.hasOwnProperty(t)&&this.handlers[t].forEach((t=>{t.call(this,e)}))}}class im extends nm{constructor(){super(),em(),rm(gg)}getJSON(t){const e=new XMLHttpRequest;return e.open("get",t,!1),e.setRequestHeader("content-type","application/json"),e.send(),JSON.parse(e.response)}getFile(t,e){const r=new XMLHttpRequest;return r.open("get",t,!1),r.setRequestHeader("content-type",e),r.send(),r.response}ConvertCoordinatesTo3857(t,e){return gg("EPSG:"+t,"EPSG:3857",e)}ConvertCoordinatesTo4326(t,e){return gg("EPSG:"+t,"EPSG:4326",e)}formatJsonTo3857(t){let e;return e=t.crs?"EPSG:3857"===t.crs.properties.name?(new Df).readFeatures(t):"EPSG:4326"===t.crs.properties.name?(new Df).readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}):(new Df).readFeatures(t,{dataProjection:t.crs.properties.name,featureProjection:"EPSG:3857"}):(new Df).readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}),e}formatJsonTo4326Json(t){let e,r=new Df;return e=t.crs?"EPSG:4326"===t.crs.properties.name?r.readFeatures(t):"EPSG:3857"===t.crs.properties.name?r.readFeatures(t,{dataProjection:"EPSG:3857",featureProjection:"EPSG:4326"}):r.readFeatures(t,{dataProjection:t.crs.properties.name,featureProjection:"EPSG:4326"}):r.readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:4326"}),r.writeFeaturesObject(e)}formatJsonToPoint(t){let e=this.formatJsonTo3857(t),r=[];return e.forEach((t=>{switch(t.getGeometry().getType()){case"Polygon":r.push(new X({geometry:t.getGeometry().getInteriorPoint(),properties:t.getProperties().properties}));break;case"Point":r.push(t)}})),r}colorRgba(t,e){let r=t.toLowerCase();if(r&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(r)){if(4===r.length){let t="#";for(let e=1;e<4;e+=1)t+=r.slice(e,e+1).concat(r.slice(e,e+1));r=t}let t=[];for(let e=1;e<7;e+=2)t.push(parseInt("0x"+r.slice(e,e+2)));return"rgba("+t.join(",")+","+e+")"}return r}}const om="ol-ctx-menu",sm={namespace:om,container:`${om}-container`,separator:`${om}-separator`,submenu:`${om}-submenu`,hidden:`${om}-hidden`,icon:`${om}-icon`,zoomIn:`${om}-zoom-in`,zoomOut:`${om}-zoom-out`,unselectable:"ol-unselectable"},am=sm,lm="contextmenu",um={width:150,scrollAt:4,eventType:lm,defaultItems:!0},hm=[{text:"放大",classname:`${sm.zoomIn} ${sm.icon}`,callback:(t,e)=>{const r=e.getView();r.animate({zoom:+r.getZoom()+1,duration:700,center:t.coordinate})}},{text:"缩小",classname:`${sm.zoomOut} ${sm.icon}`,callback:(t,e)=>{const r=e.getView();r.animate({zoom:+r.getZoom()-1,duration:700,center:t.coordinate})}}];function cm(t,e="Assertion failed"){if(!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}function Am(t){return/^\d+$/.test(t)}function fm(t,e,r){if(Array.isArray(t))return void t.forEach((t=>fm(t,e)));const n=Array.isArray(e)?e:e.split(/\s+/);let i=n.length;for(;i--;)dm(t,n[i])||_m(t,n[i],r)}function pm(t,e,r){if(Array.isArray(t))return void t.forEach((t=>pm(t,e,r)));const n=Array.isArray(e)?e:e.split(/\s+/);let i=n.length;for(;i--;)dm(t,n[i])&&wm(t,n[i],r)}function dm(t,e){return t.classList?t.classList.contains(e):vm(e).test(t.className)}function gm(t,e=window.document,r){let n=/\./g,i=Array.prototype.slice,o=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":o=[ym(t.substr(1))];break;case".":o=i.call(e.getElementsByClassName(t.substr(1).replace(n," ")));break;default:o=i.call(e.getElementsByTagName(t))}else o=i.call(e.querySelectorAll(t));return r?o:o[0]}function ym(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)}function mm(t){let e=document.createDocumentFragment(),r=document.createElement("div");for(r.innerHTML=t;r.firstChild;)e.appendChild(r.firstChild);return e}function vm(t){return new RegExp(`(^|\\s+) ${t} (\\s+|$)`)}function _m(t,e,r){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),r&&Am(r)&&window.setTimeout((()=>wm(t,e)),r)}function wm(t,e,r){t.classList?t.classList.remove(e):t.className=t.className.replace(vm(e)," ").trim(),r&&Am(r)&&window.setTimeout((()=>_m(t,e)),r)}class bm{constructor(t,e){return this.Base=t,this.Base.container=this.container=e,this}createContainer(t){const e=document.createElement("div"),r=document.createElement("ul"),n=[am.container,am.unselectable];return t&&n.push(am.hidden),e.className=n.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(r),e}createMenu(){let t=[];if("items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(hm):this.Base.options.items:this.Base.options.defaultItems&&(t=hm),0===t.length)return!1;t.forEach(this.addMenuEntry,this)}addMenuEntry(t){if(t.items&&Array.isArray(t.items)){t.classname=t.classname||"",e=am.submenu,~t.classname.indexOf(e)||(t.classname=t.classname.length?" "+am.submenu:am.submenu);let r=this.generateHtmlAndPublish(this.container,t),n=this.createContainer();n.style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,r.appendChild(n),t.items.forEach((t=>{this.generateHtmlAndPublish(n,t,!0)}))}else this.generateHtmlAndPublish(this.container,t);var e}generateHtmlAndPublish(t,e,r){const n="_"+Math.random().toString(36).substr(2,9);let i,o,s,a=!1;return"string"==typeof e&&"-"===e.trim()?(i=`<li id="${n}" class="${am.separator}"><hr></li>`,o=mm(i),s=[].slice.call(o.childNodes,0)[0],t.firstChild.appendChild(o),a=!0):(e.classname=e.classname||"",i=`<span>${e.text}</span>`,o=mm(i),s=document.createElement("li"),e.icon&&(""===e.classname?e.classname=am.icon:-1===e.classname.indexOf(am.icon)&&(e.classname+=` ${am.icon}`),s.setAttribute("style",`background-image:url(${e.icon})`)),s.id=n,s.className=e.classname,s.appendChild(o),t.firstChild.appendChild(s)),this.Base.Internal.items[n]={id:n,submenu:r||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(s,n),s}removeMenuEntry(t){const e=gm("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]}cloneAndGetLineHeight(){const t=this.container.cloneNode(),e=mm("<span>Foo</span>"),r=mm("<span>Foo</span>"),n=document.createElement("li"),i=document.createElement("li");n.appendChild(e),i.appendChild(r),t.appendChild(n),t.appendChild(i),this.container.parentNode.appendChild(t);const o=t.offsetHeight/2;return this.container.parentNode.removeChild(t),o}}class xm extends Bl{constructor(t={}){cm("object"==typeof t,"@param `opt_options` should be object type!");const e=document.createElement("div"),r=document.createElement("ul"),n=[am.container,am.unselectable];n.push(am.hidden),e.className=n.join(" "),e.style.width=parseInt(t.width,10)+"px",e.appendChild(r),super({element:e}),this.container=e,this.options=function(t,e){let r={};for(let n in t)r[n]=t[n];for(let n in e)r[n]=e[n];return r}(um,t),this.disabled=!1,this.Internal=new class{constructor(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this.eventMapMoveHandler=this.handleMapMoveEvent.bind(this),this}init(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=this.getItemsLength()>0?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()}getItemsLength(){let t=0;return Object.keys(this.items).forEach((e=>{this.items[e].submenu||this.items[e].separator||t++})),t}getPixelClicked(){return this.pixelClicked}getCoordinateClicked(){return this.coordinateClicked}positionContainer(t){const e=this.Base.container,r=this.map.getSize(),n=r[1]-t[1],i=r[0]-t[0],o=e.offsetWidth,s=Math.round(this.lineHeight*this.getItemsLength()),a=gm(`li.${am.submenu}>div`,e,!0);i>=o?(e.style.right="auto",e.style.left=`${t[0]+5}px`):(e.style.left="auto",e.style.right="15px"),n>=s?(e.style.bottom="auto",e.style.top=t[1]-10+"px"):(e.style.top="auto",e.style.bottom=0),pm(e,am.hidden),a.length&&(this.submenu.lastLeft=i<2*o?`-${o}px`:this.submenu.left,a.forEach((t=>{window.innerWidth||document.documentElement.clientWidth;const e=window.innerHeight||document.documentElement.clientHeight,r=function(t){const e=t.getBoundingClientRect(),r=document.documentElement;return{left:e.left+window.pageXOffset-r.clientLeft,top:e.top+window.pageYOffset-r.clientTop,width:t.offsetWidth,height:t.offsetHeight}}(t),i=r.height;let o=n-i;o<0&&(o=i-(e-r.top),t.style.top=`-${o}px`),t.style.left=this.submenu.lastLeft})))}openMenu(t,e){this.Base.dispatchEvent({type:"open",pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)}closeMenu(){this.opened=!1,fm(this.Base.container,am.hidden),this.Base.dispatchEvent({type:"close"})}setListeners(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.on("movestart",this.eventMapMoveHandler)}removeListeners(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.un("movestart",this.eventMapMoveHandler)}handleEvent(t){const e=this;this.coordinateClicked=this.map.getEventCoordinate(t),this.pixelClicked=this.map.getEventPixel(t),this.Base.dispatchEvent({type:"beforeopen",pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===lm&&(t.stopPropagation(),t.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),t.target.addEventListener("pointerdown",{handleEvent:function(r){e.opened&&(e.closeMenu(),r.stopPropagation(),t.target.removeEventListener(r.type,this,!1))}},!1))}handleMapMoveEvent(t){this.closeMenu()}setItemListener(t,e){const r=this;var n;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",(function(t){t.preventDefault();const i={coordinate:r.getCoordinateClicked(),data:r.items[e].data||null};r.closeMenu(),n(i,r.map)}),!1))}}(this),this.Html=new bm(this,e),this.element=this.container}clear(){Object.keys(this.Internal.items).forEach(this.Html.removeMenuEntry,this.Html)}close(){this.Internal.closeMenu()}enable(){this.disabled=!1}disable(){this.disabled=!0}getDefaultItems(){return hm}countItems(){return Object.keys(this.Internal.items).length}extend(t){cm(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)}isOpen(){return this.Internal.opened}updatePosition(t){cm(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)}pop(){const t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])}push(t){cm(null!=t,"@param `item` must be informed."),this.Html.addMenuEntry(t)}shift(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])}setMap(t){Bl.prototype.setMap.call(this,t),t?this.Internal.init(t,this):this.Internal.removeListeners()}}var Em=(t=>(t.onLoadStart="onLoadStart",t.onLoadError="onLoadError",t.onLoadEnd="onLoadEnd",t.onChange="change",t.onClick="click",t.onFeatureSelected="featureSelected",t.onFeatureContextmenu="FeatureContextmenu",t.onFeatureMousemove="mousemove",t.onFeatureMouseout="mouseout",t.onFeaturesLoad="onFeaturesLoad",t.onFeaturePopupOpen="popupopen",t.onFeaturePopupClose="popupclose",t.onFeatureTooltipOpen="tooltipopen",t.onFeatureTooltiClose="toolticlose",t.onFeatureMoved="featureMoved",t.onFeatureDeleted="featureDeleted",t.onDrawStart="onDrawStart",t.onDrawEnd="onDrawEnd",t.onFeatureMoveProgress="onFeatureMoveProgress",t.onEditStart="onEditStart",t.onEditEnd="onEditEnd",t.onEditModifyStart="onEditModifyStart",t.onEditModifyEnd="onEditModifyEnd",t.onPathAnimateStart="onPathAnimateStart",t.onPathAnimateEnd="onPathAnimateEnd",t.onPathAnimateRunning="onPathAnimateRunning",t.onPathComputerComplete="onPathComputerComplete",t.onScaleChange="onScaleChange",t.onChangePosition="onChangePosition",t))(Em||{}),Cm=(t=>(t.onMapContextmenu="MapContextmenu",t.onClick="click",t.onMapMove="onMapMove",t.onMapMoveEnd="onMapMoveEnd",t.onZoomChange="onZoomChange",t.onCenterChange="onCenterChange",t.onRemoveLayer="onRemoveLayer",t.onChangeBaseLayer="onChangeBaseLayer",t))(Cm||{}),Sm=(t=>(t.tileloadstart="tileloadstart",t.tileloadend="tileloadend",t.tileloaderror="tileloaderror",t))(Sm||{});const Bm=Object.freeze(Object.defineProperty({__proto__:null,LayerEventType:Sm,XMapEventType:Cm,featureType:Em},Symbol.toStringTag,{value:"Module"}));class Im extends im{constructor(t,r){super(),e(this,"_map"),e(this,"contextmenuitems"),e(this,"contextmenu"),e(this,"EventType"),e(this,"layerid"),e(this,"layertype"),e(this,"layerSource"),e(this,"layer"),e(this,"layerclass"),e(this,"_isShow"),e(this,"_isAdded"),e(this,"option"),this.layerid=t,this.layerclass="",this._isAdded=!1,this._map=null,this.contextmenuitems=[],this.contextmenu=null,this.EventType=Bm,this.option=Object.assign({},{radio:!1},r)}initContextmenu(t){if(this.contextmenu=new xm({id:"contextmenu",width:150,defaultItems:!1,items:this.contextmenuitems}),this.contextmenu&&(this.contextmenu.set("id","contextmenu"),this._map)){this._map.addControl(this.contextmenu);let t=this;this.contextmenu.on("beforeopen",(function(e){if(t._map){let r=t._map.forEachFeatureAtPixel(e.pixel,(function(t,e){return t}));t.contextmenu.clear(),r?void 0===r.get("featuretype")||r.get("featuretype"):t.contextmenuitems.forEach((t=>{t.data={e:e}}))}})),this.contextmenu.on("open",(function(e){if(t._map){let r=t._map.forEachFeatureAtPixel(e.pixel,(function(t,e){return{feature:t,layer:e}}));r.feature?t.trigger(t.EventType.featureType.onFeatureContextmenu,{feature:r.feature,layer:r.layer,contextmenu:t.contextmenu}):t.trigger(t.EventType.XMapEventType.onMapContextmenu,null)}}))}}flyto(t){this.layer.getExtent()&&this._map.getView().fit(this.layer.getExtent(),t)}setZIndex(t){this.layer.setZIndex(t)}set show(t){this.layer.setVisible(t)}get show(){return this.layer.getVisible()}set isAdded(t){this._isAdded=t}get isAdded(){return this._isAdded}}var Tm=(t=>(t.vector="矢量图层",t.tag="标注图层",t.temp="临时图层",t.Measure="量测图层",t))(Tm||{}),Pm=(t=>(t.Point="Point",t.Line="LineString",t.Polygon="Polygon",t.MultiPolygon="MultiPolygon",t.Rectangle="Rectangle",t.Circle="Circle",t.GeometryCollection="GeometryCollection",t))(Pm||{}),Fm=(t=>(t.xyz="xyz",t.arcgisMapServer="arcgisMapServer",t.arcgisMapTile="arcgisMapTile",t.imageLayer="imageLayer",t.TileGroupLayer="TileGroupLayer",t.WmsLayer="WmsLayer",t.WmsTileLayer="WmsTileLayer",t.tencent="tencent",t.baidu="baidu",t.group="group",t))(Fm||{}),Lm=(t=>(t.EPSG3857="3857",t.EPSG4326="4326",t.EPSG4490="4490",t.IMAGE="IMAGE",t.PGIS="PGIS",t.BAIDU="BAIDU",t.GCJ02="GCJ02",t.CGCS2000_GK_Zone_3="CGCS2000_GK_Zone_3",t.CGCS2000_GK_Zone_6="CGCS2000_GK_Zone_6",t.CGCS2000_GK_CM_3_75="EPSG:4534",t.CGCS2000_GK_CM_3_78="EPSG:4535",t.CGCS2000_GK_CM_3_81="EPSG:4536",t.CGCS2000_GK_CM_3_84="EPSG:4537",t.CGCS2000_GK_CM_3_87="EPSG:4538",t.CGCS2000_GK_CM_3_90="EPSG:4539",t.CGCS2000_GK_CM_3_93="EPSG:4540",t.CGCS2000_GK_CM_3_96="EPSG:4541",t.CGCS2000_GK_CM_3_99="EPSG:4542",t.CGCS2000_GK_CM_3_102="EPSG:4543",t.CGCS2000_GK_CM_3_105="EPSG:4544",t.CGCS2000_GK_CM_3_108="EPSG:4545",t.CGCS2000_GK_CM_3_111="EPSG:4546",t.CGCS2000_GK_CM_3_114="EPSG:4547",t.CGCS2000_GK_CM_3_117="EPSG:4548",t.CGCS2000_GK_CM_3_120="EPSG:4549",t.CGCS2000_GK_CM_3_123="EPSG:4550",t.CGCS2000_GK_CM_3_126="EPSG:4551",t.CGCS2000_GK_CM_3_129="EPSG:4552",t.CGCS2000_GK_CM_3_132="EPSG:4553",t.CGCS2000_GK_CM_3_135="EPSG:4554",t.CGCS2000_GK_CM_6="CGCS2000_GK_CM_6",t.other="other",t))(Lm||{}),Mm=(t=>(t.point="point",t.hex="hex",t.square="square",t.triangle="triangle",t))(Mm||{}),Om=(t=>(t.voronoi="voronoi",t.tin="tin",t.convex="convex",t))(Om||{}),km=(t=>(t.Bounce="Bounce",t.Blink="Blink",t.Drop="Drop",t.Fade="Fade",t.Path="Path",t.Shake="Shake",t.Show="Show",t.Slide="Slide",t.Throw="Throw",t.Zoom="Zoom",t.Teleport="Teleport",t.ZoomOut="ZoomOut",t))(km||{}),Nm=(t=>(t.grayscale="grayscale",t.invert="invert",t.sepia="sepia",t.color="color",t.difference="difference",t["color-dodge"]="color-dodge",t.hue="hue",t.saturation="saturation",t.luminosity="luminosity",t.enhance="enhance",t.contrast="contrast",t))(Nm||{}),Rm=(t=>(t.emboss="emboss",t.erode="erode",t.blur="blur",t.brightness="brightness",t.contrast="contrast",t.grayscale="grayscale",t.sepia="sepia",t.hueRotate="hueRotate",t.invert="invert",t.saturate="saturate",t.paper="paper",t))(Rm||{}),Um=(t=>(t.intensity="intensity",t.color="color",t.blur="blur",t))(Um||{}),Dm=(t=>(t.hatch="hatch",t.cross="cross",t.dot="dot",t.circle="circle",t.square="square",t.tile="tile",t.woven="woven",t.crosses="crosses",t.caps="caps",t.nylon="nylon",t.hexagon="hexagon",t.cemetry="cemetry",t.sand="sand",t.conglomerate="conglomerate",t.conglomerate2="conglomerate2",t.gravel="gravel",t.brick="brick",t.dolomite="dolomite",t.coal="coal",t.breccia="breccia",t.clay="clay",t.flooded="flooded",t.chaos="chaos",t.grass="grass",t.swamp="swamp",t.reed="reed",t.wave="wave",t.vine="vine",t.forest="forest",t.forest2="forest2",t.scrub="scrub",t.tree="tree",t.tree2="tree2",t.pine="pine",t.pine2="pine2",t.mixtree="mixtree",t.mixtree2="mixtree2",t.pines="pines",t.rock="rock",t.rocks="rocks",t))(Dm||{}),Qm=(t=>(t[t.gaode_poi_text=1]="gaode_poi_text",t[t.gaode_poi_around=0]="gaode_poi_around",t[t.gaode_poi_polygon=2]="gaode_poi_polygon",t[t.gaode_route_driving=0]="gaode_route_driving",t[t.gaode_route_walking=1]="gaode_route_walking",t[t.gaode_route_integrated=2]="gaode_route_integrated",t))(Qm||{}),Gm=(t=>(t.bottomleft="bottom-left",t.bottomcenter="bottom-center",t.bottomright="bottom-right",t.centerleft="center-left",t.center="center-center",t.centerright="center-right",t.topleft="top-left",t.topcenter="top-center",t.topright="top-right",t))(Gm||{});const jm=Object.freeze(Object.defineProperty({__proto__:null,CanvasFilterType:Rm,ColorizeFilterType:Nm,PencilSketchFilterType:Um,QueryType:Qm,crsType:Lm,datagridType:Mm,drawtype:Pm,featureAnimationType:km,featureStyleType:Dm,featuretype:Tm,layertype:Fm,pointToPolygonType:Om,positioning:Gm},Symbol.toStringTag,{value:"Module"}));var Hm,zm,Vm={},Km={get exports(){return Vm},set exports(t){Vm=t}};
|
|
3
|
+
read:function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=r?i-1:0,A=r?-1:1,f=t[e+c];for(c+=A,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=A,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=A,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,A=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?A/l:A*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+f]=255&s,f+=p,s/=256,u-=8);t[r+f-p]|=128*d}},nA=oA,iA=rA;function oA(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}oA.Varint=0,oA.Fixed64=1,oA.Bytes=2,oA.Fixed32=5;var sA=4294967296,aA=1/sA,lA="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function uA(t){return t.type===oA.Bytes?t.readVarint()+t.pos:t.pos+1}function hA(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function cA(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function AA(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function fA(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function pA(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function dA(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function gA(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function yA(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function mA(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function vA(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function _A(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function wA(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function bA(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function xA(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}oA.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=wA(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=xA(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=wA(this.buf,this.pos)+wA(this.buf,this.pos+4)*sA;return this.pos+=8,t},readSFixed64:function(){var t=wA(this.buf,this.pos)+xA(this.buf,this.pos+4)*sA;return this.pos+=8,t},readFloat:function(){var t=iA.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=iA.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return hA(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return hA(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return hA(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&lA?function(t,e,r){return lA.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==oA.Bytes)return t.push(this.readVarint(e));var r=uA(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==oA.Bytes)return t.push(this.readSVarint());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==oA.Bytes)return t.push(this.readBoolean());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==oA.Bytes)return t.push(this.readFloat());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==oA.Bytes)return t.push(this.readDouble());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==oA.Bytes)return t.push(this.readFixed32());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==oA.Bytes)return t.push(this.readSFixed32());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==oA.Bytes)return t.push(this.readFixed64());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==oA.Bytes)return t.push(this.readSFixed64());var e=uA(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===oA.Varint)for(;this.buf[this.pos++]>127;);else if(e===oA.Bytes)this.pos=this.readVarint()+this.pos;else if(e===oA.Fixed32)this.pos+=4;else{if(e!==oA.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),bA(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),bA(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),bA(this.buf,-1&t,this.pos),bA(this.buf,Math.floor(t*aA),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),bA(this.buf,-1&t,this.pos),bA(this.buf,Math.floor(t*aA),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&cA(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),iA.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),iA.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&cA(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,oA.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,AA,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,fA,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,gA,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pA,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dA,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,yA,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,mA,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,vA,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_A,e)},writeBytesField:function(t,e){this.writeTag(t,oA.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,oA.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,oA.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,oA.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,oA.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,oA.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,oA.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,oA.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,oA.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,oA.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var EA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function CA(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}const SA=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return EA(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(L),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(P(this.geometries_[t],T.CHANGE,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<Bt(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,s=i.length;o<s;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){Mt(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)Rt(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return CA(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,s=n.length;o<s;++o){var a=n[o],l=a.getSimplifiedGeometry(t);r.push(l),l!==a&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return"GeometryCollection"},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=Vt(this.getExtent()));for(var i=this.geometries_,o=0,s=i.length;o<s;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(CA(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Mr);var BA=[1,0,0,1,0,0],IA=function(){function t(t,e,r,n,i){this.styleFunction,this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_="Point"===this.type_?Ot(this.flatCoordinates_):kt(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Vt(this.getExtent());this.flatInteriorPoints_=un(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ih(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=hn(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Ln(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],s=Ln(t,e,o,2,.5);y(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=ir(t)).getExtent(),r=t.getWorldExtent();if(e&&r){var n=Xt(r)/Xt(e);_t(BA,r[0],r[3],n,-n,0,0,0),Br(this.flatCoordinates_,0,this.flatCoordinates_.length,2,BA,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();function TA(t,e){var r=t.getId(),n=function(t){var e=t.getType();switch(e){case"Point":return new on(t.getFlatCoordinates());case"MultiPoint":return new nh(t.getFlatCoordinates(),Y.XY);case"LineString":return new Nn(t.getFlatCoordinates(),Y.XY);case"MultiLineString":return new th(t.getFlatCoordinates(),Y.XY,t.getEnds());case"Polygon":var r=t.getFlatCoordinates(),n=t.getEnds(),i=_n(r,n);return i.length>1?new ah(r,Y.XY,i):new xn(r,Y.XY,n);default:throw new Error("Invalid geometry type:"+e)}}(t),i=t.getProperties(),o=new X;return void 0!==e&&o.setGeometryName(e),o.setGeometry(n),void 0!==r&&o.setId(r),o.setProperties(i,!0),o}IA.prototype.getEndss=IA.prototype.getEnds,IA.prototype.getFlatCoordinates=IA.prototype.getOrientedFlatCoordinates;const PA=IA;var FA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),LA=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new se({code:"",units:et.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:PA,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return FA(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<i;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),r.push(a,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):K(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var r;return 1===t?r=1===e?"Point":"MultiPoint":2===t?r=1===e?"LineString":"MultiLineString":3===t&&(r="Polygon"),r}(i,l.length);if(this.featureClass_===PA)(n=new this.featureClass_(u,a,l,s,o)).transform(r.dataProjection);else{var h=void 0;if("Polygon"==u){var c=_n(a,l);h=c.length>1?new ah(a,Y.XY,c):new xn(a,Y.XY,l)}else h="Point"===u?new on(a,Y.XY):"LineString"===u?new Nn(a,Y.XY):"MultiPoint"===u?new nh(a,Y.XY):"MultiLineString"===u?new th(a,Y.XY,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var A=$c(h,!1,r);n.setGeometry(A),void 0!==o&&n.setId(o),n.setProperties(s,!0)}return n},e.prototype.getType=function(){return"arraybuffer"},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=ir(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new nA(t),s=o.readFields(MA,{}),a=[];for(var l in s)if(!r||-1!=r.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;i.setExtent(h);for(var c=0,A=u.length;c<A;++c){var f=NA(o,u,c),p=this.createFeature_(o,f,n);null!==p&&a.push(p)}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Jc);function MA(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(OA,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function OA(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1==(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function kA(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function NA(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(kA,i,n),i}const RA=LA;var UA=10,DA=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=pr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&$t(n)==$t(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?$t(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?$t(this.targetProj_.getExtent()):null;var l=Zt(r),u=Jt(r),h=zt(r),c=Ht(r),A=this.transformInv_(l),f=this.transformInv_(u),p=this.transformInv_(h),d=this.transformInv_(c),g=UA+(o?Math.max(0,Math.ceil(ue(jt(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,A,f,p,d,g),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,r){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,s,a,l){var u=Et([i,o,s,a]),h=this.sourceWorldWidth_?$t(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,A=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(f=$t(Et([t,e,r,n]))/this.targetWorldWidth_>.25||f),!A&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)),!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||te(u,this.maxSourceExtent_)){var p=0;if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(p=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=p&&4!=p&&8!=p)return;if(l>0){if(!f){var d,g=[(t[0]+r[0])/2,(t[1]+r[1])/2],y=this.transformInv_(g);d=A?(fe(i[0],c)+fe(s[0],c))/2-fe(y[0],c):(i[0]+s[0])/2-y[0];var m=(i[1]+s[1])/2-y[1];f=d*d+m*m>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var v=[(e[0]+r[0])/2,(e[1]+r[1])/2],_=this.transformInv_(v),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,v,w,i,o,_,b,l-1),this.addQuad_(w,v,r,n,b,_,s,a,l-1)}else{var x=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(x),C=[(r[0]+n[0])/2,(r[1]+n[1])/2],S=this.transformInv_(C);this.addQuad_(t,x,C,n,i,E,S,a,l-1),this.addQuad_(x,e,r,C,E,o,s,S,l-1)}return}}if(A){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&p)&&this.addTriangle_(t,r,n,i,s,a),0==(14&p)&&this.addTriangle_(t,r,e,i,s,o),p&&(0==(13&p)&&this.addTriangle_(e,n,t,o,a,i),0==(7&p)&&this.addTriangle_(e,n,r,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;Ut(t,i[0]),Ut(t,i[1]),Ut(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();const QA=DA;var GA,jA=[];function HA(t,e,r,n,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(n,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(r,i)),t.restore()}function zA(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function VA(t,e,r,n){var i=dr(r,e,t),o=or(e,n,r),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||It(l,i)){var u=or(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function KA(t,e,r,n,i,o,s,a,l,u,h,c){var A=ei(Math.round(r*t),Math.round(r*e),jA);if(c||b(A,Kc),0===l.length)return A.canvas;function f(t){return Math.round(t*r)/r}A.scale(r,r),A.globalCompositeOperation="lighter";var p=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){Rt(p,t.extent)}));var d=$t(p),g=Xt(p),y=ei(Math.round(r*d/n),Math.round(r*g/n));c||b(y,Kc);var m=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-p[0],i=-(t.extent[3]-p[3]),o=$t(t.extent),s=Xt(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*m,i*m,o*m,s*m)}));var v=Zt(s);return a.getTriangles().forEach((function(t,e,i){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],d=s[1][1],g=s[2][0],m=s[2][1],_=f((a[0][0]-v[0])/o),w=f(-(a[0][1]-v[1])/o),b=f((a[1][0]-v[0])/o),x=f(-(a[1][1]-v[1])/o),E=f((a[2][0]-v[0])/o),C=f(-(a[2][1]-v[1])/o),S=l,B=u;l=0,u=0;var I=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var s=Math.abs(t[o][r]);s>i&&(i=s,n=o)}if(0===i)return null;var a=t[n];t[n]=t[r],t[r]=a;for(var l=r+1;l<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][h]}for(var c=new Array(e),A=e-1;A>=0;A--){c[A]=t[A][e]/t[A][A];for(var f=A-1;f>=0;f--)t[f][e]-=t[f][A]*c[A]}return c}([[h-=S,d-=B,0,0,b-_],[g-=S,m-=B,0,0,E-_],[0,0,h,d,x-w],[0,0,g,m,C-w]]);if(I){if(A.save(),A.beginPath(),function(){if(void 0===GA){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",HA(t,4,5,4,0),HA(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;GA=zA(e,0)||zA(e,4)||zA(e,8)}return GA}()||!c){A.moveTo(b,x);for(var T=_-b,P=w-x,F=0;F<4;F++)A.lineTo(b+f((F+1)*T/4),x+f(F*P/3)),3!=F&&A.lineTo(b+f((F+1)*T/4),x+f((F+1)*P/3));A.lineTo(E,C)}else A.moveTo(b,x),A.lineTo(_,w),A.lineTo(E,C);A.clip(),A.transform(I[0],I[2],I[1],I[3],_,w),A.translate(p[0]-S,p[3]-B),A.scale(n/r,-n/r),A.drawImage(y.canvas,0,0),A.restore()}})),h&&(A.save(),A.globalCompositeOperation="source-over",A.strokeStyle="black",A.lineWidth=1,a.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-v[0])/o,s=-(n[0][1]-v[1])/o,a=(n[1][0]-v[0])/o,l=-(n[1][1]-v[1])/o,u=(n[2][0]-v[0])/o,h=-(n[2][1]-v[1])/o;A.beginPath(),A.moveTo(a,l),A.lineTo(i,s),A.lineTo(u,h),A.closePath(),A.stroke()})),A.restore()),A.canvas}var qA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const WA=function(t){function e(e,r,n,i,o,s,a,l,u,h,c,A){var f=t.call(this,o,ya.IDLE,{interpolate:!!A})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=r,f.targetTileGrid_=i,f.wrappedTileCoord_=s||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var p=i.getTileCoordExtent(f.wrappedTileCoord_),d=f.targetTileGrid_.getExtent(),g=f.sourceTileGrid_.getExtent(),y=d?Yt(p,d):p;if(0===jt(y))return f.state=ya.EMPTY,f;var m=e.getExtent();m&&(g=g?Yt(g,m):m);var v=i.getResolution(f.wrappedTileCoord_[0]),_=function(t,e,r,n){var i=Vt(r),o=VA(t,e,i,n);return(!isFinite(o)||o<=0)&&Gt(r,(function(r){return o=VA(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,y,v);if(!isFinite(_)||_<=0)return f.state=ya.EMPTY,f;var w=void 0!==h?h:Vc;if(f.triangulation_=new QA(e,n,y,g,_*w,v),0===f.triangulation_.getTriangles().length)return f.state=ya.EMPTY,f;f.sourceZ_=r.getZForResolution(_);var b=f.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(b[1]=ae(b[1],g[1],g[3]),b[3]=ae(b[3],g[1],g[3])):b=Yt(b,g)),jt(b)){for(var x=r.getTileRangeForExtentAndZ(b,f.sourceZ_),E=x.minX;E<=x.maxX;E++)for(var C=x.minY;C<=x.maxY;C++){var S=u(f.sourceZ_,E,C,a);S&&f.sourceTiles_.push(S)}0===f.sourceTiles_.length&&(f.state=ya.EMPTY)}else f.state=ya.EMPTY;return f}return qA(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==ya.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=ya.ERROR;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=KA(n,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=ya.LOADED}this.changed()},e.prototype.load=function(){if(this.state==ya.IDLE){this.state=ya.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==ya.IDLE||i==ya.LOADING){t++;var o=P(e,T.CHANGE,(function(r){var n=e.getState();n!=ya.LOADED&&n!=ya.ERROR&&n!=ya.EMPTY||(L(o),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,r){t.getState()==ya.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(L),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(ri(this.canvas_.getContext("2d")),jA.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(Ea);var XA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const YA=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Jh(0,0,0,0),r}return XA(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ya.LOADED||r==ya.EMPTY||r==ya.ERROR&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,r,i,o);return a.getState()==ya.ERROR&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(ya.LOADED)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=gt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!It(i,n))return null;for(var o=e.pixelRatio,s=e.viewState.projection,a=e.viewState,l=r.getRenderSource(),u=l.getTileGridForProjection(a.projection),h=l.getTilePixelRatio(e.pixelRatio),c=u.getZForResolution(a.resolution);c>=u.getMinZoom();--c){var A=u.getTileCoordForCoordAndZ(n,c),f=l.getTile(c,A[1],A[2],o,s);if(!(f instanceof Sa||f instanceof WA))return null;if(f.getState()===ya.LOADED){var p=u.getOrigin(c),d=jn(u.getTileSize(c)),g=u.getResolution(c),y=Math.floor(h*((n[0]-p[0])/g-A[1]*d[0])),m=Math.floor(h*((p[1]-n[1])/g-A[2]*d[1])),v=Math.round(h*l.getGutterForProjection(a.projection));return this.getImageData(f.getImage(),y+v,m+v)}}return null},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],n=t.viewState,i=n.projection,s=n.resolution,a=n.center,l=n.rotation,u=t.pixelRatio,h=this.getLayer(),c=h.getSource(),A=c.getRevision(),p=c.getTileGridForProjection(i),d=p.getZForResolution(s,c.zDirection),g=p.getResolution(d),y=t.extent,m=t.viewState.resolution,v=c.getTilePixelRatio(u),_=Math.round($t(y)/m*u),w=Math.round(Xt(y)/m*u),x=r.extent&&Cr(r.extent);x&&(y=Yt(y,Cr(r.extent)));var E=g*_/2/v,C=g*w/2/v,S=[a[0]-E,a[1]-C,a[0]+E,a[1]+C],B=p.getTileRangeForExtentAndZ(y,d),I={};I[d]={};var T=this.createLoadedTileFinder(c,i,I),P=this.tmpExtent,F=this.tmpTileRange_;this.newTiles_=!1;for(var L=l?Wt(n.center,m,l,t.size):void 0,M=B.minX;M<=B.maxX;++M)for(var O=B.minY;O<=B.maxY;++O)if(!l||p.tileCoordIntersectsViewport([d,M,O],L)){var k=this.getTile(d,M,O,t);if(this.isDrawableTile(k)){var N=o(this);if(k.getState()==ya.LOADED&&(I[d][k.tileCoord.toString()]=k,(ot=k.inTransition(N))&&1!==r.opacity&&(k.endTransition(N),ot=!1),this.newTiles_||!ot&&-1!==this.renderedTiles.indexOf(k)||(this.newTiles_=!0)),1===k.getAlpha(N,t.time))continue}var R=p.getTileCoordChildTileRange(k.tileCoord,F,P),U=!1;R&&(U=T(d+1,R)),U||p.forEachTileCoordParentTileRange(k.tileCoord,T,F,P)}var D=g/s*u/v;_t(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,l,-_/2,-w/2);var Q=bt(this.pixelTransform);this.useContainer(e,Q,this.getBackground(t));var G=this.context,j=G.canvas;wt(this.inversePixelTransform,this.pixelTransform),_t(this.tempTransform,_/2,w/2,D,D,0,-_/2,-w/2),j.width!=_||j.height!=w?(j.width=_,j.height=w):this.containerReused||G.clearRect(0,0,_,w),x&&this.clipUnrotated(G,t,x),c.getInterpolate()||b(G,Kc),this.preRender(G,t),this.renderedTiles.length=0;var H,z,V,K=Object.keys(I).map(Number);K.sort(f),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(H=[],z=[]):K=K.reverse();for(var q=K.length-1;q>=0;--q){var W=K[q],X=c.getTilePixelSize(W,u,i),Y=p.getResolution(W)/g,Z=X[0]*Y*D,J=X[1]*Y*D,$=p.getTileCoordForCoordAndZ(Zt(S),W),tt=p.getTileCoordExtent($),et=gt(this.tempTransform,[v*(tt[0]-S[0])/g,v*(S[3]-tt[3])/g]),rt=v*c.getGutterForProjection(i),nt=I[W];for(var it in nt){var ot,st=(k=nt[it]).tileCoord,at=$[1]-st[1],lt=Math.round(et[0]-(at-1)*Z),ut=$[2]-st[2],ht=Math.round(et[1]-(ut-1)*J),ct=lt-(M=Math.round(et[0]-at*Z)),At=ht-(O=Math.round(et[1]-ut*J)),ft=d===W,pt=!1;if(!(ot=ft&&1!==k.getAlpha(o(this),t.time)))if(H){V=[M,O,M+ct,O,M+ct,O+At,M,O+At];for(var dt=0,yt=H.length;dt<yt;++dt)if(d!==W&&W<z[dt]){var mt=H[dt];te([M,O,M+ct,O+At],[mt[0],mt[3],mt[4],mt[7]])&&(pt||(G.save(),pt=!0),G.beginPath(),G.moveTo(V[0],V[1]),G.lineTo(V[2],V[3]),G.lineTo(V[4],V[5]),G.lineTo(V[6],V[7]),G.moveTo(mt[6],mt[7]),G.lineTo(mt[4],mt[5]),G.lineTo(mt[2],mt[3]),G.lineTo(mt[0],mt[1]),G.clip())}H.push(V),z.push(W)}else G.clearRect(M,O,ct,At);this.drawTileImage(k,t,M,O,ct,At,rt,ft),H&&!ot?(pt&&G.restore(),this.renderedTiles.unshift(k)):this.renderedTiles.push(k),this.updateUsedTiles(t.usedTiles,c,k)}}return this.renderedRevision=A,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Nt(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=u,this.renderedProjection=i,this.manageTilePyramid(t,c,p,u,i,y,d,h.getPreload()),this.scheduleExpireCache(t,c),this.postRender(G,t),r.extent&&G.restore(),b(G,qc),Q!==j.style.transform&&(j.style.transform=Q),this.container},e.prototype.drawTileImage=function(t,e,r,n,i,s,a,l){var u=this.getTileImage(t);if(u){var h=o(this),c=e.layerStatesArray[e.layerIndex],A=c.opacity*(l?t.getAlpha(h,e.time):1),f=A!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=A),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,r,n,i,s),f&&this.context.restore(),A!==c.opacity?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var n=o(t);n in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var n=o(e);n in t||(t[n]={}),t[n][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,n,i,s,a,l,u){var h=o(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,A,f,p,d,g,y=t.wantedTiles[h],m=t.tileQueue,v=r.getMinZoom(),_=t.viewState.rotation,w=_?Wt(t.viewState.center,t.viewState.resolution,_,t.size):void 0,b=0;for(g=v;g<=a;++g)for(A=r.getTileRangeForExtentAndZ(s,g,A),f=r.getResolution(g),p=A.minX;p<=A.maxX;++p)for(d=A.minY;d<=A.maxY;++d)_&&!r.tileCoordIntersectsViewport([g,p,d],w)||(a-g<=l?(++b,(c=e.getTile(g,p,d,n,i)).getState()==ya.IDLE&&(y[c.getKey()]=!0,m.isKeyQueued(c.getKey())||m.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(g,p,d,i));e.updateCacheSize(b,i)},e}(rs),ZA={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var JA=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$A={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},tf={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]},ef=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return JA(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return i!==ya.LOADED&&i!==ya.ERROR||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,s=i.viewState,a=s.resolution,l=s.projection,u=this.getLayer(),h=u.getSource().getTile(e,r,n,o,l),c=i.viewHints,A=!(c[vs.ANIMATING]||c[vs.INTERACTING]);return!A&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,l)&&(A||Date.now()-i.time<8)&&u.getRenderMode()!==ZA.VECTOR&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===ZA.VECTOR?o(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!==r&&(this.renderedLayerRevision_=r,this.renderedTiles.length=0),t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var n=this.getLayer(),i=n.getRevision(),s=n.getRenderOrder()||null,a=t.wantedResolution,l=t.getReplayState(n);if(l.dirty||l.renderedResolution!==a||l.renderedRevision!=i||l.renderedRenderOrder!=s){var u=n.getSource(),h=n.getDeclutter(),c=u.getTileGrid(),A=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,r,t),p=o(n);delete t.hitDetectionImageData[p],t.executorGroups[p]=[],h&&(t.declutterExecutorGroups[p]=[]),l.dirty=!1;for(var d=function(r,i){var o=f[r];if(o.getState()!=ya.LOADED)return"continue";var d=o.tileCoord,y=c.getTileCoordExtent(d),m=Yt(A,y),v=Ct(m,n.getRenderBuffer()*a,g.tmpExtent),_=Nt(y,m)?null:v,w=new qo(0,v,a,e),b=h?new qo(0,m,a,e):void 0,x=Ks(a,e),E=function(t){var e,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(e=r(t,a)),e){var i=this.renderFeature(t,x,e,w,b);l.dirty=l.dirty||i}},C=o.getFeatures();s&&s!==l.renderedRenderOrder&&C.sort(s);for(var S=0,B=C.length;S<B;++S){var I=C[S];_&&!te(_,I.getGeometry().getExtent())||E.call(g,I)}var T=w.finish(),P=n.getRenderMode()!==ZA.VECTOR&&h&&1===f.length?null:m,F=new ms(P,a,e,u.getOverlaps(),T,n.getRenderBuffer());if(t.executorGroups[p].push(F),b){var L=new ms(null,a,e,u.getOverlaps(),b.finish(),n.getRenderBuffer());t.declutterExecutorGroups[p].push(L)}},g=this,y=0,m=f.length;y<m;++y)d(y);l.renderedRevision=i,l.renderedRenderOrder=s,l.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var s=e.viewState.resolution,a=e.viewState.rotation;r=null==r?0:r;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=Et([t]);Ct(h,s*r,h);for(var c,A={},f=function(t,e,r){var s=t.getId();void 0===s&&(s=o(t));var a=A[s];if(a){if(!0!==a&&r<a.distanceSq){if(0===r)return A[s]=!0,i.splice(i.lastIndexOf(a),1),n(t,l,e);a.geometry=e,a.distanceSq=r}}else{if(0===r)return A[s]=!0,n(t,l,e);i.push(A[s]={feature:t,layer:l,geometry:e,distanceSq:r,callback:n})}},p=this.renderedTiles,d=function(n,i){var A=p[n];if(!te(u.getTileCoordExtent(A.wrappedTileCoord),h))return"continue";var d=o(l),g=[A.executorGroups[d]],y=A.declutterExecutorGroups[d];y&&g.push(y),g.some((function(n){for(var i=n===y?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=n.length;o<l;++o){var u=n[o];if(c=u.forEachFeatureAtCoordinate(t,s,a,r,f,i))return!0}}))},g=0,y=p.length;!c&&g<y;++g)d(g);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var n,i=this.getLayer(),s=o(i),a=i.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=a.getTileGridForProjection(l),A=gt(this.renderedPixelToCoordinateTransform_,t.slice()),f=c.getTileCoordForCoordAndResolution(A,h),p=0,d=this.renderedTiles.length;p<d;++p)if(f.toString()===this.renderedTiles[p].tileCoord.toString()){if((n=this.renderedTiles[p]).getState()===ya.LOADED){var g=c.getTileCoordExtent(n.tileCoord);a.getWrapX()&&l.canWrapX()&&!Tt(u,g)&&Ve(A,l);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var y=Zt(c.getTileCoordExtent(n.wrappedTileCoord)),m=[(A[0]-y[0])/h,(y[1]-A[1])/h],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=n.hitDetectionImageData[s];if(!_&&!this.animatingOrInteracting_){var w=jn(c.getTileSize(c.getZForResolution(h,a.zDirection))),b=this.renderedRotation_;_=Gs(w,[this.getRenderTransform(c.getTileCoordCenter(n.wrappedTileCoord),h,0,Qs,w[0]*Qs,w[1]*Qs,0)],v,i.getStyleFunction(),c.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,b),n.hitDetectionImageData[s]=_}e(js(m,v,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,i=!(n[vs.ANIMATING]||n[vs.INTERACTING]),s=this.renderedTiles,a=0,l=s.length;a<l;++a){var u=s[a],h=u.declutterExecutorGroups[o(this.getLayer())];if(h)for(var c=h.length-1;c>=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,s=n.rotation,a=e.size,l=Math.round(a[0]*r),u=Math.round(a[1]*r),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,A=h.getTileCoordExtent(t.wrappedTileCoord),f=h.getTileCoordExtent(c,this.tmpExtent)[0]-A[0];return pt(mt(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,s,r,l,u,f))},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[vs.ANIMATING]||n[vs.INTERACTING]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=s.getOpacity();for(var h=tf[a],c=e.viewState,A=c.rotation,f=s.getSource(),p=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),d=this.renderedTiles,g=[],y=[],m=!0,v=d.length-1;v>=0;--v){var _=d[v];m=m&&!_.getReplayState(s).dirty;var w=_.executorGroups[o(s)].filter((function(t){return t.hasExecutors(h)}));if(0!==w.length){var b=this.getTileRenderTransform(_,e),x=_.tileCoord[0],E=!1,C=w[0].getClipCoords(b);if(C){for(var S=0,B=g.length;S<B;++S)if(p!==x&&x<y[S]){var I=g[S];te([C[0],C[3],C[4],C[7]],[I[0],I[3],I[4],I[7]])&&(E||(l.save(),E=!0),l.beginPath(),l.moveTo(C[0],C[1]),l.lineTo(C[2],C[3]),l.lineTo(C[4],C[5]),l.lineTo(C[6],C[7]),l.moveTo(I[6],I[7]),l.lineTo(I[4],I[5]),l.lineTo(I[2],I[3]),l.lineTo(I[0],I[1]),l.clip())}g.push(C),y.push(x)}for(var T=0,P=w.length;T<P;++T)w[T].execute(l,1,b,A,i,h);E&&l.restore()}}return l.globalAlpha=u,this.ready=m,this.container},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=0,a=r.length;s<a;++s)o=Ws(n,t,r[s],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Ws(n,t,r,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===ZA.VECTOR)return!1;var r=t.getReplayState(e),n=e.getRevision(),i=t.wantedResolution;return r.renderedTileResolution!==i||r.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),n=t.getReplayState(r),i=r.getRevision(),s=t.executorGroups[o(r)];n.renderedTileRevision=i;var a=t.wrappedTileCoord,l=a[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,A=u.getTileGridForProjection(c),f=A.getResolution(t.tileCoord[0]),p=e.pixelRatio/t.wantedResolution*f,d=A.getResolution(l),g=t.getContext(r);h=Math.round(Math.max(h,p/h));var y=u.getTilePixelSize(l,h,c);g.canvas.width=y[0],g.canvas.height=y[1];var m=h/p;if(1!==m){var v=ft(this.tmpTransform_);mt(v,m,m),g.setTransform.apply(g,v)}var _=A.getTileCoordExtent(a,this.tmpExtent),w=p/d,b=ft(this.tmpTransform_);mt(b,w,-w),vt(b,-_[0],-_[3]);for(var x=0,E=s.length;x<E;++x)s[x].execute(g,m,b,0,!0,$A[r.getRenderMode()]);n.renderedTileResolution=t.wantedResolution},e}(YA);const rf=ef,nf="preload",of="useInterimTilesOnError";var sf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const af=function(t){function e(e){var r=this,n=e||{},i=b({},n);delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,n.renderMode===ZA.IMAGE&&(n.renderMode=void 0);var o=n.renderMode||ZA.HYBRID;return K(o==ZA.HYBRID||o==ZA.VECTOR,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r.getBackground,r.setBackground,r}return sf(e,t),e.prototype.createRenderer=function(){return new rf(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(nf)},e.prototype.getUseInterimTilesOnError=function(){return this.get(of)},e.prototype.setPreload=function(t){this.set(nf,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(of,t)},e}(xo);var lf=[0,0,0],uf=function(){function t(t){var e,r,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,K((e=this.resolutions_,r=function(t,e){return e-t}||f,e.every((function(t,n){if(0===n)return!0;var i=r(e[n-1],t);return!(i>0||0===i)}))),17),!t.origins)for(var i=0,o=this.resolutions_.length-1;i<o;++i)if(n){if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}else n=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,K(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Zt(s)),K(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,K(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:al,K(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var r=new Jh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var n=this.getTileRangeForExtentAndZ(s,e);r.minX=Math.max(n.minX,r.minX),r.maxX=Math.min(n.maxX,r.maxX),r.minY=Math.max(n.minY,r.minY),r.maxY=Math.min(n.maxY,r.maxY)}return r}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var s=n.minY,a=n.maxY;s<=a;++s)r([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,n);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Zh(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(s,a,r)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return Zh(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,r){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],i=t[1],o=t[2];if(e===n)return Zh(i,o,i,o,r);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-n),a=Math.floor(i*s),l=Math.floor(o*s);return e<n?Zh(a,a,l,l,r):Zh(a,Math.floor(s*(i+1))-1,l,Math.floor(s*(o+1))-1,r)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,r)},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=jn(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*o[0]*i,a=n[0]+(e.maxX+1)*o[0]*i;return Lt(s,n[1]+e.minY*o[1]*i,a,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=lf;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Zh(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=jn(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=jn(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,s=r[1]-(t[2]+1)*i[1]*n;return Lt(o,s,o+i[0]*n,s+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),s=r/this.getResolution(o),a=this.getOrigin(o),l=jn(this.getTileSize(o),this.tmpSize_),u=s*(t-a[0])/r/l[0],h=s*(a[1]-e)/r/l[1];return n?(u=me(u,5)-1,h=me(h,5)-1):(u=ye(u,5),h=ye(h,5)),Hh(o,u,h,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),s=this.getResolution(r),a=jn(this.getTileSize(r),this.tmpSize_),l=(t-o[0])/s/a[0],u=(o[1]-e)/s/a[1];return n?(l=me(l,5)-1,u=me(u,5)-1):(l=ye(l,5),u=ye(u,5)),Hh(r,l,u,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return ae(d(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return fn(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}();const hf=uf,cf="tileloadstart",Af="tileloadend",ff="tileloaderror";function pf(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,r,n){return function(t,e,r,n){var i=gf(t,void 0,r);return new hf({extent:t,origin:Kt(t,"top-left"),resolutions:i,tileSize:r})}(yf(t),0,void 0)}(t),t.setDefaultTileGrid(e)),e}function df(t){var e=t||{},r=e.extent||ir("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:gf(r,e.maxZoom,e.tileSize,e.maxResolution)};return new hf(n)}function gf(t,e,r,n){for(var i=void 0!==e?e:sl,o=Xt(t),s=$t(t),a=jn(void 0!==r?r:al),l=n>0?n:Math.max(s/a[0],o/a[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function yf(t){var e=(t=ir(t)).getExtent();if(!e){var r=180*tt[et.DEGREES]/t.getMetersPerUnit();e=Lt(-r,-r,r,r)}return e}var mf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vf=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;return r.on,r.once,r.un,r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null,r.tileGrid&&jn(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),[256,256]),r.tileCache=new Xh(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition,interpolate:e.interpolate},r.zDirection=e.zDirection?e.zDirection:0,r}return mf(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)s=zh(e,u,h),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===ya.LOADED)&&(a=!1!==n(o)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,r,i,o){return n()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:pf(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return K(null===e||Ar(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=jn(n.getTileSize(t),this.tmpSize);return 1==i?o:Gn(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=yf(r);if(It(o,i))return e;var s=$t(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,e,r,n){},e}(oa),_f=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return mf(e,t),e}(h);const wf=vf;function bf(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(r,s[0].toString()).replace(n,s[1].toString()).replace(i,s[2].toString()).replace(o,(function(){var t=s[0],r=e.getFullTileRange(t);return K(r,55),(r.getHeight()-s[2]-1).toString()})):void 0}}function xf(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=fe(qh(e),t.length);return t[i](e,r,n)}}}function Ef(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(r[2],10),a=parseInt(r[1],10);a<=s;a++)e.push(t.replace(r[0],a.toString()));return e}return e.push(t),e}var Cf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sf=function(t){function e(r){var n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,interpolate:r.interpolate,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(n.tileUrlFunction=r.tileUrlFunction),n.urls=null,r.urls?n.setUrls(r.urls):r.url&&n.setUrl(r.url),n.tileLoadingKeys_={},n}return Cf(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=o(r),i=r.getState();i==ya.LOADING?(this.tileLoadingKeys_[n]=!0,e=cf):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=i==ya.ERROR?ff:i==ya.LOADED?Af:void 0),null!=e&&this.dispatchEvent(new _f(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=Ef(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=bf(t[i],e);return xf(n)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var n=zh(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(wf);const Bf=Sf;var If=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tf=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||yf(n),o=e.tileGrid||df({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ff,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.sourceTileCache=new Xh(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:ic,r.tileGrids_={},r}return If(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=Kh(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===ya.LOADED)for(var o=r.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],u=l.tileCoord;if(te(t,i.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,A=h.length;c<A;++c){var f=h[c],p=f.getGeometry();te(t,p.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){var n=this.getTileCacheForProjection(e),i=Object.keys(r).reduce((function(t,e){var r,i,o=zh((i=(r=e).substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number))[0],i[1],i[2]),s=n.peek(o);if(s)for(var a=s.sourceTiles,l=0,u=a.length;l<u;++l)t[a[l].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,r){var n=this;if(r.getState()===ya.IDLE){r.setState(ya.LOADING);var i=r.wrappedTileCoord,o=this.getTileGridForProjection(e),s=o.getTileCoordExtent(i),a=i[0],l=o.getResolution(a);Ct(s,-l,s);var u=this.tileGrid,h=u.getExtent();h&&Yt(s,h,s);var c=u.getZForResolution(l,this.zDirection);u.forEachTileCoord(s,c,(function(i){var o=n.tileUrlFunction(i,t,e),s=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(i,o?ya.IDLE:ya.EMPTY,o,n.format_,n.tileLoadFunction);r.sourceTiles.push(s);var a=s.getState();if(a<ya.LOADED){var l=function(t){n.handleTileChange(t);var e=s.getState();if(e===ya.LOADED||e===ya.ERROR){var i=s.getKey();i in r.errorTileKeys?s.getState()===ya.LOADED&&delete r.errorTileKeys[i]:r.loadingSourceTiles--,e===ya.ERROR?r.errorTileKeys[i]=!0:s.removeEventListener(T.CHANGE,l),0===r.loadingSourceTiles&&r.setState(C(r.errorTileKeys)?ya.LOADED:ya.ERROR)}};s.addEventListener(T.CHANGE,l),r.loadingSourceTiles++}a===ya.IDLE&&(s.extent=u.getTileCoordExtent(i),s.projection=e,s.resolution=u.getResolution(i[0]),n.sourceTileCache.set(o,s),s.load())})),r.loadingSourceTiles||r.setState(r.sourceTiles.some((function(t){return t.getState()===ya.ERROR}))?ya.ERROR:ya.LOADED)}return r.sourceTiles},e.prototype.getTile=function(t,e,r,n,i){var o,s=zh(t,e,r),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(u&&h){var A=c.getTileCoordExtent(u);Ct(A,-c.getResolution(t),A),te(h,A)||(u=null)}var f=!0;if(null!==u){var p=this.tileGrid,d=c.getResolution(t),g=p.getZForResolution(d,1),y=c.getTileCoordExtent(u);Ct(y,-d,y),p.forEachTileCoord(y,g,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var m=new rc(l,f?ya.EMPTY:ya.IDLE,u,this.getSourceTiles.bind(this,n,i));return m.key=a,o?(m.interimTile=o,m.refreshInterimChain(),this.tileCache.replace(s,m)):this.tileCache.set(s,m),m},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){for(var n=this.tileGrid,i=n.getResolutions().slice(),o=i.map((function(t,e){return n.getOrigin(e)})),s=i.map((function(t,e){return n.getTileSize(e)})),a=sl+1,l=i.length;l<a;++l)i.push(i[l-1]/2),o.push(o[l-1]),s.push(s[l-1]);r=new hf({extent:n.getExtent(),origins:o,resolutions:i,tileSizes:s}),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=jn(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(Bf);const Pf=Tf;function Ff(t,e){t.setLoader((function(r,n,i){ua(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Lf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Mf(t){return"string"==typeof t?JSON.parse(t)||null:null!==t?t:null}const Of=function(t){function e(){return t.call(this)||this}return Lf(e,t),e.prototype.getType=function(){return"json"},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Mf(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Mf(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return n()},e.prototype.readFeaturesFromObject=function(t,e){return n()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Mf(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return n()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(Mf(t))},e.prototype.readProjectionFromObject=function(t){return n()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return n()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return n()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return n()},e}(Jc);var kf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nf=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=ir(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=ir(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return kf(e,t),e.prototype.readFeatureFromObject=function(t,e){var r,n=Rf((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new X;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return Rf(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=ir(r.properties.name):"EPSG"===r.type?e=ir("EPSG:"+r.properties.code):K(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(r.id=n),!t.hasProperties())return r;var i=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=Uf(o,e),delete i[t.getGeometryName()]),C(i)||(r.properties=i),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return Uf(t,this.adaptOptions(e))},e}(Of);function Rf(t,e){if(!t)return null;var r;switch(t.type){case"Point":r=function(t){return new on(t.coordinates)}(t);break;case"LineString":r=function(t){return new Nn(t.coordinates)}(t);break;case"Polygon":r=function(t){return new xn(t.coordinates)}(t);break;case"MultiPoint":r=function(t){return new nh(t.coordinates)}(t);break;case"MultiLineString":r=function(t){return new th(t.coordinates)}(t);break;case"MultiPolygon":r=function(t){return new ah(t.coordinates)}(t);break;case"GeometryCollection":r=function(t,e){var r=t.geometries.map((function(t){return Rf(t,void 0)}));return new SA(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return $c(r,!1,e)}function Uf(t,e){var r,n=(t=$c(t,!0,e)).getType();switch(n){case"Point":r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case"LineString":r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case"Polygon":r=function(t,e){var r;return e&&(r=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case"MultiPoint":r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case"MultiLineString":r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case"MultiPolygon":r=function(t,e){var r;return e&&(r=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case"GeometryCollection":r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=b({},e);return delete r.featureProjection,Uf(t,r)}))}}(t,e);break;case"Circle":r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}const Df=Nf;var Qf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gf=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:jf,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:Sa,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Qf(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Ar(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Ar(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Ar(e,t)){var r=o(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=pf(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Ar(e,t))return this.tileCache;var r=o(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Xh(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var s=[t,e,r],a=this.getTileCoordForTileUrlFunction(s,i),l=a?this.tileUrlFunction(a,n,i):void 0,u=new this.tileClass(s,void 0!==l?ya.IDLE:ya.EMPTY,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(T.CHANGE,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Ar(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,r],l=void 0,u=Vh(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),A=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(a,i),p=new WA(o,c,i,A,a,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return p.key=h,l?(p.interimTile=l,p.refreshInterimChain(),s.replace(u,p)):s.set(u,p),p}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,s=zh(t,e,r),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,r,n,i,a),l.getState()==ya.IDLE?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,r,n,i,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=ir(t);if(r){var n=o(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Bf);function jf(t,e){t.getImage().src=e}const Hf=Gf;var zf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Vf=function(t){function e(e){var r=this,n=e||{},i=b({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,r.setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return zf(e,t),e.prototype.getPreload=function(){return this.get(nf)},e.prototype.setPreload=function(t){this.set(nf,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(of)},e.prototype.setUseInterimTilesOnError=function(t){this.set(of,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(to);var Kf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const qf=function(t){function e(e){return t.call(this,e)||this}return Kf(e,t),e.prototype.createRenderer=function(){return new YA(this)},e}(Vf);var Wf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Xf=function(t){function e(e){var r=t.call(this,e)||this;return r.vectorRenderer_=new Js(e),r.layerImageRatio_=e.getImageRatio(),r.coordinateToVectorPixelTransform_=[1,0,0,1,0,0],r.renderedPixelToCoordinateTransform_=null,r}return Wf(e,t),e.prototype.disposeInternal=function(){this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getFeatures=function(t){if(!this.vectorRenderer_)return new Promise((function(t){return t([])}));var e=gt(this.coordinateToVectorPixelTransform_,gt(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)},e.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},e.prototype.prepareFrame=function(t){var e=t.pixelRatio,r=t.viewState,n=r.resolution,i=t.viewHints,o=this.vectorRenderer_,s=t.extent;1!==this.layerImageRatio_&&re(s=s.slice(0),this.layerImageRatio_);var a=$t(s)/n,l=Xt(s)/n;if(!i[vs.ANIMATING]&&!i[vs.INTERACTING]&&!ee(s)){o.useContainer(null,null);var u=o.context,h=t.layerStatesArray[t.layerIndex];u.globalAlpha=h.opacity;var c=b({},h,{opacity:1}),A=b({},t,{declutterTree:new oo(9),extent:s,size:[a,l],viewState:b({},t.viewState,{rotation:0}),layerStatesArray:[c],layerIndex:0}),f=!0,p=new ga(s,n,e,u.canvas,(function(t){o.prepareFrame(A)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(A,null)&&(o.renderDeclutter(A),f=!1),t())}));p.addEventListener(T.CHANGE,function(){if(p.getState()===Un.LOADED){this.image_=f?null:p;var t=p.getResolution(),n=p.getPixelRatio(),i=t*e/n;this.renderedResolution=i,this.coordinateToVectorPixelTransform_=_t(this.coordinateToVectorPixelTransform_,a/2,l/2,1/i,-1/i,0,-r.center[0],-r.center[1])}}.bind(this)),p.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_},e.prototype.preRender=function(){},e.prototype.postRender=function(){},e.prototype.renderDeclutter=function(){},e.prototype.forEachFeatureAtCoordinate=function(e,r,n,i,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,r,n,i,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,r,n,i,o)},e}(Xc);var Yf=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Zf=function(t){function e(e){var r=this,n=e||{},i=b({},n);return delete i.imageRatio,(r=t.call(this,i)||this).imageRatio_=void 0!==n.imageRatio?n.imageRatio:1,r}return Yf(e,t),e.prototype.getImageRatio=function(){return this.imageRatio_},e.prototype.createRenderer=function(){return new Xf(this)},e}(xo);var Jf=function(){function t(t,e){this.name=t,this.data=e,this.texture_=null}return t.prototype.getTexture=function(t){if(!this.texture_){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_},t}();const $f=Jf;var tp=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ep=function(t){function e(e){var r=this,n=ya.IDLE;return(r=t.call(this,e.tileCoord,n,{transition:e.transition,interpolate:e.interpolate})||this).loader_=e.loader,r.data_=null,r.error_=null,r.size_=e.size||[256,256],r}return tp(e,t),e.prototype.getSize=function(){return this.size_},e.prototype.getData=function(){return this.data_},e.prototype.getError=function(){return this.error_},e.prototype.load=function(){if(this.state===ya.IDLE||this.state===ya.ERROR){this.state=ya.LOADING,this.changed();var t=this;this.loader_().then((function(e){t.data_=e,t.state=ya.LOADED,t.changed()})).catch((function(e){t.error_=e,t.state=ya.ERROR,t.changed()}))}},e}(Ea);const rp=ep;var np=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ip(t,e,r){var n=r?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function op(t,e,r,n,i,o){var s,a,l=t.getGL();r instanceof Float32Array?(s=l.FLOAT,t.getExtension("OES_texture_float"),a=null!==t.getExtension("OES_texture_float_linear")):(s=l.UNSIGNED_BYTE,a=!0),ip(l,e,o&&a);var u,h=r.byteLength/n[1],c=1;switch(h%8==0?c=8:h%4==0?c=4:h%2==0&&(c=2),i){case 1:u=l.LUMINANCE;break;case 2:u=l.LUMINANCE_ALPHA;break;case 3:u=l.RGB;break;case 4:u=l.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(i))}var A=l.getParameter(l.UNPACK_ALIGNMENT);l.pixelStorei(l.UNPACK_ALIGNMENT,c),l.texImage2D(l.TEXTURE_2D,0,u,n[0],n[1],0,u,s,r),l.pixelStorei(l.UNPACK_ALIGNMENT,A)}var sp=null,ap=function(t){function e(e){var r=t.call(this)||this;r.tile,r.textures=[],r.handleTileChange_=r.handleTileChange_.bind(r),r.renderSize_=jn(e.grid.getTileSize(e.tile.tileCoord[0])),r.gutter_=e.gutter||0,r.bandCount=NaN,r.helper_=e.helper;var n=new pc(oc,ac);return n.fromArray([0,1,1,1,1,0,0,0]),r.helper_.flushBufferData(n),r.coords=n,r.setTile(e.tile),r}return np(e,t),e.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(T.CHANGE,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===ya.LOADED,this.loaded)this.uploadTile_();else{if(t instanceof Sa){var e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(T.CHANGE,this.handleTileChange_)}},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof Sa||r instanceof WA){var n=e.createTexture();return this.textures.push(n),this.bandCount=4,void function(t,e,r,n){ip(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,n,r.getImage(),r.interpolate)}var i=r.getSize(),o=[i[0]+2*this.gutter_,i[1]+2*this.gutter_],s=r.getData(),a=s instanceof Float32Array,l=o[0]*o[1],u=a?Float32Array:Uint8Array,h=u.BYTES_PER_ELEMENT,c=s.byteLength/o[1];this.bandCount=Math.floor(c/h/o[0]);var A=Math.ceil(this.bandCount/4);if(1===A)return n=e.createTexture(),this.textures.push(n),void op(t,n,s,o,this.bandCount,r.interpolate);for(var f=new Array(A),p=0;p<A;++p){n=e.createTexture(),this.textures.push(n);var d=p<A-1?4:this.bandCount%4;f[p]=new u(l*d)}for(var g=0,y=0,m=o[0]*this.bandCount,v=0;v<o[1];++v){for(var _=0;_<m;++_){var w=s[y+_],b=Math.floor(g/this.bandCount),x=_%this.bandCount;(E=f[p=Math.floor(x/4)])[b*(d=E.length/l)+x%4]=w,++g}y+=c/h}for(p=0;p<A;++p){var E;op(t,n=this.textures[p],E=f[p],o,d=E.length/l,r.interpolate)}},e.prototype.handleTileChange_=function(){this.tile.getState()===ya.LOADED&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(T.CHANGE))},e.prototype.disposeInternal=function(){var t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(var e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(T.CHANGE,this.handleTileChange_)},e.prototype.getPixelData=function(t,e){if(!this.loaded)return null;var r,n=this.renderSize_[0],i=this.renderSize_[1],o=this.gutter_;if(this.tile instanceof rp){var s=this.tile.getSize(),a=s[0],l=s[1],u=a+2*o,h=l+2*o,c=o+Math.floor(a*(t/n)),A=o+Math.floor(l*(e/i)),f=this.tile.getData();if(f instanceof DataView){var p=f.byteLength/(u*h),d=p*(A*u+c),g=f.buffer.slice(d,d+p);return new DataView(g)}var y=this.bandCount*(A*u+c);return f.slice(y,y+this.bandCount)}sp||((r=document.createElement("canvas")).width=1,r.height=1,sp=r.getContext("2d")),sp.clearRect(0,0,1,1);var m,v=this.tile.getImage(),_=v.width-2*o,w=v.height-2*o,b=o+Math.floor(_*(t/n)),x=o+Math.floor(w*(e/i));try{sp.drawImage(v,b,x,1,1,0,0,1,1),m=sp.getImageData(0,0,1,1).data}catch(E){return sp=null,null}return m},e}(I);const lp=ap;var up=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hp={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},cp={TEXTURE_COORD:"a_textureCoord"},Ap=[{name:cp.TEXTURE_COORD,size:2,type:bc.FLOAT}],fp={};function pp(t){return 2*(1-1/(t+1))-1}function dp(t,e,r){r in t||(t[r]=[]),t[r].push(e)}function gp(t,e){var r=t.layerStatesArray[t.layerIndex];r.extent&&(e=Yt(e,Cr(r.extent,t.viewState.projection)));var n=r.layer.getRenderSource();if(!n.getWrapX()){var i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=Yt(e,i))}return e}function yp(t,e){return"".concat(t.getKey(),",").concat(Vh(e))}var mp=function(t){function e(e,r){var n=t.call(this,e,{uniforms:r.uniforms})||this;n.renderComplete=!1,n.tileTransform_=[1,0,0,1,0,0],n.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.tempTileRange_=new Jh(0,0,0,0),n.tempTileCoord_=Hh(0,0,0),n.tempSize_=[0,0],n.program_,n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.indices_=new pc(sc,ac),n.indices_.fromArray([0,1,3,1,2,3]);var i=void 0!==r.cacheSize?r.cacheSize:512;return n.tileTextureCache_=new jh(i),n.paletteTextures_=r.paletteTextures||[],n.frameState_=null,n}return up(e,t),e.prototype.reset=function(e){t.prototype.reset.call(this,{uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))},e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)},e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ya.LOADED||r==ya.EMPTY||r==ya.ERROR&&!n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer().getRenderSource();return!!e&&!ee(gp(t,t.extent))&&"ready"===e.getState()},e.prototype.enqueueTiles=function(t,e,r,n){var i=t.viewState,s=this.getLayer(),a=s.getRenderSource(),l=a.getTileGridForProjection(i.projection),u=a.getGutterForProjection(i.projection),h=o(a);h in t.wantedTiles||(t.wantedTiles[h]={});for(var c=t.wantedTiles[h],A=this.tileTextureCache_,f=Math.max(r-s.getPreload(),l.getMinZoom(),s.getMinZoom()),p=r;p>=f;--p)for(var d=l.getTileRangeForExtentAndZ(e,p,this.tempTileRange_),g=l.getResolution(p),y=d.minX;y<=d.maxX;++y)for(var m=d.minY;m<=d.maxY;++m){var v=Hh(p,y,m,this.tempTileCoord_),_=yp(a,v),w=void 0,b=void 0;if(A.containsKey(_)&&(b=(w=A.get(_)).tile),!w||w.tile.key!==a.getKey())if(b=a.getTile(p,y,m,t.pixelRatio,i.projection),w)if(this.isDrawableTile_(b))w.setTile(b);else{var x=b.getInterimTile();w.setTile(x)}else w=new lp({tile:b,grid:l,helper:this.helper,gutter:u}),A.set(_,w);dp(n,w,p);var E=b.getKey();c[E]=!0,b.getState()===ya.IDLE&&(t.tileQueue.isKeyQueued(E)||t.tileQueue.enqueue([b,h,l.getTileCoordCenter(v),g]))}},e.prototype.renderFrame=function(t){this.frameState_=t,this.renderComplete=!0;var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,n=this.getLayer().getRenderSource(),i=n.getTileGridForProjection(r.projection),s=n.getGutterForProjection(r.projection),a=gp(t,t.extent),l=i.getZForResolution(r.resolution,n.zDirection),u={};if(t.nextExtent){var h=i.getZForResolution(r.nextResolution,n.zDirection),c=gp(t,t.nextExtent);this.enqueueTiles(t,c,h,u)}this.enqueueTiles(t,a,l,u);for(var A={},p=o(this),d=t.time,g=!1,y=u[l],m=0,v=y.length;m<v;++m){var _=(Q=(tt=y[m]).tile).tileCoord;if(tt.loaded){if(1===(G=Q.getAlpha(p,d))){Q.endTransition(p);continue}g=!0,A[j=Vh(_)]=G}if(this.renderComplete=!1,!this.findAltTiles_(i,_,l+1,u))for(var w=i.getMinZoom(),b=l-1;b>=w&&!this.findAltTiles_(i,_,b,u);--b);}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!g);for(var x=Object.keys(u).map(Number).sort(f),E=r.center[0],C=r.center[1],S=0,B=x.length;S<B;++S){var I=x[S],T=i.getResolution(I),P=jn(i.getTileSize(I),this.tempSize_),F=i.getOrigin(I),L=P[0]+2*s,M=P[1]+2*s,O=L/M,k=(E-F[0])/(P[0]*T),N=(F[1]-C)/(P[1]*T),R=r.resolution/T,U=pp(I),D=u[I];for(m=0,v=D.length;m<v;++m)if((tt=D[m]).loaded){var Q,G,j=Vh(_=(Q=tt.tile).tileCoord),H=_[1],z=_[2];ft(this.tileTransform_),mt(this.tileTransform_,2/(t.size[0]*R/L),-2/(t.size[1]*R/L)),yt(this.tileTransform_,r.rotation),mt(this.tileTransform_,1,1/O),vt(this.tileTransform_,(P[0]*(H-k)-s)/L,(P[1]*(z-N)-s)/M),this.helper.setUniformMatrixValue(hp.TILE_TRANSFORM,vc(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(tt.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(Ap);for(var V=0;V<tt.textures.length;){var K="TEXTURE"+V,q="".concat(hp.TILE_TEXTURE_ARRAY,"[").concat(V,"]");e.activeTexture(e[K]),e.bindTexture(e.TEXTURE_2D,tt.textures[V]),e.uniform1i(this.helper.getUniformLocation(q),V),++V}for(var W=0;W<this.paletteTextures_.length;++W){var X=this.paletteTextures_[W];e.activeTexture(e["TEXTURE"+V]);var Y=X.getTexture(e);e.bindTexture(e.TEXTURE_2D,Y),e.uniform1i(this.helper.getUniformLocation(X.name),V),++V}(G=j in A?A[j]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(hp.TRANSITION_ALPHA,G),this.helper.setUniformFloatValue(hp.DEPTH,U),this.helper.setUniformFloatValue(hp.TEXTURE_PIXEL_WIDTH,L),this.helper.setUniformFloatValue(hp.TEXTURE_PIXEL_HEIGHT,M),this.helper.setUniformFloatValue(hp.TEXTURE_RESOLUTION,T),this.helper.setUniformFloatValue(hp.TEXTURE_ORIGIN_X,F[0]+H*P[0]*T-s*T),this.helper.setUniformFloatValue(hp.TEXTURE_ORIGIN_Y,F[1]-z*P[1]*T+s*T);var Z=a;s>0&&Yt(Z=i.getTileCoordExtent(_),a,Z),this.helper.setUniformFloatVec4(hp.RENDER_EXTENT,Z),this.helper.setUniformFloatValue(hp.RESOLUTION,r.resolution),this.helper.setUniformFloatValue(hp.ZOOM,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var J=this.helper.getCanvas(),$=this.tileTextureCache_;$.canExpireCache();){var tt;(tt=$.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){n.expireCache(e.viewState.projection,fp)})),this.postRender(e,t),J},e.prototype.getData=function(t){if(!this.helper.getGL())return null;var e=this.frameState_;if(!e)return null;var r=this.getLayer(),n=gt(e.pixelToCoordinateTransform,t.slice()),i=e.viewState,o=r.getExtent();if(o&&!It(Cr(o,i.projection),n))return null;var s,a,l,u=r.getSources(Et([n]),i.resolution);for(s=u.length-1;s>=0;--s)if("ready"===(a=u[s]).getState()){if(l=a.getTileGridForProjection(i.projection),a.getWrapX())break;var h=l.getExtent();if(!h||It(h,n))break}if(s<0)return null;for(var c=this.tileTextureCache_,A=l.getZForResolution(i.resolution);A>=l.getMinZoom();--A){var f=l.getTileCoordForCoordAndZ(n,A),p=yp(a,f);if(c.containsKey(p)){var d=c.get(p);if(d.loaded){var g=l.getOrigin(A),y=jn(l.getTileSize(A)),m=l.getResolution(A),v=(n[0]-g[0])/m-f[1]*y[0],_=(g[1]-n[1])/m-f[2]*y[1];return d.getPixelData(v,_)}}}return null},e.prototype.findAltTiles_=function(t,e,r,n){var i=t.getTileRangeForTileCoordAndZ(e,r,this.tempTileRange_);if(!i)return!1;for(var o=!0,s=this.tileTextureCache_,a=this.getLayer().getRenderSource(),l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u){var h=yp(a,[r,l,u]),c=!1;if(s.containsKey(h)){var A=s.get(h);A.loaded&&(dp(n,A,r),c=!0)}c||(o=!1)}return o},e.prototype.removeHelper=function(){if(this.helper){var e=this.tileTextureCache_;e.forEach((function(t){return t.dispose()})),e.clear()}t.prototype.removeHelper.call(this)},e.prototype.disposeInternal=function(){var e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_)),t.prototype.disposeInternal.call(this),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_},e}(Lc);const vp=mp;var _p={NUMBER:1,STRING:2,COLOR:4,BOOLEAN:8,NUMBER_ARRAY:16,ANY:31,NONE:0},wp={};function bp(t){if("number"==typeof t)return _p.NUMBER;if("boolean"==typeof t)return _p.BOOLEAN;if("string"==typeof t)return e=t,Vn.test(e)&&(e=qn(e)),zn.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?_p.COLOR|_p.STRING:_p.STRING;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var r=t;if(r.every((function(t){return"number"==typeof t})))return 3===r.length||4===r.length?_p.COLOR|_p.NUMBER_ARRAY:_p.NUMBER_ARRAY;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(r)));var n=wp[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(r)));return n.getReturnType(r.slice(1))}function xp(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Ep(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(xp).join(", "),")")}function Cp(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Sp(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=wp[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(e)));return n.toGlsl(t,e.slice(1),r)}var i,o=bp(e);if((o&_p.NUMBER)>0)return xp(e);if((o&_p.BOOLEAN)>0)return e.toString();if((o&_p.STRING)>0&&(void 0===r||r==_p.STRING))return function(t,e){return xp(Cp(t,e))}(t,e.toString());if((o&_p.COLOR)>0&&(void 0===r||r==_p.COLOR))return(i=Zn(e).slice()).length<4&&i.push(1),Ep(i.map((function(t,e){return e<3?t/255:t})));if((o&_p.NUMBER_ARRAY)>0)return Ep(e);throw new Error("Unexpected expression ".concat(e," (expected type ").concat(r,")"))}function Bp(t){if(!(bp(t)&_p.NUMBER))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ip(t){for(var e=0;e<t.length;e++)Bp(t[e])}function Tp(t){if(!(bp(t)&_p.STRING))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function Pp(t){if(!(bp(t)&_p.BOOLEAN))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function Fp(t,e){if(t.length!==e)throw new Error("Exactly ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Lp(t,e){if(t.length<e)throw new Error("At least ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Mp(t,e){if(t.length>e)throw new Error("At most ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Op(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function kp(t,e){if(ue(e)%1!=0)throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function Np(t){return"u_var_"+t}wp.get={getReturnType:function(t){return _p.ANY},toGlsl:function(t,e){Fp(e,1),Tp(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},wp.var={getReturnType:function(t){return _p.ANY},toGlsl:function(t,e){Fp(e,1),Tp(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),Np(r)}};var Rp="u_paletteTextures";wp.palette={getReturnType:function(t){return _p.COLOR},toGlsl:function(t,e){Fp(e,2),Bp(e[0]);var r=Sp(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");for(var i=n.length,o=new Uint8Array(4*i),s=0;s<i;s++){var a=n[s],l=void 0;if("string"==typeof a)l=Yn(a);else{if(!Array.isArray(a))throw new Error("The second argument of palette must be an array of strings or colors");var u=a.length;if(4===u)l=a;else{if(3!==u)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(u));l=[a[0],a[1],a[2],1]}}var h=4*s;o[h]=l[0],o[h+1]=l[1],o[h+2]=l[2],o[h+3]=255*l[3]}t.paletteTextures||(t.paletteTextures=[]);var c="".concat(Rp,"[").concat(t.paletteTextures.length,"]"),A=new $f(c,o);return t.paletteTextures.push(A),"texture2D(".concat(c,", vec2((").concat(r," + 0.5) / ").concat(i,".0, 0.5))")}};var Up="getBandValue";function Dp(t){return{getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(e,r){Fp(r,2);for(var n=_p.ANY,i=0;i<r.length;i++)n&=bp(r[i]);if(n===_p.NONE)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(r)," instead"));return n&=~_p.COLOR,"(".concat(Sp(e,r[0],n)," ").concat(t," ").concat(Sp(e,r[1],n),")")}}}function Qp(t){return{getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(e,r){Lp(r,2);for(var n=0;n<r.length;n++)Pp(r[n]);var i;return i=r.map((function(t){return Sp(e,t)})).join(" ".concat(t," ")),"(".concat(i,")")}}}wp.band={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){Lp(e,1),Mp(e,3);var r=e[0];if(!(Up in t.functions)){for(var n="",i=t.bandCount||1,o=0;o<i;o++){var s=Math.floor(o/4),a=o%4;a===i-1&&1===a&&(a=3);var l="".concat(hp.TILE_TEXTURE_ARRAY,"[").concat(s,"]");n+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(l,", v_textureCoord + vec2(dx, dy))[").concat(a,"];\n }\n ")}t.functions[Up]="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(hp.TEXTURE_PIXEL_WIDTH,";\n float dy = yOffset / ").concat(hp.TEXTURE_PIXEL_HEIGHT,";\n ").concat(n,"\n }\n ")}var u=Sp(t,r),h=Sp(t,e[1]||0),c=Sp(t,e[2]||0);return"".concat(Up,"(").concat(u,", ").concat(h,", ").concat(c,")")}},wp.time={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,0),"u_time"}},wp.zoom={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,0),"u_zoom"}},wp.resolution={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,0),"u_resolution"}},wp["*"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," * ").concat(Sp(t,e[1]),")")}},wp["/"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," / ").concat(Sp(t,e[1]),")")}},wp["+"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," + ").concat(Sp(t,e[1]),")")}},wp["-"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," - ").concat(Sp(t,e[1]),")")}},wp.clamp={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){Fp(e,3),Ip(e);var r=Sp(t,e[1]),n=Sp(t,e[2]);return"clamp(".concat(Sp(t,e[0]),", ").concat(r,", ").concat(n,")")}},wp["%"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"mod(".concat(Sp(t,e[0]),", ").concat(Sp(t,e[1]),")")}},wp["^"]={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,2),Ip(e),"pow(".concat(Sp(t,e[0]),", ").concat(Sp(t,e[1]),")")}},wp.abs={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"abs(".concat(Sp(t,e[0]),")")}},wp.floor={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"floor(".concat(Sp(t,e[0]),")")}},wp.round={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"floor(".concat(Sp(t,e[0])," + 0.5)")}},wp.ceil={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"ceil(".concat(Sp(t,e[0]),")")}},wp.sin={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"sin(".concat(Sp(t,e[0]),")")}},wp.cos={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Fp(e,1),Ip(e),"cos(".concat(Sp(t,e[0]),")")}},wp.atan={getReturnType:function(t){return _p.NUMBER},toGlsl:function(t,e){return Lp(e,1),Mp(e,2),Ip(e),2===e.length?"atan(".concat(Sp(t,e[0]),", ").concat(Sp(t,e[1]),")"):"atan(".concat(Sp(t,e[0]),")")}},wp[">"]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," > ").concat(Sp(t,e[1]),")")}},wp[">="]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," >= ").concat(Sp(t,e[1]),")")}},wp["<"]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," < ").concat(Sp(t,e[1]),")")}},wp["<="]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,2),Ip(e),"(".concat(Sp(t,e[0])," <= ").concat(Sp(t,e[1]),")")}},wp["=="]=Dp("=="),wp["!="]=Dp("!="),wp["!"]={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){return Fp(e,1),Pp(e[0]),"(!".concat(Sp(t,e[0]),")")}},wp.all=Qp("&&"),wp.any=Qp("||"),wp.between={getReturnType:function(t){return _p.BOOLEAN},toGlsl:function(t,e){Fp(e,3),Ip(e);var r=Sp(t,e[1]),n=Sp(t,e[2]),i=Sp(t,e[0]);return"(".concat(i," >= ").concat(r," && ").concat(i," <= ").concat(n,")")}},wp.array={getReturnType:function(t){return _p.NUMBER_ARRAY},toGlsl:function(t,e){Lp(e,2),Mp(e,4),Ip(e);var r=e.map((function(e){return Sp(t,e,_p.NUMBER)}));return"vec".concat(e.length,"(").concat(r.join(", "),")")}},wp.color={getReturnType:function(t){return _p.COLOR},toGlsl:function(t,e){Lp(e,3),Mp(e,4),Ip(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Sp(t,e,_p.NUMBER)+(r<3?" / 255.0":"")}));return"vec".concat(e.length,"(").concat(n.join(", "),")")}},wp.interpolate={getReturnType:function(t){for(var e=_p.COLOR|_p.NUMBER,r=3;r<t.length;r+=2)e&=bp(t[r]);return e},toGlsl:function(t,e,r){Op(e),Lp(e,6);var n,i=e[0];switch(i[0]){case"linear":n=1;break;case"exponential":n=i[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(i)));var o=void 0!==r?r:_p.ANY,s=wp.interpolate.getReturnType(e)&o;kp(e,s);for(var a=Sp(t,e[1]),l=xp(n),u="",h=2;h<e.length-2;h+=2){var c=Sp(t,e[h]),A=u||Sp(t,e[h+1],s),f=Sp(t,e[h+2]),p=Sp(t,e[h+3],s);u="mix(".concat(A,", ").concat(p,", pow(clamp((").concat(a," - ").concat(c,") / (").concat(f," - ").concat(c,"), 0.0, 1.0), ").concat(l,"))")}return u}},wp.match={getReturnType:function(t){for(var e=_p.ANY,r=2;r<t.length;r+=2)e&=bp(t[r]);return e&bp(t[t.length-1])},toGlsl:function(t,e,r){Op(e),Lp(e,4);var n=void 0!==r?r:_p.ANY,i=wp.match.getReturnType(e)&n;kp(e,i);for(var o=Sp(t,e[0]),s=Sp(t,e[e.length-1],i),a=null,l=e.length-3;l>=1;l-=2){var u=Sp(t,e[l]),h=Sp(t,e[l+1],i);a="(".concat(o," == ").concat(u," ? ").concat(h," : ").concat(a||s,")")}return a}},wp.case={getReturnType:function(t){for(var e=_p.ANY,r=1;r<t.length;r+=2)e&=bp(t[r]);return e&bp(t[t.length-1])},toGlsl:function(t,e,r){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(e),Lp(e,3);var n=void 0!==r?r:_p.ANY,i=wp.case.getReturnType(e)&n;kp(e,i);for(var o=0;o<e.length-1;o+=2)Pp(e[o]);var s=Sp(t,e[e.length-1],i),a=null;for(o=e.length-3;o>=0;o-=2){var l=Sp(t,e[o]),u=Sp(t,e[o+1],i);a="(".concat(l," ? ").concat(u," : ").concat(a||s,")")}return a}};var Gp=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,r){return this.varyings.push({name:t,type:e,expression:r}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",r=this.attributes,n=this.varyings;return t&&(r=r.concat("vec4 a_hitColor"),n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(r.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(e,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(n.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",r=this.varyings;return t&&(r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(e,"\n}")},t}(),jp=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Hp=function(t){function e(e){var r=this,n=b({},e);return(r=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,r=void 0!==e.size?e.size:1,n=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],s=void 0!==e.opacity?e.opacity:1,a=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=Sp(l,r,_p.NUMBER_ARRAY|_p.NUMBER),h=Sp(l,o,_p.NUMBER_ARRAY),c=Sp(l,i,_p.NUMBER_ARRAY),A=Sp(l,a,_p.NUMBER),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},p=Sp(f,n,_p.COLOR),d=Sp(f,s,_p.NUMBER),g="1.0",y="vec2(".concat(Sp(f,r,_p.NUMBER_ARRAY|_p.NUMBER),").x");switch(e.symbolType){case"square":case"image":break;case"circle":g="(1.0-smoothstep(1.-4./".concat(y,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var m="(v_quadCoord*2.-1.)",v="(atan(".concat(m,".x,").concat(m,".y))");g="(1.0-smoothstep(.5-3./".concat(y,",.5,cos(floor(.5+").concat(v,"/2.094395102)*2.094395102-").concat(v,")*length(").concat(m,")))");break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var _=(new Gp).setSizeExpression("vec2(".concat(u,")")).setRotationExpression(A).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4(".concat(p,".rgb, ").concat(p,".a * ").concat(d," * ").concat(g,")"));if(t.filter){var w=Sp(f,t.filter,_p.BOOLEAN);_.setFragmentDiscardExpression("!".concat(w))}var b={};if(f.variables.forEach((function(e){var r=Np(e);_.addUniform("float ".concat(r)),b[r]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: ".concat(e));var r=t.variables[e];return"string"==typeof r&&(r=Cp(l,r)),void 0!==r?r:-9999999}})),"image"===e.symbolType&&e.src){var x=new Image;x.crossOrigin=void 0===e.crossOrigin?"anonymous":e.crossOrigin,x.src=e.src,_.addUniform("sampler2D u_texture").setColorExpression(_.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),b.u_texture=x}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),_.addVarying("v_".concat(t),"float","a_".concat(t))})),l.attributes.forEach((function(t){_.addAttribute("float a_".concat(t))})),{builder:_,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,r){var n=r[t];return"string"==typeof n&&(n=Cp(l,n)),void 0!==n?n:-9999999}}})),uniforms:b}}(e.style),r.styleVariables_=e.style.variables||{},r.hitDetectionDisabled_=!!e.disableHitDetection,r}return jp(e,t),e.prototype.createRenderer=function(){return new Uc(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.updateStyleVariables=function(t){b(this.styleVariables_,t),this.changed()},e}(to);var zp=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Vp(t,e){var r="\n attribute vec2 ".concat(cp.TEXTURE_COORD,";\n uniform mat4 ").concat(hp.TILE_TRANSFORM,";\n uniform float ").concat(hp.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(hp.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(hp.TEXTURE_RESOLUTION,";\n uniform float ").concat(hp.TEXTURE_ORIGIN_X,";\n uniform float ").concat(hp.TEXTURE_ORIGIN_Y,";\n uniform float ").concat(hp.DEPTH,";\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ").concat(cp.TEXTURE_COORD,";\n v_mapCoord = vec2(\n ").concat(hp.TEXTURE_ORIGIN_X," + ").concat(hp.TEXTURE_RESOLUTION," * ").concat(hp.TEXTURE_PIXEL_WIDTH," * v_textureCoord[0],\n ").concat(hp.TEXTURE_ORIGIN_Y," - ").concat(hp.TEXTURE_RESOLUTION," * ").concat(hp.TEXTURE_PIXEL_HEIGHT," * v_textureCoord[1]\n );\n gl_Position = ").concat(hp.TILE_TRANSFORM," * vec4(").concat(cp.TEXTURE_COORD,", ").concat(hp.DEPTH,", 1.0);\n }\n "),n={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:e},i=[];if(void 0!==t.color){var o=Sp(n,t.color,_p.COLOR);i.push("color = ".concat(o,";"))}if(void 0!==t.contrast){var s=Sp(n,t.contrast,_p.NUMBER);i.push("color.rgb = clamp((".concat(s," + 1.0) * color.rgb - (").concat(s," / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.exposure){var a=Sp(n,t.exposure,_p.NUMBER);i.push("color.rgb = clamp((".concat(a," + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.saturation){var l=Sp(n,t.saturation,_p.NUMBER);i.push("\n float saturation = ".concat(l," + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n "))}if(void 0!==t.gamma){var u=Sp(n,t.gamma,_p.NUMBER);i.push("color.rgb = pow(color.rgb, vec3(1.0 / ".concat(u,"));"))}if(void 0!==t.brightness){var h=Sp(n,t.brightness,_p.NUMBER);i.push("color.rgb = clamp(color.rgb + ".concat(h,", vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}var c={},A=n.variables.length;if(A>1&&!t.variables)throw new Error("Missing variables in style (expected ".concat(n.variables,")"));for(var f=function(e){var r=n.variables[e];if(!(r in t.variables))throw new Error("Missing '".concat(r,"' in style variables"));var i=Np(r);c[i]=function(){var e=t.variables[r];return"string"==typeof e&&(e=Cp(n,e)),void 0!==e?e:-9999999}},p=0;p<A;++p)f(p);var d=Object.keys(c).map((function(t){return"uniform float ".concat(t,";")})),g=Math.ceil(e/4);d.push("uniform sampler2D ".concat(hp.TILE_TEXTURE_ARRAY,"[").concat(g,"];")),n.paletteTextures&&d.push("uniform sampler2D ".concat(Rp,"[").concat(n.paletteTextures.length,"];"));var y=Object.keys(n.functions).map((function(t){return n.functions[t]}));return{vertexShader:r,fragmentShader:"\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n uniform vec4 ".concat(hp.RENDER_EXTENT,";\n uniform float ").concat(hp.TRANSITION_ALPHA,";\n uniform float ").concat(hp.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(hp.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(hp.RESOLUTION,";\n uniform float ").concat(hp.ZOOM,";\n\n ").concat(d.join("\n"),"\n\n ").concat(y.join("\n"),"\n\n void main() {\n if (\n v_mapCoord[0] < ").concat(hp.RENDER_EXTENT,"[0] ||\n v_mapCoord[1] < ").concat(hp.RENDER_EXTENT,"[1] ||\n v_mapCoord[0] > ").concat(hp.RENDER_EXTENT,"[2] ||\n v_mapCoord[1] > ").concat(hp.RENDER_EXTENT,"[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(").concat(hp.TILE_TEXTURE_ARRAY,"[0], v_textureCoord);\n\n ").concat(i.join("\n"),"\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ").concat(hp.TRANSITION_ALPHA,";\n }"),uniforms:c,paletteTextures:n.paletteTextures}}var Kp=function(t){function e(e){var r=this,n=e?b({},e):{},i=n.style||{};delete n.style;var o=n.cacheSize;return delete n.cacheSize,(r=t.call(this,n)||this).sources_=n.sources,r.renderedSource_=null,r.renderedResolution_=NaN,r.style_=i,r.cacheSize_=o,r.styleVariables_=r.style_.variables||{},r.addChangeListener(Xi.SOURCE,r.handleSourceUpdate_),r}return zp(e,t),e.prototype.getSources=function(t,e){var r=this.getSource();return this.sources_?"function"==typeof this.sources_?this.sources_(t,e):this.sources_:r?[r]:[]},e.prototype.getRenderSource=function(){return this.renderedSource_||this.getSource()},e.prototype.getSourceState=function(){var t=this.getRenderSource();return t?t.getState():"undefined"},e.prototype.handleSourceUpdate_=function(){this.getSource()&&this.setStyle(this.style_)},e.prototype.getSourceBandCount_=function(){var t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4},e.prototype.createRenderer=function(){var t=Vp(this.style_,this.getSourceBandCount_());return new vp(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.cacheSize_,paletteTextures:t.paletteTextures})},e.prototype.renderSources=function(t,e){for(var r,n=this.getRenderer(),i=0,o=e.length;i<o;++i)this.renderedSource_=e[i],n.prepareFrame(t)&&(r=n.renderFrame(t));return r},e.prototype.render=function(t,e){var r=this;this.rendered=!0;for(var n=t.viewState,i=this.getSources(t.extent,n.resolution),o=!0,s=function(t,e){var n=i[t],s=n.getState();if("loading"==s){var a=function(){"ready"==n.getState()&&(n.removeEventListener("change",a),r.changed())};n.addEventListener("change",a)}o=o&&"ready"==s},a=0,l=i.length;a<l;++a)s(a);var u=this.renderSources(t,i);if(this.getRenderer().renderComplete&&o)return this.renderedResolution_=n.resolution,u;if(this.renderedResolution_>.5*n.resolution){var h=this.getSources(t.extent,this.renderedResolution_).filter((function(t){return!i.includes(t)}));if(h.length>0)return this.renderSources(t,h)}return u},e.prototype.setStyle=function(t){this.styleVariables_=t.variables||{},this.style_=t;var e=Vp(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,paletteTextures:e.paletteTextures}),this.changed()},e.prototype.updateStyleVariables=function(t){b(this.styleVariables_,t),this.changed()},e}(Vf);Kp.prototype.dispose;const qp=Kp;var Wp=1,Xp=2,Yp=3,Zp=4,Jp=5,$p=6378137,td=6356752.314,ed=.0066943799901413165,rd=484813681109536e-20,nd=Math.PI/2,id=.16666666666666666,od=.04722222222222222,sd=.022156084656084655,ad=1e-10,ld=.017453292519943295,ud=57.29577951308232,hd=Math.PI/4,cd=2*Math.PI,Ad=3.14159265359,fd={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const pd={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var dd=/[\s_\-\/\(\)]/g;function gd(t,e){if(t[e])return t[e];for(var r,n=Object.keys(t),i=e.toLowerCase().replace(dd,""),o=-1;++o<n.length;)if((r=n[o]).toLowerCase().replace(dd,"")===i)return t[r]}function yd(t){var e,r,n,i={},o=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var r=e.split("=");return r.push(!0),t[r[0].toLowerCase()]=r[1],t}),{}),s={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*ld},lat_1:function(t){i.lat1=t*ld},lat_2:function(t){i.lat2=t*ld},lat_ts:function(t){i.lat_ts=t*ld},lon_0:function(t){i.long0=t*ld},lon_1:function(t){i.long1=t*ld},lon_2:function(t){i.long2=t*ld},alpha:function(t){i.alpha=parseFloat(t)*ld},gamma:function(t){i.rectified_grid_angle=parseFloat(t)},lonc:function(t){i.longc=t*ld},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r_a:function(){i.R_A=!0},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=!0},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var e=gd(pd,t);e&&(i.to_meter=e.to_meter)},from_greenwich:function(t){i.from_greenwich=t*ld},pm:function(t){var e=gd(fd,t);i.from_greenwich=(e||parseFloat(t))*ld},nadgrids:function(t){"@null"===t?i.datumCode="none":i.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(i.axis=t)},approx:function(){i.approx=!0}};for(e in o)r=o[e],e in s?"function"==typeof(n=s[e])?n(r):i[n]=r:i[e]=r;return"string"==typeof i.datumCode&&"WGS84"!==i.datumCode&&(i.datumCode=i.datumCode.toLowerCase()),i}var md=1,vd=/\s/,_d=/[A-Za-z]/,wd=/[A-Za-z84_]/,bd=/[,\]]/,xd=/[\d\.E\-\+]/;function Ed(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=md}function Cd(t,e,r){Array.isArray(e)&&(r.unshift(e),e=null);var n=e?{}:t,i=r.reduce((function(t,e){return Sd(e,t),t}),n);e&&(t[e]=i)}function Sd(t,e){if(Array.isArray(t)){var r=t.shift();if("PARAMETER"===r&&(r=t.shift()),1===t.length)return Array.isArray(t[0])?(e[r]={},void Sd(t[0],e[r])):void(e[r]=t[0]);if(t.length)if("TOWGS84"!==r){if("AXIS"===r)return r in e||(e[r]=[]),void e[r].push(t);var n;switch(Array.isArray(r)||(e[r]={}),r){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[r]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&Sd(t[2],e[r]));case"SPHEROID":case"ELLIPSOID":return e[r]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&Sd(t[3],e[r]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void Cd(e,r,t);default:for(n=-1;++n<t.length;)if(!Array.isArray(t[n]))return Sd(t,e[r]);return Cd(e,r,t)}}else e[r]=t;else e[r]=!0}else e[t]=!0}Ed.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;vd.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case md:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Ed.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(bd.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Ed.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=md)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=md,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Ed.prototype.number=function(t){if(!xd.test(t)){if(bd.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Ed.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Ed.prototype.keyword=function(t){if(wd.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=md)}if(!bd.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Ed.prototype.neutral=function(t){if(_d.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(xd.test(t))return this.word=t,void(this.state=3);if(!bd.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Ed.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Bd,Id=.017453292519943295;function Td(t){return t*Id}function Pd(t){var e=new Ed(t).output(),r=e.shift(),n=e.shift();e.unshift(["name",n]),e.unshift(["type",r]);var i={};return Sd(e,i),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",r=0,n=t.AXIS.length;r<n;++r){var i=[t.AXIS[r][0].toLowerCase(),t.AXIS[r][1].toLowerCase()];-1!==i[0].indexOf("north")||("y"===i[0]||"lat"===i[0])&&"north"===i[1]?e+="n":-1!==i[0].indexOf("south")||("y"===i[0]||"lat"===i[0])&&"south"===i[1]?e+="s":-1!==i[0].indexOf("east")||("x"===i[0]||"lon"===i[0])&&"east"===i[1]?e+="e":-1===i[0].indexOf("west")&&("x"!==i[0]&&"lon"!==i[0]||"west"!==i[1])||(e+="w")}2===e.length&&(e+="u"),3===e.length&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function s(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Td],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Td],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",Td],["lat0","latitude_of_origin",Td],["lat0","standard_parallel_1",Td],["lat1","standard_parallel_1",Td],["lat2","standard_parallel_2",Td],["azimuth","Azimuth"],["alpha","azimuth",Td],["srsCode","name"]].forEach((function(e){return r=t,i=(n=e)[0],o=n[1],void(!(i in r)&&o in r&&(r[i]=r[o],3===n.length&&(r[i]=n[2](r[i]))));var r,n,i,o})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=Td(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i}function Fd(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?Fd[t]=yd(arguments[1]):Fd[t]=Pd(arguments[1]):Fd[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?Fd.apply(e,t):Fd(t)}));if("string"==typeof t){if(t in Fd)return Fd[t]}else"EPSG"in t?Fd["EPSG:"+t.EPSG]=t:"ESRI"in t?Fd["ESRI:"+t.ESRI]=t:"IAU2000"in t&&(Fd["IAU2000:"+t.IAU2000]=t);return}}(Bd=Fd)("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),Bd("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),Bd("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),Bd.WGS84=Bd["EPSG:4326"],Bd["EPSG:3785"]=Bd["EPSG:3857"],Bd.GOOGLE=Bd["EPSG:3857"],Bd["EPSG:900913"]=Bd["EPSG:3857"],Bd["EPSG:102113"]=Bd["EPSG:3857"];var Ld=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],Md=["3857","900913","3785","102113"];function Od(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}function kd(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}function Nd(t){return t<0?-1:1}function Rd(t){return Math.abs(t)<=Ad?t:t-Nd(t)*cd}function Ud(t,e,r){var n=t*r,i=.5*t;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(nd-e))/n}function Dd(t,e){for(var r,n,i=.5*t,o=nd-2*Math.atan(e),s=0;s<=15;s++)if(r=t*Math.sin(o),o+=n=nd-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999}function Qd(t){return t}var Gd=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=kd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,i=t.y;if(i*ud>90&&i*ud<-90&&n*ud>180&&n*ud<-180)return null;if(Math.abs(Math.abs(i)-nd)<=ad)return null;if(this.sphere)e=this.x0+this.a*this.k0*Rd(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(hd+.5*i));else{var o=Math.sin(i),s=Ud(this.e,i,o);e=this.x0+this.a*this.k0*Rd(n-this.long0),r=this.y0-this.a*this.k0*Math.log(s)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=nd-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=Dd(this.e,o)))return null}return e=Rd(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Qd,inverse:Qd,names:["longlat","identity"]}],jd={},Hd=[];function zd(t,e){var r=Hd.length;return!t.names||(Hd[r]=t,t.names.forEach((function(t){jd[t.toLowerCase()]=r})),this)}const Vd={start:function(){Gd.forEach(zd)},add:zd,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==jd[e]&&Hd[jd[e]]?Hd[jd[e]]:void 0}};var Kd={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},qd=Kd.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Kd.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Wd={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Xd={};function Yd(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Xd[t]||null,isNull:!1}}function Zd(t){return t/3600*Math.PI/180}function Jd(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function $d(t){return t.map((function(t){return[Zd(t.longitudeShift),Zd(t.latitudeShift)]}))}function tg(t,e,r){return{name:Jd(t,e+8,e+16).trim(),parent:Jd(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function eg(t,e,r,n){for(var i=e+176,o=[],s=0;s<r.gridNodeCount;s++){var a={latitudeShift:t.getFloat32(i+16*s,n),longitudeShift:t.getFloat32(i+16*s+4,n),latitudeAccuracy:t.getFloat32(i+16*s+8,n),longitudeAccuracy:t.getFloat32(i+16*s+12,n)};o.push(a)}return o}function rg(t,e){if(!(this instanceof rg))return new rg(t);e=e||function(t){if(t)throw t};var r=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in Fd}(t))return Fd[t];if(function(t){return Ld.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=Pd(t);if(function(t){var e=gd(t,"authority");if(e){var r=gd(e,"epsg");return r&&Md.indexOf(r)>-1}}(e))return Fd["EPSG:3857"];var r=function(t){var e=gd(t,"extension");if(e)return gd(e,"proj4")}(e);return r?yd(r):e}return function(t){return"+"===t[0]}(t)?yd(t):void 0}(t);if("object"==typeof r){var n=rg.projections.get(r.projName);if(n){if(r.datumCode&&"none"!==r.datumCode){var i=gd(Wd,r.datumCode);i&&(r.datum_params=r.datum_params||(i.towgs84?i.towgs84.split(","):null),r.ellps=i.ellipse,r.datumName=i.datumName?i.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o,s,a,l,u,h,c=function(t,e,r,n,i){if(!t){var o=gd(Kd,n);o||(o=qd),t=o.a,e=o.b,r=o.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)<ad)&&(i=!0,e=t),{a:t,b:e,rf:r,sphere:i}}(r.a,r.b,r.rf,r.ellps,r.sphere),A=(o=c.a,s=c.b,c.rf,u=((a=o*o)-(l=s*s))/a,h=0,r.R_A?(a=(o*=1-u*(id+u*(od+u*sd)))*o,u=0):h=Math.sqrt(u),{es:u,e:h,ep2:(a-l)/l}),f=function(t){return void 0===t?null:t.split(",").map(Yd)}(r.nadgrids),p=r.datum||function(t,e,r,n,i,o,s){var a={};return a.datum_type=void 0===t||"none"===t?Jp:Zp,e&&(a.datum_params=e.map(parseFloat),0===a.datum_params[0]&&0===a.datum_params[1]&&0===a.datum_params[2]||(a.datum_type=Wp),a.datum_params.length>3&&(0===a.datum_params[3]&&0===a.datum_params[4]&&0===a.datum_params[5]&&0===a.datum_params[6]||(a.datum_type=Xp,a.datum_params[3]*=rd,a.datum_params[4]*=rd,a.datum_params[5]*=rd,a.datum_params[6]=a.datum_params[6]/1e6+1))),s&&(a.datum_type=Yp,a.grids=s),a.a=r,a.b=n,a.es=i,a.ep2=o,a}(r.datumCode,r.datum_params,c.a,c.b,A.es,A.ep2,f);Od(this,r),Od(this,n),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=A.es,this.e=A.e,this.ep2=A.ep2,this.datum=p,this.init(),e(null,this)}else e(t)}else e(t)}function ng(t,e,r){var n,i,o,s,a=t.x,l=t.y,u=t.z?t.z:0;if(l<-nd&&l>-1.001*nd)l=-nd;else if(l>nd&&l<1.001*nd)l=nd;else{if(l<-nd)return{x:-1/0,y:-1/0,z:t.z};if(l>nd)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),i=Math.sin(l),s=Math.cos(l),o=i*i,{x:((n=r/Math.sqrt(1-e*o))+u)*s*Math.cos(a),y:(n+u)*s*Math.sin(a),z:(n*(1-e)+u)*i}}function ig(t,e,r,n){var i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v=t.x,_=t.y,w=t.z?t.z:0;if(i=Math.sqrt(v*v+_*_),o=Math.sqrt(v*v+_*_+w*w),i/r<1e-12){if(y=0,o/r<1e-12)return m=-n,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(_,v);s=w/o,c=(a=i/o)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),A=s*l,g=0;do{g++,u=e*(h=r/Math.sqrt(1-e*A*A))/(h+(m=i*c+w*A-h*(1-e*A*A))),d=(p=s*(l=1/Math.sqrt(1-u*(2-u)*a*a)))*c-(f=a*(1-u)*l)*A,c=f,A=p}while(d*d>1e-24&&g<30);return{x:y,y:Math.atan(p/Math.abs(f)),z:m}}function og(t){return t===Wp||t===Xp}function sg(t,e,r){if(null===t.grids||0===t.grids.length)return-1;for(var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[],s=0;s<t.grids.length;s++){var a=t.grids[s];if(o.push(a.name),a.isNull){i=n;break}if(a.mandatory,null!==a.grid){var l=a.grid.subgrids[0],u=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,h=l.ll[0]-u,c=l.ll[1]-u,A=l.ll[0]+(l.lim[0]-1)*l.del[0]+u,f=l.ll[1]+(l.lim[1]-1)*l.del[1]+u;if(!(c>n.y||h>n.x||f<n.y||A<n.x||(i=ag(n,e,l),isNaN(i.x))))break}else if(a.mandatory)return-1}return isNaN(i.x)?-1:(r.x=-i.x,r.y=i.y,0)}function ag(t,e,r){var n={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return n;var i={x:t.x,y:t.y};i.x-=r.ll[0],i.y-=r.ll[1],i.x=Rd(i.x-Math.PI)+Math.PI;var o=lg(i,r);if(e){if(isNaN(o.x))return n;o.x=i.x-o.x,o.y=i.y-o.y;var s,a,l=9;do{if(a=lg(o,r),isNaN(a.x))break;s={x:i.x-(a.x+o.x),y:i.y-(a.y+o.y)},o.x+=s.x,o.y+=s.y}while(l--&&Math.abs(s.x)>1e-12&&Math.abs(s.y)>1e-12);if(l<0)return n;n.x=Rd(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=t.x+o.x,n.y=t.y+o.y);return n}function lg(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),s=n.x-1*i,a=n.y-1*o,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return l;if(o<0||o>=e.lim[1])return l;r=o*e.lim[0]+i;var u=e.cvs[r][0],h=e.cvs[r][1];r++;var c=e.cvs[r][0],A=e.cvs[r][1];r+=e.lim[0];var f=e.cvs[r][0],p=e.cvs[r][1];r--;var d=e.cvs[r][0],g=e.cvs[r][1],y=s*a,m=s*(1-a),v=(1-s)*(1-a),_=(1-s)*a;return l.x=v*u+m*c+_*d+y*f,l.y=v*h+m*A+_*g+y*p,l}function ug(t,e,r){var n,i,o,s=r.x,a=r.y,l=r.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=s,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(n=a,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(n=l,i="z"),t.axis[o]){case"e":case"n":u[i]=n;break;case"w":case"s":u[i]=-n;break;case"u":void 0!==r[i]&&(u.z=n);break;case"d":void 0!==r[i]&&(u.z=-n);break;default:return null}return u}function hg(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function cg(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Ag(t,e,r,n){var i,o=void 0!==(r=Array.isArray(r)?hg(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){cg(t.x),cg(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===Wp||t.datum.datum_type===Xp||t.datum.datum_type===Yp)&&"WGS84"!==e.datumCode||(e.datum.datum_type===Wp||e.datum.datum_type===Xp||e.datum.datum_type===Yp)&&"WGS84"!==t.datumCode}(t,e)&&(r=Ag(t,i=new rg("WGS84"),r,n),t=i),n&&"enu"!==t.axis&&(r=ug(t,!1,r)),"longlat"===t.projName)r={x:r.x*ld,y:r.y*ld,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===Wp?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==Xp||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===Jp||e.datum_type===Jp)return r;var n=t.a,i=t.es;if(t.datum_type===Yp){if(0!==sg(t,!1,r))return;n=$p,i=ed}var o=e.a,s=e.b,a=e.es;return e.datum_type===Yp&&(o=$p,s=td,a=ed),i!==a||n!==o||og(t.datum_type)||og(e.datum_type)?(r=ng(r,i,n),og(t.datum_type)&&(r=function(t,e,r){if(e===Wp)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===Xp){var n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],u=r[6];return{x:u*(t.x-l*t.y+a*t.z)+n,y:u*(l*t.x+t.y-s*t.z)+i,z:u*(-a*t.x+s*t.y+t.z)+o}}}(r,t.datum_type,t.datum_params)),og(e.datum_type)&&(r=function(t,e,r){if(e===Wp)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===Xp){var n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],u=r[6],h=(t.x-n)/u,c=(t.y-i)/u,A=(t.z-o)/u;return{x:h+l*c-a*A,y:-l*h+c+s*A,z:a*h-s*c+A}}}(r,e.datum_type,e.datum_params)),r=ig(r,a,o,s),e.datum_type!==Yp||0===sg(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*ud,y:r.y*ud,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),n&&"enu"!==e.axis?ug(e,!0,r):(o||delete r.z,r)}rg.projections=Vd,rg.projections.start();var fg=rg("WGS84");function pg(t,e,r,n){var i,o,s;return Array.isArray(r)?(i=Ag(t,e,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(o=Ag(t,e,r,n),2===(s=Object.keys(r)).length||s.forEach((function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;o[n]=r[n]})),o)}function dg(t){return t instanceof rg?t:t.oProj?t.oProj:rg(t)}function gg(t,e,r){t=dg(t);var n,i=!1;return void 0===e?(e=t,t=fg,i=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=fg,i=!0),e=dg(e),r?pg(t,e,r):(n={forward:function(r,n){return pg(t,e,r,n)},inverse:function(r,n){return pg(e,t,r,n)}},i&&(n.oProj=e),n)}var yg=6,mg="AJSAJS",vg="AFAFAF",_g=65,wg=73,bg=79,xg=86,Eg=90;const Cg={forward:Sg,inverse:function(t){var e=Pg(Lg(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Bg};function Sg(t,e){return e=e||5,function(t,e){var r,n,i,o,s,a,l,u,h,c,A,f="00000"+t.easting,p="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,c=t.northing,A=Fg(t.zoneNumber),r=Math.floor(h/1e5),n=Math.floor(c/1e5)%20,i=A-1,o=mg.charCodeAt(i),s=vg.charCodeAt(i),u=!1,(a=o+r-1)>Eg&&(a=a-Eg+_g-1,u=!0),(a===wg||o<wg&&a>wg||(a>wg||o<wg)&&u)&&a++,(a===bg||o<bg&&a>bg||(a>bg||o<bg)&&u)&&++a===wg&&a++,a>Eg&&(a=a-Eg+_g-1),(l=s+n)>xg?(l=l-xg+_g-1,u=!0):u=!1,(l===wg||s<wg&&l>wg||(l>wg||s<wg)&&u)&&l++,(l===bg||s<bg&&l>bg||(l>bg||s<bg)&&u)&&++l===wg&&l++,l>xg&&(l=l-xg+_g-1),String.fromCharCode(a)+String.fromCharCode(l))+f.substr(f.length-5,e)+p.substr(p.length-5,e)}(function(t){var e,r,n,i,o,s,a,l=t.lat,u=t.lon,h=6378137,c=.9996,A=Ig(l),f=Ig(u);a=Math.floor((u+180)/6)+1,180===u&&(a=60),l>=56&&l<64&&u>=3&&u<12&&(a=32),l>=72&&l<84&&(u>=0&&u<9?a=31:u>=9&&u<21?a=33:u>=21&&u<33?a=35:u>=33&&u<42&&(a=37)),s=Ig(6*(a-1)-180+3),e=.006739496752268451,r=h/Math.sqrt(1-.00669438*Math.sin(A)*Math.sin(A)),n=Math.tan(A)*Math.tan(A),i=e*Math.cos(A)*Math.cos(A);var p,d,g=c*r*((o=Math.cos(A)*(f-s))+(1-n+i)*o*o*o/6+(5-18*n+n*n+72*i-58*e)*o*o*o*o*o/120)+5e5,y=c*(h*(.9983242984503243*A-.002514607064228144*Math.sin(2*A)+2639046602129982e-21*Math.sin(4*A)-3.418046101696858e-9*Math.sin(6*A))+r*Math.tan(A)*(o*o/2+(5-n+9*i+4*i*i)*o*o*o*o/24+(61-58*n+n*n+600*i-2.2240339282485886)*o*o*o*o*o*o/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(g),zoneNumber:a,zoneLetter:(p=l,d="Z",84>=p&&p>=72?d="X":72>p&&p>=64?d="W":64>p&&p>=56?d="V":56>p&&p>=48?d="U":48>p&&p>=40?d="T":40>p&&p>=32?d="S":32>p&&p>=24?d="R":24>p&&p>=16?d="Q":16>p&&p>=8?d="P":8>p&&p>=0?d="N":0>p&&p>=-8?d="M":-8>p&&p>=-16?d="L":-16>p&&p>=-24?d="K":-24>p&&p>=-32?d="J":-32>p&&p>=-40?d="H":-40>p&&p>=-48?d="G":-48>p&&p>=-56?d="F":-56>p&&p>=-64?d="E":-64>p&&p>=-72?d="D":-72>p&&p>=-80&&(d="C"),d)}}({lat:t[1],lon:t[0]}),e)}function Bg(t){var e=Pg(Lg(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ig(t){return t*(Math.PI/180)}function Tg(t){return t/Math.PI*180}function Pg(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,s,a,l,u,h,c,A,f,p=.9996,d=6378137,g=.00669438,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=r-5e5,v=e;n<"N"&&(v-=1e7),c=6*(i-1)-180+3,o=.006739496752268451,f=(A=v/p/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*A)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*A)+151*y*y*y/96*Math.sin(6*A),s=d/Math.sqrt(1-g*Math.sin(f)*Math.sin(f)),a=Math.tan(f)*Math.tan(f),l=o*Math.cos(f)*Math.cos(f),u=.99330562*d/Math.pow(1-g*Math.sin(f)*Math.sin(f),1.5),h=m/(s*p);var _=f-s*Math.tan(f)/u*(h*h/2-(5+3*a+10*l-4*l*l-9*o)*h*h*h*h/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*h*h*h*h*h*h/720);_=Tg(_);var w,b=(h-(1+2*a+l)*h*h*h/6+(5-2*l+28*a-3*l*l+8*o+24*a*a)*h*h*h*h*h/120)/Math.cos(f);if(b=c+Tg(b),t.accuracy){var x=Pg({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:x.lat,right:x.lon,bottom:_,left:b}}else w={lat:_,lon:b};return w}function Fg(t){var e=t%yg;return 0===e&&(e=yg),e}function Lg(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var s=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(o++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;n=t.substring(o,o+=2);for(var l=Fg(s),u=function(t,e){for(var r=mg.charCodeAt(e-1),n=1e5,i=!1;r!==t.charCodeAt(0);){if(++r===wg&&r++,r===bg&&r++,r>Eg){if(i)throw"Bad character: "+t;r=_g,i=!0}n+=1e5}return n}(n.charAt(0),l),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=vg.charCodeAt(e-1),n=0,i=!1;r!==t.charCodeAt(0);){if(++r===wg&&r++,r===bg&&r++,r>xg){if(i)throw"Bad character: "+t;r=_g,i=!0}n+=1e5}return n}(n.charAt(1),l);h<Mg(a);)h+=2e6;var c=r-o;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var A,f,p,d=c/2,g=0,y=0;return d>0&&(A=1e5/Math.pow(10,d),f=t.substring(o,o+d),g=parseFloat(f)*A,p=t.substring(o+d),y=parseFloat(p)*A),{easting:g+u,northing:y+h,zoneLetter:a,zoneNumber:s,accuracy:A}}function Mg(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Og(t,e,r){if(!(this instanceof Og))return new Og(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0}Og.fromMGRS=function(t){return new Og(Bg(t))},Og.prototype.toMGRS=function(t){return Sg([this.x,this.y],t)};var kg=1,Ng=.25,Rg=.046875,Ug=.01953125,Dg=.01068115234375,Qg=.75,Gg=.46875,jg=.013020833333333334,Hg=.007120768229166667,zg=.3645833333333333,Vg=.005696614583333333,Kg=.3076171875;function qg(t){var e=[];e[0]=kg-t*(Ng+t*(Rg+t*(Ug+t*Dg))),e[1]=t*(Qg-t*(Rg+t*(Ug+t*Dg)));var r=t*t;return e[2]=r*(Gg-t*(jg+t*Hg)),r*=t,e[3]=r*(zg-t*Vg),e[4]=r*t*Kg,e}function Wg(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var Xg=20;function Yg(t,e,r){for(var n=1/(1-e),i=t,o=Xg;o;--o){var s=Math.sin(i),a=1-e*s*s;if(i-=a=(Wg(i,s,Math.cos(i),r)-t)*(a*Math.sqrt(a))*n,Math.abs(a)<ad)return i}return i}const Zg={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=qg(this.es),this.ml0=Wg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,r,n,i=t.x,o=t.y,s=Rd(i-this.long0),a=Math.sin(o),l=Math.cos(o);if(this.es){var u=l*s,h=Math.pow(u,2),c=this.ep2*Math.pow(l,2),A=Math.pow(c,2),f=Math.abs(l)>ad?Math.tan(o):0,p=Math.pow(f,2),d=Math.pow(p,2);e=1-this.es*Math.pow(a,2),u/=Math.sqrt(e);var g=Wg(o,a,l,this.en);r=this.a*(this.k0*u*(1+h/6*(1-p+c+h/20*(5-18*p+d+14*c-58*p*c+h/42*(61+179*d-d*p-479*p)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+a*s*u/2*(1+h/12*(5-p+9*c+4*A+h/30*(61+d-58*p+270*c-330*p*c+h/56*(1385+543*d-d*p-3111*p))))))+this.y0}else{var y=l*Math.sin(s);if(Math.abs(Math.abs(y)-1)<ad)return 93;if(r=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,n=l*Math.cos(s)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(n))>=1){if(y-1>ad)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,i,o=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Yg(e=this.ml0+s/this.k0,this.es,this.en),Math.abs(r)<nd){var a=Math.sin(r),l=Math.cos(r),u=Math.abs(l)>ad?Math.tan(r):0,h=this.ep2*Math.pow(l,2),c=Math.pow(h,2),A=Math.pow(u,2),f=Math.pow(A,2);e=1-this.es*Math.pow(a,2);var p=o*Math.sqrt(e)/this.k0,d=Math.pow(p,2);n=r-(e*=u)*d/(1-this.es)*.5*(1-d/12*(5+3*A-9*h*A+h-4*c-d/30*(61+90*A-252*h*A+45*f+46*h-d/56*(1385+3633*A+4095*f+1574*f*A)))),i=Rd(this.long0+p*(1-d/6*(1+2*A+h-d/20*(5+28*A+24*f+8*h*A+6*h-d/42*(61+662*A+1320*f+720*f*A))))/l)}else n=nd*Nd(s),i=0;else{var g=Math.exp(o/this.k0),y=.5*(g-1/g),m=this.lat0+s/this.k0,v=Math.cos(m);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(y,2))),n=Math.asin(e),s<0&&(n=-n),i=0===y&&0===v?0:Rd(Math.atan2(y,v)+this.long0)}return t.x=i,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Jg(t){var e=Math.exp(t);return(e-1/e)/2}function $g(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function ty(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,o=t[i],s=0;--i>=0;)r=n*o-s+t[i],s=o,o=r;return e+r*Math.sin(2*e)}function ey(t,e,r){for(var n,i,o=Math.sin(e),s=Math.cos(e),a=Jg(r),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(r),u=2*s*l,h=-2*o*a,c=t.length-1,A=t[c],f=0,p=0,d=0;--c>=0;)n=p,i=f,A=u*(p=A)-n-h*(f=d)+t[c],d=h*p-i+u*f;return[(u=o*l)*A-(h=s*a)*d,u*d+h*A]}const ry={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Zg.init.apply(this),this.forward=Zg.forward,this.inverse=Zg.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var n=ty(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,o=t[i],s=0;--i>=0;)r=n*o-s+t[i],s=o,o=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=Rd(t.x-this.long0),r=t.y;r=ty(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(e),s=Math.cos(e);r=Math.atan2(n,s*i),e=Math.atan2(o*i,$g(n,i*s)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/($g(1,e)+1))),t<0?-e:e}(Math.tan(e));var a,l,u=ey(this.gtu,2*r,2*e);return r+=u[0],e+=u[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=ey(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(Jg(n));var s=Math.sin(i),a=Math.cos(i),l=Math.sin(n),u=Math.cos(n);i=Math.atan2(s*u,$g(l,u*a)),e=Rd((n=Math.atan2(l,u*a))+this.long0),r=ty(this.cgb,i)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ny={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Rd(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*ld,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ry.init.apply(this),this.forward=ry.forward,this.inverse=ry.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function iy(t,e){return Math.pow((1-t)/(1+t),e)}const oy={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+hd)/(Math.pow(Math.tan(.5*this.lat0+hd),this.C)*iy(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+hd),this.C)*iy(this.e*Math.sin(r),this.ratexp))-nd,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+hd)/this.K,1/this.C),i=20;i>0&&(r=2*Math.atan(n*iy(this.e*Math.sin(t.y),-.5*this.e))-nd,!(Math.abs(r-t.y)<1e-14));--i)t.y=r;return i?(t.x=e,t.y=r,t):null},names:["gauss"]},sy={init:function(){oy.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,i;return t.x=Rd(t.x-this.long0),oy.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var s=2*Math.atan2(o,this.R2);e=Math.sin(s),r=Math.cos(s),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/o),n=Math.atan2(t.x*e,o*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,n=0;return t.x=n,t.y=i,oy.inverse.apply(this,[t]),t.x=Rd(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ay={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ad&&(this.k0=.5*(1+Nd(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=ad&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ad&&(this.k0=.5*this.cons*kd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ud(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=kd(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-nd,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,i,o,s,a=t.x,l=t.y,u=Math.sin(l),h=Math.cos(l),c=Rd(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=ad&&Math.abs(l+this.lat0)<=ad?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*u+this.coslat0*h*Math.cos(c)),t.x=this.a*e*h*Math.sin(c)+this.x0,t.y=this.a*e*(this.coslat0*u-this.sinlat0*h*Math.cos(c))+this.y0,t):(r=2*Math.atan(this.ssfn_(l,u,this.e))-nd,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=ad?(o=Ud(this.e,l*this.con,this.con*u),s=2*this.a*this.k0*o/this.cons,t.x=this.x0+s*Math.sin(a-this.long0),t.y=this.y0-this.con*s*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)<ad?(e=2*this.a*this.k0/(1+i*Math.cos(c)),t.y=e*n):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*i*Math.cos(c))),t.y=e*(this.cosX0*n-this.sinX0*i*Math.cos(c))+this.y0),t.x=e*i*Math.sin(c)+this.x0,t))},inverse:function(t){var e,r,n,i,o;t.x-=this.x0,t.y-=this.y0;var s=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(s/(2*this.a*this.k0));return e=this.long0,r=this.lat0,s<=ad?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/s),e=Math.abs(this.coslat0)<ad?this.lat0>0?Rd(this.long0+Math.atan2(t.x,-1*t.y)):Rd(this.long0+Math.atan2(t.x,t.y)):Rd(this.long0+Math.atan2(t.x*Math.sin(a),s*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=ad){if(s<=ad)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=s*this.cons/(2*this.a*this.k0),r=this.con*Dd(this.e,n),e=this.con*Rd(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=ad?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/s),e=Rd(this.long0+Math.atan2(t.x*Math.sin(i),s*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*Dd(this.e,Math.tan(.5*(nd+o)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(nd+t))*Math.pow((1-e)/(1+e),.5*r)}},ly={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*a+this.alpha*o/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*s+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),s=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+s/this.alpha,l=0,u=o,h=-1e3,c=0;Math.abs(u-h)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),h=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=u,t},names:["somerc"]};var uy=1e-7;const hy={init:function(){var t,e,r,n,i,o,s,a,l,u,h,c,A,f=0,p=0,d=0,g=0,y=0,m=0,v=0;this.no_off=(A="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var _=!1;"alpha"in this&&(_=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),_&&(v=this.alpha),w&&(f=this.rectified_grid_angle*ld),_||w)p=this.longc;else if(d=this.long1,y=this.lat1,g=this.long2,m=this.lat2,Math.abs(y-m)<=uy||(t=Math.abs(y))<=uy||Math.abs(t-nd)<=uy||Math.abs(Math.abs(this.lat0)-nd)<=uy||Math.abs(Math.abs(m)-nd)<=uy)throw new Error;var b=1-this.es;e=Math.sqrt(b),Math.abs(this.lat0)>ad?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*e/t,(i=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(Ud(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=i=1),_||w?(_?(h=Math.asin(Math.sin(v)/n),w||(f=v)):(h=f,v=Math.asin(n*Math.sin(h))),this.lam0=p-Math.asin(.5*(i-1/i)*Math.tan(h))/this.B):(o=Math.pow(Ud(this.e,y,Math.sin(y)),this.B),s=Math.pow(Ud(this.e,m,Math.sin(m)),this.B),i=this.E/o,l=(s-o)/(s+o),u=((u=this.E*this.E)-s*o)/(u+s*o),(t=d-g)<-Math.pi?g-=cd:t>Math.pi&&(g+=cd),this.lam0=Rd(.5*(d+g)-Math.atan(u*Math.tan(.5*this.B*(d-g))/l)/this.B),h=Math.atan(2*Math.sin(this.B*Rd(d-this.lam0))/(i-1/i)),f=v=Math.asin(n*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(v))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(hd-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(hd+i))},forward:function(t){var e,r,n,i,o,s,a,l,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-nd)>ad){if(e=.5*((o=this.E/Math.pow(Ud(this.e,t.y,Math.sin(t.y)),this.B))-(s=1/o)),r=.5*(o+s),i=Math.sin(this.B*t.x),n=(e*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)<ad)throw new Error;l=.5*this.ArB*Math.log((1-n)/(1+n)),s=Math.cos(this.B*t.x),a=Math.abs(s)<uy?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+i*this.singam,s)}else l=t.y>0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(u.x=a,u.y=l):(a-=this.u_0,u.x=l*this.cosrot+a*this.sinrot,u.y=a*this.cosrot-l*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var e,r,n,i,o,s,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),a=((s=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(a)-1)<ad)l.x=0,l.y=a<0?-nd:nd;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=Dd(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-s*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},cy={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<ad)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),n=kd(this.e,e,r),i=Ud(this.e,this.lat1,e),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=kd(this.e,o,s),l=Ud(this.e,this.lat2,o),u=Ud(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>ad?this.ns=Math.log(n/a)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=ad&&(r=Nd(r)*(nd-2*ad));var n,i,o=Math.abs(Math.abs(r)-nd);if(o>ad)n=Ud(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var s=this.ns*Rd(e-this.long0);return t.x=this.k0*(i*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(s))+this.y0,t},inverse:function(t){var e,r,n,i,o,s=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+a*a),r=1):(e=-Math.sqrt(s*s+a*a),r=-1);var l=0;if(0!==e&&(l=Math.atan2(r*s,r*a)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(i=Dd(this.e,n)))return null}else i=-nd;return o=Rd(l/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Ay={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,i,o,s,a,l=t.x,u=t.y,h=Rd(l-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),n=-h*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=a*Math.cos(s)/1,t.x=a*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,i,o,s,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,s=e,a=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(a=1),s=t.y,u+=1}while(0===a&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function fy(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function py(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function dy(t){return.375*t*(1+.25*t*(1+.46875*t))}function gy(t){return.05859375*t*t*(1+.75*t)}function yy(t){return t*t*t*(35/3072)}function my(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}function vy(t){return Math.abs(t)<nd?t:t-Nd(t)*Math.PI}function _y(t,e,r,n,i){var o,s;o=t/e;for(var a=0;a<15;a++)if(o+=s=(t-(e*o-r*Math.sin(2*o)+n*Math.sin(4*o)-i*Math.sin(6*o)))/(e-2*r*Math.cos(2*o)+4*n*Math.cos(4*o)-6*i*Math.cos(6*o)),Math.abs(s)<=1e-10)return o;return NaN}const wy={init:function(){this.sphere||(this.e0=py(this.es),this.e1=dy(this.es),this.e2=gy(this.es),this.e3=yy(this.es),this.ml0=this.a*fy(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,r,n=t.x,i=t.y;if(n=Rd(n-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(n)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var o=Math.sin(i),s=Math.cos(i),a=my(this.a,this.e,o),l=Math.tan(i)*Math.tan(i),u=n*Math.cos(i),h=u*u,c=this.es*s*s/(1-this.es);e=a*u*(1-h*l*(1/6-(8-l+8*c)*h/120)),r=this.a*fy(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+a*o/s*h*(.5+(5-l+6*c)*h/24)}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n=t.x/this.a,i=t.y/this.a;if(this.sphere){var o=i+this.lat0;e=Math.asin(Math.sin(o)*Math.cos(n)),r=Math.atan2(Math.tan(n),Math.cos(o))}else{var s=_y(this.ml0/this.a+i,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-nd)<=ad)return t.x=this.long0,t.y=nd,i<0&&(t.y*=-1),t;var a=my(this.a,this.e,Math.sin(s)),l=a*a*a/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(s),2),h=n*this.a/a,c=h*h;e=s-a*Math.tan(s)/l*h*h*(.5-(1+3*u)*h*h/24),r=h*(1-c*(u/3+(1+3*u)*u*c/15))/Math.cos(s)}return t.x=Rd(r+this.long0),t.y=vy(e),t},names:["Cassini","Cassini_Soldner","cass"]};function by(t,e){var r;return t>1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}const xy={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-nd)<ad?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<ad?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=by(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=by(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,i,o,s,a,l,u,h,c=t.x,A=t.y;if(c=Rd(c-this.long0),this.sphere){if(o=Math.sin(A),h=Math.cos(A),n=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+h*n:1+this.sinph0*o+this.cosph0*h*n)<=ad)return null;e=(r=Math.sqrt(2/r))*h*Math.sin(c),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(A+this.lat0)<ad)return null;r=hd-.5*A,e=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(c),r*=n}}else{switch(a=0,l=0,u=0,n=Math.cos(c),i=Math.sin(c),o=Math.sin(A),s=by(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(a=s/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:u=1+this.sinb1*a+this.cosb1*l*n;break;case this.EQUIT:u=1+l*n;break;case this.N_POLE:u=nd+A,s=this.qp-s;break;case this.S_POLE:u=A-nd,s=this.qp+s}if(Math.abs(u)<ad)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),r=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*a-this.sinb1*l*n):(u=Math.sqrt(2/(1+l*n)))*a*this.ymf,e=this.xmf*u*l*i;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(u=Math.sqrt(s))*i,r=n*(this.mode===this.S_POLE?u:-u)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,i,o,s,a,l,u,h,c=t.x/this.a,A=t.y/this.a;if(this.sphere){var f,p=0,d=0;if((r=.5*(f=Math.sqrt(c*c+A*A)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(r),p=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(f)<=ad?0:Math.asin(A*d/f),c*=d,A=p*f;break;case this.OBLIQ:r=Math.abs(f)<=ad?this.lat0:Math.asin(p*this.sinph0+A*d*this.cosph0/f),c*=d*this.cosph0,A=(p-Math.sin(r)*this.sinph0)*f;break;case this.N_POLE:A=-A,r=nd-r;break;case this.S_POLE:r-=nd}e=0!==A||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,A):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,A*=this.dd,(s=Math.sqrt(c*c+A*A))<ad)return t.x=this.long0,t.y=this.lat0,t;i=2*Math.asin(.5*s/this.rq),n=Math.cos(i),c*=i=Math.sin(i),this.mode===this.OBLIQ?(a=n*this.sinb1+A*i*this.cosb1/s,o=this.qp*a,A=s*this.cosb1*n-A*this.sinb1*i):(a=A*i/s,o=this.qp*a,A=s*n)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(A=-A),!(o=c*c+A*A))return t.x=this.long0,t.y=this.lat0,t;a=1-o/this.qp,this.mode===this.S_POLE&&(a=-a)}e=Math.atan2(c,A),h=(l=Math.asin(a))+l,r=l+(u=this.apa)[0]*Math.sin(h)+u[1]*Math.sin(h+h)+u[2]*Math.sin(h+h+h)}return t.x=Rd(this.long0+e),t.y=r,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Ey(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const Cy={init:function(){Math.abs(this.lat1+this.lat2)<ad||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=kd(this.e3,this.sin_po,this.cos_po),this.qs1=by(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=kd(this.e3,this.sin_po,this.cos_po),this.qs2=by(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=by(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>ad?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=by(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*Rd(e-this.long0),s=i*Math.sin(o)+this.x0,a=this.rh-i*Math.cos(o)+this.y0;return t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i,o,s;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),i=0,0!==e&&(i=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,s=this.phi1z(this.e3,r)),o=Rd(i/this.ns0+this.long0),t.x=o,t.y=s,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,i,o,s=Ey(.5*e);if(t<ad)return s;for(var a=t*t,l=1;l<=25;l++)if(s+=o=.5*(i=1-(n=t*(r=Math.sin(s)))*n)*i/Math.cos(s)*(e/(1-a)-r/i+.5/t*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return s;return null}},Sy={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,r,n,i,o,s,a,l=t.x,u=t.y;return n=Rd(l-this.long0),e=Math.sin(u),r=Math.cos(u),i=Math.cos(n),(o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=ad?(s=this.x0+1*this.a*r*Math.sin(n)/o,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)/o):(s=this.x0+this.infinity_dist*r*Math.sin(n),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i,o,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),s=Ey((n=Math.cos(i))*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),o=Rd(this.long0+o)):(s=this.phic0,o=0),t.x=o,t.y=s,t},names:["gnom"]},By={init:function(){this.sphere||(this.k0=kd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,i=t.y,o=Rd(n-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var s=by(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,r=this.y0+this.a*s*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Rd(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*nd:nd;for(var n,i,o,s,a=Math.asin(.5*e),l=0;l<30;l++)if(i=Math.sin(a),o=Math.cos(a),s=t*i,a+=n=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-i/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(n)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=Rd(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},Iy={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=Rd(e-this.long0),i=vy(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,r=t.y;return t.x=Rd(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=vy(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ty={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=py(this.es),this.e1=dy(this.es),this.e2=gy(this.es),this.e3=yy(this.es),this.ml0=this.a*fy(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,i=t.x,o=t.y,s=Rd(i-this.long0);if(n=s*Math.sin(o),this.sphere)Math.abs(o)<=ad?(e=this.a*s,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(o),r=this.a*(vy(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=ad)e=this.a*s,r=-1*this.ml0;else{var a=my(this.a,this.e,Math.sin(o))/Math.tan(o);e=a*Math.sin(n),r=this.a*fy(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+a*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,i,o,s,a,l,u;if(n=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=ad)e=Rd(n/this.a+this.long0),r=0;else{var h;for(s=this.lat0+i/this.a,a=n*n/this.a/this.a+s*s,l=s,o=20;o;--o)if(l+=u=-1*(s*(l*(h=Math.tan(l))+1)-l-.5*(l*l+a)*h)/((l-s)/h-1),Math.abs(u)<=ad){r=l;break}e=Rd(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=ad)r=0,e=Rd(this.long0+n/this.a);else{var c,A,f,p,d;for(s=(this.ml0+i)/this.a,a=n*n/this.a/this.a+s*s,l=s,o=20;o;--o)if(d=this.e*Math.sin(l),c=Math.sqrt(1-d*d)*Math.tan(l),A=this.a*fy(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=u=(s*(c*(p=A/this.a)+1)-p-.5*c*(p*p+a))/(this.es*Math.sin(2*l)*(p*p+a-2*s*p)/(4*c)+(s-p)*(c*f-2/Math.sin(2*l))-f),Math.abs(u)<=ad){r=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=Rd(this.long0+Math.asin(n*c/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Py={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,i=r-this.long0,o=n/rd*1e-5,s=i,a=1,l=0;for(e=1;e<=10;e++)a*=o,l+=this.A[e]*a;var u,h=l,c=s,A=1,f=0,p=0,d=0;for(e=1;e<=6;e++)u=f*h+A*c,A=A*h-f*c,f=u,p=p+this.B_re[e]*A-this.B_im[e]*f,d=d+this.B_im[e]*A+this.B_re[e]*f;return t.x=d*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,i=t.y,o=n-this.x0,s=(i-this.y0)/this.a,a=o/this.a,l=1,u=0,h=0,c=0;for(e=1;e<=6;e++)r=u*s+l*a,l=l*s-u*a,u=r,h=h+this.C_re[e]*l-this.C_im[e]*u,c=c+this.C_im[e]*l+this.C_re[e]*u;for(var A=0;A<this.iterations;A++){var f,p=h,d=c,g=s,y=a;for(e=2;e<=6;e++)f=d*h+p*c,p=p*h-d*c,d=f,g+=(e-1)*(this.B_re[e]*p-this.B_im[e]*d),y+=(e-1)*(this.B_im[e]*p+this.B_re[e]*d);p=1,d=0;var m=this.B_re[1],v=this.B_im[1];for(e=2;e<=6;e++)f=d*h+p*c,p=p*h-d*c,d=f,m+=e*(this.B_re[e]*p-this.B_im[e]*d),v+=e*(this.B_im[e]*p+this.B_re[e]*d);var _=m*m+v*v;h=(g*m+y*v)/_,c=(y*m-g*v)/_}var w=h,b=c,x=1,E=0;for(e=1;e<=9;e++)x*=w,E+=this.D[e]*x;var C=this.lat0+E*rd*1e5,S=this.long0+b;return t.x=S,t.y=C,t},names:["New_Zealand_Map_Grid","nzmg"]},Fy={init:function(){},forward:function(t){var e=t.x,r=t.y,n=Rd(e-this.long0),i=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return t.x=i,t.y=o,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=Rd(this.long0+t.x/this.a),r=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=r,t},names:["Miller_Cylindrical","mill"]},Ly={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=qg(this.es)},forward:function(t){var e,r,n=t.x,i=t.y;if(n=Rd(n-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(i),s=20;s;--s){var a=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=a,Math.abs(a)<ad)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;e=this.a*this.C_x*n*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var l=Math.sin(i),u=Math.cos(i);r=this.a*Wg(i,l,u,this.en),e=this.a*n*u/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,r/=this.C_x*(this.m+Math.cos(e)),this.m?e=Ey((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=Ey(Math.sin(e)/this.n)),r=Rd(r+this.long0),e=vy(e)):(e=Yg(t.y/this.a,this.es,this.en),(n=Math.abs(e))<nd?(n=Math.sin(e),r=Rd(this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(e)))):n-ad<nd&&(r=this.long0)),t.x=r,t.y=e,t},names:["Sinusoidal","sinu"]},My={init:function(){},forward:function(t){for(var e=t.x,r=t.y,n=Rd(e-this.long0),i=r,o=Math.PI*Math.sin(r);;){var s=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=s,Math.abs(s)<ad)break}i/=2,Math.PI/2-Math.abs(r)<ad&&(n=0);var a=.900316316158*this.a*n*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=a,t.y=l,t},inverse:function(t){var e,r;t.x-=this.x0,t.y-=this.y0,r=t.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),e=Math.asin(r);var n=Rd(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=n,t.y=i,t},names:["Mollweide","moll"]},Oy={init:function(){Math.abs(this.lat1+this.lat2)<ad||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=py(this.es),this.e1=dy(this.es),this.e2=gy(this.es),this.e3=yy(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=kd(this.e,this.sinphi,this.cosphi),this.ml1=fy(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<ad?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=kd(this.e,this.sinphi,this.cosphi),this.ml2=fy(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=fy(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,r=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var i=fy(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-i)}var o=this.ns*Rd(r-this.long0),s=this.x0+e*Math.sin(o),a=this.y0+this.rh-e*Math.cos(o);return t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==r&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=Rd(this.long0+o/this.ns),n=vy(this.g-r/this.a),t.x=i,t.y=n,t):(n=_y(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=Rd(this.long0+o/this.ns),t.x=i,t.y=n,t)},names:["Equidistant_Conic","eqdc"]},ky={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,i=t.y,o=Rd(n-this.long0);Math.abs(i)<=ad&&(e=this.x0+this.R*o,r=this.y0);var s=Ey(2*Math.abs(i/Math.PI));(Math.abs(o)<=ad||Math.abs(Math.abs(i)-nd)<=ad)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var a=.5*Math.abs(Math.PI/o-o/Math.PI),l=a*a,u=Math.sin(s),h=Math.cos(s),c=h/(u+h-1),A=c*c,f=c*(2/u-1),p=f*f,d=Math.PI*this.R*(a*(c-p)+Math.sqrt(l*(c-p)*(c-p)-(p+l)*(A-p)))/(p+l);o<0&&(d=-d),e=this.x0+d;var g=l+c;return d=Math.PI*this.R*(f*g-a*Math.sqrt((p+l)*(l+1)-g*g))/(p+l),r=i>=0?this.y0+d:this.y0-d,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,i,o,s,a,l,u,h,c,A;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,o=(n=t.x/c)*n+(i=t.y/c)*i,c=3*(i*i/(l=-2*(s=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(a=s-2*i*i+n*n)*a*a/l/l/l-9*s*a/l/l)/27)/(u=(s-a*a/3/l)/l)/(h=2*Math.sqrt(-u/3)),Math.abs(c)>1&&(c=c>=0?1:-1),A=Math.acos(c)/3,r=t.y>=0?(-h*Math.cos(A+Math.PI/3)-a/3/l)*Math.PI:-(-h*Math.cos(A+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(n)<ad?this.long0:Rd(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-i*i)+o*o))/2/n),t.x=e,t.y=r,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},Ny={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x=t.x,E=t.y,C=Math.sin(t.y),S=Math.cos(t.y),B=Rd(x-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=ad?(t.x=this.x0+this.a*(nd-E)*Math.sin(B),t.y=this.y0-this.a*(nd-E)*Math.cos(B),t):Math.abs(this.sin_p12+1)<=ad?(t.x=this.x0+this.a*(nd+E)*Math.sin(B),t.y=this.y0+this.a*(nd+E)*Math.cos(B),t):(m=this.sin_p12*C+this.cos_p12*S*Math.cos(B),y=(g=Math.acos(m))?g/Math.sin(g):1,t.x=this.x0+this.a*y*S*Math.sin(B),t.y=this.y0+this.a*y*(this.cos_p12*C-this.sin_p12*S*Math.cos(B)),t):(e=py(this.es),r=dy(this.es),n=gy(this.es),i=yy(this.es),Math.abs(this.sin_p12-1)<=ad?(o=this.a*fy(e,r,n,i,nd),s=this.a*fy(e,r,n,i,E),t.x=this.x0+(o-s)*Math.sin(B),t.y=this.y0-(o-s)*Math.cos(B),t):Math.abs(this.sin_p12+1)<=ad?(o=this.a*fy(e,r,n,i,nd),s=this.a*fy(e,r,n,i,E),t.x=this.x0+(o+s)*Math.sin(B),t.y=this.y0+(o+s)*Math.cos(B),t):(a=C/S,l=my(this.a,this.e,this.sin_p12),u=my(this.a,this.e,C),h=Math.atan((1-this.es)*a+this.es*l*this.sin_p12/(u*S)),v=0===(c=Math.atan2(Math.sin(B),this.cos_p12*Math.tan(h)-this.sin_p12*Math.cos(B)))?Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.abs(Math.abs(c)-Math.PI)<=ad?-Math.asin(this.cos_p12*Math.sin(h)-this.sin_p12*Math.cos(h)):Math.asin(Math.sin(B)*Math.cos(h)/Math.sin(c)),A=this.e*this.sin_p12/Math.sqrt(1-this.es),g=l*v*(1-(_=v*v)*(d=(f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*f)*(1-d)/6+(w=_*v)/8*(p=A*f)*(1-2*d)+(b=w*v)/120*(d*(4-7*d)-3*A*A*(1-7*d))-b*v/48*p),t.x=this.x0+g*Math.sin(c),t.y=this.y0+g*Math.cos(c),t))},inverse:function(t){var e,r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*nd*this.a)return;return r=e/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(e)<=ad?s=this.lat0:(s=Ey(i*this.sin_p12+t.y*n*this.cos_p12/e),a=Math.abs(this.lat0)-nd,o=Math.abs(a)<=ad?this.lat0>=0?Rd(this.long0+Math.atan2(t.x,-t.y)):Rd(this.long0-Math.atan2(-t.x,t.y)):Rd(this.long0+Math.atan2(t.x*n,e*this.cos_p12*i-t.y*this.sin_p12*n))),t.x=o,t.y=s,t}return l=py(this.es),u=dy(this.es),h=gy(this.es),c=yy(this.es),Math.abs(this.sin_p12-1)<=ad?(s=_y(((A=this.a*fy(l,u,h,c,nd))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,u,h,c),o=Rd(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=s,t):Math.abs(this.sin_p12+1)<=ad?(A=this.a*fy(l,u,h,c,nd),s=_y(((e=Math.sqrt(t.x*t.x+t.y*t.y))-A)/this.a,l,u,h,c),o=Rd(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.x,t.y),f=my(this.a,this.e,this.sin_p12),g=Math.cos(d),m=-(y=this.e*this.cos_p12*g)*y/(1-this.es),v=3*this.es*(1-m)*this.sin_p12*this.cos_p12*g/(1-this.es),b=1-m*(w=(_=e/f)-m*(1+m)*Math.pow(_,3)/6-v*(1+3*m)*Math.pow(_,4)/24)*w/2-_*w*w*w/6,p=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*g),o=Rd(this.long0+Math.asin(Math.sin(d)*Math.sin(w)/Math.cos(p))),x=Math.sin(p),s=Math.atan2((x-this.es*b*this.sin_p12)*Math.tan(p),x*(1-this.es)),t.x=o,t.y=s,t)},names:["Azimuthal_Equidistant","aeqd"]},Ry={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,s,a,l=t.x,u=t.y;return n=Rd(l-this.long0),e=Math.sin(u),r=Math.cos(u),i=Math.cos(n),((o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=ad)&&(s=1*this.a*r*Math.sin(n),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=s,t.y=a,t},inverse:function(t){var e,r,n,i,o,s,a;return t.x-=this.x0,t.y-=this.y0,r=Ey((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),n=Math.sin(r),i=Math.cos(r),s=this.long0,Math.abs(e)<=ad?(a=this.lat0,t.x=s,t.y=a,t):(a=Ey(i*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-nd,Math.abs(o)<=ad?(s=this.lat0>=0?Rd(this.long0+Math.atan2(t.x,-t.y)):Rd(this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=a,t):(s=Rd(this.long0+Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n)),t.x=s,t.y=a,t))},names:["ortho"]};var Uy={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Dy(t,e,r,n){var i;return t<ad?(n.value=Uy.AREA_0,i=0):(i=Math.atan2(e,r),Math.abs(i)<=hd?n.value=Uy.AREA_0:i>hd&&i<=nd+hd?(n.value=Uy.AREA_1,i-=nd):i>nd+hd||i<=-(nd+hd)?(n.value=Uy.AREA_2,i=i>=0?i-Ad:i+Ad):(n.value=Uy.AREA_3,i+=nd)),i}function Qy(t,e){var r=t+e;return r<-Ad?r+=cd:r>+Ad&&(r-=cd),r}const Gy={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=nd-hd/2?this.face=5:this.lat0<=-(nd-hd/2)?this.face=6:Math.abs(this.long0)<=hd?this.face=1:Math.abs(this.long0)<=nd+hd?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,i,o,s,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)i=nd-e,r>=hd&&r<=nd+hd?(l.value=Uy.AREA_0,n=r-nd):r>nd+hd||r<=-(nd+hd)?(l.value=Uy.AREA_1,n=r>0?r-Ad:r+Ad):r>-(nd+hd)&&r<=-hd?(l.value=Uy.AREA_2,n=r+nd):(l.value=Uy.AREA_3,n=r);else if(6===this.face)i=nd+e,r>=hd&&r<=nd+hd?(l.value=Uy.AREA_0,n=-r+nd):r<hd&&r>=-hd?(l.value=Uy.AREA_1,n=-r):r<-hd&&r>=-(nd+hd)?(l.value=Uy.AREA_2,n=-r-nd):(l.value=Uy.AREA_3,n=r>0?-r+Ad:-r-Ad);else{var u,h,c,A,f,p;2===this.face?r=Qy(r,+nd):3===this.face?r=Qy(r,+Ad):4===this.face&&(r=Qy(r,-nd)),A=Math.sin(e),f=Math.cos(e),p=Math.sin(r),u=f*Math.cos(r),h=f*p,c=A,1===this.face?n=Dy(i=Math.acos(u),c,h,l):2===this.face?n=Dy(i=Math.acos(h),c,-u,l):3===this.face?n=Dy(i=Math.acos(-u),c,-h,l):4===this.face?n=Dy(i=Math.acos(-h),c,u,l):(i=n=0,l.value=Uy.AREA_0)}return s=Math.atan(12/Ad*(n+Math.acos(Math.sin(n)*Math.cos(hd))-nd)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===Uy.AREA_1?s+=nd:l.value===Uy.AREA_2?s+=Ad:l.value===Uy.AREA_3&&(s+=1.5*Ad),a.x=o*Math.cos(s),a.y=o*Math.sin(s),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,r,n,i,o,s,a,l,u,h,c,A,f={lam:0,phi:0},p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=Uy.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=Uy.AREA_1,e-=nd):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Uy.AREA_2,e=e<0?e+Ad:e-Ad):(p.value=Uy.AREA_3,e+=nd),u=Ad/12*Math.tan(e),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),s=Math.atan(o),(a=1-(n=Math.cos(e))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?a=-1:a>1&&(a=1),5===this.face)l=Math.acos(a),f.phi=nd-l,p.value===Uy.AREA_0?f.lam=s+nd:p.value===Uy.AREA_1?f.lam=s<0?s+Ad:s-Ad:p.value===Uy.AREA_2?f.lam=s-nd:f.lam=s;else if(6===this.face)l=Math.acos(a),f.phi=l-nd,p.value===Uy.AREA_0?f.lam=-s+nd:p.value===Uy.AREA_1?f.lam=-s:p.value===Uy.AREA_2?f.lam=-s-nd:f.lam=s<0?-s-Ad:-s+Ad;else{var d,g,y;u=(d=a)*d,g=(u+=(y=u>=1?0:Math.sqrt(1-u)*Math.sin(s))*y)>=1?0:Math.sqrt(1-u),p.value===Uy.AREA_1?(u=g,g=-y,y=u):p.value===Uy.AREA_2?(g=-g,y=-y):p.value===Uy.AREA_3&&(u=g,g=y,y=-u),2===this.face?(u=d,d=-g,g=u):3===this.face?(d=-d,g=-g):4===this.face&&(u=d,d=g,g=-u),f.phi=Math.acos(-y)-nd,f.lam=Math.atan2(g,d),2===this.face?f.lam=Qy(f.lam,-nd):3===this.face?f.lam=Qy(f.lam,-Ad):4===this.face&&(f.lam=Qy(f.lam,+nd))}return 0!==this.es&&(h=f.phi<0?1:0,c=Math.tan(f.phi),A=this.b/Math.sqrt(c*c+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-A*A)/(this.one_minus_f*A)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var jy=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Hy=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],zy=.8487,Vy=1.3523,Ky=ud/5,qy=1/Ky,Wy=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const Xy={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Rd(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*Ky);n<0?n=0:n>=18&&(n=17);var i={x:Wy(jy[n],r=ud*(r-qy*n))*e,y:Wy(Hy[n],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*zy+this.x0,i.y=i.y*this.a*Vy+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*zy),y:Math.abs(t.y-this.y0)/(this.a*Vy)};if(e.y>=1)e.x/=jy[18][0],e.y=t.y<0?-nd:nd;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(Hy[r][0]>e.y)--r;else{if(!(Hy[r+1][0]<=e.y))break;++r}var n=Hy[r],i=5*(e.y-n[0])/(Hy[r+1][0]-n[0]);i=function(t,e,r,n){for(var i=e;n;--n){var o=t(i);if(i-=o,Math.abs(o)<r)break}return i}((function(t){return(Wy(n,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(n,t)}),i,ad,100),e.x/=Wy(jy[r],i),e.y=(5*r+i)*ld,t.y<0&&(e.y=-e.y)}return e.x=Rd(e.x+this.long0),e},names:["Robinson","robin"]},Yy={init:function(){this.name="geocent"},forward:function(t){return ng(t,this.es,this.a)},inverse:function(t){return ig(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Zy={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const Jy={init:function(){if(Object.keys(Zy).forEach(function(t){if(void 0===this[t])this[t]=Zy[t].def;else{if(Zy[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Zy[t].num&&(this[t]=parseFloat(this[t]))}Zy[t].degrees&&(this[t]=this[t]*ld)}.bind(this)),Math.abs(Math.abs(this.lat0)-nd)<ad?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<ad?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,r,n,i,o=Math.sin(t.y),s=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*o+this.cosph0*s*a;break;case 2:r=s*a;break;case 1:r=-o;break;case 0:r=o}switch(e=(r=this.pn1/(this.p-r))*s*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*o-this.sinph0*s*a;break;case 2:r*=o;break;case 0:r*=-s*a;break;case 1:r*=s*a}return i=1/((n=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*i,r=n*i,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,n,i={x:t.x,y:t.y};n=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*n,r=this.pn1*t.y*this.cw*n,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var o=$g(t.x,t.y);if(Math.abs(o)<ad)i.x=0,i.y=t.y;else{var s,a;switch(a=1-o*o*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/o+o/this.pn1),s=Math.sqrt(1-a*a),this.mode){case 3:i.y=Math.asin(s*this.sinph0+t.y*a*this.cosph0/o),t.y=(s-this.sinph0*Math.sin(i.y))*o,t.x*=a*this.cosph0;break;case 2:i.y=Math.asin(t.y*a/o),t.y=s*o,t.x*=a;break;case 0:i.y=Math.asin(s),t.y=-t.y;break;case 1:i.y=-Math.asin(s)}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t},names:["Tilted_Perspective","tpers"]},$y={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,n,i,o=t.x,s=t.y;if(o-=this.long0,"ellipse"===this.shape){s=Math.atan(this.radius_p2*Math.tan(s));var a=this.radius_p/$g(this.radius_p*Math.cos(s),Math.sin(s));if(r=a*Math.cos(o)*Math.cos(s),n=a*Math.sin(o)*Math.cos(s),i=a*Math.sin(s),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/$g(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/$g(n,e)))}else"sphere"===this.shape&&(e=Math.cos(s),r=Math.cos(o)*e,n=Math.sin(o)*e,i=Math.sin(s),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/$g(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/$g(n,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,n,i,o=-1,s=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*$g(1,a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*$g(1,s));var l=a/this.radius_p;if(e=s*s+l*l+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,s*=i,a*=i,t.x=Math.atan2(s,o),t.y=Math.atan(a*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),e=s*s+a*a+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,s*=i,a*=i,t.x=Math.atan2(s,o),t.y=Math.atan(a*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var tm;function em(){gg.defs("EPSG:2327","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2328","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2329","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2330","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2331","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2332","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2333","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2334","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2335","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2336","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2337","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2338","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2339","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2340","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2341","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2342","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2343","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2344","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2345","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2346","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2347","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2348","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2349","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2350","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2351","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2352","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2353","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2354","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2355","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2356","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2357","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2358","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2359","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2360","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2361","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2362","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2363","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2364","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2365","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2366","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2367","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2368","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2369","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2370","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2371","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2372","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2373","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2374","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2375","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2376","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2377","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2378","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2379","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2380","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2381","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2382","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2383","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2384","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2385","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2386","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2387","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2388","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2389","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2390","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"),gg.defs("EPSG:2401","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2402","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2403","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2404","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2405","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2406","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2407","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2408","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2409","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2410","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2411","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2412","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2413","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2414","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2415","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2416","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2417","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2418","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2419","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2420","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2421","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2422","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2423","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2424","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2425","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2426","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2427","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2428","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2429","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2430","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2431","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2432","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2433","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2434","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2435","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2436","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2437","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2438","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2439","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2440","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2441","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:2442","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21413","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21414","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21415","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21416","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21417","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21418","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21419","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21420","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21421","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21422","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:21423","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs"),gg.defs("EPSG:4491","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4492","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4493","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4494","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4495","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4496","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4497","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4498","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4499","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4500","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4501","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4502","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4503","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4504","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4505","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4506","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4507","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4508","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4509","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4510","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4511","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4512","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4513","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4514","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4515","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4516","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4517","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4518","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4519","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4520","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4521","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4522","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4523","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4524","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4525","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4526","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4527","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4528","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4529","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4530","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4531","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4532","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4533","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4534","+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4535","+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4536","+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4537","+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4538","+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4539","+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4540","+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4541","+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4542","+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4543","+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4544","+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4545","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4546","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4547","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4548","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4549","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4550","+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4551","+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4552","+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4553","+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:4554","+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),gg.defs("EPSG:5223","+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=500000 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:5523","+proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=1500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32601","+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32602","+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32603","+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32604","+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32605","+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32606","+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32607","+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32608","+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32609","+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32610","+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32611","+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32612","+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32613","+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32614","+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32615","+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32616","+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32617","+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32618","+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32619","+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32620","+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32621","+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32622","+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32623","+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32624","+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32625","+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32626","+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32627","+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32628","+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32629","+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32630","+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32631","+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32632","+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32633","+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32634","+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32635","+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32636","+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32637","+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32638","+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32639","+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32640","+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32641","+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32642","+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32643","+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32644","+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32645","+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32646","+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32647","+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32648","+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32649","+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32650","+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32651","+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32652","+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32653","+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32654","+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32655","+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32656","+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32657","+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32658","+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32659","+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32660","+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32701","+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32702","+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32703","+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32704","+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32705","+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32706","+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32707","+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32708","+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32709","+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32710","+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32711","+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32712","+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32713","+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32714","+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32715","+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32716","+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32717","+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32718","+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32719","+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32720","+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32721","+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32722","+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32723","+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32724","+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32725","+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32726","+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32727","+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32728","+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32729","+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32730","+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32731","+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32732","+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32733","+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32734","+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32735","+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32736","+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32737","+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32738","+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32739","+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32740","+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32741","+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32742","+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32743","+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32744","+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32745","+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32746","+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32747","+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32748","+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32749","+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32750","+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32751","+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32752","+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32753","+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32754","+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32755","+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32756","+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32757","+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32758","+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32759","+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"),gg.defs("EPSG:32760","+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs")}function rm(t){var e,r,n=Object.keys(t.defs),i=n.length;for(e=0;e<i;++e){var o=n[e];if(!ir(o)){var s=t.defs(o),a=s.units;a||"longlat"!==s.projName||(a=et.DEGREES),nr(new se({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:a}))}}for(e=0;e<i;++e){var l=n[e],u=ir(l);for(r=0;r<i;++r){var h=n[r],c=ir(h);if(!ke(l,h))if(t.defs[l]===t.defs[h])sr([u,c]);else{var A=t(l,h);ur(u,c,Sr(u,c,A.forward),Sr(c,u,A.inverse))}}}}gg.defaultDatum="WGS84",gg.Proj=rg,gg.WGS84=new gg.Proj("WGS84"),gg.Point=Og,gg.toPoint=hg,gg.defs=Fd,gg.nadgrid=function(t,e){var r=new DataView(e),n=function(t){var e=t.getInt32(8,!1);return 11!==e&&(e=t.getInt32(8,!0),!0)}(r),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Jd(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,n);i.nSubgrids;var o=function(t,e,r){for(var n=[],i=0;i<e.nSubgrids;i++){var o=tg(t,176,r),s=eg(t,176,o,r),a=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),l=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);n.push({ll:[Zd(o.lowerLongitude),Zd(o.lowerLatitude)],del:[Zd(o.longitudeInterval),Zd(o.latitudeInterval)],lim:[a,l],count:o.gridNodeCount,cvs:$d(s)})}return n}(r,i,n),s={header:i,subgrids:o};return Xd[t]=s,s},gg.transform=Ag,gg.mgrs=Cg,gg.version="__VERSION__",(tm=gg).Proj.projections.add(Zg),tm.Proj.projections.add(ry),tm.Proj.projections.add(ny),tm.Proj.projections.add(sy),tm.Proj.projections.add(ay),tm.Proj.projections.add(ly),tm.Proj.projections.add(hy),tm.Proj.projections.add(cy),tm.Proj.projections.add(Ay),tm.Proj.projections.add(wy),tm.Proj.projections.add(xy),tm.Proj.projections.add(Cy),tm.Proj.projections.add(Sy),tm.Proj.projections.add(By),tm.Proj.projections.add(Iy),tm.Proj.projections.add(Ty),tm.Proj.projections.add(Py),tm.Proj.projections.add(Fy),tm.Proj.projections.add(Ly),tm.Proj.projections.add(My),tm.Proj.projections.add(Oy),tm.Proj.projections.add(ky),tm.Proj.projections.add(Ny),tm.Proj.projections.add(Ry),tm.Proj.projections.add(Gy),tm.Proj.projections.add(Xy),tm.Proj.projections.add(Yy),tm.Proj.projections.add(Jy),tm.Proj.projections.add($y);class nm{constructor(){e(this,"handlers"),this.handlers={}}_on(t,e){return this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(e),this}off(t,e){let r=this.handlers[t];for(let n=0;n<r.length;n++)if(r[n]===e){r.splice(n,1);break}return this}onec(t,e,r){let n=this;return this._on(t,(function i(){n.off(t,i),e.apply(r||n,arguments)})),this}trigger(t,e){this.handlers.hasOwnProperty(t)&&this.handlers[t].forEach((t=>{t.call(this,e)}))}}class im extends nm{constructor(){super(),em(),rm(gg)}getJSON(t){const e=new XMLHttpRequest;return e.open("get",t,!1),e.setRequestHeader("content-type","application/json"),e.send(),JSON.parse(e.response)}getFile(t,e){const r=new XMLHttpRequest;return r.open("get",t,!1),r.setRequestHeader("content-type",e),r.send(),r.response}ConvertCoordinatesTo3857(t,e){return gg("EPSG:"+t,"EPSG:3857",e)}ConvertCoordinatesTo4326(t,e){return gg("EPSG:"+t,"EPSG:4326",e)}formatJsonTo3857(t){let e;return e=t.crs?"EPSG:3857"===t.crs.properties.name?(new Df).readFeatures(t):"EPSG:4326"===t.crs.properties.name?(new Df).readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}):(new Df).readFeatures(t,{dataProjection:t.crs.properties.name,featureProjection:"EPSG:3857"}):(new Df).readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}),e}formatJsonTo4326Json(t){let e,r=new Df;return e=t.crs?"EPSG:4326"===t.crs.properties.name?r.readFeatures(t):"EPSG:3857"===t.crs.properties.name?r.readFeatures(t,{dataProjection:"EPSG:3857",featureProjection:"EPSG:4326"}):r.readFeatures(t,{dataProjection:t.crs.properties.name,featureProjection:"EPSG:4326"}):r.readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:4326"}),r.writeFeaturesObject(e)}formatJsonToPoint(t){let e=this.formatJsonTo3857(t),r=[];return e.forEach((t=>{switch(t.getGeometry().getType()){case"Polygon":r.push(new X({geometry:t.getGeometry().getInteriorPoint(),properties:t.getProperties().properties}));break;case"Point":r.push(t)}})),r}colorRgba(t,e){let r=t.toLowerCase();if(r&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(r)){if(4===r.length){let t="#";for(let e=1;e<4;e+=1)t+=r.slice(e,e+1).concat(r.slice(e,e+1));r=t}let t=[];for(let e=1;e<7;e+=2)t.push(parseInt("0x"+r.slice(e,e+2)));return"rgba("+t.join(",")+","+e+")"}return r}}const om="ol-ctx-menu",sm={namespace:om,container:`${om}-container`,separator:`${om}-separator`,submenu:`${om}-submenu`,hidden:`${om}-hidden`,icon:`${om}-icon`,zoomIn:`${om}-zoom-in`,zoomOut:`${om}-zoom-out`,unselectable:"ol-unselectable"},am=sm,lm="contextmenu",um={width:150,scrollAt:4,eventType:lm,defaultItems:!0},hm=[{text:"放大",classname:`${sm.zoomIn} ${sm.icon}`,callback:(t,e)=>{const r=e.getView();r.animate({zoom:+r.getZoom()+1,duration:700,center:t.coordinate})}},{text:"缩小",classname:`${sm.zoomOut} ${sm.icon}`,callback:(t,e)=>{const r=e.getView();r.animate({zoom:+r.getZoom()-1,duration:700,center:t.coordinate})}}];function cm(t,e="Assertion failed"){if(!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}function Am(t){return/^\d+$/.test(t)}function fm(t,e,r){if(Array.isArray(t))return void t.forEach((t=>fm(t,e)));const n=Array.isArray(e)?e:e.split(/\s+/);let i=n.length;for(;i--;)dm(t,n[i])||_m(t,n[i],r)}function pm(t,e,r){if(Array.isArray(t))return void t.forEach((t=>pm(t,e,r)));const n=Array.isArray(e)?e:e.split(/\s+/);let i=n.length;for(;i--;)dm(t,n[i])&&wm(t,n[i],r)}function dm(t,e){return t.classList?t.classList.contains(e):vm(e).test(t.className)}function gm(t,e=window.document,r){let n=/\./g,i=Array.prototype.slice,o=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":o=[ym(t.substr(1))];break;case".":o=i.call(e.getElementsByClassName(t.substr(1).replace(n," ")));break;default:o=i.call(e.getElementsByTagName(t))}else o=i.call(e.querySelectorAll(t));return r?o:o[0]}function ym(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)}function mm(t){let e=document.createDocumentFragment(),r=document.createElement("div");for(r.innerHTML=t;r.firstChild;)e.appendChild(r.firstChild);return e}function vm(t){return new RegExp(`(^|\\s+) ${t} (\\s+|$)`)}function _m(t,e,r){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),r&&Am(r)&&window.setTimeout((()=>wm(t,e)),r)}function wm(t,e,r){t.classList?t.classList.remove(e):t.className=t.className.replace(vm(e)," ").trim(),r&&Am(r)&&window.setTimeout((()=>_m(t,e)),r)}class bm{constructor(t,e){return this.Base=t,this.Base.container=this.container=e,this}createContainer(t){const e=document.createElement("div"),r=document.createElement("ul"),n=[am.container,am.unselectable];return t&&n.push(am.hidden),e.className=n.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(r),e}createMenu(){let t=[];if("items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(hm):this.Base.options.items:this.Base.options.defaultItems&&(t=hm),0===t.length)return!1;t.forEach(this.addMenuEntry,this)}addMenuEntry(t){if(t.items&&Array.isArray(t.items)){t.classname=t.classname||"",e=am.submenu,~t.classname.indexOf(e)||(t.classname=t.classname.length?" "+am.submenu:am.submenu);let r=this.generateHtmlAndPublish(this.container,t),n=this.createContainer();n.style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,r.appendChild(n),t.items.forEach((t=>{this.generateHtmlAndPublish(n,t,!0)}))}else this.generateHtmlAndPublish(this.container,t);var e}generateHtmlAndPublish(t,e,r){const n="_"+Math.random().toString(36).substr(2,9);let i,o,s,a=!1;return"string"==typeof e&&"-"===e.trim()?(i=`<li id="${n}" class="${am.separator}"><hr></li>`,o=mm(i),s=[].slice.call(o.childNodes,0)[0],t.firstChild.appendChild(o),a=!0):(e.classname=e.classname||"",i=`<span>${e.text}</span>`,o=mm(i),s=document.createElement("li"),e.icon&&(""===e.classname?e.classname=am.icon:-1===e.classname.indexOf(am.icon)&&(e.classname+=` ${am.icon}`),s.setAttribute("style",`background-image:url(${e.icon})`)),s.id=n,s.className=e.classname,s.appendChild(o),t.firstChild.appendChild(s)),this.Base.Internal.items[n]={id:n,submenu:r||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(s,n),s}removeMenuEntry(t){const e=gm("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]}cloneAndGetLineHeight(){const t=this.container.cloneNode(),e=mm("<span>Foo</span>"),r=mm("<span>Foo</span>"),n=document.createElement("li"),i=document.createElement("li");n.appendChild(e),i.appendChild(r),t.appendChild(n),t.appendChild(i),this.container.parentNode.appendChild(t);const o=t.offsetHeight/2;return this.container.parentNode.removeChild(t),o}}class xm extends Bl{constructor(t={}){cm("object"==typeof t,"@param `opt_options` should be object type!");const e=document.createElement("div"),r=document.createElement("ul"),n=[am.container,am.unselectable];n.push(am.hidden),e.className=n.join(" "),e.style.width=parseInt(t.width,10)+"px",e.appendChild(r),super({element:e}),this.container=e,this.options=function(t,e){let r={};for(let n in t)r[n]=t[n];for(let n in e)r[n]=e[n];return r}(um,t),this.disabled=!1,this.Internal=new class{constructor(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this.eventMapMoveHandler=this.handleMapMoveEvent.bind(this),this}init(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=this.getItemsLength()>0?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()}getItemsLength(){let t=0;return Object.keys(this.items).forEach((e=>{this.items[e].submenu||this.items[e].separator||t++})),t}getPixelClicked(){return this.pixelClicked}getCoordinateClicked(){return this.coordinateClicked}positionContainer(t){const e=this.Base.container,r=this.map.getSize(),n=r[1]-t[1],i=r[0]-t[0],o=e.offsetWidth,s=Math.round(this.lineHeight*this.getItemsLength()),a=gm(`li.${am.submenu}>div`,e,!0);i>=o?(e.style.right="auto",e.style.left=`${t[0]+5}px`):(e.style.left="auto",e.style.right="15px"),n>=s?(e.style.bottom="auto",e.style.top=t[1]-10+"px"):(e.style.top="auto",e.style.bottom=0),pm(e,am.hidden),a.length&&(this.submenu.lastLeft=i<2*o?`-${o}px`:this.submenu.left,a.forEach((t=>{window.innerWidth||document.documentElement.clientWidth;const e=window.innerHeight||document.documentElement.clientHeight,r=function(t){const e=t.getBoundingClientRect(),r=document.documentElement;return{left:e.left+window.pageXOffset-r.clientLeft,top:e.top+window.pageYOffset-r.clientTop,width:t.offsetWidth,height:t.offsetHeight}}(t),i=r.height;let o=n-i;o<0&&(o=i-(e-r.top),t.style.top=`-${o}px`),t.style.left=this.submenu.lastLeft})))}openMenu(t,e){this.Base.dispatchEvent({type:"open",pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)}closeMenu(){this.opened=!1,fm(this.Base.container,am.hidden),this.Base.dispatchEvent({type:"close"})}setListeners(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.on("movestart",this.eventMapMoveHandler)}removeListeners(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.un("movestart",this.eventMapMoveHandler)}handleEvent(t){const e=this;this.coordinateClicked=this.map.getEventCoordinate(t),this.pixelClicked=this.map.getEventPixel(t),this.Base.dispatchEvent({type:"beforeopen",pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===lm&&(t.stopPropagation(),t.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),t.target.addEventListener("pointerdown",{handleEvent:function(r){e.opened&&(e.closeMenu(),r.stopPropagation(),t.target.removeEventListener(r.type,this,!1))}},!1))}handleMapMoveEvent(t){this.closeMenu()}setItemListener(t,e){const r=this;var n;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",(function(t){t.preventDefault();const i={coordinate:r.getCoordinateClicked(),data:r.items[e].data||null};r.closeMenu(),n(i,r.map)}),!1))}}(this),this.Html=new bm(this,e),this.element=this.container}clear(){Object.keys(this.Internal.items).forEach(this.Html.removeMenuEntry,this.Html)}close(){this.Internal.closeMenu()}enable(){this.disabled=!1}disable(){this.disabled=!0}getDefaultItems(){return hm}countItems(){return Object.keys(this.Internal.items).length}extend(t){cm(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)}isOpen(){return this.Internal.opened}updatePosition(t){cm(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)}pop(){const t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])}push(t){cm(null!=t,"@param `item` must be informed."),this.Html.addMenuEntry(t)}shift(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])}setMap(t){Bl.prototype.setMap.call(this,t),t?this.Internal.init(t,this):this.Internal.removeListeners()}}var Em=(t=>(t.onLoadStart="onLoadStart",t.onLoadError="onLoadError",t.onLoadEnd="onLoadEnd",t.onChange="change",t.onClick="click",t.onFeatureSelected="featureSelected",t.onFeatureContextmenu="FeatureContextmenu",t.onFeatureMousemove="mousemove",t.onFeatureMouseout="mouseout",t.onFeaturesLoad="onFeaturesLoad",t.onFeaturePopupOpen="popupopen",t.onFeaturePopupClose="popupclose",t.onFeatureTooltipOpen="tooltipopen",t.onFeatureTooltiClose="toolticlose",t.onFeatureMoved="featureMoved",t.onFeatureDeleted="featureDeleted",t.onDrawStart="onDrawStart",t.onDrawEnd="onDrawEnd",t.onFeatureMoveProgress="onFeatureMoveProgress",t.onEditStart="onEditStart",t.onEditEnd="onEditEnd",t.onEditModifyStart="onEditModifyStart",t.onEditModifyEnd="onEditModifyEnd",t.onPathAnimateStart="onPathAnimateStart",t.onPathAnimateEnd="onPathAnimateEnd",t.onPathAnimateRunning="onPathAnimateRunning",t.onPathComputerComplete="onPathComputerComplete",t.onScaleChange="onScaleChange",t.onChangePosition="onChangePosition",t))(Em||{}),Cm=(t=>(t.onMapContextmenu="MapContextmenu",t.onClick="click",t.onMapMove="onMapMove",t.onMapMoveEnd="onMapMoveEnd",t.onZoomChange="onZoomChange",t.onCenterChange="onCenterChange",t.onRemoveLayer="onRemoveLayer",t.onChangeBaseLayer="onChangeBaseLayer",t))(Cm||{}),Sm=(t=>(t.tileloadstart="tileloadstart",t.tileloadend="tileloadend",t.tileloaderror="tileloaderror",t))(Sm||{});const Bm=Object.freeze(Object.defineProperty({__proto__:null,LayerEventType:Sm,XMapEventType:Cm,featureType:Em},Symbol.toStringTag,{value:"Module"}));class Im extends im{constructor(t,r){super(),e(this,"_map"),e(this,"contextmenuitems"),e(this,"contextmenu"),e(this,"EventType"),e(this,"layerid"),e(this,"layertype"),e(this,"layerSource"),e(this,"layer"),e(this,"layerclass"),e(this,"_isShow"),e(this,"_isAdded"),e(this,"option"),this.layerid=t,this.layerclass="",this._isAdded=!1,this._map=null,this.contextmenuitems=[],this.contextmenu=null,this.EventType=Bm,this.option=Object.assign({},{radio:!1},r)}initContextmenu(t){if(this.contextmenu=new xm({id:"contextmenu",width:150,defaultItems:!1,items:this.contextmenuitems}),this.contextmenu&&(this.contextmenu.set("id","contextmenu"),this._map)){this._map.addControl(this.contextmenu);let t=this;this.contextmenu.on("beforeopen",(function(e){if(t._map){let r=t._map.forEachFeatureAtPixel(e.pixel,(function(t,e){return t}));t.contextmenu.clear(),r?void 0===r.get("featuretype")||r.get("featuretype"):t.contextmenuitems.forEach((t=>{t.data={e:e}}))}})),this.contextmenu.on("open",(function(e){if(t._map){let r=t._map.forEachFeatureAtPixel(e.pixel,(function(t,e){return{feature:t,layer:e}}));r.feature?t.trigger(t.EventType.featureType.onFeatureContextmenu,{feature:r.feature,layer:r.layer,contextmenu:t.contextmenu}):t.trigger(t.EventType.XMapEventType.onMapContextmenu,null)}}))}}flyto(t){this.layer.getExtent()&&this._map.getView().fit(this.layer.getExtent(),t)}setZIndex(t){this.layer.setZIndex(t)}set show(t){this.layer.setVisible(t)}get show(){return this.layer.getVisible()}set isAdded(t){this._isAdded=t}get isAdded(){return this._isAdded}}var Tm=(t=>(t.vector="矢量图层",t.tag="标注图层",t.temp="临时图层",t.Measure="量测图层",t))(Tm||{}),Pm=(t=>(t.Point="Point",t.Line="LineString",t.MultiLineString="MultiLineString",t.Polygon="Polygon",t.MultiPolygon="MultiPolygon",t.Rectangle="Rectangle",t.Circle="Circle",t.GeometryCollection="GeometryCollection",t))(Pm||{}),Fm=(t=>(t.xyz="xyz",t.arcgisMapServer="arcgisMapServer",t.arcgisMapTile="arcgisMapTile",t.imageLayer="imageLayer",t.TileGroupLayer="TileGroupLayer",t.WmsLayer="WmsLayer",t.WmsTileLayer="WmsTileLayer",t.tencent="tencent",t.baidu="baidu",t.group="group",t))(Fm||{}),Lm=(t=>(t.EPSG3857="3857",t.EPSG4326="4326",t.EPSG4490="4490",t.IMAGE="IMAGE",t.PGIS="PGIS",t.BAIDU="BAIDU",t.GCJ02="GCJ02",t.CGCS2000_GK_Zone_3="CGCS2000_GK_Zone_3",t.CGCS2000_GK_Zone_6="CGCS2000_GK_Zone_6",t.CGCS2000_GK_CM_3_75="EPSG:4534",t.CGCS2000_GK_CM_3_78="EPSG:4535",t.CGCS2000_GK_CM_3_81="EPSG:4536",t.CGCS2000_GK_CM_3_84="EPSG:4537",t.CGCS2000_GK_CM_3_87="EPSG:4538",t.CGCS2000_GK_CM_3_90="EPSG:4539",t.CGCS2000_GK_CM_3_93="EPSG:4540",t.CGCS2000_GK_CM_3_96="EPSG:4541",t.CGCS2000_GK_CM_3_99="EPSG:4542",t.CGCS2000_GK_CM_3_102="EPSG:4543",t.CGCS2000_GK_CM_3_105="EPSG:4544",t.CGCS2000_GK_CM_3_108="EPSG:4545",t.CGCS2000_GK_CM_3_111="EPSG:4546",t.CGCS2000_GK_CM_3_114="EPSG:4547",t.CGCS2000_GK_CM_3_117="EPSG:4548",t.CGCS2000_GK_CM_3_120="EPSG:4549",t.CGCS2000_GK_CM_3_123="EPSG:4550",t.CGCS2000_GK_CM_3_126="EPSG:4551",t.CGCS2000_GK_CM_3_129="EPSG:4552",t.CGCS2000_GK_CM_3_132="EPSG:4553",t.CGCS2000_GK_CM_3_135="EPSG:4554",t.CGCS2000_GK_CM_6="CGCS2000_GK_CM_6",t.other="other",t))(Lm||{}),Mm=(t=>(t.point="point",t.hex="hex",t.square="square",t.triangle="triangle",t))(Mm||{}),Om=(t=>(t.voronoi="voronoi",t.tin="tin",t.convex="convex",t))(Om||{}),km=(t=>(t.Bounce="Bounce",t.Blink="Blink",t.Drop="Drop",t.Fade="Fade",t.Path="Path",t.Shake="Shake",t.Show="Show",t.Slide="Slide",t.Throw="Throw",t.Zoom="Zoom",t.Teleport="Teleport",t.ZoomOut="ZoomOut",t))(km||{}),Nm=(t=>(t.grayscale="grayscale",t.invert="invert",t.sepia="sepia",t.color="color",t.difference="difference",t["color-dodge"]="color-dodge",t.hue="hue",t.saturation="saturation",t.luminosity="luminosity",t.enhance="enhance",t.contrast="contrast",t))(Nm||{}),Rm=(t=>(t.emboss="emboss",t.erode="erode",t.blur="blur",t.brightness="brightness",t.contrast="contrast",t.grayscale="grayscale",t.sepia="sepia",t.hueRotate="hueRotate",t.invert="invert",t.saturate="saturate",t.paper="paper",t))(Rm||{}),Um=(t=>(t.intensity="intensity",t.color="color",t.blur="blur",t))(Um||{}),Dm=(t=>(t.hatch="hatch",t.cross="cross",t.dot="dot",t.circle="circle",t.square="square",t.tile="tile",t.woven="woven",t.crosses="crosses",t.caps="caps",t.nylon="nylon",t.hexagon="hexagon",t.cemetry="cemetry",t.sand="sand",t.conglomerate="conglomerate",t.conglomerate2="conglomerate2",t.gravel="gravel",t.brick="brick",t.dolomite="dolomite",t.coal="coal",t.breccia="breccia",t.clay="clay",t.flooded="flooded",t.chaos="chaos",t.grass="grass",t.swamp="swamp",t.reed="reed",t.wave="wave",t.vine="vine",t.forest="forest",t.forest2="forest2",t.scrub="scrub",t.tree="tree",t.tree2="tree2",t.pine="pine",t.pine2="pine2",t.mixtree="mixtree",t.mixtree2="mixtree2",t.pines="pines",t.rock="rock",t.rocks="rocks",t))(Dm||{}),Qm=(t=>(t[t.gaode_poi_text=1]="gaode_poi_text",t[t.gaode_poi_around=0]="gaode_poi_around",t[t.gaode_poi_polygon=2]="gaode_poi_polygon",t[t.gaode_route_driving=0]="gaode_route_driving",t[t.gaode_route_walking=1]="gaode_route_walking",t[t.gaode_route_integrated=2]="gaode_route_integrated",t))(Qm||{}),Gm=(t=>(t.bottomleft="bottom-left",t.bottomcenter="bottom-center",t.bottomright="bottom-right",t.centerleft="center-left",t.center="center-center",t.centerright="center-right",t.topleft="top-left",t.topcenter="top-center",t.topright="top-right",t))(Gm||{});const jm=Object.freeze(Object.defineProperty({__proto__:null,CanvasFilterType:Rm,ColorizeFilterType:Nm,PencilSketchFilterType:Um,QueryType:Qm,crsType:Lm,datagridType:Mm,drawtype:Pm,featureAnimationType:km,featureStyleType:Dm,featuretype:Tm,layertype:Fm,pointToPolygonType:Om,positioning:Gm},Symbol.toStringTag,{value:"Module"}));var Hm,zm,Vm={},Km={get exports(){return Vm},set exports(t){Vm=t}};
|
|
4
4
|
/*!
|
|
5
5
|
* kml与geojson互转工具类
|
|
6
6
|
* 版本信息:v1.1.0, hash值: 1cf0769e0dcb8c6a7e75
|
|
@@ -17,7 +17,7 @@ Hm=Vm,window,zm=function(){return function(t){var e={};function r(n){if(e[n])ret
|
|
|
17
17
|
*/
|
|
18
18
|
var n=r(7),i=r(8),o=r(9);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=A(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}(t,e,r):function(t,e){if(l.isBuffer(e)){var r=0|f(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):A(t,e);if("Buffer"===e.type&&o(e.data))return A(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(h(e),t=a(t,e<0?0:0|f(e)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function A(t,e){var r=e.length<0?0:0|f(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return Q(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var c=!0,A=0;A<l;A++)if(u(t,o+A)!==u(e,A)){c=!1;break}if(c)return o}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function _(t,e,r,n){return j(Q(e,t.length-r),t,r,n)}function w(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function b(t,e,r,n){return w(t,e,r,n)}function x(t,e,r,n){return j(G(e),t,r,n)}function E(t,e,r,n){return j(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function C(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,l,u=t[i],h=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)>127&&(h=l);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=B)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=B));return r}(n)}e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(TX){return!1}}(),e.kMaxLength=s(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,r){return u(null,t,e,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,r){return function(t,e,r,n){return h(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},l.allocUnsafe=function(t){return c(null,t)},l.allocUnsafeSlow=function(t){return c(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=l.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):d.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,r,n,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),c=0;c<a;++c)if(u[c]!==h[c]){o=u[c],s=h[c];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},l.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){var n,i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var o="",s=e;s<r;++s)o+=(n=t[s])<16?"0"+n.toString(16):n.toString(16);return o}function F(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function L(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function k(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=l.prototype;else{var i=e-t;r=new l(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},l.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},l.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),i.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),i.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),i.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),i.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},l.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},l.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=l.isBuffer(t)?t:Q(new l(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(1))},function(t,e,r){e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=u(t),s=n[0],a=n[1],l=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[h++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=16383,a=0,l=r-i;a<l;a+=s)o.push(h(t,a,a+s>l?l:a+s));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
|
19
19
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
20
|
-
e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=r?i-1:0,A=r?-1:1,f=t[e+c];for(c+=A,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=A,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=A,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,A=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?A/l:A*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+f]=255&s,f+=p,s/=256,u-=8);t[r+f-p]|=128*d}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(11),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(1))},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var n,i,o,s,a,l=1,u={},h=!1,c=t.document,A=Object.getPrototypeOf&&Object.getPrototypeOf(t);A=A&&A.setTimeout?A:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,n=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)},A.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return u[l]=i,n(l),l++},A.clearImmediate=f}function f(t){delete u[t]}function p(t){if(h)setTimeout(p,0,t);else{var e=u[t];if(e){h=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(r,n)}}(e)}finally{f(t),h=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(1),r(3))},function(t,e){function r(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}r.keys=function(){return[]},r.resolve=r,t.exports=r,r.id=12},function(t,e,r){function n(t){this.options=t||{locator:{}}}function i(){this.cdata=!1}function o(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function s(t,e,r){return"string"==typeof t?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}function a(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}n.prototype.parseFromString=function(t,e){var r=this.options,n=new h,o=r.domBuilder||new i,s=r.errorHandler,a=r.locator,u=r.xmlns||{},c=/\/x?html?$/.test(e),A=c?l.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return a&&o.setDocumentLocator(a),n.errorHandler=function(t,e,r){if(!t){if(e instanceof i)return e;t=e}var n={},o=t instanceof Function;function s(e){var i=t[e];!i&&o&&(i=2==t.length?function(r){t(e,r)}:t),n[e]=i&&function(t){i("[xmldom "+e+"]\t"+t+function(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),n}(s,o,a),n.domBuilder=r.domBuilder||o,c&&(u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",t&&"string"==typeof t?n.parse(t,u,A):n.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new A).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,r,n){var i=this.doc,s=i.createElementNS(t,r||e),l=n.length;a(this,s),this.currentElement=s,this.locator&&o(this.locator,s);for(var u=0;u<l;u++){t=n.getURI(u);var h=n.getValue(u),c=(r=n.getQName(u),i.createAttributeNS(t,r));this.locator&&o(n.getLocator(u),c),c.value=c.nodeValue=h,s.setAttributeNode(c)}},endElement:function(t,e,r){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&o(this.locator,r),a(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=s.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&o(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,r){t=s.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&o(this.locator,n),a(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(t,e,r);this.locator&&o(this.locator,i),a(this,i)}},warning:function(t){},error:function(t){},fatalError:function(t){throw new c(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){i.prototype[t]=function(){return null}}));var l=r(14),u=r(15),h=u.XMLReader,c=u.ParseError,A=e.DOMImplementation=r(4).DOMImplementation;e.XMLSerializer=r(4).XMLSerializer,e.DOMParser=n,e.__DOMHandler=i},function(t,e){e.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},function(t,e){var r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,n=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+r.source+n.source+"*(?::"+r.source+n.source+"*)?$"),o=0,s=1,a=2,l=3,u=4,h=5,c=6,A=7;function f(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,f)}function p(){}function d(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function g(t,e,r,n,i,f){function p(t,e,n){t in r.attributeNames&&f.fatalError("Attribute "+t+" redefined"),r.addValue(t,e,n)}for(var d,g=++e,y=o;;){var m=t.charAt(g);switch(m){case"=":if(y===s)d=t.slice(e,g),y=l;else{if(y!==a)throw new Error("attribute equal must after attrName");y=l}break;case"'":case'"':if(y===l||y===s){if(y===s&&(f.warning('attribute value must after "="'),d=t.slice(e,g)),e=g+1,!((g=t.indexOf(m,e))>0))throw new Error("attribute value no end '"+m+"' match");p(d,v=t.slice(e,g).replace(/&#?\w+;/g,i),e-1),y=h}else{if(y!=u)throw new Error('attribute value must after "="');p(d,v=t.slice(e,g).replace(/&#?\w+;/g,i),e),f.warning('attribute "'+d+'" missed start quot('+m+")!!"),e=g+1,y=h}break;case"/":switch(y){case o:r.setTagName(t.slice(e,g));case h:case c:case A:y=A,r.closed=!0;case u:case s:case a:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return f.error("unexpected end of input"),y==o&&r.setTagName(t.slice(e,g)),g;case">":switch(y){case o:r.setTagName(t.slice(e,g));case h:case c:case A:break;case u:case s:"/"===(v=t.slice(e,g)).slice(-1)&&(r.closed=!0,v=v.slice(0,-1));case a:y===a&&(v=d),y==u?(f.warning('attribute "'+v+'" missed quot(")!'),p(d,v.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===n[""]&&v.match(/^(?:disabled|checked|selected)$/i)||f.warning('attribute "'+v+'" missed value!! "'+v+'" instead!!'),p(v,v,e));break;case l:throw new Error("attribute value missed!!")}return g;case"":m=" ";default:if(m<=" ")switch(y){case o:r.setTagName(t.slice(e,g)),y=c;break;case s:d=t.slice(e,g),y=a;break;case u:var v=t.slice(e,g).replace(/&#?\w+;/g,i);f.warning('attribute "'+v+'" missed quot(")!!'),p(d,v,e);case h:y=c}else switch(y){case a:r.tagName,"http://www.w3.org/1999/xhtml"===n[""]&&d.match(/^(?:disabled|checked|selected)$/i)||f.warning('attribute "'+d+'" missed value!! "'+d+'" instead2!!'),p(d,d,e),e=g,y=s;break;case h:f.warning('attribute space is required"'+d+'"!!');case c:y=s,e=g;break;case l:y=u,e=g;break;case A:throw new Error("elements closed character '/' and '>' must be connected to")}}g++}}function y(t,e,r){for(var n=t.tagName,i=null,o=t.length;o--;){var s=t[o],a=s.qName,l=s.value;if((A=a.indexOf(":"))>0)var u=s.prefix=a.slice(0,A),h=a.slice(A+1),c="xmlns"===u&&h;else h=a,u=null,c="xmlns"===a&&"";s.localName=h,!1!==c&&(null==i&&(i={},_(r,r={})),r[c]=i[c]=l,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(c,l))}for(o=t.length;o--;)(u=(s=t[o]).prefix)&&("xml"===u&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(s.uri=r[u||""]));var A;(A=n.indexOf(":"))>0?(u=t.prefix=n.slice(0,A),h=t.localName=n.slice(A+1)):(u=null,h=t.localName=n);var f=t.uri=r[u||""];if(e.startElement(f,h,n,t),!t.closed)return t.currentNSMap=r,t.localNSMap=i,!0;if(e.endElement(f,h,n),i)for(u in i)e.endPrefixMapping(u)}function m(t,e,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var o=t.indexOf("</"+r+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(r)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,n),i.characters(s,0,s.length),o)}return e+1}function v(t,e,r,n){var i=n[r];return null==i&&((i=t.lastIndexOf("</"+r+">"))<e&&(i=t.lastIndexOf("</"+r)),n[r]=i),i<e}function _(t,e){for(var r in t)e[r]=t[r]}function w(t,e,r,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(i=t.indexOf("--\x3e",e+4))>e?(r.comment(t,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var i=t.indexOf("]]>",e+9);return r.startCDATA(),r.characters(t,e+9,i-e-9),r.endCDATA(),i+3}var o=function(t,e){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);r=i.exec(t);)if(n.push(r),r[1])return n}(t,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],l=!1,u=!1;s>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],u=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var h=o[s-1];return r.startDTD(a,l,u),r.endDTD(),h.index+h[0].length}return-1}function b(t,e,r){var n=t.indexOf("?>",e);if(n){var i=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,r.processingInstruction(i[1],i[2]),n+2):-1}return-1}function x(){this.attributeNames={}}f.prototype=new Error,f.prototype.name=f.name,p.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),_(e,e={}),function(t,e,r,n,i){function o(t){var e=t.slice(1,-1);return e in r?r[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(i.error("entity not found:"+t),t)}function s(e){if(e>_){var r=t.substring(_,e).replace(/&#?\w+;/g,o);c&&a(_),n.characters(r,0,e-_),_=e}}function a(e,r){for(;e>=u&&(r=h.exec(t));)l=r.index,u=l+r[0].length,c.lineNumber++;c.columnNumber=e-l+1}for(var l=0,u=0,h=/.*(?:\r\n?|\n)|.*$/g,c=n.locator,A=[{currentNSMap:e}],p={},_=0;;){try{var E=t.indexOf("<",_);if(E<0){if(!t.substr(_).match(/^\s*$/)){var C=n.doc,S=C.createTextNode(t.substr(_));C.appendChild(S),n.currentElement=S}return}switch(E>_&&s(E),t.charAt(E+1)){case"/":var B=t.indexOf(">",E+3),I=t.substring(E+2,B),T=A.pop();B<0?(I=t.substring(E+2).replace(/[\s<].*/,""),i.error("end tag name: "+I+" is not complete:"+T.tagName),B=E+1+I.length):I.match(/\s</)&&(I=I.replace(/[\s<].*/,""),i.error("end tag name: "+I+" maybe not complete"),B=E+1+I.length);var P=T.localNSMap,F=T.tagName==I;if(F||T.tagName&&T.tagName.toLowerCase()==I.toLowerCase()){if(n.endElement(T.uri,T.localName,I),P)for(var L in P)n.endPrefixMapping(L);F||i.fatalError("end tag name: "+I+" is not match the current start tagName:"+T.tagName)}else A.push(T);B++;break;case"?":c&&a(E),B=b(t,E,n);break;case"!":c&&a(E),B=w(t,E,n,i);break;default:c&&a(E);var M=new x,O=A[A.length-1].currentNSMap,k=(B=g(t,E,M,O,o,i),M.length);if(!M.closed&&v(t,B,M.tagName,p)&&(M.closed=!0,r.nbsp||i.warning("unclosed xml attribute")),c&&k){for(var N=d(c,{}),R=0;R<k;R++){var U=M[R];a(U.offset),U.locator=d(c,{})}n.locator=N,y(M,n,O)&&A.push(M),n.locator=c}else y(M,n,O)&&A.push(M);"http://www.w3.org/1999/xhtml"!==M.uri||M.closed?B++:B=m(t,B,M.tagName,o,n)}}catch(TX){if(TX instanceof f)throw TX;i.error("element parse error: "+TX),B=-1}B>_?_=B:s(Math.max(E,_)+1)}}(t,e,r,n,this.errorHandler),n.endDocument()}},x.prototype={setTagName:function(t){if(!i.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!i.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=p,e.ParseError=f},function(t,e,r){r.r(e),r.d(e,"toKml",(function(){return A})),r.d(e,"toGeoJSON",(function(){return g}));var n=r(5),i=r(0);function o(t,e){return function(r){if(!r.properties||!s.valid(r.geometry))return"";var n=s.any(r.geometry);if(!n)return"";var i="",o="";if(t.simplestyle){var a=function(t){var e="";return t["marker-symbol"]&&(e=e+"ms"+t["marker-symbol"]),t["marker-color"]&&(e=e+"mc"+t["marker-color"].replace("#","")),t["marker-size"]&&(e=e+"ms"+t["marker-size"]),t.stroke&&(e=e+"s"+t.stroke.replace("#","")),t["stroke-width"]&&(e=e+"sw"+t["stroke-width"].toString().replace(".","")),t["stroke-opacity"]&&(e=e+"mo"+t["stroke-opacity"].toString().replace(".","")),t.fill&&(e=e+"f"+t.fill.replace("#","")),t["fill-opacity"]&&(e=e+"fo"+t["fill-opacity"].toString().replace(".","")),e}(r.properties);a&&(s.isPoint(r.geometry)&&function(t){return!!(t["marker-size"]||t["marker-symbol"]||t["marker-color"])}(r.properties)?(-1===e.indexOf(a)&&(i=function(t,e){return c("Style",c("IconStyle",c("Icon",c("href",function(t){return t["marker-symbol"]}(t))))+c("hotSpot","",[["xunits","fraction"],["yunits","fraction"],["x",.5],["y",.5]]),[["id",e]])}(r.properties,a),e.push(a)),o=c("styleUrl","#"+a)):(s.isPolygon(r.geometry)||s.isLine(r.geometry))&&function(t){for(var e in t)if({stroke:!0,"stroke-opacity":!0,"stroke-width":!0,fill:!0,"fill-opacity":!0}[e])return!0}(r.properties)&&(-1===e.indexOf(a)&&(i=function(t,e){var r=c("LineStyle",[c("color",l(t.stroke,t["stroke-opacity"])||"ff555555")+c("width",void 0===t["stroke-width"]?2:t["stroke-width"])]),n="";return(t.fill||t["fill-opacity"])&&(n=c("PolyStyle",[c("color",l(t.fill,t["fill-opacity"])||"88555555")])),c("Style",r+n,[["id",e]])}(r.properties,a),e.push(a)),o=c("styleUrl","#"+a)))}return i+c("Placemark",function(t,e){return t[e.name]?c("name",u(t[e.name])):""}(r.properties,t)+function(t,e){return t[e.description]?c("description",u(t[e.description])):""}(r.properties,t)+function(t){var e,r=[];for(var n in t){var i=t[n];e=i,"[object Object]"===Object.prototype.toString.call(e)?r.push('<Data name ="'.concat(n,'"><value>').concat(JSON.stringify(i),"</value></Data>")):r.push('<Data name ="'.concat(n,'"><value>').concat(i,"</value></Data>"))}return c("ExtendedData",r.join(""))}(r.properties)+function(t,e){return t[e.timestamp]?c("TimeStamp",c("when",u(t[e.timestamp]))):""}(r.properties,t)+n+o)}}var s={Point:function(t){return c("Point",c("coordinates",t.coordinates.join(",")))},LineString:function(t){return c("LineString",c("coordinates",a(t.coordinates)))},Polygon:function(t){if(!t.coordinates.length)return"";var e=t.coordinates[0],r=t.coordinates.slice(1),n=c("outerBoundaryIs",c("LinearRing",c("coordinates",a(e)))),i=r.map((function(t){return c("innerBoundaryIs",c("LinearRing",c("coordinates",a(t))))})).join("");return c("Polygon",n+i)},MultiPoint:function(t){return t.coordinates.length?c("MultiGeometry",t.coordinates.map((function(t){return s.Point({coordinates:t})})).join("")):""},MultiPolygon:function(t){return t.coordinates.length?c("MultiGeometry",t.coordinates.map((function(t){return s.Polygon({coordinates:t})})).join("")):""},MultiLineString:function(t){return t.coordinates.length?c("MultiGeometry",t.coordinates.map((function(t){return s.LineString({coordinates:t})})).join("")):""},GeometryCollection:function(t){return c("MultiGeometry",t.geometries.map(s.any).join(""))},valid:function(t){return t&&t.type&&(t.coordinates||"GeometryCollection"===t.type&&t.geometries&&t.geometries.every(s.valid))},any:function(t){return s[t.type]?s[t.type](t):""},isPoint:function(t){return"Point"===t.type||"MultiPoint"===t.type},isPolygon:function(t){return"Polygon"===t.type||"MultiPolygon"===t.type},isLine:function(t){return"LineString"===t.type||"MultiLineString"===t.type}};function a(t){return t.map((function(t){return t.join(",")})).join(" ")}function l(t,e){if("string"!=typeof t)return"";if(3===(t=t.replace("#","").toLowerCase()).length)t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2];else if(6!==t.length)return"";var r=t[0]+t[1],n=t[2]+t[3],i=t[4]+t[5],o="ff";return"number"==typeof e&&e>=0&&e<=1&&((o=(255*e).toString(16)).indexOf(".")>-1&&(o=o.substr(0,o.indexOf("."))),o.length<2&&(o="0"+o)),o+i+n+r}function u(t){return t?t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}var h={">":">","<":"<","'":"'",'"':""","&":"&"};function c(t,e,r){return(Array.isArray(e)||"string"==typeof e)&&(r=e,e={}),Array.isArray(r)&&(r="\n"+r.map((function(t){return" "+t})).join("\n")+"\n"),"<"+t+function(t){return Object.keys(t).length?" "+Object.keys(t).map((function(e){return e+'="'+function(t,e){var r;if(null!=t)return e=(e||"").replace(/[^&"<>\']/g,""),r="([&\"<>'])".replace(new RegExp("["+e+"]","g"),""),t.replace(new RegExp(r,"g"),(function(t,e){return h[e]}))}(t[e])+'"'})).join(" "):""}(e)+">"+r+"</"+t+">"}function A(t,e){return t.features&&t.features.forEach((function(t){if(t.properties){var e=t.properties.style;if(e){if(e.image)return t.properties["marker-symbol"]=e.image,void(e.outlineColor&&(t.properties["marker-color"]=e.outlineColor));var r,n,i;e.color&&(t.properties.fill=e.color,e.opacity&&(t.properties["fill-opacity"]=e.opacity)),e.outlineColor&&(t.properties.stroke=e.outlineColor,t.properties["stroke-width"]=null!==(r=e.outlineWidth)&&void 0!==r?r:1,t.properties["stroke-opacity"]=null!==(n=null!==(i=e.outlineOpacity)&&void 0!==i?i:e.opacity)&&void 0!==n?n:1)}}})),function(t,e){return'<?xml version="1.0" encoding="UTF-8"?>'+c("kml",c("Document",function(t){return void 0!==t.documentName?c("name",t.documentName):""}(e=e||{documentName:void 0,documentDescription:void 0,name:"name",description:"description",simplestyle:!1,timestamp:"timestamp"})+function(t){return void 0!==t.documentDescription?c("description",t.documentDescription):""}(e)+function(t,e){if(!t.type)return"";var r=[];switch(t.type){case"FeatureCollection":return t.features?t.features.map(o(e,r)).join(""):"";case"Feature":return o(e,r)(t);default:return o(e,r)({type:"Feature",geometry:t,properties:{}})}}(t,e)),[["xmlns","http://www.opengis.net/kml/2.2"]])}(t,e)}var f=function(t){return(new DOMParser).parseFromString(t,"text/xml")},p=function(t){return t.split(".").pop()},d=function(t){return(new n).loadAsync(t).then((function(t){var e=null;return t.forEach((function(t,r){"kml"===p(t)&&null===e&&(e=r.async("string").then(f))})),e||Promise.reject("No kml file found")}))};function g(t){if(!t)return Promise.reject("参数不能为空");if("string"==typeof(o=t)&&o.constructor==String){var e=p(t);if("kml"===e)return Cesium.Resource.fetchXML(t).then((function(t){return Object(i.a)(t)}));if("kmz"===e)return Cesium.Resource.fetchBlob(t).then((function(t){return d(t)})).then((function(t){return Object(i.a)(t)}));var r=Object(i.a)(f(t));return Promise.resolve(r)}if(t.getRootNode){var n=Object(i.a)(t);return Promise.resolve(n)}return d(t).then((function(t){return Object(i.a)(t)}));var o}}])},Km.exports=zm(),window.ol&&!ol.ext&&(ol.ext={});var qm=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t};window.ol&&(ol.inherits||(ol.inherits=qm)),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.Element&&!Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var Wm=function(t){var e;t||(t={});var r=this.canvas_=document.createElement("canvas"),n=(Number(t.scale)>0?Number(t.scale):1)*lt||lt,i=r.getContext("2d");if(t.image){var o;t.image.load();var s=t.image.getImage();if(s.width)r.width=Math.round(s.width*n),r.height=Math.round(s.height*n),i.globalAlpha="number"==typeof t.opacity?t.opacity:1,i.drawImage(s,0,0,s.width,s.height,0,0,r.width,r.height),e=i.createPattern(r,"repeat");else{var a=this;e=[0,0,0,0],s.onload=function(){r.width=Math.round(s.width*n),r.height=Math.round(s.height*n),i.globalAlpha="number"==typeof t.opacity?t.opacity:1,i.drawImage(s,0,0,s.width,s.height,0,0,r.width,r.height),e=i.createPattern(r,"repeat"),a.setColor(e)}}}else{var l=this.getPattern_(t);if(r.width=Math.round(l.width*n),r.height=Math.round(l.height*n),i.beginPath(),t.fill&&(i.fillStyle=Kn(t.fill.getColor()),i.fillRect(0,0,r.width,r.height)),i.scale(n,n),i.lineCap="round",i.lineWidth=l.stroke||1,i.fillStyle=Kn(t.color||"#000"),i.strokeStyle=Kn(t.color||"#000"),l.circles)for(o=0;o<l.circles.length;o++){var u=l.circles[o];i.beginPath(),i.arc(u[0],u[1],u[2],0,2*Math.PI),l.fill&&i.fill(),l.stroke&&i.stroke()}if(l.repeat||(l.repeat=[[0,0]]),l.char&&(i.font=l.font||l.width+"px Arial",i.textAlign="center",i.textBaseline="middle",l.angle?(i.fillText(l.char,l.width/4,l.height/4),i.fillText(l.char,5*l.width/4,5*l.height/4),i.fillText(l.char,l.width/4,5*l.height/4),i.fillText(l.char,5*l.width/4,l.height/4),i.fillText(l.char,3*l.width/4,3*l.height/4),i.fillText(l.char,-l.width/4,-l.height/4),i.fillText(l.char,3*l.width/4,-l.height/4),i.fillText(l.char,-l.width/4,3*l.height/4)):i.fillText(l.char,l.width/2,l.height/2)),l.lines)for(o=0;o<l.lines.length;o++)for(var h=0;h<l.repeat.length;h++){var c=l.lines[o];i.beginPath(),i.moveTo(c[0]+l.repeat[h][0],c[1]+l.repeat[h][1]);for(var A=2;A<c.length;A+=2)i.lineTo(c[A]+l.repeat[h][0],c[A+1]+l.repeat[h][1]);l.fill&&i.fill(),l.stroke&&i.stroke(),i.save(),i.strokeStyle="red",i.strokeWidth=.1,i.restore()}if(e=i.createPattern(r,"repeat"),t.offset){var f=t.offset;if("number"==typeof f&&(f=[f,f]),f instanceof Array){var p=Math.round(f[0]*n),d=Math.round(f[1]*n);i.scale(1/n,1/n),i.clearRect(0,0,r.width,r.height),i.translate(p,d),i.fillStyle=e,i.fillRect(-p,-d,r.width,r.height),e=i.createPattern(r,"repeat")}}}Fn.call(this,{color:e})};qm(Wm,Fn),Wm.prototype.clone=function(){var t=Fn.prototype.clone.call(this);return t.canvas_=this.canvas_,t},Wm.prototype.getImage=function(){return this.canvas_},Wm.prototype.getPattern_=function(t){var e,r=Wm.prototype.patterns[t.pattern]||Wm.prototype.patterns.dot,n=Math.round(t.spacing)||10;switch(t.pattern){case"dot":case"circle":e=0===t.size?0:t.size/2||2,t.angle?(n=r.width=r.height=Math.round(1.4*n),r.circles=[[n/4,n/4,e],[3*n/4,3*n/4,e]],"circle"==t.pattern&&(r.circles=r.circles.concat([[n/4+n,n/4,e],[n/4,n/4+n,e],[3*n/4-n,3*n/4,e],[3*n/4,3*n/4-n,e],[n/4+n,n/4+n,e],[3*n/4-n,3*n/4-n,e]]))):(r.width=r.height=n,r.circles=[[n/2,n/2,e]],"circle"==t.pattern&&(r.circles=r.circles.concat([[n/2+n,n/2,e],[n/2-n,n/2,e],[n/2,n/2+n,e],[n/2,n/2-n,e],[n/2+n,n/2+n,e],[n/2+n,n/2-n,e],[n/2-n,n/2+n,e],[n/2-n,n/2-n,e]])));break;case"tile":case"square":e=0===t.size?0:t.size/2||2,t.angle?(r.width=r.height=n,r.lines=[[n/2-e,n/2,n/2,n/2-e,n/2+e,n/2,n/2,n/2+e,n/2-e,n/2]]):(r.width=r.height=n,r.lines=[[n/2-e,n/2-e,n/2+e,n/2-e,n/2+e,n/2+e,n/2-e,n/2+e,n/2-e,n/2-e]]),"square"==t.pattern&&(r.repeat=[[0,0],[0,n],[n,0],[0,-n],[-n,0],[-n,-n],[n,n],[-n,n],[n,-n]]);break;case"cross":t.angle&&(t.angle=45);case"hatch":var i=Math.round(((t.angle||0)-90)%360);i>180&&(i-=360),i*=Math.PI/180;var o=Math.cos(i),s=Math.sin(i);if(Math.abs(s)<1e-4)r.width=r.height=n,r.lines=[[0,.5,n,.5]],r.repeat=[[0,0],[0,n]];else if(Math.abs(o)<1e-4)r.width=r.height=n,r.lines=[[.5,0,.5,n]],r.repeat=[[0,0],[n,0]],"cross"==t.pattern&&(r.lines.push([0,.5,n,.5]),r.repeat.push([0,n]));else{var a=r.width=Math.round(Math.abs(n/s))||1,l=r.height=Math.round(Math.abs(n/o))||1;"cross"==t.pattern?(r.lines=[[-a,-l,2*a,2*l],[2*a,-l,-a,2*l]],r.repeat=[[0,0]]):o*s>0?(r.lines=[[-a,-l,2*a,2*l]],r.repeat=[[0,0],[a,0],[0,l]]):(r.lines=[[2*a,-l,-a,2*l]],r.repeat=[[0,0],[-a,0],[0,l]])}r.stroke=0===t.size?0:t.size||4}return r},Wm.addPattern=function(t,e){e||(e={}),Wm.prototype.patterns[t||e.char]={width:e.width||e.size||10,height:e.height||e.size||10,font:e.font,char:e.char,circles:e.circles,lines:e.lines,repeat:e.repeat,stroke:e.stroke,angle:e.angle,fill:e.fill}},Wm.prototype.patterns={hatch:{width:5,height:5,lines:[[0,2.5,5,2.5]],stroke:1},cross:{width:7,height:7,lines:[[0,3,10,3],[3,0,3,10]],stroke:1},dot:{width:8,height:8,circles:[[5,5,2]],stroke:!1,fill:!0},circle:{width:10,height:10,circles:[[5,5,2]],stroke:1,fill:!1},square:{width:10,height:10,lines:[[3,3,3,8,8,8,8,3,3,3]],stroke:1,fill:!1},tile:{width:10,height:10,lines:[[3,3,3,8,8,8,8,3,3,3]],fill:!0},woven:{width:12,height:12,lines:[[3,3,9,9],[0,12,3,9],[9,3,12,0],[-1,1,1,-1],[13,11,11,13]],stroke:1},crosses:{width:8,height:8,lines:[[2,2,6,6],[2,6,6,2]],stroke:1},caps:{width:8,height:8,lines:[[2,6,4,2,6,6]],stroke:1},nylon:{width:20,height:20,lines:[[1,6,1,1,6,1],[6,11,11,11,11,6],[11,16,11,21,16,21],[16,11,21,11,21,16]],repeat:[[0,0],[-20,0],[0,-20]],stroke:1},hexagon:{width:20,height:12,lines:[[0,10,4,4,10,4,14,10,10,16,4,16,0,10]],stroke:1,repeat:[[0,0],[10,6],[10,-6],[-10,-6]]},cemetry:{width:15,height:19,lines:[[0,3.5,7,3.5],[3.5,0,3.5,10]],stroke:1,repeat:[[0,0],[7,9]]},sand:{width:20,height:20,circles:[[1,2,1],[9,3,1],[2,16,1],[7,8,1],[6,14,1],[4,19,1],[14,2,1],[12,10,1],[14,18,1],[18,8,1],[18,14,1]],fill:1},conglomerate:{width:60,height:40,circles:[[2,4,1],[17,3,1],[26,18,1],[12,17,1],[5,17,2],[28,11,2]],lines:[[7,5,6,7,9,9,11,8,11,6,9,5,7,5],[16,10,15,13,16,14,19,15,21,13,22,9,20,8,19,8,16,10],[24,6,26,7,27,5,26,4,24,4,24,6]],repeat:[[30,0],[-15,20],[15,20],[45,20]],stroke:1},conglomerate2:{width:60,height:40,circles:[[2,4,1],[17,3,1],[26,18,1],[12,17,1],[5,17,2],[28,11,2]],lines:[[7,5,6,7,9,9,11,8,11,6,9,5,7,5],[16,10,15,13,16,14,19,15,21,13,22,9,20,8,19,8,16,10],[24,6,26,7,27,5,26,4,24,4,24,6]],repeat:[[30,0],[-15,20],[15,20],[45,20]],fill:1},gravel:{width:15,height:10,circles:[[4,2,1],[5,9,1],[1,7,1]],lines:[[7,5,6,6,7,7,8,7,9,7,10,5,9,4,7,5],[11,2,14,4,14,1,12,1,11,2]],stroke:1},brick:{width:18,height:16,lines:[[0,1,18,1],[0,10,18,10],[6,1,6,10],[12,10,12,18],[12,0,12,1]],stroke:1},dolomite:{width:20,height:16,lines:[[0,1,20,1],[0,9,20,9],[1,9,6,1],[11,9,14,16],[14,0,14.4,1]],stroke:1},coal:{width:20,height:16,lines:[[1,5,7,1,7,7],[11,10,12,5,18,9],[5,10,2,15,9,15],[15,16,15,13,20,16],[15,0,15,2,20,0]],fill:1},breccia:{width:20,height:16,lines:[[1,5,7,1,7,7,1,5],[11,10,12,5,18,9,11,10],[5,10,2,15,9,15,5,10],[15,16,15,13,22,18],[15,0,15,2,20,0]],stroke:1},clay:{width:20,height:20,lines:[[0,0,3,11,0,20],[11,0,10,3,13,13,11,20],[0,0,10,3,20,0],[0,12,3,11,13,13,20,12]],stroke:1},flooded:{width:15,height:10,lines:[[0,1,10,1],[0,6,5,6],[10,6,15,6]],stroke:1},chaos:{width:40,height:40,lines:[[40,2,40,0,38,0,40,2],[4,0,3,2,2,5,0,0,0,3,2,7,5,6,7,7,8,10,9,12,9,13,9,14,8,14,6,15,2,15,0,20,0,22,2,20,5,19,8,15,10,14,11,12.25,10,12,10,10,12,9,13,7,12,6,13,4,16,7,17,4,20,0,18,0,15,3,14,2,14,0,12,1,11,0,10,1,11,4,10,7,9,8,8,5,6,4,5,3,5,1,5,0,4,0],[7,1,7,3,8,3,8,2,7,1],[4,3,5,5,4,5,4,3],[34,5,33,7,38,10,38,8,36,5,34,5],[27,0,23,2,21,8,30,0,27,0],[25,8,26,12,26,16,22.71875,15.375,20,13,18,15,17,18,13,22,17,21,19,22,21,20,19,18,22,17,30,25,26,26,24,28,21.75,33.34375,20,36,18,40,20,40,24,37,25,32,27,31,26,38,27,37,30,32,32,35,36,37,38,40,38,39,40,40,37,36,34,32,37,31,36,29,33,27,34,24,39,21,40,21,40,16,37,20,31,22,32,25,27,20,29,15,30,20,32,20,34,18,33,12,31,11,29,14,26,9,25,8],[39,24,37,26,40,28,39,24],[13,15,9,19,14,18,13,15],[18,23,14,27,16,27,17,25,20,26,18,23],[6,24,2,26,1,28,2,30,5,28,12,30,16,32,18,30,15,30,12,28,9,25,7,27,6,24],[29,27,32,28,33,31,30,29,27,28,29,27],[5,35,1,33,3,36,13,38,15,35,10,36,5,35]],fill:1},grass:{width:27,height:22,lines:[[0,10.5,13,10.5],[2.5,10,1.5,7],[4.5,10,4.5,5,3.5,4],[7,10,7.5,6,8.5,3],[10,10,11,6]],repeat:[[0,0],[14,10]],stroke:1},swamp:{width:24,height:23,lines:[[0,10.5,9.5,10.5],[2.5,10,2.5,7],[4.5,10,4.5,4],[6.5,10,6.5,6],[3,12.5,7,12.5]],repeat:[[0,0],[14,10]],stroke:1},reed:{width:26,height:23,lines:[[2.5,10,2,7],[4.5,10,4.2,4],[6.5,10,6.8,4],[8.5,10,9,6],[3.7,4,3.7,2.5],[4.7,4,4.7,2.5],[6.3,4,6.3,2.5],[7.3,4,7.3,2.5]],circles:[[4.2,2.5,.5],[18.2,12.5,.5],[6.8,2.5,.5],[20.8,12.5,.5],[9,6,.5],[23,16,.5]],repeat:[[0,0],[14,10]],stroke:1},wave:{width:10,height:8,lines:[[0,0,5,4,10,0]],stroke:1},vine:{width:13,height:13,lines:[[3,0,3,6],[9,7,9,13]],stroke:1},forest:{width:55,height:30,circles:[[7,7,3.5],[20,20,1.5],[42,22,3.5],[35,5,1.5]],stroke:1},forest2:{width:55,height:30,circles:[[7,7,3.5],[20,20,1.5],[42,22,3.5],[35,5,1.5]],fill:1,stroke:1},scrub:{width:26,height:20,lines:[[1,4,4,8,6,4]],circles:[[20,13,1.5]],stroke:1},tree:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78]],repeat:[[3,1],[18,16]],stroke:1},tree2:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78,4.95,10.61,7.78,10.61]],repeat:[[3,1],[18,16]],fill:1,stroke:1},pine:{width:30,height:30,lines:[[5.66,11.31,2.83,11.31,2.83,8.49,0,8.49,2.83,0,5.66,8.49,2.83,8.49]],repeat:[[3,1],[18,16]],stroke:1},pine2:{width:30,height:30,lines:[[5.66,11.31,2.83,11.31,2.83,8.49,0,8.49,2.83,0,5.66,8.49,2.83,8.49,2.83,11.31,5.66,11.31]],repeat:[[3,1],[18,16]],fill:1,stroke:1},mixtree:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78,4.95,10.61,7.78,10.61],[23.66,27.31,20.83,27.31,20.83,24.49,18,24.49,20.83,16,23.66,24.49,20.83,24.49,20.83,27.31,23.66,27.31]],repeat:[[3,1]],stroke:1},mixtree2:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78,4.95,10.61,7.78,10.61],[23.66,27.31,20.83,27.31,20.83,24.49,18,24.49,20.83,16,23.66,24.49,20.83,24.49,20.83,27.31,23.66,27.31]],repeat:[[3,1]],fill:1,stroke:1},pines:{width:22,height:20,lines:[[1,4,3.5,1,6,4],[1,8,3.5,5,6,8],[3.5,1,3.5,11],[12,14.5,14.5,14,17,14.5],[12,18,17,18],[14.5,12,14.5,18]],repeat:[[2,1]],stroke:1},rock:{width:20,height:20,lines:[[1,0,1,9],[4,0,4,9],[7,0,7,9],[10,1,19,1],[10,4,19,4],[10,7,19,7],[0,11,9,11],[0,14,9,14],[0,17,9,17],[12,10,12,19],[15,10,15,19],[18,10,18,19]],repeat:[[.5,.5]],stroke:1},rocks:{width:20,height:20,lines:[[5,0,3,0,5,4,4,6,0,3,0,5,3,6,5,9,3.75,10,2.5,10,0,9,0,10,4,11,5,14,4,15,0,13,0,13,0,13,0,14,0,14,5,16,5,18,3,19,0,19,-.25,19.9375,5,20,10,19,10,20,11,20,12,19,14,20,15,20,17,19,20,20,20,19,19,16,20,15,20,11,20,10,19,8,20,5,20,0,19,0,20,2,19,4,17,4,16,3,15,0,14,0,15,4,11,5,10,4,11,0,10,0,9,4,6,5,5,0],[18,5,19,6,18,10,16,10,14,9,16,5,18,5],[5,6,9,5,10,6,10,9,6,10,5,6],[14,5,14,8,13,9,12,9,11,7,12,5,14,5],[5,11,8,10,9,11,10,14,6,15,6,15,5,11],[13,10,14,11,15,14,15,14,15,14,11,15,10,11,11,10,13,10],[15,12,16,11,19,11,19,15,16,14,16,14,15,12],[6,16,9,15,10,18,5,19,6,16],[10,16,14,16,14,18,13,19,11,18,10,16],[15,15,18,16,18,18,16,19,15,18,15,15]],stroke:1}};class Xm{static uuid15(){return Xm.uuid(15,16)}static CheckIsColor(t){return CSS.supports("color",t)?t:"rgba(0, 0, 0, 0.8)"}static getDefaultImageFillStyle(){let t=[],e=new Wm;for(let r in e.patterns){let e=new Wm({pattern:r});t.push({title:r,image:e.getImage().toDataURL()})}return t}static saveToShp(t,e){}static toGeoJSON(t){return(new Df).writeFeaturesObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}static formatStr(t,e){if(0===arguments.length)return null;let r=arguments[0];for(let n=1;n<arguments.length;n++){let t=new RegExp("\\{"+(n-1)+"\\}","gm");r=r.replace(t,arguments[n])}return r}static randomString(t){t=t||32;let e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz",r=e.length,n="";for(let i=0;i<t;i++)n+=e.charAt(Math.floor(Math.random()*r));return n.toLowerCase()}static uuid(t,e){let r,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];if(e=e||n.length,t)for(r=0;r<t;r++)i[r]=n[0|Math.random()*e];else{let t;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",r=0;r<36;r++)i[r]||(t=0|16*Math.random(),i[r]=n[19===r?3&t|8:t])}return i.join("")}static format(t,e){if("object"==typeof e){for(let r in e)if(void 0!==e[r]){let n=new RegExp("({"+r+"})","g");t=t.replace(n,e[r])}}else for(let r=0;r<e.length;r++)if(void 0!==e[r]){let n=new RegExp("({["+r+"]})","g");t=t.replace(n,e[r])}return t}static getQueryString(t){return new URL(window.location.href).searchParams.get(t)}static ConvertKmlToJson(t,e){Vm.toGeoJSON(t).then((t=>{e(t)}))}static saveTokml(t,e){let r=Vm.toKml(t,{name:"标绘数据",documentName:"标绘数据文件",documentDescription:"标绘数据 by 幻景科技",simplestyle:!0});Xm.downloadFile(e,r)}static saveJSON(t,e){if(!t)return void alert("保存的数据为空");e||(e="json.json"),"object"==typeof t&&(t=JSON.stringify(t,void 0,4));let r=new Blob([t],{type:"text/json"}),n=document.createEvent("MouseEvents"),i=document.createElement("a");i.download=e,i.href=window.URL.createObjectURL(r),i.dataset.downloadurl=["text/json",i.download,i.href].join(":"),n.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(n)}static downloadFile(t,e){const r=new Blob([e]),n=document.createElement("a");n.download=t,n.href=URL.createObjectURL(r),document.body.appendChild(n),n.click(),document.body.removeChild(n)}static randomHexColor(){return"#"+Math.random().toString(16).substring(2,6).toUpperCase()}static randomRgbColor(t=1){return Xm.hexToRgba(Xm.randomHexColor(),t)}static rgbToHex(t){let e,r,n,i,o=t.replace(/\s+/g,"").match(/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([.\d]+))?\)/);return o?(e=(+o[1]).toString(16),e=1===e.length?"0"+e:e,r=(+o[2]).toString(16),r=1===r.length?"0"+r:r,n=(+o[3]).toString(16),n=1===n.length?"0"+n:n,i=+(o[5]?o[5]:1),{hex:"#"+e+r+n,alpha:i}):{hex:t,alpha:1}}static hexToRgba(t,e){let r=t.toLowerCase();if(r&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(r)){if(4===r.length){let t="#";for(let e=1;e<4;e+=1)t+=r.slice(e,e+1).concat(r.slice(e,e+1));r=t}let t=[];for(let e=1;e<7;e+=2)t.push(parseInt("0x"+r.slice(e,e+2)));return"rgba("+t.join(",")+","+e+")"}return r}}const Ym=class{constructor(t){e(this,"overlayStyle"),e(this,"StylesList",{highlightStyle:new Vi({stroke:new Rn({color:"rgba(0, 255, 0,1)",width:5}),fill:new Fn({color:"rgba(0, 255, 0,0.0)"}),text:new Wi({text:"",font:"12px Calibri,sans-serif",fill:new Fn({color:"#000"}),stroke:new Rn({color:"#f00",width:3})}),image:new Di({radius:5,fill:new Fn({color:"rgba(0, 255, 0,1)"}),stroke:new Rn({color:"rgba(255, 255, 255,1)",width:2})})}),point:new Vi({text:new Wi({font:Ym.option.Point.Font,text:"",offsetX:Ym.option.Point.FontoffsetX,offsetY:Ym.option.Point.FontoffsetY,fill:new Fn({color:Ym.option.Point.FontColor}),stroke:new Rn({color:Ym.option.Point.FontStrokeColor,width:Ym.option.Point.FontStrokeWidth})}),image:new Di({scale:Ym.option.Point.scale,radius:Ym.option.Point.radius,fill:new Fn({color:Ym.option.Point.fillcolor}),stroke:new Rn({color:Ym.option.Point.strokecolor,width:Ym.option.Point.strokewidth})})}),polyline:new Vi({stroke:new Rn({color:Ym.option.LineString.strokecolor,width:Ym.option.LineString.strokewidth}),text:new Wi({text:"",font:Ym.option.LineString.Font,fill:new Fn({color:Ym.option.LineString.FontColor}),stroke:new Rn({color:Ym.option.LineString.FontStrokeColor,width:Ym.option.LineString.FontStrokeWidth})})}),polygon:new Vi({stroke:new Rn({color:Ym.option.Polygon.strokecolor,width:Ym.option.Polygon.strokewidth}),fill:new Fn({color:Ym.option.Polygon.fillcolor}),text:new Wi({text:"",font:Ym.option.Polygon.Font,fill:new Fn({color:Ym.option.Polygon.FontColor}),stroke:new Rn({color:Ym.option.Polygon.FontStrokeColor,width:Ym.option.Polygon.FontStrokeWidth})})}),bufferStyle:new Vi({stroke:new Rn({color:Ym.option.bufferStyle.strokecolor,width:Ym.option.bufferStyle.strokewidth,lineDash:[10,10]}),fill:new Fn({color:Ym.option.bufferStyle.fillcolor}),text:new Wi({text:"",font:Ym.option.bufferStyle.Font,fill:new Fn({color:Ym.option.bufferStyle.FontColor}),stroke:new Rn({color:Ym.option.bufferStyle.FontStrokeColor,width:Ym.option.bufferStyle.FontStrokeWidth})})}),overlapStyle:new Vi({stroke:new Rn({color:Ym.option.overlapStyle.strokecolor,width:Ym.option.overlapStyle.strokewidth}),fill:new Fn({color:Ym.option.overlapStyle.fillcolor}),text:new Wi({text:"",font:Ym.option.overlapStyle.Font,fill:new Fn({color:Ym.option.overlapStyle.FontColor}),stroke:new Rn({color:Ym.option.overlapStyle.FontStrokeColor,width:Ym.option.overlapStyle.FontStrokeWidth})}),image:new Di({radius:5,fill:new Fn({color:Ym.option.overlapStyle.fillcolor}),stroke:new Rn({color:Ym.option.overlapStyle.strokecolor,width:Ym.option.overlapStyle.strokewidth})}),zIndex:1/0}),MultiLineString:new Vi({stroke:new Rn({color:"green",width:1})}),MultiPoint:new Vi({image:Ym.image}),MultiPolygon:new Vi({stroke:new Rn({color:"yellow",width:1}),fill:new Fn({color:"rgba(255, 255, 0, 0.1)"})}),Circle:new Vi({stroke:new Rn({color:Ym.option.Polygon.strokecolor,width:Ym.option.Polygon.strokewidth}),fill:new Fn({color:Ym.option.Polygon.fillcolor})}),square:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:4,radius:10,angle:Math.PI/4})}),triangle:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:3,radius:10,rotation:Math.PI/4,angle:0})}),star:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:5,radius:10,radius2:4,angle:0})}),cross:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:4,radius:10,radius2:0,angle:0})}),x:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:4,radius:10,radius2:0,angle:Math.PI/4})}),GeometryCollection:new Vi({fill:new Fn({color:"rgba(255, 255, 255, 0.1)"}),stroke:new Rn({color:"rgba(255, 255, 0, 1)",width:3}),image:new Di({radius:5,stroke:new Rn({color:"rgba(255, 0,0, 1)",width:2}),fill:new Fn({color:"rgba(255, 255, 0, 1)"})})})}),e(this,"option",{overlapStyle:{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:0,fillcolor:"rgba(255, 255, 255,0.5)",strokecolor:"blue",strokewidth:3,strokeradius:5}}),this.overlayStyle=function(){const t={};return t.Polygon=[new Vi({fill:new Fn({color:[255,255,255,.5]})}),new Vi({stroke:new Rn({color:[255,255,255,1],width:5})}),new Vi({stroke:new Rn({color:[0,153,255,1],width:3})}),new Vi({image:new Di({radius:3,fill:new Fn({color:"red"})})})],t.MultiPolygon=t.Polygon,t.LineString=[new Vi({stroke:new Rn({color:[255,255,255,1],width:5})}),new Vi({stroke:new Rn({color:[0,153,255,1],width:3})})],t.MultiLineString=t.LineString,t.Point=[new Vi({image:new Di({radius:7,fill:new Fn({color:[0,153,255,1]}),stroke:new Rn({color:[255,255,255,.75],width:1.5})}),zIndex:1e5})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.Point),function(e,r){return t[e.getGeometry().getType()]}}()}static getStyle(t,e){let r;switch(t){case Pm.Point:r=(null==e?void 0:e.imageOption)?Ym.getIconStyle(e):Ym.getPointStyle(e);break;case Pm.Line:r=Ym.getPolylineStyle(e);break;case Pm.Polygon:case Pm.MultiPolygon:case Pm.Rectangle:case Pm.Circle:r=Ym.getPolygonStyle(e);break;case Pm.GeometryCollection:r=new Vi({fill:new Fn({color:"rgba(255, 255, 255, 0.1)"}),stroke:new Rn({color:"rgba(255, 255, 0, 1)",width:3}),image:new Di({radius:5,stroke:new Rn({color:"rgba(255, 0,0, 1)",width:2}),fill:new Fn({color:"rgba(255, 255, 0, 1)"})})})}return r}static getDefaultPointStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:-10,fillcolor:"rgba(0, 153, 255,1)",strokecolor:"rgba(255, 255, 255,1)",strokewidth:1,radius:3,scale:1,text:""}}static getDefaulLineStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:10,fillcolor:"rgba(255, 255, 0,1)",strokecolor:"rgba(255, 255, 0,1)",strokewidth:2,strokeradius:5,strokelineDash:null,strokelineCap:"round",strokelineJoin:"round",text:""}}static getDefaultBufferStyleStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:0,fillcolor:"rgba(255, 255, 255,0.2)",strokecolor:"rgba(255, 0, 0,1)",strokewidth:2,strokeradius:5,text:""}}static getDefaultPolygonStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:0,fillcolor:"rgba(255, 255, 255,0.2)",strokecolor:"rgba(255, 255, 0,1)",strokewidth:2,strokeradius:5,text:""}}static getTipStyle(){return new Vi({text:new Wi({font:"12px Calibri,sans-serif",fill:new Fn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new Fn({color:"rgba(0, 0, 0, 0.8)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})})}static getIconStyle(t){for(let r in t)""===t[r]&&delete t[r];let e=Object.assign({},Ym.getDefaultPointStyle(),t);return new Vi({text:new Wi({font:e.Font,text:e.text,offsetX:e.FontoffsetX,offsetY:e.FontoffsetY,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})}),image:new Us(e.imageOption)})}static getPointStyle(t){for(let n in t)""===t[n].toString()&&delete t[n];let e,r=Object.assign({},Ym.getDefaultPointStyle(),t);switch(r.GraphicStyle){case"STYLE_TRIANGLE":e=new Ri({scale:r.scale,radius:r.radius,points:3,angle:Math.PI,displacement:[0,10],fill:new Fn({color:Xm.CheckIsColor(r.fillcolor)}),stroke:new Rn({color:Xm.CheckIsColor(r.strokecolor),width:r.strokewidth})});break;case"STYLE_SQUARE":e=new Ri({scale:r.scale,radius:r.radius,points:4,angle:Math.PI/4,fill:new Fn({color:Xm.CheckIsColor(r.fillcolor)}),stroke:new Rn({color:Xm.CheckIsColor(r.strokecolor),width:r.strokewidth})});break;default:e=new Di({scale:r.scale,radius:r.radius,fill:new Fn({color:Xm.CheckIsColor(r.fillcolor)}),stroke:new Rn({color:Xm.CheckIsColor(r.strokecolor),width:r.strokewidth})})}return new Vi({text:new Wi({font:r.Font,text:r.text,offsetX:r.FontoffsetX,offsetY:r.FontoffsetY,fill:new Fn({color:Xm.CheckIsColor(r.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(r.FontStrokeColor),width:r.FontStrokeWidth})}),image:e})}static getPolylineStyle(t){for(let r in t)""===t[r].toString()&&delete t[r];let e=Object.assign({},Ym.getDefaulLineStyle(),t);switch(e.GraphicStyle){case"STYLE_DASH":e.strokelineDash=[15,10];break;case"STYLE_SOLID":e.strokelineDash=null;break;case"STYLE_DOT":e.strokelineDash=[2,5];break;case"STYLE_DASHDOT":e.strokelineDash=[2,10,15,10]}return new Vi({stroke:new Rn({color:e.strokecolor,width:e.strokewidth,lineDash:e.strokelineDash}),text:new Wi({text:e.text,font:e.Font,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})})})}static getTrackLineStyle(t,e){t.getGeometry();let r=[new Vi({stroke:new Rn({color:"#2E8B57",width:10})})];t.getGeometry().getLength();let n=Math.ceil(t.getGeometry().getLength()/e/100),i=[];for(let o=0;o<=n;o++){let e=o/n+.01;e>1&&(e-=1);let r=new X(new on(t.getGeometry().getCoordinateAt(e)));i.push(r)}return t.getGeometry().forEachSegment(((t,e)=>{i.forEach((n=>{let i=new Nn([t,e]),o=n.getGeometry().getFirstCoordinate(),s=i.getClosestPoint(o);if(Math.abs(s[0]-o[0])<1&&Math.abs(s[1]-o[1])<1){new Image(117,71).src="../../public/image/linearrow.png";let i=e[0]-t[0],o=e[1]-t[1],s=Math.atan(i/o);s=o>0?s:Math.PI+s,r.push(new Vi({geometry:n.getGeometry(),image:new Us({src:"../../public/image/linearrow.png",anchor:[.75,.5],scale:1,rotateWithView:!1,color:"white",rotation:-s})}))}}))})),r}static getPolygonStyle(t){for(let r in t)""===t[r].toString()&&delete t[r];let e=Object.assign({},Ym.getDefaultPolygonStyle(),t);switch(e.strokeStyle){case"STYLE_DASH":e.strokelineDash=[15,10];break;case"STYLE_SOLID":e.strokelineDash=null;break;case"STYLE_DOT":e.strokelineDash=[2,5];break;case"STYLE_DASHDOT":e.strokelineDash=[2,10,15,10]}return new Vi({stroke:new Rn({color:Xm.CheckIsColor(e.strokecolor),width:e.strokewidth,lineDash:e.strokelineDash}),fill:new Fn({color:Xm.CheckIsColor(e.fillcolor)}),text:new Wi({text:e.text,font:e.Font,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})})})}static getBufferStyleStyle(t){for(let r in t)""===t[r].toString()&&delete t[r];let e=Object.assign({},Ym.getDefaultBufferStyleStyle(),t);return new Vi({stroke:new Rn({color:Xm.CheckIsColor(e.strokecolor),width:e.strokewidth,lineDash:[10,10]}),fill:new Fn({color:Xm.CheckIsColor(e.fillcolor)}),text:new Wi({text:e.text,font:e.Font,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})})})}static getEditPolygonStyle(){return[new Vi({stroke:new Rn({color:"rgba(0, 153, 255,1)",width:3}),fill:new Fn({color:"rgba(255, 255, 255,0.3)"}),text:new Wi({text:"",font:"12px Microsoft YaHei",fill:new Fn({color:"#000"}),stroke:new Rn({color:"#fff",width:2})})}),new Vi({image:new Di({radius:3,fill:new Fn({color:"rgba(255, 255, 255,1)"}),stroke:new Rn({color:"red",width:2})}),geometry:function(t){var e,r;if(t){let n;return n=t.getGeometry().getType()===Pm.Line?null==(e=t.getGeometry())?void 0:e.getCoordinates():null==(r=t.getGeometry())?void 0:r.getCoordinates()[0],new nh(n)}}})]}static getEditPointStyle(t){return new Vi({image:new Di({radius:5,stroke:new Rn({color:"rgba(255, 255,255, 0.7)"}),fill:new Fn({color:"rgba(0, 255, 255, 0.8)"})}),text:new Wi({text:"拖动点修改图形,点击空白处完成",font:"12px Calibri,sans-serif",fill:new Fn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new Fn({color:"rgba(0, 0, 0, 0.7)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})})}static getRandomColor(){return"#"+Math.random().toString(16).substring(2,6).toUpperCase()}static _getStyle(t){const e={};switch(t){case"Point":case"MultiPoint":e.Point=new Vi({text:new Wi({font:Ym.option.Point.Font,text:"",offsetX:Ym.option.Point.FontoffsetX,offsetY:Ym.option.Point.FontoffsetY,fill:new Fn({color:Ym.option.Point.FontColor}),stroke:new Rn({color:Ym.option.Point.FontStrokeColor,width:Ym.option.Point.FontStrokeWidth})}),image:new Di({scale:Ym.option.Point.scale,radius:Ym.option.Point.radius,fill:new Fn({color:Ym.option.Point.fillcolor}),stroke:new Rn({color:Ym.option.Point.strokecolor,width:Ym.option.Point.strokewidth})})});break;case"LineString":case"MultiLineString":e.LineString=new Vi({stroke:new Rn({color:Ym.option.LineString.strokecolor,width:Ym.option.LineString.strokewidth}),text:new Wi({text:"",font:Ym.option.LineString.Font,fill:new Fn({color:Ym.option.LineString.FontColor}),stroke:new Rn({color:Ym.option.LineString.FontStrokeColor,width:Ym.option.LineString.FontStrokeWidth})})});break;case"Polygon":case"MultiPolygon":e.Polygon=new Vi({stroke:new Rn({color:Ym.option.Polygon.strokecolor,width:Ym.option.Polygon.strokewidth}),fill:new Fn({color:Ym.option.Polygon.fillcolor}),text:new Wi({text:"",font:Ym.option.Polygon.Font,fill:new Fn({color:Ym.option.Polygon.FontColor}),stroke:new Rn({color:Ym.option.Polygon.FontStrokeColor,width:Ym.option.Polygon.FontStrokeWidth})})})}return e[t]}static setHighlightStyle(t){const e=t.getGeometry().getType();let r=Ym.getStyle(e,{radius:8,strokewidth:2,strokecolor:"rgba(0, 255, 0,1)"});try{t.get("name")&&r.getText()&&r.getText().setText(t.get("name"))}catch(TX){}return r}static getFeaturesDefaultStyle(t,e,r){let n,i,o,s=t.getProperties(),a={};switch(t.getGeometry().getType()){case"Point":case"MultiPoint":i=Ym.getDefaultPointStyle(),a.fillcolor=""!==s.style.fillcolor?s.style.fillcolor:i.fillcolor,a.strokecolor=""!==s.style.strokecolor?s.style.strokecolor:i.strokecolor,a.strokewidth=""!==s.style.strokewidth?s.style.strokewidth:i.strokewidth,a.radius=""!==s.style.radius?s.style.radius/2:i.radius,s.style.src&&""!==s.style.src&&(a.imageOption={src:s.style.src});break;case"LineString":case"MultiLineString":n=Ym.getDefaulLineStyle(),a=Object.assign({},n,s.style);break;case"Polygon":case"MultiPolygon":o=Ym.getDefaultPolygonStyle(),a.fillcolor=""!==s.style.fillcolor?s.style.fillcolor:o.fillcolor,a.strokecolor=""!==s.style.strokecolor?s.style.strokecolor:o.strokecolor,a.strokewidth=""!==s.style.strokewidth?s.style.strokewidth:o.strokewidth}t.set("style",a)}};let Zm=Ym;e(Zm,"option"),e(Zm,"StylesList"),e(Zm,"stroke",new Rn({color:"black",width:2})),e(Zm,"fill",new Fn({color:"red"})),e(Zm,"image",new Di({radius:5,stroke:new Rn({color:"red",width:1})}));var Jm=6371008.8,$m={centimeters:100*Jm,centimetres:100*Jm,degrees:Jm/111325,feet:3.28084*Jm,inches:39.37*Jm,kilometers:Jm/1e3,kilometres:Jm/1e3,meters:Jm,metres:Jm,miles:Jm/1609.344,millimeters:1e3*Jm,millimetres:1e3*Jm,nauticalmiles:Jm/1852,radians:1,yards:1.0936*Jm},tv={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Jm,yards:1.0936133},ev={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function rv(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function nv(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!yv(t[0])||!yv(t[1]))throw new Error("coordinates must contain numbers");return rv({type:"Point",coordinates:t},e,r)}function iv(t,e,r){void 0===r&&(r={});for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return rv({type:"Polygon",coordinates:t},e,r)}function ov(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return rv({type:"LineString",coordinates:t},e,r)}function sv(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function av(t,e,r){return void 0===r&&(r={}),rv({type:"MultiLineString",coordinates:t},e,r)}function lv(t,e,r){return void 0===r&&(r={}),rv({type:"MultiPoint",coordinates:t},e,r)}function uv(t,e,r){return void 0===r&&(r={}),rv({type:"MultiPolygon",coordinates:t},e,r)}function hv(t,e,r){return void 0===r&&(r={}),rv({type:"GeometryCollection",geometries:t},e,r)}function cv(t,e){void 0===e&&(e="kilometers");var r=$m[e];if(!r)throw new Error(e+" units is invalid");return t*r}function Av(t,e){void 0===e&&(e="kilometers");var r=$m[e];if(!r)throw new Error(e+" units is invalid");return t/r}function fv(t,e){return pv(Av(t,e))}function pv(t){return t%(2*Math.PI)*180/Math.PI}function dv(t){return t%360*Math.PI/180}function gv(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return cv(Av(t,e),r)}function yv(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function mv(t){return!!t&&t.constructor===Object}const vv=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:ev,bearingToAzimuth:function(t){var e=t%360;return e<0&&(e+=360),e},convertArea:function(t,e,r){if(void 0===e&&(e="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=ev[e];if(!n)throw new Error("invalid original units");var i=ev[r];if(!i)throw new Error("invalid final units");return t/n*i},convertLength:gv,degreesToRadians:dv,earthRadius:Jm,factors:$m,feature:rv,featureCollection:sv,geometry:function(t,e,r){switch(t){case"Point":return nv(e).geometry;case"LineString":return ov(e).geometry;case"Polygon":return iv(e).geometry;case"MultiPoint":return lv(e).geometry;case"MultiLineString":return av(e).geometry;case"MultiPolygon":return uv(e).geometry;default:throw new Error(t+" is invalid")}},geometryCollection:hv,isNumber:yv,isObject:mv,lengthToDegrees:fv,lengthToRadians:Av,lineString:ov,lineStrings:function(t,e,r){return void 0===r&&(r={}),sv(t.map((function(t){return ov(t,e)})),r)},multiLineString:av,multiPoint:lv,multiPolygon:uv,point:nv,points:function(t,e,r){return void 0===r&&(r={}),sv(t.map((function(t){return nv(t,e)})),r)},polygon:iv,polygons:function(t,e,r){return void 0===r&&(r={}),sv(t.map((function(t){return iv(t,e)})),r)},radiansToDegrees:pv,radiansToLength:cv,round:function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},unitsFactors:tv,validateBBox:function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!yv(t))throw new Error("bbox must only contain numbers")}))},validateId:function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},Symbol.toStringTag,{value:"Module"}));function _v(t,e,r){if(null!==t)for(var n,i,o,s,a,l,u,h,c=0,A=0,f=t.type,p="FeatureCollection"===f,d="Feature"===f,g=p?t.features.length:1,y=0;y<g;y++){a=(h=!!(u=p?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var m=0;m<a;m++){var v=0,_=0;if(null!==(s=h?u.geometries[m]:u)){l=s.coordinates;var w=s.type;switch(c=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,A,y,v,_))return!1;A++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],A,y,v,_))return!1;A++,"MultiPoint"===w&&v++}"LineString"===w&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(!1===e(l[n][i],A,y,v,_))return!1;A++}"MultiLineString"===w&&v++,"Polygon"===w&&_++}"Polygon"===w&&v++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(_=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(!1===e(l[n][i][o],A,y,v,_))return!1;A++}_++}v++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===_v(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function wv(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function bv(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function xv(t,e,r){var n=r;return bv(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n}function Ev(t){var e=[];return _v(t,(function(t){e.push(t)})),e}function Cv(t,e){var r,n,i,o,s,a,l,u,h,c,A=0,f="FeatureCollection"===t.type,p="Feature"===t.type,d=f?t.features.length:1;for(r=0;r<d;r++){for(a=f?t.features[r].geometry:p?t.geometry:t,u=f?t.features[r].properties:p?t.properties:{},h=f?t.features[r].bbox:p?t.bbox:void 0,c=f?t.features[r].id:p?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,A,u,h,c))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===e(o.geometries[n],A,u,h,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,A,u,h,c))return!1;A++}}function Sv(t,e,r){var n=r;return Cv(t,(function(t,i,o,s,a){n=0===i&&void 0===r?t:e(n,t,i,o,s,a)})),n}function Bv(t,e){Cv(t,(function(t,r,n,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(rv(t,n,{bbox:i,id:o}),r,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var u=t.coordinates[l];if(!1===e(rv({type:s,coordinates:u},n),r,l))return!1}}))}function Iv(t,e){Bv(t,(function(t,r,n){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,u=0;return!1!==_v(t,(function(o,h,c,A,f){if(void 0===s||r>a||A>l||f>u)return s=o,a=r,l=A,u=f,void(i=0);var p=ov([s,o],t.properties);if(!1===e(p,r,n,f,i))return!1;i++,s=o}))&&void 0}}}))}function Tv(t,e,r){var n=r,i=!1;return Iv(t,(function(t,o,s,a,l){n=!1===i&&void 0===r?t:e(n,t,o,s,a,l),i=!0})),n}function Pv(t,e){if(!t)throw new Error("geojson is required");Bv(t,(function(t,r,n){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,n,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(ov(o[s],t.properties),r,n,s))return!1}}}))}function Fv(t,e,r){var n=r;return Pv(t,(function(t,i,o,s){n=0===i&&void 0===r?t:e(n,t,i,o,s)})),n}const Lv=Object.freeze(Object.defineProperty({__proto__:null,coordAll:Ev,coordEach:_v,coordReduce:function(t,e,r,n){var i=r;return _v(t,(function(t,n,o,s,a){i=0===n&&void 0===r?t:e(i,t,n,o,s,a)}),n),i},featureEach:bv,featureReduce:xv,findPoint:function(t,e){if(!mv(e=e||{}))throw new Error("options is invalid");var r,n=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n),a=a||t.features[n].properties,r=t.features[n].geometry;break;case"Feature":a=a||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var l=r.coordinates;switch(r.type){case"Point":return nv(l,a,e);case"MultiPoint":return i<0&&(i=l.length+i),nv(l[i],a,e);case"LineString":return s<0&&(s=l.length+s),nv(l[s],a,e);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),nv(l[o][s],a,e);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s),nv(l[i][s],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s),nv(l[i][o][s],a,e)}throw new Error("geojson is invalid")},findSegment:function(t,e){if(!mv(e=e||{}))throw new Error("options is invalid");var r,n=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n),a=a||t.features[n].properties,r=t.features[n].geometry;break;case"Feature":a=a||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var l=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),ov([l[s],l[s+1]],a,e);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),ov([l[o][s],l[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s-1),ov([l[i][s],l[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s-1),ov([l[i][o][s],l[i][o][s+1]],a,e)}throw new Error("geojson is invalid")},flattenEach:Bv,flattenReduce:function(t,e,r){var n=r;return Bv(t,(function(t,i,o){n=0===i&&0===o&&void 0===r?t:e(n,t,i,o)})),n},geomEach:Cv,geomReduce:Sv,lineEach:Pv,lineReduce:Fv,propEach:wv,propReduce:function(t,e,r){var n=r;return wv(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},segmentEach:Iv,segmentReduce:Tv},Symbol.toStringTag,{value:"Module"}));function Mv(t){var e=[1/0,1/0,-1/0,-1/0];return _v(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}Mv.default=Mv;const Ov=Object.freeze(Object.defineProperty({__proto__:null,default:Mv},Symbol.toStringTag,{value:"Module"}));function kv(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Nv(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Rv(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,i=t.features;n<i.length;n++){var o=i[n];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+o.geometry.type)}}function Uv(t){return"Feature"===t.type?t.geometry:t}function Dv(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}
|
|
20
|
+
e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=r?i-1:0,A=r?-1:1,f=t[e+c];for(c+=A,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=A,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=A,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,A=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?A/l:A*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+f]=255&s,f+=p,s/=256,u-=8);t[r+f-p]|=128*d}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(11),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(1))},function(t,e,r){(function(t,e){!function(t,r){if(!t.setImmediate){var n,i,o,s,a,l=1,u={},h=!1,c=t.document,A=Object.getPrototypeOf&&Object.getPrototypeOf(t);A=A&&A.setTimeout?A:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,n=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)},A.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return u[l]=i,n(l),l++},A.clearImmediate=f}function f(t){delete u[t]}function p(t){if(h)setTimeout(p,0,t);else{var e=u[t];if(e){h=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(r,n)}}(e)}finally{f(t),h=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(1),r(3))},function(t,e){function r(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}r.keys=function(){return[]},r.resolve=r,t.exports=r,r.id=12},function(t,e,r){function n(t){this.options=t||{locator:{}}}function i(){this.cdata=!1}function o(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function s(t,e,r){return"string"==typeof t?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}function a(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}n.prototype.parseFromString=function(t,e){var r=this.options,n=new h,o=r.domBuilder||new i,s=r.errorHandler,a=r.locator,u=r.xmlns||{},c=/\/x?html?$/.test(e),A=c?l.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return a&&o.setDocumentLocator(a),n.errorHandler=function(t,e,r){if(!t){if(e instanceof i)return e;t=e}var n={},o=t instanceof Function;function s(e){var i=t[e];!i&&o&&(i=2==t.length?function(r){t(e,r)}:t),n[e]=i&&function(t){i("[xmldom "+e+"]\t"+t+function(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),n}(s,o,a),n.domBuilder=r.domBuilder||o,c&&(u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",t&&"string"==typeof t?n.parse(t,u,A):n.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new A).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,r,n){var i=this.doc,s=i.createElementNS(t,r||e),l=n.length;a(this,s),this.currentElement=s,this.locator&&o(this.locator,s);for(var u=0;u<l;u++){t=n.getURI(u);var h=n.getValue(u),c=(r=n.getQName(u),i.createAttributeNS(t,r));this.locator&&o(n.getLocator(u),c),c.value=c.nodeValue=h,s.setAttributeNode(c)}},endElement:function(t,e,r){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&o(this.locator,r),a(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=s.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&o(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,r){t=s.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&o(this.locator,n),a(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(t,e,r);this.locator&&o(this.locator,i),a(this,i)}},warning:function(t){},error:function(t){},fatalError:function(t){throw new c(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){i.prototype[t]=function(){return null}}));var l=r(14),u=r(15),h=u.XMLReader,c=u.ParseError,A=e.DOMImplementation=r(4).DOMImplementation;e.XMLSerializer=r(4).XMLSerializer,e.DOMParser=n,e.__DOMHandler=i},function(t,e){e.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},function(t,e){var r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,n=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+r.source+n.source+"*(?::"+r.source+n.source+"*)?$"),o=0,s=1,a=2,l=3,u=4,h=5,c=6,A=7;function f(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,f)}function p(){}function d(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function g(t,e,r,n,i,f){function p(t,e,n){t in r.attributeNames&&f.fatalError("Attribute "+t+" redefined"),r.addValue(t,e,n)}for(var d,g=++e,y=o;;){var m=t.charAt(g);switch(m){case"=":if(y===s)d=t.slice(e,g),y=l;else{if(y!==a)throw new Error("attribute equal must after attrName");y=l}break;case"'":case'"':if(y===l||y===s){if(y===s&&(f.warning('attribute value must after "="'),d=t.slice(e,g)),e=g+1,!((g=t.indexOf(m,e))>0))throw new Error("attribute value no end '"+m+"' match");p(d,v=t.slice(e,g).replace(/&#?\w+;/g,i),e-1),y=h}else{if(y!=u)throw new Error('attribute value must after "="');p(d,v=t.slice(e,g).replace(/&#?\w+;/g,i),e),f.warning('attribute "'+d+'" missed start quot('+m+")!!"),e=g+1,y=h}break;case"/":switch(y){case o:r.setTagName(t.slice(e,g));case h:case c:case A:y=A,r.closed=!0;case u:case s:case a:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return f.error("unexpected end of input"),y==o&&r.setTagName(t.slice(e,g)),g;case">":switch(y){case o:r.setTagName(t.slice(e,g));case h:case c:case A:break;case u:case s:"/"===(v=t.slice(e,g)).slice(-1)&&(r.closed=!0,v=v.slice(0,-1));case a:y===a&&(v=d),y==u?(f.warning('attribute "'+v+'" missed quot(")!'),p(d,v.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===n[""]&&v.match(/^(?:disabled|checked|selected)$/i)||f.warning('attribute "'+v+'" missed value!! "'+v+'" instead!!'),p(v,v,e));break;case l:throw new Error("attribute value missed!!")}return g;case"":m=" ";default:if(m<=" ")switch(y){case o:r.setTagName(t.slice(e,g)),y=c;break;case s:d=t.slice(e,g),y=a;break;case u:var v=t.slice(e,g).replace(/&#?\w+;/g,i);f.warning('attribute "'+v+'" missed quot(")!!'),p(d,v,e);case h:y=c}else switch(y){case a:r.tagName,"http://www.w3.org/1999/xhtml"===n[""]&&d.match(/^(?:disabled|checked|selected)$/i)||f.warning('attribute "'+d+'" missed value!! "'+d+'" instead2!!'),p(d,d,e),e=g,y=s;break;case h:f.warning('attribute space is required"'+d+'"!!');case c:y=s,e=g;break;case l:y=u,e=g;break;case A:throw new Error("elements closed character '/' and '>' must be connected to")}}g++}}function y(t,e,r){for(var n=t.tagName,i=null,o=t.length;o--;){var s=t[o],a=s.qName,l=s.value;if((A=a.indexOf(":"))>0)var u=s.prefix=a.slice(0,A),h=a.slice(A+1),c="xmlns"===u&&h;else h=a,u=null,c="xmlns"===a&&"";s.localName=h,!1!==c&&(null==i&&(i={},_(r,r={})),r[c]=i[c]=l,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(c,l))}for(o=t.length;o--;)(u=(s=t[o]).prefix)&&("xml"===u&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(s.uri=r[u||""]));var A;(A=n.indexOf(":"))>0?(u=t.prefix=n.slice(0,A),h=t.localName=n.slice(A+1)):(u=null,h=t.localName=n);var f=t.uri=r[u||""];if(e.startElement(f,h,n,t),!t.closed)return t.currentNSMap=r,t.localNSMap=i,!0;if(e.endElement(f,h,n),i)for(u in i)e.endPrefixMapping(u)}function m(t,e,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var o=t.indexOf("</"+r+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(r)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,n),i.characters(s,0,s.length),o)}return e+1}function v(t,e,r,n){var i=n[r];return null==i&&((i=t.lastIndexOf("</"+r+">"))<e&&(i=t.lastIndexOf("</"+r)),n[r]=i),i<e}function _(t,e){for(var r in t)e[r]=t[r]}function w(t,e,r,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(i=t.indexOf("--\x3e",e+4))>e?(r.comment(t,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var i=t.indexOf("]]>",e+9);return r.startCDATA(),r.characters(t,e+9,i-e-9),r.endCDATA(),i+3}var o=function(t,e){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);r=i.exec(t);)if(n.push(r),r[1])return n}(t,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],l=!1,u=!1;s>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],u=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var h=o[s-1];return r.startDTD(a,l,u),r.endDTD(),h.index+h[0].length}return-1}function b(t,e,r){var n=t.indexOf("?>",e);if(n){var i=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,r.processingInstruction(i[1],i[2]),n+2):-1}return-1}function x(){this.attributeNames={}}f.prototype=new Error,f.prototype.name=f.name,p.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),_(e,e={}),function(t,e,r,n,i){function o(t){var e=t.slice(1,-1);return e in r?r[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(i.error("entity not found:"+t),t)}function s(e){if(e>_){var r=t.substring(_,e).replace(/&#?\w+;/g,o);c&&a(_),n.characters(r,0,e-_),_=e}}function a(e,r){for(;e>=u&&(r=h.exec(t));)l=r.index,u=l+r[0].length,c.lineNumber++;c.columnNumber=e-l+1}for(var l=0,u=0,h=/.*(?:\r\n?|\n)|.*$/g,c=n.locator,A=[{currentNSMap:e}],p={},_=0;;){try{var E=t.indexOf("<",_);if(E<0){if(!t.substr(_).match(/^\s*$/)){var C=n.doc,S=C.createTextNode(t.substr(_));C.appendChild(S),n.currentElement=S}return}switch(E>_&&s(E),t.charAt(E+1)){case"/":var B=t.indexOf(">",E+3),I=t.substring(E+2,B),T=A.pop();B<0?(I=t.substring(E+2).replace(/[\s<].*/,""),i.error("end tag name: "+I+" is not complete:"+T.tagName),B=E+1+I.length):I.match(/\s</)&&(I=I.replace(/[\s<].*/,""),i.error("end tag name: "+I+" maybe not complete"),B=E+1+I.length);var P=T.localNSMap,F=T.tagName==I;if(F||T.tagName&&T.tagName.toLowerCase()==I.toLowerCase()){if(n.endElement(T.uri,T.localName,I),P)for(var L in P)n.endPrefixMapping(L);F||i.fatalError("end tag name: "+I+" is not match the current start tagName:"+T.tagName)}else A.push(T);B++;break;case"?":c&&a(E),B=b(t,E,n);break;case"!":c&&a(E),B=w(t,E,n,i);break;default:c&&a(E);var M=new x,O=A[A.length-1].currentNSMap,k=(B=g(t,E,M,O,o,i),M.length);if(!M.closed&&v(t,B,M.tagName,p)&&(M.closed=!0,r.nbsp||i.warning("unclosed xml attribute")),c&&k){for(var N=d(c,{}),R=0;R<k;R++){var U=M[R];a(U.offset),U.locator=d(c,{})}n.locator=N,y(M,n,O)&&A.push(M),n.locator=c}else y(M,n,O)&&A.push(M);"http://www.w3.org/1999/xhtml"!==M.uri||M.closed?B++:B=m(t,B,M.tagName,o,n)}}catch(TX){if(TX instanceof f)throw TX;i.error("element parse error: "+TX),B=-1}B>_?_=B:s(Math.max(E,_)+1)}}(t,e,r,n,this.errorHandler),n.endDocument()}},x.prototype={setTagName:function(t){if(!i.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!i.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=p,e.ParseError=f},function(t,e,r){r.r(e),r.d(e,"toKml",(function(){return A})),r.d(e,"toGeoJSON",(function(){return g}));var n=r(5),i=r(0);function o(t,e){return function(r){if(!r.properties||!s.valid(r.geometry))return"";var n=s.any(r.geometry);if(!n)return"";var i="",o="";if(t.simplestyle){var a=function(t){var e="";return t["marker-symbol"]&&(e=e+"ms"+t["marker-symbol"]),t["marker-color"]&&(e=e+"mc"+t["marker-color"].replace("#","")),t["marker-size"]&&(e=e+"ms"+t["marker-size"]),t.stroke&&(e=e+"s"+t.stroke.replace("#","")),t["stroke-width"]&&(e=e+"sw"+t["stroke-width"].toString().replace(".","")),t["stroke-opacity"]&&(e=e+"mo"+t["stroke-opacity"].toString().replace(".","")),t.fill&&(e=e+"f"+t.fill.replace("#","")),t["fill-opacity"]&&(e=e+"fo"+t["fill-opacity"].toString().replace(".","")),e}(r.properties);a&&(s.isPoint(r.geometry)&&function(t){return!!(t["marker-size"]||t["marker-symbol"]||t["marker-color"])}(r.properties)?(-1===e.indexOf(a)&&(i=function(t,e){return c("Style",c("IconStyle",c("Icon",c("href",function(t){return t["marker-symbol"]}(t))))+c("hotSpot","",[["xunits","fraction"],["yunits","fraction"],["x",.5],["y",.5]]),[["id",e]])}(r.properties,a),e.push(a)),o=c("styleUrl","#"+a)):(s.isPolygon(r.geometry)||s.isLine(r.geometry))&&function(t){for(var e in t)if({stroke:!0,"stroke-opacity":!0,"stroke-width":!0,fill:!0,"fill-opacity":!0}[e])return!0}(r.properties)&&(-1===e.indexOf(a)&&(i=function(t,e){var r=c("LineStyle",[c("color",l(t.stroke,t["stroke-opacity"])||"ff555555")+c("width",void 0===t["stroke-width"]?2:t["stroke-width"])]),n="";return(t.fill||t["fill-opacity"])&&(n=c("PolyStyle",[c("color",l(t.fill,t["fill-opacity"])||"88555555")])),c("Style",r+n,[["id",e]])}(r.properties,a),e.push(a)),o=c("styleUrl","#"+a)))}return i+c("Placemark",function(t,e){return t[e.name]?c("name",u(t[e.name])):""}(r.properties,t)+function(t,e){return t[e.description]?c("description",u(t[e.description])):""}(r.properties,t)+function(t){var e,r=[];for(var n in t){var i=t[n];e=i,"[object Object]"===Object.prototype.toString.call(e)?r.push('<Data name ="'.concat(n,'"><value>').concat(JSON.stringify(i),"</value></Data>")):r.push('<Data name ="'.concat(n,'"><value>').concat(i,"</value></Data>"))}return c("ExtendedData",r.join(""))}(r.properties)+function(t,e){return t[e.timestamp]?c("TimeStamp",c("when",u(t[e.timestamp]))):""}(r.properties,t)+n+o)}}var s={Point:function(t){return c("Point",c("coordinates",t.coordinates.join(",")))},LineString:function(t){return c("LineString",c("coordinates",a(t.coordinates)))},Polygon:function(t){if(!t.coordinates.length)return"";var e=t.coordinates[0],r=t.coordinates.slice(1),n=c("outerBoundaryIs",c("LinearRing",c("coordinates",a(e)))),i=r.map((function(t){return c("innerBoundaryIs",c("LinearRing",c("coordinates",a(t))))})).join("");return c("Polygon",n+i)},MultiPoint:function(t){return t.coordinates.length?c("MultiGeometry",t.coordinates.map((function(t){return s.Point({coordinates:t})})).join("")):""},MultiPolygon:function(t){return t.coordinates.length?c("MultiGeometry",t.coordinates.map((function(t){return s.Polygon({coordinates:t})})).join("")):""},MultiLineString:function(t){return t.coordinates.length?c("MultiGeometry",t.coordinates.map((function(t){return s.LineString({coordinates:t})})).join("")):""},GeometryCollection:function(t){return c("MultiGeometry",t.geometries.map(s.any).join(""))},valid:function(t){return t&&t.type&&(t.coordinates||"GeometryCollection"===t.type&&t.geometries&&t.geometries.every(s.valid))},any:function(t){return s[t.type]?s[t.type](t):""},isPoint:function(t){return"Point"===t.type||"MultiPoint"===t.type},isPolygon:function(t){return"Polygon"===t.type||"MultiPolygon"===t.type},isLine:function(t){return"LineString"===t.type||"MultiLineString"===t.type}};function a(t){return t.map((function(t){return t.join(",")})).join(" ")}function l(t,e){if("string"!=typeof t)return"";if(3===(t=t.replace("#","").toLowerCase()).length)t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2];else if(6!==t.length)return"";var r=t[0]+t[1],n=t[2]+t[3],i=t[4]+t[5],o="ff";return"number"==typeof e&&e>=0&&e<=1&&((o=(255*e).toString(16)).indexOf(".")>-1&&(o=o.substr(0,o.indexOf("."))),o.length<2&&(o="0"+o)),o+i+n+r}function u(t){return t?t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}var h={">":">","<":"<","'":"'",'"':""","&":"&"};function c(t,e,r){return(Array.isArray(e)||"string"==typeof e)&&(r=e,e={}),Array.isArray(r)&&(r="\n"+r.map((function(t){return" "+t})).join("\n")+"\n"),"<"+t+function(t){return Object.keys(t).length?" "+Object.keys(t).map((function(e){return e+'="'+function(t,e){var r;if(null!=t)return e=(e||"").replace(/[^&"<>\']/g,""),r="([&\"<>'])".replace(new RegExp("["+e+"]","g"),""),t.replace(new RegExp(r,"g"),(function(t,e){return h[e]}))}(t[e])+'"'})).join(" "):""}(e)+">"+r+"</"+t+">"}function A(t,e){return t.features&&t.features.forEach((function(t){if(t.properties){var e=t.properties.style;if(e){if(e.image)return t.properties["marker-symbol"]=e.image,void(e.outlineColor&&(t.properties["marker-color"]=e.outlineColor));var r,n,i;e.color&&(t.properties.fill=e.color,e.opacity&&(t.properties["fill-opacity"]=e.opacity)),e.outlineColor&&(t.properties.stroke=e.outlineColor,t.properties["stroke-width"]=null!==(r=e.outlineWidth)&&void 0!==r?r:1,t.properties["stroke-opacity"]=null!==(n=null!==(i=e.outlineOpacity)&&void 0!==i?i:e.opacity)&&void 0!==n?n:1)}}})),function(t,e){return'<?xml version="1.0" encoding="UTF-8"?>'+c("kml",c("Document",function(t){return void 0!==t.documentName?c("name",t.documentName):""}(e=e||{documentName:void 0,documentDescription:void 0,name:"name",description:"description",simplestyle:!1,timestamp:"timestamp"})+function(t){return void 0!==t.documentDescription?c("description",t.documentDescription):""}(e)+function(t,e){if(!t.type)return"";var r=[];switch(t.type){case"FeatureCollection":return t.features?t.features.map(o(e,r)).join(""):"";case"Feature":return o(e,r)(t);default:return o(e,r)({type:"Feature",geometry:t,properties:{}})}}(t,e)),[["xmlns","http://www.opengis.net/kml/2.2"]])}(t,e)}var f=function(t){return(new DOMParser).parseFromString(t,"text/xml")},p=function(t){return t.split(".").pop()},d=function(t){return(new n).loadAsync(t).then((function(t){var e=null;return t.forEach((function(t,r){"kml"===p(t)&&null===e&&(e=r.async("string").then(f))})),e||Promise.reject("No kml file found")}))};function g(t){if(!t)return Promise.reject("参数不能为空");if("string"==typeof(o=t)&&o.constructor==String){var e=p(t);if("kml"===e)return Cesium.Resource.fetchXML(t).then((function(t){return Object(i.a)(t)}));if("kmz"===e)return Cesium.Resource.fetchBlob(t).then((function(t){return d(t)})).then((function(t){return Object(i.a)(t)}));var r=Object(i.a)(f(t));return Promise.resolve(r)}if(t.getRootNode){var n=Object(i.a)(t);return Promise.resolve(n)}return d(t).then((function(t){return Object(i.a)(t)}));var o}}])},Km.exports=zm(),window.ol&&!ol.ext&&(ol.ext={});var qm=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t};window.ol&&(ol.inherits||(ol.inherits=qm)),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.Element&&!Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var Wm=function(t){var e;t||(t={});var r=this.canvas_=document.createElement("canvas"),n=(Number(t.scale)>0?Number(t.scale):1)*lt||lt,i=r.getContext("2d");if(t.image){var o;t.image.load();var s=t.image.getImage();if(s.width)r.width=Math.round(s.width*n),r.height=Math.round(s.height*n),i.globalAlpha="number"==typeof t.opacity?t.opacity:1,i.drawImage(s,0,0,s.width,s.height,0,0,r.width,r.height),e=i.createPattern(r,"repeat");else{var a=this;e=[0,0,0,0],s.onload=function(){r.width=Math.round(s.width*n),r.height=Math.round(s.height*n),i.globalAlpha="number"==typeof t.opacity?t.opacity:1,i.drawImage(s,0,0,s.width,s.height,0,0,r.width,r.height),e=i.createPattern(r,"repeat"),a.setColor(e)}}}else{var l=this.getPattern_(t);if(r.width=Math.round(l.width*n),r.height=Math.round(l.height*n),i.beginPath(),t.fill&&(i.fillStyle=Kn(t.fill.getColor()),i.fillRect(0,0,r.width,r.height)),i.scale(n,n),i.lineCap="round",i.lineWidth=l.stroke||1,i.fillStyle=Kn(t.color||"#000"),i.strokeStyle=Kn(t.color||"#000"),l.circles)for(o=0;o<l.circles.length;o++){var u=l.circles[o];i.beginPath(),i.arc(u[0],u[1],u[2],0,2*Math.PI),l.fill&&i.fill(),l.stroke&&i.stroke()}if(l.repeat||(l.repeat=[[0,0]]),l.char&&(i.font=l.font||l.width+"px Arial",i.textAlign="center",i.textBaseline="middle",l.angle?(i.fillText(l.char,l.width/4,l.height/4),i.fillText(l.char,5*l.width/4,5*l.height/4),i.fillText(l.char,l.width/4,5*l.height/4),i.fillText(l.char,5*l.width/4,l.height/4),i.fillText(l.char,3*l.width/4,3*l.height/4),i.fillText(l.char,-l.width/4,-l.height/4),i.fillText(l.char,3*l.width/4,-l.height/4),i.fillText(l.char,-l.width/4,3*l.height/4)):i.fillText(l.char,l.width/2,l.height/2)),l.lines)for(o=0;o<l.lines.length;o++)for(var h=0;h<l.repeat.length;h++){var c=l.lines[o];i.beginPath(),i.moveTo(c[0]+l.repeat[h][0],c[1]+l.repeat[h][1]);for(var A=2;A<c.length;A+=2)i.lineTo(c[A]+l.repeat[h][0],c[A+1]+l.repeat[h][1]);l.fill&&i.fill(),l.stroke&&i.stroke(),i.save(),i.strokeStyle="red",i.strokeWidth=.1,i.restore()}if(e=i.createPattern(r,"repeat"),t.offset){var f=t.offset;if("number"==typeof f&&(f=[f,f]),f instanceof Array){var p=Math.round(f[0]*n),d=Math.round(f[1]*n);i.scale(1/n,1/n),i.clearRect(0,0,r.width,r.height),i.translate(p,d),i.fillStyle=e,i.fillRect(-p,-d,r.width,r.height),e=i.createPattern(r,"repeat")}}}Fn.call(this,{color:e})};qm(Wm,Fn),Wm.prototype.clone=function(){var t=Fn.prototype.clone.call(this);return t.canvas_=this.canvas_,t},Wm.prototype.getImage=function(){return this.canvas_},Wm.prototype.getPattern_=function(t){var e,r=Wm.prototype.patterns[t.pattern]||Wm.prototype.patterns.dot,n=Math.round(t.spacing)||10;switch(t.pattern){case"dot":case"circle":e=0===t.size?0:t.size/2||2,t.angle?(n=r.width=r.height=Math.round(1.4*n),r.circles=[[n/4,n/4,e],[3*n/4,3*n/4,e]],"circle"==t.pattern&&(r.circles=r.circles.concat([[n/4+n,n/4,e],[n/4,n/4+n,e],[3*n/4-n,3*n/4,e],[3*n/4,3*n/4-n,e],[n/4+n,n/4+n,e],[3*n/4-n,3*n/4-n,e]]))):(r.width=r.height=n,r.circles=[[n/2,n/2,e]],"circle"==t.pattern&&(r.circles=r.circles.concat([[n/2+n,n/2,e],[n/2-n,n/2,e],[n/2,n/2+n,e],[n/2,n/2-n,e],[n/2+n,n/2+n,e],[n/2+n,n/2-n,e],[n/2-n,n/2+n,e],[n/2-n,n/2-n,e]])));break;case"tile":case"square":e=0===t.size?0:t.size/2||2,t.angle?(r.width=r.height=n,r.lines=[[n/2-e,n/2,n/2,n/2-e,n/2+e,n/2,n/2,n/2+e,n/2-e,n/2]]):(r.width=r.height=n,r.lines=[[n/2-e,n/2-e,n/2+e,n/2-e,n/2+e,n/2+e,n/2-e,n/2+e,n/2-e,n/2-e]]),"square"==t.pattern&&(r.repeat=[[0,0],[0,n],[n,0],[0,-n],[-n,0],[-n,-n],[n,n],[-n,n],[n,-n]]);break;case"cross":t.angle&&(t.angle=45);case"hatch":var i=Math.round(((t.angle||0)-90)%360);i>180&&(i-=360),i*=Math.PI/180;var o=Math.cos(i),s=Math.sin(i);if(Math.abs(s)<1e-4)r.width=r.height=n,r.lines=[[0,.5,n,.5]],r.repeat=[[0,0],[0,n]];else if(Math.abs(o)<1e-4)r.width=r.height=n,r.lines=[[.5,0,.5,n]],r.repeat=[[0,0],[n,0]],"cross"==t.pattern&&(r.lines.push([0,.5,n,.5]),r.repeat.push([0,n]));else{var a=r.width=Math.round(Math.abs(n/s))||1,l=r.height=Math.round(Math.abs(n/o))||1;"cross"==t.pattern?(r.lines=[[-a,-l,2*a,2*l],[2*a,-l,-a,2*l]],r.repeat=[[0,0]]):o*s>0?(r.lines=[[-a,-l,2*a,2*l]],r.repeat=[[0,0],[a,0],[0,l]]):(r.lines=[[2*a,-l,-a,2*l]],r.repeat=[[0,0],[-a,0],[0,l]])}r.stroke=0===t.size?0:t.size||4}return r},Wm.addPattern=function(t,e){e||(e={}),Wm.prototype.patterns[t||e.char]={width:e.width||e.size||10,height:e.height||e.size||10,font:e.font,char:e.char,circles:e.circles,lines:e.lines,repeat:e.repeat,stroke:e.stroke,angle:e.angle,fill:e.fill}},Wm.prototype.patterns={hatch:{width:5,height:5,lines:[[0,2.5,5,2.5]],stroke:1},cross:{width:7,height:7,lines:[[0,3,10,3],[3,0,3,10]],stroke:1},dot:{width:8,height:8,circles:[[5,5,2]],stroke:!1,fill:!0},circle:{width:10,height:10,circles:[[5,5,2]],stroke:1,fill:!1},square:{width:10,height:10,lines:[[3,3,3,8,8,8,8,3,3,3]],stroke:1,fill:!1},tile:{width:10,height:10,lines:[[3,3,3,8,8,8,8,3,3,3]],fill:!0},woven:{width:12,height:12,lines:[[3,3,9,9],[0,12,3,9],[9,3,12,0],[-1,1,1,-1],[13,11,11,13]],stroke:1},crosses:{width:8,height:8,lines:[[2,2,6,6],[2,6,6,2]],stroke:1},caps:{width:8,height:8,lines:[[2,6,4,2,6,6]],stroke:1},nylon:{width:20,height:20,lines:[[1,6,1,1,6,1],[6,11,11,11,11,6],[11,16,11,21,16,21],[16,11,21,11,21,16]],repeat:[[0,0],[-20,0],[0,-20]],stroke:1},hexagon:{width:20,height:12,lines:[[0,10,4,4,10,4,14,10,10,16,4,16,0,10]],stroke:1,repeat:[[0,0],[10,6],[10,-6],[-10,-6]]},cemetry:{width:15,height:19,lines:[[0,3.5,7,3.5],[3.5,0,3.5,10]],stroke:1,repeat:[[0,0],[7,9]]},sand:{width:20,height:20,circles:[[1,2,1],[9,3,1],[2,16,1],[7,8,1],[6,14,1],[4,19,1],[14,2,1],[12,10,1],[14,18,1],[18,8,1],[18,14,1]],fill:1},conglomerate:{width:60,height:40,circles:[[2,4,1],[17,3,1],[26,18,1],[12,17,1],[5,17,2],[28,11,2]],lines:[[7,5,6,7,9,9,11,8,11,6,9,5,7,5],[16,10,15,13,16,14,19,15,21,13,22,9,20,8,19,8,16,10],[24,6,26,7,27,5,26,4,24,4,24,6]],repeat:[[30,0],[-15,20],[15,20],[45,20]],stroke:1},conglomerate2:{width:60,height:40,circles:[[2,4,1],[17,3,1],[26,18,1],[12,17,1],[5,17,2],[28,11,2]],lines:[[7,5,6,7,9,9,11,8,11,6,9,5,7,5],[16,10,15,13,16,14,19,15,21,13,22,9,20,8,19,8,16,10],[24,6,26,7,27,5,26,4,24,4,24,6]],repeat:[[30,0],[-15,20],[15,20],[45,20]],fill:1},gravel:{width:15,height:10,circles:[[4,2,1],[5,9,1],[1,7,1]],lines:[[7,5,6,6,7,7,8,7,9,7,10,5,9,4,7,5],[11,2,14,4,14,1,12,1,11,2]],stroke:1},brick:{width:18,height:16,lines:[[0,1,18,1],[0,10,18,10],[6,1,6,10],[12,10,12,18],[12,0,12,1]],stroke:1},dolomite:{width:20,height:16,lines:[[0,1,20,1],[0,9,20,9],[1,9,6,1],[11,9,14,16],[14,0,14.4,1]],stroke:1},coal:{width:20,height:16,lines:[[1,5,7,1,7,7],[11,10,12,5,18,9],[5,10,2,15,9,15],[15,16,15,13,20,16],[15,0,15,2,20,0]],fill:1},breccia:{width:20,height:16,lines:[[1,5,7,1,7,7,1,5],[11,10,12,5,18,9,11,10],[5,10,2,15,9,15,5,10],[15,16,15,13,22,18],[15,0,15,2,20,0]],stroke:1},clay:{width:20,height:20,lines:[[0,0,3,11,0,20],[11,0,10,3,13,13,11,20],[0,0,10,3,20,0],[0,12,3,11,13,13,20,12]],stroke:1},flooded:{width:15,height:10,lines:[[0,1,10,1],[0,6,5,6],[10,6,15,6]],stroke:1},chaos:{width:40,height:40,lines:[[40,2,40,0,38,0,40,2],[4,0,3,2,2,5,0,0,0,3,2,7,5,6,7,7,8,10,9,12,9,13,9,14,8,14,6,15,2,15,0,20,0,22,2,20,5,19,8,15,10,14,11,12.25,10,12,10,10,12,9,13,7,12,6,13,4,16,7,17,4,20,0,18,0,15,3,14,2,14,0,12,1,11,0,10,1,11,4,10,7,9,8,8,5,6,4,5,3,5,1,5,0,4,0],[7,1,7,3,8,3,8,2,7,1],[4,3,5,5,4,5,4,3],[34,5,33,7,38,10,38,8,36,5,34,5],[27,0,23,2,21,8,30,0,27,0],[25,8,26,12,26,16,22.71875,15.375,20,13,18,15,17,18,13,22,17,21,19,22,21,20,19,18,22,17,30,25,26,26,24,28,21.75,33.34375,20,36,18,40,20,40,24,37,25,32,27,31,26,38,27,37,30,32,32,35,36,37,38,40,38,39,40,40,37,36,34,32,37,31,36,29,33,27,34,24,39,21,40,21,40,16,37,20,31,22,32,25,27,20,29,15,30,20,32,20,34,18,33,12,31,11,29,14,26,9,25,8],[39,24,37,26,40,28,39,24],[13,15,9,19,14,18,13,15],[18,23,14,27,16,27,17,25,20,26,18,23],[6,24,2,26,1,28,2,30,5,28,12,30,16,32,18,30,15,30,12,28,9,25,7,27,6,24],[29,27,32,28,33,31,30,29,27,28,29,27],[5,35,1,33,3,36,13,38,15,35,10,36,5,35]],fill:1},grass:{width:27,height:22,lines:[[0,10.5,13,10.5],[2.5,10,1.5,7],[4.5,10,4.5,5,3.5,4],[7,10,7.5,6,8.5,3],[10,10,11,6]],repeat:[[0,0],[14,10]],stroke:1},swamp:{width:24,height:23,lines:[[0,10.5,9.5,10.5],[2.5,10,2.5,7],[4.5,10,4.5,4],[6.5,10,6.5,6],[3,12.5,7,12.5]],repeat:[[0,0],[14,10]],stroke:1},reed:{width:26,height:23,lines:[[2.5,10,2,7],[4.5,10,4.2,4],[6.5,10,6.8,4],[8.5,10,9,6],[3.7,4,3.7,2.5],[4.7,4,4.7,2.5],[6.3,4,6.3,2.5],[7.3,4,7.3,2.5]],circles:[[4.2,2.5,.5],[18.2,12.5,.5],[6.8,2.5,.5],[20.8,12.5,.5],[9,6,.5],[23,16,.5]],repeat:[[0,0],[14,10]],stroke:1},wave:{width:10,height:8,lines:[[0,0,5,4,10,0]],stroke:1},vine:{width:13,height:13,lines:[[3,0,3,6],[9,7,9,13]],stroke:1},forest:{width:55,height:30,circles:[[7,7,3.5],[20,20,1.5],[42,22,3.5],[35,5,1.5]],stroke:1},forest2:{width:55,height:30,circles:[[7,7,3.5],[20,20,1.5],[42,22,3.5],[35,5,1.5]],fill:1,stroke:1},scrub:{width:26,height:20,lines:[[1,4,4,8,6,4]],circles:[[20,13,1.5]],stroke:1},tree:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78]],repeat:[[3,1],[18,16]],stroke:1},tree2:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78,4.95,10.61,7.78,10.61]],repeat:[[3,1],[18,16]],fill:1,stroke:1},pine:{width:30,height:30,lines:[[5.66,11.31,2.83,11.31,2.83,8.49,0,8.49,2.83,0,5.66,8.49,2.83,8.49]],repeat:[[3,1],[18,16]],stroke:1},pine2:{width:30,height:30,lines:[[5.66,11.31,2.83,11.31,2.83,8.49,0,8.49,2.83,0,5.66,8.49,2.83,8.49,2.83,11.31,5.66,11.31]],repeat:[[3,1],[18,16]],fill:1,stroke:1},mixtree:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78,4.95,10.61,7.78,10.61],[23.66,27.31,20.83,27.31,20.83,24.49,18,24.49,20.83,16,23.66,24.49,20.83,24.49,20.83,27.31,23.66,27.31]],repeat:[[3,1]],stroke:1},mixtree2:{width:30,height:30,lines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,.71,6.36,0,4.24,.71,2.12,4.24,0,7.78,.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78,4.95,10.61,7.78,10.61],[23.66,27.31,20.83,27.31,20.83,24.49,18,24.49,20.83,16,23.66,24.49,20.83,24.49,20.83,27.31,23.66,27.31]],repeat:[[3,1]],fill:1,stroke:1},pines:{width:22,height:20,lines:[[1,4,3.5,1,6,4],[1,8,3.5,5,6,8],[3.5,1,3.5,11],[12,14.5,14.5,14,17,14.5],[12,18,17,18],[14.5,12,14.5,18]],repeat:[[2,1]],stroke:1},rock:{width:20,height:20,lines:[[1,0,1,9],[4,0,4,9],[7,0,7,9],[10,1,19,1],[10,4,19,4],[10,7,19,7],[0,11,9,11],[0,14,9,14],[0,17,9,17],[12,10,12,19],[15,10,15,19],[18,10,18,19]],repeat:[[.5,.5]],stroke:1},rocks:{width:20,height:20,lines:[[5,0,3,0,5,4,4,6,0,3,0,5,3,6,5,9,3.75,10,2.5,10,0,9,0,10,4,11,5,14,4,15,0,13,0,13,0,13,0,14,0,14,5,16,5,18,3,19,0,19,-.25,19.9375,5,20,10,19,10,20,11,20,12,19,14,20,15,20,17,19,20,20,20,19,19,16,20,15,20,11,20,10,19,8,20,5,20,0,19,0,20,2,19,4,17,4,16,3,15,0,14,0,15,4,11,5,10,4,11,0,10,0,9,4,6,5,5,0],[18,5,19,6,18,10,16,10,14,9,16,5,18,5],[5,6,9,5,10,6,10,9,6,10,5,6],[14,5,14,8,13,9,12,9,11,7,12,5,14,5],[5,11,8,10,9,11,10,14,6,15,6,15,5,11],[13,10,14,11,15,14,15,14,15,14,11,15,10,11,11,10,13,10],[15,12,16,11,19,11,19,15,16,14,16,14,15,12],[6,16,9,15,10,18,5,19,6,16],[10,16,14,16,14,18,13,19,11,18,10,16],[15,15,18,16,18,18,16,19,15,18,15,15]],stroke:1}};class Xm{static uuid15(){return Xm.uuid(15,16)}static CheckIsColor(t){return CSS.supports("color",t)?t:"rgba(0, 0, 0, 0.8)"}static getDefaultImageFillStyle(){let t=[],e=new Wm;for(let r in e.patterns){let e=new Wm({pattern:r});t.push({title:r,image:e.getImage().toDataURL()})}return t}static saveToShp(t,e){}static toGeoJSON(t){return(new Df).writeFeaturesObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}static formatStr(t,e){if(0===arguments.length)return null;let r=arguments[0];for(let n=1;n<arguments.length;n++){let t=new RegExp("\\{"+(n-1)+"\\}","gm");r=r.replace(t,arguments[n])}return r}static randomString(t){t=t||32;let e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz",r=e.length,n="";for(let i=0;i<t;i++)n+=e.charAt(Math.floor(Math.random()*r));return n.toLowerCase()}static uuid(t,e){let r,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];if(e=e||n.length,t)for(r=0;r<t;r++)i[r]=n[0|Math.random()*e];else{let t;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",r=0;r<36;r++)i[r]||(t=0|16*Math.random(),i[r]=n[19===r?3&t|8:t])}return i.join("")}static format(t,e){if("object"==typeof e){for(let r in e)if(void 0!==e[r]){let n=new RegExp("({"+r+"})","g");t=t.replace(n,e[r])}}else for(let r=0;r<e.length;r++)if(void 0!==e[r]){let n=new RegExp("({["+r+"]})","g");t=t.replace(n,e[r])}return t}static getQueryString(t){return new URL(window.location.href).searchParams.get(t)}static ConvertKmlToJson(t,e){Vm.toGeoJSON(t).then((t=>{e(t)}))}static saveTokml(t,e){let r=Vm.toKml(t,{name:"标绘数据",documentName:"标绘数据文件",documentDescription:"标绘数据 by 幻景科技",simplestyle:!0});Xm.downloadFile(e,r)}static saveJSON(t,e){if(!t)return void alert("保存的数据为空");e||(e="json.json"),"object"==typeof t&&(t=JSON.stringify(t,void 0,4));let r=new Blob([t],{type:"text/json"}),n=document.createEvent("MouseEvents"),i=document.createElement("a");i.download=e,i.href=window.URL.createObjectURL(r),i.dataset.downloadurl=["text/json",i.download,i.href].join(":"),n.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(n)}static downloadFile(t,e){const r=new Blob([e]),n=document.createElement("a");n.download=t,n.href=URL.createObjectURL(r),document.body.appendChild(n),n.click(),document.body.removeChild(n)}static randomHexColor(){return"#"+Math.random().toString(16).substring(2,6).toUpperCase()}static randomRgbColor(t=1){return Xm.hexToRgba(Xm.randomHexColor(),t)}static rgbToHex(t){let e,r,n,i,o=t.replace(/\s+/g,"").match(/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([.\d]+))?\)/);return o?(e=(+o[1]).toString(16),e=1===e.length?"0"+e:e,r=(+o[2]).toString(16),r=1===r.length?"0"+r:r,n=(+o[3]).toString(16),n=1===n.length?"0"+n:n,i=+(o[5]?o[5]:1),{hex:"#"+e+r+n,alpha:i}):{hex:t,alpha:1}}static hexToRgba(t,e){let r=t.toLowerCase();if(r&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(r)){if(4===r.length){let t="#";for(let e=1;e<4;e+=1)t+=r.slice(e,e+1).concat(r.slice(e,e+1));r=t}let t=[];for(let e=1;e<7;e+=2)t.push(parseInt("0x"+r.slice(e,e+2)));return"rgba("+t.join(",")+","+e+")"}return r}}const Ym=class{constructor(t){e(this,"overlayStyle"),e(this,"StylesList",{highlightStyle:new Vi({stroke:new Rn({color:"rgba(0, 255, 0,1)",width:5}),fill:new Fn({color:"rgba(0, 255, 0,0.0)"}),text:new Wi({text:"",font:"12px Calibri,sans-serif",fill:new Fn({color:"#000"}),stroke:new Rn({color:"#f00",width:3})}),image:new Di({radius:5,fill:new Fn({color:"rgba(0, 255, 0,1)"}),stroke:new Rn({color:"rgba(255, 255, 255,1)",width:2})})}),point:new Vi({text:new Wi({font:Ym.option.Point.Font,text:"",offsetX:Ym.option.Point.FontoffsetX,offsetY:Ym.option.Point.FontoffsetY,fill:new Fn({color:Ym.option.Point.FontColor}),stroke:new Rn({color:Ym.option.Point.FontStrokeColor,width:Ym.option.Point.FontStrokeWidth})}),image:new Di({scale:Ym.option.Point.scale,radius:Ym.option.Point.radius,fill:new Fn({color:Ym.option.Point.fillcolor}),stroke:new Rn({color:Ym.option.Point.strokecolor,width:Ym.option.Point.strokewidth})})}),polyline:new Vi({stroke:new Rn({color:Ym.option.LineString.strokecolor,width:Ym.option.LineString.strokewidth}),text:new Wi({text:"",font:Ym.option.LineString.Font,fill:new Fn({color:Ym.option.LineString.FontColor}),stroke:new Rn({color:Ym.option.LineString.FontStrokeColor,width:Ym.option.LineString.FontStrokeWidth})})}),polygon:new Vi({stroke:new Rn({color:Ym.option.Polygon.strokecolor,width:Ym.option.Polygon.strokewidth}),fill:new Fn({color:Ym.option.Polygon.fillcolor}),text:new Wi({text:"",font:Ym.option.Polygon.Font,fill:new Fn({color:Ym.option.Polygon.FontColor}),stroke:new Rn({color:Ym.option.Polygon.FontStrokeColor,width:Ym.option.Polygon.FontStrokeWidth})})}),bufferStyle:new Vi({stroke:new Rn({color:Ym.option.bufferStyle.strokecolor,width:Ym.option.bufferStyle.strokewidth,lineDash:[10,10]}),fill:new Fn({color:Ym.option.bufferStyle.fillcolor}),text:new Wi({text:"",font:Ym.option.bufferStyle.Font,fill:new Fn({color:Ym.option.bufferStyle.FontColor}),stroke:new Rn({color:Ym.option.bufferStyle.FontStrokeColor,width:Ym.option.bufferStyle.FontStrokeWidth})})}),overlapStyle:new Vi({stroke:new Rn({color:Ym.option.overlapStyle.strokecolor,width:Ym.option.overlapStyle.strokewidth}),fill:new Fn({color:Ym.option.overlapStyle.fillcolor}),text:new Wi({text:"",font:Ym.option.overlapStyle.Font,fill:new Fn({color:Ym.option.overlapStyle.FontColor}),stroke:new Rn({color:Ym.option.overlapStyle.FontStrokeColor,width:Ym.option.overlapStyle.FontStrokeWidth})}),image:new Di({radius:5,fill:new Fn({color:Ym.option.overlapStyle.fillcolor}),stroke:new Rn({color:Ym.option.overlapStyle.strokecolor,width:Ym.option.overlapStyle.strokewidth})}),zIndex:1/0}),MultiLineString:new Vi({stroke:new Rn({color:"green",width:1})}),MultiPoint:new Vi({image:Ym.image}),MultiPolygon:new Vi({stroke:new Rn({color:"yellow",width:1}),fill:new Fn({color:"rgba(255, 255, 0, 0.1)"})}),Circle:new Vi({stroke:new Rn({color:Ym.option.Polygon.strokecolor,width:Ym.option.Polygon.strokewidth}),fill:new Fn({color:Ym.option.Polygon.fillcolor})}),square:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:4,radius:10,angle:Math.PI/4})}),triangle:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:3,radius:10,rotation:Math.PI/4,angle:0})}),star:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:5,radius:10,radius2:4,angle:0})}),cross:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:4,radius:10,radius2:0,angle:0})}),x:new Vi({image:new Ri({fill:Ym.fill,stroke:Ym.stroke,points:4,radius:10,radius2:0,angle:Math.PI/4})}),GeometryCollection:new Vi({fill:new Fn({color:"rgba(255, 255, 255, 0.1)"}),stroke:new Rn({color:"rgba(255, 255, 0, 1)",width:3}),image:new Di({radius:5,stroke:new Rn({color:"rgba(255, 0,0, 1)",width:2}),fill:new Fn({color:"rgba(255, 255, 0, 1)"})})})}),e(this,"option",{overlapStyle:{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:0,fillcolor:"rgba(255, 255, 255,0.5)",strokecolor:"blue",strokewidth:3,strokeradius:5}}),this.overlayStyle=function(){const t={};return t.Polygon=[new Vi({fill:new Fn({color:[255,255,255,.5]})}),new Vi({stroke:new Rn({color:[255,255,255,1],width:5})}),new Vi({stroke:new Rn({color:[0,153,255,1],width:3})}),new Vi({image:new Di({radius:3,fill:new Fn({color:"red"})})})],t.MultiPolygon=t.Polygon,t.LineString=[new Vi({stroke:new Rn({color:[255,255,255,1],width:5})}),new Vi({stroke:new Rn({color:[0,153,255,1],width:3})})],t.MultiLineString=t.LineString,t.Point=[new Vi({image:new Di({radius:7,fill:new Fn({color:[0,153,255,1]}),stroke:new Rn({color:[255,255,255,.75],width:1.5})}),zIndex:1e5})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.Point),function(e,r){return t[e.getGeometry().getType()]}}()}static getStyle(t,e){let r;switch(t){case Pm.Point:r=(null==e?void 0:e.imageOption)?Ym.getIconStyle(e):Ym.getPointStyle(e);break;case Pm.Line:case Pm.MultiLineString:r=Ym.getPolylineStyle(e);break;case Pm.Polygon:case Pm.MultiPolygon:case Pm.Rectangle:case Pm.Circle:r=Ym.getPolygonStyle(e);break;case Pm.GeometryCollection:r=new Vi({fill:new Fn({color:"rgba(255, 255, 255, 0.1)"}),stroke:new Rn({color:"rgba(255, 255, 0, 1)",width:3}),image:new Di({radius:5,stroke:new Rn({color:"rgba(255, 0,0, 1)",width:2}),fill:new Fn({color:"rgba(255, 255, 0, 1)"})})})}return r}static getDefaultPointStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:-10,fillcolor:"rgba(0, 153, 255,1)",strokecolor:"rgba(255, 255, 255,1)",strokewidth:1,radius:3,scale:1,text:""}}static getDefaulLineStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:10,fillcolor:"rgba(255, 255, 0,1)",strokecolor:"rgba(255, 255, 0,1)",strokewidth:2,strokeradius:5,strokelineDash:null,strokelineCap:"round",strokelineJoin:"round",text:""}}static getDefaultBufferStyleStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:0,fillcolor:"rgba(255, 255, 255,0.2)",strokecolor:"rgba(255, 0, 0,1)",strokewidth:2,strokeradius:5,text:""}}static getDefaultPolygonStyle(){return{Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:0,fillcolor:"rgba(255, 255, 255,0.2)",strokecolor:"rgba(255, 255, 0,1)",strokewidth:2,strokeradius:5,text:""}}static getTipStyle(){return new Vi({text:new Wi({font:"12px Calibri,sans-serif",fill:new Fn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new Fn({color:"rgba(0, 0, 0, 0.8)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})})}static getIconStyle(t){for(let r in t)""===t[r]&&delete t[r];let e=Object.assign({},Ym.getDefaultPointStyle(),t);return new Vi({text:new Wi({font:e.Font,text:e.text,offsetX:e.FontoffsetX,offsetY:e.FontoffsetY,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})}),image:new Us(e.imageOption)})}static getPointStyle(t){for(let n in t)""===t[n].toString()&&delete t[n];let e,r=Object.assign({},Ym.getDefaultPointStyle(),t);switch(r.GraphicStyle){case"STYLE_TRIANGLE":e=new Ri({scale:r.scale,radius:r.radius,points:3,angle:Math.PI,displacement:[0,10],fill:new Fn({color:Xm.CheckIsColor(r.fillcolor)}),stroke:new Rn({color:Xm.CheckIsColor(r.strokecolor),width:r.strokewidth})});break;case"STYLE_SQUARE":e=new Ri({scale:r.scale,radius:r.radius,points:4,angle:Math.PI/4,fill:new Fn({color:Xm.CheckIsColor(r.fillcolor)}),stroke:new Rn({color:Xm.CheckIsColor(r.strokecolor),width:r.strokewidth})});break;default:e=new Di({scale:r.scale,radius:r.radius,fill:new Fn({color:Xm.CheckIsColor(r.fillcolor)}),stroke:new Rn({color:Xm.CheckIsColor(r.strokecolor),width:r.strokewidth})})}return new Vi({text:new Wi({font:r.Font,text:r.text,offsetX:r.FontoffsetX,offsetY:r.FontoffsetY,fill:new Fn({color:Xm.CheckIsColor(r.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(r.FontStrokeColor),width:r.FontStrokeWidth})}),image:e})}static getPolylineStyle(t){for(let r in t)""===t[r].toString()&&delete t[r];let e=Object.assign({},Ym.getDefaulLineStyle(),t);switch(e.GraphicStyle){case"STYLE_DASH":e.strokelineDash=[15,10];break;case"STYLE_SOLID":e.strokelineDash=null;break;case"STYLE_DOT":e.strokelineDash=[2,5];break;case"STYLE_DASHDOT":e.strokelineDash=[2,10,15,10]}return new Vi({stroke:new Rn({color:e.strokecolor,width:e.strokewidth,lineDash:e.strokelineDash}),text:new Wi({text:e.text,font:e.Font,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})})})}static getTrackLineStyle(t,e){t.getGeometry();let r=[new Vi({stroke:new Rn({color:"#2E8B57",width:10})})];t.getGeometry().getLength();let n=Math.ceil(t.getGeometry().getLength()/e/100),i=[];for(let o=0;o<=n;o++){let e=o/n+.01;e>1&&(e-=1);let r=new X(new on(t.getGeometry().getCoordinateAt(e)));i.push(r)}return t.getGeometry().forEachSegment(((t,e)=>{i.forEach((n=>{let i=new Nn([t,e]),o=n.getGeometry().getFirstCoordinate(),s=i.getClosestPoint(o);if(Math.abs(s[0]-o[0])<1&&Math.abs(s[1]-o[1])<1){new Image(117,71).src="../../public/image/linearrow.png";let i=e[0]-t[0],o=e[1]-t[1],s=Math.atan(i/o);s=o>0?s:Math.PI+s,r.push(new Vi({geometry:n.getGeometry(),image:new Us({src:"../../public/image/linearrow.png",anchor:[.75,.5],scale:1,rotateWithView:!1,color:"white",rotation:-s})}))}}))})),r}static getPolygonStyle(t){for(let r in t)""===t[r].toString()&&delete t[r];let e=Object.assign({},Ym.getDefaultPolygonStyle(),t);switch(e.strokeStyle){case"STYLE_DASH":e.strokelineDash=[15,10];break;case"STYLE_SOLID":e.strokelineDash=null;break;case"STYLE_DOT":e.strokelineDash=[2,5];break;case"STYLE_DASHDOT":e.strokelineDash=[2,10,15,10]}return new Vi({stroke:new Rn({color:Xm.CheckIsColor(e.strokecolor),width:e.strokewidth,lineDash:e.strokelineDash}),fill:new Fn({color:Xm.CheckIsColor(e.fillcolor)}),text:new Wi({text:e.text,font:e.Font,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})})})}static getBufferStyleStyle(t){for(let r in t)""===t[r].toString()&&delete t[r];let e=Object.assign({},Ym.getDefaultBufferStyleStyle(),t);return new Vi({stroke:new Rn({color:Xm.CheckIsColor(e.strokecolor),width:e.strokewidth,lineDash:[10,10]}),fill:new Fn({color:Xm.CheckIsColor(e.fillcolor)}),text:new Wi({text:e.text,font:e.Font,fill:new Fn({color:Xm.CheckIsColor(e.FontColor)}),stroke:new Rn({color:Xm.CheckIsColor(e.FontStrokeColor),width:e.FontStrokeWidth})})})}static getEditPolygonStyle(){return[new Vi({stroke:new Rn({color:"rgba(0, 153, 255,1)",width:3}),fill:new Fn({color:"rgba(255, 255, 255,0.3)"}),text:new Wi({text:"",font:"12px Microsoft YaHei",fill:new Fn({color:"#000"}),stroke:new Rn({color:"#fff",width:2})})}),new Vi({image:new Di({radius:3,fill:new Fn({color:"rgba(255, 255, 255,1)"}),stroke:new Rn({color:"red",width:2})}),geometry:function(t){var e,r;if(t){let n;return n=t.getGeometry().getType()===Pm.Line?null==(e=t.getGeometry())?void 0:e.getCoordinates():null==(r=t.getGeometry())?void 0:r.getCoordinates()[0],new nh(n)}}})]}static getEditPointStyle(t){return new Vi({image:new Di({radius:5,stroke:new Rn({color:"rgba(255, 255,255, 0.7)"}),fill:new Fn({color:"rgba(0, 255, 255, 0.8)"})}),text:new Wi({text:"拖动点修改图形,点击空白处完成",font:"12px Calibri,sans-serif",fill:new Fn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new Fn({color:"rgba(0, 0, 0, 0.7)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})})}static getRandomColor(){return"#"+Math.random().toString(16).substring(2,6).toUpperCase()}static _getStyle(t){const e={};switch(t){case"Point":case"MultiPoint":e.Point=new Vi({text:new Wi({font:Ym.option.Point.Font,text:"",offsetX:Ym.option.Point.FontoffsetX,offsetY:Ym.option.Point.FontoffsetY,fill:new Fn({color:Ym.option.Point.FontColor}),stroke:new Rn({color:Ym.option.Point.FontStrokeColor,width:Ym.option.Point.FontStrokeWidth})}),image:new Di({scale:Ym.option.Point.scale,radius:Ym.option.Point.radius,fill:new Fn({color:Ym.option.Point.fillcolor}),stroke:new Rn({color:Ym.option.Point.strokecolor,width:Ym.option.Point.strokewidth})})});break;case"LineString":case"MultiLineString":e.LineString=new Vi({stroke:new Rn({color:Ym.option.LineString.strokecolor,width:Ym.option.LineString.strokewidth}),text:new Wi({text:"",font:Ym.option.LineString.Font,fill:new Fn({color:Ym.option.LineString.FontColor}),stroke:new Rn({color:Ym.option.LineString.FontStrokeColor,width:Ym.option.LineString.FontStrokeWidth})})});break;case"Polygon":case"MultiPolygon":e.Polygon=new Vi({stroke:new Rn({color:Ym.option.Polygon.strokecolor,width:Ym.option.Polygon.strokewidth}),fill:new Fn({color:Ym.option.Polygon.fillcolor}),text:new Wi({text:"",font:Ym.option.Polygon.Font,fill:new Fn({color:Ym.option.Polygon.FontColor}),stroke:new Rn({color:Ym.option.Polygon.FontStrokeColor,width:Ym.option.Polygon.FontStrokeWidth})})})}return e[t]}static setHighlightStyle(t){const e=t.getGeometry().getType();let r=Ym.getStyle(e,{radius:8,strokewidth:2,strokecolor:"rgba(0, 255, 0,1)"});try{t.get("name")&&r.getText()&&r.getText().setText(t.get("name"))}catch(TX){}return r}static getFeaturesDefaultStyle(t,e,r){let n,i,o,s=t.getProperties(),a={};switch(t.getGeometry().getType()){case"Point":case"MultiPoint":i=Ym.getDefaultPointStyle(),a.fillcolor=""!==s.style.fillcolor?s.style.fillcolor:i.fillcolor,a.strokecolor=""!==s.style.strokecolor?s.style.strokecolor:i.strokecolor,a.strokewidth=""!==s.style.strokewidth?s.style.strokewidth:i.strokewidth,a.radius=""!==s.style.radius?s.style.radius/2:i.radius,s.style.src&&""!==s.style.src&&(a.imageOption={src:s.style.src});break;case"LineString":case"MultiLineString":n=Ym.getDefaulLineStyle(),a=Object.assign({},n,s.style);break;case"Polygon":case"MultiPolygon":o=Ym.getDefaultPolygonStyle(),a.fillcolor=""!==s.style.fillcolor?s.style.fillcolor:o.fillcolor,a.strokecolor=""!==s.style.strokecolor?s.style.strokecolor:o.strokecolor,a.strokewidth=""!==s.style.strokewidth?s.style.strokewidth:o.strokewidth}t.set("style",a)}};let Zm=Ym;e(Zm,"option"),e(Zm,"StylesList"),e(Zm,"stroke",new Rn({color:"black",width:2})),e(Zm,"fill",new Fn({color:"red"})),e(Zm,"image",new Di({radius:5,stroke:new Rn({color:"red",width:1})}));var Jm=6371008.8,$m={centimeters:100*Jm,centimetres:100*Jm,degrees:Jm/111325,feet:3.28084*Jm,inches:39.37*Jm,kilometers:Jm/1e3,kilometres:Jm/1e3,meters:Jm,metres:Jm,miles:Jm/1609.344,millimeters:1e3*Jm,millimetres:1e3*Jm,nauticalmiles:Jm/1852,radians:1,yards:1.0936*Jm},tv={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Jm,yards:1.0936133},ev={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function rv(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function nv(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!yv(t[0])||!yv(t[1]))throw new Error("coordinates must contain numbers");return rv({type:"Point",coordinates:t},e,r)}function iv(t,e,r){void 0===r&&(r={});for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return rv({type:"Polygon",coordinates:t},e,r)}function ov(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return rv({type:"LineString",coordinates:t},e,r)}function sv(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function av(t,e,r){return void 0===r&&(r={}),rv({type:"MultiLineString",coordinates:t},e,r)}function lv(t,e,r){return void 0===r&&(r={}),rv({type:"MultiPoint",coordinates:t},e,r)}function uv(t,e,r){return void 0===r&&(r={}),rv({type:"MultiPolygon",coordinates:t},e,r)}function hv(t,e,r){return void 0===r&&(r={}),rv({type:"GeometryCollection",geometries:t},e,r)}function cv(t,e){void 0===e&&(e="kilometers");var r=$m[e];if(!r)throw new Error(e+" units is invalid");return t*r}function Av(t,e){void 0===e&&(e="kilometers");var r=$m[e];if(!r)throw new Error(e+" units is invalid");return t/r}function fv(t,e){return pv(Av(t,e))}function pv(t){return t%(2*Math.PI)*180/Math.PI}function dv(t){return t%360*Math.PI/180}function gv(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return cv(Av(t,e),r)}function yv(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function mv(t){return!!t&&t.constructor===Object}const vv=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:ev,bearingToAzimuth:function(t){var e=t%360;return e<0&&(e+=360),e},convertArea:function(t,e,r){if(void 0===e&&(e="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=ev[e];if(!n)throw new Error("invalid original units");var i=ev[r];if(!i)throw new Error("invalid final units");return t/n*i},convertLength:gv,degreesToRadians:dv,earthRadius:Jm,factors:$m,feature:rv,featureCollection:sv,geometry:function(t,e,r){switch(t){case"Point":return nv(e).geometry;case"LineString":return ov(e).geometry;case"Polygon":return iv(e).geometry;case"MultiPoint":return lv(e).geometry;case"MultiLineString":return av(e).geometry;case"MultiPolygon":return uv(e).geometry;default:throw new Error(t+" is invalid")}},geometryCollection:hv,isNumber:yv,isObject:mv,lengthToDegrees:fv,lengthToRadians:Av,lineString:ov,lineStrings:function(t,e,r){return void 0===r&&(r={}),sv(t.map((function(t){return ov(t,e)})),r)},multiLineString:av,multiPoint:lv,multiPolygon:uv,point:nv,points:function(t,e,r){return void 0===r&&(r={}),sv(t.map((function(t){return nv(t,e)})),r)},polygon:iv,polygons:function(t,e,r){return void 0===r&&(r={}),sv(t.map((function(t){return iv(t,e)})),r)},radiansToDegrees:pv,radiansToLength:cv,round:function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},unitsFactors:tv,validateBBox:function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!yv(t))throw new Error("bbox must only contain numbers")}))},validateId:function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},Symbol.toStringTag,{value:"Module"}));function _v(t,e,r){if(null!==t)for(var n,i,o,s,a,l,u,h,c=0,A=0,f=t.type,p="FeatureCollection"===f,d="Feature"===f,g=p?t.features.length:1,y=0;y<g;y++){a=(h=!!(u=p?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var m=0;m<a;m++){var v=0,_=0;if(null!==(s=h?u.geometries[m]:u)){l=s.coordinates;var w=s.type;switch(c=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,A,y,v,_))return!1;A++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],A,y,v,_))return!1;A++,"MultiPoint"===w&&v++}"LineString"===w&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(!1===e(l[n][i],A,y,v,_))return!1;A++}"MultiLineString"===w&&v++,"Polygon"===w&&_++}"Polygon"===w&&v++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(_=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(!1===e(l[n][i][o],A,y,v,_))return!1;A++}_++}v++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===_v(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function wv(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function bv(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function xv(t,e,r){var n=r;return bv(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n}function Ev(t){var e=[];return _v(t,(function(t){e.push(t)})),e}function Cv(t,e){var r,n,i,o,s,a,l,u,h,c,A=0,f="FeatureCollection"===t.type,p="Feature"===t.type,d=f?t.features.length:1;for(r=0;r<d;r++){for(a=f?t.features[r].geometry:p?t.geometry:t,u=f?t.features[r].properties:p?t.properties:{},h=f?t.features[r].bbox:p?t.bbox:void 0,c=f?t.features[r].id:p?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,A,u,h,c))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===e(o.geometries[n],A,u,h,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,A,u,h,c))return!1;A++}}function Sv(t,e,r){var n=r;return Cv(t,(function(t,i,o,s,a){n=0===i&&void 0===r?t:e(n,t,i,o,s,a)})),n}function Bv(t,e){Cv(t,(function(t,r,n,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(rv(t,n,{bbox:i,id:o}),r,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var u=t.coordinates[l];if(!1===e(rv({type:s,coordinates:u},n),r,l))return!1}}))}function Iv(t,e){Bv(t,(function(t,r,n){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,u=0;return!1!==_v(t,(function(o,h,c,A,f){if(void 0===s||r>a||A>l||f>u)return s=o,a=r,l=A,u=f,void(i=0);var p=ov([s,o],t.properties);if(!1===e(p,r,n,f,i))return!1;i++,s=o}))&&void 0}}}))}function Tv(t,e,r){var n=r,i=!1;return Iv(t,(function(t,o,s,a,l){n=!1===i&&void 0===r?t:e(n,t,o,s,a,l),i=!0})),n}function Pv(t,e){if(!t)throw new Error("geojson is required");Bv(t,(function(t,r,n){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,n,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(ov(o[s],t.properties),r,n,s))return!1}}}))}function Fv(t,e,r){var n=r;return Pv(t,(function(t,i,o,s){n=0===i&&void 0===r?t:e(n,t,i,o,s)})),n}const Lv=Object.freeze(Object.defineProperty({__proto__:null,coordAll:Ev,coordEach:_v,coordReduce:function(t,e,r,n){var i=r;return _v(t,(function(t,n,o,s,a){i=0===n&&void 0===r?t:e(i,t,n,o,s,a)}),n),i},featureEach:bv,featureReduce:xv,findPoint:function(t,e){if(!mv(e=e||{}))throw new Error("options is invalid");var r,n=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n),a=a||t.features[n].properties,r=t.features[n].geometry;break;case"Feature":a=a||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var l=r.coordinates;switch(r.type){case"Point":return nv(l,a,e);case"MultiPoint":return i<0&&(i=l.length+i),nv(l[i],a,e);case"LineString":return s<0&&(s=l.length+s),nv(l[s],a,e);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),nv(l[o][s],a,e);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s),nv(l[i][s],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s),nv(l[i][o][s],a,e)}throw new Error("geojson is invalid")},findSegment:function(t,e){if(!mv(e=e||{}))throw new Error("options is invalid");var r,n=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n),a=a||t.features[n].properties,r=t.features[n].geometry;break;case"Feature":a=a||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var l=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),ov([l[s],l[s+1]],a,e);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),ov([l[o][s],l[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s-1),ov([l[i][s],l[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s-1),ov([l[i][o][s],l[i][o][s+1]],a,e)}throw new Error("geojson is invalid")},flattenEach:Bv,flattenReduce:function(t,e,r){var n=r;return Bv(t,(function(t,i,o){n=0===i&&0===o&&void 0===r?t:e(n,t,i,o)})),n},geomEach:Cv,geomReduce:Sv,lineEach:Pv,lineReduce:Fv,propEach:wv,propReduce:function(t,e,r){var n=r;return wv(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},segmentEach:Iv,segmentReduce:Tv},Symbol.toStringTag,{value:"Module"}));function Mv(t){var e=[1/0,1/0,-1/0,-1/0];return _v(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}Mv.default=Mv;const Ov=Object.freeze(Object.defineProperty({__proto__:null,default:Mv},Symbol.toStringTag,{value:"Module"}));function kv(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Nv(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Rv(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,i=t.features;n<i.length;n++){var o=i[n];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+o.geometry.type)}}function Uv(t){return"Feature"===t.type?t.geometry:t}function Dv(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}
|
|
21
21
|
/*
|
|
22
22
|
object-assign
|
|
23
23
|
(c) Sindre Sorhus
|
|
@@ -466,7 +466,7 @@ var Mlt=function(){return"undefined"!=typeof window?window:"undefined"!=typeof g
|
|
|
466
466
|
* By Jimmy Wärting, https://github.com/jimmywarting
|
|
467
467
|
* License: MIT
|
|
468
468
|
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
|
|
469
|
-
*/Mlt.URL=Mlt.URL||Mlt.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var klt=Mlt.Blob,Nlt=URL.createObjectURL,Rlt=URL.revokeObjectURL,Ult=Mlt.Symbol&&Mlt.Symbol.toStringTag,Dlt=!1,Qlt=!1,Glt=!!Mlt.ArrayBuffer,jlt=Olt&&Olt.prototype.append&&Olt.prototype.getBlob;try{Dlt=2===new Blob(["ä"]).size,Qlt=2===new Blob([new Uint8Array([1,2])]).size}catch(TX){}function Hlt(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function zlt(t,e){e=e||{};var r=new Olt;return Hlt(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function Vlt(t,e){return new klt(Hlt(t),e||{})}if(Mlt.Blob&&(zlt.prototype=Blob.prototype,Vlt.prototype=Blob.prototype),Ult)try{File.prototype[Ult]="File",Blob.prototype[Ult]="Blob",FileReader.prototype[Ult]="FileReader"}catch(TX){}function Klt(){var t=!!Mlt.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,e=Mlt.XMLHttpRequest&&Mlt.XMLHttpRequest.prototype.send;t&&e&&(XMLHttpRequest.prototype.send=function(t){t instanceof Blob?(this.setRequestHeader("Content-Type",t.type),e.call(this,t)):e.call(this,t)});try{new File([],"")}catch(n){try{var r=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();Mlt.File=r}catch(i){r=function(t,e,r){var n=new Blob(t,r),i=r&&void 0!==r.lastModified?new Date(r.lastModified):new Date;return n.name=e,n.lastModifiedDate=i,n.lastModified=+i,n.toString=function(){return"[object File]"},Ult&&(n[Ult]="File"),n},Mlt.File=r}}}Dlt?(Klt(),Mlt.Blob=Qlt?Mlt.Blob:Vlt):jlt?(Klt(),Mlt.Blob=zlt):function(){function t(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}function e(t){var e,r,n,i,o,s;for(e="",n=t.length,r=0;r<n;)switch((i=t[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=String.fromCharCode(i);break;case 12:case 13:o=t[r++],e+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[r++],s=t[r++],e+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&s)<<0)}return e}function r(t){for(var e=new Array(t.byteLength),r=new Uint8Array(t),n=e.length;n--;)e[n]=r[n];return e}function n(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[],n=0;n<t.length;n+=3){var i=t[n],o=n+1<t.length,s=o?t[n+1]:0,a=n+2<t.length,l=a?t[n+2]:0,u=i>>2,h=(3&i)<<4|s>>4,c=(15&s)<<2|l>>6,A=63&l;a||(A=64,o||(c=64)),r.push(e[u],e[h],e[c],e[A])}return r.join("")}var i=Object.create||function(t){function e(){}return e.prototype=t,new e};if(Glt)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function a(e,n){for(var i=0,o=(e=e||[]).length;i<o;i++){var l=e[i];l instanceof a?e[i]=l._buffer:"string"==typeof l?e[i]=t(l):Glt&&(ArrayBuffer.prototype.isPrototypeOf(l)||s(l))?e[i]=r(l):Glt&&(u=l)&&DataView.prototype.isPrototypeOf(u)?e[i]=r(l.buffer):e[i]=t(String(l))}var u;this._buffer=[].concat.apply([],e),this.size=this._buffer.length,this.type=n&&n.type||""}function l(t,e,r){r=r||{};var n=a.call(this,t,r)||this;return n.name=e,n.lastModifiedDate=r.lastModified?new Date(r.lastModified):new Date,n.lastModified=+n.lastModifiedDate,n}if(a.prototype.slice=function(t,e,r){return new a([this._buffer.slice(t||0,e||this._buffer.length)],{type:r})},a.prototype.toString=function(){return"[object Blob]"},l.prototype=i(a.prototype),l.prototype.constructor=l,Object.setPrototypeOf)Object.setPrototypeOf(l,a);else try{l.__proto__=a}catch(TX){}function u(){if(!(this instanceof u))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var t=document.createDocumentFragment();this.addEventListener=t.addEventListener,this.dispatchEvent=function(e){var r=this["on"+e.type];"function"==typeof r&&r(e),t.dispatchEvent(e)},this.removeEventListener=t.removeEventListener}function h(t,e,r){if(!(e instanceof a))throw new TypeError("Failed to execute '"+r+"' on 'FileReader': parameter 1 is not of type 'Blob'.");t.result="",setTimeout((function(){this.readyState=u.LOADING,t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend"))}))}l.prototype.toString=function(){return"[object File]"},u.EMPTY=0,u.LOADING=1,u.DONE=2,u.prototype.error=null,u.prototype.onabort=null,u.prototype.onerror=null,u.prototype.onload=null,u.prototype.onloadend=null,u.prototype.onloadstart=null,u.prototype.onprogress=null,u.prototype.readAsDataURL=function(t){h(this,t,"readAsDataURL"),this.result="data:"+t.type+";base64,"+n(t._buffer)},u.prototype.readAsText=function(t){h(this,t,"readAsText"),this.result=e(t._buffer)},u.prototype.readAsArrayBuffer=function(t){h(this,t,"readAsText"),this.result=t._buffer.slice()},u.prototype.abort=function(){},URL.createObjectURL=function(t){return t instanceof a?"data:"+t.type+";base64,"+n(t._buffer):Nlt.call(URL,t)},URL.revokeObjectURL=function(t){Rlt&&Rlt.call(URL,t)};var c=Mlt.XMLHttpRequest&&Mlt.XMLHttpRequest.prototype.send;c&&(XMLHttpRequest.prototype.send=function(t){t instanceof a?(this.setRequestHeader("Content-Type",t.type),c.call(this,e(t._buffer))):c.call(this,t)}),Mlt.FileReader=u,Mlt.File=l,Mlt.Blob=a}();var qlt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===Mlt.btoa&&(Mlt.btoa=function(t){var e,r,n,i,o,s=0,a=0,l="",u=[];if(!t)return t;do{e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,r=o>>12&63,n=o>>6&63,i=63&o,u[a++]=qlt.charAt(e)+qlt.charAt(r)+qlt.charAt(n)+qlt.charAt(i)}while(s<t.length);l=u.join("");var h=t.length%3;return(h?l.slice(0,h-3):l)+"===".slice(h||3)}),void 0===Mlt.atob&&(Mlt.atob=function(t){var e,r,n,i,o,s,a=0,l=0,u=[];if(!t)return t;t+="";do{e=(s=qlt.indexOf(t.charAt(a++))<<18|qlt.indexOf(t.charAt(a++))<<12|(i=qlt.indexOf(t.charAt(a++)))<<6|(o=qlt.indexOf(t.charAt(a++))))>>16&255,r=s>>8&255,n=255&s,u[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,r):String.fromCharCode(e,r,n)}while(a<t.length);return u.join("")});class Wlt extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.setAttribute("id","mouse-position"),n.innerHTML="",n.style.float="right",n.style.left=" 0px",n.style.right="0px",n.style.bottom="0px",n.style.marginRight="60px";let i=document.createElement("div");i.setAttribute("id","locationbar"),i.style.position="absolute",i.style.zIndex="991",i.style.padding=" 3px 10px",i.style.fontSize=" 13px",i.style.color="#e9e9e9",i.style.textShadow="2px 2px 2px #000",i.style.backgroundColor="rgba(0,0,0,.4)",i.style.minHeight="26px",i.style.left=" 0px",i.style.right="0px",i.style.bottom="0px",i.appendChild(n),super({element:i,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}updateMousePosition(t){this._mouseposition.innerHTML=t}}class Xlt extends Bl{constructor(t,r,n,i){const o=t||{};let s=n.find((t=>t.name===r));const a=new Image;a.src=s.icon,a.className="mirage-mapswitch-image";const l=document.createElement("div");l.className="mirage-mapswitch-button-itemLabel",l.innerHTML=r;const u=document.createElement("div");u.className="mirage-mapswitch-button mirage-mapswitch-toolbar-button",u.appendChild(a),u.appendChild(l);const h=document.createElement("div");h.className="mirage-mapswitch-box";const c=document.createElement("div");c.className="mirage-mapswitch-baseLayerPicker-dropDown",c.style.maxHeight="300px",n.forEach((t=>{const e=new Image;e.src=t.icon,e.className="mirage-mapswitch-baseLayerPicker-itemIcon";const r=document.createElement("div");r.className="mirage-mapswitch-baseLayerPicker-itemLabel",r.innerHTML=t.name;const n=document.createElement("div");n.className="mirage-mapswitch-baseLayerPicker-item mirage-mapswitch-baseLayerPicker-selectedItem",n.appendChild(e),n.appendChild(r),n.addEventListener("click",(t=>{this._isshow=!1,c.className="mirage-mapswitch-baseLayerPicker-dropDown",a.src=t.currentTarget.children[0].src,l.innerHTML=t.currentTarget.innerText,i(t.currentTarget.innerText)}),!1),c.appendChild(n)})),h.appendChild(u),h.appendChild(c),super({element:h,target:o.target}),e(this,"_isshow"),e(this,"baseLayerList"),e(this,"mianImage"),e(this,"mianLabel"),this.mianImage=a,this.mianLabel=l,this.baseLayerList=n,this._isshow=!1,u.addEventListener("click",this.showSwitch.bind(this),!1)}changeBaseLayer(t){this.baseLayerList.forEach((e=>{if(e.name===t)return this.mianImage.src=e.icon,void(this.mianLabel.innerHTML=e.name)}))}showSwitch(t){this._isshow=!this._isshow;let e=document.getElementsByClassName("mirage-mapswitch-baseLayerPicker-dropDown");this._isshow?e[0].className="mirage-mapswitch-baseLayerPicker-dropDown mirage-mapswitch-baseLayerPicker-dropDown-visible":e[0].className="mirage-mapswitch-baseLayerPicker-dropDown"}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}var Ylt=function(t){t=t||{};var e=document.createElement("button"),r=document.createElement("div");r.className=(t.className||"ol-swipe")+" ol-unselectable ol-control",r.appendChild(e),r.addEventListener("mousedown",this.move.bind(this)),r.addEventListener("touchstart",this.move.bind(this)),Bl.call(this,{element:r}),this.precomposeRight_=this.precomposeRight.bind(this),this.precomposeLeft_=this.precomposeLeft.bind(this),this.postcompose_=this.postcompose.bind(this),this.layers=[],t.layers&&this.addLayer(t.layers,!1),t.rightLayers&&this.addLayer(t.rightLayers,!0),this.on("propertychange",function(t){if(this.getMap())try{this.getMap().renderSync()}catch(e){}"horizontal"===this.get("orientation")?(this.element.style.top=100*this.get("position")+"%",this.element.style.left=""):("vertical"!==this.get("orientation")&&this.set("orientation","vertical"),this.element.style.left=100*this.get("position")+"%",this.element.style.top=""),"orientation"===t.key&&(this.element.classList.remove("horizontal","vertical"),this.element.classList.add(this.get("orientation"))),this.isMoving||this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}))}.bind(this)),this.set("position",t.position||.5),this.set("orientation",t.orientation||"vertical")};qm(Ylt,Bl),Ylt.prototype.setMap=function(t){var e,r;if(this.getMap()){for(e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.un(["precompose","prerender"],this.precomposeRight_):r.layer.un(["precompose","prerender"],this.precomposeLeft_),r.layer.un(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(TX){}}if(Bl.prototype.setMap.call(this,t),t){for(this._listener=[],e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.on(["precompose","prerender"],this.precomposeRight_):r.layer.on(["precompose","prerender"],this.precomposeLeft_),r.layer.on(["postcompose","postrender"],this.postcompose_);try{t.renderSync()}catch(TX){}}},Ylt.prototype.isLayer_=function(t){for(var e=0;e<this.layers.length;e++)if(this.layers[e].layer===t)return e;return-1},Ylt.prototype.addLayer=function(t,e){t instanceof Array||(t=[t]);for(var r=0;r<t.length;r++){var n=t[r];if(this.isLayer_(n)<0&&(this.layers.push({layer:n,right:e}),this.getMap())){e?n.on(["precompose","prerender"],this.precomposeRight_):n.on(["precompose","prerender"],this.precomposeLeft_),n.on(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(TX){}}}},Ylt.prototype.removeLayers=function(){var t=[];this.layers.forEach((function(e){t.push(e.layer)})),this.removeLayer(t)},Ylt.prototype.removeLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++){var r=this.isLayer_(t[e]);r>=0&&this.getMap()&&(this.layers[r].right?t[e].un(["precompose","prerender"],this.precomposeRight_):t[e].un(["precompose","prerender"],this.precomposeLeft_),t[e].un(["postcompose","postrender"],this.postcompose_),this.layers.splice(r,1))}if(this.getMap())try{this.getMap().renderSync()}catch(TX){}},Ylt.prototype.getRectangle=function(){var t;return"vertical"===this.get("orientation")?[0,0,(t=this.getMap().getSize())[0]*this.get("position"),t[1]]:[0,0,(t=this.getMap().getSize())[0],t[1]*this.get("position")]},Ylt.prototype.move=function(t){var e,r=this;switch(this._movefn||(this._movefn=this.move.bind(this)),t.type){case"touchcancel":case"touchend":case"mouseup":r.isMoving=!1,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.removeEventListener(t,r._movefn)})),this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}));break;case"mousedown":case"touchstart":r.isMoving=!0,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.addEventListener(t,r._movefn)}));case"mousemove":case"touchmove":if(r.isMoving)if("vertical"===r.get("orientation")){var n=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX;if(!n)break;n-=r.getMap().getTargetElement().getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft;var i=(e=r.getMap().getSize()[0])-Math.min(Math.max(0,e-n),e);e=i/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[i,r.getMap().getSize()[1]],position:[e,0]})}else{var o=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY;if(!o)break;o-=r.getMap().getTargetElement().getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop;var s=(e=r.getMap().getSize()[1])-Math.min(Math.max(0,e-o),e);e=s/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[r.getMap().getSize()[0],s],position:[0,e]})}}},Ylt.prototype._transformPt=function(t,e){var r=t.inversePixelTransform,n=e[0],i=e[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},Ylt.prototype._drawRect=function(t,e){var r=t.inversePixelTransform;if(r){var n=[[e[0][0],e[0][1]],[e[0][0],e[1][1]],[e[1][0],e[1][1]],[e[1][0],e[0][1]],[e[0][0],e[0][1]]];if(t.context.save(),t.target.getImageRatio){var i=-Math.atan2(t.frameState.pixelToCoordinateTransform[1],t.frameState.pixelToCoordinateTransform[0]);t.context.translate(t.frameState.size[0]/2,t.frameState.size[1]/2),t.context.rotate(i),t.context.translate(-t.frameState.size[0]/2,-t.frameState.size[1]/2)}n.forEach((function(e,n){e=[e[0]*r[0]-e[1]*r[1]+r[4],-e[0]*r[2]+e[1]*r[3]+r[5]],n?t.context.lineTo(e[0],e[1]):t.context.moveTo(e[0],e[1])})),t.context.restore()}else{var o=t.frameState.pixelRatio;t.context.rect(e[0][0]*o,e[0][1]*o,e[1][0]*o,e[1][1]*o)}},Ylt.prototype.precomposeLeft=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(r=Math.round(a*this.get("position")),n=l):(r=a,n=Math.round(l*this.get("position")),o[1]+=l-n),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[1]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),u[1]]:h[1]=[u[0],.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Ylt.prototype.precomposeRight=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(n=l,r=Math.round(a*(1-this.get("position"))),o[0]+=a-r):(r=a,n=Math.round(l*(1-this.get("position")))),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[0]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),0]:h[0]=[0,.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Ylt.prototype.postcompose=function(t){if(t.context instanceof WebGLRenderingContext){if("postrender"===t.type){var e=t.context;e.disable(e.SCISSOR_TEST)}}else t.target.getClassName&&"ol-layer"!==t.target.getClassName()&&t.target.get("declutter")?setTimeout((function(){t.context.restore()}),0):t.context.restore()};class Zlt{constructor(){e(this,"events",new Map)}on(t,e,r){return this.events.has(t)||this.events.set(t,[]),(this.events.get(t)||[]).push({handler:e,once:r}),()=>{this.off(t,e)}}once(t,e){return this.on(t,e,!0)}fire(t,...e){let r=0;for(;r<(this.events.get(t)||[]).length;){const n=this.events.get(t)||[],{handler:i,once:o}=n[r];o&&n.splice(r--,1),r++,i(...e)}}off(t,e){t&&(e?this.events.set(t,(this.events.get(t)||[]).filter((t=>t.handler!==e))):this.events.set(t,[]))}}class Jlt extends Zlt{constructor(){super(),e(this,"_swipe"),this._swipe=new Ylt}show(t,e,r="vertical"){this.fire("show",{swipe:this._swipe,leftlayerID:t,rightlayerID:e}),this._swipe.set("orientation",r)}hide(){this.fire("hide",this._swipe)}}class $lt extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.style.zIndex="999",n.style.width="200px",n.className="huitudiv",n.setAttribute("id","huitutext1"),n.style.position="absolute",n.style.zIndex="991",n.style.padding=" 3px 10px",n.style.fontSize=" 25px",n.style.color="#000",n.style.textShadow="2px 2px 2px #fff",n.style.backgroundColor="rgba(0,0,0,.4)",n.style.minHeight="26px",n.style.right="100px",n.style.bottom="50px",n.innerHTML="",super({element:n,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}getElement(){return this._mouseposition}hide(){this.element.style.display="none"}updateHtml(t){this._mouseposition.innerHTML=t}updateElementStyle(t,e){this._mouseposition.style[t]=e}}const tut=Object.freeze(Object.defineProperty({__proto__:null,Locationbar:Wlt,baseLayerSwitch:Xlt,drawTextControl:$lt,swipeControl:Jlt},Symbol.toStringTag,{value:"Module"}));var eut=function(t){t||(t={});var e=this;this.selection_=new V,this.handles_=new V,this.overlayLayer_=new ta({source:new pa({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(t){return e.style[(t.get("handle")||"default")+(t.get("constraint")||"")+(t.get("option")||"")]}}),ou.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.features_=t.features,"function"==typeof t.filter&&(this._filter=t.filter),this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null,this._handleEvent=t.condition||function(){return!0},this.addFn_=t.addCondition||function(){return!1},this.setPointRadius(t.pointRadius),this.set("translateFeature",!1!==t.translateFeature),this.set("translate",!1!==t.translate),this.set("translateBBox",!0===t.translateBBox),this.set("stretch",!1!==t.stretch),this.set("scale",!1!==t.scale),this.set("rotate",!1!==t.rotate),this.set("keepAspectRatio",t.keepAspectRatio||function(t){return t.originalEvent.shiftKey}),this.set("modifyCenter",t.modifyCenter||function(t){return t.originalEvent.metaKey||t.originalEvent.ctrlKey}),this.set("noFlip",t.noFlip||!1),this.set("selection",!1!==t.selection),this.set("hitTolerance",t.hitTolerance||0),this.set("enableRotatedTransform",t.enableRotatedTransform||!1),this.set("keepRectangle",t.keepRectangle||!1),this.on("propertychange",(function(){this.drawSketch_()})),this.setDefaultStyle()};function rut(t,e){var r=(t[0]*e[0]+t[1]*e[1])/(e[0]*e[0]+e[1]*e[1]);return[e[0]*r,e[1]*r]}function nut(t,e){return[e[0]-t[0],e[1]-t[1]]}function iut(t,e){return[t[0]+e[0],t[1]+e[1]]}qm(eut,ou),eut.prototype.Cursors={default:"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"},eut.prototype.setMap=function(t){var e=this.getMap();if(e){var r=e.getTargetElement();e.removeLayer(this.overlayLayer_),this.previousCursor_&&r&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}ou.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),null===t&&this.select(null),null!==t&&(this.isTouch=/touch/.test(t.getViewport().className),this.setDefaultStyle())},eut.prototype.setActive=function(t){this.select(null),this.overlayLayer_.setVisible(t),ou.prototype.setActive.call(this,t)},eut.prototype.setDefaultStyle=function(t){var e=(t=t||{}).pointStroke||new Rn({color:[255,0,0,1],width:1}),r=t.stroke||new Rn({color:[255,0,0,1],width:1,lineDash:[4,4]}),n=t.fill||new Fn({color:[255,0,0,.01]}),i=t.pointFill||new Fn({color:[255,255,255,.8]}),o=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,displacement:this.isTouch?[24,-24]:[12,-12],points:15});o.setDisplacement||(o.getAnchor()[0]=this.isTouch?-10:-5);var s=new Ri({fill:i,stroke:e,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),a=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function l(t,e,r){return[new Vi({image:t,stroke:e,fill:r})]}this.style={default:l(s,r,n),translate:l(s,e,i),rotate:l(o,e,i),rotate0:l(s,e,i),scale:l(s,e,i),scale1:l(s,e,i),scale2:l(s,e,i),scale3:l(s,e,i),scalev:l(a,e,i),scaleh1:l(a,e,i),scalev2:l(a,e,i),scaleh3:l(a,e,i)},this.drawSketch_()},eut.prototype.setStyle=function(t,e){if(e){this.style[t]=e instanceof Array?e:[e];for(var r=0;r<this.style[t].length;r++){var n=this.style[t][r].getImage();n&&("rotate"==t&&(n.getAnchor()[0]=-5),this.isTouch&&n.setScale(1.8));var i=this.style[t][r].getText();i&&("rotate"==t&&i.setOffsetX(this.isTouch?14:7),this.isTouch&&i.setScale(1.8))}this.drawSketch_()}},eut.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t,(function(t,r){var n=!1;if(!r){if(t===e.bbox_)return!!e.get("translateBBox")&&{feature:t,handle:"translate",constraint:"",option:""};if(e.handles_.forEach((function(e){e===t&&(n=!0)})),n)return{feature:t,handle:t.get("handle"),constraint:t.get("constraint"),option:t.get("option")}}if(!e.get("selection"))return e.selection_.getArray().some((function(e){return t===e}))?{feature:t}:null;if(e._filter)return e._filter(t,r)?{feature:t}:null;if(e.layers_){for(var i=0;i<e.layers_.length;i++)if(e.layers_[i]===r)return{feature:t};return null}return e.features_?(e.features_.forEach((function(e){e===t&&(n=!0)})),n?{feature:t}:null):{feature:t}}),{hitTolerance:this.get("hitTolerance")})||{}},eut.prototype.getGeometryRotateToZero_=function(t,e){var r=t.getGeometry(),n=this.getMap().getView().getRotation();if(0===n||!this.get("enableRotatedTransform"))return e?r.clone():r;var i=r.clone();return i.rotate(-1*n,this.getMap().getView().getCenter()),i},eut.prototype._isRectangle=function(t){return!(!this.get("keepRectangle")||"Polygon"!==t.getType())&&5===t.getCoordinates()[0].length},eut.prototype.drawSketch_=function(t){var e,r,n,i=this.selection_.item(0)&&this._isRectangle(this.selection_.item(0).getGeometry());if(this.overlayLayer_.getSource().clear(),this.selection_.getLength()){var o,s=this.getMap().getView().getRotation(),a=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();i&&(o=this.getGeometryRotateToZero_(this.selection_.item(0)).getCoordinates()[0].slice(0,4)).unshift(o[3]),a=Ct(a,0),this.selection_.forEach(function(t){var e=this.getGeometryRotateToZero_(t).getExtent();Rt(a,e)}.bind(this));var l=1===this.selection_.getLength()?this._pointRadius(this.selection_.item(0)):0;if(!l||l instanceof Array||(l=[l,l]),!0===t)this.ispt_||(this.overlayLayer_.getSource().addFeature(new X({geometry:new on(this.center_),handle:"rotate0"})),n=En(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n),this.overlayLayer_.getSource().addFeature(r));else{if(this.ispt_){var u=this.getMap().getPixelFromCoordinate([a[0],a[1]]);if(u){var h=l&&l[0]||10,c=l&&l[1]||10;a=Et([this.getMap().getCoordinateFromPixel([u[0]-h,u[1]-c]),this.getMap().getCoordinateFromPixel([u[0]+h,u[1]+c])])}}n=i?new xn([o]):En(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n);var A=[],f=n.getCoordinates()[0];if(!this.ispt_||l){if(A.push(r),!this.iscircle_&&!this.ispt_&&this.get("stretch")&&this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on([(f[e][0]+f[e+1][0])/2,(f[e][1]+f[e+1][1])/2]),handle:"scale",constraint:e%2?"h":"v",option:e}),A.push(r);if(this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on(f[e]),handle:"scale",option:e}),A.push(r);this.get("translate")&&!this.get("translateFeature")&&(r=new X({geometry:new on([(f[0][0]+f[2][0])/2,(f[0][1]+f[2][1])/2]),handle:"translate"}),A.push(r))}!this.iscircle_&&this.get("rotate")&&(r=new X({geometry:new on(f[3]),handle:"rotate"}),A.push(r)),this.overlayLayer_.getSource().addFeatures(A)}}},eut.prototype.select=function(t,e){if(!t)return this.selection_.clear(),void this.drawSketch_();if(t.getGeometry&&t.getGeometry()){if(e)this.selection_.push(t);else{var r=this.selection_.getArray().indexOf(t);this.selection_.removeAt(r)}this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:t,features:this.selection_})}},eut.prototype.setSelection=function(t){this.selection_.clear(),t.forEach(function(t){this.selection_.push(t)}.bind(this)),this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",features:this.selection_})},eut.prototype.watchFeatures_=function(){this._featureListeners&&this._featureListeners.forEach((function(t){k(t)})),this._featureListeners=[],this.selection_.forEach(function(t){this._featureListeners.push(t.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))},eut.prototype.handleDownEvent_=function(t){if(this._handleEvent(t,this.selection_)){var e=this.getFeatureAtPixel_(t.pixel),r=e.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(r)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(e.handle="translate"),e.handle){this.mode_=e.handle,this.opt_=e.option,this.constraint_=e.constraint;var n=this.getMap().getView().getRotation();this.coordinate_=t.coordinate,this.pixel_=t.pixel,this.geoms_=[],this.rotatedGeoms_=[];for(var i,o=[1/0,1/0,-1/0,-1/0],s=[1/0,1/0,-1/0,-1/0],a=0;i=this.selection_.item(a);a++)if(this.geoms_.push(i.getGeometry().clone()),o=Rt(o,i.getGeometry().getExtent()),this.get("enableRotatedTransform")&&0!==n){var l=this.getGeometryRotateToZero_(i,!0);this.rotatedGeoms_.push(l),s=Rt(s,l.getExtent())}if(this.extent_=En(o).getCoordinates()[0],this.get("enableRotatedTransform")&&0!==n&&(this.rotatedExtent_=En(s).getCoordinates()[0]),"rotate"===this.mode_){this.center_=this.getCenter()||Vt(o);var u=t.map.getTargetElement();u.style.cursor=this.Cursors.rotate0,this.previousCursor_=u.style.cursor}else this.center_=Vt(o);return this.angle_=Math.atan2(this.center_[1]-t.coordinate[1],this.center_[0]-t.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!0}if(this.get("selection")){if(r){this.addFn_(t)||this.selection_.clear();var h=this.selection_.getArray().indexOf(r);h<0?this.selection_.push(r):this.selection_.removeAt(h)}else this.selection_.clear();return this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:r,features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!1}}},eut.prototype.getFeatures=function(){return this.selection_},eut.prototype.getCenter=function(){return this.get("center")},eut.prototype.setCenter=function(t){return this.set("center",t)},eut.prototype.handleDragEvent_=function(t){if(this._handleEvent(t,this.features_)){var e,r,n,i,o=this.getMap().getView().getRotation(),s=[this.coordinate_[0],this.coordinate_[1]],a=[t.coordinate[0],t.coordinate[1]];switch(this.isUpdating_=!0,this.mode_){case"rotate":var l=Math.atan2(this.center_[1]-a[1],this.center_[0]-a[0]);if(!this.ispt)for(e=0;n=this.selection_.item(e);e++)(i=this.geoms_[e].clone()).rotate(l-this.angle_,this.center_),"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),n.setGeometry(i);this.drawSketch_(!0),this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:l-this.angle_,pixel:t.pixel,coordinate:t.coordinate});break;case"translate":var u=a[0]-s[0],h=a[1]-s[1];for(e=0;n=this.selection_.item(e);e++)n.getGeometry().translate(u,h);this.handles_.forEach((function(t){t.getGeometry().translate(u,h)})),this.coordinate_=t.coordinate,this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[u,h],pixel:t.pixel,coordinate:t.coordinate});break;case"scale":var c=this.center_;if(this.get("modifyCenter")(t)){var A=this.extent_;this.get("enableRotatedTransform")&&0!==o&&(A=this.rotatedExtent_),c=A[(Number(this.opt_)+2)%4]}var f=1==this.geoms_.length&&this._isRectangle(this.geoms_[0]),p=this.constraint_,d=this.opt_,g=this.coordinate_,y=t.coordinate;if(this.get("enableRotatedTransform")&&0!==o){var m=new on(this.coordinate_);m.rotate(-1*o,c),g=m.getCoordinates();var v=new on(t.coordinate);v.rotate(-1*o,c),y=v.getCoordinates()}var _=(y[0]-c[0])/(g[0]-c[0]),w=(y[1]-c[1])/(g[1]-c[1]),b=[y[0]-g[0],y[1]-g[1]];if(this.get("enableRotatedTransform")&&0!==o){var x=new on(c);x.rotate(-1*o,this.getMap().getView().getCenter()),c=x.getCoordinates()}for(this.get("noFlip")&&(_<0&&(_=-_),w<0&&(w=-w)),this.constraint_?"h"==this.constraint_?_=1:w=1:this.get("keepAspectRatio")(t)&&(_=w=Math.min(_,w)),e=0;n=this.selection_.item(e);e++)(i=0!==o&&this.get("enableRotatedTransform")?this.rotatedGeoms_[e].clone():this.geoms_[e].clone()).applyTransform((function(t,e,n){if(n<2)return e;if(f){var o=[[6],[0,8],[2],[4]],s=[t[0],t[1]],a=[t[2],t[3]],l=[t[4],t[5]],u=[t[6],t[7]],h=[t[8],t[9]];if(p){var A=d%2==0?nut(s,a):nut(u,s),g=rut(b,A),m=[...o[d],...o[d+1<o.length?d+1:0]];for(r=0;r<t.length;r+=n)e[r]=m.includes(r)?t[r]+g[0]:t[r],e[r+1]=m.includes(r)?t[r+1]+g[1]:t[r+1]}else{var v,x;switch(d){case 0:v=rut(b=nut(u,y),nut(l,u)),x=rut(b,nut(s,u)),[e[0],e[1]]=iut(s,v),[e[4],e[5]]=iut(l,x),[e[6],e[7]]=iut(u,b),[e[8],e[9]]=iut(h,v);break;case 1:v=rut(b=nut(s,y),nut(u,s)),x=rut(b,nut(a,s)),[e[0],e[1]]=iut(s,b),[e[2],e[3]]=iut(a,v),[e[6],e[7]]=iut(u,x),[e[8],e[9]]=iut(h,b);break;case 2:v=rut(b=nut(a,y),nut(s,a)),x=rut(b,nut(l,a)),[e[0],e[1]]=iut(s,x),[e[2],e[3]]=iut(a,b),[e[4],e[5]]=iut(l,v),[e[8],e[9]]=iut(h,x);break;case 3:v=rut(b=nut(l,y),nut(a,l)),x=rut(b,nut(u,l)),[e[2],e[3]]=iut(a,x),[e[4],e[5]]=iut(l,b),[e[6],e[7]]=iut(u,v)}}}else for(r=0;r<t.length;r+=n)1!=_&&(e[r]=c[0]+(t[r]-c[0])*_),1!=w&&(e[r+1]=c[1]+(t[r+1]-c[1])*w);return"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),e})),this.get("enableRotatedTransform")&&0!==o&&i.rotate(o,this.getMap().getView().getCenter()),n.setGeometry(i);this.drawSketch_(),this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[_,w],pixel:t.pixel,coordinate:t.coordinate})}this.isUpdating_=!1}},eut.prototype.handleMoveEvent_=function(t){if(this._handleEvent(t,this.features_)&&!this.mode_){var e=this.getFeatureAtPixel_(t.pixel),r=t.map.getTargetElement();if(e.feature){var n=e.handle?this.Cursors[(e.handle||"default")+(e.constraint||"")+(e.option||"")]:this.Cursors.select;void 0===this.previousCursor_&&(this.previousCursor_=r.style.cursor),r.style.cursor=n}else void 0!==this.previousCursor_&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}},eut.prototype.handleUpEvent_=function(t){return"rotate"===this.mode_&&(t.map.getTargetElement().style.cursor=this.Cursors.default,this.previousCursor_=void 0),this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_}),this.drawSketch_(),this.mode_=null,!1},eut.prototype.getFeatures=function(){return this.selection_},eut.prototype.setPointRadius=function(t){this._pointRadius="function"==typeof t?t:function(){return t}};class out{constructor(t){e(this,"transformInteraction"),this.transformInteraction=new eut({enableRotatedTransform:!1,hitTolerance:2,translateFeature:!0,scale:!0,rotate:!0,keepAspectRatio:!1,keepRectangle:!1,translate:!0,stretch:!0,pointRadius:function(t){let e=t.get("radius")||10;return[e,e]}}),this.transformInteraction.setActive(!1),this.transformInteraction.on(["select"],(t=>{s&&t.features&&t.features.getLength()&&this.transformInteraction.setCenter(t.features.getArray()[0].getGeometry().getFirstCoordinate())}));let r=0,n=10,i=[1,1],o=[0,0],s=!1;this.transformInteraction.on(["rotatestart","translatestart","scalestart"],(function(t){r=t.feature.get("angle")||0,n=t.feature.get("radius")||10,i=t.feature.get("Scale")||[1,1],o=[0,0]})),this.transformInteraction.on("rotating",(t=>{t.feature.set("angle",r-t.angle),t.feature.dispatchEvent({type:"onRotating",data:r-t.angle})})),this.transformInteraction.on("translating",(t=>{o[0]+=t.delta[0],o[1]+=t.delta[1],t.feature.dispatchEvent({type:"onMoveing",data:Vt(t.features.getArray()[0].getGeometry().getExtent())})})),this.transformInteraction.on("scaling",(t=>{if(1===t.features.getLength()){let e=t.features.item(0);e.set("radius",n*Math.abs(t.scale[0])),e.set("Scale",[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]),t.feature.dispatchEvent({type:"onScaling",data:[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]})}})),this.transformInteraction.on(["rotateend","translateend","scaleend"],(t=>{}))}setHandleStyle(t=!0){if(t){let t=new Ri({fill:new Fn({color:[255,255,255,.01]}),stroke:new Rn({width:1,color:[0,0,0,.01]}),radius:8,points:10});this.transformInteraction.setStyle("rotate",new Vi({text:new Wi({text:"",font:"16px Fontawesome",textAlign:"left",fill:new Fn({color:"red"})}),image:t})),this.transformInteraction.setStyle("rotate0",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})})),this.transformInteraction.setStyle("translate",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})}))}else this.transformInteraction.setDefaultStyle();this.transformInteraction.set("translate",this.transformInteraction.get("translate"))}appendTo(t){t.addInteraction(this.transformInteraction)}setActive(t){this.transformInteraction.setActive(t)}}var sut,aut=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},lut=function(t,e){return t[0]==e[0]&&t[1]==e[1]};!function(){function t(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][0]>e&&t[n-1][0]<e||t[n][0]<e&&t[n-1][0]>e)&&(r=[e,(e-t[n][0])/(t[n-1][0]-t[n][0])*(t[n-1][1]-t[n][1])+t[n][1]],t.splice(n,0,r))}function e(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][1]>e&&t[n-1][1]<e||t[n][1]<e&&t[n-1][1]>e)&&(r=[(e-t[n][1])/(t[n-1][1]-t[n][1])*(t[n-1][0]-t[n][0])+t[n][0],e],t.splice(n,0,r))}sut=function(r,n){var i="Polygon"===n.getType();if(!i&&"MultiPolygon"!==n.getType())return null;var o=n.getCoordinates();return i&&(o=[o]),o.forEach((function(n){n.forEach((function(n){t(n,r[0]),t(n,r[2]),e(n,r[1]),e(n,r[3])}))})),o.forEach((function(t){t.forEach((function(t){t.forEach((function(t){t[0]<r[0]?t[0]=r[0]:t[0]>r[2]&&(t[0]=r[2]),t[1]<r[1]?t[1]=r[1]:t[1]>r[3]&&(t[1]=r[3])}))}))})),i?new xn(o[0]):new ah(o)}}();var uut=function(t,e,r,n){var i=[];!1!==n&&i.push(t);var o=aut(t,e);if(o){var s=Math.round(o/r);if(s>1)for(var a=(e[0]-t[0])/s,l=(e[1]-t[1])/s,u=1;u<s;u++)i.push([t[0]+a*u,t[1]+l*u])}return i.push(e),i};Nn.prototype.sampleAt=function(t){for(var e=this.getCoordinates(),r=[],n=1;n<e.length;n++)r=r.concat(uut(e[n-1],e[n],t,1===n));return new Nn(r)},th.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(uut(e[i-1],e[i],t,1===i));r.push(n)})),new th(r)},xn.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(uut(e[i-1],e[i],t,1===i));r.push(n)})),new xn(r)},ah.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){var n=[];r.push(n),e.forEach((function(e){for(var r=[],i=1;i<e.length;i++)r=r.concat(uut(e[i-1],e[i],t,1===i));n.push(r)}))})),new ah(r)},Zu.prototype.intersection=function(t,e){if(t.sampleAt){var r=Ct(this.getCenter().concat(this.getCenter()),this.getRadius());t=(t=sut(r,t)).simplify(e);var n=this.getCenter(),i=this.getRadius(),o=t.sampleAt(e).getCoordinates();switch(t.getType()){case"Polygon":o=[o];case"MultiPolygon":var s=!1,a=[];return o.forEach((function(t){var e=[];a.push(e),t.forEach((function(t){var r=[];e.push(r),t.forEach((function(t){var e=aut(n,t);e>i?(s=!0,r.push([n[0]+i/e*(t[0]-n[0]),n[1]+i/e*(t[1]-n[1])])):r.push(t)}))}))})),s?"Polygon"===t.getType()?new xn(a[0]):new ah(a):t}}return t},Nn.prototype.splitAt=function(t,e){var r;if(!t)return[this];if(e||(e=1e-10),t.length&&t[0].length){var n=[this];for(r=0;r<t.length;r++){for(var i=[],o=0;o<n.length;o++){var s=n[o].splitAt(t[r],e);i=i.concat(s)}n=i}return n}if(lut(t,this.getFirstCoordinate())||lut(t,this.getLastCoordinate()))return[this];var a=this.getCoordinates(),l=[a[0]],u=[];for(r=0;r<a.length-1;r++)if(!lut(a[r],a[r+1])){if(lut(t,a[r+1]))l.push(a[r+1]),u.push(new Nn(l)),l=[];else if(!lut(t,a[r])){var h,c,A=!1;a[r][0]==a[r+1][0]?(h=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=a[r][0]==t[0]&&0<h&&h<=1):a[r][1]==a[r+1][1]?(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),A=a[r][1]==t[1]&&0<h&&h<=1):(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),c=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=Math.abs(h-c)<=e&&0<h&&h<=1),A&&(l.push(t),u.push(new Nn(l)),l=[t])}l.push(a[r+1])}return l.length>1&&u.push(new Nn(l)),u.length?u:[this]};var hut=function(t){t||(t={}),tu.call(this,{handleEvent:function(t){switch(t.type){case"singleclick":return this.handleDownEvent(t);case"pointermove":return this.handleMoveEvent(t);default:return!0}}}),this.snapDistance_=t.snapDistance||25,this.tolerance_=t.tolerance||1e-10,this.cursor_=t.cursor,this.setSources(t.sources),t.features&&this.sources_.push(new pa({features:t.features})),this.filterSplit_=t.filter||function(){return!0};var e=[255,255,255,1],r=[0,153,255,1],n=new Fn({color:"rgba(255,255,255,0.4)"}),i=new Rn({color:"#3399CC",width:1.25}),o=[new Vi({image:new Di({fill:n,stroke:i,radius:5}),fill:n,stroke:i})],s=[new Vi({stroke:new Rn({color:e,width:5})}),new Vi({image:new Di({radius:6,fill:new Fn({color:r}),stroke:new Rn({color:e,width:1.5})}),stroke:new Rn({color:r,width:3})})];t.sketchStyle&&(o=t.sketchStyle instanceof Array?t.sketchStyle:[t.sketchStyle]),t.featureStyle&&(s=t.featureStyle instanceof Array?t.featureStyle:[t.featureStyle]),this.overlayLayer_=new ta({source:new pa({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(t){return t._sketch_?o:s}})};qm(hut,tu),hut.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),tu.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t)},hut.prototype.getSources=function(){if(!this.sources_&&this.getMap()){var t=[],e=function(r){r.forEach((function(r){r.getVisible()&&(r.getSource&&r.getSource()instanceof pa?t.unshift(r.getSource()):r.getLayers&&e(r.getLayers()))}))};return e(this.getMap().getLayers()),t}return this.sources_||[]},hut.prototype.setSources=function(t){this.sources_=!!t&&(t instanceof Array?t||!1:[t])},hut.prototype.getClosestFeature=function(t){var e,r,n,i,o=this.snapDistance_+1;if(this.getSources().forEach((function(s){var a=s.getClosestFeatureToCoordinate(t.coordinate);if(a&&a.getGeometry().splitAt){var l=a.getGeometry().getClosestPoint(t.coordinate),u=new Nn([t.coordinate,l]),h=u.getLength()/t.frameState.viewState.resolution;h<o&&(e=s,o=h,r=a,i=u,n=l)}})),o>this.snapDistance_)return!1;var s=this.getNearestCoord(n,r.getGeometry().getCoordinates()),a=this.getMap().getPixelFromCoordinate(s);return aut(t.pixel,a)<this.snapDistance_&&(n=s),{source:e,feature:r,coord:n,link:i}},hut.prototype.getNearestCoord=function(t,e){for(var r,n,i=Number.MAX_VALUE,o=0;o<e.length;o++)(r=aut(t,e[o]))<i&&(i=r,n=e[o]);return n},hut.prototype.handleDownEvent=function(t){var e=this.getClosestFeature(t);if(e){var r=this;r.overlayLayer_.getSource().clear();var n,i=e.feature.getGeometry().splitAt(e.coord,this.tolerance_);if(i.length>1){var o=[];for(n=0;n<i.length;n++){var s=e.feature.clone();s.setGeometry(i[n]),o.push(s)}for(r.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.removeFeature(e.feature),n=0;n<o.length;n++)e.source.addFeature(o[n]);r.dispatchEvent({type:"aftersplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"aftersplit",original:e.feature,features:o})}}return!1},hut.prototype.handleMoveEvent=function(t){var e=t.map;this.overlayLayer_.getSource().clear();var r,n,i=this.getClosestFeature(t);i&&this.filterSplit_(i.feature)?(this.overlayLayer_.getSource().addFeature(i.feature),(r=new X(new on(i.coord)))._sketch_=!0,this.overlayLayer_.getSource().addFeature(r),(n=new X(i.link))._sketch_=!0,this.overlayLayer_.getSource().addFeature(n),this.dispatchEvent({type:"pointermove",coordinate:t.coordinate,frameState:t.frameState,originalEvent:t.originalEvent,map:t.map,pixel:t.pixel,feature:i.feature,linkGeometry:i.link})):this.dispatchEvent(t);var o=e.getTargetElement();this.cursor_&&(i?o.style.cursor!=this.cursor_&&(this.previousCursor_=o.style.cursor,o.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(o.style.cursor=this.previousCursor_,this.previousCursor_=void 0))};class cut extends wU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.layerSource=new iU(e),this.layer=new Zc({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}class Aut extends Bl{constructor(t){const e=t||{},r=new Image;r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAUCAYAAADFlsDIAAAEsElEQVRYhe1XTWhjVRT+7lgmpSlIGN25kNSVP3WRLkQE0UlbXMgQnERwGFBHU6j4t0qNohGcTuJGWqQ6KeKAdhbNhOB0oZg6MChDF30gFZxVA65kKhhsFHRQr5z6nXLz+vJeZtBdDjySd95555z7ne+cex8GMpD/RYw4bYwXVwBcAfAjgIuZrfk/B3AflEPUfAfgfQB1AJ83xouH/wvn1trUTbyTjLgSNxPTWpsVv37bIHvGz/r1yqxhABsA7qf+3K8jh587uVH660YX6wRMA1gFMGaMaVtr8wCCFlI1xnh8R2zKANphvo0xY06cAoCkcwmYOT5OGmOqtNsGUNF76s7S34wvd8mj4MaBMiuzNf87gJcd/dMAmktHy3dGgfLSSmno7cbs8wGPJGBNgAp5PRsAoABX6XHVQnwl+K4UZ53glQlmpJBleQK1x0C9pw5D6iSzNX+5MV78BsBDVD0C4Grl2Hsf7cZj5zrxmLe4fMqq/fRC/Z4jIzvHgGtSlS8ALOsz0j2tFZbWcSvq2KV7LLpX+yb9CmNMBd0safO3aq0V0JrW2q532GJlxtI8qo7/pD8PWcMQuuVFAJsAbqFW2vMFXr8988rKD53RmN2Nx+4Art9Km+sA3vX5KZBV65wx29baHCseJZpopNB3mXYpBzRZeIqATRpjWsoOirJX51LN1555tnBXe3aBldma/7YxXnwTwOmAROMA7g7Ql97KLG07gVJMYoKLkcBeFFDOYiqOOk3wqgG26wTBozpLEPQ+TwZ1LRj/sq4lPnW4O3NNmZXw3beFsX5mgZV6GMBU2OIoHzqVVTnL3yaDyjUZ5oSghs2WfIBO2q1F9qQZJ8nCeCzWKtswLH6CbPQCNhddg8zKmQNgZbbm/26MF2XWfA3gvh4BOgBel+PG4omS9T2rOMN2D4AoVnHOjLHSQcC40tI55UjZYVRTW94Yk5MBTwbuW7M4abZuUtuQemnfnGO7qb5Nr4w+eaB0eyc+fKkzGrt3Nx5DJx5rd+LD33dGYxdl4H/52uM7YSsihTe1rQIWeGA71y3b14quiM+s7+hQ5qJbVNVoM8McFJACWaMtnee9p7PJyVnmnMedVHxNwD+zXDm5Ufpp6WhZ2nENwIMALgF48sI7x/s9e+mg1R2pxlkRJX3vhmw/WfSEy2JhCAuRJIjaWjXOur0BrzuoChkohVrlb8E5s+2f4ANl9qu5nwE8CuBjAE8AOH/8jQuRp3tWRI4Lc1S1nZ0nTATYOa04f9POf4/PVeQ+F1AEj4NdzlxjZIbOOC8sAXbAuhbbHSGhYIkUPnv1j9PnZ58VsgF4TBxNnVnrubWz2gJWi9VtMtG8z07bw51nypQUW7MFZ7fis/1Dosy6oHko4HFm9cNkN6ck2ZZlV0isgn5iRYKlsrh86lMeHWThV6YX6nf1ME2R7vvV1d2Q7bHqgFgj9bVtCnw35yStAMzR1/qNnMx7gJJivCyLKvGbnFciE5xjk7TZDvpW7EumzqxNTy/ULz+1/EE/x4ugRPP+4AEfufqpEfShm+j3o9h53vUh7c8h6EPbZ5vouRtGyfRC/dCRkZ3MbSPXflk8UernZD6QgQzkoAD4BzP8qid//qPeAAAAAElFTkSuQmCC",r.style.float="right",r.style.left=" 0px",r.style.right="0px",r.style.bottom="0px";let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="991",n.style.backgroundColor="rgba(0,0,0,0)",n.style.minHeight="26px",n.style.right="0px",n.style.bottom="0px",n.style.width="75px",n.appendChild(r),super({element:n,target:e.target})}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}class fut extends wU{constructor(t,e){super(t,e),this.layertype="WmsTileLayer",this.layerSource=new aU(e),this.layer=new qf({extent:[-20037725.11268234,-19994619.55417086,20037725.11268234,19994619.55417086],source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}function put(t){const e=t.frameState,r=pt(t.inversePixelTransform.slice(),e.coordinateToPixelTransform);return new bs(t.context,e.pixelRatio,e.extent,r,e.viewState.rotation)}window.ol&&(ol.util?ol.util.VERSION||(ol.util.VERSION=ol.VERSION||"6.1.0"):ol.util={VERSION:ol.VERSION||"5.3.0"});var dut=a.split(".");dut=100*parseInt(dut[0])+parseInt(dut[1]);var gut=function(t,e){var r=t.frameState.pixelRatio;if(dut>605&&1!==r&&e.getImage()instanceof Us){var n=(e=e.clone()).getImage();n.setScale(n.getScale()*r);var i=n.getAnchor();if(n.setDisplacement){var o=n.getDisplacement();o&&(o[0]-=i[0]/r,o[1]+=i[1]/r,n.setAnchor([0,0]))}else i&&(i[0]/=r,i[1]/=r)}return e},yut=function(t){var e=t||{};ta.call(this,e),this.oldcluster=new pa,this.clusters=[],this.animation={start:!1},this.set("animationDuration","number"==typeof e.animationDuration?e.animationDuration:700),this.set("animationMethod",e.animationMethod||va),this.getSource().on("change",this.saveCluster.bind(this)),this.on(["precompose","prerender"],this.animate.bind(this)),this.on(["postcompose","postrender"],this.postanimate.bind(this))};qm(yut,ta),yut.prototype.saveCluster=function(){if(this.oldcluster){if(this.oldcluster.clear(),!this.get("animationDuration"))return;var t=this.getSource().getFeatures();t.length&&t[0].get("features")&&(this.oldcluster.addFeatures(this.clusters),this.clusters=t.slice(0),this.sourceChanged=!0)}},yut.prototype.getClusterForFeature=function(t,e){for(var r,n=0;r=e[n];n++){var i=r.get("features");if(i&&i.length)for(var o,s=0;o=i[s];s++)if(t===o)return r}return!1},yut.prototype.stopAnimation=function(){this.animation.start=!1,this.animation.cA=[],this.animation.cB=[]},yut.prototype.animate=function(t){var e=this.get("animationDuration");if(e){var r,n,i=t.frameState.viewState.resolution,o=this.animation,s=t.frameState.time;if(o.resolution!=i&&this.sourceChanged){var a=t.frameState.extent;for(o.resolution<i?(a=Ct(a,100*i),o.cA=this.oldcluster.getFeaturesInExtent(a),o.cB=this.getSource().getFeaturesInExtent(a),o.revers=!1):(a=Ct(a,100*i),o.cA=this.getSource().getFeaturesInExtent(a),o.cB=this.oldcluster.getFeaturesInExtent(a),o.revers=!0),o.clusters=[],r=0;n=o.cA[r];r++){var l=n.get("features");if(l&&l.length){var u=this.getClusterForFeature(l[0],o.cB);u&&o.clusters.push({f:n,pt:u.getGeometry().getCoordinates()})}}if(o.resolution=i,this.sourceChanged=!1,!o.clusters.length||o.clusters.length>1e3)return void this.stopAnimation();s=o.start=(new Date).getTime()}if(o.start){var h=t.vectorContext||put(t),c=(s-o.start)/e;c>1&&(this.stopAnimation(),c=1),c=this.get("animationMethod")(c);var A=this.getStyle(),f="function"==typeof A?A:A.length?function(){return A}:function(){return[A]};for(t.context.save(),t.context.globalAlpha=this.getOpacity(),r=0;u=o.clusters[r];r++){var p=u.f.getGeometry().getCoordinates(),d=p[0]-u.pt[0],g=p[1]-u.pt[1];o.revers?(p[0]=u.pt[0]+c*d,p[1]=u.pt[1]+c*g):(p[0]=p[0]-c*d,p[1]=p[1]-c*g);var y=f(u.f,i,!0);if(y.length||(y=[y]),1!==u.f.get("features").length||d||g){var m=new on(p);l=new X(m)}else l=u.f.get("features")[0];for(var v,_=0;v=y[_];_++)if(v.getText()&&/\n/.test(v.getText().getText())){var w,b=v.getText().getOffsetX(),x=v.getText().getOffsetY(),E=v.getText().getRotation()||0,C=1.2*Number((v.getText().getFont()||"10px").match(/\d+/)),S=v.getText().getText().split("\n"),B=S.length-1,I=v.clone();S.forEach((function(e,r){switch(1==r&&(I.setImage(),I.setFill(),I.setStroke()),v.getText().getTextBaseline()){case"alphabetic":case"ideographic":case"bottom":w=B;break;case"hanging":case"top":w=0;break;default:w=B/2}I.getText().setOffsetX(b-Math.sin(E)*C*(r-w)),I.getText().setOffsetY(x+Math.cos(E)*C*(r-w)),I.getText().setText(e),h.drawFeature(l,gut(t,I))}))}else h.drawFeature(l,gut(t,v))}t.context.restore(),t.frameState.animate=!0,t.context.save(),t.context.beginPath(),t.context.rect(0,0,0,0),t.context.clip(),this.clip_=!0}}},yut.prototype.postanimate=function(t){this.clip_&&(t.context.restore(),this.clip_=!1)};var mut,vut=function(t){t=t||{},this.pointRadius=t.pointRadius||12,this.circleMaxObjects=t.circleMaxObjects||10,this.maxObjects=t.maxObjects||60,this.spiral=!1!==t.spiral,this.animate=t.animate,this.animationDuration=t.animationDuration||500,this.selectCluster_=!1!==t.selectCluster,this._autoClose=!1!==t.autoClose;var e=this.overlayLayer_=new ta({source:new pa({features:new V,wrapX:t.wrapX,useSpatialIndex:!0}),name:"Cluster overlay",updateWhileAnimating:!0,updateWhileInteracting:!0,displayInLayerSwitcher:!1,style:t.featureStyle});if(t.layers)if("function"==typeof t.layers){var r=t.layers;t.layers=function(t){return t===e||r(t)}}else t.layers.push&&t.layers.push(this.overlayLayer_);if(t.filter){var n=t.filter;t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))&&n(t,e)}}else t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))};this.filter_=t.filter,this._autoClose||t.toggleCondition||(t.toggleCondition=pu),Th.call(this,t),this.on("select",this.selectCluster.bind(this))};qm(vut,Th),vut.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),this._listener&&k(this._listener),this._listener=null,Th.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),t&&t.getView()&&(this._listener=t.getView().on("change:resolution",this.clear.bind(this)))},vut.prototype.clear=function(){this.getFeatures().clear(),this.overlayLayer_.getSource().clear()},vut.prototype.getLayer=function(){return this.overlayLayer_},vut.prototype.selectCluster=function(t){if(t instanceof X&&(t={selected:[t]}),t.selected.length){var e=t.selected[0];if(!e.get("selectclusterfeature")){var r=this.overlayLayer_.getSource();this._autoClose&&r.clear();var n=e.get("features");if(n&&1!=n.length){this.selectCluster_||this.getFeatures().clear();var i,o,s,a,l,u,h,c=e.getGeometry().getCoordinates(),A=this.getMap().getView().getResolution(),f=[];if(!this.spiral||n.length<=this.circleMaxObjects)for(a=Math.min(n.length,this.circleMaxObjects),i=A*this.pointRadius*(.5+a/4),s=0;s<a;s++)o=2*Math.PI*s/a,2!=a&&4!=a||(o+=Math.PI/4),l=[c[0]+i*Math.sin(o),c[1]+i*Math.cos(o)],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h);else{o=0;var p=2*this.pointRadius;for(a=Math.min(this.maxObjects,n.length),s=0;s<a;s++){o+=(p+.1)/(i=p/2+p*o/(2*Math.PI));var d=A*i*Math.sin(o),g=A*i*Math.cos(o);l=[c[0]+d,c[1]+g],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h)}}e.set("selectcluserfeatures",f),this.animate?this.animateCluster_(c,f):r.addFeatures(f)}}}else this._autoClose?this.clear():t.deselected.forEach((t=>{var e=t.get("selectcluserfeatures");e&&e.forEach((t=>{this.overlayLayer_.getSource().removeFeature(t)}))}))},vut.prototype.animateCluster_=function(t,e){if(this.listenerKey_&&k(this.listenerKey_),e.length){var r=this.overlayLayer_.getStyle(),n="function"==typeof r?r:r.length?function(){return r}:function(){return[r]},i=this.animationDuration||500,o=(new Date).getTime();this.listenerKey_=this.overlayLayer_.on(["postcompose","postrender"],function(r){for(var s,a=r.vectorContext||put(r),l=r.frameState.pixelRatio,u=this.getMap().getView().getResolution(),h=va((r.frameState.time-o)/i),c=0;s=e[c];c++)if(s.get("features")){var A=s.getGeometry().getCoordinates();A[0]=t[0]+h*(A[0]-t[0]),A[1]=t[1]+h*(A[1]-t[1]);for(var f=new on(A),p=n(s,u),d=0;d<p.length;d++){var g,y=!Qh.prototype.getFeaturesAtPixel&&p[d].getImage();y&&(g=y.getScale(),y.setScale(l)),a.setStyle?(a.setStyle(p[d]),a.drawGeometry(f)):(a.setImageStyle(y),a.drawPointGeometry(f)),y&&y.setScale(g)}}if(h>1)return k(this.listenerKey_),this.overlayLayer_.getSource().addFeatures(e),void this.overlayLayer_.changed();r.frameState.animate=!0}.bind(this));var s=new X(new on(this.getMap().getView().getCenter()));s.setStyle(new Vi({image:new Di({})})),this.overlayLayer_.getSource().addFeature(s)}},vut.prototype.getClusterExtent=function(t){if(!t.get("features"))return null;var e=[1/0,1/0,-1/0,-1/0];return t.get("features").forEach((function(t){e=Rt(e,t.getGeometry().getExtent())})),e[0]===e[2]&&e[1]===e[3]?null:e},function(){var t=function(t,e,r){return(t[0]-r[0])*(e[1]-r[1])-(t[1]-r[1])*(e[0]-r[0])<=0};mut=function(e){var r;e.sort((function(t,e){return t[0]==e[0]?t[1]-e[1]:t[0]-e[0]}));var n=[];for(r=0;r<e.length;r++){for(;n.length>=2&&t(n[n.length-2],n[n.length-1],e[r]);)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&t(i[i.length-2],i[i.length-1],e[r]);)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)};var e=function(t){var r,n,i=[];switch(t.getType()){case"Point":i.push(t.getCoordinates());break;case"LineString":case"LinearRing":case"MultiPoint":i=t.getCoordinates();break;case"MultiLineString":for(n=t.getLineStrings(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"Polygon":i=e(t.getLinearRing(0));break;case"MultiPolygon":for(n=t.getPolygons(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"GeometryCollection":for(n=t.getGeometries(),r=0;r<n.length;r++)i.concat(e(n[r]))}return i};Mr.prototype.convexHull=function(){return mut(e(this))}}();const _ut=mut;var wut=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),but={Point:function(t){return void 0!==t.m&&void 0!==t.z?new on([t.x,t.y,t.z,t.m],Y.XYZM):void 0!==t.z?new on([t.x,t.y,t.z],Y.XYZ):void 0!==t.m?new on([t.x,t.y,t.m],Y.XYM):new on([t.x,t.y])},LineString:function(t){var e=Sut(t);return new Nn(t.paths[0],e)},Polygon:function(t){var e=Sut(t);return new xn(t.rings,e)},MultiPoint:function(t){var e=Sut(t);return new nh(t.points,e)},MultiLineString:function(t){var e=Sut(t);return new th(t.paths,e)},MultiPolygon:function(t){var e=Sut(t);return new ah(t.rings,e)}},xut={Point:function(t,e){var r,n=t.getCoordinates(),i=t.getLayout();return i===Y.XYZ?r={x:n[0],y:n[1],z:n[2]}:i===Y.XYM?r={x:n[0],y:n[1],m:n[2]}:i===Y.XYZM?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===Y.XY?r={x:n[0],y:n[1]}:K(!1,34),r},LineString:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},MultiLineString:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,e){for(var r=But(t),n=t.getCoordinates(!1),i=[],o=0;o<n.length;o++)for(var s=n[o].length-1;s>=0;s--)i.push(n[o][s]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}}},Eut=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return wut(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var n=t,i=Cut(n.geometry,e),o=new X;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(i),n.attributes){o.setProperties(n.attributes,!0);var s=n.attributes[r];void 0!==s&&o.setId(s)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var n=[],i=t.features,o=0,s=i.length;o<s;++o)n.push(this.readFeatureFromObject(i[o],r,t.objectIdFieldName));return n}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return Cut(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?ir("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return Iut(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={};if(!t.hasProperties())return r.attributes={},r;var n=t.getProperties(),i=t.getGeometry();if(i){r.geometry=Iut(i,e);var o=e&&(e.dataProjection||e.featureProjection);o&&(r.geometry.spatialReference={wkid:Number(ir(o).getCode().split(":").pop())}),delete n[t.getGeometryName()]}return C(n)?r.attributes={}:r.attributes=n,r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{features:r}},e}(Of);function Cut(t,e){var r,n,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i="Point";else if(t.points)i="MultiPoint";else if(t.paths)i=1===t.paths.length?"LineString":"MultiLineString";else if(t.rings){var o=t,s=Sut(o),a=function(t,e){var r,n,i=[],o=[],s=[];for(r=0,n=t.length;r<n;++r)i.length=0,zr(i,0,t[r],e.length),gn(i,0,i.length,e.length)?o.push([t[r]]):s.push(t[r]);for(;s.length;){var a=s.shift(),l=!1;for(r=o.length-1;r>=0;r--){var u=o[r][0];if(Tt(new rn(u).getExtent(),new rn(a).getExtent())){o[r].push(a),l=!0;break}}l||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(i="Polygon",t=b({},t,((r={}).rings=a[0],r))):(i="MultiPolygon",t=b({},t,((n={}).rings=a,n)))}return $c((0,but[i])(t),!1,e)}function Sut(t){var e=Y.XY;return!0===t.hasZ&&!0===t.hasM?e=Y.XYZM:!0===t.hasZ?e=Y.XYZ:!0===t.hasM&&(e=Y.XYM),e}function But(t){var e=t.getLayout();return{hasZ:e===Y.XYZ||e===Y.XYZM,hasM:e===Y.XYM||e===Y.XYZM}}function Iut(t,e){return(0,xut[t.getType()])($c(t,!0,e),e)}const Tut=Eut;var Put="http://www.w3.org/2001/XMLSchema-instance";function Fut(t,e){return Yut().createElementNS(t,e)}function Lut(t,e){return Mut(t,e,[]).join("")}function Mut(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)Mut(n,e,r)}return r}function Out(t){return"documentElement"in t}function kut(t){return(new DOMParser).parseFromString(t,"application/xml")}function Nut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&y(n[n.length-1],i)}}function Rut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function Uut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function Dut(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function Qut(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function Gut(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,s=r;return void 0===s&&(s=i),Fut(void 0!==e?e:o.namespaceURI,s)}}var jut=Gut();function Hut(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function zut(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function Vut(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var s=o[i.localName];void 0!==s&&s.call(n,i,r)}}}function Kut(t,e,r,n,i){return n.push(t),Vut(e,r,n,i),n.pop()}function qut(t,e,r,n,i,o,s){return i.push(t),function(t,e,r,n,i,o){for(var s,a,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(s=r[u])&&void 0!==(a=e.call(void 0!==o?o:this,s,n,void 0!==i?i[u]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,n)}(e,r,n,i,o,s),i.pop()}var Wut=void 0,Xut=void 0;function Yut(){return void 0===Xut&&"undefined"!=typeof document&&(Xut=document.implementation.createDocument("","",null)),Xut}var Zut=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Jut=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===Wut&&"undefined"!=typeof XMLSerializer&&(Wut=new XMLSerializer),Wut),e}return Zut(e,t),e.prototype.getType=function(){return"xml"},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=kut(t);return this.readFeatureFromDocument(r,e)}return Out(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=kut(t);return this.readFeaturesFromDocument(r,e)}return Out(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&y(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return n()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=kut(t);return this.readGeometryFromDocument(r,e)}return Out(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=kut(t);return this.readProjectionFromDocument(e)}return Out(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Jc);function $ut(t){var e,r=Lut(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function tht(t){var e,r=Lut(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function eht(t){return Lut(t,!1).trim()}function rht(t,e){iht(t,e?"1":"0")}function nht(t,e){var r=e.toPrecision();t.appendChild(Yut().createTextNode(r))}function iht(t,e){t.appendChild(Yut().createTextNode(e))}var oht,sht,aht,lht,uht,hht,cht,Aht,fht,pht=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dht=["http://www.google.com/kml/ext/2.2"],ght=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],yht={fraction:xs.FRACTION,pixels:xs.PIXELS,insetPixels:xs.PIXELS},mht=zut(ght,{ExtendedData:Act,Region:fct,MultiGeometry:Dut(nct,"geometry"),LineString:Dut(tct,"geometry"),LinearRing:Dut(ect,"geometry"),Point:Dut(ict,"geometry"),Polygon:Dut(sct,"geometry"),Style:Dut(lct),StyleMap:function(t,e){var r=Qht.call(this,t,e);if(r){var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:K(!1,38)}},address:Dut(eht),description:Dut(eht),name:Dut(eht),open:Dut($ut),phoneNumber:Dut(eht),styleUrl:Dut(Rht),visibility:Dut($ut)},zut(dht,{MultiTrack:Dut((function(t,e){var r=Kut([],qht,t,e);if(r)return new th(r)}),"geometry"),Track:Dut(Xht,"geometry")})),vht=zut(ght,{ExtendedData:Act,Region:fct,Link:function(t,e){Vut(_ht,t,e)},address:Dut(eht),description:Dut(eht),name:Dut(eht),open:Dut($ut),phoneNumber:Dut(eht),visibility:Dut($ut)}),_ht=zut(ght,{href:Dut(Nht)}),wht=zut(ght,{LatLonAltBox:function(t,e){var r=Kut({},gct,t,e);if(r){var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)}},Lod:function(t,e){var r=Kut({},yct,t,e);if(r){var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}}),bht=zut(ght,["Document","Placemark"]),xht=zut(ght,{Document:Qut((function(t,e,r){qut({node:t},bct,xct,e,r,void 0,this)})),Placemark:Qut(qct)}),Eht=null,Cht=null,Sht=null,Bht=null,Iht=null,Tht=null;function Pht(t){return 32/Math.min(t[0],t[1])}function Fht(t){return t}var Lht=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Tht||(Eht=new Fn({color:oht=[255,255,255,1]}),sht=[20,2],aht=xs.PIXELS,lht=xs.PIXELS,uht=[64,64],hht="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Cht=new Us({anchor:sht,anchorOrigin:Es.BOTTOM_LEFT,anchorXUnits:aht,anchorYUnits:lht,crossOrigin:"anonymous",rotation:0,scale:Pht(uht),size:uht,src:hht}),cht="NO_IMAGE",Sht=new Rn({color:oht,width:1}),Aht=new Rn({color:[51,51,51,1],width:2}),Bht=new Wi({font:"bold 16px Helvetica",fill:Eht,stroke:Aht,scale:.8}),Iht=new Vi({fill:Eht,image:Cht,text:Bht,stroke:Sht,zIndex:0}),Tht=[Iht]),r.dataProjection=ir("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Tht,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:Fht,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return pht(e,t),e.prototype.readDocumentOrFolder_=function(t,e){return Kut([],zut(ght,{Document:Nut(this.readDocumentOrFolder_,this),Folder:Nut(this.readDocumentOrFolder_,this),Placemark:Rut(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this)||void 0},e.prototype.readPlacemark_=function(t,e){var r,n,i,o,s,a=Kut({geometry:null},mht,t,e,this);if(a){var l=new X,u=t.getAttribute("id");null!==u&&l.setId(u);var h=e[0],c=a.geometry;if(c&&$c(c,!1,h),l.setGeometry(c),delete a.geometry,this.extractStyles_){var A=(r=a.Style,n=a.styleUrl,i=this.defaultStyle_,o=this.sharedStyles_,s=this.showPointNames_,function(t,e){var a=s,l="",u=[];if(a){var h=t.getGeometry();if(h)if(h instanceof SA)a=(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e}))).length>0;else{var c=h.getType();a="Point"===c||"MultiPoint"===c}}a&&(l=t.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(fht||(fht=document.createElement("textarea")),fht.innerHTML=l,l=fht.value));var A=i;if(r?A=r:n&&(A=Mht(n,i,o)),a){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var s=i.getScaleArray(),a=i.getAnchor();r[0]=s[0]*(o[0]-a[0]),r[1]=s[1]*(o[1]/2-a[1]),n="left"}}var l=t.getText();return l?((l=l.clone()).setFont(l.getFont()||Bht.getFont()),l.setScale(l.getScale()||Bht.getScale()),l.setFill(l.getFill()||Bht.getFill()),l.setStroke(l.getStroke()||Aht)):l=Bht.clone(),l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new Vi({image:i,text:l})}(A[0],l);return u.length>0?(f.setGeometry(new SA(u)),[f,new Vi({geometry:A[0].getGeometry(),image:null,fill:A[0].getFill(),stroke:A[0].getStroke(),text:null})].concat(A.slice(1))):f}return A});l.setStyle(A)}return delete a.Style,l.setProperties(a,!0),l}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=lct.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Qht.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){return p(ght,t.namespaceURI)&&this.readPlacemark_(t,[this.getReadOptions(t,e)])||null},e.prototype.readFeaturesFromNode=function(t,e){if(!p(ght,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&y(r,s)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=kut(t);return this.readNameFromDocument(e)}return Out(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(p(ght,e.namespaceURI)&&"name"==e.localName)return eht(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(p(ght,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=kut(t);y(e,this.readNetworkLinksFromDocument(r))}else Out(t)?y(e,this.readNetworkLinksFromDocument(t)):y(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(ght,r.namespaceURI)&&"NetworkLink"==r.localName){var n=Kut({},vht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(ght,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=kut(t);y(e,this.readRegionFromDocument(r))}else Out(t)?y(e,this.readRegionFromDocument(t)):y(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(ght,r.namespaceURI)&&"Region"==r.localName){var n=Kut({},wht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(ght,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Fut(ght[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",dht[0]),r.setAttributeNS(n,"xmlns:xsi",Put),r.setAttributeNS(Put,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=bht[r.namespaceURI],a=Hut(o,s);return qut(i,xht,jut,a,[e],s,this),r},e}(Jut);function Mht(t,e,r){return Array.isArray(t)?t:"string"==typeof t?Mht(r[t],e,r):e}function Oht(t){var e=Lut(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function kht(t){var e=Lut(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=n[3]?parseFloat(n[3]):0;r.push(o,s,a),e=e.substr(n[0].length)}if(""===e)return r}function Nht(t){var e=Lut(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Rht(t){var e=Lut(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Uht(t){return tht(t)}var Dht=zut(ght,{Pair:function(t,e){var r=Kut({},pct,t,e,this);if(r){var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}}});function Qht(t,e){return Kut(void 0,Dht,t,e,this)}var Ght=zut(ght,{Icon:Dut((function(t,e){return Kut({},Yht,t,e)||null})),color:Dut(Oht),heading:Dut(tht),hotSpot:Dut((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Es.BOTTOM_LEFT:Es.TOP_LEFT:"insetPixels"!==n?Es.BOTTOM_RIGHT:Es.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:yht[r],y:parseFloat(t.getAttribute("y")),yunits:yht[n],origin:e}})),scale:Dut(Uht)}),jht=zut(ght,{color:Dut(Oht),scale:Dut(Uht)}),Hht=zut(ght,{color:Dut(Oht),width:Dut(tht)}),zht=zut(ght,{color:Dut(Oht),fill:Dut($ut),outline:Dut($ut)}),Vht=zut(ght,{coordinates:Uut(kht)});function Kht(t,e){return Kut(null,Vht,t,e)}var qht=zut(dht,{Track:Rut(Xht)}),Wht=zut(ght,{when:function(t,e){var r=e[e.length-1].whens,n=Lut(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},zut(dht,{coord:function(t,e){var r=e[e.length-1].coordinates,n=Lut(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);r.push([o,s,a])}else r.push([])}}));function Xht(t,e){var r=Kut({coordinates:[],whens:[]},Wht,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,s=0,a=Math.min(i.length,o.length);s<a;++s)3==i[s].length&&n.push(i[s][0],i[s][1],i[s][2],o[s]);return new Nn(n,Y.XYZM)}}var Yht=zut(ght,{href:Dut(Nht)},zut(dht,{x:Dut(tht),y:Dut(tht),w:Dut(tht),h:Dut(tht)})),Zht=zut(ght,{coordinates:Uut(kht)});function Jht(t,e){return Kut(null,Zht,t,e)}var $ht=zut(ght,{extrude:Dut($ut),tessellate:Dut($ut),altitudeMode:Dut(eht)});function tct(t,e){var r=Kut({},$ht,t,e),n=Jht(t,e);if(n){var i=new Nn(n,Y.XYZ);return i.setProperties(r,!0),i}}function ect(t,e){var r=Kut({},$ht,t,e),n=Jht(t,e);if(n){var i=new xn(n,Y.XYZ,[n.length]);return i.setProperties(r,!0),i}}var rct=zut(ght,{LineString:Rut(tct),LinearRing:Rut(ect),MultiGeometry:Rut(nct),Point:Rut(ict),Polygon:Rut(sct)});function nct(t,e){var r,n=Kut([],rct,t,e);if(!n)return null;if(0===n.length)return new SA(n);for(var i=!0,o=n[0].getType(),s=1,a=n.length;s<a;++s)if(n[s].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if("Point"==o){var h=n[0];for(l=h.getLayout(),u=h.getFlatCoordinates(),s=1,a=n.length;s<a;++s)y(u,n[s].getFlatCoordinates());uct(r=new nh(u,l),n)}else"LineString"==o?uct(r=new th(n),n):"Polygon"==o?uct(r=new ah(n),n):"GeometryCollection"==o?r=new SA(n):K(!1,37)}else r=new SA(n);return r}function ict(t,e){var r=Kut({},$ht,t,e),n=Jht(t,e);if(n){var i=new on(n,Y.XYZ);return i.setProperties(r,!0),i}}var oct=zut(ght,{innerBoundaryIs:function(t,e){var r=Kut([],mct,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=Kut(void 0,vct,t,e);r&&(e[e.length-1][0]=r)}});function sct(t,e){var r=Kut({},$ht,t,e),n=Kut([null],oct,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],s=1,a=n.length;s<a;++s)y(i,n[s]),o.push(i.length);var l=new xn(i,Y.XYZ,o);return l.setProperties(r,!0),l}}var act=zut(ght,{IconStyle:function(t,e){var r=Kut({},Ght,t,e);if(r){var n,i,o,s,a=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=hht);var c,A=Es.BOTTOM_LEFT,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,s=f.yunits,A=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=sht,o=aht,s=lht):/arrow-reverse/.test(n)?(i=[54,42],o=aht,s=lht):/paddle/.test(n)&&(i=[32,1],o=aht,s=lht));var p,d=l.x,g=l.y;void 0!==d&&void 0!==g&&(c=[d,g]);var y,m=l.w,v=l.h;void 0!==m&&void 0!==v&&(p=[m,v]);var _=r.heading;void 0!==_&&(y=Ae(_));var w=r.scale,b=r.color;if(u){n==hht&&(p=uht);var x=new Us({anchor:i,anchorOrigin:A,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Es.BOTTOM_LEFT,rotation:y,scale:w,size:p,src:this.iconUrlFunction_(n),color:b}),E=x.getScaleArray()[0],C=x.getSize();if(null===C){var S=x.getImageState();if(S===Un.IDLE||S===Un.LOADING){var B=function(){var t=x.getImageState();if(t!==Un.IDLE&&t!==Un.LOADING){var e=x.getSize();if(e&&2==e.length){var r=Pht(e);x.setScale(E*r)}x.unlistenImageChange(B)}};x.listenImageChange(B),S===Un.IDLE&&x.load()}}else if(2==C.length){var I=Pht(C);x.setScale(E*I)}a.imageStyle=x}else a.imageStyle=cht}},LabelStyle:function(t,e){var r=Kut({},jht,t,e);if(r){var n=e[e.length-1],i=new Wi({fill:new Fn({color:"color"in r?r.color:oht}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=Kut({},Hht,t,e);if(r){var n=e[e.length-1],i=new Rn({color:"color"in r?r.color:oht,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=Kut({},zht,t,e);if(r){var n=e[e.length-1],i=new Fn({color:"color"in r?r.color:oht});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var s=r.outline;void 0!==s&&(n.outline=s)}}});function lct(t,e){var r=Kut({},act,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Eht,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=cht&&(n=r.imageStyle):n=Cht;var s="textStyle"in r?r.textStyle:Bht,a="strokeStyle"in r?r.strokeStyle:Sht,l=r.outline;return void 0===l||l?[new Vi({fill:i,image:n,stroke:a,text:s,zIndex:void 0})]:[new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e}))):"Polygon"!==r&&"MultiPolygon"!==r?e:void 0},fill:i,image:n,stroke:a,text:s,zIndex:void 0}),new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e}))):"Polygon"===r||"MultiPolygon"===r?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function uct(t,e){var r,n,i,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];s[u]=h.get("extrude"),a[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==s[u],n=n||void 0!==a[u],i=i||l[u]}r&&t.set("extrude",s),n&&t.set("tessellate",a),i&&t.set("altitudeMode",l)}var hct=zut(ght,{displayName:Dut(eht),value:Dut(eht)}),cct=zut(ght,{Data:function(t,e){var r=t.getAttribute("name");Vut(hct,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){Vut(dct,t,e)}});function Act(t,e){Vut(cct,t,e)}function fct(t,e){Vut(wht,t,e)}var pct=zut(ght,{Style:Dut(lct),key:Dut(eht),styleUrl:Dut(Rht)}),dct=zut(ght,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=eht(t);e[e.length-1][r]=n}}}),gct=zut(ght,{altitudeMode:Dut(eht),minAltitude:Dut(tht),maxAltitude:Dut(tht),north:Dut(tht),south:Dut(tht),east:Dut(tht),west:Dut(tht)}),yct=zut(ght,{minLodPixels:Dut(tht),maxLodPixels:Dut(tht),minFadeExtent:Dut(tht),maxFadeExtent:Dut(tht)}),mct=zut(ght,{LinearRing:Rut(Kht)}),vct=zut(ght,{LinearRing:Uut(Kht)});function _ct(t,e){for(var r=Zn(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}iht(t,n.join(""))}var wct=zut(ght,{Data:Qut((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&qut(n,wct,jut,[i.displayName],r,["displayName"]),null!==i&&i.value&&qut(n,wct,jut,[i.value],r,["value"])):qut(n,wct,jut,[i],r,["value"])})),value:Qut((function(t,e){iht(t,e)})),displayName:Qut((function(t,e){!function(t,e){t.appendChild(Yut().createCDATASection(e))}(t,e)}))}),bct=zut(ght,{Placemark:Qut(qct)}),xct=function(t,e,r){return Fut(e[e.length-1].node.namespaceURI,"Placemark")},Ect=Gut("Data"),Cct=zut(ght,["href"],zut(dht,["x","y","w","h"])),Sct=zut(ght,{href:Qut(iht)},zut(dht,{x:Qut(nht),y:Qut(nht),w:Qut(nht),h:Qut(nht)})),Bct=function(t,e,r){return Fut(dht[0],"gx:"+r)},Ict=zut(ght,["scale","heading","Icon","color","hotSpot"]),Tct=zut(ght,{Icon:Qut((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Cct[i.namespaceURI],s=Hut(e,o);qut(n,Sct,jut,s,r,o),s=Hut(e,o=Cct[dht[0]]),qut(n,Sct,Bct,s,r,o)})),color:Qut(_ct),heading:Qut(nht),hotSpot:Qut((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Qut(nAt)}),Pct=zut(ght,["color","scale"]),Fct=zut(ght,{color:Qut(_ct),scale:Qut(nAt)}),Lct=zut(ght,["color","width"]),Mct=zut(ght,{color:Qut(_ct),width:Qut(nht)}),Oct={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},kct=function(t,e,r){if(t)return Fut(e[e.length-1].node.namespaceURI,Oct[t.getType()])},Nct=Gut("Point"),Rct=Gut("LineString"),Uct=Gut("LinearRing"),Dct=Gut("Polygon"),Qct=zut(ght,{LineString:Qut(Yct),Point:Qut(Yct),Polygon:Qut(eAt),GeometryCollection:Qut(Gct)});function Gct(t,e,r){var n,i={node:t},o=e.getType(),s=[];"GeometryCollection"===o?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();"MultiPoint"===e?s=s.concat(t.getPoints()):"MultiLineString"===e?s=s.concat(t.getLineStrings()):"MultiPolygon"===e?s=s.concat(t.getPolygons()):"Point"===e||"LineString"===e||"Polygon"===e?s.push(t):K(!1,39)})),n=kct):"MultiPoint"===o?(s=e.getPoints(),n=Nct):"MultiLineString"===o?(s=e.getLineStrings(),n=Rct):"MultiPolygon"===o?(s=e.getPolygons(),n=Dct):K(!1,39),qut(i,Qct,n,s,r)}var jct=zut(ght,{LinearRing:Qut(Yct)});function Hct(t,e,r){qut({node:t},jct,Uct,[e],r)}var zct=zut(ght,{ExtendedData:Qut((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,s=i.length,a=0;a<s;a++)qut(n,wct,Ect,[{name:i[a],value:o[a]}],r)})),MultiGeometry:Qut(Gct),LineString:Qut(Yct),LinearRing:Qut(Yct),Point:Qut(Yct),Polygon:Qut(eAt),Style:Qut((function(t,e,r){var n,i={node:t},o={};if(e.pointStyles.length){var s=e.pointStyles[0].getText();s&&(o.LabelStyle=s);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(o.IconStyle=a)}e.lineStyles.length&&(n=e.lineStyles[0].getStroke())&&(o.LineStyle=n),e.polyStyles.length&&((n=e.polyStyles[0].getStroke())&&!o.LineStyle&&(o.LineStyle=n),o.PolyStyle=e.polyStyles[0]);var l=r[r.length-1].node,u=iAt[l.namespaceURI],h=Hut(o,u);qut(i,oAt,jut,h,r,u)})),address:Qut(iht),description:Qut(iht),name:Qut(iht),open:Qut(rht),phoneNumber:Qut(iht),styleUrl:Qut(iht),visibility:Qut(rht)}),Vct=zut(ght,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Kct=Gut("ExtendedData");function qct(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),a=e.getStyleFunction();if(a){var l=a(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})).length:"Point"===n||"MultiPoint"===n}}))),this.writeStyles_){var c=u,A=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"LineString"===e||"MultiLineString"===e})).length:"LineString"===n||"MultiLineString"===n}})),A=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e})).length:"Polygon"===n||"MultiPolygon"===n}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:A}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var p=r[r.length-1].node,d=Vct[p.namespaceURI],g=Hut(i,d);if(qut(n,zct,jut,g,r,d),s.length>0){var y=Hut(i,s);qut(n,zct,Kct,[{names:s,values:y}],r)}var m=r[0],v=e.getGeometry();v&&(v=$c(v,!0,m)),qut(n,zct,kct,[v],r)}var Wct=zut(ght,["extrude","tessellate","altitudeMode","coordinates"]),Xct=zut(ght,{extrude:Qut(rht),tessellate:Qut(rht),altitudeMode:Qut(iht),coordinates:Qut((function(t,e,r){var n,i=r[r.length-1],o=i.layout,s=i.stride;o==Y.XY||o==Y.XYM?n=2:o==Y.XYZ||o==Y.XYZM?n=3:K(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=s;h<a;h+=s)for(l+=" "+e[h],u=1;u<n;++u)l+=","+e[h+u]}iht(t,l)}))});function Yct(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var s=r[r.length-1].node,a=Wct[s.namespaceURI],l=Hut(o,a);qut(i,Xct,jut,l,r,a)}var Zct=zut(ght,["color","fill","outline"]),Jct=zut(ght,{outerBoundaryIs:Qut(Hct),innerBoundaryIs:Qut(Hct)}),$ct=Gut("innerBoundaryIs"),tAt=Gut("outerBoundaryIs");function eAt(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};qut(o,Jct,$ct,n,r),qut(o,Jct,tAt,[i],r)}var rAt=zut(ght,{color:Qut(_ct),fill:Qut(rht),outline:Qut(rht)});function nAt(t,e){nht(t,Math.round(1e6*e)/1e6)}var iAt=zut(ght,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),oAt=zut(ght,{IconStyle:Qut((function(t,e,r){var n={node:t},i={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),l={href:o};if(s){l.w=s[0],l.h=s[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(l.x=h[0],l.y=a[1]-(h[1]+s[1])),u&&(u[0]!==s[0]/2||u[1]!==s[1]/2)){var c={x:u[0],xunits:xs.PIXELS,y:s[1]-u[1],yunits:xs.PIXELS};i.hotSpot=c}}i.Icon=l;var A=e.getScaleArray()[0],f=s;null===f&&(f=uht),2==f.length&&(A/=Pht(f)),1!==A&&(i.scale=A);var p=e.getRotation();0!==p&&(i.heading=p);var d=e.getColor();d&&(i.color=d);var g=r[r.length-1].node,y=Ict[g.namespaceURI],m=Hut(i,y);qut(n,Tct,jut,m,r,y)})),LabelStyle:Qut((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var s=e.getScale();s&&1!==s&&(i.scale=s);var a=r[r.length-1].node,l=Pct[a.namespaceURI],u=Hut(i,l);qut(n,Fct,jut,u,r,l)})),LineStyle:Qut((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,s=Lct[o.namespaceURI],a=Hut(i,s);qut(n,Mct,jut,a,r,s)})),PolyStyle:Qut((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),s={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},a=r[r.length-1].node,l=Zct[a.namespaceURI],u=Hut(s,l);qut(n,rAt,jut,u,r,l)}))});const sAt=Lht;var aAt=function(t){t=t||{},this.duration_="number"==typeof t.duration?t.duration>=0?t.duration:0:1e3,this.fade_="function"==typeof t.fade?t.fade:null,this.repeat_=Number(t.repeat);var e="function"==typeof t.easing?t.easing:wa;t.revers?this.easing_=function(t){return 1-e(t)}:this.easing_=e,this.hiddenStyle=t.hiddenStyle,D.call(this)};qm(aAt,D),aAt.hiddenStyle=new Vi({image:new Di({}),stroke:new Rn({color:"transparent"})}),aAt.prototype.drawGeom_=function(t,e,r){this.fade_&&(t.context.globalAlpha=this.fade_(1-t.elapsed));for(var n=t.style,i=0;i<n.length;i++)try{var o=t.vectorContext||put(t),s=gut(t,n[i]);o.setStyle(s),s.getZIndex()<0?o.drawGeometry(r||e):o.drawGeometry(e)}catch(a){}},aAt.prototype.animate=function(){return!1},Qh.prototype.animateFeature=function(t,e){var r=this._featureAnimationLayer;r||(r=this._featureAnimationLayer=new ta({source:new pa})).setMap(this),r.getSource().addFeature(t);var n=e.on("animationend",(function(e){e.feature===t&&(r.getSource().removeFeature(t),k(n))}));r.animateFeature(t,e)},Zi.prototype.animateFeature=function(t,e,r){var n,i=this,o=t.getStyle(),s=o||(this.getStyleFunction?this.getStyleFunction()(t):null);s||(s=[]),s instanceof Array||(s=[s]);var a={vectorContext:null,frameState:null,start:0,time:0,elapsed:0,extent:!1,feature:t,geom:t.getGeometry(),typeGeom:t.getGeometry().getType(),bbox:t.getGeometry().getExtent(),coord:Vt(t.getGeometry().getExtent()),style:s};e instanceof Array||(e=[e]);for(var l=e.length-1;l>=0;l--)0===e[l].duration_&&e.splice(l,1);var u=0,h=0,c=r&&this.getFilters?this.getFilters():[];function A(r){a.type=r.type;try{a.vectorContext=r.vectorContext||put(r)}catch(o){}if(a.frameState=r.frameState,a.inversePixelTransform=r.inversePixelTransform,a.extent||(a.extent=r.frameState.extent,a.start=r.frameState.time,a.context=r.context),a.time=r.frameState.time-a.start,a.elapsed=a.time/e[h].duration_,a.elapsed>1&&(a.elapsed=1),r.context.save(),c.forEach((function(t){t.get("active")&&t.precompose(r)})),this.getOpacity&&(r.context.globalAlpha=this.getOpacity()),e[h].animate(a)){var n={type:"animating",step:h,start:a.start,time:a.time,elapsed:a.elapsed,rotation:a.rotation||0,geom:a.geom,coordinate:a.coord,feature:t};e[h].dispatchEvent(n),i.dispatchEvent(n)}else++u<e[h].repeat_?a.extent=!1:h<e.length-1?(e[h].dispatchEvent({type:"animationend",feature:t}),h++,u=0,a.extent=!1):f();c.forEach((function(t){t.get("active")&&t.postcompose(r)})),r.context.restore(),r.frameState.animate=!0}function f(r){k(n),n=null,t.setStyle(o);var s={type:"animationend",feature:t};if(r)for(var a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);e[h].dispatchEvent(s),i.dispatchEvent(s)}function p(r){if(e.length&&!n){if(n=i.on(["postcompose","postrender"],A.bind(i)),i.renderSync)try{i.renderSync()}catch(TX){}else i.changed();t.setStyle(e[h].hiddenStyle||aAt.hiddenStyle);var o={type:"animationstart",feature:t};if(r)for(var s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);e[h].dispatchEvent(o),i.dispatchEvent(o)}}return p(),{start:p,stop:f,isPlaying:function(){return!!n}}};var lAt=function(t){t=t||{},aAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||3)};qm(lAt,aAt),lAt.prototype.animate=function(t){var e=t.geom.clone(),r=Math.abs(Math.sin(this.bounce_*t.elapsed))*this.amplitude_*(1-this.easing_(t.elapsed))*t.frameState.viewState.resolution;return e.translate(0,r),this.drawGeom_(t,e,t.geom),t.time<=this.duration_};var uAt=function(t){aAt.call(this,t),this.set("nb",t.nb||10)};qm(uAt,aAt),uAt.prototype.animate=function(t){return Math.round(this.easing_(t.elapsed)*this.get("nb"))%2||this.drawGeom_(t,t.geom),t.time<=this.duration_};var hAt=function(t){t=t||{},this.speed_=t.speed||0,aAt.call(this,t),this.side_=t.side||"top"};qm(hAt,aAt),hAt.prototype.animate=function(t){if(!t.time){var e=t.frameState.viewState.rotation,r=t.frameState.size[1]*t.frameState.viewState.resolution;"top"!=this.side_&&(r*=-1),this.dx=-Math.sin(e)*r,this.dy=Math.cos(e)*r,this.speed_&&(this.duration_=r/this.speed_/t.frameState.viewState.resolution)}var n=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*(1-this.easing_(t.elapsed))),this.drawGeom_(t,n,t.geom),t.time<=this.duration_};var cAt=function(t){t=t||{},this.speed_=t.speed||0,aAt.call(this,t)};qm(cAt,aAt),cAt.prototype.animate=function(t){return t.context.globalAlpha=this.easing_(t.elapsed),this.drawGeom_(t,t.geom),t.time<=this.duration_};var AAt=function(t){switch(t=t||{},aAt.call(this,t),this.speed_=t.speed||0,this.path_=t.path,t.rotate){case!0:case 0:this.rotate_=0;break;default:this.rotate_=t.rotate||!1}this.path_&&this.path_.getGeometry&&(this.path_=this.path_.getGeometry()),this.path_&&this.path_.getLineString&&(this.path_=this.path_.getLineString()),this.path_.getLength?(this.dist_=this.path_.getLength(),this.path_&&this.path_.getCoordinates&&(this.path_=this.path_.getCoordinates())):this.dist_=0,this.speed_>0&&(this.duration_=this.dist_/this.speed_)};qm(AAt,aAt),AAt.prototype.animate=function(t){if(!t.time&&!this.dist_)return!1;var e,r,n,i,o,s,a=this.dist_*this.easing_(t.elapsed),l=0;r=this.path_[0];for(var u=1;u<this.path_.length;u++){if(e=r,i=(r=this.path_[u])[0]-e[0],o=r[1]-e[1],(s=Math.sqrt(i*i+o*o))&&l+s>=a){n=(a-l)/s,r=[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n];break}l+=s}var h=t.style;if(t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]),!1!==this.rotate_){var c=[],A=this.rotate_-t.rotation+t.frameState.viewState.rotation;t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]);for(var f=0;n=t.style[f];f++)n.getImage()&&n.getImage().setRotation(A),c.push(n);t.style=c}return t.geom.setCoordinates(r),this.drawGeom_(t,t.geom),t.style=h,t.time<=this.duration_};var fAt=function(t){t=t||{},aAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||6),this.horizontal_=t.horizontal};qm(fAt,aAt),fAt.prototype.animate=function(t){var e=t.geom.clone(),r=t.geom.clone(),n=this.easing_(t.elapsed);return n=Math.sin(this.bounce_*n)*this.amplitude_*(1-n)*t.frameState.viewState.resolution,this.horizontal_?(e.translate(n,0),r.translate(n,0)):e.translate(0,n),this.drawGeom_(t,e,r),t.time<=this.duration_};var pAt=function(t){aAt.call(this,t)};qm(pAt,aAt),pAt.prototype.animate=function(t){return this.drawGeom_(t,t.geom),t.time<=this.duration_};var dAt=function(t){t=t||{},this.speed_=t.speed||0,aAt.call(this,t),this.side_=t.side||"left"};qm(dAt,aAt),dAt.prototype.animate=function(t){t.time||("left"==this.side_?this.dx=t.extent[0]-t.bbox[2]:this.dx=t.extent[2]-t.bbox[0],this.speed_&&(this.duration_=Math.abs(this.dx)/this.speed_/t.frameState.viewState.resolution));var e=t.geom.clone();return e.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,e),t.time<=this.duration_};var gAt=function(t){aAt.call(this,t)};qm(gAt,aAt),gAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){t.context.save();var r=t.frameState.pixelRatio;t.context.globalAlpha=e,t.context.scale(e,1/e);var n=t.frameState.coordinateToPixelTransform,i=(1/e-1)*r*(n[0]*t.coord[0]+n[1]*t.coord[1]+n[4]),o=(e-1)*r*(n[2]*t.coord[0]+n[3]*t.coord[1]+n[5]);t.context.translate(i,o),this.drawGeom_(t,t.geom),t.context.restore()}return t.time<=this.duration_};var yAt=function(t){t=t||{},aAt.call(this,t),this.speed_=t.speed||0,this.side_=t.side||"left"};qm(yAt,aAt),yAt.prototype.animate=function(t){var e,r;!t.time&&this.speed_&&("left"==this.side_?(e=this.dx=t.extent[0]-t.bbox[2],r=this.dy=t.extent[3]-t.bbox[1]):(e=this.dx=t.extent[2]-t.bbox[0],r=this.dy=t.extent[3]-t.bbox[1]),this.duration_=Math.sqrt(e*e+r*r)/this.speed_/t.frameState.viewState.resolution);var n=t.geom.clone(),i=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*Math.cos(Math.PI/2*this.easing_(t.elapsed))),i.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,n,i),t.time<=this.duration_};var mAt=function(t){t=t||{},aAt.call(this,t),this.set("zoomout",t.zoomOut)};qm(mAt,aAt),qm((function(t){(t=t||{}).zoomOut=!0,mAt.call(this,t)}),mAt),mAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){this.get("zoomout")&&(e=1/e);var r,n,i=t.style,o=[];for(r=0;r<i.length;r++)(n=i[r].getImage())&&(o[r]=n.getScale(),"postrender"===t.type?n.setScale(o[r]*e/t.frameState.pixelRatio):n.setScale(o[r]*e));for(this.drawGeom_(t,t.geom),r=0;r<i.length;r++)(n=i[r].getImage())&&n.setScale(o[r])}return t.time<=this.duration_};class vAt extends DO{constructor(t,r){super(t,r),e(this,"animList"),this.animList=[],this.layertype="GraphicLayer",this.layer=new ta({source:this._source,zIndex:this.option.zIndex,declutter:this.option.declutter}),this.layer.set("layerid",t),this.layer.on("sourceready",(t=>{this.trigger(Em.onLoadEnd,t)})),this._source.on("addfeature",(t=>{t.feature.get("loadAnimation")&&setTimeout((()=>{this.animateFeature(t.feature,t.feature.get("loadAnimation"))}),1),t.feature.get("pulseAnimate")&&setTimeout((()=>{this.pulseAnimate(t.feature,t.feature.get("pulseAnimate"))}),1)})),this._source.on("removefeature",(t=>{t.feature.get("pulseAnimate")&&this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&e.anim.stop({user:!0})}))})),this.layer.on(this.EventType.featureType.onFeatureContextmenu,(t=>{this._setFeatureContextmenu(t.data.feature,t.data.contextmenu)})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}pathAnimate(t,e,r){let n={rotate:!0,speed:1,revers:!0,repeat:1/0,easing:wa};r=Object.assign({},n,r);let i=new AAt({path:e,rotate:r.rotate,speed:r.speed,repeat:r.repeat,revers:r.revers});return this.trigger(Em.onPathAnimateStart,{data:t}),i.on("animationend",(t=>{this.trigger(Em.onPathAnimateEnd,{data:t.feature})})),i.on("animating",(t=>{this.trigger(Em.onPathAnimateRunning,{data:t})})),this.layer.animateFeature(t,i)}pulseAnimate(t,e){let r={fade:va,duration:2e3,revers:!1,repeat:1/0,easing:va,radius:30,fillcolor:"rgba(255,0,0,0.2)",strokecolor:"red",strokewidth:1};e=Object.assign({},r,e);let n=new OO({graphicType:"PointGraphic",lnglat:t.getGeometry().getCoordinates(),style:{image:{radius:e.radius,scale:1,fill:{color:e.fillcolor},stroke:{color:e.strokecolor,width:e.strokewidth}},zIndex:990},attribute:{uuid:t.get("uuid")}}),i=new mAt(e);this.animList.push({uuid:t.get("uuid"),anim:this.layer.animateFeature(n,i)}),i.on("animationend",(t=>{this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&this.animList.splice(r,1)}))}))}animateFeatures(t,e){t.forEach(((t,r)=>{this.animateFeature(t,e)}))}animateFeature(t,e){let r,n={duration:3e3,animateType:km.Bounce,repeat:1,speed:.8,revers:!1,zoomOut:!1,side:!1};switch((e=Object.assign({},n,e)).animateType){case km.Blink:r=new uAt(e);break;case km.Drop:r=new hAt(e);break;case km.Fade:r=new cAt(e);break;case km.Path:r=new AAt(e);break;case km.Shake:r=new fAt(e);break;case km.Show:r=new pAt(e);break;case km.Slide:r=new dAt(e);break;case km.Teleport:r=new gAt(e);break;case km.Throw:r=new yAt(e);break;case km.Zoom:r=new mAt(e);break;case km.ZoomOut:e.zoomOut=!0,r=new mAt(e);break;default:r=new lAt(e)}this.layer.animateFeature(t,r)}}var _At=function(t){(t=t||{}).displacement||(t.displacement=[t.offsetX||0,-t.offsetY||0]),this.sanchor_="anchored"===t.kind?8:0,this._shadow=Number(t.shadow)||0,t.stroke||(t.stroke=new Rn({width:0,color:"#000"}));var e=t.stroke.getWidth();if(e<0&&(e=0),"folio"==t.kind&&(e+=6),t.stroke.setWidth(e),Ri.call(this,{radius:t.radius+e+this.sanchor_/2+this._shadow/2,points:0,displacement:[t.displacement[0]||0,(t.displacement[1]||0)+this.sanchor_],fill:Ri.prototype.render?new Fn({color:[0,0,0,0]}):null}),!this.getHitDetectionImage){var r=Ri.prototype.getImage.call(this);if(!this.hitDetectionCanvas_)for(var n in this)if(this[n]&&this[n].getContext&&this[n]!==r){this.hitDetectionCanvas_=this[n];break}this.hitDetectionCanvas_=document.createElement("canvas"),this.hitDetectionCanvas_.width=r.width,this.hitDetectionCanvas_.height=r.height;var i=this.hitDetectionCanvas_;this.getHitDetectionImage=function(){return i}}this._stroke=t.stroke,this._fill=t.fill,this._crop=t.crop,this._crossOrigin=t.crossOrigin,this._kind=t.kind||"default",this._radius=t.radius,this._src=t.src,this._offset=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0],this._onload=t.onload,"number"==typeof t.opacity&&this.setOpacity(t.opacity),"number"==typeof t.rotation&&this.setRotation(t.rotation),this.getImage()};qm(_At,Ri),_At.prototype.setOffset=function(t){this._offset=[t[0]||0,t[1]||0],this.getImage()},_At.prototype.clone=function(){var t=new _At({stroke:this._stroke,fill:this._fill,shadow:this._shadow,crop:this._crop,crossOrigin:this._crossOrigin,kind:this._kind,radius:this._radius,src:this._src,offsetX:this._offset[0],offsetY:this._offset[1],opacity:this.getOpacity(),rotation:this.getRotation()});return t.getImage(),t},CanvasRenderingContext2D.prototype.roundRect=function(t,e,r,n,i){return i?(r<2*i&&(i=r/2),n<2*i&&(i=n/2),this.beginPath(),this.moveTo(t+i,e),this.arcTo(t+r,e,t+r,e+n,i),this.arcTo(t+r,e+n,t,e+n,i),this.arcTo(t,e+n,t,e,i),this.arcTo(t,e,t+r,e,i),this.closePath()):this.rect(t,e,r,n),this},_At.prototype.drawBack_=function(t,e,r,n){var i=this._shadow,o=t.canvas;t.beginPath(),t.fillStyle=e,t.clearRect(0,0,o.width,o.height);var s=o.width/n,a=o.height/n;switch(this._kind){case"square":t.rect(0,0,s-i,a-i);break;case"circle":t.arc(this._radius+r,this._radius+r,this._radius+r,0,2*Math.PI,!1);break;case"folio":r-=6,t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=1;var l=s-i-12,u=Math.atan(6/l);t.save(),t.rotate(-u),t.translate(-6,2),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.save(),t.translate(6,-1),t.rotate(u),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.beginPath(),t.rect(6,6,l,l),t.stroke();break;case"anchored":t.roundRect(this.sanchor_/2,0,s-this.sanchor_-i,a-this.sanchor_-i,r),t.moveTo(s/2-this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2+this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2-i/2,a-i);break;default:t.roundRect(0,0,s-i,a-i,r)}t.closePath()},_At.prototype.getImage=function(t){t=t||1;var e,r=Ri.prototype.getImage.call(this,t);if(this._gethit)return r;var n=0;this._stroke&&(e=Kn(this._stroke.getColor()),n=this._stroke.getWidth()),this._gethit=!0;var i=this.getHitDetectionImage().getContext("2d");i.save(),i.setTransform(1,0,0,1,0,0),this.drawBack_(i,"#000",n,1),i.fill(),i.restore(),this._gethit=!1,(i=r.getContext("2d")).save(),i.setTransform(t,0,0,t,0,0),this.drawBack_(i,e,n,t),this._shadow&&(i.shadowColor="rgba(0,0,0,0.5)",i.shadowBlur=t*this._shadow/2,i.shadowOffsetX=t*this._shadow/2,i.shadowOffsetY=t*this._shadow/2),i.fill(),i.restore();var o=this,s=this.img_=new Image;if(this._crossOrigin&&(s.crossOrigin=this._crossOrigin),s.src=this._src,s.width?o.drawImage_(r,s,t):s.onload=function(){o.drawImage_(r,s,t),o._onload&&o._onload()},!this.getDisplacement){var a=this.getAnchor();a[0]=(r.width/t-this._shadow)/2-this._offset[0],this.sanchor_?a[1]=r.height/t-this._shadow-this._offset[1]:a[1]=(r.height/t-this._shadow)/2-this._offset[1]}return r},_At.prototype.getPhoto=function(){return this.img_},_At.prototype.drawImage_=function(t,e,r){var n=t.getContext("2d"),i=0;this._stroke&&(i=this._stroke.getWidth());var o,s,a,l,u,h,c,A,f,p=2*this._radius;n.save(),Ri.prototype.render&&n.setTransform(r,0,0,r,0,0),"circle"==this._kind&&(n.beginPath(),n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.clip()),this._crop?(A=f=(o=Math.min(e.width/p,e.height/p))*p,h=(e.width-A)/2,c=(e.height-f)/2,s=a=0,l=u=p+1):(h=c=0,s=(p-(l=(o=Math.min(p/e.width,p/e.height))*(A=e.width)))/2,a=(p-(u=o*(f=e.height)))/2),s+=i+this.sanchor_/2,a+=i,n.drawImage(e,h,c,A,f,s,a,l,u),"circle"==this._kind&&i&&(n.beginPath(),n.strokeStyle=Kn(this._stroke.getColor()),n.lineWidth=i/4,n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.stroke()),n.restore()};var wAt=function(t){(t=t||{}).loader=this._loader,t.strategy=aa,pa.call(this,t),this.set("time",t.time||new Date),this.set("step",t.step||1)};qm(wAt,pa),function(){function t(t){var e=Math.PI/180,r=t-2451545,n=280.46+.9856474*r,i=357.528+.9856003*r;return i%=360,{lambda:(n%=360)+1.915*Math.sin(i*e)+.02*Math.sin(2*i*e),R:1.00014-.01671*Math.cos(i*e)-.0014*Math.cos(2*i*e)}}function e(t){var e=(t-2451545)/36525;return 23.43929111-e*(46.836769/3600-e*(1831e-7/3600+e*(5.565e-7-e*(1.6e-10-4.34e-8*e/3600))))}function r(t,e){var r=180/Math.PI,n=Math.PI/180,i=Math.atan(Math.cos(e*n)*Math.tan(t*n))*r,o=Math.asin(Math.sin(e*n)*Math.sin(t*n))*r;return{alpha:i+=90*Math.floor(t/90)-90*Math.floor(i/90),delta:o}}wAt.prototype._loader=function(t,e,r){var n=this.getCoordinates(this.get("time")),i=new xn([n]);i.transform("EPSG:4326",r),this.addFeature(new X(i))},wAt.prototype.setTime=function(t){this.set("time",t),this.refresh()},wAt.prototype.getSunPosition=function(n){var i=(n?new Date(n):new Date)/864e5+2440587.5,o=(18.697374558+24.06570982441908*(i-2451545))%24,s=t(i),a=e(i),l=r(s.lambda,a);return[l.alpha-15*o,l.delta]},wAt.getNightLat=function(n,i){var o=180/Math.PI,s=Math.PI/180,a=(i?new Date(i):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=t(a),h=e(a),c=r(u.lambda,h),A=15*l+n-c.alpha;return Math.atan(-Math.cos(A*s)/Math.tan(c.delta*s))*o},wAt.prototype.getCoordinates=function(n,i){for(var o=180/Math.PI,s=Math.PI/180,a=(n?new Date(n):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=[],h=t(a),c=e(a),A=r(h.lambda,c),f=this.get("step")||1,p=-180;p<=180;p+=f){var d=p,g=15*l+d-A.alpha,y=Math.atan(-Math.cos(g*s)/Math.tan(A.delta*s))*o;u.push([d,y])}switch(i){case"line":break;case"day":A.delta*=-1;default:y=A.delta<0?90:-90;for(var m=180;m>=-180;m-=f)u.push([m,y]);u.push(u[0])}if("daynight"===i){var v=[];u.forEach((function(t){v.push(t.slice())})),v[0][1]=-v[0][1],v[v.length-1][1]=-v[0][1],v[v.length-1][1]=-v[0][1],u=[u,v]}return u}}();var bAt=function(t){t=t||{},this.source=t.source,this.nodes=new pa,this.maxIteration=t.maxIteration||2e4,this.stepIteration=t.stepIteration||2e3,this.astar=!0,this.candidat=[],D.call(this),this.set("epsilon",t.epsilon||1e-6)};qm(bAt,D),bAt.prototype.weight=function(){return 1},bAt.prototype.direction=function(){return 2},bAt.prototype.getLength=function(t){return t.getGeometry&&(t=t.getGeometry()),t.getLength()},bAt.prototype.getNodeSource=function(){return this.nodes},bAt.prototype.getEdges=function(t){var e=Ct(Et([t]),this.get("epsilon")),r=[];return this.source.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r},bAt.prototype.getNode=function(t){var e=Ct(Et([t]),this.get("epsilon")),r=[];return this.nodes.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r[0]},bAt.prototype.addNode=function(t,e,r,n,i){if(this.wdist&&e>this.wdist)return!1;var o=this.getNode(t),s=e+this.getLength(new Nn([this.end,t]))*this.weight();if(this.astar&&this.wdist&&s>this.wdist)return!1;if(o){if(o!==this.arrival&&o.get("wdist")<=e)return o;o.set("dist",r),o.set("wdist",e),o.set("dtotal",s),o.set("from",n),o.set("prev",i),o===this.arrival&&(this.wdist=e),this.candidat.push(o)}else o=new X({geometry:new on(t),from:n,prev:i,dist:r||0,wdist:e,dtotal:s}),e<0?o.set("wdist",!1):this.candidat.push(o),this.nodes.addFeature(o);return o},bAt.prototype.closestCoordinate=function(t){var e=this.source.getClosestFeatureToCoordinate(t),r=e.getGeometry().getFirstCoordinate(),n=e.getGeometry().getLastCoordinate();return aut(t,r)<aut(t,n)?r:n},bAt.prototype.path=function(t,e){if(this.running)return!1;if(t=this.closestCoordinate(t),this.end=this.closestCoordinate(e),t[0]===this.end[0]&&t[1]===this.end[1])return this.dispatchEvent({type:"finish",route:[],wDistance:-1,distance:this.wdist}),!1;var r=this;return this.nodes.clear(),this.candidat=[],this.wdist=0,this.running=!0,this.addNode(t,0),this.arrival=this.addNode(this.end,-1),this.nb=0,this.dispatchEvent({type:"start"}),setTimeout((function(){r._resume()})),[t,this.end]},bAt.prototype.resume=function(){this.running||this.candidat.length&&(this.running=!0,this.nb=0,this._resume())},bAt.prototype.pause=function(){this.running&&(this.nb=-1)},bAt.prototype.getBestWay=function(){for(var t,e,r=-1,n=0;e=this.candidat[n];n++)e.get("wdist")>r&&(t=e,r=e.get("wdist"));return this.getRoute(t)},bAt.prototype._resume=function(){if(this.running){for(;this.candidat.length;){this.candidat.sort((function(t,e){return t.get("dtotal")<e.get("dtotal")?1:t.get("dtotal")===e.get("dtotal")?0:-1}));for(var t,e=this.candidat.pop(),r=e.getGeometry().getCoordinates(),n=this.getEdges(r),i=0;t=n[i];i++){if(e.get("from")!==t){var o=this.getLength(t),s=e.get("wdist")+o*this.weight(t);o=e.get("dist")+o;var a=t.getGeometry().getFirstCoordinate(),l=t.getGeometry().getLastCoordinate(),u=this.direction(t);0!==u&&(r[0]===a[0]&&r[1]===a[1]&&-1!==u&&this.addNode(l,s,o,t,e),r[0]===l[0]&&r[0]===l[0]&&1!==u&&this.addNode(a,s,o,t,e))}if(-1===this.nb||this.nb++>this.maxIteration)return this.running=!1,void this.dispatchEvent({type:"pause",overflow:-1!==this.nb});if(!(this.nb%this.stepIteration)){var h=this;return window.setTimeout((function(){h._resume()}),5),void this.dispatchEvent({type:"calculating"})}}}this.nodes.clear(),this.running=!1,this.dispatchEvent({type:"finish",route:this.getRoute(this.arrival),wDistance:this.wdist,distance:this.arrival.get("dist")})}},bAt.prototype.getRoute=function(t){for(var e=[];t;)e.unshift(t.get("from")),t=t.get("prev");return e.shift(),e};var xAt=qv,EAt=function(t,e){return[Math.round(t[0]/e)*e,Math.round(t[1]/e)*e]},CAt=eA(R_),SAt=EAt;function BAt(t,e,r){return"FeatureCollection"===t.type?t.features.reduce((function(t,r){return BAt(r,e,t)}),r):e(r,t)}function IAt(t){return"LineString"===t.geometry.type}var TAt={compactNode:PAt,compactGraph:function(t,e,r,n){var i=(n=n||{}).progress,o=Object.keys(t).reduce((function(e,r,o,s){var a=t[r],l=Object.keys(a),u=l.length;return!(void 0!==n.compact&&!n.compact)&&(1===u?!t[l[0]][r]:2===u&&l.filter((function(e){return t[e][r]})).length===u)||(e[r]=a),o%1e3==0&&i&&i("compact:ends",o,s.length),e}),{});return Object.keys(o).reduce((function(s,a,l,u){var h=PAt(a,t,o,e,r,!1,n);return s.graph[a]=h.edges,s.coordinates[a]=h.coordinates,n.edgeDataReduceFn&&(s.reducedEdges[a]=h.reducedEdges),l%1e3==0&&i&&i("compact:nodes",l,u.length),s}),{graph:{},coordinates:{},reducedEdges:{}})}};function PAt(t,e,r,n,i,o,s){s=s||{};var a=e[t];return Object.keys(a).reduce((function(a,l){var u=function(t,e,r,n,i,o,s,a){var l=r[t][e],u=r[e][t],h=[],c=[],A=a.edgeDataSeed;for(a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][t]));!n[e];){var f=r[e];if(!f)break;var p=Object.keys(f).filter((function(e){return e!==t}))[0];if(l+=f[p],s){if(u+=r[p][e],c.indexOf(e)>=0){n[e]=r[e];break}c.push(e)}a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][p])),h.push(i[e]),t=e,e=p}return{vertex:e,weight:l,reverseWeight:u,coordinates:h,reducedEdge:A}}(t,l,e,r,n,i,o,s),h=u.weight,c=u.reverseWeight;if(u.vertex!==t&&((!a.edges[u.vertex]||a.edges[u.vertex]>h)&&(a.edges[u.vertex]=h,a.coordinates[u.vertex]=[n[t]].concat(u.coordinates),a.reducedEdges[u.vertex]=u.reducedEdge),o&&!isNaN(c)&&(!a.incomingEdges[u.vertex]||a.incomingEdges[u.vertex]>c))){a.incomingEdges[u.vertex]=c;var A=[n[t]].concat(u.coordinates);A.reverse(),a.incomingCoordinates[u.vertex]=A}return a}),{edges:{},incomingEdges:{},coordinates:{},incomingCoordinates:{},reducedEdges:{}})}var FAt=function(t,e){var r=(e=e||{}).keyFn||function(t){return t.join(",")},n=e.precision||1e-5,i=function(t,e){var r=[];return"FeatureCollection"===t.type&&(r=r.concat(t.features.filter(e))),{type:"FeatureCollection",features:r}}(t,IAt),o=CAt(i).features.reduce((function(t,i,o,s){var a=SAt(i.geometry.coordinates,n);return t[r(a)]=i.geometry.coordinates,o%1e3==0&&e.progress&&e.progress("topo:vertices",o,s.length),t}),{}),s=BAt(i,(function(t,i,o,s){return i.geometry.coordinates.forEach((function(e,o,s){if(o>0){var a=r(SAt(s[o-1],n)),l=r(SAt(e,n));t.push([a,l,i.properties])}})),o%1e3==0&&e.progress&&e.progress("topo:edges",o,s.length),t}),[]);return{vertices:o,edges:s}},LAt=TAt,MAt=eA(Zv).default,{point:OAt}=G_,kAt=function(t,e){var r,n=(e=e||{}).weightFn||function(t,e){return MAt(OAt(t),OAt(e))};"FeatureCollection"===t.type?r=FAt(t,e):t.edges&&(r=t),t=r.edges.reduce((function(t,i,o,s){var a=i[0],l=i[1],u=i[2],h=n(r.vertices[a],r.vertices[l],u),c=function(r){t.vertices[r]||(t.vertices[r]={},e.edgeDataReduceFn&&(t.edgeData[r]={}))},A=function(r,n,i){t.vertices[r][n]=i,e.edgeDataReduceFn&&(t.edgeData[r][n]=e.edgeDataReduceFn(e.edgeDataSeed,u))};return h&&(c(a),c(l),h instanceof Object?(h.forward&&A(a,l,h.forward),h.backward&&A(l,a,h.backward)):(A(a,l,h),A(l,a,h))),o%1e3==0&&e.progress&&e.progress("edgeweights",o,s.length),t}),{edgeData:{},vertices:{}});var i=LAt.compactGraph(t.vertices,r.vertices,t.edgeData,e);return{vertices:t.vertices,edgeData:t.edgeData,sourceVertices:r.vertices,compactedVertices:i.graph,compactedCoordinates:i.coordinates,compactedEdges:e.edgeDataReduceFn?i.reducedEdges:null}},NAt=TAt,RAt=EAt,UAt=DAt;function DAt(t,e){if(e=e||{},t.compactedVertices||(t=kAt(t,e)),this._graph=t,this._keyFn=e.keyFn||function(t){return t.join(",")},this._precision=e.precision||1e-5,this._options=e,0===Object.keys(this._graph.compactedVertices).filter((function(t){return"edgeData"!==t})).length)throw new Error("Compacted graph contains no forks (topology has no intersections).")}DAt.prototype={findPath:function(t,e){var r=this._keyFn(RAt(t.geometry.coordinates,this._precision)),n=this._keyFn(RAt(e.geometry.coordinates,this._precision));if(!this._graph.vertices[r]||!this._graph.vertices[n])return null;this._createPhantom(r),this._createPhantom(n);var i=function(t,e,r){var n={};n[e]=0;for(var i=new xAt([[0,[e],e]],(function(t,e){return t[0]-e[0]}));i.length;){var o=i.pop(),s=o[0],a=o[2];if(a===r)return o.slice(0,2);var l=t[a];Object.keys(l).forEach((function(t){var e=s+l[t];if(!(t in n)||e<n[t]){n[t]=e;var r=[e,o[1].concat([t]),t];i.push(r)}}))}return null}(this._graph.compactedVertices,r,n);if(i){var o=i[0];return{path:(i=i[1]).reduce(function(t,e,r,n){return r>0&&(t=t.concat(this._graph.compactedCoordinates[n[r-1]][e])),t}.bind(this),[]).concat([this._graph.sourceVertices[n]]),weight:o,edgeDatas:this._graph.compactedEdges?i.reduce(function(t,e,r,n){return r>0&&t.push({reducedEdge:this._graph.compactedEdges[n[r-1]][e]}),t}.bind(this),[]):void 0}}return null},serialize:function(){return this._graph},_createPhantom:function(t){if(this._graph.compactedVertices[t])return null;var e=NAt.compactNode(t,this._graph.vertices,this._graph.compactedVertices,this._graph.sourceVertices,this._graph.edgeData,!0,this._options);return this._graph.compactedVertices[t]=e.edges,this._graph.compactedCoordinates[t]=e.coordinates,this._graph.compactedEdges&&(this._graph.compactedEdges[t]=e.reducedEdges),Object.keys(e.incomingEdges).forEach(function(r){this._graph.compactedVertices[r][t]=e.incomingEdges[r],this._graph.compactedCoordinates[r][t]=[this._graph.sourceVertices[r]].concat(e.incomingCoordinates[r].slice(0,-1)),this._graph.compactedEdges&&(this._graph.compactedEdges[r][t]=e.reducedEdges[r])}.bind(this)),t},_removePhantom:function(t){t&&(Object.keys(this._graph.compactedVertices[t]).forEach(function(e){delete this._graph.compactedVertices[e][t]}.bind(this)),Object.keys(this._graph.compactedCoordinates[t]).forEach(function(e){delete this._graph.compactedCoordinates[e][t]}.bind(this)),this._graph.compactedEdges&&Object.keys(this._graph.compactedEdges[t]).forEach(function(e){delete this._graph.compactedEdges[e][t]}.bind(this)),delete this._graph.compactedVertices[t],delete this._graph.compactedCoordinates[t],this._graph.compactedEdges&&delete this._graph.compactedEdges[t])}};var QAt=function(t){t||(t={}),null==t.typing&&(t.typing=300);var e=document.createElement("DIV"),r=(t.className||"")+" ol-scale";t.target||(r+=" ol-unselectable ol-control"),this._input=document.createElement("INPUT"),this._input.value="-",e.setAttribute("class",r),!1===t.editable&&(this._input.readOnly=!0),e.appendChild(this._input),Bl.call(this,{element:e,target:t.target}),this._input.addEventListener("change",this.setScale.bind(this)),this.set("ppi",t.ppi||96)};qm(QAt,Bl),QAt.prototype.setMap=function(t){this._listener&&k(this._listener),this._listener=null,Bl.prototype.setMap.call(this,t),t&&(this._listener=t.on("moveend",this.getScale.bind(this)))},QAt.prototype.getScale=function(){var t=this.getMap();if(t){var e=function(t,e){var r=t.getView(),n=r.getProjection(),i=r.getCenter(),o=t.getPixelFromCoordinate(i);o[1]+=1;var s=t.getCoordinateFromPixel(o);return We(dr(i,n,"EPSG:4326"),dr(s,n,"EPSG:4326"))*((e||96)/.0254)}(t,this.get("ppi"));return this._input.value=this.formatScale(e),e}},QAt.prototype.formatScale=function(t){return"1 / "+(t=t>100?100*Math.round(t/100):Math.round(t)).toLocaleString()},QAt.prototype.setScale=function(t){var e=this.getMap();e&&t&&(t.target&&(t=t.target.value),function(t,e,r){if(t&&e){var n=e;if("string"==typeof e&&((n=e.split("/")[1])||(n=e),n=n.replace(/[^\d]/g,""),n=parseInt(n)),!n)return;var i=t.getView(),o=i.getProjection(),s=i.getCenter(),a=t.getPixelFromCoordinate(s);a[1]+=1;var l=t.getCoordinateFromPixel(a),u=We(dr(s,o,"EPSG:4326"),dr(l,o,"EPSG:4326"));u*=(r||96)/.0254,i.setResolution(i.getResolution()*n/u)}}(e,t,this.get("ppi"))),this.getScale()};var GAt=function(t){Zc.call(this,t)};qm(GAt,Zc),GAt.prototype.getExtent=function(){return this.getSource().getExtent()};var jAt=function(t){var e={attributions:t.attributions,logo:t.logo,projection:t.projection};this._image=t.image?t.image:new Image,this._image.crossOrigin=t.crossOrigin;var r=this;this._image.onload=function(){r.setCrop(r.crop),r.changed()},t.image||(this._image.src=t.url),e.canvasFunction=this.calculateImage,JR.call(this,e),this.center=t.imageCenter,this.setScale(t.imageScale),this.rotate=t.imageRotate?t.imageRotate:0,this.crop=t.imageCrop,this.mask=t.imageMask,this.setCrop(this.crop),this.on("change",function(){this.set("extent",this.calculateExtent())}.bind(this))};qm(jAt,JR),jAt.prototype.calculateImage=function(t,e,r,n){if(this.center){var i=document.createElement("canvas");i.width=n[0],i.height=n[1];var o=i.getContext("2d");if(!this._imageSize)return i;if(this.mask){o.beginPath();var s=f(this.mask[0]);o.moveTo(s[0],s[1]);for(var a=1;a<this.mask.length;a++)s=f(this.mask[a]),o.lineTo(s[0],s[1]);o.clip()}var l=f(this.center),u=(this._image.naturalWidth/2-this.crop[0])*this.scale[0]/e*r,h=(this._image.naturalHeight/2-this.crop[1])*this.scale[1]/e*r,c=this._imageSize[0]*this.scale[0]/e*r,A=this._imageSize[1]*this.scale[1]/e*r;return o.translate(l[0],l[1]),this.rotate&&o.rotate(this.rotate),o.drawImage(this._image,this.crop[0],this.crop[1],this._imageSize[0],this._imageSize[1],-u,-h,c,A),i}function f(e){return[(e[0]-t[0])/(t[2]-t[0])*n[0],(e[1]-t[3])/(t[1]-t[3])*n[1]]}},jAt.prototype.getCenter=function(){return this.center},jAt.prototype.setCenter=function(t){this.center=t,this.changed()},jAt.prototype.getScale=function(){return this.scale},jAt.prototype.setScale=function(t){switch(typeof t){case"number":t=[t,t];break;case"object":if(2!=t.length)return;break;default:return}this.scale=t,this.changed()},jAt.prototype.getRotation=function(){return this.rotate},jAt.prototype.setRotation=function(t){this.rotate=t,this.changed()},jAt.prototype.getGeoImage=function(){return this._image},jAt.prototype.getCrop=function(){return this.crop},jAt.prototype.setMask=function(t){this.mask=t,this.changed()},jAt.prototype.getMask=function(){return this.mask},jAt.prototype.setCrop=function(t){if(this._image.naturalWidth){if(t){switch(typeof t){case"number":t=[t,t,this._image.naturalWidth-t,this._image.naturalHeight-t];break;case"object":if(4!=t.length)return;break;default:return}t=Et([[t[0],t[1]],[t[2],t[3]]]),this.crop=[Math.max(0,t[0]),Math.max(0,t[1]),Math.min(this._image.naturalWidth,t[2]),Math.min(this._image.naturalHeight,t[3])]}else this.crop=[0,0,this._image.naturalWidth,this._image.naturalHeight];this.crop[2]<=this.crop[0]&&(this.crop[2]=this.crop[0]+1),this.crop[3]<=this.crop[1]&&(this.crop[3]=this.crop[1]+1),this._imageSize=[this.crop[2]-this.crop[0],this.crop[3]-this.crop[1]],this.changed()}else this.crop=t},jAt.prototype.getExtent=function(t){var e=this.get("extent");if(e||(e=this.calculateExtent()),t)for(var r=0;r<t.length;r++)t[r]=e[r];return e},jAt.prototype.calculateExtent=function(t){var e;if(!1!==t&&this.getMask())e=new xn([this.getMask()]);else{var r=this.getCenter(),n=this.getScale(),i=this.getGeoImage().width*n[0],o=this.getGeoImage().height*n[1];(e=En(Et([[r[0]-i/2,r[1]-o/2],[r[0]+i/2,r[1]+o/2]]))).rotate(-this.getRotation(),r)}return e.getExtent()};const HAt=Object.freeze(Object.defineProperty({__proto__:null,ArcGisFeatureServiceLayer:class extends vAt{constructor(t,r){super(t,r),e(this,"queryParams"),e(this,"isLoading"),e(this,"defaultExtent"),this.layertype="ArcGisFeatureServiceLayer",this.isLoading=!1,this.queryParams={f:"json",where:"1=1",outFields:"*",returnGeometry:"true",spatialRel:"esriSpatialRelIntersects",geometryType:"esriGeometryEnvelope",inSR:"102100",outSR:"102100",extent:null,extentWkid:"102100",onlyField:"OBJECTID",autoShowFeature:!1},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t={}){try{this.isLoading=!0;let e,r=this,n=this.option.url+"/query/",i=new Tut,o=Object.assign({},this.queryParams,t),s="";if(o.feature){let t=o.feature.getGeometry(),e=t.getType();if("Polygon"===e||"MultiPolygon"===e){let r=t;"Polygon"===e?r.getLinearRing(0):r.getLinearRings(),s=`{"rings":${JSON.stringify(r.getCoordinates())},"spatialReference":{"wkid":102100}}`}o.geometryType="esriGeometryPolygon",delete o.feature,delete o.extent,delete o.extentWkid}else o.extent&&("4326"===o.extentWkid&&(o.extent=gr(o.extent,"EPSG:4326","EPSG:3857")),delete o.extent,delete o.extentWkid,o.geometryType="esriGeometryEnvelope",s=`{"xmin":${o.extent[0]},"ymin":${o.extent[1]},"xmax":${o.extent[2]},"ymax":${o.extent[3]},"spatialReference":{"wkid":102100}}`);""!==s?e=Object.assign({},o,{geometry:s}):this.defaultExtent&&(o.geometryType="esriGeometryEnvelope",e=Object.assign({},o,{geometry:`{"xmin":${this.defaultExtent[0]},"ymin":${this.defaultExtent[1]},"xmax":${this.defaultExtent[2]},"ymax":${this.defaultExtent[3]},"spatialReference":{"wkid":102100}}`}));let a=!1;fetch(`${n}?${new URLSearchParams(e)}`).then((t=>t.json())).then((t=>{const e=i.readFeatures(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(o.onlyField)===e.get(o.onlyField)}))||t.push(e)})),r.addFeatures("arcgisFeature",t),r.trigger(Em.onFeaturesLoad,e)}})).catch((t=>{a||(a=!0)})).finally((()=>{this.isLoading=!1}))}catch(TX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},ArcGisMapServerLayer:xU,ArcGisTileXyzLayer:bU,ClusterImageLayer:class extends DO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.styleCache={},this.layertype="ClusterImageLayer",this.option={distance:40,imageFieldName:"主照片地址",animationDuration:600,maxResolution:40},this.option=Object.assign({},this.option,r),this._source=new pa,this.clusterSource=new zO({distance:this.option.distance,source:this._source}),this.layer=new yut({source:this.clusterSource,animationDuration:this.option.animationDuration,maxResolution:this.option.maxResolution,renderOrder:function(t,e){return e.getGeometry().getExtent()[1]-t.getGeometry().getExtent()[1]},style:(t,e)=>this.getFeatureStyle(t,e,"")}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype),this.selectCluster=new Th({layers:[this.layer],condition:pu,style:(t,e)=>this.getFeatureStyle(t,e,"sel")}),this.selectCluster.setActive(!0),this.selectCluster.getFeatures().on(["add"],(t=>{let e=t.target.getArray()[0].get("features");e&&this.trigger(Em.onFeatureSelected,e)})),this.selectCluster.getFeatures().on(["remove"],(function(t){}))}addFeaturesMN(t,e){var r,n,i,o;let s=t.getView().calculateExtent(t.getSize()),a=[];for(let l=0;l<e;++l)a[l]=new X(new on([s[0]+(s[2]-s[0])*Math.random(),s[1]+(s[3]-s[1])*Math.random()])),a[l].set("id",l),a[l].set("name","123123"),a[l].set("classname",l),a[l].set("thumbnail","");null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.clear(),null==(o=null==(i=this.clusterSource)?void 0:i.getSource())||o.addFeatures(a)}getFeatureStyle(t,e,r){let n,i=t.get("features")[0].get("uuid"),o=t.get("features")[0],s=t.get("features").length,a=o.get(this.option.imageFieldName);if(a=a.replace("_sss","_s"),n||(this.styleCache[i]=n=new Vi({image:new _At({src:a,radius:20,crop:!0,kind:s>1?"folio":"square",shadow:!0,onload:function(){try{t.changed()}catch{}},stroke:new Rn({width:2,color:"sel"===r?"rgba(0, 255, 0,1)":"#fff"})})})),s>1){let t=new Vi({image:new Ri({points:12,radius:9,fill:new Fn({color:"rgba(0, 255, 0,0.3)"})}),text:new Wi({text:s.toString(),font:"bold 12px helvetica,sans-serif",fill:new Fn({color:"#000"})})}),e=t.getImage().getAnchor();return e[0]-=20,e[1]+=20,[n,t]}return[n]}appendTo(t){var e,r;this._map=t,this.selectCluster&&(null==(e=this._map)||e.addInteraction(this.selectCluster)),this.layer&&(null==(r=this._map)||r.addLayer(this.layer))}},ClusterLayer:class extends DO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.option={convexhull:!0,animatesel:!0,haslink:!0,distance:40,popupInfo:"",popupOption:{offset:[0,0]},levelColor:[{maxnum:5e3,strokecolor:"rgba(192,0,0,0.5)",strokewidth:15,fillcolor:"rgba(192,0,0,1)"},{maxnum:1e3,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(255,165,0,1)"},{maxnum:500,strokecolor:"rgba(255,128,0,0.5)",strokewidth:15,fillcolor:"rgba(255,128,0,1)"},{maxnum:100,strokecolor:"rgba(0,191,255,0.5)",strokewidth:15,fillcolor:"rgba(0,191,255,1)"},{maxnum:50,strokecolor:"rgba(139,0,139,0.5)",strokewidth:15,fillcolor:"rgba(139,0,139,1)"},{maxnum:2,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(\t255,165,0,1)"}]},this.option=Object.assign({},this.option,r),this.styleCache={},this.layertype="ClusterLayer",this.clusterSource=new zO({distance:this.option.distance,source:this._source}),this.layer=new yut({zIndex:this.option.zIndex,source:this.clusterSource,style:this.getStyle.bind(this)}),this.layer.set("layerid",t);let n=new Di({radius:5,stroke:new Rn({color:"rgba(0,255,255,1)",width:1}),fill:new Fn({color:"rgba(0,255,255,0.3)"})}),i=new Vi({image:n}),o=new Vi({image:n,stroke:new Rn({color:"#fff",width:1})});this.selectCluster=new vut({layers:[this.layer],condition:pu,pointRadius:7,animate:this.option.animatesel,featureStyle:()=>[this.option.haslink?o:i],style:(t,e)=>{let r=t.get("features");if(r){if(r.length>1){let n=[this.getStyle(t,e)];if(this.option.convexhull&&_ut){let t=[];for(let n=0;n<r.length;n++)t.push(r[n].getGeometry().getFirstCoordinate());let e=_ut(t);n.push(new Vi({stroke:new Rn({color:"rgba(0,0,192,0.5)",width:2}),fill:new Fn({color:"rgba(0,0,192,0.3)"}),geometry:new xn([e]),zIndex:100}))}return n}return[new Vi({image:new Di({radius:5,stroke:new Rn({color:"rgba(255,0,0,0.5)",width:10}),fill:new Fn({color:"rgba(255,0,0,1)"})}),text:new Wi({text:r[0].getProperties().name,font:"13px Microsoft YaHei",offsetY:-15,fill:new Fn({color:"#8B4513"}),stroke:new Rn({color:"#fff",width:2})})})]}}}),this.selectCluster.getFeatures().on(["add"],(t=>{t.target.getArray()[0].get("features")})),this.selectCluster.getFeatures().on(["remove"],(function(t){})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}appendTo(t){var e;this._map=t,this._map.addInteraction(this.selectCluster),this.layer&&(null==(e=this._map)||e.addLayer(this.layer))}showTitle(t,e){new Promise(((r,n)=>{this._source.getFeatures().forEach((r=>{let n=r.getProperties();if(t===n.dataType)try{r.getStyle().getText().setText(e?r.get("name"):"")}catch(TX){}})),this.layer.changed()}))}addFeaturesMN(t,e){var r,n;let i=t.getView().calculateExtent(t.getSize()),o=[];for(let s=0;s<e;++s)o[s]=new X(new on([i[0]+(i[2]-i[0])*Math.random(),i[1]+(i[3]-i[1])*Math.random()])),o[s].set("id",s),o[s].set("name","123123"),o[s].set("classname",s);null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.addFeatures(o)}getStyle(t,e){let r=t.get("features").length,n=this.styleCache[r];return 1===r?n=this.styleCache[r]=t.get("features")[0].getStyle():n||(this.option.levelColor.sort((function(t,e){return t.maxnum-e.maxnum})),this.option.levelColor.forEach((t=>{let e=Math.max(8,Math.min(.75*r,20));r>=t.maxnum&&(n=this.styleCache[r]=new Vi({image:new Di({radius:e,stroke:new Rn({color:t.strokecolor,width:t.strokewidth,lineCap:"butt"}),fill:new Fn({color:t.fillcolor})}),text:new Wi({text:r.toString(),fill:new Fn({color:"#fff"})})}))}))),n}},DayNightLayer:class extends DO{constructor(t,e){super(t,e),this.layertype="DayNightLayer",this._source=new wAt({}),this.layer=new ta({source:this._source,zIndex:500,style:new Vi({image:new Di({radius:5,fill:new Fn({color:"red"})}),fill:new Fn({color:[0,0,50,.5]})})}),this.layer.set("layerid",t),this._source.on("addfeature",(t=>{}))}setDataTime(t){this._source.setTime(t)}},DivLayer:class extends Im{constructor(t,r){super(t,r),e(this,"DivGraphicList"),this.layertype="DivLayer",this.layerid=t,this.DivGraphicList=[],this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.layerid===t&&this.DivGraphicList.length>0&&this.removeAll()}))}getDivList(){return this.DivGraphicList}addDiv(t){this.DivGraphicList.push(t),this._map.addOverlay(t)}removeDiv(t){this._map.removeOverlay(t),this.DivGraphicList.forEach(((e,r,n)=>{if(e===t)return this.DivGraphicList.slice(r,1),void this.trigger(Em.onFeatureDeleted,{value:e})}))}removeAll(){this.DivGraphicList.forEach((t=>{this._map.removeOverlay(t),this.trigger(Em.onFeatureDeleted,{element:t})})),this.DivGraphicList=[]}appendTo(t){this._map=t}},GeoImageLayer:class extends wU{constructor(t,r){super(t,r),e(this,"GraphicLayer"),e(this,"graphic");let n={imageCenter:[0,0],imageScale:[1,1],imageRotate:0,imageMask:null,ImageExtentWKID:Lm.EPSG3857,opacity:1,hashEdit:!1};this.option=Object.assign({},n,this.option),this.GraphicLayer=null,this.graphic=null,this.option.ImageExtentWKID===Lm.EPSG4326&&(this.option.imageCenter=hr(this.option.imageCenter)),this.layertype="GeoImageLayer",this.layerSource=new jAt({url:this.option.url,imageMask:this.option.imageMask,imageCenter:this.option.imageCenter,imageScale:this.option.imageScale,imageRotate:Number(this.option.imageRotate*Math.PI/180)}),this.layer=new GAt({source:this.layerSource,opacity:this.option.opacity}),this.layer.set("layerid",t),this.layerSource.on("imageloadend",(t=>{this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.trigger(this.EventType.LayerEventType.tileloadend,t)})),this.layerSource.on("change",(t=>{this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent())})),this.layerSource.on("tileloaderror",(function(){})),this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.GraphicLayer&&this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}))}getAttribute(){return this.option}startEdit(t){this.option.hashEdit=!0,this.GraphicLayer=t,this.graphic?this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic):this.setExtent()}endEdit(){this.option.hashEdit=!1,this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}setExtent(){this.graphic||(this.graphic=new RO({graphicType:"PolygonGraphic",style:{stroke:{color:"rgba(255, 0, 0,0)",width:0},fill:{color:"rgba(255, 0, 0,0)"},zIndex:800},attribute:{name:this.layerid+"_graphic",movestate:!1,editallows:!1}}),this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic),this.graphic.set("Scale",this.option.imageScale),this.graphic.on("onRotating",(t=>{this.option.imageRotate=t.data,this.layerSource.setRotation(t.data)})),this.graphic.on("onScaling",(t=>{this.option.imageScale=[t.data,t.data],this.layerSource.setScale(t.data)})),this.graphic.on("onMoveing",(t=>{this.option.imageCenter=t.data,this.layerSource.setCenter(t.data)})))}setScale(t){this.graphic.set("Scale",t),this.layerSource.setScale(t)}computeAutoScale(t){let e=jt(t)/jt(this.layerSource.getExtent());this.graphic.set("Scale",[e,e]),this.layerSource.setScale([e,e])}getGraphic(){return this.graphic}},GraphicImageLayer:QO,GraphicLayer:vAt,HeatmapLayer:class extends DO{constructor(t,e){super(t,e),this.layertype="HeatmapLayer",this._source=new pa({wrapX:!1}),this.option={blur:25,radius:8,gradient:["#00f","#0ff","#0f0","#ff0","#f00"]},this.option=Object.assign({},this.option,e),this.layer=new jc({source:this._source,zIndex:this.option.zIndex,gradient:this.option.gradient,blur:this.option.blur,radius:this.option.radius}),this.layer.set("layerid",t)}setBlur(t){this.layer.setBlur(parseInt(t,10))}setRadius(t){this.layer.setRadius(parseInt(t,10))}},ImageCanvasLayer:class extends Im{constructor(t,r){if(super(t,r),e(this,"scale"),e(this,"ppi"),e(this,"layerOption"),e(this,"drawText"),this.option={},this.layerOption={line1Style:"rgba(255,0,0, 0.1)",line1Width:.5,line5Style:"rgba(255,0,0, 0.3)",line5Width:1,line10Style:"rgba(255,0,0, 0.5)",line10Width:2,lineRectStyle:"rgba(255, 0, 0, 1)",lineRectWidth:5},this.layerOption=Object.assign({},this.layerOption,r),this.layertype="ImageCanvasLayer",this.layer=new Zc({zIndex:r.zIndex}),!document.getElementById("hutia")){let t=document.createElement("div");t.setAttribute("id","hutia"),t.style.width="1cm",document.body.appendChild(t)}this.layer.setSource(new JR({canvasFunction:(t,e,r,n,i)=>{let o=document.createElement("canvas");this.trigger(Em.onScaleChange,{Scale:Math.round(this.scale.getScale())});let s=this._map.getSize(),a=new Array(2);a[0]=n[0]-s[0],a[1]=n[1]-s[1],o.width=n[0],o.height=n[1],a[0]=0,a[1]=0;const l=this.ppi/2.54/10;let u=a[0]/2,h=a[1]/2,c=o.width-a[0],A=o.height-a[1],f=o.getContext("2d");f.clearRect(u,h,c,A);let p=0;for(let d=h;d<o.height-h;d+=l)f.beginPath(),f.moveTo(u,d),f.lineTo(o.width-u,d),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;p=0;for(let d=u;d<o.width-u;d+=l)f.beginPath(),f.moveTo(d,h),f.lineTo(d,o.height-h),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;return f.lineWidth=this.layerOption.lineRectWidth,f.strokeStyle=this.layerOption.lineRectStyle,f.strokeRect(u,h,c,A),o}})),this.layer.set("layerid",t),this.layer.on(Em.onClick,(t=>{t.feature&&this.trigger(Em.onClick,t.feature.getProperties())}))}setScale(t){this.scale.setScale(t)}setText(t){this.drawText.updateHtml(t)}setElementStyle(t,e){this.drawText.updateElementStyle(t,e)}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0);let r=document.getElementById("hutia").offsetWidth,n=screen.width/r,i=screen.height/r,o=Math.round(Math.sqrt(n*n+i*i)/2.54);this.ppi=Math.sqrt(window.screen.width*window.screen.width+window.screen.height*window.screen.height)/o,this.ppi=Math.round(this.ppi),this.scale=new QAt({}),this.scale.set("ppi",this.ppi),this.scale.set("Visible",!1),this._map.addControl(this.scale),this.drawText=new $lt({}),this._map.addControl(this.drawText),this._map.getView().on("change",(t=>{this.layer.getSource().changed()})),document.querySelector(".ol-scale").style.display="none"}setMouseLock(t=!1){let e,r;this._map.getInteractions().forEach((function(n){n instanceof bu&&(e=n),n instanceof ju&&(r=n),e&&e.setActive(t),r&&r.setActive(t)}))}},PathLayer:class extends Im{constructor(t,r){super(t,r),e(this,"autoPointSize"),e(this,"result"),e(this,"resultlayer"),e(this,"resultSource"),e(this,"nodesLayer"),e(this,"dijkstra"),e(this,"pathDatalayer"),e(this,"animating"),e(this,"distance"),e(this,"lastTime"),e(this,"pathLine"),e(this,"position"),e(this,"geoMarker"),e(this,"styles"),e(this,"vueThis"),e(this,"pathLineFeature"),e(this,"lastAngle"),e(this,"pathIndex"),e(this,"pathNodeInfo"),e(this,"geoMarkerCircle"),e(this,"moveNodeInfo"),e(this,"FeatureMoveProgressInfo"),e(this,"oldPathLineFeature"),e(this,"routeFeatures"),e(this,"_source"),e(this,"multiLinePathData"),e(this,"timer"),e(this,"fun",(t=>{this.vueThis.moveFeature(t)})),this.option=SO.merge({roadNetworkData:"",pathDefaultStyle:{color:"rgba(255, 255, 255, 0.1)",width:1},pathStyle:{color:"#089519",width:10,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACISURBVDhP3Yy9CYAwFIQzg+ASTuFmuokjuIaFpb2Vc8S7vEswKFE78YOD5H6e+zne+xqq9H0Hhj0U6WU/gwPbZTw7gmJn/UvKR1iwXmKRjlwfYWB5gsNGKh+hYX4ijBUzLx/BZzUvkI0j9JRFNkUhHM3zE3QaR5hBM4tgkG3AaPW85U338zi3A+g3FErF6/qjAAAAAElFTkSuQmCC"},trackPathStyle:{color:"rgba(180,205,205, 1)",width:10},geoMarkerStyle:{url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAlCAYAAABGWhk4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABYgAAAWIBXyfQUwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAYGSURBVEiJlZdvaFvXFcB/7+mPI8lvjmxHil0vKkuq1bCuYbVsQrDxFup9aSAezA5pExpGRh26hdF0FOIv+9CyrLCh7dvABARmyIWB6Qad69Ik1PH8h67E0C6anbqTI8myZUeWZE1/nu4+6D7n2VZpcuCgq/vu/d37zjvn3HMVIQS1RFEUxWiaFECYFPE1AGtN6iNRAYv8VWVfRaouf2tKTbDcrQG1AXbZRgKLprGVWrtW93ZIqCJBdsAB1Mfj8d/H4/F3gXrZZyymmMz2SIQQu1RCrYATaAKeDoVC54WUUCh0HnhaPnPKscpejmJ+C5MJrMABQAMOpjY2xgpW13cB6sq5e02NjQPAQyAD/A8oA7tMstcUe8Gu8fHxM41ud/u1Ww/Ua7ceqI1ud/v4+PgZwCXHWOWc3ebYYwKLHOwGfG1tbV2ZbG51IZnT1bdnhfr2rFhI5vRMNrfa1tbWBfjk2AOGvQ2eecfm3dYBznA4fKHe5fS8MbmiVgRUBLwxuaLWu5yecDh8Qdq4rtauVZNtjY9mBxx9fX0tL3QEXv3wyy0xcT+9s/rE/TQffrklXugIvNrX19fCIw+xYvIQ1QRVzeBgMPia3W5zvPlRdJ8rvflRVLHbbY5gMPjaHrBqwC01TOC6evVq++DZs78JLaTUqWiWn//Aw7s/ahOXjh/icL1d+WI9j9OmKj9sb3t2e3t74s6dOymgxKNo3Oe3h4BjiURiUgghbi5vGe4r1lOp5fVUatn4bzxLJBKTwDE5d8evDTvbqEaUd2xsbNCYXNb10szMzGh/f//LwIvAi/39/S/PzMyMlnW9ZIwbGxsbBLySYTO+3S7ww4dbt4QQIrm29unQ0NArQC/QA3RL7QF6h4aGXkmurX0qhBDp9NYne8H7XGx+fv58Op22njp16pb8KCpAIBCoB5ibm8vKb1gBihMTEz1ut7sQCAT+AuSoJqiyERRGYLiohrHW0NDQEA6Hf+L3+497PJ5jLpfLC5DL5VaTyeRiJBL5bHBw8K/pdDpNNbS3gG2qIa4jd+sAGoEjwPeHh4cvbm5uLgqTFPWKKOoVc5fY3NxcHB4evgg8J+c2SpZVka9bJ+1z8ObNmxd7enp+pSiK9at0kd9Nx5mN5VhIbgPwnMdJZ6uLX59owddgRwhRvn379h96e3tvUE1MWaBgkVAHoF2/fr3r3Llzv1UUxfrnf63R/94iUytZYtkSugBdQCxbYi6eY+SzdZqcVjpaXKrP5+tyOp1zk5OTCaqZTleAbwGa3+9vnZ+ff0/TNN+f5lb55cR/9wZcTflj3xF+EfCSyWS+6ujo+GkkEokBmZ0UOTo6ekHTNN/iZoG3Pl55LCjAWx+vsLhZQNM03+jo6AXpBNad/NDa2noc4J2pGNulrz0j98l2qcI7UzEAJMNugC2A1e12Pwvwzwe5x4YaYsyRDCtgUQF1YGCg2eFwNGeKOvdS+ScG30vlyRR1HA5H88DAQDOgqoCIRqMFIYSos6jY1P0H7jeJTVWos6gIIUQ0Gi0AQgUq09PTW7lcbsVuUXje63xi8PNeJ3aLQi6XW5ment4CKirV8CttbGz8G6DniPbEYGOOZJQAXaXq0MVIJDIFcO1kC09p9seGPqXZuXayBQDJ2ElCGtVwbkwkEiNer7frH/fTvBT+D+VK7YLREKuq8LfBZ/jxdxpYXV2dOXz48M+ADSBrLvjUeDx+9/Tp02f8zc66l545yJ2VLMntck3o9w45+PtZP93f1iiVSpnLly8PLSwsJKhmuAJUE7OL6tFydGRk5FI+n08KIUShrIvQ3XXx+gfL4sSNz8WJG5+L1z9YFqG766JQ1oUQQuTz+eTIyMgl4KhkuCRzp/jTAA9wtLu7++TS0tL74htkaWnp/e7u7pMS6pEMO2CpdfQfoJrtXMFgsKOzs7OztbW1vampyQ+QSqUisVjsi9nZ2dkrV67MUz018lQTfBFZxylCiFr1sI1qOq1jd80A1SOpLCEFqSVMx78QQuxUmya4sYBFAo22+aqgSy2b2hVMFWetMtasxkK17iDGlWHnTmIuY/8P3C0FYo4OztIAAAAASUVORK5CYII="},navigationOption:{defaultZoom:15,turnToZoom:17,speed:1,tracking:!0,trackingDirection:!0,showNode:!0,showStartEndNode:!0,showPathLine:!0,scale:1,pointDistance:.5}},r,!0),this.layertype="PathLayer",this._source=new pa({wrapX:!1,url:this.option.roadNetworkData,format:new Df}),this._source.on("featuresloadend",(t=>{let e=[];t.features.forEach((t=>{let r=t.getGeometry();e.push(r.getCoordinates())})),this.multiLinePathData=new X({geometry:new th(e)})}));let n=[];this.pathDatalayer=new ta({source:this._source,zIndex:900,style:new Vi({stroke:new Rn({width:this.option.pathDefaultStyle.width,color:this.option.pathDefaultStyle.color}),fill:new Fn({color:this.option.pathDefaultStyle.color})})}),this.vueThis=this,this.styles={route:new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]})}),icon:new Vi({image:new Us({anchor:[.5,1],src:"data/icon.png"})}),geoMarker:new Vi({zIndex:999,image:new Us({src:this.option.geoMarkerStyle.url,rotation:0,rotateWithView:!1})})},this.resultSource=new pa,this.resultlayer=new ta({source:this.resultSource,zIndex:200,updateWhileAnimating:!0,updateWhileInteracting:!0}),this.position=new on([0,0]),this.geoMarker=new X({geometry:this.position}),this.geoMarker.setStyle(this.styles.geoMarker),this.resultSource.addFeature(this.geoMarker),this.resultlayer.on("change",(t=>{})),this.dijkstra=new bAt({source:this._source}),this.dijkstra.on("start",(t=>{this.resultSource.clear()})),this.dijkstra.on("finish",(t=>{if(this.resultSource.clear(),!t.route.length)return void this.trigger(Em.onPathComputerComplete,{pathLine:null,distance:0});if(this.routeFeatures=t.route,this.pathNodeInfo=bO.lineMerger(t.route,this.option.navigationOption.pointDistance),this.pathLineFeature=this.pathNodeInfo.line,this.pathLine=this.pathLineFeature.getGeometry(),this.option.navigationOption.totalDistance=Ye(this.pathLine)*this.option.navigationOption.scale,this.option.navigationOption.showNode){let t=0;this.pathLine.forEachSegment(((e,r)=>{let n=new X({geometry:new on(e)});n.setStyle(new Vi({image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:t.toString(),font:"12px sans-serif",fill:new Fn({color:"white"})})})),t++,this.resultSource.addFeature(n)}))}this.position.setCoordinates(this.pathLine.getFirstCoordinate()),this.setNavigationMarker(this.pathLine.getFirstCoordinate(),0),this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom)),this.geoMarkerCircle=new X({geometry:new Zu(this.pathLine.getFirstCoordinate(),50)}),this.oldPathLineFeature=new X({geometry:new Nn([this.pathLine.getFirstCoordinate()])}),this.oldPathLineFeature.setStyle(new Vi({stroke:new Rn({color:this.option.trackPathStyle.color,width:this.option.trackPathStyle.width})})),this.pathLineFeature.setStyle(this.styleFunc.bind(this)),this.geoMarkerCircle.setStyle(new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]}),fill:new Fn({color:"rgba(255, 255, 255, 0.1)"})})),this.option.navigationOption.showPathLine&&(this.resultSource.addFeature(this.geoMarker),this.resultSource.addFeature(this.oldPathLineFeature),this.resultSource.addFeature(this.pathLineFeature));let e=Ye(this.pathLineFeature.getGeometry());this.trigger(Em.onPathComputerComplete,{pathLine:this.pathLineFeature,distance:e})})),this.dijkstra.on("pause",(t=>{t.overflow&&this.dijkstra.resume()})),this.dijkstra.on("calculating",(t=>{let e=this.dijkstra.getBestWay();this.resultSource.clear(),this.resultSource.addFeatures(e)})),this.nodesLayer=new ta({source:this.dijkstra.getNodeSource(),style:new Vi({image:new Di({radius:5,fill:new Fn({color:[255,0,0,.1]})})})}),n.push(this.nodesLayer),n.push(this.resultlayer),n.push(this.pathDatalayer),this.layer=new Da({layers:n}),this.layer.set("layerid",t),this.animating=!1,this.distance=0,this.lastTime}styleFunc(t,e){let r=[];r.push(new Vi({stroke:new Rn({color:this.option.pathStyle.color,width:this.option.pathStyle.width})}));const n=t.get("geometry");if("linestring"===n.getType().toLowerCase()){const t=n.getCoordinates(),i=n.getLength(),o=80*e,s=Math.ceil(i/o);for(let e=1;e<s;e++){const t=e/s,i=n.getCoordinateAt(t),o=n.getCoordinateAt(t+.05*t),a=o[0]-i[0],l=o[1]-i[1],u=Math.atan2(l,a);r.push(new Vi({geometry:new on(i),image:new Us({scale:.8,rotateWithView:!0,rotation:-u,src:this.option.pathStyle.imageUrl})}))}this.option.navigationOption.showStartEndNode&&(r.push(new Vi({geometry:new on(t[0]),image:new Di({radius:12,fill:new Fn({color:"green"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"起",font:"12px sans-serif",fill:new Fn({color:"white"})})})),r.push(new Vi({geometry:new on(t[t.length-1]),image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"终",font:"12px sans-serif",fill:new Fn({color:"white"})})})))}return r}moveFeature(t){this.resultlayer.changed();const e=t.frameState.time,r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,this.trigger(Em.onFeatureMoveProgress,{progress:this.distance,distance:this.distance,elapsedTime:r}),this.distance>=1)this.stopAnimation();else{const e=this.pathLine.getCoordinateAt(this.distance);let n,i=(this.distance+this.option.navigationOption.speed*r/1e6)%2;n=i>=1?this.pathLine.getLastCoordinate():this.pathLine.getCoordinateAt(i);let o=this.setAngle(e,n);this.position.setCoordinates(e),this.option.navigationOption.tracking?(this._map.getView().setCenter(e),this._map.getView().setRotation(o.viewAngle)):this.styles.geoMarker.getImage().setRotation(o.markAngle);const s=function(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var e=t.inversePixelTransform[0],r=t.frameState,n=pt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ks(r.viewState.resolution,e);return new bs(t.context,e,r.extent,n,r.viewState.rotation,i,void 0)}(t);s.setStyle(this.styles.geoMarker),s.drawGeometry(this.position),this._map.render()}}setAngle(t,e){let r=e[1]-t[1],n=e[0]-t[0],i=1,o=Math.atan(r/n);r<=0&&n>=0?(i=2,o=-o):n>=0&&r>=0?(o=-o,i=1):n<=0&&r>=0?(o=Math.PI-o,i=4):n<=0&&r<=0&&(o=Math.PI-o,i=3);let s=Math.atan2(1,0);return{viewAngle:-s-o,markAngle:s+o,Angle:s-Math.atan2(r,n),xx:i}}startAnimation(t=!0,e=!0,r=10){this.lastAngle=0,this.distance=0,this.animating=!0,this.lastTime=Date.now(),this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(15),this.resultlayer.addEventListener("postrender",this.fun)}pauseAnimation(){this.resultlayer.removeEventListener("postrender",this.fun)}resumeAnimation(){this.resultlayer.addEventListener("postrender",this.fun)}stopAnimation(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),this.resultlayer.removeEventListener("postrender",this.fun)}startAnimation2(t){clearInterval(this.timer),t&&(this.option.navigationOption=Object.assign({},this.option.navigationOption,t)),this.distance=0,this.animating=!0,this.lastTime=Date.now(),this.pathNodeInfo.nodeData.length>3?this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[2]}:this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[1]},this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom),this._map.getView().setRotation(this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)).viewAngle)),this.oldPathLineFeature.getGeometry().setCoordinates([this.pathLine.getFirstCoordinate()]),this.pathIndex=0,this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.pathIndex/this.pathNodeInfo.coordinates.length,remainingDistance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*(this.pathIndex/this.pathNodeInfo.coordinates.length),nextNodeDistance:this.moveNodeInfo.currentNode.distance*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:this.ComputDirection()},this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),1)}stopAnimation2(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),clearInterval(this.timer)}pauseAnimation2(){clearInterval(this.timer)}resumeAnimation2(){this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),100)}moveFeature3(t){const e=(new Date).getTime(),r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,t>=this.pathNodeInfo.coordinates.length)this.stopAnimation2();else{const e=hr(this.pathNodeInfo.coordinates[t]);this.oldPathLineFeature.getGeometry().appendCoordinate(e),this.oldPathLineFeature.getGeometry().changed();let r=Ye(new Nn([e,hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale;if(this.position.setCoordinates(e),this.geoMarker.getGeometry().setCoordinates(e),this.geoMarkerCircle.getGeometry().setCenter(e),this.FeatureMoveProgressInfo.nodeNum=this.moveNodeInfo.currentNode.coordIndex,this.FeatureMoveProgressInfo.nextNodeDistance=r,this.FeatureMoveProgressInfo.progress=t/this.pathNodeInfo.coordinates.length,this.FeatureMoveProgressInfo.remainingDistance=this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.FeatureMoveProgressInfo.progress,r<=1*this.option.navigationOption.speed){let t=this.moveNodeInfo.currentNode.coordIndex+1;if(t<this.pathNodeInfo.nodeData.length-1){this.moveNodeInfo.currentNode=this.pathNodeInfo.nodeData[t],this.moveNodeInfo.nextNode=this.pathNodeInfo.nodeData[t+1],t<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[t+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):this.FeatureMoveProgressInfo.angle="直行";let e=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(e.viewAngle):this.styles.geoMarker.getImage().setRotation(e.markAngle)}}this.trigger(Em.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.option.navigationOption.tracking&&this._map.getView().setCenter(e)}}moveFeature2(){const t=(new Date).getTime(),e=t-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*e/1e6)%2,this.lastTime=t,this.distance>=1)this.stopAnimation2();else{const t=this.pathLine.getCoordinateAt(this.distance);let r,n=Ye(new Nn([t,hr(this.moveNodeInfo.nextNode.coords)]));if(this.position.setCoordinates(t),this.geoMarker.getGeometry().setCoordinates(t),this.geoMarkerCircle.getGeometry().setCenter(t),n<100){let t=bO.movePointContain(this.geoMarkerCircle,this.pathNodeInfo.nodeData);if(-1!==t.coordIndex&&t.coordIndex!==this.moveNodeInfo.currentNode.coordIndex&&t.coordIndex<=this.moveNodeInfo.currentNode.coordIndex+2){this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[t.coordIndex],nextNode:this.pathNodeInfo.nodeData[t.coordIndex+1],threeNode:this.pathNodeInfo.nodeData[t.coordIndex+2]};let n=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),i=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),o=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),s=(i[0]-n[0])*(o[1]-i[1])-(i[1]-n[1])*(o[0]-i[0]),a=this.setAngle(hr(this.moveNodeInfo.nextNode.coords),hr(this.moveNodeInfo.threeNode.coords));this.trigger(Em.onFeatureMoveProgress,{nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.distance,distance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.distance,elapsedTime:e,nextNodeDistance:this.moveNodeInfo.currentNode.distance,nextNodeDirection:a.markAngle,angle:s>0?"右":"左",xx:a.xx}),r=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)),this.option.navigationOption.tracking?this._map.getView().setRotation(r.viewAngle):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}this.option.navigationOption.tracking?this._map.getView().setCenter(t):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}ComputDirection(){let t=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),e=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),r=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),n=(e[0]-t[0])*(r[1]-e[1])-(e[1]-t[1])*(r[0]-e[0]);return 0===n?"直行":n>0?"右":"左"}getNearestPointOnPathNetWork(t){let e;return e=t instanceof X?t:new X({geometry:new on(t)}),bO.nearestPointOnLine(e,this.multiLinePathData)}addNavigationMarker(){this.resultSource.addFeature(this.geoMarker)}setNavigationMarker(t,e=0){let r;r=t instanceof X?t:new X({geometry:new on(t)}),this.position.setCoordinates(r.getGeometry().getCoordinates());let n=bO.nearestPointOnLine(r,this.multiLinePathData);this.geoMarker.setGeometry(n.getGeometry()),this.styles.geoMarker.getImage().setRotation(e),this.pathLineFeature&&this.resultSource.hasFeature(this.pathLineFeature)&&this.updateNavigationMarker(n)}updateNavigationMarker(t){let e=new X({geometry:new on(this.pathLine.getFirstCoordinate())});new X({geometry:new on(this.pathLine.getLastCoordinate())});let r=bO.lineSlice(e,t,this.pathLineFeature);this.pathIndex=t.get("index"),this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[this.pathIndex],nextNode:this.pathNodeInfo.nodeData[this.pathIndex+1]};let n=Ye(r.getGeometry())*this.option.navigationOption.scale;this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:n/this.option.navigationOption.totalDistance,remainingDistance:this.option.navigationOption.totalDistance-n,nextNodeDistance:Ye(new Nn([t.getGeometry().getCoordinates(),hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:""},this.pathIndex<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+1],this.FeatureMoveProgressInfo.angle="直行"),this.trigger(Em.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.oldPathLineFeature.setGeometry(r.getGeometry()),this.oldPathLineFeature.getGeometry().changed();let i=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(i.viewAngle):this.styles.geoMarker.getImage().setRotation(i.markAngle),this.option.navigationOption.tracking&&this._map.getView().setCenter(t.getGeometry().getCoordinates())}getPathLine(){return this.pathLine}computerPath(t,e){let r,n;r=t instanceof X?t.getGeometry().getCoordinates():t,n=e instanceof X?e.getGeometry().getCoordinates():e,clearInterval(this.timer),this.resultSource.clear(),this.dijkstra.path(r,n)}computerPath2(t,e){let r=this.getFile("../public/tempData/铁路_简版.json","text/json"),n=this.formatJsonTo4326Json(JSON.parse(r)),i=new UAt(n,{weightFn:function(t,e,r){let n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)}}),o=bO.featureTo4326(t),s=bO.featureTo4326(e);i.findPath(o,s)}addGeoJsonUrl(t,e){let r=this.getFile(e,"text/json"),n=this.formatJsonTo3857(JSON.parse(r));this.addFeatures(t,n)}addGeoJson(t,e){this.addFeatures(t,this.formatJsonTo3857(e))}convertGeoJsontoFeatures(t){return this.formatJsonTo3857(t)}addFeatures(t,e){var r;null==(r=this._map)||r.getView().getZoom(),e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector),Zm.getFeaturesDefaultStyle(e,25,this.autoPointSize);let r=Zm.getStyle(e.getGeometry().getType(),e.get("style"));e.setStyle(r)})),this._source.addFeatures(e)}addFeature(t,e){e.set("classname",t),this._source.addFeature(e)}getFeaturesByClassName(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("classname")===t&&e.push(r)})),e}getFeatures(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("name")===t&&e.push(r)})),e}getFeature(t){let e=null;return this._source.getFeatures().forEach((r=>{r.get("name")!==t||(e=r)})),e}removeFeatures(t){this._source.getFeatures().forEach((e=>{e.get("classname")===t&&this._source.removeFeature(e)}))}removeNavigationPath(){this.resultSource.forEachFeature((t=>{t!==this.geoMarker&&this.resultSource.removeFeature(t)}))}removeNavigationMarker(){this.resultSource.removeFeature(this.geoMarker)}removeNavigationAll(){this.resultSource.clear()}pathToGeoJSON(){return(new Df).writeFeaturesObject(this.routeFeatures,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0)}},PbfLayer:class extends Im{constructor(t,r){super(t,r),e(this,"_source"),e(this,"isLoading"),e(this,"queryParams"),this.layertype="PbfLayer",this.layerid=t,this.isLoading=!1;let n=this;const i=new AbortController;this._source=new Pf({format:new RA,url:r.url,tileLoadFunction:(t,e)=>{t.setLoader((function(r,o,s){fetch(e,{signal:i.signal}).then((function(t){return!t.status||t.status>=200&&t.status<300?t.arrayBuffer():null})).then((function(e){if(e)try{if(e.byteLength>0){const i=t.getFormat().readFeatures(e,{extent:r,featureProjection:s});let o=[];i.forEach((t=>{let e=TA(t);e.set("movestate",!1),e.set("editstate",!1),e.on("mousemove",(t=>{n.trigger(Em.onFeatureMousemove,{data:t.target})})),e.on("mouseout",(t=>{n.trigger(Em.onFeatureMouseout,{data:t.target})})),o.push(e)})),t.setFeatures(o)}}catch(TX){}})).catch((t=>{}))}))}});const o=new Vi({fill:new Fn({color:"#eeeeee"}),stroke:new Rn({color:"#eeeeee",width:1})});this.queryParams={onlyField:"OBJECTID"},this._source.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this._source.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this._source.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)})),this.layer=new af({zIndex:r.zIndex,source:this._source,style:t=>(r.featureStyle&&r.featureStyle.forEach((e=>{if(t.get(e.propertiesName)===e.propertiesValue)return o.getFill().setColor(e.fillColor),o.getStroke().setColor(e.strokeColor),void o.getStroke().setWidth(e.strokeWidth)})),o)}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype)}appendTo(t){t.addLayer(this.layer),this.isAdded=!0}},TifLayer:class extends wU{constructor(t,e){super(t,e),this.layertype="GeoTIFFLayer",this.layerSource=new GR({sources:[{url:this.option.url}]}),this.layer=new qp({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this.layerSource.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this.layerSource.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)}))}padLeft(t,e,r){let n=t.toString(r||10);return(new Array(e).join("0")+n).slice(-e)}},TileTencentLayer:rD,TileXyzLayer:eD,WfsLayer:class extends vAt{constructor(t,r){super(t,r),e(this,"geoserverData"),e(this,"queryParams"),e(this,"defaultExtent"),e(this,"isLoading"),this.layertype="WfsLayer",this.option.url,this.layer.set("layerid",t),this.queryParams={service:"WFS",request:"GetFeature",version:"1.0.0",outputFormat:"application/json",maxFeatures:"1000",typeName:"mars:hfjy",bbox:"",filter:"",queryField:"",querykeyword:"",autoShowFeature:!1},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t){try{this.isLoading=!0;let e,r=this,n=this.option.url,i=Object.assign({},this.queryParams,t);if(i.feature){let t=i.feature.getGeometry(),e=(t.getType(),(new Df).writeGeometryObject(t,{featureProjection:"EPSG:3857",dataProjection:"EPSG:4326"}).coordinates[0].map((function(t){return t.join(",")})).join(" ")),r="";""!==i.querykeyword?r=` \n <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">\n <PropertyName>${i.queryField}</PropertyName>\n <Literal>*${i.querykeyword}*</Literal>\n </PropertyIsLike>`:(delete i.queryField,delete i.querykeyword),i.filter=`<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">\n <And> \n ${r}\n <Intersects>\n <PropertyName>the_geom</PropertyName>\n <gml:Polygon>\n <gml:outerBoundaryIs>\n <gml:LinearRing>\n <gml:coordinates>${e}</gml:coordinates>\n </gml:LinearRing>\n </gml:outerBoundaryIs>\n </gml:Polygon>\n </Intersects>\n </And>\n </Filter>`,delete i.feature,delete i.extent,delete i.extentWkid}else i.extent?("4326"===i.extentWkid&&(i.extent=gr(i.extent,"EPSG:4326","EPSG:3857")),i.bbox=i.extent.join(",")+",EPSG:3857",delete i.extent,delete i.extentWkid,delete i.filter):(delete i.filter,delete i.extent,delete i.extentWkid);""===i.bbox&&this.defaultExtent&&(i.bbox=this.defaultExtent.join(",")+",EPSG:3857"),""!==i.filter&&delete i.bbox,e=Object.assign({},i);let o=!1;fetch(`${n}?${new URLSearchParams(e)}`).then((t=>t.json())).then((t=>{const e=bO.formatJsonTo3857(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(i.onlyField)===e.get(i.onlyField)}))||t.push(e)})),r.addFeatures("wfsFeature",t),r.trigger(Em.onFeaturesLoad,e)}})).catch((t=>{o||(o=!0)})).finally((()=>{this.isLoading=!1}))}catch(TX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},WmsLayer:cut,WmtsLayer:class extends wU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.option=Object.assign({},{opacity:.7,attributions:"",layer:"",matrixSet:"GoogleMapsCompatible",format:"image/png"},e);const r=ir("EPSG:3857"),n=r.getExtent(),i=$t(n)/256,o=new Array(19),s=new Array(19);for(let a=0;a<19;++a)o[a]=i/Math.pow(2,a),s[a]=a;this.layerSource=new AU({attributions:this.option.attributions,url:this.option.url,layer:this.option.layer,matrixSet:this.option.matrixSet,format:this.option.format,projection:r,tileGrid:new uU({origin:Zt(n),resolutions:o,matrixIds:s}),style:"default",wrapX:!0}),this.layer=new qf({zIndex:this.option.zIndex,opacity:this.option.opacity,source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}},XWebGLPointsLayer:class extends Im{constructor(t,e){super(t,e),this.layertype="XWebGLPointsLayer",this._source=new pa({wrapX:!1}),this.Layer=new Hp({source:this._source,style:{symbol:{symbolType:"circle",size:["interpolate",["exponential",2.5],["zoom"],2,1,12,8,16,12],color:"#ffed02",offset:[0,0],opacity:.95}},disableHitDetection:!1,colorCallback:function(t,e,r){},attributes:[{name:"color",callback:function(t){}},{name:"size",callback:function(t){}},{name:"GraphicColor",callback:function(t){}}]}),this.Layer.on(Em.onClick,(t=>{t.feature&&this.trigger(Em.onClick,t.feature.getProperties())}))}appendTo(t){var e;this._map=t,null==(e=this._map)||e.addLayer(this.Layer)}addGeoJson(t,e){let r=this.formatJsonTo3857(e);this.addFeatures(t,r)}addFeatures(t,e){var r;let n=null==(r=this._map)?void 0:r.getView().getZoom();e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector);let r=Zm.getFeaturesDefaultStyle(e,n,!1);e.setStyle(r)})),this._source.addFeatures(e)}},imageLayer:ND,kmlLayer:class extends DO{constructor(t,e){super(t,e),this.option={},Object.assign(this.option,e),this.layertype="KmlLayer",this._source=new pa({url:e.url,format:new sAt({extractStyles:!1})}),this.layer=new ta({source:this._source,zIndex:e.zIndex}),this.layer.set("layerid",t),this.layer.on(Em.onClick,(t=>{t.feature&&this.trigger(Em.onClick,t.feature.getProperties())}))}}},Symbol.toStringTag,{value:"Module"})),zAt=Object.freeze(Object.defineProperty({__proto__:null,getJSON:function(t){const e=new XMLHttpRequest;return e.open("get",t,!1),e.setRequestHeader("content-type","application/json"),e.send(),JSON.parse(e.response)}},Symbol.toStringTag,{value:"Module"}));class VAt{constructor(t){e(this,"option"),this.option={key:"50da1a3686015849769f4a414bfdfb8f"},this.option=Object.assign({},this.option,t)}}const KAt=Object.freeze(Object.defineProperty({__proto__:null,GaodePOI:class extends VAt{constructor(t){super(t)}query(t){let e=new LO,r={serverUrl:"",queryType:1,keywords:"",location:"",radius:"3000",city:"西安市",city_limit:!0,polygon:"",extensions:"base",offset:20,page:1,success:null,error:null};r=Object.assign({},r,t);let n=[{type:"周边搜索",url:r.serverUrl+"/v3/place/around",parameters:{key:this.option.key,keywords:r.keywords,location:r.location,radius:r.radius,offset:r.offset,page:r.page}},{type:"关键字搜索",url:r.serverUrl+"/v3/place/text",parameters:{key:this.option.key,keywords:r.keywords,city:t.city,city_limit:t.city_limit,offset:r.offset,page:r.page}},{type:"多边形区域搜索",url:r.serverUrl+"/v3/place/polygon",parameters:{key:this.option.key,keywords:t.keywords,polygon:t.polygon,offset:r.offset,page:r.page}}];r.keywords=r.keywords.replace("","|"),TO(n[r.queryType].url+BO(n[r.queryType].parameters)).then((function(r){r.pois.forEach((t=>{let r=t.location.split(","),n=e.gcj02ToWgs84(parseFloat(r[1]),parseFloat(r[0]));t.lnglat=[n.lontitude,n.latitude]})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}queryUrl(){}},GaodeRoute:class extends VAt{constructor(t){super(t)}query(t){let e=new LO,r=[{type:"驾车",url:t.serverUrl+"/v3/direction/driving"},{type:"步行",url:t.serverUrl+"/v3/direction/walking"},{type:"公交",url:t.serverUrl+"/v3/direction/transit/integrated"}];t.params.key=this.option.key,TO(r[t.queryType].url+BO(t.params)).then((function(r){r.route.paths.forEach((t=>{t.points=[],t.steps.forEach((r=>{r.polyline.split(";").forEach((r=>{let n=r.split(","),i=e.gcj02ToWgs84(parseFloat(n[1]),parseFloat(n[0]));t.points.push([i.lontitude,i.latitude])}))}))})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}}},Symbol.toStringTag,{value:"Module"}));function qAt(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function WAt(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let a=0;a<o;++a)for(let e=0;e<r;++e)t[r*a+e]=s[(r-e-1)*o+a]}class XAt{async decode(t,e){const r=await this.decodeBlock(e),n=t.Predictor||1;if(1!==n){const e=!t.StripOffsets;return function(t,e,r,n,i,o){if(!e||1===e)return t;for(let l=0;l<i.length;++l){if(i[l]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[l]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let l=0;l<n&&!(l*a*r*s>=t.byteLength);++l){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,l*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,l*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,l*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}qAt(n,a)}else 3===e&&(n=new Uint8Array(t,l*a*r*s,a*r*s),WAt(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}const YAt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{decodeBlock(t){return t}}},Symbol.toStringTag,{value:"Module"})),ZAt=9,JAt=257;function $At(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}const tft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{decodeBlock(t){return function(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let p=0;p<=257;p++)e[p]=4096,r[p]=p;let n=258,i=ZAt,o=0;function s(){n=258,i=ZAt}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const l=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return JAt;let u=t[i]&2**(8-n)-1;u<<=r-o;let h=u;if(i+1<t.length){let e=t[i+1]>>>a;e<<=Math.max(0,r-l),h+=e}if(s>8&&i+2<t.length){const n=8*(i+3)-(e+r);h+=t[i+2]>>>n}return h}(t,o,i);return o+=i,e}function l(t,i){return r[n]=i,e[n]=t,n++,n-1}function u(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const h=[];s();const c=new Uint8Array(t);let A,f=a(c);for(;f!==JAt;){if(256===f){for(s(),f=a(c);256===f;)f=a(c);if(f===JAt)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);$At(h,u(f)),A=f}else if(f<n){const t=u(f);$At(h,t),l(A,t[t.length-1]),A=f}else{const t=u(A);if(!t)throw new Error(`Bogus entry. Not in dictionary, ${A} / ${n}, position: ${o}`);$At(h,t),h.push(t[t.length-1]),l(A,t[t.length-1]),A=f}n+1>=2**i&&(12===i?A=void 0:i++),f=a(c)}return new Uint8Array(h)}(t).buffer}}},Symbol.toStringTag,{value:"Module"})),eft=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),rft=4017,nft=799,ift=3406,oft=2276,sft=1567,aft=3784,lft=5793,uft=2896;function hft(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<t[a];i++){for(s=n.pop(),s.children[s.index]=e[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function cft(t,e,r,n,i,o,s,a,l){const{mcusPerLine:u,progressive:h}=r,c=e;let A=e,f=0,p=0;function d(){if(p>0)return p--,f>>p&1;if(f=t[A++],255===f){const e=t[A++];if(e)throw new Error(`unexpected marker: ${(f<<8|e).toString(16)}`)}return p=7,f>>>7}function g(t){let e,r=t;for(;null!==(e=d());){if(r=r[e],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(t){let e=t,r=0;for(;e>0;){const t=d();if(null===t)return;r=r<<1|t,--e}return r}function m(t){const e=y(t);return e>=1<<t-1?e:e+(-1<<t)+1}let v,_=0,w=0;function b(t,e,r,n,i){const o=r%u,s=(r/u|0)*t.v+n,a=o*t.h+i;e(t,t.blocks[s][a])}function x(t,e,r){const n=r/t.blocksPerLine|0,i=r%t.blocksPerLine;e(t,t.blocks[n][i])}const E=n.length;let C,S,B,I,T,P;P=h?0===o?0===a?function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r)<<l;t.pred+=n,e[0]=t.pred}:function(t,e){e[0]|=d()<<l}:0===a?function(t,e){if(_>0)return void _--;let r=o;const n=s;for(;r<=n;){const n=g(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){_=y(o)+(1<<o)-1;break}r+=16}else r+=o,e[eft[r]]=m(i)*(1<<l),r++}}:function(t,e){let r=o;const n=s;let i=0;for(;r<=n;){const n=eft[r],o=e[n]<0?-1:1;switch(w){case 0:{const e=g(t.huffmanTableAC),r=15&e;if(i=e>>4,0===r)i<15?(_=y(i)+(1<<i),w=4):(i=16,w=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=m(r),w=i?2:3}continue}case 1:case 2:e[n]?e[n]+=(d()<<l)*o:(i--,0===i&&(w=2===w?3:0));break;case 3:e[n]?e[n]+=(d()<<l)*o:(e[n]=v<<l,w=0);break;case 4:e[n]&&(e[n]+=(d()<<l)*o)}r++}4===w&&(_--,0===_&&(w=0))}:function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r);t.pred+=n,e[0]=t.pred;let i=1;for(;i<64;){const r=g(t.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else i+=o,e[eft[i]]=m(n),i++}};let F,L,M=0;L=1===E?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;const O=i||L;for(;M<L;){for(S=0;S<E;S++)n[S].pred=0;if(_=0,1===E)for(C=n[0],T=0;T<O;T++)x(C,P,M),M++;else for(T=0;T<O;T++){for(S=0;S<E;S++){C=n[S];const{h:t,v:e}=C;for(B=0;B<e;B++)for(I=0;I<t;I++)b(C,P,M,B,I)}if(M++,M===L)break}if(p=0,F=t[A]<<8|t[A+1],F<65280)throw new Error("marker was not found");if(!(F>=65488&&F<=65495))break;A+=2}return A-c}function Aft(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(t,r,n){const i=e.quantizationTable;let o,s,a,l,u,h,c,A,f;const p=n;let d;for(d=0;d<64;d++)p[d]=t[d]*i[d];for(d=0;d<8;++d){const t=8*d;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=lft*p[0+t]+128>>8,s=lft*p[4+t]+128>>8,a=p[2+t],l=p[6+t],u=uft*(p[1+t]-p[7+t])+128>>8,A=uft*(p[1+t]+p[7+t])+128>>8,h=p[3+t]<<4,c=p[5+t]<<4,f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*aft+l*sft+128>>8,a=a*sft-l*aft+128>>8,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*oft+A*ift+2048>>12,u=u*ift-A*oft+2048>>12,A=f,f=h*nft+c*rft+2048>>12,h=h*rft-c*nft+2048>>12,c=f,p[0+t]=o+A,p[7+t]=o-A,p[1+t]=s+c,p[6+t]=s-c,p[2+t]=a+h,p[5+t]=a-h,p[3+t]=l+u,p[4+t]=l-u):(f=lft*p[0+t]+512>>10,p[0+t]=f,p[1+t]=f,p[2+t]=f,p[3+t]=f,p[4+t]=f,p[5+t]=f,p[6+t]=f,p[7+t]=f)}for(d=0;d<8;++d){const t=d;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=lft*p[0+t]+2048>>12,s=lft*p[32+t]+2048>>12,a=p[16+t],l=p[48+t],u=uft*(p[8+t]-p[56+t])+2048>>12,A=uft*(p[8+t]+p[56+t])+2048>>12,h=p[24+t],c=p[40+t],f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*aft+l*sft+2048>>12,a=a*sft-l*aft+2048>>12,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*oft+A*ift+2048>>12,u=u*ift-A*oft+2048>>12,A=f,f=h*nft+c*rft+2048>>12,h=h*rft-c*nft+2048>>12,c=f,p[0+t]=o+A,p[56+t]=o-A,p[8+t]=s+c,p[48+t]=s-c,p[16+t]=a+h,p[40+t]=a-h,p[24+t]=l+u,p[32+t]=l-u):(f=lft*n[d+0]+8192>>14,p[0+t]=f,p[8+t]=f,p[16+t]=f,p[24+t]=f,p[32+t]=f,p[40+t]=f,p[48+t]=f,p[56+t]=f)}for(d=0;d<64;++d){const t=128+(p[d]+8>>4);r[d]=t<0?0:t>255?255:t}}for(let u=0;u<i;u++){const t=u<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let i=0;i<n;i++){l(e.blocks[u][i],a,s);let n=0;const o=i<<3;for(let e=0;e<8;e++){const i=r[t+e];for(let t=0;t<8;t++)i[o+t]=a[n++]}}}return r}class fft{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(t){let e=0;function r(){const r=t[e]<<8|t[e+1];return e+=2,r}function n(){const n=r(),i=t.subarray(e,e+n-2);return e+=i.length,i}function i(t){let e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(e=t.components[r],n<e.h&&(n=e.h),i<e.v&&(i=e.v));const o=Math.ceil(t.samplesPerLine/8/n),s=Math.ceil(t.scanLines/8/i);for(r in t.components)if(t.components.hasOwnProperty(r)){e=t.components[r];const a=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/n),l=Math.ceil(Math.ceil(t.scanLines/8)*e.v/i),u=o*e.h,h=s*e.v,c=[];for(let t=0;t<h;t++){const t=[];for(let e=0;e<u;e++)t.push(new Int32Array(64));c.push(t)}e.blocksPerLine=a,e.blocksPerColumn=l,e.blocks=c}t.maxH=n,t.maxV=i,t.mcusPerLine=o,t.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const t=n();65504===o&&74===t[0]&&70===t[1]&&73===t[2]&&70===t[3]&&0===t[4]&&(this.jfif={version:{major:t[5],minor:t[6]},densityUnits:t[7],xDensity:t[8]<<8|t[9],yDensity:t[10]<<8|t[11],thumbWidth:t[12],thumbHeight:t[13],thumbData:t.subarray(14,14+3*t[12]*t[13])}),65518===o&&65===t[0]&&100===t[1]&&111===t[2]&&98===t[3]&&101===t[4]&&0===t[5]&&(this.adobe={version:t[6],flags0:t[7]<<8|t[8],flags1:t[9]<<8|t[10],transformCode:t[11]});break}case 65499:{const n=r()+e-2;for(;e<n;){const n=t[e++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++)i[eft[r]]=t[e++];else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let t=0;t<64;t++)i[eft[t]]=r()}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r<s;r++){a=t[e];const r=t[e+1]>>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=t[e++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,e++)i[r]=t[e],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,e++)s[r]=t[e];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=hft(i,s):this.huffmanTablesAC[15&n]=hft(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[t[e++]],n=t[e++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],l=t[e++],u=cft(t,e,o,i,this.resetInterval,s,a,l>>4,15&l);e+=u;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length;for(let u=0;u<this.frames.length;u++){const t=this.frames[u].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const e=t[0],{components:r,componentsOrder:n}=e,i=[],o=e.samplesPerLine,s=e.scanLines;for(let u=0;u<n.length;u++){const t=r[n[u]];i.push({lines:Aft(0,t),scaleX:t.h/e.maxH,scaleY:t.v/e.maxV})}const a=new Uint8Array(o*s*i.length);let l=0;for(let u=0;u<s;++u)for(let t=0;t<o;++t)for(let e=0;e<i.length;++e){const r=i[e];a[l]=r.lines[0|u*r.scaleY][0|t*r.scaleX],++l}return a}}const pft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{constructor(t){super(),this.reader=new fft,t.JPEGTables&&this.reader.parse(t.JPEGTables)}decodeBlock(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}},Symbol.toStringTag,{value:"Module"}));
|
|
469
|
+
*/Mlt.URL=Mlt.URL||Mlt.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var klt=Mlt.Blob,Nlt=URL.createObjectURL,Rlt=URL.revokeObjectURL,Ult=Mlt.Symbol&&Mlt.Symbol.toStringTag,Dlt=!1,Qlt=!1,Glt=!!Mlt.ArrayBuffer,jlt=Olt&&Olt.prototype.append&&Olt.prototype.getBlob;try{Dlt=2===new Blob(["ä"]).size,Qlt=2===new Blob([new Uint8Array([1,2])]).size}catch(TX){}function Hlt(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function zlt(t,e){e=e||{};var r=new Olt;return Hlt(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function Vlt(t,e){return new klt(Hlt(t),e||{})}if(Mlt.Blob&&(zlt.prototype=Blob.prototype,Vlt.prototype=Blob.prototype),Ult)try{File.prototype[Ult]="File",Blob.prototype[Ult]="Blob",FileReader.prototype[Ult]="FileReader"}catch(TX){}function Klt(){var t=!!Mlt.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,e=Mlt.XMLHttpRequest&&Mlt.XMLHttpRequest.prototype.send;t&&e&&(XMLHttpRequest.prototype.send=function(t){t instanceof Blob?(this.setRequestHeader("Content-Type",t.type),e.call(this,t)):e.call(this,t)});try{new File([],"")}catch(n){try{var r=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();Mlt.File=r}catch(i){r=function(t,e,r){var n=new Blob(t,r),i=r&&void 0!==r.lastModified?new Date(r.lastModified):new Date;return n.name=e,n.lastModifiedDate=i,n.lastModified=+i,n.toString=function(){return"[object File]"},Ult&&(n[Ult]="File"),n},Mlt.File=r}}}Dlt?(Klt(),Mlt.Blob=Qlt?Mlt.Blob:Vlt):jlt?(Klt(),Mlt.Blob=zlt):function(){function t(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}function e(t){var e,r,n,i,o,s;for(e="",n=t.length,r=0;r<n;)switch((i=t[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=String.fromCharCode(i);break;case 12:case 13:o=t[r++],e+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[r++],s=t[r++],e+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&s)<<0)}return e}function r(t){for(var e=new Array(t.byteLength),r=new Uint8Array(t),n=e.length;n--;)e[n]=r[n];return e}function n(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[],n=0;n<t.length;n+=3){var i=t[n],o=n+1<t.length,s=o?t[n+1]:0,a=n+2<t.length,l=a?t[n+2]:0,u=i>>2,h=(3&i)<<4|s>>4,c=(15&s)<<2|l>>6,A=63&l;a||(A=64,o||(c=64)),r.push(e[u],e[h],e[c],e[A])}return r.join("")}var i=Object.create||function(t){function e(){}return e.prototype=t,new e};if(Glt)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function a(e,n){for(var i=0,o=(e=e||[]).length;i<o;i++){var l=e[i];l instanceof a?e[i]=l._buffer:"string"==typeof l?e[i]=t(l):Glt&&(ArrayBuffer.prototype.isPrototypeOf(l)||s(l))?e[i]=r(l):Glt&&(u=l)&&DataView.prototype.isPrototypeOf(u)?e[i]=r(l.buffer):e[i]=t(String(l))}var u;this._buffer=[].concat.apply([],e),this.size=this._buffer.length,this.type=n&&n.type||""}function l(t,e,r){r=r||{};var n=a.call(this,t,r)||this;return n.name=e,n.lastModifiedDate=r.lastModified?new Date(r.lastModified):new Date,n.lastModified=+n.lastModifiedDate,n}if(a.prototype.slice=function(t,e,r){return new a([this._buffer.slice(t||0,e||this._buffer.length)],{type:r})},a.prototype.toString=function(){return"[object Blob]"},l.prototype=i(a.prototype),l.prototype.constructor=l,Object.setPrototypeOf)Object.setPrototypeOf(l,a);else try{l.__proto__=a}catch(TX){}function u(){if(!(this instanceof u))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var t=document.createDocumentFragment();this.addEventListener=t.addEventListener,this.dispatchEvent=function(e){var r=this["on"+e.type];"function"==typeof r&&r(e),t.dispatchEvent(e)},this.removeEventListener=t.removeEventListener}function h(t,e,r){if(!(e instanceof a))throw new TypeError("Failed to execute '"+r+"' on 'FileReader': parameter 1 is not of type 'Blob'.");t.result="",setTimeout((function(){this.readyState=u.LOADING,t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend"))}))}l.prototype.toString=function(){return"[object File]"},u.EMPTY=0,u.LOADING=1,u.DONE=2,u.prototype.error=null,u.prototype.onabort=null,u.prototype.onerror=null,u.prototype.onload=null,u.prototype.onloadend=null,u.prototype.onloadstart=null,u.prototype.onprogress=null,u.prototype.readAsDataURL=function(t){h(this,t,"readAsDataURL"),this.result="data:"+t.type+";base64,"+n(t._buffer)},u.prototype.readAsText=function(t){h(this,t,"readAsText"),this.result=e(t._buffer)},u.prototype.readAsArrayBuffer=function(t){h(this,t,"readAsText"),this.result=t._buffer.slice()},u.prototype.abort=function(){},URL.createObjectURL=function(t){return t instanceof a?"data:"+t.type+";base64,"+n(t._buffer):Nlt.call(URL,t)},URL.revokeObjectURL=function(t){Rlt&&Rlt.call(URL,t)};var c=Mlt.XMLHttpRequest&&Mlt.XMLHttpRequest.prototype.send;c&&(XMLHttpRequest.prototype.send=function(t){t instanceof a?(this.setRequestHeader("Content-Type",t.type),c.call(this,e(t._buffer))):c.call(this,t)}),Mlt.FileReader=u,Mlt.File=l,Mlt.Blob=a}();var qlt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===Mlt.btoa&&(Mlt.btoa=function(t){var e,r,n,i,o,s=0,a=0,l="",u=[];if(!t)return t;do{e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,r=o>>12&63,n=o>>6&63,i=63&o,u[a++]=qlt.charAt(e)+qlt.charAt(r)+qlt.charAt(n)+qlt.charAt(i)}while(s<t.length);l=u.join("");var h=t.length%3;return(h?l.slice(0,h-3):l)+"===".slice(h||3)}),void 0===Mlt.atob&&(Mlt.atob=function(t){var e,r,n,i,o,s,a=0,l=0,u=[];if(!t)return t;t+="";do{e=(s=qlt.indexOf(t.charAt(a++))<<18|qlt.indexOf(t.charAt(a++))<<12|(i=qlt.indexOf(t.charAt(a++)))<<6|(o=qlt.indexOf(t.charAt(a++))))>>16&255,r=s>>8&255,n=255&s,u[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,r):String.fromCharCode(e,r,n)}while(a<t.length);return u.join("")});class Wlt extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.setAttribute("id","mouse-position"),n.innerHTML="",n.style.float="right",n.style.left=" 0px",n.style.right="0px",n.style.bottom="0px",n.style.marginRight="60px";let i=document.createElement("div");i.setAttribute("id","locationbar"),i.style.position="absolute",i.style.zIndex="991",i.style.padding=" 3px 10px",i.style.fontSize=" 13px",i.style.color="#e9e9e9",i.style.textShadow="2px 2px 2px #000",i.style.backgroundColor="rgba(0,0,0,.4)",i.style.minHeight="26px",i.style.left=" 0px",i.style.right="0px",i.style.bottom="0px",i.appendChild(n),super({element:i,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}updateMousePosition(t){this._mouseposition.innerHTML=t}}class Xlt extends Bl{constructor(t,r,n,i){const o=t||{};let s=n.find((t=>t.name===r));const a=new Image;a.src=s.icon,a.className="mirage-mapswitch-image";const l=document.createElement("div");l.className="mirage-mapswitch-button-itemLabel",l.innerHTML=r;const u=document.createElement("div");u.className="mirage-mapswitch-button mirage-mapswitch-toolbar-button",u.appendChild(a),u.appendChild(l);const h=document.createElement("div");h.className="mirage-mapswitch-box";const c=document.createElement("div");c.className="mirage-mapswitch-baseLayerPicker-dropDown",c.style.maxHeight="300px",n.forEach((t=>{const e=new Image;e.src=t.icon,e.className="mirage-mapswitch-baseLayerPicker-itemIcon";const r=document.createElement("div");r.className="mirage-mapswitch-baseLayerPicker-itemLabel",r.innerHTML=t.name;const n=document.createElement("div");n.className="mirage-mapswitch-baseLayerPicker-item mirage-mapswitch-baseLayerPicker-selectedItem",n.appendChild(e),n.appendChild(r),n.addEventListener("click",(t=>{this._isshow=!1,c.className="mirage-mapswitch-baseLayerPicker-dropDown",a.src=t.currentTarget.children[0].src,l.innerHTML=t.currentTarget.innerText,i(t.currentTarget.innerText)}),!1),c.appendChild(n)})),h.appendChild(u),h.appendChild(c),super({element:h,target:o.target}),e(this,"_isshow"),e(this,"baseLayerList"),e(this,"mianImage"),e(this,"mianLabel"),this.mianImage=a,this.mianLabel=l,this.baseLayerList=n,this._isshow=!1,u.addEventListener("click",this.showSwitch.bind(this),!1)}changeBaseLayer(t){this.baseLayerList.forEach((e=>{if(e.name===t)return this.mianImage.src=e.icon,void(this.mianLabel.innerHTML=e.name)}))}showSwitch(t){this._isshow=!this._isshow;let e=document.getElementsByClassName("mirage-mapswitch-baseLayerPicker-dropDown");this._isshow?e[0].className="mirage-mapswitch-baseLayerPicker-dropDown mirage-mapswitch-baseLayerPicker-dropDown-visible":e[0].className="mirage-mapswitch-baseLayerPicker-dropDown"}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}var Ylt=function(t){t=t||{};var e=document.createElement("button"),r=document.createElement("div");r.className=(t.className||"ol-swipe")+" ol-unselectable ol-control",r.appendChild(e),r.addEventListener("mousedown",this.move.bind(this)),r.addEventListener("touchstart",this.move.bind(this)),Bl.call(this,{element:r}),this.precomposeRight_=this.precomposeRight.bind(this),this.precomposeLeft_=this.precomposeLeft.bind(this),this.postcompose_=this.postcompose.bind(this),this.layers=[],t.layers&&this.addLayer(t.layers,!1),t.rightLayers&&this.addLayer(t.rightLayers,!0),this.on("propertychange",function(t){if(this.getMap())try{this.getMap().renderSync()}catch(e){}"horizontal"===this.get("orientation")?(this.element.style.top=100*this.get("position")+"%",this.element.style.left=""):("vertical"!==this.get("orientation")&&this.set("orientation","vertical"),this.element.style.left=100*this.get("position")+"%",this.element.style.top=""),"orientation"===t.key&&(this.element.classList.remove("horizontal","vertical"),this.element.classList.add(this.get("orientation"))),this.isMoving||this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}))}.bind(this)),this.set("position",t.position||.5),this.set("orientation",t.orientation||"vertical")};qm(Ylt,Bl),Ylt.prototype.setMap=function(t){var e,r;if(this.getMap()){for(e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.un(["precompose","prerender"],this.precomposeRight_):r.layer.un(["precompose","prerender"],this.precomposeLeft_),r.layer.un(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(TX){}}if(Bl.prototype.setMap.call(this,t),t){for(this._listener=[],e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.on(["precompose","prerender"],this.precomposeRight_):r.layer.on(["precompose","prerender"],this.precomposeLeft_),r.layer.on(["postcompose","postrender"],this.postcompose_);try{t.renderSync()}catch(TX){}}},Ylt.prototype.isLayer_=function(t){for(var e=0;e<this.layers.length;e++)if(this.layers[e].layer===t)return e;return-1},Ylt.prototype.addLayer=function(t,e){t instanceof Array||(t=[t]);for(var r=0;r<t.length;r++){var n=t[r];if(this.isLayer_(n)<0&&(this.layers.push({layer:n,right:e}),this.getMap())){e?n.on(["precompose","prerender"],this.precomposeRight_):n.on(["precompose","prerender"],this.precomposeLeft_),n.on(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(TX){}}}},Ylt.prototype.removeLayers=function(){var t=[];this.layers.forEach((function(e){t.push(e.layer)})),this.removeLayer(t)},Ylt.prototype.removeLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++){var r=this.isLayer_(t[e]);r>=0&&this.getMap()&&(this.layers[r].right?t[e].un(["precompose","prerender"],this.precomposeRight_):t[e].un(["precompose","prerender"],this.precomposeLeft_),t[e].un(["postcompose","postrender"],this.postcompose_),this.layers.splice(r,1))}if(this.getMap())try{this.getMap().renderSync()}catch(TX){}},Ylt.prototype.getRectangle=function(){var t;return"vertical"===this.get("orientation")?[0,0,(t=this.getMap().getSize())[0]*this.get("position"),t[1]]:[0,0,(t=this.getMap().getSize())[0],t[1]*this.get("position")]},Ylt.prototype.move=function(t){var e,r=this;switch(this._movefn||(this._movefn=this.move.bind(this)),t.type){case"touchcancel":case"touchend":case"mouseup":r.isMoving=!1,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.removeEventListener(t,r._movefn)})),this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}));break;case"mousedown":case"touchstart":r.isMoving=!0,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.addEventListener(t,r._movefn)}));case"mousemove":case"touchmove":if(r.isMoving)if("vertical"===r.get("orientation")){var n=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX;if(!n)break;n-=r.getMap().getTargetElement().getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft;var i=(e=r.getMap().getSize()[0])-Math.min(Math.max(0,e-n),e);e=i/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[i,r.getMap().getSize()[1]],position:[e,0]})}else{var o=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY;if(!o)break;o-=r.getMap().getTargetElement().getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop;var s=(e=r.getMap().getSize()[1])-Math.min(Math.max(0,e-o),e);e=s/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[r.getMap().getSize()[0],s],position:[0,e]})}}},Ylt.prototype._transformPt=function(t,e){var r=t.inversePixelTransform,n=e[0],i=e[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},Ylt.prototype._drawRect=function(t,e){var r=t.inversePixelTransform;if(r){var n=[[e[0][0],e[0][1]],[e[0][0],e[1][1]],[e[1][0],e[1][1]],[e[1][0],e[0][1]],[e[0][0],e[0][1]]];if(t.context.save(),t.target.getImageRatio){var i=-Math.atan2(t.frameState.pixelToCoordinateTransform[1],t.frameState.pixelToCoordinateTransform[0]);t.context.translate(t.frameState.size[0]/2,t.frameState.size[1]/2),t.context.rotate(i),t.context.translate(-t.frameState.size[0]/2,-t.frameState.size[1]/2)}n.forEach((function(e,n){e=[e[0]*r[0]-e[1]*r[1]+r[4],-e[0]*r[2]+e[1]*r[3]+r[5]],n?t.context.lineTo(e[0],e[1]):t.context.moveTo(e[0],e[1])})),t.context.restore()}else{var o=t.frameState.pixelRatio;t.context.rect(e[0][0]*o,e[0][1]*o,e[1][0]*o,e[1][1]*o)}},Ylt.prototype.precomposeLeft=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(r=Math.round(a*this.get("position")),n=l):(r=a,n=Math.round(l*this.get("position")),o[1]+=l-n),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[1]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),u[1]]:h[1]=[u[0],.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Ylt.prototype.precomposeRight=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(n=l,r=Math.round(a*(1-this.get("position"))),o[0]+=a-r):(r=a,n=Math.round(l*(1-this.get("position")))),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[0]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),0]:h[0]=[0,.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Ylt.prototype.postcompose=function(t){if(t.context instanceof WebGLRenderingContext){if("postrender"===t.type){var e=t.context;e.disable(e.SCISSOR_TEST)}}else t.target.getClassName&&"ol-layer"!==t.target.getClassName()&&t.target.get("declutter")?setTimeout((function(){t.context.restore()}),0):t.context.restore()};class Zlt{constructor(){e(this,"events",new Map)}on(t,e,r){return this.events.has(t)||this.events.set(t,[]),(this.events.get(t)||[]).push({handler:e,once:r}),()=>{this.off(t,e)}}once(t,e){return this.on(t,e,!0)}fire(t,...e){let r=0;for(;r<(this.events.get(t)||[]).length;){const n=this.events.get(t)||[],{handler:i,once:o}=n[r];o&&n.splice(r--,1),r++,i(...e)}}off(t,e){t&&(e?this.events.set(t,(this.events.get(t)||[]).filter((t=>t.handler!==e))):this.events.set(t,[]))}}class Jlt extends Zlt{constructor(){super(),e(this,"_swipe"),this._swipe=new Ylt}show(t,e,r="vertical"){this.fire("show",{swipe:this._swipe,leftlayerID:t,rightlayerID:e}),this._swipe.set("orientation",r)}hide(){this.fire("hide",this._swipe)}}class $lt extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.style.zIndex="999",n.style.width="200px",n.className="huitudiv",n.setAttribute("id","huitutext1"),n.style.position="absolute",n.style.zIndex="991",n.style.padding=" 3px 10px",n.style.fontSize=" 25px",n.style.color="#000",n.style.textShadow="2px 2px 2px #fff",n.style.backgroundColor="rgba(0,0,0,.4)",n.style.minHeight="26px",n.style.right="100px",n.style.bottom="50px",n.innerHTML="",super({element:n,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}getElement(){return this._mouseposition}hide(){this.element.style.display="none"}updateHtml(t){this._mouseposition.innerHTML=t}updateElementStyle(t,e){this._mouseposition.style[t]=e}}const tut=Object.freeze(Object.defineProperty({__proto__:null,Locationbar:Wlt,baseLayerSwitch:Xlt,drawTextControl:$lt,swipeControl:Jlt},Symbol.toStringTag,{value:"Module"}));var eut=function(t){t||(t={});var e=this;this.selection_=new V,this.handles_=new V,this.overlayLayer_=new ta({source:new pa({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(t){return e.style[(t.get("handle")||"default")+(t.get("constraint")||"")+(t.get("option")||"")]}}),ou.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.features_=t.features,"function"==typeof t.filter&&(this._filter=t.filter),this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null,this._handleEvent=t.condition||function(){return!0},this.addFn_=t.addCondition||function(){return!1},this.setPointRadius(t.pointRadius),this.set("translateFeature",!1!==t.translateFeature),this.set("translate",!1!==t.translate),this.set("translateBBox",!0===t.translateBBox),this.set("stretch",!1!==t.stretch),this.set("scale",!1!==t.scale),this.set("rotate",!1!==t.rotate),this.set("keepAspectRatio",t.keepAspectRatio||function(t){return t.originalEvent.shiftKey}),this.set("modifyCenter",t.modifyCenter||function(t){return t.originalEvent.metaKey||t.originalEvent.ctrlKey}),this.set("noFlip",t.noFlip||!1),this.set("selection",!1!==t.selection),this.set("hitTolerance",t.hitTolerance||0),this.set("enableRotatedTransform",t.enableRotatedTransform||!1),this.set("keepRectangle",t.keepRectangle||!1),this.on("propertychange",(function(){this.drawSketch_()})),this.setDefaultStyle()};function rut(t,e){var r=(t[0]*e[0]+t[1]*e[1])/(e[0]*e[0]+e[1]*e[1]);return[e[0]*r,e[1]*r]}function nut(t,e){return[e[0]-t[0],e[1]-t[1]]}function iut(t,e){return[t[0]+e[0],t[1]+e[1]]}qm(eut,ou),eut.prototype.Cursors={default:"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"},eut.prototype.setMap=function(t){var e=this.getMap();if(e){var r=e.getTargetElement();e.removeLayer(this.overlayLayer_),this.previousCursor_&&r&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}ou.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),null===t&&this.select(null),null!==t&&(this.isTouch=/touch/.test(t.getViewport().className),this.setDefaultStyle())},eut.prototype.setActive=function(t){this.select(null),this.overlayLayer_.setVisible(t),ou.prototype.setActive.call(this,t)},eut.prototype.setDefaultStyle=function(t){var e=(t=t||{}).pointStroke||new Rn({color:[255,0,0,1],width:1}),r=t.stroke||new Rn({color:[255,0,0,1],width:1,lineDash:[4,4]}),n=t.fill||new Fn({color:[255,0,0,.01]}),i=t.pointFill||new Fn({color:[255,255,255,.8]}),o=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,displacement:this.isTouch?[24,-24]:[12,-12],points:15});o.setDisplacement||(o.getAnchor()[0]=this.isTouch?-10:-5);var s=new Ri({fill:i,stroke:e,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),a=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function l(t,e,r){return[new Vi({image:t,stroke:e,fill:r})]}this.style={default:l(s,r,n),translate:l(s,e,i),rotate:l(o,e,i),rotate0:l(s,e,i),scale:l(s,e,i),scale1:l(s,e,i),scale2:l(s,e,i),scale3:l(s,e,i),scalev:l(a,e,i),scaleh1:l(a,e,i),scalev2:l(a,e,i),scaleh3:l(a,e,i)},this.drawSketch_()},eut.prototype.setStyle=function(t,e){if(e){this.style[t]=e instanceof Array?e:[e];for(var r=0;r<this.style[t].length;r++){var n=this.style[t][r].getImage();n&&("rotate"==t&&(n.getAnchor()[0]=-5),this.isTouch&&n.setScale(1.8));var i=this.style[t][r].getText();i&&("rotate"==t&&i.setOffsetX(this.isTouch?14:7),this.isTouch&&i.setScale(1.8))}this.drawSketch_()}},eut.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t,(function(t,r){var n=!1;if(!r){if(t===e.bbox_)return!!e.get("translateBBox")&&{feature:t,handle:"translate",constraint:"",option:""};if(e.handles_.forEach((function(e){e===t&&(n=!0)})),n)return{feature:t,handle:t.get("handle"),constraint:t.get("constraint"),option:t.get("option")}}if(!e.get("selection"))return e.selection_.getArray().some((function(e){return t===e}))?{feature:t}:null;if(e._filter)return e._filter(t,r)?{feature:t}:null;if(e.layers_){for(var i=0;i<e.layers_.length;i++)if(e.layers_[i]===r)return{feature:t};return null}return e.features_?(e.features_.forEach((function(e){e===t&&(n=!0)})),n?{feature:t}:null):{feature:t}}),{hitTolerance:this.get("hitTolerance")})||{}},eut.prototype.getGeometryRotateToZero_=function(t,e){var r=t.getGeometry(),n=this.getMap().getView().getRotation();if(0===n||!this.get("enableRotatedTransform"))return e?r.clone():r;var i=r.clone();return i.rotate(-1*n,this.getMap().getView().getCenter()),i},eut.prototype._isRectangle=function(t){return!(!this.get("keepRectangle")||"Polygon"!==t.getType())&&5===t.getCoordinates()[0].length},eut.prototype.drawSketch_=function(t){var e,r,n,i=this.selection_.item(0)&&this._isRectangle(this.selection_.item(0).getGeometry());if(this.overlayLayer_.getSource().clear(),this.selection_.getLength()){var o,s=this.getMap().getView().getRotation(),a=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();i&&(o=this.getGeometryRotateToZero_(this.selection_.item(0)).getCoordinates()[0].slice(0,4)).unshift(o[3]),a=Ct(a,0),this.selection_.forEach(function(t){var e=this.getGeometryRotateToZero_(t).getExtent();Rt(a,e)}.bind(this));var l=1===this.selection_.getLength()?this._pointRadius(this.selection_.item(0)):0;if(!l||l instanceof Array||(l=[l,l]),!0===t)this.ispt_||(this.overlayLayer_.getSource().addFeature(new X({geometry:new on(this.center_),handle:"rotate0"})),n=En(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n),this.overlayLayer_.getSource().addFeature(r));else{if(this.ispt_){var u=this.getMap().getPixelFromCoordinate([a[0],a[1]]);if(u){var h=l&&l[0]||10,c=l&&l[1]||10;a=Et([this.getMap().getCoordinateFromPixel([u[0]-h,u[1]-c]),this.getMap().getCoordinateFromPixel([u[0]+h,u[1]+c])])}}n=i?new xn([o]):En(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n);var A=[],f=n.getCoordinates()[0];if(!this.ispt_||l){if(A.push(r),!this.iscircle_&&!this.ispt_&&this.get("stretch")&&this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on([(f[e][0]+f[e+1][0])/2,(f[e][1]+f[e+1][1])/2]),handle:"scale",constraint:e%2?"h":"v",option:e}),A.push(r);if(this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on(f[e]),handle:"scale",option:e}),A.push(r);this.get("translate")&&!this.get("translateFeature")&&(r=new X({geometry:new on([(f[0][0]+f[2][0])/2,(f[0][1]+f[2][1])/2]),handle:"translate"}),A.push(r))}!this.iscircle_&&this.get("rotate")&&(r=new X({geometry:new on(f[3]),handle:"rotate"}),A.push(r)),this.overlayLayer_.getSource().addFeatures(A)}}},eut.prototype.select=function(t,e){if(!t)return this.selection_.clear(),void this.drawSketch_();if(t.getGeometry&&t.getGeometry()){if(e)this.selection_.push(t);else{var r=this.selection_.getArray().indexOf(t);this.selection_.removeAt(r)}this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:t,features:this.selection_})}},eut.prototype.setSelection=function(t){this.selection_.clear(),t.forEach(function(t){this.selection_.push(t)}.bind(this)),this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",features:this.selection_})},eut.prototype.watchFeatures_=function(){this._featureListeners&&this._featureListeners.forEach((function(t){k(t)})),this._featureListeners=[],this.selection_.forEach(function(t){this._featureListeners.push(t.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))},eut.prototype.handleDownEvent_=function(t){if(this._handleEvent(t,this.selection_)){var e=this.getFeatureAtPixel_(t.pixel),r=e.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(r)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(e.handle="translate"),e.handle){this.mode_=e.handle,this.opt_=e.option,this.constraint_=e.constraint;var n=this.getMap().getView().getRotation();this.coordinate_=t.coordinate,this.pixel_=t.pixel,this.geoms_=[],this.rotatedGeoms_=[];for(var i,o=[1/0,1/0,-1/0,-1/0],s=[1/0,1/0,-1/0,-1/0],a=0;i=this.selection_.item(a);a++)if(this.geoms_.push(i.getGeometry().clone()),o=Rt(o,i.getGeometry().getExtent()),this.get("enableRotatedTransform")&&0!==n){var l=this.getGeometryRotateToZero_(i,!0);this.rotatedGeoms_.push(l),s=Rt(s,l.getExtent())}if(this.extent_=En(o).getCoordinates()[0],this.get("enableRotatedTransform")&&0!==n&&(this.rotatedExtent_=En(s).getCoordinates()[0]),"rotate"===this.mode_){this.center_=this.getCenter()||Vt(o);var u=t.map.getTargetElement();u.style.cursor=this.Cursors.rotate0,this.previousCursor_=u.style.cursor}else this.center_=Vt(o);return this.angle_=Math.atan2(this.center_[1]-t.coordinate[1],this.center_[0]-t.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!0}if(this.get("selection")){if(r){this.addFn_(t)||this.selection_.clear();var h=this.selection_.getArray().indexOf(r);h<0?this.selection_.push(r):this.selection_.removeAt(h)}else this.selection_.clear();return this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:r,features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!1}}},eut.prototype.getFeatures=function(){return this.selection_},eut.prototype.getCenter=function(){return this.get("center")},eut.prototype.setCenter=function(t){return this.set("center",t)},eut.prototype.handleDragEvent_=function(t){if(this._handleEvent(t,this.features_)){var e,r,n,i,o=this.getMap().getView().getRotation(),s=[this.coordinate_[0],this.coordinate_[1]],a=[t.coordinate[0],t.coordinate[1]];switch(this.isUpdating_=!0,this.mode_){case"rotate":var l=Math.atan2(this.center_[1]-a[1],this.center_[0]-a[0]);if(!this.ispt)for(e=0;n=this.selection_.item(e);e++)(i=this.geoms_[e].clone()).rotate(l-this.angle_,this.center_),"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),n.setGeometry(i);this.drawSketch_(!0),this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:l-this.angle_,pixel:t.pixel,coordinate:t.coordinate});break;case"translate":var u=a[0]-s[0],h=a[1]-s[1];for(e=0;n=this.selection_.item(e);e++)n.getGeometry().translate(u,h);this.handles_.forEach((function(t){t.getGeometry().translate(u,h)})),this.coordinate_=t.coordinate,this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[u,h],pixel:t.pixel,coordinate:t.coordinate});break;case"scale":var c=this.center_;if(this.get("modifyCenter")(t)){var A=this.extent_;this.get("enableRotatedTransform")&&0!==o&&(A=this.rotatedExtent_),c=A[(Number(this.opt_)+2)%4]}var f=1==this.geoms_.length&&this._isRectangle(this.geoms_[0]),p=this.constraint_,d=this.opt_,g=this.coordinate_,y=t.coordinate;if(this.get("enableRotatedTransform")&&0!==o){var m=new on(this.coordinate_);m.rotate(-1*o,c),g=m.getCoordinates();var v=new on(t.coordinate);v.rotate(-1*o,c),y=v.getCoordinates()}var _=(y[0]-c[0])/(g[0]-c[0]),w=(y[1]-c[1])/(g[1]-c[1]),b=[y[0]-g[0],y[1]-g[1]];if(this.get("enableRotatedTransform")&&0!==o){var x=new on(c);x.rotate(-1*o,this.getMap().getView().getCenter()),c=x.getCoordinates()}for(this.get("noFlip")&&(_<0&&(_=-_),w<0&&(w=-w)),this.constraint_?"h"==this.constraint_?_=1:w=1:this.get("keepAspectRatio")(t)&&(_=w=Math.min(_,w)),e=0;n=this.selection_.item(e);e++)(i=0!==o&&this.get("enableRotatedTransform")?this.rotatedGeoms_[e].clone():this.geoms_[e].clone()).applyTransform((function(t,e,n){if(n<2)return e;if(f){var o=[[6],[0,8],[2],[4]],s=[t[0],t[1]],a=[t[2],t[3]],l=[t[4],t[5]],u=[t[6],t[7]],h=[t[8],t[9]];if(p){var A=d%2==0?nut(s,a):nut(u,s),g=rut(b,A),m=[...o[d],...o[d+1<o.length?d+1:0]];for(r=0;r<t.length;r+=n)e[r]=m.includes(r)?t[r]+g[0]:t[r],e[r+1]=m.includes(r)?t[r+1]+g[1]:t[r+1]}else{var v,x;switch(d){case 0:v=rut(b=nut(u,y),nut(l,u)),x=rut(b,nut(s,u)),[e[0],e[1]]=iut(s,v),[e[4],e[5]]=iut(l,x),[e[6],e[7]]=iut(u,b),[e[8],e[9]]=iut(h,v);break;case 1:v=rut(b=nut(s,y),nut(u,s)),x=rut(b,nut(a,s)),[e[0],e[1]]=iut(s,b),[e[2],e[3]]=iut(a,v),[e[6],e[7]]=iut(u,x),[e[8],e[9]]=iut(h,b);break;case 2:v=rut(b=nut(a,y),nut(s,a)),x=rut(b,nut(l,a)),[e[0],e[1]]=iut(s,x),[e[2],e[3]]=iut(a,b),[e[4],e[5]]=iut(l,v),[e[8],e[9]]=iut(h,x);break;case 3:v=rut(b=nut(l,y),nut(a,l)),x=rut(b,nut(u,l)),[e[2],e[3]]=iut(a,x),[e[4],e[5]]=iut(l,b),[e[6],e[7]]=iut(u,v)}}}else for(r=0;r<t.length;r+=n)1!=_&&(e[r]=c[0]+(t[r]-c[0])*_),1!=w&&(e[r+1]=c[1]+(t[r+1]-c[1])*w);return"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),e})),this.get("enableRotatedTransform")&&0!==o&&i.rotate(o,this.getMap().getView().getCenter()),n.setGeometry(i);this.drawSketch_(),this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[_,w],pixel:t.pixel,coordinate:t.coordinate})}this.isUpdating_=!1}},eut.prototype.handleMoveEvent_=function(t){if(this._handleEvent(t,this.features_)&&!this.mode_){var e=this.getFeatureAtPixel_(t.pixel),r=t.map.getTargetElement();if(e.feature){var n=e.handle?this.Cursors[(e.handle||"default")+(e.constraint||"")+(e.option||"")]:this.Cursors.select;void 0===this.previousCursor_&&(this.previousCursor_=r.style.cursor),r.style.cursor=n}else void 0!==this.previousCursor_&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}},eut.prototype.handleUpEvent_=function(t){return"rotate"===this.mode_&&(t.map.getTargetElement().style.cursor=this.Cursors.default,this.previousCursor_=void 0),this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_}),this.drawSketch_(),this.mode_=null,!1},eut.prototype.getFeatures=function(){return this.selection_},eut.prototype.setPointRadius=function(t){this._pointRadius="function"==typeof t?t:function(){return t}};class out{constructor(t){e(this,"transformInteraction"),this.transformInteraction=new eut({enableRotatedTransform:!1,hitTolerance:2,translateFeature:!0,scale:!0,rotate:!0,keepAspectRatio:!1,keepRectangle:!1,translate:!0,stretch:!0,pointRadius:function(t){let e=t.get("radius")||10;return[e,e]}}),this.transformInteraction.setActive(!1),this.transformInteraction.on(["select"],(t=>{s&&t.features&&t.features.getLength()&&this.transformInteraction.setCenter(t.features.getArray()[0].getGeometry().getFirstCoordinate())}));let r=0,n=10,i=[1,1],o=[0,0],s=!1;this.transformInteraction.on(["rotatestart","translatestart","scalestart"],(function(t){r=t.feature.get("angle")||0,n=t.feature.get("radius")||10,i=t.feature.get("Scale")||[1,1],o=[0,0]})),this.transformInteraction.on("rotating",(t=>{t.feature.set("angle",r-t.angle),t.feature.dispatchEvent({type:"onRotating",data:r-t.angle})})),this.transformInteraction.on("translating",(t=>{o[0]+=t.delta[0],o[1]+=t.delta[1],t.feature.dispatchEvent({type:"onMoveing",data:Vt(t.features.getArray()[0].getGeometry().getExtent())})})),this.transformInteraction.on("scaling",(t=>{if(1===t.features.getLength()){let e=t.features.item(0);e.set("radius",n*Math.abs(t.scale[0])),e.set("Scale",[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]),t.feature.dispatchEvent({type:"onScaling",data:[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]})}})),this.transformInteraction.on(["rotateend","translateend","scaleend"],(t=>{}))}setHandleStyle(t=!0){if(t){let t=new Ri({fill:new Fn({color:[255,255,255,.01]}),stroke:new Rn({width:1,color:[0,0,0,.01]}),radius:8,points:10});this.transformInteraction.setStyle("rotate",new Vi({text:new Wi({text:"",font:"16px Fontawesome",textAlign:"left",fill:new Fn({color:"red"})}),image:t})),this.transformInteraction.setStyle("rotate0",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})})),this.transformInteraction.setStyle("translate",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})}))}else this.transformInteraction.setDefaultStyle();this.transformInteraction.set("translate",this.transformInteraction.get("translate"))}appendTo(t){t.addInteraction(this.transformInteraction)}setActive(t){this.transformInteraction.setActive(t)}}var sut,aut=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},lut=function(t,e){return t[0]==e[0]&&t[1]==e[1]};!function(){function t(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][0]>e&&t[n-1][0]<e||t[n][0]<e&&t[n-1][0]>e)&&(r=[e,(e-t[n][0])/(t[n-1][0]-t[n][0])*(t[n-1][1]-t[n][1])+t[n][1]],t.splice(n,0,r))}function e(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][1]>e&&t[n-1][1]<e||t[n][1]<e&&t[n-1][1]>e)&&(r=[(e-t[n][1])/(t[n-1][1]-t[n][1])*(t[n-1][0]-t[n][0])+t[n][0],e],t.splice(n,0,r))}sut=function(r,n){var i="Polygon"===n.getType();if(!i&&"MultiPolygon"!==n.getType())return null;var o=n.getCoordinates();return i&&(o=[o]),o.forEach((function(n){n.forEach((function(n){t(n,r[0]),t(n,r[2]),e(n,r[1]),e(n,r[3])}))})),o.forEach((function(t){t.forEach((function(t){t.forEach((function(t){t[0]<r[0]?t[0]=r[0]:t[0]>r[2]&&(t[0]=r[2]),t[1]<r[1]?t[1]=r[1]:t[1]>r[3]&&(t[1]=r[3])}))}))})),i?new xn(o[0]):new ah(o)}}();var uut=function(t,e,r,n){var i=[];!1!==n&&i.push(t);var o=aut(t,e);if(o){var s=Math.round(o/r);if(s>1)for(var a=(e[0]-t[0])/s,l=(e[1]-t[1])/s,u=1;u<s;u++)i.push([t[0]+a*u,t[1]+l*u])}return i.push(e),i};Nn.prototype.sampleAt=function(t){for(var e=this.getCoordinates(),r=[],n=1;n<e.length;n++)r=r.concat(uut(e[n-1],e[n],t,1===n));return new Nn(r)},th.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(uut(e[i-1],e[i],t,1===i));r.push(n)})),new th(r)},xn.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(uut(e[i-1],e[i],t,1===i));r.push(n)})),new xn(r)},ah.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){var n=[];r.push(n),e.forEach((function(e){for(var r=[],i=1;i<e.length;i++)r=r.concat(uut(e[i-1],e[i],t,1===i));n.push(r)}))})),new ah(r)},Zu.prototype.intersection=function(t,e){if(t.sampleAt){var r=Ct(this.getCenter().concat(this.getCenter()),this.getRadius());t=(t=sut(r,t)).simplify(e);var n=this.getCenter(),i=this.getRadius(),o=t.sampleAt(e).getCoordinates();switch(t.getType()){case"Polygon":o=[o];case"MultiPolygon":var s=!1,a=[];return o.forEach((function(t){var e=[];a.push(e),t.forEach((function(t){var r=[];e.push(r),t.forEach((function(t){var e=aut(n,t);e>i?(s=!0,r.push([n[0]+i/e*(t[0]-n[0]),n[1]+i/e*(t[1]-n[1])])):r.push(t)}))}))})),s?"Polygon"===t.getType()?new xn(a[0]):new ah(a):t}}return t},Nn.prototype.splitAt=function(t,e){var r;if(!t)return[this];if(e||(e=1e-10),t.length&&t[0].length){var n=[this];for(r=0;r<t.length;r++){for(var i=[],o=0;o<n.length;o++){var s=n[o].splitAt(t[r],e);i=i.concat(s)}n=i}return n}if(lut(t,this.getFirstCoordinate())||lut(t,this.getLastCoordinate()))return[this];var a=this.getCoordinates(),l=[a[0]],u=[];for(r=0;r<a.length-1;r++)if(!lut(a[r],a[r+1])){if(lut(t,a[r+1]))l.push(a[r+1]),u.push(new Nn(l)),l=[];else if(!lut(t,a[r])){var h,c,A=!1;a[r][0]==a[r+1][0]?(h=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=a[r][0]==t[0]&&0<h&&h<=1):a[r][1]==a[r+1][1]?(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),A=a[r][1]==t[1]&&0<h&&h<=1):(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),c=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=Math.abs(h-c)<=e&&0<h&&h<=1),A&&(l.push(t),u.push(new Nn(l)),l=[t])}l.push(a[r+1])}return l.length>1&&u.push(new Nn(l)),u.length?u:[this]};var hut=function(t){t||(t={}),tu.call(this,{handleEvent:function(t){switch(t.type){case"singleclick":return this.handleDownEvent(t);case"pointermove":return this.handleMoveEvent(t);default:return!0}}}),this.snapDistance_=t.snapDistance||25,this.tolerance_=t.tolerance||1e-10,this.cursor_=t.cursor,this.setSources(t.sources),t.features&&this.sources_.push(new pa({features:t.features})),this.filterSplit_=t.filter||function(){return!0};var e=[255,255,255,1],r=[0,153,255,1],n=new Fn({color:"rgba(255,255,255,0.4)"}),i=new Rn({color:"#3399CC",width:1.25}),o=[new Vi({image:new Di({fill:n,stroke:i,radius:5}),fill:n,stroke:i})],s=[new Vi({stroke:new Rn({color:e,width:5})}),new Vi({image:new Di({radius:6,fill:new Fn({color:r}),stroke:new Rn({color:e,width:1.5})}),stroke:new Rn({color:r,width:3})})];t.sketchStyle&&(o=t.sketchStyle instanceof Array?t.sketchStyle:[t.sketchStyle]),t.featureStyle&&(s=t.featureStyle instanceof Array?t.featureStyle:[t.featureStyle]),this.overlayLayer_=new ta({source:new pa({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(t){return t._sketch_?o:s}})};qm(hut,tu),hut.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),tu.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t)},hut.prototype.getSources=function(){if(!this.sources_&&this.getMap()){var t=[],e=function(r){r.forEach((function(r){r.getVisible()&&(r.getSource&&r.getSource()instanceof pa?t.unshift(r.getSource()):r.getLayers&&e(r.getLayers()))}))};return e(this.getMap().getLayers()),t}return this.sources_||[]},hut.prototype.setSources=function(t){this.sources_=!!t&&(t instanceof Array?t||!1:[t])},hut.prototype.getClosestFeature=function(t){var e,r,n,i,o=this.snapDistance_+1;if(this.getSources().forEach((function(s){var a=s.getClosestFeatureToCoordinate(t.coordinate);if(a&&a.getGeometry().splitAt){var l=a.getGeometry().getClosestPoint(t.coordinate),u=new Nn([t.coordinate,l]),h=u.getLength()/t.frameState.viewState.resolution;h<o&&(e=s,o=h,r=a,i=u,n=l)}})),o>this.snapDistance_)return!1;var s=this.getNearestCoord(n,r.getGeometry().getCoordinates()),a=this.getMap().getPixelFromCoordinate(s);return aut(t.pixel,a)<this.snapDistance_&&(n=s),{source:e,feature:r,coord:n,link:i}},hut.prototype.getNearestCoord=function(t,e){for(var r,n,i=Number.MAX_VALUE,o=0;o<e.length;o++)(r=aut(t,e[o]))<i&&(i=r,n=e[o]);return n},hut.prototype.handleDownEvent=function(t){var e=this.getClosestFeature(t);if(e){var r=this;r.overlayLayer_.getSource().clear();var n,i=e.feature.getGeometry().splitAt(e.coord,this.tolerance_);if(i.length>1){var o=[];for(n=0;n<i.length;n++){var s=e.feature.clone();s.setGeometry(i[n]),o.push(s)}for(r.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.removeFeature(e.feature),n=0;n<o.length;n++)e.source.addFeature(o[n]);r.dispatchEvent({type:"aftersplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"aftersplit",original:e.feature,features:o})}}return!1},hut.prototype.handleMoveEvent=function(t){var e=t.map;this.overlayLayer_.getSource().clear();var r,n,i=this.getClosestFeature(t);i&&this.filterSplit_(i.feature)?(this.overlayLayer_.getSource().addFeature(i.feature),(r=new X(new on(i.coord)))._sketch_=!0,this.overlayLayer_.getSource().addFeature(r),(n=new X(i.link))._sketch_=!0,this.overlayLayer_.getSource().addFeature(n),this.dispatchEvent({type:"pointermove",coordinate:t.coordinate,frameState:t.frameState,originalEvent:t.originalEvent,map:t.map,pixel:t.pixel,feature:i.feature,linkGeometry:i.link})):this.dispatchEvent(t);var o=e.getTargetElement();this.cursor_&&(i?o.style.cursor!=this.cursor_&&(this.previousCursor_=o.style.cursor,o.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(o.style.cursor=this.previousCursor_,this.previousCursor_=void 0))};class cut extends wU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.layerSource=new iU(e),this.layer=new Zc({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}class Aut extends Bl{constructor(t){const e=t||{},r=new Image;r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAUCAYAAADFlsDIAAAEsElEQVRYhe1XTWhjVRT+7lgmpSlIGN25kNSVP3WRLkQE0UlbXMgQnERwGFBHU6j4t0qNohGcTuJGWqQ6KeKAdhbNhOB0oZg6MChDF30gFZxVA65kKhhsFHRQr5z6nXLz+vJeZtBdDjySd95555z7ne+cex8GMpD/RYw4bYwXVwBcAfAjgIuZrfk/B3AflEPUfAfgfQB1AJ83xouH/wvn1trUTbyTjLgSNxPTWpsVv37bIHvGz/r1yqxhABsA7qf+3K8jh587uVH660YX6wRMA1gFMGaMaVtr8wCCFlI1xnh8R2zKANphvo0xY06cAoCkcwmYOT5OGmOqtNsGUNF76s7S34wvd8mj4MaBMiuzNf87gJcd/dMAmktHy3dGgfLSSmno7cbs8wGPJGBNgAp5PRsAoABX6XHVQnwl+K4UZ53glQlmpJBleQK1x0C9pw5D6iSzNX+5MV78BsBDVD0C4Grl2Hsf7cZj5zrxmLe4fMqq/fRC/Z4jIzvHgGtSlS8ALOsz0j2tFZbWcSvq2KV7LLpX+yb9CmNMBd0safO3aq0V0JrW2q532GJlxtI8qo7/pD8PWcMQuuVFAJsAbqFW2vMFXr8988rKD53RmN2Nx+4Art9Km+sA3vX5KZBV65wx29baHCseJZpopNB3mXYpBzRZeIqATRpjWsoOirJX51LN1555tnBXe3aBldma/7YxXnwTwOmAROMA7g7Ql97KLG07gVJMYoKLkcBeFFDOYiqOOk3wqgG26wTBozpLEPQ+TwZ1LRj/sq4lPnW4O3NNmZXw3beFsX5mgZV6GMBU2OIoHzqVVTnL3yaDyjUZ5oSghs2WfIBO2q1F9qQZJ8nCeCzWKtswLH6CbPQCNhddg8zKmQNgZbbm/26MF2XWfA3gvh4BOgBel+PG4omS9T2rOMN2D4AoVnHOjLHSQcC40tI55UjZYVRTW94Yk5MBTwbuW7M4abZuUtuQemnfnGO7qb5Nr4w+eaB0eyc+fKkzGrt3Nx5DJx5rd+LD33dGYxdl4H/52uM7YSsihTe1rQIWeGA71y3b14quiM+s7+hQ5qJbVNVoM8McFJACWaMtnee9p7PJyVnmnMedVHxNwD+zXDm5Ufpp6WhZ2nENwIMALgF48sI7x/s9e+mg1R2pxlkRJX3vhmw/WfSEy2JhCAuRJIjaWjXOur0BrzuoChkohVrlb8E5s+2f4ANl9qu5nwE8CuBjAE8AOH/8jQuRp3tWRI4Lc1S1nZ0nTATYOa04f9POf4/PVeQ+F1AEj4NdzlxjZIbOOC8sAXbAuhbbHSGhYIkUPnv1j9PnZ58VsgF4TBxNnVnrubWz2gJWi9VtMtG8z07bw51nypQUW7MFZ7fis/1Dosy6oHko4HFm9cNkN6ck2ZZlV0isgn5iRYKlsrh86lMeHWThV6YX6nf1ME2R7vvV1d2Q7bHqgFgj9bVtCnw35yStAMzR1/qNnMx7gJJivCyLKvGbnFciE5xjk7TZDvpW7EumzqxNTy/ULz+1/EE/x4ugRPP+4AEfufqpEfShm+j3o9h53vUh7c8h6EPbZ5vouRtGyfRC/dCRkZ3MbSPXflk8UernZD6QgQzkoAD4BzP8qid//qPeAAAAAElFTkSuQmCC",r.style.float="right",r.style.left=" 0px",r.style.right="0px",r.style.bottom="0px";let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="991",n.style.backgroundColor="rgba(0,0,0,0)",n.style.minHeight="26px",n.style.right="0px",n.style.bottom="0px",n.style.width="75px",n.appendChild(r),super({element:n,target:e.target})}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}class fut extends wU{constructor(t,e){super(t,e),this.layertype="WmsTileLayer",this.layerSource=new aU(e),this.layer=new qf({extent:[-20037725.11268234,-19994619.55417086,20037725.11268234,19994619.55417086],source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}function put(t){const e=t.frameState,r=pt(t.inversePixelTransform.slice(),e.coordinateToPixelTransform);return new bs(t.context,e.pixelRatio,e.extent,r,e.viewState.rotation)}window.ol&&(ol.util?ol.util.VERSION||(ol.util.VERSION=ol.VERSION||"6.1.0"):ol.util={VERSION:ol.VERSION||"5.3.0"});var dut=a.split(".");dut=100*parseInt(dut[0])+parseInt(dut[1]);var gut=function(t,e){var r=t.frameState.pixelRatio;if(dut>605&&1!==r&&e.getImage()instanceof Us){var n=(e=e.clone()).getImage();n.setScale(n.getScale()*r);var i=n.getAnchor();if(n.setDisplacement){var o=n.getDisplacement();o&&(o[0]-=i[0]/r,o[1]+=i[1]/r,n.setAnchor([0,0]))}else i&&(i[0]/=r,i[1]/=r)}return e},yut=function(t){var e=t||{};ta.call(this,e),this.oldcluster=new pa,this.clusters=[],this.animation={start:!1},this.set("animationDuration","number"==typeof e.animationDuration?e.animationDuration:700),this.set("animationMethod",e.animationMethod||va),this.getSource().on("change",this.saveCluster.bind(this)),this.on(["precompose","prerender"],this.animate.bind(this)),this.on(["postcompose","postrender"],this.postanimate.bind(this))};qm(yut,ta),yut.prototype.saveCluster=function(){if(this.oldcluster){if(this.oldcluster.clear(),!this.get("animationDuration"))return;var t=this.getSource().getFeatures();t.length&&t[0].get("features")&&(this.oldcluster.addFeatures(this.clusters),this.clusters=t.slice(0),this.sourceChanged=!0)}},yut.prototype.getClusterForFeature=function(t,e){for(var r,n=0;r=e[n];n++){var i=r.get("features");if(i&&i.length)for(var o,s=0;o=i[s];s++)if(t===o)return r}return!1},yut.prototype.stopAnimation=function(){this.animation.start=!1,this.animation.cA=[],this.animation.cB=[]},yut.prototype.animate=function(t){var e=this.get("animationDuration");if(e){var r,n,i=t.frameState.viewState.resolution,o=this.animation,s=t.frameState.time;if(o.resolution!=i&&this.sourceChanged){var a=t.frameState.extent;for(o.resolution<i?(a=Ct(a,100*i),o.cA=this.oldcluster.getFeaturesInExtent(a),o.cB=this.getSource().getFeaturesInExtent(a),o.revers=!1):(a=Ct(a,100*i),o.cA=this.getSource().getFeaturesInExtent(a),o.cB=this.oldcluster.getFeaturesInExtent(a),o.revers=!0),o.clusters=[],r=0;n=o.cA[r];r++){var l=n.get("features");if(l&&l.length){var u=this.getClusterForFeature(l[0],o.cB);u&&o.clusters.push({f:n,pt:u.getGeometry().getCoordinates()})}}if(o.resolution=i,this.sourceChanged=!1,!o.clusters.length||o.clusters.length>1e3)return void this.stopAnimation();s=o.start=(new Date).getTime()}if(o.start){var h=t.vectorContext||put(t),c=(s-o.start)/e;c>1&&(this.stopAnimation(),c=1),c=this.get("animationMethod")(c);var A=this.getStyle(),f="function"==typeof A?A:A.length?function(){return A}:function(){return[A]};for(t.context.save(),t.context.globalAlpha=this.getOpacity(),r=0;u=o.clusters[r];r++){var p=u.f.getGeometry().getCoordinates(),d=p[0]-u.pt[0],g=p[1]-u.pt[1];o.revers?(p[0]=u.pt[0]+c*d,p[1]=u.pt[1]+c*g):(p[0]=p[0]-c*d,p[1]=p[1]-c*g);var y=f(u.f,i,!0);if(y.length||(y=[y]),1!==u.f.get("features").length||d||g){var m=new on(p);l=new X(m)}else l=u.f.get("features")[0];for(var v,_=0;v=y[_];_++)if(v.getText()&&/\n/.test(v.getText().getText())){var w,b=v.getText().getOffsetX(),x=v.getText().getOffsetY(),E=v.getText().getRotation()||0,C=1.2*Number((v.getText().getFont()||"10px").match(/\d+/)),S=v.getText().getText().split("\n"),B=S.length-1,I=v.clone();S.forEach((function(e,r){switch(1==r&&(I.setImage(),I.setFill(),I.setStroke()),v.getText().getTextBaseline()){case"alphabetic":case"ideographic":case"bottom":w=B;break;case"hanging":case"top":w=0;break;default:w=B/2}I.getText().setOffsetX(b-Math.sin(E)*C*(r-w)),I.getText().setOffsetY(x+Math.cos(E)*C*(r-w)),I.getText().setText(e),h.drawFeature(l,gut(t,I))}))}else h.drawFeature(l,gut(t,v))}t.context.restore(),t.frameState.animate=!0,t.context.save(),t.context.beginPath(),t.context.rect(0,0,0,0),t.context.clip(),this.clip_=!0}}},yut.prototype.postanimate=function(t){this.clip_&&(t.context.restore(),this.clip_=!1)};var mut,vut=function(t){t=t||{},this.pointRadius=t.pointRadius||12,this.circleMaxObjects=t.circleMaxObjects||10,this.maxObjects=t.maxObjects||60,this.spiral=!1!==t.spiral,this.animate=t.animate,this.animationDuration=t.animationDuration||500,this.selectCluster_=!1!==t.selectCluster,this._autoClose=!1!==t.autoClose;var e=this.overlayLayer_=new ta({source:new pa({features:new V,wrapX:t.wrapX,useSpatialIndex:!0}),name:"Cluster overlay",updateWhileAnimating:!0,updateWhileInteracting:!0,displayInLayerSwitcher:!1,style:t.featureStyle});if(t.layers)if("function"==typeof t.layers){var r=t.layers;t.layers=function(t){return t===e||r(t)}}else t.layers.push&&t.layers.push(this.overlayLayer_);if(t.filter){var n=t.filter;t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))&&n(t,e)}}else t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))};this.filter_=t.filter,this._autoClose||t.toggleCondition||(t.toggleCondition=pu),Th.call(this,t),this.on("select",this.selectCluster.bind(this))};qm(vut,Th),vut.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),this._listener&&k(this._listener),this._listener=null,Th.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),t&&t.getView()&&(this._listener=t.getView().on("change:resolution",this.clear.bind(this)))},vut.prototype.clear=function(){this.getFeatures().clear(),this.overlayLayer_.getSource().clear()},vut.prototype.getLayer=function(){return this.overlayLayer_},vut.prototype.selectCluster=function(t){if(t instanceof X&&(t={selected:[t]}),t.selected.length){var e=t.selected[0];if(!e.get("selectclusterfeature")){var r=this.overlayLayer_.getSource();this._autoClose&&r.clear();var n=e.get("features");if(n&&1!=n.length){this.selectCluster_||this.getFeatures().clear();var i,o,s,a,l,u,h,c=e.getGeometry().getCoordinates(),A=this.getMap().getView().getResolution(),f=[];if(!this.spiral||n.length<=this.circleMaxObjects)for(a=Math.min(n.length,this.circleMaxObjects),i=A*this.pointRadius*(.5+a/4),s=0;s<a;s++)o=2*Math.PI*s/a,2!=a&&4!=a||(o+=Math.PI/4),l=[c[0]+i*Math.sin(o),c[1]+i*Math.cos(o)],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h);else{o=0;var p=2*this.pointRadius;for(a=Math.min(this.maxObjects,n.length),s=0;s<a;s++){o+=(p+.1)/(i=p/2+p*o/(2*Math.PI));var d=A*i*Math.sin(o),g=A*i*Math.cos(o);l=[c[0]+d,c[1]+g],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h)}}e.set("selectcluserfeatures",f),this.animate?this.animateCluster_(c,f):r.addFeatures(f)}}}else this._autoClose?this.clear():t.deselected.forEach((t=>{var e=t.get("selectcluserfeatures");e&&e.forEach((t=>{this.overlayLayer_.getSource().removeFeature(t)}))}))},vut.prototype.animateCluster_=function(t,e){if(this.listenerKey_&&k(this.listenerKey_),e.length){var r=this.overlayLayer_.getStyle(),n="function"==typeof r?r:r.length?function(){return r}:function(){return[r]},i=this.animationDuration||500,o=(new Date).getTime();this.listenerKey_=this.overlayLayer_.on(["postcompose","postrender"],function(r){for(var s,a=r.vectorContext||put(r),l=r.frameState.pixelRatio,u=this.getMap().getView().getResolution(),h=va((r.frameState.time-o)/i),c=0;s=e[c];c++)if(s.get("features")){var A=s.getGeometry().getCoordinates();A[0]=t[0]+h*(A[0]-t[0]),A[1]=t[1]+h*(A[1]-t[1]);for(var f=new on(A),p=n(s,u),d=0;d<p.length;d++){var g,y=!Qh.prototype.getFeaturesAtPixel&&p[d].getImage();y&&(g=y.getScale(),y.setScale(l)),a.setStyle?(a.setStyle(p[d]),a.drawGeometry(f)):(a.setImageStyle(y),a.drawPointGeometry(f)),y&&y.setScale(g)}}if(h>1)return k(this.listenerKey_),this.overlayLayer_.getSource().addFeatures(e),void this.overlayLayer_.changed();r.frameState.animate=!0}.bind(this));var s=new X(new on(this.getMap().getView().getCenter()));s.setStyle(new Vi({image:new Di({})})),this.overlayLayer_.getSource().addFeature(s)}},vut.prototype.getClusterExtent=function(t){if(!t.get("features"))return null;var e=[1/0,1/0,-1/0,-1/0];return t.get("features").forEach((function(t){e=Rt(e,t.getGeometry().getExtent())})),e[0]===e[2]&&e[1]===e[3]?null:e},function(){var t=function(t,e,r){return(t[0]-r[0])*(e[1]-r[1])-(t[1]-r[1])*(e[0]-r[0])<=0};mut=function(e){var r;e.sort((function(t,e){return t[0]==e[0]?t[1]-e[1]:t[0]-e[0]}));var n=[];for(r=0;r<e.length;r++){for(;n.length>=2&&t(n[n.length-2],n[n.length-1],e[r]);)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&t(i[i.length-2],i[i.length-1],e[r]);)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)};var e=function(t){var r,n,i=[];switch(t.getType()){case"Point":i.push(t.getCoordinates());break;case"LineString":case"LinearRing":case"MultiPoint":i=t.getCoordinates();break;case"MultiLineString":for(n=t.getLineStrings(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"Polygon":i=e(t.getLinearRing(0));break;case"MultiPolygon":for(n=t.getPolygons(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"GeometryCollection":for(n=t.getGeometries(),r=0;r<n.length;r++)i.concat(e(n[r]))}return i};Mr.prototype.convexHull=function(){return mut(e(this))}}();const _ut=mut;var wut=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),but={Point:function(t){return void 0!==t.m&&void 0!==t.z?new on([t.x,t.y,t.z,t.m],Y.XYZM):void 0!==t.z?new on([t.x,t.y,t.z],Y.XYZ):void 0!==t.m?new on([t.x,t.y,t.m],Y.XYM):new on([t.x,t.y])},LineString:function(t){var e=Sut(t);return new Nn(t.paths[0],e)},Polygon:function(t){var e=Sut(t);return new xn(t.rings,e)},MultiPoint:function(t){var e=Sut(t);return new nh(t.points,e)},MultiLineString:function(t){var e=Sut(t);return new th(t.paths,e)},MultiPolygon:function(t){var e=Sut(t);return new ah(t.rings,e)}},xut={Point:function(t,e){var r,n=t.getCoordinates(),i=t.getLayout();return i===Y.XYZ?r={x:n[0],y:n[1],z:n[2]}:i===Y.XYM?r={x:n[0],y:n[1],m:n[2]}:i===Y.XYZM?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===Y.XY?r={x:n[0],y:n[1]}:K(!1,34),r},LineString:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},MultiLineString:function(t,e){var r=But(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,e){for(var r=But(t),n=t.getCoordinates(!1),i=[],o=0;o<n.length;o++)for(var s=n[o].length-1;s>=0;s--)i.push(n[o][s]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}}},Eut=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return wut(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var n=t,i=Cut(n.geometry,e),o=new X;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(i),n.attributes){o.setProperties(n.attributes,!0);var s=n.attributes[r];void 0!==s&&o.setId(s)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var n=[],i=t.features,o=0,s=i.length;o<s;++o)n.push(this.readFeatureFromObject(i[o],r,t.objectIdFieldName));return n}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return Cut(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?ir("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return Iut(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={};if(!t.hasProperties())return r.attributes={},r;var n=t.getProperties(),i=t.getGeometry();if(i){r.geometry=Iut(i,e);var o=e&&(e.dataProjection||e.featureProjection);o&&(r.geometry.spatialReference={wkid:Number(ir(o).getCode().split(":").pop())}),delete n[t.getGeometryName()]}return C(n)?r.attributes={}:r.attributes=n,r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{features:r}},e}(Of);function Cut(t,e){var r,n,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i="Point";else if(t.points)i="MultiPoint";else if(t.paths)i=1===t.paths.length?"LineString":"MultiLineString";else if(t.rings){var o=t,s=Sut(o),a=function(t,e){var r,n,i=[],o=[],s=[];for(r=0,n=t.length;r<n;++r)i.length=0,zr(i,0,t[r],e.length),gn(i,0,i.length,e.length)?o.push([t[r]]):s.push(t[r]);for(;s.length;){var a=s.shift(),l=!1;for(r=o.length-1;r>=0;r--){var u=o[r][0];if(Tt(new rn(u).getExtent(),new rn(a).getExtent())){o[r].push(a),l=!0;break}}l||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(i="Polygon",t=b({},t,((r={}).rings=a[0],r))):(i="MultiPolygon",t=b({},t,((n={}).rings=a,n)))}return $c((0,but[i])(t),!1,e)}function Sut(t){var e=Y.XY;return!0===t.hasZ&&!0===t.hasM?e=Y.XYZM:!0===t.hasZ?e=Y.XYZ:!0===t.hasM&&(e=Y.XYM),e}function But(t){var e=t.getLayout();return{hasZ:e===Y.XYZ||e===Y.XYZM,hasM:e===Y.XYM||e===Y.XYZM}}function Iut(t,e){return(0,xut[t.getType()])($c(t,!0,e),e)}const Tut=Eut;var Put="http://www.w3.org/2001/XMLSchema-instance";function Fut(t,e){return Yut().createElementNS(t,e)}function Lut(t,e){return Mut(t,e,[]).join("")}function Mut(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)Mut(n,e,r)}return r}function Out(t){return"documentElement"in t}function kut(t){return(new DOMParser).parseFromString(t,"application/xml")}function Nut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&y(n[n.length-1],i)}}function Rut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function Uut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function Dut(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function Qut(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function Gut(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,s=r;return void 0===s&&(s=i),Fut(void 0!==e?e:o.namespaceURI,s)}}var jut=Gut();function Hut(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function zut(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function Vut(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var s=o[i.localName];void 0!==s&&s.call(n,i,r)}}}function Kut(t,e,r,n,i){return n.push(t),Vut(e,r,n,i),n.pop()}function qut(t,e,r,n,i,o,s){return i.push(t),function(t,e,r,n,i,o){for(var s,a,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(s=r[u])&&void 0!==(a=e.call(void 0!==o?o:this,s,n,void 0!==i?i[u]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,n)}(e,r,n,i,o,s),i.pop()}var Wut=void 0,Xut=void 0;function Yut(){return void 0===Xut&&"undefined"!=typeof document&&(Xut=document.implementation.createDocument("","",null)),Xut}var Zut=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Jut=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===Wut&&"undefined"!=typeof XMLSerializer&&(Wut=new XMLSerializer),Wut),e}return Zut(e,t),e.prototype.getType=function(){return"xml"},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=kut(t);return this.readFeatureFromDocument(r,e)}return Out(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=kut(t);return this.readFeaturesFromDocument(r,e)}return Out(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&y(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return n()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=kut(t);return this.readGeometryFromDocument(r,e)}return Out(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=kut(t);return this.readProjectionFromDocument(e)}return Out(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Jc);function $ut(t){var e,r=Lut(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function tht(t){var e,r=Lut(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function eht(t){return Lut(t,!1).trim()}function rht(t,e){iht(t,e?"1":"0")}function nht(t,e){var r=e.toPrecision();t.appendChild(Yut().createTextNode(r))}function iht(t,e){t.appendChild(Yut().createTextNode(e))}var oht,sht,aht,lht,uht,hht,cht,Aht,fht,pht=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dht=["http://www.google.com/kml/ext/2.2"],ght=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],yht={fraction:xs.FRACTION,pixels:xs.PIXELS,insetPixels:xs.PIXELS},mht=zut(ght,{ExtendedData:Act,Region:fct,MultiGeometry:Dut(nct,"geometry"),LineString:Dut(tct,"geometry"),LinearRing:Dut(ect,"geometry"),Point:Dut(ict,"geometry"),Polygon:Dut(sct,"geometry"),Style:Dut(lct),StyleMap:function(t,e){var r=Qht.call(this,t,e);if(r){var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:K(!1,38)}},address:Dut(eht),description:Dut(eht),name:Dut(eht),open:Dut($ut),phoneNumber:Dut(eht),styleUrl:Dut(Rht),visibility:Dut($ut)},zut(dht,{MultiTrack:Dut((function(t,e){var r=Kut([],qht,t,e);if(r)return new th(r)}),"geometry"),Track:Dut(Xht,"geometry")})),vht=zut(ght,{ExtendedData:Act,Region:fct,Link:function(t,e){Vut(_ht,t,e)},address:Dut(eht),description:Dut(eht),name:Dut(eht),open:Dut($ut),phoneNumber:Dut(eht),visibility:Dut($ut)}),_ht=zut(ght,{href:Dut(Nht)}),wht=zut(ght,{LatLonAltBox:function(t,e){var r=Kut({},gct,t,e);if(r){var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)}},Lod:function(t,e){var r=Kut({},yct,t,e);if(r){var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}}),bht=zut(ght,["Document","Placemark"]),xht=zut(ght,{Document:Qut((function(t,e,r){qut({node:t},bct,xct,e,r,void 0,this)})),Placemark:Qut(qct)}),Eht=null,Cht=null,Sht=null,Bht=null,Iht=null,Tht=null;function Pht(t){return 32/Math.min(t[0],t[1])}function Fht(t){return t}var Lht=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Tht||(Eht=new Fn({color:oht=[255,255,255,1]}),sht=[20,2],aht=xs.PIXELS,lht=xs.PIXELS,uht=[64,64],hht="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Cht=new Us({anchor:sht,anchorOrigin:Es.BOTTOM_LEFT,anchorXUnits:aht,anchorYUnits:lht,crossOrigin:"anonymous",rotation:0,scale:Pht(uht),size:uht,src:hht}),cht="NO_IMAGE",Sht=new Rn({color:oht,width:1}),Aht=new Rn({color:[51,51,51,1],width:2}),Bht=new Wi({font:"bold 16px Helvetica",fill:Eht,stroke:Aht,scale:.8}),Iht=new Vi({fill:Eht,image:Cht,text:Bht,stroke:Sht,zIndex:0}),Tht=[Iht]),r.dataProjection=ir("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Tht,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:Fht,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return pht(e,t),e.prototype.readDocumentOrFolder_=function(t,e){return Kut([],zut(ght,{Document:Nut(this.readDocumentOrFolder_,this),Folder:Nut(this.readDocumentOrFolder_,this),Placemark:Rut(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this)||void 0},e.prototype.readPlacemark_=function(t,e){var r,n,i,o,s,a=Kut({geometry:null},mht,t,e,this);if(a){var l=new X,u=t.getAttribute("id");null!==u&&l.setId(u);var h=e[0],c=a.geometry;if(c&&$c(c,!1,h),l.setGeometry(c),delete a.geometry,this.extractStyles_){var A=(r=a.Style,n=a.styleUrl,i=this.defaultStyle_,o=this.sharedStyles_,s=this.showPointNames_,function(t,e){var a=s,l="",u=[];if(a){var h=t.getGeometry();if(h)if(h instanceof SA)a=(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e}))).length>0;else{var c=h.getType();a="Point"===c||"MultiPoint"===c}}a&&(l=t.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(fht||(fht=document.createElement("textarea")),fht.innerHTML=l,l=fht.value));var A=i;if(r?A=r:n&&(A=Mht(n,i,o)),a){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var s=i.getScaleArray(),a=i.getAnchor();r[0]=s[0]*(o[0]-a[0]),r[1]=s[1]*(o[1]/2-a[1]),n="left"}}var l=t.getText();return l?((l=l.clone()).setFont(l.getFont()||Bht.getFont()),l.setScale(l.getScale()||Bht.getScale()),l.setFill(l.getFill()||Bht.getFill()),l.setStroke(l.getStroke()||Aht)):l=Bht.clone(),l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new Vi({image:i,text:l})}(A[0],l);return u.length>0?(f.setGeometry(new SA(u)),[f,new Vi({geometry:A[0].getGeometry(),image:null,fill:A[0].getFill(),stroke:A[0].getStroke(),text:null})].concat(A.slice(1))):f}return A});l.setStyle(A)}return delete a.Style,l.setProperties(a,!0),l}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=lct.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Qht.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){return p(ght,t.namespaceURI)&&this.readPlacemark_(t,[this.getReadOptions(t,e)])||null},e.prototype.readFeaturesFromNode=function(t,e){if(!p(ght,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&y(r,s)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=kut(t);return this.readNameFromDocument(e)}return Out(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(p(ght,e.namespaceURI)&&"name"==e.localName)return eht(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(p(ght,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=kut(t);y(e,this.readNetworkLinksFromDocument(r))}else Out(t)?y(e,this.readNetworkLinksFromDocument(t)):y(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(ght,r.namespaceURI)&&"NetworkLink"==r.localName){var n=Kut({},vht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(ght,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=kut(t);y(e,this.readRegionFromDocument(r))}else Out(t)?y(e,this.readRegionFromDocument(t)):y(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(ght,r.namespaceURI)&&"Region"==r.localName){var n=Kut({},wht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(ght,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Fut(ght[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",dht[0]),r.setAttributeNS(n,"xmlns:xsi",Put),r.setAttributeNS(Put,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=bht[r.namespaceURI],a=Hut(o,s);return qut(i,xht,jut,a,[e],s,this),r},e}(Jut);function Mht(t,e,r){return Array.isArray(t)?t:"string"==typeof t?Mht(r[t],e,r):e}function Oht(t){var e=Lut(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function kht(t){var e=Lut(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=n[3]?parseFloat(n[3]):0;r.push(o,s,a),e=e.substr(n[0].length)}if(""===e)return r}function Nht(t){var e=Lut(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Rht(t){var e=Lut(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Uht(t){return tht(t)}var Dht=zut(ght,{Pair:function(t,e){var r=Kut({},pct,t,e,this);if(r){var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}}});function Qht(t,e){return Kut(void 0,Dht,t,e,this)}var Ght=zut(ght,{Icon:Dut((function(t,e){return Kut({},Yht,t,e)||null})),color:Dut(Oht),heading:Dut(tht),hotSpot:Dut((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Es.BOTTOM_LEFT:Es.TOP_LEFT:"insetPixels"!==n?Es.BOTTOM_RIGHT:Es.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:yht[r],y:parseFloat(t.getAttribute("y")),yunits:yht[n],origin:e}})),scale:Dut(Uht)}),jht=zut(ght,{color:Dut(Oht),scale:Dut(Uht)}),Hht=zut(ght,{color:Dut(Oht),width:Dut(tht)}),zht=zut(ght,{color:Dut(Oht),fill:Dut($ut),outline:Dut($ut)}),Vht=zut(ght,{coordinates:Uut(kht)});function Kht(t,e){return Kut(null,Vht,t,e)}var qht=zut(dht,{Track:Rut(Xht)}),Wht=zut(ght,{when:function(t,e){var r=e[e.length-1].whens,n=Lut(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},zut(dht,{coord:function(t,e){var r=e[e.length-1].coordinates,n=Lut(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);r.push([o,s,a])}else r.push([])}}));function Xht(t,e){var r=Kut({coordinates:[],whens:[]},Wht,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,s=0,a=Math.min(i.length,o.length);s<a;++s)3==i[s].length&&n.push(i[s][0],i[s][1],i[s][2],o[s]);return new Nn(n,Y.XYZM)}}var Yht=zut(ght,{href:Dut(Nht)},zut(dht,{x:Dut(tht),y:Dut(tht),w:Dut(tht),h:Dut(tht)})),Zht=zut(ght,{coordinates:Uut(kht)});function Jht(t,e){return Kut(null,Zht,t,e)}var $ht=zut(ght,{extrude:Dut($ut),tessellate:Dut($ut),altitudeMode:Dut(eht)});function tct(t,e){var r=Kut({},$ht,t,e),n=Jht(t,e);if(n){var i=new Nn(n,Y.XYZ);return i.setProperties(r,!0),i}}function ect(t,e){var r=Kut({},$ht,t,e),n=Jht(t,e);if(n){var i=new xn(n,Y.XYZ,[n.length]);return i.setProperties(r,!0),i}}var rct=zut(ght,{LineString:Rut(tct),LinearRing:Rut(ect),MultiGeometry:Rut(nct),Point:Rut(ict),Polygon:Rut(sct)});function nct(t,e){var r,n=Kut([],rct,t,e);if(!n)return null;if(0===n.length)return new SA(n);for(var i=!0,o=n[0].getType(),s=1,a=n.length;s<a;++s)if(n[s].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if("Point"==o){var h=n[0];for(l=h.getLayout(),u=h.getFlatCoordinates(),s=1,a=n.length;s<a;++s)y(u,n[s].getFlatCoordinates());uct(r=new nh(u,l),n)}else"LineString"==o?uct(r=new th(n),n):"Polygon"==o?uct(r=new ah(n),n):"GeometryCollection"==o?r=new SA(n):K(!1,37)}else r=new SA(n);return r}function ict(t,e){var r=Kut({},$ht,t,e),n=Jht(t,e);if(n){var i=new on(n,Y.XYZ);return i.setProperties(r,!0),i}}var oct=zut(ght,{innerBoundaryIs:function(t,e){var r=Kut([],mct,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=Kut(void 0,vct,t,e);r&&(e[e.length-1][0]=r)}});function sct(t,e){var r=Kut({},$ht,t,e),n=Kut([null],oct,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],s=1,a=n.length;s<a;++s)y(i,n[s]),o.push(i.length);var l=new xn(i,Y.XYZ,o);return l.setProperties(r,!0),l}}var act=zut(ght,{IconStyle:function(t,e){var r=Kut({},Ght,t,e);if(r){var n,i,o,s,a=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=hht);var c,A=Es.BOTTOM_LEFT,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,s=f.yunits,A=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=sht,o=aht,s=lht):/arrow-reverse/.test(n)?(i=[54,42],o=aht,s=lht):/paddle/.test(n)&&(i=[32,1],o=aht,s=lht));var p,d=l.x,g=l.y;void 0!==d&&void 0!==g&&(c=[d,g]);var y,m=l.w,v=l.h;void 0!==m&&void 0!==v&&(p=[m,v]);var _=r.heading;void 0!==_&&(y=Ae(_));var w=r.scale,b=r.color;if(u){n==hht&&(p=uht);var x=new Us({anchor:i,anchorOrigin:A,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Es.BOTTOM_LEFT,rotation:y,scale:w,size:p,src:this.iconUrlFunction_(n),color:b}),E=x.getScaleArray()[0],C=x.getSize();if(null===C){var S=x.getImageState();if(S===Un.IDLE||S===Un.LOADING){var B=function(){var t=x.getImageState();if(t!==Un.IDLE&&t!==Un.LOADING){var e=x.getSize();if(e&&2==e.length){var r=Pht(e);x.setScale(E*r)}x.unlistenImageChange(B)}};x.listenImageChange(B),S===Un.IDLE&&x.load()}}else if(2==C.length){var I=Pht(C);x.setScale(E*I)}a.imageStyle=x}else a.imageStyle=cht}},LabelStyle:function(t,e){var r=Kut({},jht,t,e);if(r){var n=e[e.length-1],i=new Wi({fill:new Fn({color:"color"in r?r.color:oht}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=Kut({},Hht,t,e);if(r){var n=e[e.length-1],i=new Rn({color:"color"in r?r.color:oht,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=Kut({},zht,t,e);if(r){var n=e[e.length-1],i=new Fn({color:"color"in r?r.color:oht});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var s=r.outline;void 0!==s&&(n.outline=s)}}});function lct(t,e){var r=Kut({},act,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Eht,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=cht&&(n=r.imageStyle):n=Cht;var s="textStyle"in r?r.textStyle:Bht,a="strokeStyle"in r?r.strokeStyle:Sht,l=r.outline;return void 0===l||l?[new Vi({fill:i,image:n,stroke:a,text:s,zIndex:void 0})]:[new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e}))):"Polygon"!==r&&"MultiPolygon"!==r?e:void 0},fill:i,image:n,stroke:a,text:s,zIndex:void 0}),new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e}))):"Polygon"===r||"MultiPolygon"===r?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function uct(t,e){var r,n,i,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];s[u]=h.get("extrude"),a[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==s[u],n=n||void 0!==a[u],i=i||l[u]}r&&t.set("extrude",s),n&&t.set("tessellate",a),i&&t.set("altitudeMode",l)}var hct=zut(ght,{displayName:Dut(eht),value:Dut(eht)}),cct=zut(ght,{Data:function(t,e){var r=t.getAttribute("name");Vut(hct,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){Vut(dct,t,e)}});function Act(t,e){Vut(cct,t,e)}function fct(t,e){Vut(wht,t,e)}var pct=zut(ght,{Style:Dut(lct),key:Dut(eht),styleUrl:Dut(Rht)}),dct=zut(ght,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=eht(t);e[e.length-1][r]=n}}}),gct=zut(ght,{altitudeMode:Dut(eht),minAltitude:Dut(tht),maxAltitude:Dut(tht),north:Dut(tht),south:Dut(tht),east:Dut(tht),west:Dut(tht)}),yct=zut(ght,{minLodPixels:Dut(tht),maxLodPixels:Dut(tht),minFadeExtent:Dut(tht),maxFadeExtent:Dut(tht)}),mct=zut(ght,{LinearRing:Rut(Kht)}),vct=zut(ght,{LinearRing:Uut(Kht)});function _ct(t,e){for(var r=Zn(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}iht(t,n.join(""))}var wct=zut(ght,{Data:Qut((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&qut(n,wct,jut,[i.displayName],r,["displayName"]),null!==i&&i.value&&qut(n,wct,jut,[i.value],r,["value"])):qut(n,wct,jut,[i],r,["value"])})),value:Qut((function(t,e){iht(t,e)})),displayName:Qut((function(t,e){!function(t,e){t.appendChild(Yut().createCDATASection(e))}(t,e)}))}),bct=zut(ght,{Placemark:Qut(qct)}),xct=function(t,e,r){return Fut(e[e.length-1].node.namespaceURI,"Placemark")},Ect=Gut("Data"),Cct=zut(ght,["href"],zut(dht,["x","y","w","h"])),Sct=zut(ght,{href:Qut(iht)},zut(dht,{x:Qut(nht),y:Qut(nht),w:Qut(nht),h:Qut(nht)})),Bct=function(t,e,r){return Fut(dht[0],"gx:"+r)},Ict=zut(ght,["scale","heading","Icon","color","hotSpot"]),Tct=zut(ght,{Icon:Qut((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Cct[i.namespaceURI],s=Hut(e,o);qut(n,Sct,jut,s,r,o),s=Hut(e,o=Cct[dht[0]]),qut(n,Sct,Bct,s,r,o)})),color:Qut(_ct),heading:Qut(nht),hotSpot:Qut((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Qut(nAt)}),Pct=zut(ght,["color","scale"]),Fct=zut(ght,{color:Qut(_ct),scale:Qut(nAt)}),Lct=zut(ght,["color","width"]),Mct=zut(ght,{color:Qut(_ct),width:Qut(nht)}),Oct={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},kct=function(t,e,r){if(t)return Fut(e[e.length-1].node.namespaceURI,Oct[t.getType()])},Nct=Gut("Point"),Rct=Gut("LineString"),Uct=Gut("LinearRing"),Dct=Gut("Polygon"),Qct=zut(ght,{LineString:Qut(Yct),Point:Qut(Yct),Polygon:Qut(eAt),GeometryCollection:Qut(Gct)});function Gct(t,e,r){var n,i={node:t},o=e.getType(),s=[];"GeometryCollection"===o?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();"MultiPoint"===e?s=s.concat(t.getPoints()):"MultiLineString"===e?s=s.concat(t.getLineStrings()):"MultiPolygon"===e?s=s.concat(t.getPolygons()):"Point"===e||"LineString"===e||"Polygon"===e?s.push(t):K(!1,39)})),n=kct):"MultiPoint"===o?(s=e.getPoints(),n=Nct):"MultiLineString"===o?(s=e.getLineStrings(),n=Rct):"MultiPolygon"===o?(s=e.getPolygons(),n=Dct):K(!1,39),qut(i,Qct,n,s,r)}var jct=zut(ght,{LinearRing:Qut(Yct)});function Hct(t,e,r){qut({node:t},jct,Uct,[e],r)}var zct=zut(ght,{ExtendedData:Qut((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,s=i.length,a=0;a<s;a++)qut(n,wct,Ect,[{name:i[a],value:o[a]}],r)})),MultiGeometry:Qut(Gct),LineString:Qut(Yct),LinearRing:Qut(Yct),Point:Qut(Yct),Polygon:Qut(eAt),Style:Qut((function(t,e,r){var n,i={node:t},o={};if(e.pointStyles.length){var s=e.pointStyles[0].getText();s&&(o.LabelStyle=s);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(o.IconStyle=a)}e.lineStyles.length&&(n=e.lineStyles[0].getStroke())&&(o.LineStyle=n),e.polyStyles.length&&((n=e.polyStyles[0].getStroke())&&!o.LineStyle&&(o.LineStyle=n),o.PolyStyle=e.polyStyles[0]);var l=r[r.length-1].node,u=iAt[l.namespaceURI],h=Hut(o,u);qut(i,oAt,jut,h,r,u)})),address:Qut(iht),description:Qut(iht),name:Qut(iht),open:Qut(rht),phoneNumber:Qut(iht),styleUrl:Qut(iht),visibility:Qut(rht)}),Vct=zut(ght,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Kct=Gut("ExtendedData");function qct(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),a=e.getStyleFunction();if(a){var l=a(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})).length:"Point"===n||"MultiPoint"===n}}))),this.writeStyles_){var c=u,A=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"LineString"===e||"MultiLineString"===e})).length:"LineString"===n||"MultiLineString"===n}})),A=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e})).length:"Polygon"===n||"MultiPolygon"===n}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:A}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var p=r[r.length-1].node,d=Vct[p.namespaceURI],g=Hut(i,d);if(qut(n,zct,jut,g,r,d),s.length>0){var y=Hut(i,s);qut(n,zct,Kct,[{names:s,values:y}],r)}var m=r[0],v=e.getGeometry();v&&(v=$c(v,!0,m)),qut(n,zct,kct,[v],r)}var Wct=zut(ght,["extrude","tessellate","altitudeMode","coordinates"]),Xct=zut(ght,{extrude:Qut(rht),tessellate:Qut(rht),altitudeMode:Qut(iht),coordinates:Qut((function(t,e,r){var n,i=r[r.length-1],o=i.layout,s=i.stride;o==Y.XY||o==Y.XYM?n=2:o==Y.XYZ||o==Y.XYZM?n=3:K(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=s;h<a;h+=s)for(l+=" "+e[h],u=1;u<n;++u)l+=","+e[h+u]}iht(t,l)}))});function Yct(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var s=r[r.length-1].node,a=Wct[s.namespaceURI],l=Hut(o,a);qut(i,Xct,jut,l,r,a)}var Zct=zut(ght,["color","fill","outline"]),Jct=zut(ght,{outerBoundaryIs:Qut(Hct),innerBoundaryIs:Qut(Hct)}),$ct=Gut("innerBoundaryIs"),tAt=Gut("outerBoundaryIs");function eAt(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};qut(o,Jct,$ct,n,r),qut(o,Jct,tAt,[i],r)}var rAt=zut(ght,{color:Qut(_ct),fill:Qut(rht),outline:Qut(rht)});function nAt(t,e){nht(t,Math.round(1e6*e)/1e6)}var iAt=zut(ght,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),oAt=zut(ght,{IconStyle:Qut((function(t,e,r){var n={node:t},i={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),l={href:o};if(s){l.w=s[0],l.h=s[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(l.x=h[0],l.y=a[1]-(h[1]+s[1])),u&&(u[0]!==s[0]/2||u[1]!==s[1]/2)){var c={x:u[0],xunits:xs.PIXELS,y:s[1]-u[1],yunits:xs.PIXELS};i.hotSpot=c}}i.Icon=l;var A=e.getScaleArray()[0],f=s;null===f&&(f=uht),2==f.length&&(A/=Pht(f)),1!==A&&(i.scale=A);var p=e.getRotation();0!==p&&(i.heading=p);var d=e.getColor();d&&(i.color=d);var g=r[r.length-1].node,y=Ict[g.namespaceURI],m=Hut(i,y);qut(n,Tct,jut,m,r,y)})),LabelStyle:Qut((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var s=e.getScale();s&&1!==s&&(i.scale=s);var a=r[r.length-1].node,l=Pct[a.namespaceURI],u=Hut(i,l);qut(n,Fct,jut,u,r,l)})),LineStyle:Qut((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,s=Lct[o.namespaceURI],a=Hut(i,s);qut(n,Mct,jut,a,r,s)})),PolyStyle:Qut((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),s={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},a=r[r.length-1].node,l=Zct[a.namespaceURI],u=Hut(s,l);qut(n,rAt,jut,u,r,l)}))});const sAt=Lht;var aAt=function(t){t=t||{},this.duration_="number"==typeof t.duration?t.duration>=0?t.duration:0:1e3,this.fade_="function"==typeof t.fade?t.fade:null,this.repeat_=Number(t.repeat);var e="function"==typeof t.easing?t.easing:wa;t.revers?this.easing_=function(t){return 1-e(t)}:this.easing_=e,this.hiddenStyle=t.hiddenStyle,D.call(this)};qm(aAt,D),aAt.hiddenStyle=new Vi({image:new Di({}),stroke:new Rn({color:"transparent"})}),aAt.prototype.drawGeom_=function(t,e,r){this.fade_&&(t.context.globalAlpha=this.fade_(1-t.elapsed));for(var n=t.style,i=0;i<n.length;i++)try{var o=t.vectorContext||put(t),s=gut(t,n[i]);o.setStyle(s),s.getZIndex()<0?o.drawGeometry(r||e):o.drawGeometry(e)}catch(a){}},aAt.prototype.animate=function(){return!1},Qh.prototype.animateFeature=function(t,e){var r=this._featureAnimationLayer;r||(r=this._featureAnimationLayer=new ta({source:new pa})).setMap(this),r.getSource().addFeature(t);var n=e.on("animationend",(function(e){e.feature===t&&(r.getSource().removeFeature(t),k(n))}));r.animateFeature(t,e)},Zi.prototype.animateFeature=function(t,e,r){var n,i=this,o=t.getStyle(),s=o||(this.getStyleFunction?this.getStyleFunction()(t):null);s||(s=[]),s instanceof Array||(s=[s]);var a={vectorContext:null,frameState:null,start:0,time:0,elapsed:0,extent:!1,feature:t,geom:t.getGeometry(),typeGeom:t.getGeometry().getType(),bbox:t.getGeometry().getExtent(),coord:Vt(t.getGeometry().getExtent()),style:s};e instanceof Array||(e=[e]);for(var l=e.length-1;l>=0;l--)0===e[l].duration_&&e.splice(l,1);var u=0,h=0,c=r&&this.getFilters?this.getFilters():[];function A(r){a.type=r.type;try{a.vectorContext=r.vectorContext||put(r)}catch(o){}if(a.frameState=r.frameState,a.inversePixelTransform=r.inversePixelTransform,a.extent||(a.extent=r.frameState.extent,a.start=r.frameState.time,a.context=r.context),a.time=r.frameState.time-a.start,a.elapsed=a.time/e[h].duration_,a.elapsed>1&&(a.elapsed=1),r.context.save(),c.forEach((function(t){t.get("active")&&t.precompose(r)})),this.getOpacity&&(r.context.globalAlpha=this.getOpacity()),e[h].animate(a)){var n={type:"animating",step:h,start:a.start,time:a.time,elapsed:a.elapsed,rotation:a.rotation||0,geom:a.geom,coordinate:a.coord,feature:t};e[h].dispatchEvent(n),i.dispatchEvent(n)}else++u<e[h].repeat_?a.extent=!1:h<e.length-1?(e[h].dispatchEvent({type:"animationend",feature:t}),h++,u=0,a.extent=!1):f();c.forEach((function(t){t.get("active")&&t.postcompose(r)})),r.context.restore(),r.frameState.animate=!0}function f(r){k(n),n=null,t.setStyle(o);var s={type:"animationend",feature:t};if(r)for(var a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);e[h].dispatchEvent(s),i.dispatchEvent(s)}function p(r){if(e.length&&!n){if(n=i.on(["postcompose","postrender"],A.bind(i)),i.renderSync)try{i.renderSync()}catch(TX){}else i.changed();t.setStyle(e[h].hiddenStyle||aAt.hiddenStyle);var o={type:"animationstart",feature:t};if(r)for(var s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);e[h].dispatchEvent(o),i.dispatchEvent(o)}}return p(),{start:p,stop:f,isPlaying:function(){return!!n}}};var lAt=function(t){t=t||{},aAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||3)};qm(lAt,aAt),lAt.prototype.animate=function(t){var e=t.geom.clone(),r=Math.abs(Math.sin(this.bounce_*t.elapsed))*this.amplitude_*(1-this.easing_(t.elapsed))*t.frameState.viewState.resolution;return e.translate(0,r),this.drawGeom_(t,e,t.geom),t.time<=this.duration_};var uAt=function(t){aAt.call(this,t),this.set("nb",t.nb||10)};qm(uAt,aAt),uAt.prototype.animate=function(t){return Math.round(this.easing_(t.elapsed)*this.get("nb"))%2||this.drawGeom_(t,t.geom),t.time<=this.duration_};var hAt=function(t){t=t||{},this.speed_=t.speed||0,aAt.call(this,t),this.side_=t.side||"top"};qm(hAt,aAt),hAt.prototype.animate=function(t){if(!t.time){var e=t.frameState.viewState.rotation,r=t.frameState.size[1]*t.frameState.viewState.resolution;"top"!=this.side_&&(r*=-1),this.dx=-Math.sin(e)*r,this.dy=Math.cos(e)*r,this.speed_&&(this.duration_=r/this.speed_/t.frameState.viewState.resolution)}var n=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*(1-this.easing_(t.elapsed))),this.drawGeom_(t,n,t.geom),t.time<=this.duration_};var cAt=function(t){t=t||{},this.speed_=t.speed||0,aAt.call(this,t)};qm(cAt,aAt),cAt.prototype.animate=function(t){return t.context.globalAlpha=this.easing_(t.elapsed),this.drawGeom_(t,t.geom),t.time<=this.duration_};var AAt=function(t){switch(t=t||{},aAt.call(this,t),this.speed_=t.speed||0,this.path_=t.path,t.rotate){case!0:case 0:this.rotate_=0;break;default:this.rotate_=t.rotate||!1}this.path_&&this.path_.getGeometry&&(this.path_=this.path_.getGeometry()),this.path_&&this.path_.getLineString&&(this.path_=this.path_.getLineString()),this.path_.getLength?(this.dist_=this.path_.getLength(),this.path_&&this.path_.getCoordinates&&(this.path_=this.path_.getCoordinates())):this.dist_=0,this.speed_>0&&(this.duration_=this.dist_/this.speed_)};qm(AAt,aAt),AAt.prototype.animate=function(t){if(!t.time&&!this.dist_)return!1;var e,r,n,i,o,s,a=this.dist_*this.easing_(t.elapsed),l=0;r=this.path_[0];for(var u=1;u<this.path_.length;u++){if(e=r,i=(r=this.path_[u])[0]-e[0],o=r[1]-e[1],(s=Math.sqrt(i*i+o*o))&&l+s>=a){n=(a-l)/s,r=[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n];break}l+=s}var h=t.style;if(t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]),!1!==this.rotate_){var c=[],A=this.rotate_-t.rotation+t.frameState.viewState.rotation;t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]);for(var f=0;n=t.style[f];f++)n.getImage()&&n.getImage().setRotation(A),c.push(n);t.style=c}return t.geom.setCoordinates(r),this.drawGeom_(t,t.geom),t.style=h,t.time<=this.duration_};var fAt=function(t){t=t||{},aAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||6),this.horizontal_=t.horizontal};qm(fAt,aAt),fAt.prototype.animate=function(t){var e=t.geom.clone(),r=t.geom.clone(),n=this.easing_(t.elapsed);return n=Math.sin(this.bounce_*n)*this.amplitude_*(1-n)*t.frameState.viewState.resolution,this.horizontal_?(e.translate(n,0),r.translate(n,0)):e.translate(0,n),this.drawGeom_(t,e,r),t.time<=this.duration_};var pAt=function(t){aAt.call(this,t)};qm(pAt,aAt),pAt.prototype.animate=function(t){return this.drawGeom_(t,t.geom),t.time<=this.duration_};var dAt=function(t){t=t||{},this.speed_=t.speed||0,aAt.call(this,t),this.side_=t.side||"left"};qm(dAt,aAt),dAt.prototype.animate=function(t){t.time||("left"==this.side_?this.dx=t.extent[0]-t.bbox[2]:this.dx=t.extent[2]-t.bbox[0],this.speed_&&(this.duration_=Math.abs(this.dx)/this.speed_/t.frameState.viewState.resolution));var e=t.geom.clone();return e.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,e),t.time<=this.duration_};var gAt=function(t){aAt.call(this,t)};qm(gAt,aAt),gAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){t.context.save();var r=t.frameState.pixelRatio;t.context.globalAlpha=e,t.context.scale(e,1/e);var n=t.frameState.coordinateToPixelTransform,i=(1/e-1)*r*(n[0]*t.coord[0]+n[1]*t.coord[1]+n[4]),o=(e-1)*r*(n[2]*t.coord[0]+n[3]*t.coord[1]+n[5]);t.context.translate(i,o),this.drawGeom_(t,t.geom),t.context.restore()}return t.time<=this.duration_};var yAt=function(t){t=t||{},aAt.call(this,t),this.speed_=t.speed||0,this.side_=t.side||"left"};qm(yAt,aAt),yAt.prototype.animate=function(t){var e,r;!t.time&&this.speed_&&("left"==this.side_?(e=this.dx=t.extent[0]-t.bbox[2],r=this.dy=t.extent[3]-t.bbox[1]):(e=this.dx=t.extent[2]-t.bbox[0],r=this.dy=t.extent[3]-t.bbox[1]),this.duration_=Math.sqrt(e*e+r*r)/this.speed_/t.frameState.viewState.resolution);var n=t.geom.clone(),i=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*Math.cos(Math.PI/2*this.easing_(t.elapsed))),i.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,n,i),t.time<=this.duration_};var mAt=function(t){t=t||{},aAt.call(this,t),this.set("zoomout",t.zoomOut)};qm(mAt,aAt),qm((function(t){(t=t||{}).zoomOut=!0,mAt.call(this,t)}),mAt),mAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){this.get("zoomout")&&(e=1/e);var r,n,i=t.style,o=[];for(r=0;r<i.length;r++)(n=i[r].getImage())&&(o[r]=n.getScale(),"postrender"===t.type?n.setScale(o[r]*e/t.frameState.pixelRatio):n.setScale(o[r]*e));for(this.drawGeom_(t,t.geom),r=0;r<i.length;r++)(n=i[r].getImage())&&n.setScale(o[r])}return t.time<=this.duration_};class vAt extends DO{constructor(t,r){super(t,r),e(this,"animList"),this.animList=[],this.layertype="GraphicLayer",this.layer=new ta({source:this._source,zIndex:this.option.zIndex,declutter:this.option.declutter}),this.layer.set("layerid",t),this.layer.on("sourceready",(t=>{this.trigger(Em.onLoadEnd,t)})),this._source.on("addfeature",(t=>{t.feature.get("loadAnimation")&&setTimeout((()=>{this.animateFeature(t.feature,t.feature.get("loadAnimation"))}),1),t.feature.get("pulseAnimate")&&setTimeout((()=>{this.pulseAnimate(t.feature,t.feature.get("pulseAnimate"))}),1)})),this._source.on("removefeature",(t=>{t.feature.get("pulseAnimate")&&this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&e.anim.stop({user:!0})}))})),this.layer.on(this.EventType.featureType.onFeatureContextmenu,(t=>{this._setFeatureContextmenu(t.data.feature,t.data.contextmenu)})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}pathAnimate(t,e,r){let n={rotate:!0,speed:1,revers:!0,repeat:1/0,easing:wa};r=Object.assign({},n,r);let i=new AAt({path:e,rotate:r.rotate,speed:r.speed,repeat:r.repeat,revers:r.revers});return this.trigger(Em.onPathAnimateStart,{data:t}),i.on("animationend",(t=>{this.trigger(Em.onPathAnimateEnd,{data:t.feature})})),i.on("animating",(t=>{this.trigger(Em.onPathAnimateRunning,{data:t})})),this.layer.animateFeature(t,i)}pulseAnimate(t,e){let r={fade:va,duration:2e3,revers:!1,repeat:1/0,easing:va,radius:30,fillcolor:"rgba(255,0,0,0.2)",strokecolor:"red",strokewidth:1};e=Object.assign({},r,e);let n=new OO({graphicType:"PointGraphic",lnglat:t.getGeometry().getCoordinates(),style:{image:{radius:e.radius,scale:1,fill:{color:e.fillcolor},stroke:{color:e.strokecolor,width:e.strokewidth}},zIndex:990},attribute:{uuid:t.get("uuid")}}),i=new mAt(e);this.animList.push({uuid:t.get("uuid"),anim:this.layer.animateFeature(n,i)}),i.on("animationend",(t=>{this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&this.animList.splice(r,1)}))}))}animateFeatures(t,e){t.forEach(((t,r)=>{this.animateFeature(t,e)}))}animateFeature(t,e){let r,n={duration:3e3,animateType:km.Bounce,repeat:1,speed:.8,revers:!1,zoomOut:!1,side:!1};switch((e=Object.assign({},n,e)).animateType){case km.Blink:r=new uAt(e);break;case km.Drop:r=new hAt(e);break;case km.Fade:r=new cAt(e);break;case km.Path:r=new AAt(e);break;case km.Shake:r=new fAt(e);break;case km.Show:r=new pAt(e);break;case km.Slide:r=new dAt(e);break;case km.Teleport:r=new gAt(e);break;case km.Throw:r=new yAt(e);break;case km.Zoom:r=new mAt(e);break;case km.ZoomOut:e.zoomOut=!0,r=new mAt(e);break;default:r=new lAt(e)}this.layer.animateFeature(t,r)}}var _At=function(t){(t=t||{}).displacement||(t.displacement=[t.offsetX||0,-t.offsetY||0]),this.sanchor_="anchored"===t.kind?8:0,this._shadow=Number(t.shadow)||0,t.stroke||(t.stroke=new Rn({width:0,color:"#000"}));var e=t.stroke.getWidth();if(e<0&&(e=0),"folio"==t.kind&&(e+=6),t.stroke.setWidth(e),Ri.call(this,{radius:t.radius+e+this.sanchor_/2+this._shadow/2,points:0,displacement:[t.displacement[0]||0,(t.displacement[1]||0)+this.sanchor_],fill:Ri.prototype.render?new Fn({color:[0,0,0,0]}):null}),!this.getHitDetectionImage){var r=Ri.prototype.getImage.call(this);if(!this.hitDetectionCanvas_)for(var n in this)if(this[n]&&this[n].getContext&&this[n]!==r){this.hitDetectionCanvas_=this[n];break}this.hitDetectionCanvas_=document.createElement("canvas"),this.hitDetectionCanvas_.width=r.width,this.hitDetectionCanvas_.height=r.height;var i=this.hitDetectionCanvas_;this.getHitDetectionImage=function(){return i}}this._stroke=t.stroke,this._fill=t.fill,this._crop=t.crop,this._crossOrigin=t.crossOrigin,this._kind=t.kind||"default",this._radius=t.radius,this._src=t.src,this._offset=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0],this._onload=t.onload,"number"==typeof t.opacity&&this.setOpacity(t.opacity),"number"==typeof t.rotation&&this.setRotation(t.rotation),this.getImage()};qm(_At,Ri),_At.prototype.setOffset=function(t){this._offset=[t[0]||0,t[1]||0],this.getImage()},_At.prototype.clone=function(){var t=new _At({stroke:this._stroke,fill:this._fill,shadow:this._shadow,crop:this._crop,crossOrigin:this._crossOrigin,kind:this._kind,radius:this._radius,src:this._src,offsetX:this._offset[0],offsetY:this._offset[1],opacity:this.getOpacity(),rotation:this.getRotation()});return t.getImage(),t},CanvasRenderingContext2D.prototype.roundRect=function(t,e,r,n,i){return i?(r<2*i&&(i=r/2),n<2*i&&(i=n/2),this.beginPath(),this.moveTo(t+i,e),this.arcTo(t+r,e,t+r,e+n,i),this.arcTo(t+r,e+n,t,e+n,i),this.arcTo(t,e+n,t,e,i),this.arcTo(t,e,t+r,e,i),this.closePath()):this.rect(t,e,r,n),this},_At.prototype.drawBack_=function(t,e,r,n){var i=this._shadow,o=t.canvas;t.beginPath(),t.fillStyle=e,t.clearRect(0,0,o.width,o.height);var s=o.width/n,a=o.height/n;switch(this._kind){case"square":t.rect(0,0,s-i,a-i);break;case"circle":t.arc(this._radius+r,this._radius+r,this._radius+r,0,2*Math.PI,!1);break;case"folio":r-=6,t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=1;var l=s-i-12,u=Math.atan(6/l);t.save(),t.rotate(-u),t.translate(-6,2),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.save(),t.translate(6,-1),t.rotate(u),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.beginPath(),t.rect(6,6,l,l),t.stroke();break;case"anchored":t.roundRect(this.sanchor_/2,0,s-this.sanchor_-i,a-this.sanchor_-i,r),t.moveTo(s/2-this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2+this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2-i/2,a-i);break;default:t.roundRect(0,0,s-i,a-i,r)}t.closePath()},_At.prototype.getImage=function(t){t=t||1;var e,r=Ri.prototype.getImage.call(this,t);if(this._gethit)return r;var n=0;this._stroke&&(e=Kn(this._stroke.getColor()),n=this._stroke.getWidth()),this._gethit=!0;var i=this.getHitDetectionImage().getContext("2d");i.save(),i.setTransform(1,0,0,1,0,0),this.drawBack_(i,"#000",n,1),i.fill(),i.restore(),this._gethit=!1,(i=r.getContext("2d")).save(),i.setTransform(t,0,0,t,0,0),this.drawBack_(i,e,n,t),this._shadow&&(i.shadowColor="rgba(0,0,0,0.5)",i.shadowBlur=t*this._shadow/2,i.shadowOffsetX=t*this._shadow/2,i.shadowOffsetY=t*this._shadow/2),i.fill(),i.restore();var o=this,s=this.img_=new Image;if(this._crossOrigin&&(s.crossOrigin=this._crossOrigin),s.src=this._src,s.width?o.drawImage_(r,s,t):s.onload=function(){o.drawImage_(r,s,t),o._onload&&o._onload()},!this.getDisplacement){var a=this.getAnchor();a[0]=(r.width/t-this._shadow)/2-this._offset[0],this.sanchor_?a[1]=r.height/t-this._shadow-this._offset[1]:a[1]=(r.height/t-this._shadow)/2-this._offset[1]}return r},_At.prototype.getPhoto=function(){return this.img_},_At.prototype.drawImage_=function(t,e,r){var n=t.getContext("2d"),i=0;this._stroke&&(i=this._stroke.getWidth());var o,s,a,l,u,h,c,A,f,p=2*this._radius;n.save(),Ri.prototype.render&&n.setTransform(r,0,0,r,0,0),"circle"==this._kind&&(n.beginPath(),n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.clip()),this._crop?(A=f=(o=Math.min(e.width/p,e.height/p))*p,h=(e.width-A)/2,c=(e.height-f)/2,s=a=0,l=u=p+1):(h=c=0,s=(p-(l=(o=Math.min(p/e.width,p/e.height))*(A=e.width)))/2,a=(p-(u=o*(f=e.height)))/2),s+=i+this.sanchor_/2,a+=i,n.drawImage(e,h,c,A,f,s,a,l,u),"circle"==this._kind&&i&&(n.beginPath(),n.strokeStyle=Kn(this._stroke.getColor()),n.lineWidth=i/4,n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.stroke()),n.restore()};var wAt=function(t){(t=t||{}).loader=this._loader,t.strategy=aa,pa.call(this,t),this.set("time",t.time||new Date),this.set("step",t.step||1)};qm(wAt,pa),function(){function t(t){var e=Math.PI/180,r=t-2451545,n=280.46+.9856474*r,i=357.528+.9856003*r;return i%=360,{lambda:(n%=360)+1.915*Math.sin(i*e)+.02*Math.sin(2*i*e),R:1.00014-.01671*Math.cos(i*e)-.0014*Math.cos(2*i*e)}}function e(t){var e=(t-2451545)/36525;return 23.43929111-e*(46.836769/3600-e*(1831e-7/3600+e*(5.565e-7-e*(1.6e-10-4.34e-8*e/3600))))}function r(t,e){var r=180/Math.PI,n=Math.PI/180,i=Math.atan(Math.cos(e*n)*Math.tan(t*n))*r,o=Math.asin(Math.sin(e*n)*Math.sin(t*n))*r;return{alpha:i+=90*Math.floor(t/90)-90*Math.floor(i/90),delta:o}}wAt.prototype._loader=function(t,e,r){var n=this.getCoordinates(this.get("time")),i=new xn([n]);i.transform("EPSG:4326",r),this.addFeature(new X(i))},wAt.prototype.setTime=function(t){this.set("time",t),this.refresh()},wAt.prototype.getSunPosition=function(n){var i=(n?new Date(n):new Date)/864e5+2440587.5,o=(18.697374558+24.06570982441908*(i-2451545))%24,s=t(i),a=e(i),l=r(s.lambda,a);return[l.alpha-15*o,l.delta]},wAt.getNightLat=function(n,i){var o=180/Math.PI,s=Math.PI/180,a=(i?new Date(i):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=t(a),h=e(a),c=r(u.lambda,h),A=15*l+n-c.alpha;return Math.atan(-Math.cos(A*s)/Math.tan(c.delta*s))*o},wAt.prototype.getCoordinates=function(n,i){for(var o=180/Math.PI,s=Math.PI/180,a=(n?new Date(n):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=[],h=t(a),c=e(a),A=r(h.lambda,c),f=this.get("step")||1,p=-180;p<=180;p+=f){var d=p,g=15*l+d-A.alpha,y=Math.atan(-Math.cos(g*s)/Math.tan(A.delta*s))*o;u.push([d,y])}switch(i){case"line":break;case"day":A.delta*=-1;default:y=A.delta<0?90:-90;for(var m=180;m>=-180;m-=f)u.push([m,y]);u.push(u[0])}if("daynight"===i){var v=[];u.forEach((function(t){v.push(t.slice())})),v[0][1]=-v[0][1],v[v.length-1][1]=-v[0][1],v[v.length-1][1]=-v[0][1],u=[u,v]}return u}}();var bAt=function(t){t=t||{},this.source=t.source,this.nodes=new pa,this.maxIteration=t.maxIteration||2e4,this.stepIteration=t.stepIteration||2e3,this.astar=!0,this.candidat=[],D.call(this),this.set("epsilon",t.epsilon||1e-6)};qm(bAt,D),bAt.prototype.weight=function(){return 1},bAt.prototype.direction=function(){return 2},bAt.prototype.getLength=function(t){return t.getGeometry&&(t=t.getGeometry()),t.getLength()},bAt.prototype.getNodeSource=function(){return this.nodes},bAt.prototype.getEdges=function(t){var e=Ct(Et([t]),this.get("epsilon")),r=[];return this.source.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r},bAt.prototype.getNode=function(t){var e=Ct(Et([t]),this.get("epsilon")),r=[];return this.nodes.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r[0]},bAt.prototype.addNode=function(t,e,r,n,i){if(this.wdist&&e>this.wdist)return!1;var o=this.getNode(t),s=e+this.getLength(new Nn([this.end,t]))*this.weight();if(this.astar&&this.wdist&&s>this.wdist)return!1;if(o){if(o!==this.arrival&&o.get("wdist")<=e)return o;o.set("dist",r),o.set("wdist",e),o.set("dtotal",s),o.set("from",n),o.set("prev",i),o===this.arrival&&(this.wdist=e),this.candidat.push(o)}else o=new X({geometry:new on(t),from:n,prev:i,dist:r||0,wdist:e,dtotal:s}),e<0?o.set("wdist",!1):this.candidat.push(o),this.nodes.addFeature(o);return o},bAt.prototype.closestCoordinate=function(t){var e=this.source.getClosestFeatureToCoordinate(t),r=e.getGeometry().getFirstCoordinate(),n=e.getGeometry().getLastCoordinate();return aut(t,r)<aut(t,n)?r:n},bAt.prototype.path=function(t,e){if(this.running)return!1;if(t=this.closestCoordinate(t),this.end=this.closestCoordinate(e),t[0]===this.end[0]&&t[1]===this.end[1])return this.dispatchEvent({type:"finish",route:[],wDistance:-1,distance:this.wdist}),!1;var r=this;return this.nodes.clear(),this.candidat=[],this.wdist=0,this.running=!0,this.addNode(t,0),this.arrival=this.addNode(this.end,-1),this.nb=0,this.dispatchEvent({type:"start"}),setTimeout((function(){r._resume()})),[t,this.end]},bAt.prototype.resume=function(){this.running||this.candidat.length&&(this.running=!0,this.nb=0,this._resume())},bAt.prototype.pause=function(){this.running&&(this.nb=-1)},bAt.prototype.getBestWay=function(){for(var t,e,r=-1,n=0;e=this.candidat[n];n++)e.get("wdist")>r&&(t=e,r=e.get("wdist"));return this.getRoute(t)},bAt.prototype._resume=function(){if(this.running){for(;this.candidat.length;){this.candidat.sort((function(t,e){return t.get("dtotal")<e.get("dtotal")?1:t.get("dtotal")===e.get("dtotal")?0:-1}));for(var t,e=this.candidat.pop(),r=e.getGeometry().getCoordinates(),n=this.getEdges(r),i=0;t=n[i];i++){if(e.get("from")!==t){var o=this.getLength(t),s=e.get("wdist")+o*this.weight(t);o=e.get("dist")+o;var a=t.getGeometry().getFirstCoordinate(),l=t.getGeometry().getLastCoordinate(),u=this.direction(t);0!==u&&(r[0]===a[0]&&r[1]===a[1]&&-1!==u&&this.addNode(l,s,o,t,e),r[0]===l[0]&&r[0]===l[0]&&1!==u&&this.addNode(a,s,o,t,e))}if(-1===this.nb||this.nb++>this.maxIteration)return this.running=!1,void this.dispatchEvent({type:"pause",overflow:-1!==this.nb});if(!(this.nb%this.stepIteration)){var h=this;return window.setTimeout((function(){h._resume()}),5),void this.dispatchEvent({type:"calculating"})}}}this.nodes.clear(),this.running=!1,this.dispatchEvent({type:"finish",route:this.getRoute(this.arrival),wDistance:this.wdist,distance:this.arrival.get("dist")})}},bAt.prototype.getRoute=function(t){for(var e=[];t;)e.unshift(t.get("from")),t=t.get("prev");return e.shift(),e};var xAt=qv,EAt=function(t,e){return[Math.round(t[0]/e)*e,Math.round(t[1]/e)*e]},CAt=eA(R_),SAt=EAt;function BAt(t,e,r){return"FeatureCollection"===t.type?t.features.reduce((function(t,r){return BAt(r,e,t)}),r):e(r,t)}function IAt(t){return"LineString"===t.geometry.type}var TAt={compactNode:PAt,compactGraph:function(t,e,r,n){var i=(n=n||{}).progress,o=Object.keys(t).reduce((function(e,r,o,s){var a=t[r],l=Object.keys(a),u=l.length;return!(void 0!==n.compact&&!n.compact)&&(1===u?!t[l[0]][r]:2===u&&l.filter((function(e){return t[e][r]})).length===u)||(e[r]=a),o%1e3==0&&i&&i("compact:ends",o,s.length),e}),{});return Object.keys(o).reduce((function(s,a,l,u){var h=PAt(a,t,o,e,r,!1,n);return s.graph[a]=h.edges,s.coordinates[a]=h.coordinates,n.edgeDataReduceFn&&(s.reducedEdges[a]=h.reducedEdges),l%1e3==0&&i&&i("compact:nodes",l,u.length),s}),{graph:{},coordinates:{},reducedEdges:{}})}};function PAt(t,e,r,n,i,o,s){s=s||{};var a=e[t];return Object.keys(a).reduce((function(a,l){var u=function(t,e,r,n,i,o,s,a){var l=r[t][e],u=r[e][t],h=[],c=[],A=a.edgeDataSeed;for(a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][t]));!n[e];){var f=r[e];if(!f)break;var p=Object.keys(f).filter((function(e){return e!==t}))[0];if(l+=f[p],s){if(u+=r[p][e],c.indexOf(e)>=0){n[e]=r[e];break}c.push(e)}a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][p])),h.push(i[e]),t=e,e=p}return{vertex:e,weight:l,reverseWeight:u,coordinates:h,reducedEdge:A}}(t,l,e,r,n,i,o,s),h=u.weight,c=u.reverseWeight;if(u.vertex!==t&&((!a.edges[u.vertex]||a.edges[u.vertex]>h)&&(a.edges[u.vertex]=h,a.coordinates[u.vertex]=[n[t]].concat(u.coordinates),a.reducedEdges[u.vertex]=u.reducedEdge),o&&!isNaN(c)&&(!a.incomingEdges[u.vertex]||a.incomingEdges[u.vertex]>c))){a.incomingEdges[u.vertex]=c;var A=[n[t]].concat(u.coordinates);A.reverse(),a.incomingCoordinates[u.vertex]=A}return a}),{edges:{},incomingEdges:{},coordinates:{},incomingCoordinates:{},reducedEdges:{}})}var FAt=function(t,e){var r=(e=e||{}).keyFn||function(t){return t.join(",")},n=e.precision||1e-5,i=function(t,e){var r=[];return"FeatureCollection"===t.type&&(r=r.concat(t.features.filter(e))),{type:"FeatureCollection",features:r}}(t,IAt),o=CAt(i).features.reduce((function(t,i,o,s){var a=SAt(i.geometry.coordinates,n);return t[r(a)]=i.geometry.coordinates,o%1e3==0&&e.progress&&e.progress("topo:vertices",o,s.length),t}),{}),s=BAt(i,(function(t,i,o,s){return i.geometry.coordinates.forEach((function(e,o,s){if(o>0){var a=r(SAt(s[o-1],n)),l=r(SAt(e,n));t.push([a,l,i.properties])}})),o%1e3==0&&e.progress&&e.progress("topo:edges",o,s.length),t}),[]);return{vertices:o,edges:s}},LAt=TAt,MAt=eA(Zv).default,{point:OAt}=G_,kAt=function(t,e){var r,n=(e=e||{}).weightFn||function(t,e){return MAt(OAt(t),OAt(e))};"FeatureCollection"===t.type?r=FAt(t,e):t.edges&&(r=t),t=r.edges.reduce((function(t,i,o,s){var a=i[0],l=i[1],u=i[2],h=n(r.vertices[a],r.vertices[l],u),c=function(r){t.vertices[r]||(t.vertices[r]={},e.edgeDataReduceFn&&(t.edgeData[r]={}))},A=function(r,n,i){t.vertices[r][n]=i,e.edgeDataReduceFn&&(t.edgeData[r][n]=e.edgeDataReduceFn(e.edgeDataSeed,u))};return h&&(c(a),c(l),h instanceof Object?(h.forward&&A(a,l,h.forward),h.backward&&A(l,a,h.backward)):(A(a,l,h),A(l,a,h))),o%1e3==0&&e.progress&&e.progress("edgeweights",o,s.length),t}),{edgeData:{},vertices:{}});var i=LAt.compactGraph(t.vertices,r.vertices,t.edgeData,e);return{vertices:t.vertices,edgeData:t.edgeData,sourceVertices:r.vertices,compactedVertices:i.graph,compactedCoordinates:i.coordinates,compactedEdges:e.edgeDataReduceFn?i.reducedEdges:null}},NAt=TAt,RAt=EAt,UAt=DAt;function DAt(t,e){if(e=e||{},t.compactedVertices||(t=kAt(t,e)),this._graph=t,this._keyFn=e.keyFn||function(t){return t.join(",")},this._precision=e.precision||1e-5,this._options=e,0===Object.keys(this._graph.compactedVertices).filter((function(t){return"edgeData"!==t})).length)throw new Error("Compacted graph contains no forks (topology has no intersections).")}DAt.prototype={findPath:function(t,e){var r=this._keyFn(RAt(t.geometry.coordinates,this._precision)),n=this._keyFn(RAt(e.geometry.coordinates,this._precision));if(!this._graph.vertices[r]||!this._graph.vertices[n])return null;this._createPhantom(r),this._createPhantom(n);var i=function(t,e,r){var n={};n[e]=0;for(var i=new xAt([[0,[e],e]],(function(t,e){return t[0]-e[0]}));i.length;){var o=i.pop(),s=o[0],a=o[2];if(a===r)return o.slice(0,2);var l=t[a];Object.keys(l).forEach((function(t){var e=s+l[t];if(!(t in n)||e<n[t]){n[t]=e;var r=[e,o[1].concat([t]),t];i.push(r)}}))}return null}(this._graph.compactedVertices,r,n);if(i){var o=i[0];return{path:(i=i[1]).reduce(function(t,e,r,n){return r>0&&(t=t.concat(this._graph.compactedCoordinates[n[r-1]][e])),t}.bind(this),[]).concat([this._graph.sourceVertices[n]]),weight:o,edgeDatas:this._graph.compactedEdges?i.reduce(function(t,e,r,n){return r>0&&t.push({reducedEdge:this._graph.compactedEdges[n[r-1]][e]}),t}.bind(this),[]):void 0}}return null},serialize:function(){return this._graph},_createPhantom:function(t){if(this._graph.compactedVertices[t])return null;var e=NAt.compactNode(t,this._graph.vertices,this._graph.compactedVertices,this._graph.sourceVertices,this._graph.edgeData,!0,this._options);return this._graph.compactedVertices[t]=e.edges,this._graph.compactedCoordinates[t]=e.coordinates,this._graph.compactedEdges&&(this._graph.compactedEdges[t]=e.reducedEdges),Object.keys(e.incomingEdges).forEach(function(r){this._graph.compactedVertices[r][t]=e.incomingEdges[r],this._graph.compactedCoordinates[r][t]=[this._graph.sourceVertices[r]].concat(e.incomingCoordinates[r].slice(0,-1)),this._graph.compactedEdges&&(this._graph.compactedEdges[r][t]=e.reducedEdges[r])}.bind(this)),t},_removePhantom:function(t){t&&(Object.keys(this._graph.compactedVertices[t]).forEach(function(e){delete this._graph.compactedVertices[e][t]}.bind(this)),Object.keys(this._graph.compactedCoordinates[t]).forEach(function(e){delete this._graph.compactedCoordinates[e][t]}.bind(this)),this._graph.compactedEdges&&Object.keys(this._graph.compactedEdges[t]).forEach(function(e){delete this._graph.compactedEdges[e][t]}.bind(this)),delete this._graph.compactedVertices[t],delete this._graph.compactedCoordinates[t],this._graph.compactedEdges&&delete this._graph.compactedEdges[t])}};var QAt=function(t){t||(t={}),null==t.typing&&(t.typing=300);var e=document.createElement("DIV"),r=(t.className||"")+" ol-scale";t.target||(r+=" ol-unselectable ol-control"),this._input=document.createElement("INPUT"),this._input.value="-",e.setAttribute("class",r),!1===t.editable&&(this._input.readOnly=!0),e.appendChild(this._input),Bl.call(this,{element:e,target:t.target}),this._input.addEventListener("change",this.setScale.bind(this)),this.set("ppi",t.ppi||96)};qm(QAt,Bl),QAt.prototype.setMap=function(t){this._listener&&k(this._listener),this._listener=null,Bl.prototype.setMap.call(this,t),t&&(this._listener=t.on("moveend",this.getScale.bind(this)))},QAt.prototype.getScale=function(){var t=this.getMap();if(t){var e=function(t,e){var r=t.getView(),n=r.getProjection(),i=r.getCenter(),o=t.getPixelFromCoordinate(i);o[1]+=1;var s=t.getCoordinateFromPixel(o);return We(dr(i,n,"EPSG:4326"),dr(s,n,"EPSG:4326"))*((e||96)/.0254)}(t,this.get("ppi"));return this._input.value=this.formatScale(e),e}},QAt.prototype.formatScale=function(t){return"1 / "+(t=t>100?100*Math.round(t/100):Math.round(t)).toLocaleString()},QAt.prototype.setScale=function(t){var e=this.getMap();e&&t&&(t.target&&(t=t.target.value),function(t,e,r){if(t&&e){var n=e;if("string"==typeof e&&((n=e.split("/")[1])||(n=e),n=n.replace(/[^\d]/g,""),n=parseInt(n)),!n)return;var i=t.getView(),o=i.getProjection(),s=i.getCenter(),a=t.getPixelFromCoordinate(s);a[1]+=1;var l=t.getCoordinateFromPixel(a),u=We(dr(s,o,"EPSG:4326"),dr(l,o,"EPSG:4326"));u*=(r||96)/.0254,i.setResolution(i.getResolution()*n/u)}}(e,t,this.get("ppi"))),this.getScale()};var GAt=function(t){Zc.call(this,t)};qm(GAt,Zc),GAt.prototype.getExtent=function(){return this.getSource().getExtent()};var jAt=function(t){var e={attributions:t.attributions,logo:t.logo,projection:t.projection};this._image=t.image?t.image:new Image,this._image.crossOrigin=t.crossOrigin;var r=this;this._image.onload=function(){r.setCrop(r.crop),r.changed()},t.image||(this._image.src=t.url),e.canvasFunction=this.calculateImage,JR.call(this,e),this.center=t.imageCenter,this.setScale(t.imageScale),this.rotate=t.imageRotate?t.imageRotate:0,this.crop=t.imageCrop,this.mask=t.imageMask,this.setCrop(this.crop),this.on("change",function(){this.set("extent",this.calculateExtent())}.bind(this))};qm(jAt,JR),jAt.prototype.calculateImage=function(t,e,r,n){if(this.center){var i=document.createElement("canvas");i.width=n[0],i.height=n[1];var o=i.getContext("2d");if(!this._imageSize)return i;if(this.mask){o.beginPath();var s=f(this.mask[0]);o.moveTo(s[0],s[1]);for(var a=1;a<this.mask.length;a++)s=f(this.mask[a]),o.lineTo(s[0],s[1]);o.clip()}var l=f(this.center),u=(this._image.naturalWidth/2-this.crop[0])*this.scale[0]/e*r,h=(this._image.naturalHeight/2-this.crop[1])*this.scale[1]/e*r,c=this._imageSize[0]*this.scale[0]/e*r,A=this._imageSize[1]*this.scale[1]/e*r;return o.translate(l[0],l[1]),this.rotate&&o.rotate(this.rotate),o.drawImage(this._image,this.crop[0],this.crop[1],this._imageSize[0],this._imageSize[1],-u,-h,c,A),i}function f(e){return[(e[0]-t[0])/(t[2]-t[0])*n[0],(e[1]-t[3])/(t[1]-t[3])*n[1]]}},jAt.prototype.getCenter=function(){return this.center},jAt.prototype.setCenter=function(t){this.center=t,this.changed()},jAt.prototype.getScale=function(){return this.scale},jAt.prototype.setScale=function(t){switch(typeof t){case"number":t=[t,t];break;case"object":if(2!=t.length)return;break;default:return}this.scale=t,this.changed()},jAt.prototype.getRotation=function(){return this.rotate},jAt.prototype.setRotation=function(t){this.rotate=t,this.changed()},jAt.prototype.getGeoImage=function(){return this._image},jAt.prototype.getCrop=function(){return this.crop},jAt.prototype.setMask=function(t){this.mask=t,this.changed()},jAt.prototype.getMask=function(){return this.mask},jAt.prototype.setCrop=function(t){if(this._image.naturalWidth){if(t){switch(typeof t){case"number":t=[t,t,this._image.naturalWidth-t,this._image.naturalHeight-t];break;case"object":if(4!=t.length)return;break;default:return}t=Et([[t[0],t[1]],[t[2],t[3]]]),this.crop=[Math.max(0,t[0]),Math.max(0,t[1]),Math.min(this._image.naturalWidth,t[2]),Math.min(this._image.naturalHeight,t[3])]}else this.crop=[0,0,this._image.naturalWidth,this._image.naturalHeight];this.crop[2]<=this.crop[0]&&(this.crop[2]=this.crop[0]+1),this.crop[3]<=this.crop[1]&&(this.crop[3]=this.crop[1]+1),this._imageSize=[this.crop[2]-this.crop[0],this.crop[3]-this.crop[1]],this.changed()}else this.crop=t},jAt.prototype.getExtent=function(t){var e=this.get("extent");if(e||(e=this.calculateExtent()),t)for(var r=0;r<t.length;r++)t[r]=e[r];return e},jAt.prototype.calculateExtent=function(t){var e;if(!1!==t&&this.getMask())e=new xn([this.getMask()]);else{var r=this.getCenter(),n=this.getScale(),i=this.getGeoImage().width*n[0],o=this.getGeoImage().height*n[1];(e=En(Et([[r[0]-i/2,r[1]-o/2],[r[0]+i/2,r[1]+o/2]]))).rotate(-this.getRotation(),r)}return e.getExtent()};const HAt=Object.freeze(Object.defineProperty({__proto__:null,ArcGisFeatureServiceLayer:class extends vAt{constructor(t,r){super(t,r),e(this,"queryParams"),e(this,"isLoading"),e(this,"defaultExtent"),this.layertype="ArcGisFeatureServiceLayer",this.isLoading=!1,this.queryParams={f:"json",where:"1=1",outFields:"*",returnGeometry:"true",spatialRel:"esriSpatialRelIntersects",geometryType:"esriGeometryEnvelope",inSR:"102100",outSR:"102100",extent:null,extentWkid:"102100",onlyField:"OBJECTID",autoShowFeature:!1},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t={}){try{this.isLoading=!0;let e,r=this,n=this.option.url+"/query/",i=new Tut,o=Object.assign({},this.queryParams,t),s="";if(o.feature){let t=o.feature.getGeometry(),e=t.getType();if("Polygon"===e||"MultiPolygon"===e){let r=t;"Polygon"===e?r.getLinearRing(0):r.getLinearRings(),s=`{"rings":${JSON.stringify(r.getCoordinates())},"spatialReference":{"wkid":102100}}`}o.geometryType="esriGeometryPolygon",delete o.feature,delete o.extent,delete o.extentWkid}else o.extent&&("4326"===o.extentWkid&&(o.extent=gr(o.extent,"EPSG:4326","EPSG:3857")),delete o.extent,delete o.extentWkid,o.geometryType="esriGeometryEnvelope",s=`{"xmin":${o.extent[0]},"ymin":${o.extent[1]},"xmax":${o.extent[2]},"ymax":${o.extent[3]},"spatialReference":{"wkid":102100}}`);""!==s?e=Object.assign({},o,{geometry:s}):this.defaultExtent&&(o.geometryType="esriGeometryEnvelope",e=Object.assign({},o,{geometry:`{"xmin":${this.defaultExtent[0]},"ymin":${this.defaultExtent[1]},"xmax":${this.defaultExtent[2]},"ymax":${this.defaultExtent[3]},"spatialReference":{"wkid":102100}}`}));let a=!1;fetch(`${n}?${new URLSearchParams(e)}`).then((t=>t.json())).then((t=>{const e=i.readFeatures(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(o.onlyField)===e.get(o.onlyField)}))||t.push(e)})),r.addFeatures("arcgisFeature",t),r.trigger(Em.onFeaturesLoad,e)}})).catch((t=>{a||(a=!0)})).finally((()=>{this.isLoading=!1}))}catch(TX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},ArcGisMapServerLayer:xU,ArcGisTileXyzLayer:bU,ClusterImageLayer:class extends DO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.styleCache={},this.layertype="ClusterImageLayer",this.option={distance:40,imageFieldName:"主照片地址",animationDuration:600,maxResolution:40},this.option=Object.assign({},this.option,r),this._source=new pa,this.clusterSource=new zO({distance:this.option.distance,source:this._source}),this.layer=new yut({source:this.clusterSource,animationDuration:this.option.animationDuration,maxResolution:this.option.maxResolution,renderOrder:function(t,e){return e.getGeometry().getExtent()[1]-t.getGeometry().getExtent()[1]},style:(t,e)=>this.getFeatureStyle(t,e,"")}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype),this.selectCluster=new Th({layers:[this.layer],condition:pu,style:(t,e)=>this.getFeatureStyle(t,e,"sel")}),this.selectCluster.setActive(!0),this.selectCluster.getFeatures().on(["add"],(t=>{let e=t.target.getArray()[0].get("features");e&&this.trigger(Em.onFeatureSelected,e)})),this.selectCluster.getFeatures().on(["remove"],(function(t){}))}addFeaturesMN(t,e){var r,n,i,o;let s=t.getView().calculateExtent(t.getSize()),a=[];for(let l=0;l<e;++l)a[l]=new X(new on([s[0]+(s[2]-s[0])*Math.random(),s[1]+(s[3]-s[1])*Math.random()])),a[l].set("id",l),a[l].set("name","123123"),a[l].set("classname",l),a[l].set("thumbnail","");null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.clear(),null==(o=null==(i=this.clusterSource)?void 0:i.getSource())||o.addFeatures(a)}getFeatureStyle(t,e,r){let n,i=t.get("features")[0].get("uuid"),o=t.get("features")[0],s=t.get("features").length,a=o.get(this.option.imageFieldName);if(a=a.replace("_sss","_s"),n||(this.styleCache[i]=n=new Vi({image:new _At({src:a,radius:20,crop:!0,kind:s>1?"folio":"square",shadow:!0,onload:function(){try{t.changed()}catch{}},stroke:new Rn({width:2,color:"sel"===r?"rgba(0, 255, 0,1)":"#fff"})})})),s>1){let t=new Vi({image:new Ri({points:12,radius:9,fill:new Fn({color:"rgba(0, 255, 0,0.3)"})}),text:new Wi({text:s.toString(),font:"bold 12px helvetica,sans-serif",fill:new Fn({color:"#000"})})}),e=t.getImage().getAnchor();return e[0]-=20,e[1]+=20,[n,t]}return[n]}appendTo(t){var e,r;this._map=t,this.selectCluster&&(null==(e=this._map)||e.addInteraction(this.selectCluster)),this.layer&&(null==(r=this._map)||r.addLayer(this.layer))}},ClusterLayer:class extends DO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.option={convexhull:!0,animatesel:!0,haslink:!0,distance:40,popupInfo:"",popupOption:{offset:[0,0]},levelColor:[{maxnum:5e3,strokecolor:"rgba(192,0,0,0.5)",strokewidth:15,fillcolor:"rgba(192,0,0,1)"},{maxnum:1e3,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(255,165,0,1)"},{maxnum:500,strokecolor:"rgba(255,128,0,0.5)",strokewidth:15,fillcolor:"rgba(255,128,0,1)"},{maxnum:100,strokecolor:"rgba(0,191,255,0.5)",strokewidth:15,fillcolor:"rgba(0,191,255,1)"},{maxnum:50,strokecolor:"rgba(139,0,139,0.5)",strokewidth:15,fillcolor:"rgba(139,0,139,1)"},{maxnum:2,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(\t255,165,0,1)"}]},this.option=Object.assign({},this.option,r),this.styleCache={},this.layertype="ClusterLayer",this.clusterSource=new zO({distance:this.option.distance,source:this._source}),this.layer=new yut({zIndex:this.option.zIndex,source:this.clusterSource,style:this.getStyle.bind(this)}),this.layer.set("layerid",t);let n=new Di({radius:5,stroke:new Rn({color:"rgba(0,255,255,1)",width:1}),fill:new Fn({color:"rgba(0,255,255,0.3)"})}),i=new Vi({image:n}),o=new Vi({image:n,stroke:new Rn({color:"#fff",width:1})});this.selectCluster=new vut({layers:[this.layer],condition:pu,pointRadius:7,animate:this.option.animatesel,featureStyle:()=>[this.option.haslink?o:i],style:(t,e)=>{let r=t.get("features");if(r){if(r.length>1){let n=[this.getStyle(t,e)];if(this.option.convexhull&&_ut){let t=[];for(let n=0;n<r.length;n++)t.push(r[n].getGeometry().getFirstCoordinate());let e=_ut(t);n.push(new Vi({stroke:new Rn({color:"rgba(0,0,192,0.5)",width:2}),fill:new Fn({color:"rgba(0,0,192,0.3)"}),geometry:new xn([e]),zIndex:100}))}return n}return[new Vi({image:new Di({radius:5,stroke:new Rn({color:"rgba(255,0,0,0.5)",width:10}),fill:new Fn({color:"rgba(255,0,0,1)"})}),text:new Wi({text:r[0].getProperties().name,font:"13px Microsoft YaHei",offsetY:-15,fill:new Fn({color:"#8B4513"}),stroke:new Rn({color:"#fff",width:2})})})]}}}),this.selectCluster.getFeatures().on(["add"],(t=>{t.target.getArray()[0].get("features")})),this.selectCluster.getFeatures().on(["remove"],(function(t){})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}appendTo(t){var e;this._map=t,this._map.addInteraction(this.selectCluster),this.layer&&(null==(e=this._map)||e.addLayer(this.layer))}showTitle(t,e){new Promise(((r,n)=>{this._source.getFeatures().forEach((r=>{let n=r.getProperties();if(t===n.dataType)try{r.getStyle().getText().setText(e?r.get("name"):"")}catch(TX){}})),this.layer.changed()}))}addFeaturesMN(t,e){var r,n;let i=t.getView().calculateExtent(t.getSize()),o=[];for(let s=0;s<e;++s)o[s]=new X(new on([i[0]+(i[2]-i[0])*Math.random(),i[1]+(i[3]-i[1])*Math.random()])),o[s].set("id",s),o[s].set("name","123123"),o[s].set("classname",s);null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.addFeatures(o)}getStyle(t,e){let r=t.get("features").length,n=this.styleCache[r];return 1===r?n=this.styleCache[r]=t.get("features")[0].getStyle():n||(this.option.levelColor.sort((function(t,e){return t.maxnum-e.maxnum})),this.option.levelColor.forEach((t=>{let e=Math.max(8,Math.min(.75*r,20));r>=t.maxnum&&(n=this.styleCache[r]=new Vi({image:new Di({radius:e,stroke:new Rn({color:t.strokecolor,width:t.strokewidth,lineCap:"butt"}),fill:new Fn({color:t.fillcolor})}),text:new Wi({text:r.toString(),fill:new Fn({color:"#fff"})})}))}))),n}},DayNightLayer:class extends DO{constructor(t,e){super(t,e),this.layertype="DayNightLayer",this._source=new wAt({}),this.layer=new ta({source:this._source,zIndex:500,style:new Vi({image:new Di({radius:5,fill:new Fn({color:"red"})}),fill:new Fn({color:[0,0,50,.5]})})}),this.layer.set("layerid",t),this._source.on("addfeature",(t=>{}))}setDataTime(t){this._source.setTime(t)}},DivLayer:class extends Im{constructor(t,r){super(t,r),e(this,"DivGraphicList"),this.layertype="DivLayer",this.layerid=t,this.DivGraphicList=[],this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.layerid===t&&this.DivGraphicList.length>0&&this.removeAll()}))}getDivList(){return this.DivGraphicList}addDiv(t){this.DivGraphicList.push(t),this._map.addOverlay(t)}removeDiv(t){this._map.removeOverlay(t),this.DivGraphicList.forEach(((e,r,n)=>{if(e===t)return this.DivGraphicList.slice(r,1),void this.trigger(Em.onFeatureDeleted,{value:e})}))}removeAll(){this.DivGraphicList.forEach((t=>{this._map.removeOverlay(t),this.trigger(Em.onFeatureDeleted,{element:t})})),this.DivGraphicList=[]}appendTo(t){this._map=t}},GeoImageLayer:class extends wU{constructor(t,r){super(t,r),e(this,"GraphicLayer"),e(this,"graphic");let n={imageCenter:[0,0],imageScale:[1,1],imageRotate:0,imageMask:null,ImageExtentWKID:Lm.EPSG3857,opacity:1,hashEdit:!1};this.option=Object.assign({},n,this.option),this.GraphicLayer=null,this.graphic=null,this.option.ImageExtentWKID===Lm.EPSG4326&&(this.option.imageCenter=hr(this.option.imageCenter)),this.layertype="GeoImageLayer",this.layerSource=new jAt({url:this.option.url,imageMask:this.option.imageMask,imageCenter:this.option.imageCenter,imageScale:this.option.imageScale,imageRotate:Number(this.option.imageRotate*Math.PI/180)}),this.layer=new GAt({source:this.layerSource,opacity:this.option.opacity}),this.layer.set("layerid",t),this.layerSource.on("imageloadend",(t=>{this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.trigger(this.EventType.LayerEventType.tileloadend,t)})),this.layerSource.on("change",(t=>{this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent())})),this.layerSource.on("tileloaderror",(function(){})),this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.GraphicLayer&&this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}))}getAttribute(){return this.option}startEdit(t){this.option.hashEdit=!0,this.GraphicLayer=t,this.graphic?this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic):this.setExtent()}endEdit(){this.option.hashEdit=!1,this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}setExtent(){this.graphic||(this.graphic=new RO({graphicType:"PolygonGraphic",style:{stroke:{color:"rgba(255, 0, 0,0)",width:0},fill:{color:"rgba(255, 0, 0,0)"},zIndex:800},attribute:{name:this.layerid+"_graphic",movestate:!1,editallows:!1}}),this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic),this.graphic.set("Scale",this.option.imageScale),this.graphic.on("onRotating",(t=>{this.option.imageRotate=t.data,this.layerSource.setRotation(t.data)})),this.graphic.on("onScaling",(t=>{this.option.imageScale=[t.data,t.data],this.layerSource.setScale(t.data)})),this.graphic.on("onMoveing",(t=>{this.option.imageCenter=t.data,this.layerSource.setCenter(t.data)})))}setScale(t){this.graphic.set("Scale",t),this.layerSource.setScale(t)}computeAutoScale(t){let e=jt(t)/jt(this.layerSource.getExtent());this.graphic.set("Scale",[e,e]),this.layerSource.setScale([e,e])}getGraphic(){return this.graphic}},GraphicImageLayer:QO,GraphicLayer:vAt,HeatmapLayer:class extends DO{constructor(t,e){super(t,e),this.layertype="HeatmapLayer",this._source=new pa({wrapX:!1}),this.option={blur:25,radius:8,gradient:["#00f","#0ff","#0f0","#ff0","#f00"]},this.option=Object.assign({},this.option,e),this.layer=new jc({source:this._source,zIndex:this.option.zIndex,gradient:this.option.gradient,blur:this.option.blur,radius:this.option.radius}),this.layer.set("layerid",t)}setBlur(t){this.layer.setBlur(parseInt(t,10))}setRadius(t){this.layer.setRadius(parseInt(t,10))}},ImageCanvasLayer:class extends Im{constructor(t,r){if(super(t,r),e(this,"scale"),e(this,"ppi"),e(this,"layerOption"),e(this,"drawText"),this.option={},this.layerOption={line1Style:"rgba(255,0,0, 0.1)",line1Width:.5,line5Style:"rgba(255,0,0, 0.3)",line5Width:1,line10Style:"rgba(255,0,0, 0.5)",line10Width:2,lineRectStyle:"rgba(255, 0, 0, 1)",lineRectWidth:5},this.layerOption=Object.assign({},this.layerOption,r),this.layertype="ImageCanvasLayer",this.layer=new Zc({zIndex:r.zIndex}),!document.getElementById("hutia")){let t=document.createElement("div");t.setAttribute("id","hutia"),t.style.width="1cm",document.body.appendChild(t)}this.layer.setSource(new JR({canvasFunction:(t,e,r,n,i)=>{let o=document.createElement("canvas");this.trigger(Em.onScaleChange,{Scale:Math.round(this.scale.getScale())});let s=this._map.getSize(),a=new Array(2);a[0]=n[0]-s[0],a[1]=n[1]-s[1],o.width=n[0],o.height=n[1],a[0]=0,a[1]=0;const l=this.ppi/2.54/10;let u=a[0]/2,h=a[1]/2,c=o.width-a[0],A=o.height-a[1],f=o.getContext("2d");f.clearRect(u,h,c,A);let p=0;for(let d=h;d<o.height-h;d+=l)f.beginPath(),f.moveTo(u,d),f.lineTo(o.width-u,d),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;p=0;for(let d=u;d<o.width-u;d+=l)f.beginPath(),f.moveTo(d,h),f.lineTo(d,o.height-h),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;return f.lineWidth=this.layerOption.lineRectWidth,f.strokeStyle=this.layerOption.lineRectStyle,f.strokeRect(u,h,c,A),o}})),this.layer.set("layerid",t),this.layer.on(Em.onClick,(t=>{t.feature&&this.trigger(Em.onClick,t.feature.getProperties())}))}setScale(t){this.scale.setScale(t)}setText(t){this.drawText.updateHtml(t)}setElementStyle(t,e){this.drawText.updateElementStyle(t,e)}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0);let r=document.getElementById("hutia").offsetWidth,n=screen.width/r,i=screen.height/r,o=Math.round(Math.sqrt(n*n+i*i)/2.54);this.ppi=Math.sqrt(window.screen.width*window.screen.width+window.screen.height*window.screen.height)/o,this.ppi=Math.round(this.ppi),this.scale=new QAt({}),this.scale.set("ppi",this.ppi),this.scale.set("Visible",!1),this._map.addControl(this.scale),this.drawText=new $lt({}),this._map.addControl(this.drawText),this._map.getView().on("change",(t=>{this.layer.getSource().changed()})),document.querySelector(".ol-scale").style.display="none"}setMouseLock(t=!1){let e,r;this._map.getInteractions().forEach((function(n){n instanceof bu&&(e=n),n instanceof ju&&(r=n),e&&e.setActive(t),r&&r.setActive(t)}))}},PathLayer:class extends Im{constructor(t,r){super(t,r),e(this,"autoPointSize"),e(this,"result"),e(this,"resultlayer"),e(this,"resultSource"),e(this,"nodesLayer"),e(this,"dijkstra"),e(this,"pathDatalayer"),e(this,"animating"),e(this,"distance"),e(this,"lastTime"),e(this,"pathLine"),e(this,"position"),e(this,"geoMarker"),e(this,"styles"),e(this,"vueThis"),e(this,"pathLineFeature"),e(this,"lastAngle"),e(this,"pathIndex"),e(this,"pathNodeInfo"),e(this,"geoMarkerCircle"),e(this,"moveNodeInfo"),e(this,"FeatureMoveProgressInfo"),e(this,"oldPathLineFeature"),e(this,"routeFeatures"),e(this,"_source"),e(this,"multiLinePathData"),e(this,"timer"),e(this,"fun",(t=>{this.vueThis.moveFeature(t)})),this.option=SO.merge({roadNetworkData:"",pathDefaultStyle:{color:"rgba(255, 255, 255, 0.1)",width:1},pathStyle:{color:"#089519",width:10,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACISURBVDhP3Yy9CYAwFIQzg+ASTuFmuokjuIaFpb2Vc8S7vEswKFE78YOD5H6e+zne+xqq9H0Hhj0U6WU/gwPbZTw7gmJn/UvKR1iwXmKRjlwfYWB5gsNGKh+hYX4ijBUzLx/BZzUvkI0j9JRFNkUhHM3zE3QaR5hBM4tgkG3AaPW85U338zi3A+g3FErF6/qjAAAAAElFTkSuQmCC"},trackPathStyle:{color:"rgba(180,205,205, 1)",width:10},geoMarkerStyle:{url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAlCAYAAABGWhk4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABYgAAAWIBXyfQUwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAYGSURBVEiJlZdvaFvXFcB/7+mPI8lvjmxHil0vKkuq1bCuYbVsQrDxFup9aSAezA5pExpGRh26hdF0FOIv+9CyrLCh7dvABARmyIWB6Qad69Ik1PH8h67E0C6anbqTI8myZUeWZE1/nu4+6D7n2VZpcuCgq/vu/d37zjvn3HMVIQS1RFEUxWiaFECYFPE1AGtN6iNRAYv8VWVfRaouf2tKTbDcrQG1AXbZRgKLprGVWrtW93ZIqCJBdsAB1Mfj8d/H4/F3gXrZZyymmMz2SIQQu1RCrYATaAKeDoVC54WUUCh0HnhaPnPKscpejmJ+C5MJrMABQAMOpjY2xgpW13cB6sq5e02NjQPAQyAD/A8oA7tMstcUe8Gu8fHxM41ud/u1Ww/Ua7ceqI1ud/v4+PgZwCXHWOWc3ebYYwKLHOwGfG1tbV2ZbG51IZnT1bdnhfr2rFhI5vRMNrfa1tbWBfjk2AOGvQ2eecfm3dYBznA4fKHe5fS8MbmiVgRUBLwxuaLWu5yecDh8Qdq4rtauVZNtjY9mBxx9fX0tL3QEXv3wyy0xcT+9s/rE/TQffrklXugIvNrX19fCIw+xYvIQ1QRVzeBgMPia3W5zvPlRdJ8rvflRVLHbbY5gMPjaHrBqwC01TOC6evVq++DZs78JLaTUqWiWn//Aw7s/ahOXjh/icL1d+WI9j9OmKj9sb3t2e3t74s6dOymgxKNo3Oe3h4BjiURiUgghbi5vGe4r1lOp5fVUatn4bzxLJBKTwDE5d8evDTvbqEaUd2xsbNCYXNb10szMzGh/f//LwIvAi/39/S/PzMyMlnW9ZIwbGxsbBLySYTO+3S7ww4dbt4QQIrm29unQ0NArQC/QA3RL7QF6h4aGXkmurX0qhBDp9NYne8H7XGx+fv58Op22njp16pb8KCpAIBCoB5ibm8vKb1gBihMTEz1ut7sQCAT+AuSoJqiyERRGYLiohrHW0NDQEA6Hf+L3+497PJ5jLpfLC5DL5VaTyeRiJBL5bHBw8K/pdDpNNbS3gG2qIa4jd+sAGoEjwPeHh4cvbm5uLgqTFPWKKOoVc5fY3NxcHB4evgg8J+c2SpZVka9bJ+1z8ObNmxd7enp+pSiK9at0kd9Nx5mN5VhIbgPwnMdJZ6uLX59owddgRwhRvn379h96e3tvUE1MWaBgkVAHoF2/fr3r3Llzv1UUxfrnf63R/94iUytZYtkSugBdQCxbYi6eY+SzdZqcVjpaXKrP5+tyOp1zk5OTCaqZTleAbwGa3+9vnZ+ff0/TNN+f5lb55cR/9wZcTflj3xF+EfCSyWS+6ujo+GkkEokBmZ0UOTo6ekHTNN/iZoG3Pl55LCjAWx+vsLhZQNM03+jo6AXpBNad/NDa2noc4J2pGNulrz0j98l2qcI7UzEAJMNugC2A1e12Pwvwzwe5x4YaYsyRDCtgUQF1YGCg2eFwNGeKOvdS+ScG30vlyRR1HA5H88DAQDOgqoCIRqMFIYSos6jY1P0H7jeJTVWos6gIIUQ0Gi0AQgUq09PTW7lcbsVuUXje63xi8PNeJ3aLQi6XW5ment4CKirV8CttbGz8G6DniPbEYGOOZJQAXaXq0MVIJDIFcO1kC09p9seGPqXZuXayBQDJ2ElCGtVwbkwkEiNer7frH/fTvBT+D+VK7YLREKuq8LfBZ/jxdxpYXV2dOXz48M+ADSBrLvjUeDx+9/Tp02f8zc66l545yJ2VLMntck3o9w45+PtZP93f1iiVSpnLly8PLSwsJKhmuAJUE7OL6tFydGRk5FI+n08KIUShrIvQ3XXx+gfL4sSNz8WJG5+L1z9YFqG766JQ1oUQQuTz+eTIyMgl4KhkuCRzp/jTAA9wtLu7++TS0tL74htkaWnp/e7u7pMS6pEMO2CpdfQfoJrtXMFgsKOzs7OztbW1vampyQ+QSqUisVjsi9nZ2dkrV67MUz018lQTfBFZxylCiFr1sI1qOq1jd80A1SOpLCEFqSVMx78QQuxUmya4sYBFAo22+aqgSy2b2hVMFWetMtasxkK17iDGlWHnTmIuY/8P3C0FYo4OztIAAAAASUVORK5CYII="},navigationOption:{defaultZoom:15,turnToZoom:17,speed:1,tracking:!0,trackingDirection:!0,showNode:!0,showStartEndNode:!0,showPathLine:!0,scale:1,pointDistance:.5}},r,!0),this.layertype="PathLayer",this._source=new pa({wrapX:!1,url:this.option.roadNetworkData,format:new Df}),this._source.on("featuresloadend",(t=>{let e=[];t.features.forEach((t=>{let r=t.getGeometry();e.push(r.getCoordinates())})),this.multiLinePathData=new X({geometry:new th(e)})}));let n=[];this.pathDatalayer=new ta({source:this._source,zIndex:900,style:new Vi({stroke:new Rn({width:this.option.pathDefaultStyle.width,color:this.option.pathDefaultStyle.color}),fill:new Fn({color:this.option.pathDefaultStyle.color})})}),this.vueThis=this,this.styles={route:new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]})}),icon:new Vi({image:new Us({anchor:[.5,1],src:"data/icon.png"})}),geoMarker:new Vi({zIndex:999,image:new Us({src:this.option.geoMarkerStyle.url,rotation:0,rotateWithView:!1})})},this.resultSource=new pa,this.resultlayer=new ta({source:this.resultSource,zIndex:200,updateWhileAnimating:!0,updateWhileInteracting:!0}),this.position=new on([0,0]),this.geoMarker=new X({geometry:this.position}),this.geoMarker.setStyle(this.styles.geoMarker),this.resultSource.addFeature(this.geoMarker),this.resultlayer.on("change",(t=>{})),this.dijkstra=new bAt({source:this._source}),this.dijkstra.on("start",(t=>{this.resultSource.clear()})),this.dijkstra.on("finish",(t=>{if(this.resultSource.clear(),!t.route.length)return void this.trigger(Em.onPathComputerComplete,{pathLine:null,distance:0});if(this.routeFeatures=t.route,this.pathNodeInfo=bO.lineMerger(t.route,this.option.navigationOption.pointDistance),this.pathLineFeature=this.pathNodeInfo.line,this.pathLine=this.pathLineFeature.getGeometry(),this.option.navigationOption.totalDistance=Ye(this.pathLine)*this.option.navigationOption.scale,this.option.navigationOption.showNode){let t=0;this.pathLine.forEachSegment(((e,r)=>{let n=new X({geometry:new on(e)});n.setStyle(new Vi({image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:t.toString(),font:"12px sans-serif",fill:new Fn({color:"white"})})})),t++,this.resultSource.addFeature(n)}))}this.position.setCoordinates(this.pathLine.getFirstCoordinate()),this.setNavigationMarker(this.pathLine.getFirstCoordinate(),0),this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom)),this.geoMarkerCircle=new X({geometry:new Zu(this.pathLine.getFirstCoordinate(),50)}),this.oldPathLineFeature=new X({geometry:new Nn([this.pathLine.getFirstCoordinate()])}),this.oldPathLineFeature.setStyle(new Vi({stroke:new Rn({color:this.option.trackPathStyle.color,width:this.option.trackPathStyle.width})})),this.pathLineFeature.setStyle(this.styleFunc.bind(this)),this.geoMarkerCircle.setStyle(new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]}),fill:new Fn({color:"rgba(255, 255, 255, 0.1)"})})),this.option.navigationOption.showPathLine&&(this.resultSource.addFeature(this.geoMarker),this.resultSource.addFeature(this.oldPathLineFeature),this.resultSource.addFeature(this.pathLineFeature));let e=Ye(this.pathLineFeature.getGeometry());this.trigger(Em.onPathComputerComplete,{pathLine:this.pathLineFeature,distance:e})})),this.dijkstra.on("pause",(t=>{t.overflow&&this.dijkstra.resume()})),this.dijkstra.on("calculating",(t=>{let e=this.dijkstra.getBestWay();this.resultSource.clear(),this.resultSource.addFeatures(e)})),this.nodesLayer=new ta({source:this.dijkstra.getNodeSource(),style:new Vi({image:new Di({radius:5,fill:new Fn({color:[255,0,0,.1]})})})}),n.push(this.nodesLayer),n.push(this.resultlayer),n.push(this.pathDatalayer),this.layer=new Da({layers:n}),this.layer.set("layerid",t),this.animating=!1,this.distance=0,this.lastTime}styleFunc(t,e){let r=[];r.push(new Vi({stroke:new Rn({color:this.option.pathStyle.color,width:this.option.pathStyle.width})}));const n=t.get("geometry");if("linestring"===n.getType().toLowerCase()){const t=n.getCoordinates(),i=n.getLength(),o=80*e,s=Math.ceil(i/o);for(let e=1;e<s;e++){const t=e/s,i=n.getCoordinateAt(t),o=n.getCoordinateAt(t+.05*t),a=o[0]-i[0],l=o[1]-i[1],u=Math.atan2(l,a);r.push(new Vi({geometry:new on(i),image:new Us({scale:.8,rotateWithView:!0,rotation:-u,src:this.option.pathStyle.imageUrl})}))}this.option.navigationOption.showStartEndNode&&(r.push(new Vi({geometry:new on(t[0]),image:new Di({radius:12,fill:new Fn({color:"green"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"起",font:"12px sans-serif",fill:new Fn({color:"white"})})})),r.push(new Vi({geometry:new on(t[t.length-1]),image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"终",font:"12px sans-serif",fill:new Fn({color:"white"})})})))}return r}moveFeature(t){this.resultlayer.changed();const e=t.frameState.time,r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,this.trigger(Em.onFeatureMoveProgress,{progress:this.distance,distance:this.distance,elapsedTime:r}),this.distance>=1)this.stopAnimation();else{const e=this.pathLine.getCoordinateAt(this.distance);let n,i=(this.distance+this.option.navigationOption.speed*r/1e6)%2;n=i>=1?this.pathLine.getLastCoordinate():this.pathLine.getCoordinateAt(i);let o=this.setAngle(e,n);this.position.setCoordinates(e),this.option.navigationOption.tracking?(this._map.getView().setCenter(e),this._map.getView().setRotation(o.viewAngle)):this.styles.geoMarker.getImage().setRotation(o.markAngle);const s=function(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var e=t.inversePixelTransform[0],r=t.frameState,n=pt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ks(r.viewState.resolution,e);return new bs(t.context,e,r.extent,n,r.viewState.rotation,i,void 0)}(t);s.setStyle(this.styles.geoMarker),s.drawGeometry(this.position),this._map.render()}}setAngle(t,e){let r=e[1]-t[1],n=e[0]-t[0],i=1,o=Math.atan(r/n);r<=0&&n>=0?(i=2,o=-o):n>=0&&r>=0?(o=-o,i=1):n<=0&&r>=0?(o=Math.PI-o,i=4):n<=0&&r<=0&&(o=Math.PI-o,i=3);let s=Math.atan2(1,0);return{viewAngle:-s-o,markAngle:s+o,Angle:s-Math.atan2(r,n),xx:i}}startAnimation(t=!0,e=!0,r=10){this.lastAngle=0,this.distance=0,this.animating=!0,this.lastTime=Date.now(),this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(15),this.resultlayer.addEventListener("postrender",this.fun)}pauseAnimation(){this.resultlayer.removeEventListener("postrender",this.fun)}resumeAnimation(){this.resultlayer.addEventListener("postrender",this.fun)}stopAnimation(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),this.resultlayer.removeEventListener("postrender",this.fun)}startAnimation2(t){clearInterval(this.timer),t&&(this.option.navigationOption=Object.assign({},this.option.navigationOption,t)),this.distance=0,this.animating=!0,this.lastTime=Date.now(),this.pathNodeInfo.nodeData.length>3?this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[2]}:this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[1]},this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom),this._map.getView().setRotation(this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)).viewAngle)),this.oldPathLineFeature.getGeometry().setCoordinates([this.pathLine.getFirstCoordinate()]),this.pathIndex=0,this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.pathIndex/this.pathNodeInfo.coordinates.length,remainingDistance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*(this.pathIndex/this.pathNodeInfo.coordinates.length),nextNodeDistance:this.moveNodeInfo.currentNode.distance*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:this.ComputDirection()},this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),1)}stopAnimation2(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),clearInterval(this.timer)}pauseAnimation2(){clearInterval(this.timer)}resumeAnimation2(){this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),100)}moveFeature3(t){const e=(new Date).getTime(),r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,t>=this.pathNodeInfo.coordinates.length)this.stopAnimation2();else{const e=hr(this.pathNodeInfo.coordinates[t]);this.oldPathLineFeature.getGeometry().appendCoordinate(e),this.oldPathLineFeature.getGeometry().changed();let r=Ye(new Nn([e,hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale;if(this.position.setCoordinates(e),this.geoMarker.getGeometry().setCoordinates(e),this.geoMarkerCircle.getGeometry().setCenter(e),this.FeatureMoveProgressInfo.nodeNum=this.moveNodeInfo.currentNode.coordIndex,this.FeatureMoveProgressInfo.nextNodeDistance=r,this.FeatureMoveProgressInfo.progress=t/this.pathNodeInfo.coordinates.length,this.FeatureMoveProgressInfo.remainingDistance=this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.FeatureMoveProgressInfo.progress,r<=1*this.option.navigationOption.speed){let t=this.moveNodeInfo.currentNode.coordIndex+1;if(t<this.pathNodeInfo.nodeData.length-1){this.moveNodeInfo.currentNode=this.pathNodeInfo.nodeData[t],this.moveNodeInfo.nextNode=this.pathNodeInfo.nodeData[t+1],t<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[t+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):this.FeatureMoveProgressInfo.angle="直行";let e=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(e.viewAngle):this.styles.geoMarker.getImage().setRotation(e.markAngle)}}this.trigger(Em.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.option.navigationOption.tracking&&this._map.getView().setCenter(e)}}moveFeature2(){const t=(new Date).getTime(),e=t-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*e/1e6)%2,this.lastTime=t,this.distance>=1)this.stopAnimation2();else{const t=this.pathLine.getCoordinateAt(this.distance);let r,n=Ye(new Nn([t,hr(this.moveNodeInfo.nextNode.coords)]));if(this.position.setCoordinates(t),this.geoMarker.getGeometry().setCoordinates(t),this.geoMarkerCircle.getGeometry().setCenter(t),n<100){let t=bO.movePointContain(this.geoMarkerCircle,this.pathNodeInfo.nodeData);if(-1!==t.coordIndex&&t.coordIndex!==this.moveNodeInfo.currentNode.coordIndex&&t.coordIndex<=this.moveNodeInfo.currentNode.coordIndex+2){this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[t.coordIndex],nextNode:this.pathNodeInfo.nodeData[t.coordIndex+1],threeNode:this.pathNodeInfo.nodeData[t.coordIndex+2]};let n=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),i=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),o=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),s=(i[0]-n[0])*(o[1]-i[1])-(i[1]-n[1])*(o[0]-i[0]),a=this.setAngle(hr(this.moveNodeInfo.nextNode.coords),hr(this.moveNodeInfo.threeNode.coords));this.trigger(Em.onFeatureMoveProgress,{nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.distance,distance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.distance,elapsedTime:e,nextNodeDistance:this.moveNodeInfo.currentNode.distance,nextNodeDirection:a.markAngle,angle:s>0?"右":"左",xx:a.xx}),r=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)),this.option.navigationOption.tracking?this._map.getView().setRotation(r.viewAngle):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}this.option.navigationOption.tracking?this._map.getView().setCenter(t):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}ComputDirection(){let t=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),e=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),r=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),n=(e[0]-t[0])*(r[1]-e[1])-(e[1]-t[1])*(r[0]-e[0]);return 0===n?"直行":n>0?"右":"左"}getNearestPointOnPathNetWork(t){let e;return e=t instanceof X?t:new X({geometry:new on(t)}),bO.nearestPointOnLine(e,this.multiLinePathData)}addNavigationMarker(){this.resultSource.addFeature(this.geoMarker)}setNavigationMarker(t,e=0){let r;r=t instanceof X?t:new X({geometry:new on(t)}),this.position.setCoordinates(r.getGeometry().getCoordinates());let n=bO.nearestPointOnLine(r,this.multiLinePathData);this.geoMarker.setGeometry(n.getGeometry()),this.styles.geoMarker.getImage().setRotation(e),this.pathLineFeature&&this.resultSource.hasFeature(this.pathLineFeature)&&this.updateNavigationMarker(n)}updateNavigationMarker(t){let e=new X({geometry:new on(this.pathLine.getFirstCoordinate())});new X({geometry:new on(this.pathLine.getLastCoordinate())});let r=bO.lineSlice(e,t,this.pathLineFeature);this.pathIndex=t.get("index"),this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[this.pathIndex],nextNode:this.pathNodeInfo.nodeData[this.pathIndex+1]};let n=Ye(r.getGeometry())*this.option.navigationOption.scale;this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:n/this.option.navigationOption.totalDistance,remainingDistance:this.option.navigationOption.totalDistance-n,nextNodeDistance:Ye(new Nn([t.getGeometry().getCoordinates(),hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:""},this.pathIndex<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+1],this.FeatureMoveProgressInfo.angle="直行"),this.trigger(Em.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.oldPathLineFeature.setGeometry(r.getGeometry()),this.oldPathLineFeature.getGeometry().changed();let i=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(i.viewAngle):this.styles.geoMarker.getImage().setRotation(i.markAngle),this.option.navigationOption.tracking&&this._map.getView().setCenter(t.getGeometry().getCoordinates())}getPathLine(){return this.pathLine}computerPath(t,e){let r,n;r=t instanceof X?t.getGeometry().getCoordinates():t,n=e instanceof X?e.getGeometry().getCoordinates():e,clearInterval(this.timer),this.resultSource.clear(),this.dijkstra.path(r,n)}computerPath2(t,e){let r=this.getFile("../public/tempData/铁路_简版.json","text/json"),n=this.formatJsonTo4326Json(JSON.parse(r)),i=new UAt(n,{weightFn:function(t,e,r){let n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)}}),o=bO.featureTo4326(t),s=bO.featureTo4326(e);i.findPath(o,s)}addGeoJsonUrl(t,e){let r=this.getFile(e,"text/json"),n=this.formatJsonTo3857(JSON.parse(r));this.addFeatures(t,n)}addGeoJson(t,e){this.addFeatures(t,this.formatJsonTo3857(e))}convertGeoJsontoFeatures(t){return this.formatJsonTo3857(t)}addFeatures(t,e){var r;null==(r=this._map)||r.getView().getZoom(),e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector),Zm.getFeaturesDefaultStyle(e,25,this.autoPointSize);let r=Zm.getStyle(e.getGeometry().getType(),e.get("style"));e.setStyle(r)})),this._source.addFeatures(e)}addFeature(t,e){e.set("classname",t),this._source.addFeature(e)}getFeaturesByClassName(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("classname")===t&&e.push(r)})),e}getFeatures(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("name")===t&&e.push(r)})),e}getFeature(t){let e=null;return this._source.getFeatures().forEach((r=>{r.get("name")!==t||(e=r)})),e}removeFeatures(t){this._source.getFeatures().forEach((e=>{e.get("classname")===t&&this._source.removeFeature(e)}))}removeNavigationPath(){this.resultSource.forEachFeature((t=>{t!==this.geoMarker&&this.resultSource.removeFeature(t)}))}removeNavigationMarker(){this.resultSource.removeFeature(this.geoMarker)}removeNavigationAll(){this.resultSource.clear()}pathToGeoJSON(){return(new Df).writeFeaturesObject(this.routeFeatures,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0)}},PbfLayer:class extends Im{constructor(t,r){super(t,r),e(this,"_source"),e(this,"isLoading"),e(this,"queryParams"),this.layertype="PbfLayer",this.layerid=t,this.isLoading=!1;let n=this;const i=new AbortController;this._source=new Pf({format:new RA,url:r.url,tileLoadFunction:(t,e)=>{t.setLoader((function(r,o,s){fetch(e,{signal:i.signal}).then((function(t){return!t.status||t.status>=200&&t.status<300?t.arrayBuffer():null})).then((function(e){if(e)try{if(e.byteLength>0){const i=t.getFormat().readFeatures(e,{extent:r,featureProjection:s});let o=[];i.forEach((t=>{let e=TA(t);e.set("movestate",!1),e.set("editstate",!1),e.on("mousemove",(t=>{n.trigger(Em.onFeatureMousemove,{data:t.target})})),e.on("mouseout",(t=>{n.trigger(Em.onFeatureMouseout,{data:t.target})})),o.push(e)})),t.setFeatures(o)}}catch(TX){}})).catch((t=>{}))}))}});const o=new Vi({fill:new Fn({color:"#eeeeee"}),stroke:new Rn({color:"#eeeeee",width:1})});this.queryParams={onlyField:"OBJECTID"},this._source.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this._source.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this._source.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)})),this.layer=new af({zIndex:r.zIndex,source:this._source,style:t=>(r.featureStyle&&r.featureStyle.forEach((e=>{if(t.get(e.propertiesName)===e.propertiesValue)return o.getFill().setColor(e.fillColor),o.getStroke().setColor(e.strokeColor),void o.getStroke().setWidth(e.strokeWidth)})),o)}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype)}appendTo(t){t.addLayer(this.layer),this.isAdded=!0}},TifLayer:class extends wU{constructor(t,e){super(t,e),this.layertype="GeoTIFFLayer",this.layerSource=new GR({sources:[{url:this.option.url}]}),this.layer=new qp({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this.layerSource.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this.layerSource.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)}))}padLeft(t,e,r){let n=t.toString(r||10);return(new Array(e).join("0")+n).slice(-e)}},TileTencentLayer:rD,TileXyzLayer:eD,WfsLayer:class extends vAt{constructor(t,r){super(t,r),e(this,"geoserverData"),e(this,"queryParams"),e(this,"defaultExtent"),e(this,"isLoading"),this.layertype="WfsLayer",this.option.url,this.layer.set("layerid",t),this.queryParams={service:"WFS",request:"GetFeature",version:"1.0.0",outputFormat:"application/json",maxFeatures:"1000",typeName:"mars:hfjy",bbox:"",filter:"",queryField:"",querykeyword:"",autoShowFeature:!1},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t){try{this.isLoading=!0;let e,r=this,n=this.option.url,i=Object.assign({},this.queryParams,t);if(i.feature){let t=i.feature.getGeometry(),e=(t.getType(),(new Df).writeGeometryObject(t,{featureProjection:"EPSG:3857",dataProjection:"EPSG:4326"}).coordinates[0].map((function(t){return t.join(",")})).join(" ")),r="";""!==i.querykeyword?r=` \n <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">\n <PropertyName>${i.queryField}</PropertyName>\n <Literal>*${i.querykeyword}*</Literal>\n </PropertyIsLike>`:(delete i.queryField,delete i.querykeyword),i.filter=`<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">\n <And> \n ${r}\n <Intersects>\n <PropertyName>the_geom</PropertyName>\n <gml:Polygon>\n <gml:outerBoundaryIs>\n <gml:LinearRing>\n <gml:coordinates>${e}</gml:coordinates>\n </gml:LinearRing>\n </gml:outerBoundaryIs>\n </gml:Polygon>\n </Intersects>\n </And>\n </Filter>`,delete i.feature,delete i.extent,delete i.extentWkid}else i.extent?("4326"===i.extentWkid&&(i.extent=gr(i.extent,"EPSG:4326","EPSG:3857")),i.bbox=i.extent.join(",")+",EPSG:3857",delete i.extent,delete i.extentWkid,delete i.filter):(delete i.filter,delete i.extent,delete i.extentWkid);""===i.bbox&&this.defaultExtent&&(i.bbox=this.defaultExtent.join(",")+",EPSG:3857"),""!==i.filter&&delete i.bbox,e=Object.assign({},i);let o=!1;fetch(`${n}?${new URLSearchParams(e)}`).then((t=>t.json())).then((t=>{const e=bO.formatJsonTo3857(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(i.onlyField)===e.get(i.onlyField)}))||t.push(e)})),r.addFeatures("wfsFeature",t),r.trigger(Em.onFeaturesLoad,e)}})).catch((t=>{o||(o=!0)})).finally((()=>{this.isLoading=!1}))}catch(TX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},WmsLayer:cut,WmsTileLayer:fut,WmtsLayer:class extends wU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.option=Object.assign({},{opacity:.7,attributions:"",layer:"",matrixSet:"GoogleMapsCompatible",format:"image/png"},e);const r=ir("EPSG:3857"),n=r.getExtent(),i=$t(n)/256,o=new Array(19),s=new Array(19);for(let a=0;a<19;++a)o[a]=i/Math.pow(2,a),s[a]=a;this.layerSource=new AU({attributions:this.option.attributions,url:this.option.url,layer:this.option.layer,matrixSet:this.option.matrixSet,format:this.option.format,projection:r,tileGrid:new uU({origin:Zt(n),resolutions:o,matrixIds:s}),style:"default",wrapX:!0}),this.layer=new qf({zIndex:this.option.zIndex,opacity:this.option.opacity,source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}},XWebGLPointsLayer:class extends Im{constructor(t,e){super(t,e),this.layertype="XWebGLPointsLayer",this._source=new pa({wrapX:!1}),this.Layer=new Hp({source:this._source,style:{symbol:{symbolType:"circle",size:["interpolate",["exponential",2.5],["zoom"],2,1,12,8,16,12],color:"#ffed02",offset:[0,0],opacity:.95}},disableHitDetection:!1,colorCallback:function(t,e,r){},attributes:[{name:"color",callback:function(t){}},{name:"size",callback:function(t){}},{name:"GraphicColor",callback:function(t){}}]}),this.Layer.on(Em.onClick,(t=>{t.feature&&this.trigger(Em.onClick,t.feature.getProperties())}))}appendTo(t){var e;this._map=t,null==(e=this._map)||e.addLayer(this.Layer)}addGeoJson(t,e){let r=this.formatJsonTo3857(e);this.addFeatures(t,r)}addFeatures(t,e){var r;let n=null==(r=this._map)?void 0:r.getView().getZoom();e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector);let r=Zm.getFeaturesDefaultStyle(e,n,!1);e.setStyle(r)})),this._source.addFeatures(e)}},imageLayer:ND,kmlLayer:class extends DO{constructor(t,r){super(t,r),e(this,"styleOptions"),this.option={},Object.assign(this.option,r),this.layertype="KmlLayer",this._source=new pa({url:r.url,format:new sAt({extractStyles:!1})}),this.styleOptions={Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:-10,fillcolor:"rgba(0, 153, 255,1)",strokecolor:"rgba(255, 255, 255,1)",strokewidth:1,radius:10,scale:1,text:""},this.layer=new ta({source:this._source,zIndex:r.zIndex,style:(t,e)=>{let r=Zm.getStyle(t.getGeometry().getType(),this.styleOptions);if(this.styleOptions.text){let e=this.replaceField(this.styleOptions.text);e!==this.styleOptions.text&&r.getText().setText(t.getProperties()[e])}return r}}),this.layer.set("layerid",t),this.layer.on(Em.onClick,(t=>{t.feature&&this.trigger(Em.onClick,t.feature.getProperties())}))}setSymbol(t){this.styleOptions=Object.assign({},this.styleOptions,t)}}},Symbol.toStringTag,{value:"Module"})),zAt=Object.freeze(Object.defineProperty({__proto__:null,getJSON:function(t){const e=new XMLHttpRequest;return e.open("get",t,!1),e.setRequestHeader("content-type","application/json"),e.send(),JSON.parse(e.response)}},Symbol.toStringTag,{value:"Module"}));class VAt{constructor(t){e(this,"option"),this.option={key:"50da1a3686015849769f4a414bfdfb8f"},this.option=Object.assign({},this.option,t)}}const KAt=Object.freeze(Object.defineProperty({__proto__:null,GaodePOI:class extends VAt{constructor(t){super(t)}query(t){let e=new LO,r={serverUrl:"",queryType:1,keywords:"",location:"",radius:"3000",city:"西安市",city_limit:!0,polygon:"",extensions:"base",offset:20,page:1,success:null,error:null};r=Object.assign({},r,t);let n=[{type:"周边搜索",url:r.serverUrl+"/v3/place/around",parameters:{key:this.option.key,keywords:r.keywords,location:r.location,radius:r.radius,offset:r.offset,page:r.page}},{type:"关键字搜索",url:r.serverUrl+"/v3/place/text",parameters:{key:this.option.key,keywords:r.keywords,city:t.city,city_limit:t.city_limit,offset:r.offset,page:r.page}},{type:"多边形区域搜索",url:r.serverUrl+"/v3/place/polygon",parameters:{key:this.option.key,keywords:t.keywords,polygon:t.polygon,offset:r.offset,page:r.page}}];r.keywords=r.keywords.replace("","|"),TO(n[r.queryType].url+BO(n[r.queryType].parameters)).then((function(r){r.pois.forEach((t=>{let r=t.location.split(","),n=e.gcj02ToWgs84(parseFloat(r[1]),parseFloat(r[0]));t.lnglat=[n.lontitude,n.latitude]})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}queryUrl(){}},GaodeRoute:class extends VAt{constructor(t){super(t)}query(t){let e=new LO,r=[{type:"驾车",url:t.serverUrl+"/v3/direction/driving"},{type:"步行",url:t.serverUrl+"/v3/direction/walking"},{type:"公交",url:t.serverUrl+"/v3/direction/transit/integrated"}];t.params.key=this.option.key,TO(r[t.queryType].url+BO(t.params)).then((function(r){r.route.paths.forEach((t=>{t.points=[],t.steps.forEach((r=>{r.polyline.split(";").forEach((r=>{let n=r.split(","),i=e.gcj02ToWgs84(parseFloat(n[1]),parseFloat(n[0]));t.points.push([i.lontitude,i.latitude])}))}))})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}}},Symbol.toStringTag,{value:"Module"}));function qAt(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function WAt(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let a=0;a<o;++a)for(let e=0;e<r;++e)t[r*a+e]=s[(r-e-1)*o+a]}class XAt{async decode(t,e){const r=await this.decodeBlock(e),n=t.Predictor||1;if(1!==n){const e=!t.StripOffsets;return function(t,e,r,n,i,o){if(!e||1===e)return t;for(let l=0;l<i.length;++l){if(i[l]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[l]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let l=0;l<n&&!(l*a*r*s>=t.byteLength);++l){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,l*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,l*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,l*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}qAt(n,a)}else 3===e&&(n=new Uint8Array(t,l*a*r*s,a*r*s),WAt(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}const YAt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{decodeBlock(t){return t}}},Symbol.toStringTag,{value:"Module"})),ZAt=9,JAt=257;function $At(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}const tft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{decodeBlock(t){return function(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let p=0;p<=257;p++)e[p]=4096,r[p]=p;let n=258,i=ZAt,o=0;function s(){n=258,i=ZAt}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const l=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return JAt;let u=t[i]&2**(8-n)-1;u<<=r-o;let h=u;if(i+1<t.length){let e=t[i+1]>>>a;e<<=Math.max(0,r-l),h+=e}if(s>8&&i+2<t.length){const n=8*(i+3)-(e+r);h+=t[i+2]>>>n}return h}(t,o,i);return o+=i,e}function l(t,i){return r[n]=i,e[n]=t,n++,n-1}function u(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const h=[];s();const c=new Uint8Array(t);let A,f=a(c);for(;f!==JAt;){if(256===f){for(s(),f=a(c);256===f;)f=a(c);if(f===JAt)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);$At(h,u(f)),A=f}else if(f<n){const t=u(f);$At(h,t),l(A,t[t.length-1]),A=f}else{const t=u(A);if(!t)throw new Error(`Bogus entry. Not in dictionary, ${A} / ${n}, position: ${o}`);$At(h,t),h.push(t[t.length-1]),l(A,t[t.length-1]),A=f}n+1>=2**i&&(12===i?A=void 0:i++),f=a(c)}return new Uint8Array(h)}(t).buffer}}},Symbol.toStringTag,{value:"Module"})),eft=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),rft=4017,nft=799,ift=3406,oft=2276,sft=1567,aft=3784,lft=5793,uft=2896;function hft(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<t[a];i++){for(s=n.pop(),s.children[s.index]=e[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function cft(t,e,r,n,i,o,s,a,l){const{mcusPerLine:u,progressive:h}=r,c=e;let A=e,f=0,p=0;function d(){if(p>0)return p--,f>>p&1;if(f=t[A++],255===f){const e=t[A++];if(e)throw new Error(`unexpected marker: ${(f<<8|e).toString(16)}`)}return p=7,f>>>7}function g(t){let e,r=t;for(;null!==(e=d());){if(r=r[e],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(t){let e=t,r=0;for(;e>0;){const t=d();if(null===t)return;r=r<<1|t,--e}return r}function m(t){const e=y(t);return e>=1<<t-1?e:e+(-1<<t)+1}let v,_=0,w=0;function b(t,e,r,n,i){const o=r%u,s=(r/u|0)*t.v+n,a=o*t.h+i;e(t,t.blocks[s][a])}function x(t,e,r){const n=r/t.blocksPerLine|0,i=r%t.blocksPerLine;e(t,t.blocks[n][i])}const E=n.length;let C,S,B,I,T,P;P=h?0===o?0===a?function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r)<<l;t.pred+=n,e[0]=t.pred}:function(t,e){e[0]|=d()<<l}:0===a?function(t,e){if(_>0)return void _--;let r=o;const n=s;for(;r<=n;){const n=g(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){_=y(o)+(1<<o)-1;break}r+=16}else r+=o,e[eft[r]]=m(i)*(1<<l),r++}}:function(t,e){let r=o;const n=s;let i=0;for(;r<=n;){const n=eft[r],o=e[n]<0?-1:1;switch(w){case 0:{const e=g(t.huffmanTableAC),r=15&e;if(i=e>>4,0===r)i<15?(_=y(i)+(1<<i),w=4):(i=16,w=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=m(r),w=i?2:3}continue}case 1:case 2:e[n]?e[n]+=(d()<<l)*o:(i--,0===i&&(w=2===w?3:0));break;case 3:e[n]?e[n]+=(d()<<l)*o:(e[n]=v<<l,w=0);break;case 4:e[n]&&(e[n]+=(d()<<l)*o)}r++}4===w&&(_--,0===_&&(w=0))}:function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r);t.pred+=n,e[0]=t.pred;let i=1;for(;i<64;){const r=g(t.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else i+=o,e[eft[i]]=m(n),i++}};let F,L,M=0;L=1===E?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;const O=i||L;for(;M<L;){for(S=0;S<E;S++)n[S].pred=0;if(_=0,1===E)for(C=n[0],T=0;T<O;T++)x(C,P,M),M++;else for(T=0;T<O;T++){for(S=0;S<E;S++){C=n[S];const{h:t,v:e}=C;for(B=0;B<e;B++)for(I=0;I<t;I++)b(C,P,M,B,I)}if(M++,M===L)break}if(p=0,F=t[A]<<8|t[A+1],F<65280)throw new Error("marker was not found");if(!(F>=65488&&F<=65495))break;A+=2}return A-c}function Aft(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(t,r,n){const i=e.quantizationTable;let o,s,a,l,u,h,c,A,f;const p=n;let d;for(d=0;d<64;d++)p[d]=t[d]*i[d];for(d=0;d<8;++d){const t=8*d;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=lft*p[0+t]+128>>8,s=lft*p[4+t]+128>>8,a=p[2+t],l=p[6+t],u=uft*(p[1+t]-p[7+t])+128>>8,A=uft*(p[1+t]+p[7+t])+128>>8,h=p[3+t]<<4,c=p[5+t]<<4,f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*aft+l*sft+128>>8,a=a*sft-l*aft+128>>8,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*oft+A*ift+2048>>12,u=u*ift-A*oft+2048>>12,A=f,f=h*nft+c*rft+2048>>12,h=h*rft-c*nft+2048>>12,c=f,p[0+t]=o+A,p[7+t]=o-A,p[1+t]=s+c,p[6+t]=s-c,p[2+t]=a+h,p[5+t]=a-h,p[3+t]=l+u,p[4+t]=l-u):(f=lft*p[0+t]+512>>10,p[0+t]=f,p[1+t]=f,p[2+t]=f,p[3+t]=f,p[4+t]=f,p[5+t]=f,p[6+t]=f,p[7+t]=f)}for(d=0;d<8;++d){const t=d;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=lft*p[0+t]+2048>>12,s=lft*p[32+t]+2048>>12,a=p[16+t],l=p[48+t],u=uft*(p[8+t]-p[56+t])+2048>>12,A=uft*(p[8+t]+p[56+t])+2048>>12,h=p[24+t],c=p[40+t],f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*aft+l*sft+2048>>12,a=a*sft-l*aft+2048>>12,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*oft+A*ift+2048>>12,u=u*ift-A*oft+2048>>12,A=f,f=h*nft+c*rft+2048>>12,h=h*rft-c*nft+2048>>12,c=f,p[0+t]=o+A,p[56+t]=o-A,p[8+t]=s+c,p[48+t]=s-c,p[16+t]=a+h,p[40+t]=a-h,p[24+t]=l+u,p[32+t]=l-u):(f=lft*n[d+0]+8192>>14,p[0+t]=f,p[8+t]=f,p[16+t]=f,p[24+t]=f,p[32+t]=f,p[40+t]=f,p[48+t]=f,p[56+t]=f)}for(d=0;d<64;++d){const t=128+(p[d]+8>>4);r[d]=t<0?0:t>255?255:t}}for(let u=0;u<i;u++){const t=u<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let i=0;i<n;i++){l(e.blocks[u][i],a,s);let n=0;const o=i<<3;for(let e=0;e<8;e++){const i=r[t+e];for(let t=0;t<8;t++)i[o+t]=a[n++]}}}return r}class fft{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(t){let e=0;function r(){const r=t[e]<<8|t[e+1];return e+=2,r}function n(){const n=r(),i=t.subarray(e,e+n-2);return e+=i.length,i}function i(t){let e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(e=t.components[r],n<e.h&&(n=e.h),i<e.v&&(i=e.v));const o=Math.ceil(t.samplesPerLine/8/n),s=Math.ceil(t.scanLines/8/i);for(r in t.components)if(t.components.hasOwnProperty(r)){e=t.components[r];const a=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/n),l=Math.ceil(Math.ceil(t.scanLines/8)*e.v/i),u=o*e.h,h=s*e.v,c=[];for(let t=0;t<h;t++){const t=[];for(let e=0;e<u;e++)t.push(new Int32Array(64));c.push(t)}e.blocksPerLine=a,e.blocksPerColumn=l,e.blocks=c}t.maxH=n,t.maxV=i,t.mcusPerLine=o,t.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const t=n();65504===o&&74===t[0]&&70===t[1]&&73===t[2]&&70===t[3]&&0===t[4]&&(this.jfif={version:{major:t[5],minor:t[6]},densityUnits:t[7],xDensity:t[8]<<8|t[9],yDensity:t[10]<<8|t[11],thumbWidth:t[12],thumbHeight:t[13],thumbData:t.subarray(14,14+3*t[12]*t[13])}),65518===o&&65===t[0]&&100===t[1]&&111===t[2]&&98===t[3]&&101===t[4]&&0===t[5]&&(this.adobe={version:t[6],flags0:t[7]<<8|t[8],flags1:t[9]<<8|t[10],transformCode:t[11]});break}case 65499:{const n=r()+e-2;for(;e<n;){const n=t[e++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++)i[eft[r]]=t[e++];else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let t=0;t<64;t++)i[eft[t]]=r()}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r<s;r++){a=t[e];const r=t[e+1]>>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=t[e++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,e++)i[r]=t[e],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,e++)s[r]=t[e];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=hft(i,s):this.huffmanTablesAC[15&n]=hft(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[t[e++]],n=t[e++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],l=t[e++],u=cft(t,e,o,i,this.resetInterval,s,a,l>>4,15&l);e+=u;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length;for(let u=0;u<this.frames.length;u++){const t=this.frames[u].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const e=t[0],{components:r,componentsOrder:n}=e,i=[],o=e.samplesPerLine,s=e.scanLines;for(let u=0;u<n.length;u++){const t=r[n[u]];i.push({lines:Aft(0,t),scaleX:t.h/e.maxH,scaleY:t.v/e.maxV})}const a=new Uint8Array(o*s*i.length);let l=0;for(let u=0;u<s;++u)for(let t=0;t<o;++t)for(let e=0;e<i.length;++e){const r=i[e];a[l]=r.lines[0|u*r.scaleY][0|t*r.scaleX],++l}return a}}const pft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{constructor(t){super(),this.reader=new fft,t.JPEGTables&&this.reader.parse(t.JPEGTables)}decodeBlock(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}},Symbol.toStringTag,{value:"Module"}));
|
|
470
470
|
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function dft(t){let e=t.length;for(;--e>=0;)t[e]=0}const gft=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),yft=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),mft=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),vft=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_ft=new Array(576);dft(_ft);const wft=new Array(60);dft(wft);const bft=new Array(512);dft(bft);const xft=new Array(256);dft(xft);const Eft=new Array(29);dft(Eft);const Cft=new Array(30);function Sft(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let Bft,Ift,Tft;function Pft(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}dft(Cft);const Fft=t=>t<256?bft[t]:bft[256+(t>>>7)],Lft=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},Mft=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,Lft(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Oft=(t,e,r)=>{Mft(t,r[2*e],r[2*e+1])},kft=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},Nft=(t,e,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=kft(n[e]++,e))}},Rft=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Uft=t=>{t.bi_valid>8?Lft(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Dft=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},Qft=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Dft(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Dft(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},Gft=(t,e,r)=>{let n,i,o,s,a=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+a++],n+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===n?Oft(t,i,e):(o=xft[i],Oft(t,o+256+1,e),s=gft[o],0!==s&&(i-=Eft[o],Mft(t,i,s)),n--,o=Fft(n),Oft(t,o,r),s=yft[o],0!==s&&(n-=Cft[o],Mft(t,n,s)))}while(a<t.sym_next);Oft(t,256,e)},jft=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let s,a,l,u=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(t.heap[++t.heap_len]=u=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=u<2?++u:0,r[2*l]=1,t.depth[l]=0,t.opt_len--,i&&(t.static_len-=n[2*l+1]);for(e.max_code=u,s=t.heap_len>>1;s>=1;s--)Qft(t,r,s);l=o;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Qft(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[2*l]=r[2*s]+r[2*a],t.depth[l]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[2*s+1]=r[2*a+1]=l,t.heap[1]=l++,Qft(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,h,c,A,f,p,d=0;for(A=0;A<=15;A++)t.bl_count[A]=0;for(r[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)h=t.heap[u],A=r[2*r[2*h+1]+1]+1,A>l&&(A=l,d++),r[2*h+1]=A,h>n||(t.bl_count[A]++,f=0,h>=a&&(f=s[h-a]),p=r[2*h],t.opt_len+=p*(A+f),o&&(t.static_len+=p*(i[2*h+1]+f)));if(0!==d){do{for(A=l-1;0===t.bl_count[A];)A--;t.bl_count[A]--,t.bl_count[A+1]+=2,t.bl_count[l]--,d-=2}while(d>0);for(A=l;0!==A;A--)for(h=t.bl_count[A];0!==h;)c=t.heap[--u],c>n||(r[2*c+1]!==A&&(t.opt_len+=(A-r[2*c+1])*r[2*c],r[2*c+1]=A),h--)}})(t,e),Nft(r,u,t.bl_count)},Hft=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++a<l&&i===s||(a<u?t.bl_tree[2*i]+=a:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=i,0===s?(l=138,u=3):i===s?(l=6,u=3):(l=7,u=4))},zft=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++a<l&&i===s)){if(a<u)do{Oft(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(Oft(t,i,t.bl_tree),a--),Oft(t,16,t.bl_tree),Mft(t,a-3,2)):a<=10?(Oft(t,17,t.bl_tree),Mft(t,a-3,3)):(Oft(t,18,t.bl_tree),Mft(t,a-11,7));a=0,o=i,0===s?(l=138,u=3):i===s?(l=6,u=3):(l=7,u=4)}};let Vft=!1;const Kft=(t,e,r,n)=>{Mft(t,0+(n?1:0),3),Uft(t),Lft(t,r),Lft(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var qft={_tr_init:t=>{Vft||((()=>{let t,e,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(Eft[n]=r,t=0;t<1<<gft[n];t++)xft[r++]=n;for(xft[r-1]=n,i=0,n=0;n<16;n++)for(Cft[n]=i,t=0;t<1<<yft[n];t++)bft[i++]=n;for(i>>=7;n<30;n++)for(Cft[n]=i<<7,t=0;t<1<<yft[n]-7;t++)bft[256+i++]=n;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)_ft[2*t+1]=8,t++,o[8]++;for(;t<=255;)_ft[2*t+1]=9,t++,o[9]++;for(;t<=279;)_ft[2*t+1]=7,t++,o[7]++;for(;t<=287;)_ft[2*t+1]=8,t++,o[8]++;for(Nft(_ft,287,o),t=0;t<30;t++)wft[2*t+1]=5,wft[2*t]=kft(t,5);Bft=new Sft(_ft,gft,257,286,15),Ift=new Sft(wft,yft,0,30,15),Tft=new Sft(new Array(0),mft,0,19,7)})(),Vft=!0),t.l_desc=new Pft(t.dyn_ltree,Bft),t.d_desc=new Pft(t.dyn_dtree,Ift),t.bl_desc=new Pft(t.bl_tree,Tft),t.bi_buf=0,t.bi_valid=0,Rft(t)},_tr_stored_block:Kft,_tr_flush_block:(t,e,r,n)=>{let i,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),jft(t,t.l_desc),jft(t,t.d_desc),s=(t=>{let e;for(Hft(t,t.dyn_ltree,t.l_desc.max_code),Hft(t,t.dyn_dtree,t.d_desc.max_code),jft(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*vft[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?Kft(t,e,r,n):4===t.strategy||o===i?(Mft(t,2+(n?1:0),3),Gft(t,_ft,wft)):(Mft(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(Mft(t,e-257,5),Mft(t,r-1,5),Mft(t,n-4,4),i=0;i<n;i++)Mft(t,t.bl_tree[2*vft[i]+1],3);zft(t,t.dyn_ltree,e-1),zft(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Gft(t,t.dyn_ltree,t.dyn_dtree)),Rft(t),n&&Uft(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(xft[r]+256+1)]++,t.dyn_dtree[2*Fft(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{Mft(t,2,3),Oft(t,256,_ft),(t=>{16===t.bi_valid?(Lft(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},Wft=(t,e,r,n)=>{let i=65535&t|0,o=t>>>16&65535|0,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+e[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16|0};const Xft=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var Yft=(t,e,r,n)=>{const i=Xft,o=n+r;t^=-1;for(let s=n;s<o;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},Zft={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Jft={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:$ft,_tr_stored_block:tpt,_tr_flush_block:ept,_tr_tally:rpt,_tr_align:npt}=qft,{Z_NO_FLUSH:ipt,Z_PARTIAL_FLUSH:opt,Z_FULL_FLUSH:spt,Z_FINISH:apt,Z_BLOCK:lpt,Z_OK:upt,Z_STREAM_END:hpt,Z_STREAM_ERROR:cpt,Z_DATA_ERROR:Apt,Z_BUF_ERROR:fpt,Z_DEFAULT_COMPRESSION:ppt,Z_FILTERED:dpt,Z_HUFFMAN_ONLY:gpt,Z_RLE:ypt,Z_FIXED:mpt,Z_DEFAULT_STRATEGY:vpt,Z_UNKNOWN:_pt,Z_DEFLATED:wpt}=Jft,bpt=286,xpt=30,Ept=19,Cpt=2*bpt+1,Spt=15,Bpt=258,Ipt=262,Tpt=42,Ppt=113,Fpt=666,Lpt=(t,e)=>(t.msg=Zft[e],e),Mpt=t=>2*t-(t>4?9:0),Opt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},kpt=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);e=i,n=e;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)};let Npt=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const Rpt=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},Upt=(t,e)=>{ept(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Rpt(t.strm)},Dpt=(t,e)=>{t.pending_buf[t.pending++]=e},Qpt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Gpt=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=Wft(t.adler,e,i,r):2===t.state.wrap&&(t.adler=Yft(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},jpt=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match;const l=t.strstart>t.w_size-Ipt?t.strstart-(t.w_size-Ipt):0,u=t.window,h=t.w_mask,c=t.prev,A=t.strstart+Bpt;let f=u[o+s-1],p=u[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(r=e,u[r+s]===p&&u[r+s-1]===f&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<A);if(n=Bpt-(A-o),o=A-Bpt,n>s){if(t.match_start=e,s=n,n>=a)break;f=u[o+s-1],p=u[o+s]}}}while((e=c[e&h])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead},Hpt=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Ipt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),kpt(t),n+=e),0===t.strm.avail_in)break;if(r=Gpt(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Npt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Npt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Ipt&&0!==t.strm.avail_in)},zpt=(t,e)=>{let r,n,i,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,a=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&e!==apt||e===ipt||r!==n+t.strm.avail_in))break;s=e===apt&&r===n+t.strm.avail_in?1:0,tpt(t,0,0,s),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,Rpt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(Gpt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===s);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==ipt&&e!==apt&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Gpt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,o=i>t.w_size?t.w_size:i,n=t.strstart-t.block_start,(n>=o||(n||e===apt)&&e!==ipt&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=e===apt&&0===t.strm.avail_in&&r===n?1:0,tpt(t,t.block_start,r,s),t.block_start+=r,Rpt(t.strm)),s?3:1)},Vpt=(t,e)=>{let r,n;for(;;){if(t.lookahead<Ipt){if(Hpt(t),t.lookahead<Ipt&&e===ipt)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=Npt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-Ipt&&(t.match_length=jpt(t,r)),t.match_length>=3)if(n=rpt(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Npt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Npt(t,t.ins_h,t.window[t.strstart+1]);else n=rpt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Upt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===apt?(Upt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Upt(t,!1),0===t.strm.avail_out)?1:2},Kpt=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Ipt){if(Hpt(t),t.lookahead<Ipt&&e===ipt)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=Npt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Ipt&&(t.match_length=jpt(t,r),t.match_length<=5&&(t.strategy===dpt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=rpt(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=Npt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Upt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=rpt(t,0,t.window[t.strstart-1]),n&&Upt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=rpt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===apt?(Upt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Upt(t,!1),0===t.strm.avail_out)?1:2};function qpt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Wpt=[new qpt(0,0,0,0,zpt),new qpt(4,4,8,4,Vpt),new qpt(4,5,16,8,Vpt),new qpt(4,6,32,32,Vpt),new qpt(4,4,16,16,Kpt),new qpt(8,16,32,32,Kpt),new qpt(8,16,128,128,Kpt),new qpt(8,32,128,256,Kpt),new qpt(32,128,258,1024,Kpt),new qpt(32,258,258,4096,Kpt)];function Xpt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=wpt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*Cpt),this.dyn_dtree=new Uint16Array(2*(2*xpt+1)),this.bl_tree=new Uint16Array(2*(2*Ept+1)),Opt(this.dyn_ltree),Opt(this.dyn_dtree),Opt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Spt+1),this.heap=new Uint16Array(2*bpt+1),Opt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*bpt+1),Opt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ypt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Tpt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==Ppt&&e.status!==Fpt?1:0},Zpt=t=>{if(Ypt(t))return Lpt(t,cpt);t.total_in=t.total_out=0,t.data_type=_pt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?Tpt:Ppt,t.adler=2===e.wrap?0:1,e.last_flush=-2,$ft(e),upt},Jpt=t=>{const e=Zpt(t);var r;return e===upt&&((r=t.state).window_size=2*r.w_size,Opt(r.head),r.max_lazy_match=Wpt[r.level].max_lazy,r.good_match=Wpt[r.level].good_length,r.nice_match=Wpt[r.level].nice_length,r.max_chain_length=Wpt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},$pt=(t,e,r,n,i,o)=>{if(!t)return cpt;let s=1;if(e===ppt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==wpt||n<8||n>15||e<0||e>9||o<0||o>mpt||8===n&&1!==s)return Lpt(t,cpt);8===n&&(n=9);const a=new Xpt;return t.state=a,a.strm=t,a.status=Tpt,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=o,a.method=r,Jpt(t)};var tdt={deflateInit:(t,e)=>$pt(t,e,wpt,15,8,vpt),deflateInit2:$pt,deflateReset:Jpt,deflateResetKeep:Zpt,deflateSetHeader:(t,e)=>Ypt(t)||2!==t.state.wrap?cpt:(t.state.gzhead=e,upt),deflate:(t,e)=>{if(Ypt(t)||e>lpt||e<0)return t?Lpt(t,cpt):cpt;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===Fpt&&e!==apt)return Lpt(t,0===t.avail_out?fpt:cpt);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(Rpt(t),0===t.avail_out)return r.last_flush=-1,upt}else if(0===t.avail_in&&Mpt(e)<=Mpt(n)&&e!==apt)return Lpt(t,fpt);if(r.status===Fpt&&0!==t.avail_in)return Lpt(t,fpt);if(r.status===Tpt&&0===r.wrap&&(r.status=Ppt),r.status===Tpt){let e=wpt+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=gpt||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,Qpt(r,e),0!==r.strstart&&(Qpt(r,t.adler>>>16),Qpt(r,65535&t.adler)),t.adler=1,r.status=Ppt,Rpt(t),0!==r.pending)return r.last_flush=-1,upt}if(57===r.status)if(t.adler=0,Dpt(r,31),Dpt(r,139),Dpt(r,8),r.gzhead)Dpt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dpt(r,255&r.gzhead.time),Dpt(r,r.gzhead.time>>8&255),Dpt(r,r.gzhead.time>>16&255),Dpt(r,r.gzhead.time>>24&255),Dpt(r,9===r.level?2:r.strategy>=gpt||r.level<2?4:0),Dpt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dpt(r,255&r.gzhead.extra.length),Dpt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Yft(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Dpt(r,0),Dpt(r,0),Dpt(r,0),Dpt(r,0),Dpt(r,0),Dpt(r,9===r.level?2:r.strategy>=gpt||r.level<2?4:0),Dpt(r,3),r.status=Ppt,Rpt(t),0!==r.pending)return r.last_flush=-1,upt;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=Yft(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=i,Rpt(t),0!==r.pending)return r.last_flush=-1,upt;e=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=Yft(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Yft(t.adler,r.pending_buf,r.pending-n,n)),Rpt(t),0!==r.pending)return r.last_flush=-1,upt;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dpt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=Yft(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Yft(t.adler,r.pending_buf,r.pending-n,n)),Rpt(t),0!==r.pending)return r.last_flush=-1,upt;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dpt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=Yft(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Rpt(t),0!==r.pending))return r.last_flush=-1,upt;Dpt(r,255&t.adler),Dpt(r,t.adler>>8&255),t.adler=0}if(r.status=Ppt,Rpt(t),0!==r.pending)return r.last_flush=-1,upt}if(0!==t.avail_in||0!==r.lookahead||e!==ipt&&r.status!==Fpt){let n=0===r.level?zpt(r,e):r.strategy===gpt?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(Hpt(t),0===t.lookahead)){if(e===ipt)return 1;break}if(t.match_length=0,r=rpt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Upt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===apt?(Upt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Upt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===ypt?((t,e)=>{let r,n,i,o;const s=t.window;for(;;){if(t.lookahead<=Bpt){if(Hpt(t),t.lookahead<=Bpt&&e===ipt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=t.strstart+Bpt;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);t.match_length=Bpt-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=rpt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=rpt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Upt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===apt?(Upt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Upt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Wpt[r.level].func(r,e);if(3!==n&&4!==n||(r.status=Fpt),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),upt;if(2===n&&(e===opt?npt(r):e!==lpt&&(tpt(r,0,0,!1),e===spt&&(Opt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Rpt(t),0===t.avail_out))return r.last_flush=-1,upt}return e!==apt?upt:r.wrap<=0?hpt:(2===r.wrap?(Dpt(r,255&t.adler),Dpt(r,t.adler>>8&255),Dpt(r,t.adler>>16&255),Dpt(r,t.adler>>24&255),Dpt(r,255&t.total_in),Dpt(r,t.total_in>>8&255),Dpt(r,t.total_in>>16&255),Dpt(r,t.total_in>>24&255)):(Qpt(r,t.adler>>>16),Qpt(r,65535&t.adler)),Rpt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?upt:hpt)},deflateEnd:t=>{if(Ypt(t))return cpt;const e=t.state.status;return t.state=null,e===Ppt?Lpt(t,Apt):upt},deflateSetDictionary:(t,e)=>{let r=e.length;if(Ypt(t))return cpt;const n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==Tpt||n.lookahead)return cpt;if(1===i&&(t.adler=Wft(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Opt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Hpt(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=Npt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Hpt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,n.wrap=i,upt},deflateInfo:"pako deflate (from Nodeca project)"};const edt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var rdt={assign:function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)edt(r,e)&&(t[e]=r[e])}}return t},flattenChunks:t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;const r=new Uint8Array(e);for(let n=0,i=0,o=t.length;n<o;n++){let e=t[n];r.set(e,i),i+=e.length}return r}};let ndt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(fEt){ndt=!1}const idt=new Uint8Array(256);for(let ol=0;ol<256;ol++)idt[ol]=ol>=252?6:ol>=248?5:ol>=240?4:ol>=224?3:ol>=192?2:1;idt[254]=idt[254]=1;var odt={string2buf:t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},buf2string:(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){o[i++]=e;continue}let s=idt[e];if(s>4)o[i++]=65533,n+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&n<r;)e=e<<6|63&t[n++],s--;s>1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&ndt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(o,i)},utf8border:(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+idt[t[r]]>e?r:e}},sdt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const adt=Object.prototype.toString,{Z_NO_FLUSH:ldt,Z_SYNC_FLUSH:udt,Z_FULL_FLUSH:hdt,Z_FINISH:cdt,Z_OK:Adt,Z_STREAM_END:fdt,Z_DEFAULT_COMPRESSION:pdt,Z_DEFAULT_STRATEGY:ddt,Z_DEFLATED:gdt}=Jft;function ydt(t){this.options=rdt.assign({level:pdt,method:gdt,chunkSize:16384,windowBits:15,memLevel:8,strategy:ddt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sdt,this.strm.avail_out=0;let r=tdt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Adt)throw new Error(Zft[r]);if(e.header&&tdt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?odt.string2buf(e.dictionary):"[object ArrayBuffer]"===adt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=tdt.deflateSetDictionary(this.strm,t),r!==Adt)throw new Error(Zft[r]);this._dict_set=!0}}ydt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?cdt:ldt,"string"==typeof t?r.input=odt.string2buf(t):"[object ArrayBuffer]"===adt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===udt||o===hdt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=tdt.deflate(r,o),i===fdt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=tdt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Adt;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ydt.prototype.onData=function(t){this.chunks.push(t)},ydt.prototype.onEnd=function(t){t===Adt&&(this.result=rdt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const mdt=16209;var vdt=function(t,e){let r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x,E,C;const S=t.state;r=t.next_in,E=t.input,n=r+(t.avail_in-5),i=t.next_out,C=t.output,o=i-(e-t.avail_out),s=i+(t.avail_out-257),a=S.dmax,l=S.wsize,u=S.whave,h=S.wnext,c=S.window,A=S.hold,f=S.bits,p=S.lencode,d=S.distcode,g=(1<<S.lenbits)-1,y=(1<<S.distbits)-1;t:do{f<15&&(A+=E[r++]<<f,f+=8,A+=E[r++]<<f,f+=8),m=p[A&g];e:for(;;){if(v=m>>>24,A>>>=v,f-=v,v=m>>>16&255,0===v)C[i++]=65535&m;else{if(!(16&v)){if(0==(64&v)){m=p[(65535&m)+(A&(1<<v)-1)];continue e}if(32&v){S.mode=16191;break t}t.msg="invalid literal/length code",S.mode=mdt;break t}_=65535&m,v&=15,v&&(f<v&&(A+=E[r++]<<f,f+=8),_+=A&(1<<v)-1,A>>>=v,f-=v),f<15&&(A+=E[r++]<<f,f+=8,A+=E[r++]<<f,f+=8),m=d[A&y];r:for(;;){if(v=m>>>24,A>>>=v,f-=v,v=m>>>16&255,!(16&v)){if(0==(64&v)){m=d[(65535&m)+(A&(1<<v)-1)];continue r}t.msg="invalid distance code",S.mode=mdt;break t}if(w=65535&m,v&=15,f<v&&(A+=E[r++]<<f,f+=8,f<v&&(A+=E[r++]<<f,f+=8)),w+=A&(1<<v)-1,w>a){t.msg="invalid distance too far back",S.mode=mdt;break t}if(A>>>=v,f-=v,v=i-o,w>v){if(v=w-v,v>u&&S.sane){t.msg="invalid distance too far back",S.mode=mdt;break t}if(b=0,x=c,0===h){if(b+=l-v,v<_){_-=v;do{C[i++]=c[b++]}while(--v);b=i-w,x=C}}else if(h<v){if(b+=l+h-v,v-=h,v<_){_-=v;do{C[i++]=c[b++]}while(--v);if(b=0,h<_){v=h,_-=v;do{C[i++]=c[b++]}while(--v);b=i-w,x=C}}}else if(b+=h-v,v<_){_-=v;do{C[i++]=c[b++]}while(--v);b=i-w,x=C}for(;_>2;)C[i++]=x[b++],C[i++]=x[b++],C[i++]=x[b++],_-=3;_&&(C[i++]=x[b++],_>1&&(C[i++]=x[b++]))}else{b=i-w;do{C[i++]=C[b++],C[i++]=C[b++],C[i++]=C[b++],_-=3}while(_>2);_&&(C[i++]=C[b++],_>1&&(C[i++]=C[b++]))}break}}break}}while(r<n&&i<s);_=f>>3,r-=_,f-=_<<3,A&=(1<<f)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<s?s-i+257:257-(i-s),S.hold=A,S.bits=f};const _dt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),wdt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),bdt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),xdt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Edt=(t,e,r,n,i,o,s,a)=>{const l=a.bits;let u,h,c,A,f,p,d=0,g=0,y=0,m=0,v=0,_=0,w=0,b=0,x=0,E=0,C=null;const S=new Uint16Array(16),B=new Uint16Array(16);let I,T,P,F=null;for(d=0;d<=15;d++)S[d]=0;for(g=0;g<n;g++)S[e[r+g]]++;for(v=l,m=15;m>=1&&0===S[m];m--);if(v>m&&(v=m),0===m)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(y=1;y<m&&0===S[y];y++);for(v<y&&(v=y),b=1,d=1;d<=15;d++)if(b<<=1,b-=S[d],b<0)return-1;if(b>0&&(0===t||1!==m))return-1;for(B[1]=0,d=1;d<15;d++)B[d+1]=B[d]+S[d];for(g=0;g<n;g++)0!==e[r+g]&&(s[B[e[r+g]]++]=g);if(0===t?(C=F=s,p=20):1===t?(C=_dt,F=wdt,p=257):(C=bdt,F=xdt,p=0),E=0,g=0,d=y,f=o,_=v,w=0,c=-1,x=1<<v,A=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){I=d-w,s[g]+1<p?(T=0,P=s[g]):s[g]>=p?(T=F[s[g]-p],P=C[s[g]-p]):(T=96,P=0),u=1<<d-w,h=1<<_,y=h;do{h-=u,i[f+(E>>w)+h]=I<<24|T<<16|P|0}while(0!==h);for(u=1<<d-1;E&u;)u>>=1;if(0!==u?(E&=u-1,E+=u):E=0,g++,0==--S[d]){if(d===m)break;d=e[r+s[g]]}if(d>v&&(E&A)!==c){for(0===w&&(w=v),f+=y,_=d-w,b=1<<_;_+w<m&&(b-=S[_+w],!(b<=0));)_++,b<<=1;if(x+=1<<_,1===t&&x>852||2===t&&x>592)return 1;c=E&A,i[c]=v<<24|_<<16|f-o|0}}return 0!==E&&(i[f+E]=d-w<<24|64<<16|0),a.bits=v,0};const{Z_FINISH:Cdt,Z_BLOCK:Sdt,Z_TREES:Bdt,Z_OK:Idt,Z_STREAM_END:Tdt,Z_NEED_DICT:Pdt,Z_STREAM_ERROR:Fdt,Z_DATA_ERROR:Ldt,Z_MEM_ERROR:Mdt,Z_BUF_ERROR:Odt,Z_DEFLATED:kdt}=Jft,Ndt=16180,Rdt=16190,Udt=16191,Ddt=16192,Qdt=16194,Gdt=16199,jdt=16200,Hdt=16206,zdt=16209,Vdt=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Kdt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const qdt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Ndt||e.mode>16211?1:0},Wdt=t=>{if(qdt(t))return Fdt;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ndt,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Idt},Xdt=t=>{if(qdt(t))return Fdt;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Wdt(t)},Ydt=(t,e)=>{let r;if(qdt(t))return Fdt;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Fdt:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Xdt(t))},Zdt=(t,e)=>{if(!t)return Fdt;const r=new Kdt;t.state=r,r.strm=t,r.window=null,r.mode=Ndt;const n=Ydt(t,e);return n!==Idt&&(t.state=null),n};let Jdt,$dt,tgt=!0;const egt=t=>{if(tgt){Jdt=new Int32Array(512),$dt=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Edt(1,t.lens,0,288,Jdt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Edt(2,t.lens,0,32,$dt,0,t.work,{bits:5}),tgt=!1}t.lencode=Jdt,t.lenbits=9,t.distcode=$dt,t.distbits=5},rgt=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var ngt={inflateReset:Xdt,inflateReset2:Ydt,inflateResetKeep:Wdt,inflateInit:t=>Zdt(t,15),inflateInit2:Zdt,inflate:(t,e)=>{let r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x,E=0;const C=new Uint8Array(4);let S,B;const I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(qdt(t)||!t.output||!t.input&&0!==t.avail_in)return Fdt;r=t.state,r.mode===Udt&&(r.mode=Ddt),s=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,h=r.bits,c=a,A=l,x=Idt;t:for(;;)switch(r.mode){case Ndt:if(0===r.wrap){r.mode=Ddt;break}for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(2&r.wrap&&35615===u){0===r.wbits&&(r.wbits=15),r.check=0,C[0]=255&u,C[1]=u>>>8&255,r.check=Yft(r.check,C,2,0),u=0,h=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=zdt;break}if((15&u)!==kdt){t.msg="unknown compression method",r.mode=zdt;break}if(u>>>=4,h-=4,b=8+(15&u),0===r.wbits&&(r.wbits=b),b>15||b>r.wbits){t.msg="invalid window size",r.mode=zdt;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&u?16189:Udt,u=0,h=0;break;case 16181:for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(r.flags=u,(255&r.flags)!==kdt){t.msg="unknown compression method",r.mode=zdt;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=zdt;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&4&r.wrap&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Yft(r.check,C,2,0)),u=0,h=0,r.mode=16182;case 16182:for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.head&&(r.head.time=u),512&r.flags&&4&r.wrap&&(C[0]=255&u,C[1]=u>>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=Yft(r.check,C,4,0)),u=0,h=0,r.mode=16183;case 16183:for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&4&r.wrap&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Yft(r.check,C,2,0)),u=0,h=0,r.mode=16184;case 16184:if(1024&r.flags){for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&4&r.wrap&&(C[0]=255&u,C[1]=u>>>8&255,r.check=Yft(r.check,C,2,0)),u=0,h=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>a&&(f=a),f&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),b)),512&r.flags&&4&r.wrap&&(r.check=Yft(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break t;f=0;do{b=n[o+f++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b))}while(b&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=Yft(r.check,n,f,o)),a-=f,o+=f,b)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break t;f=0;do{b=n[o+f++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b))}while(b&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=Yft(r.check,n,f,o)),a-=f,o+=f,b)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(4&r.wrap&&u!==(65535&r.check)){t.msg="header crc mismatch",r.mode=zdt;break}u=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Udt;break;case 16189:for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}t.adler=r.check=Vdt(u),u=0,h=0,r.mode=Rdt;case Rdt:if(0===r.havedict)return t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,Pdt;t.adler=r.check=1,r.mode=Udt;case Udt:if(e===Sdt||e===Bdt)break t;case Ddt:if(r.last){u>>>=7&h,h-=7&h,r.mode=Hdt;break}for(;h<3;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}switch(r.last=1&u,u>>>=1,h-=1,3&u){case 0:r.mode=16193;break;case 1:if(egt(r),r.mode=Gdt,e===Bdt){u>>>=2,h-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=zdt}u>>>=2,h-=2;break;case 16193:for(u>>>=7&h,h-=7&h;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=zdt;break}if(r.length=65535&u,u=0,h=0,r.mode=Qdt,e===Bdt)break t;case Qdt:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>l&&(f=l),0===f)break t;i.set(n.subarray(o,o+f),s),a-=f,o+=f,l-=f,s+=f,r.length-=f;break}r.mode=Udt;break;case 16196:for(;h<14;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(r.nlen=257+(31&u),u>>>=5,h-=5,r.ndist=1+(31&u),u>>>=5,h-=5,r.ncode=4+(15&u),u>>>=4,h-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=zdt;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;h<3;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.lens[I[r.have++]]=7&u,u>>>=3,h-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=Edt(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg="invalid code lengths set",r.mode=zdt;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;E=r.lencode[u&(1<<r.lenbits)-1],g=E>>>24,y=E>>>16&255,m=65535&E,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(m<16)u>>>=g,h-=g,r.lens[r.have++]=m;else{if(16===m){for(B=g+2;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(u>>>=g,h-=g,0===r.have){t.msg="invalid bit length repeat",r.mode=zdt;break}b=r.lens[r.have-1],f=3+(3&u),u>>>=2,h-=2}else if(17===m){for(B=g+3;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=g,h-=g,b=0,f=3+(7&u),u>>>=3,h-=3}else{for(B=g+7;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=g,h-=g,b=0,f=11+(127&u),u>>>=7,h-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=zdt;break}for(;f--;)r.lens[r.have++]=b}}if(r.mode===zdt)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=zdt;break}if(r.lenbits=9,S={bits:r.lenbits},x=Edt(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg="invalid literal/lengths set",r.mode=zdt;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=Edt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){t.msg="invalid distances set",r.mode=zdt;break}if(r.mode=Gdt,e===Bdt)break t;case Gdt:r.mode=jdt;case jdt:if(a>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,vdt(t,A),s=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,h=r.bits,r.mode===Udt&&(r.back=-1);break}for(r.back=0;E=r.lencode[u&(1<<r.lenbits)-1],g=E>>>24,y=E>>>16&255,m=65535&E,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(y&&0==(240&y)){for(v=g,_=y,w=m;E=r.lencode[w+((u&(1<<v+_)-1)>>v)],g=E>>>24,y=E>>>16&255,m=65535&E,!(v+g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=v,h-=v,r.back+=v}if(u>>>=g,h-=g,r.back+=g,r.length=m,0===y){r.mode=16205;break}if(32&y){r.back=-1,r.mode=Udt;break}if(64&y){t.msg="invalid literal/length code",r.mode=zdt;break}r.extra=15&y,r.mode=16201;case 16201:if(r.extra){for(B=r.extra;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;E=r.distcode[u&(1<<r.distbits)-1],g=E>>>24,y=E>>>16&255,m=65535&E,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(0==(240&y)){for(v=g,_=y,w=m;E=r.distcode[w+((u&(1<<v+_)-1)>>v)],g=E>>>24,y=E>>>16&255,m=65535&E,!(v+g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=v,h-=v,r.back+=v}if(u>>>=g,h-=g,r.back+=g,64&y){t.msg="invalid distance code",r.mode=zdt;break}r.offset=m,r.extra=15&y,r.mode=16203;case 16203:if(r.extra){for(B=r.extra;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=zdt;break}r.mode=16204;case 16204:if(0===l)break t;if(f=A-l,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=zdt;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),d=r.window}else d=i,p=s-r.offset,f=r.length;f>l&&(f=l),l-=f,r.length-=f;do{i[s++]=d[p++]}while(--f);0===r.length&&(r.mode=jdt);break;case 16205:if(0===l)break t;i[s++]=r.length,l--,r.mode=jdt;break;case Hdt:if(r.wrap){for(;h<32;){if(0===a)break t;a--,u|=n[o++]<<h,h+=8}if(A-=l,t.total_out+=A,r.total+=A,4&r.wrap&&A&&(t.adler=r.check=r.flags?Yft(r.check,i,A,s-A):Wft(r.check,i,A,s-A)),A=l,4&r.wrap&&(r.flags?u:Vdt(u))!==r.check){t.msg="incorrect data check",r.mode=zdt;break}u=0,h=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(4&r.wrap&&u!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=zdt;break}u=0,h=0}r.mode=16208;case 16208:x=Tdt;break t;case zdt:x=Ldt;break t;case 16210:return Mdt;default:return Fdt}return t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,(r.wsize||A!==t.avail_out&&r.mode<zdt&&(r.mode<Hdt||e!==Cdt))&&rgt(t,t.output,t.next_out,A-t.avail_out),c-=t.avail_in,A-=t.avail_out,t.total_in+=c,t.total_out+=A,r.total+=A,4&r.wrap&&A&&(t.adler=r.check=r.flags?Yft(r.check,i,A,t.next_out-A):Wft(r.check,i,A,t.next_out-A)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Udt?128:0)+(r.mode===Gdt||r.mode===Qdt?256:0),(0===c&&0===A||e===Cdt)&&x===Idt&&(x=Odt),x},inflateEnd:t=>{if(qdt(t))return Fdt;let e=t.state;return e.window&&(e.window=null),t.state=null,Idt},inflateGetHeader:(t,e)=>{if(qdt(t))return Fdt;const r=t.state;return 0==(2&r.wrap)?Fdt:(r.head=e,e.done=!1,Idt)},inflateSetDictionary:(t,e)=>{const r=e.length;let n,i,o;return qdt(t)?Fdt:(n=t.state,0!==n.wrap&&n.mode!==Rdt?Fdt:n.mode===Rdt&&(i=1,i=Wft(i,e,r,0),i!==n.check)?Ldt:(o=rgt(t,e,r,r),o?(n.mode=16210,Mdt):(n.havedict=1,Idt)))},inflateInfo:"pako inflate (from Nodeca project)"},igt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const ogt=Object.prototype.toString,{Z_NO_FLUSH:sgt,Z_FINISH:agt,Z_OK:lgt,Z_STREAM_END:ugt,Z_NEED_DICT:hgt,Z_STREAM_ERROR:cgt,Z_DATA_ERROR:Agt,Z_MEM_ERROR:fgt}=Jft;function pgt(t){this.options=rdt.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sdt,this.strm.avail_out=0;let r=ngt.inflateInit2(this.strm,e.windowBits);if(r!==lgt)throw new Error(Zft[r]);if(this.header=new igt,ngt.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=odt.string2buf(e.dictionary):"[object ArrayBuffer]"===ogt.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=ngt.inflateSetDictionary(this.strm,e.dictionary),r!==lgt)))throw new Error(Zft[r])}function dgt(t,e){const r=new pgt(e);if(r.push(t),r.err)throw r.msg||Zft[r.err];return r.result}pgt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=e===~~e?e:!0===e?agt:sgt,"[object ArrayBuffer]"===ogt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=ngt.inflate(r,s),o===hgt&&i&&(o=ngt.inflateSetDictionary(r,i),o===lgt?o=ngt.inflate(r,s):o===Agt&&(o=hgt));r.avail_in>0&&o===ugt&&r.state.wrap>0&&0!==t[r.next_in];)ngt.inflateReset(r),o=ngt.inflate(r,s);switch(o){case cgt:case Agt:case hgt:case fgt:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===ugt))if("string"===this.options.to){let t=odt.utf8border(r.output,r.next_out),e=r.next_out-t,i=odt.buf2string(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==lgt||0!==a){if(o===ugt)return o=ngt.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},pgt.prototype.onData=function(t){this.chunks.push(t)},pgt.prototype.onEnd=function(t){t===lgt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=rdt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ggt={Inflate:pgt,inflate:dgt,inflateRaw:function(t,e){return(e=e||{}).raw=!0,dgt(t,e)},ungzip:dgt,constants:Jft};const{Inflate:ygt,inflate:mgt,inflateRaw:vgt,ungzip:_gt}=ggt;var wgt=mgt;const bgt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{decodeBlock(t){return wgt(new Uint8Array(t)).buffer}}},Symbol.toStringTag,{value:"Module"})),xgt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{decodeBlock(t){const e=new DataView(t),r=[];for(let n=0;n<t.byteLength;++n){let t=e.getInt8(n);if(t<0){const i=e.getUint8(n+1);t=-t;for(let e=0;e<=t;++e)r.push(i);n+=1}else{for(let i=0;i<=t;++i)r.push(e.getUint8(n+i+1));n+=t+1}}return new Uint8Array(r).buffer}}},Symbol.toStringTag,{value:"Module"}));var Egt={};!function(t){
|
|
471
471
|
/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */
|
|
472
472
|
!function(){var e,r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m=(e={defaultNoDataValue:-34027999387901484e22,decode:function(t,s){var a=(s=s||{}).encodedMaskData||null===s.encodedMaskData,l=o(t,s.inputOffset||0,a),u=null!==s.noDataValue?s.noDataValue:e.defaultNoDataValue,h=r(l,s.pixelType||Float32Array,s.encodedMaskData,u,s.returnMask),c={width:l.width,height:l.height,pixelData:h.resultPixels,minValue:h.minValue,maxValue:l.pixels.maxValue,noDataValue:u};return h.resultMask&&(c.maskData=h.resultMask),s.returnEncodedMask&&l.mask&&(c.encodedMaskData=l.mask.bitset?l.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=n(l),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=i(l))),c}},r=function(t,e,r,n,i){var o,a,l,u=0,h=t.pixels.numBlocksX,c=t.pixels.numBlocksY,A=Math.floor(t.width/h),f=Math.floor(t.height/c),p=2*t.maxZError,d=Number.MAX_VALUE;r=r||(t.mask?t.mask.bitset:null),a=new e(t.width*t.height),i&&r&&(l=new Uint8Array(t.width*t.height));for(var g,y,m=new Float32Array(A*f),v=0;v<=c;v++){var _=v!==c?f:t.height%c;if(0!==_)for(var w=0;w<=h;w++){var b=w!==h?A:t.width%h;if(0!==b){var x,E,C,S,B=v*t.width*f+w*A,I=t.width-b,T=t.pixels.blocks[u];if(T.encoding<2?(0===T.encoding?x=T.rawData:(s(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,m,t.pixels.maxValue),x=m),E=0):C=2===T.encoding?0:T.offset,r)for(y=0;y<_;y++){for(7&B&&(S=r[B>>3],S<<=7&B),g=0;g<b;g++)7&B||(S=r[B>>3]),128&S?(l&&(l[B]=1),d=d>(o=T.encoding<2?x[E++]:C)?o:d,a[B++]=o):(l&&(l[B]=0),a[B++]=n),S<<=1;B+=I}else if(T.encoding<2)for(y=0;y<_;y++){for(g=0;g<b;g++)d=d>(o=x[E++])?o:d,a[B++]=o;B+=I}else for(d=d>C?C:d,y=0;y<_;y++){for(g=0;g<b;g++)a[B++]=C;B+=I}if(1===T.encoding&&E!==T.numValidPixels)throw"Block and Mask do not match";u++}}}return{resultPixels:a,resultMask:l,minValue:d}},n=function(t){return{fileIdentifierString:t.fileIdentifierString,fileVersion:t.fileVersion,imageType:t.imageType,height:t.height,width:t.width,maxZError:t.maxZError,eofOffset:t.eofOffset,mask:t.mask?{numBlocksX:t.mask.numBlocksX,numBlocksY:t.mask.numBlocksY,numBytes:t.mask.numBytes,maxValue:t.mask.maxValue}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,numBytes:t.pixels.numBytes,maxValue:t.pixels.maxValue,noDataValue:t.noDataValue}}},i=function(t){for(var e=t.pixels.numBlocksX*t.pixels.numBlocksY,r={},n=0;n<e;n++){var i=t.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},o=function(t,e,r){var n={},i=new Uint8Array(t,e,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;e+=10;var o=new DataView(t,e,24);if(n.fileVersion=o.getInt32(0,!0),n.imageType=o.getInt32(4,!0),n.height=o.getUint32(8,!0),n.width=o.getUint32(12,!0),n.maxZError=o.getFloat64(16,!0),e+=24,!r)if(o=new DataView(t,e,16),n.mask={},n.mask.numBlocksY=o.getUint32(0,!0),n.mask.numBlocksX=o.getUint32(4,!0),n.mask.numBytes=o.getUint32(8,!0),n.mask.maxValue=o.getFloat32(12,!0),e+=16,n.mask.numBytes>0){var s=new Uint8Array(Math.ceil(n.width*n.height/8)),a=(o=new DataView(t,e,n.mask.numBytes)).getInt16(0,!0),l=2,u=0;do{if(a>0)for(;a--;)s[u++]=o.getUint8(l++);else{var h=o.getUint8(l++);for(a=-a;a--;)s[u++]=h}a=o.getInt16(l,!0),l+=2}while(l<n.mask.numBytes);if(-32768!==a||u<s.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=s,e+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));o=new DataView(t,e,16),n.pixels={},n.pixels.numBlocksY=o.getUint32(0,!0),n.pixels.numBlocksX=o.getUint32(4,!0),n.pixels.numBytes=o.getUint32(8,!0),n.pixels.maxValue=o.getFloat32(12,!0),e+=16;var c=n.pixels.numBlocksX,A=n.pixels.numBlocksY,f=c+(n.width%c>0?1:0),p=A+(n.height%A>0?1:0);n.pixels.blocks=new Array(f*p);for(var d=0,g=0;g<p;g++)for(var y=0;y<f;y++){var m=0,v=t.byteLength-e;o=new DataView(t,e,Math.min(10,v));var _={};n.pixels.blocks[d++]=_;var w=o.getUint8(0);if(m++,_.encoding=63&w,_.encoding>3)throw"Invalid block encoding ("+_.encoding+")";if(2!==_.encoding){if(0!==w&&2!==w){if(w>>=6,_.offsetType=w,2===w)_.offset=o.getInt8(1),m++;else if(1===w)_.offset=o.getInt16(1,!0),m+=2;else{if(0!==w)throw"Invalid block offset type";_.offset=o.getFloat32(1,!0),m+=4}if(1===_.encoding)if(w=o.getUint8(m),m++,_.bitsPerPixel=63&w,w>>=6,_.numValidPixelsType=w,2===w)_.numValidPixels=o.getUint8(m),m++;else if(1===w)_.numValidPixels=o.getUint16(m,!0),m+=2;else{if(0!==w)throw"Invalid valid pixel count type";_.numValidPixels=o.getUint32(m,!0),m+=4}}var b;if(e+=m,3!==_.encoding)if(0===_.encoding){var x=(n.pixels.numBytes-1)/4;if(x!==Math.floor(x))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*x),new Uint8Array(b).set(new Uint8Array(t,e,4*x));var E=new Float32Array(b);_.rawData=E,e+=4*x}else if(1===_.encoding){var C=Math.ceil(_.numValidPixels*_.bitsPerPixel/8),S=Math.ceil(C/4);b=new ArrayBuffer(4*S),new Uint8Array(b).set(new Uint8Array(t,e,C)),_.stuffedData=new Uint32Array(b),e+=C}}else e++}return n.eofOffset=e,n},s=function(t,e,r,n,i,o,s){var a,l,u,h=(1<<e)-1,c=0,A=0,f=Math.ceil((s-n)/i),p=4*t.length-Math.ceil(e*r/8);for(t[t.length-1]<<=8*p,a=0;a<r;a++){if(0===A&&(u=t[c++],A=32),A>=e)l=u>>>A-e&h,A-=e;else{var d=e-A;l=(u&h)<<d&h,l+=(u=t[c++])>>>(A=32-d)}o[a]=l<f?n+l*i:s}return o},e),v=(a=function(t,e,r,n,i,o,s,a){var l,u,h,c,A,f=(1<<r)-1,p=0,d=0,g=4*t.length-Math.ceil(r*n/8);if(t[t.length-1]<<=8*g,i)for(l=0;l<n;l++)0===d&&(h=t[p++],d=32),d>=r?(u=h>>>d-r&f,d-=r):(u=(h&f)<<(c=r-d)&f,u+=(h=t[p++])>>>(d=32-c)),e[l]=i[u];else for(A=Math.ceil((a-o)/s),l=0;l<n;l++)0===d&&(h=t[p++],d=32),d>=r?(u=h>>>d-r&f,d-=r):(u=(h&f)<<(c=r-d)&f,u+=(h=t[p++])>>>(d=32-c)),e[l]=u<A?o+u*s:a},l=function(t,e,r,n,i,o){var s,a=(1<<e)-1,l=0,u=0,h=0,c=0,A=0,f=[],p=4*t.length-Math.ceil(e*r/8);t[t.length-1]<<=8*p;var d=Math.ceil((o-n)/i);for(u=0;u<r;u++)0===c&&(s=t[l++],c=32),c>=e?(A=s>>>c-e&a,c-=e):(A=(s&a)<<(h=e-c)&a,A+=(s=t[l++])>>>(c=32-h)),f[u]=A<d?n+A*i:o;return f.unshift(n),f},u=function(t,e,r,n,i,o,s,a){var l,u,h,c,A=(1<<r)-1,f=0,p=0,d=0;if(i)for(l=0;l<n;l++)0===p&&(h=t[f++],p=32,d=0),p>=r?(u=h>>>d&A,p-=r,d+=r):(u=h>>>d&A,p=32-(c=r-p),u|=((h=t[f++])&(1<<c)-1)<<r-c,d=c),e[l]=i[u];else{var g=Math.ceil((a-o)/s);for(l=0;l<n;l++)0===p&&(h=t[f++],p=32,d=0),p>=r?(u=h>>>d&A,p-=r,d+=r):(u=h>>>d&A,p=32-(c=r-p),u|=((h=t[f++])&(1<<c)-1)<<r-c,d=c),e[l]=u<g?o+u*s:a}return e},h=function(t,e,r,n,i,o){var s,a=(1<<e)-1,l=0,u=0,h=0,c=0,A=0,f=0,p=[],d=Math.ceil((o-n)/i);for(u=0;u<r;u++)0===c&&(s=t[l++],c=32,f=0),c>=e?(A=s>>>f&a,c-=e,f+=e):(A=s>>>f&a,c=32-(h=e-c),A|=((s=t[l++])&(1<<h)-1)<<e-h,f=h),p[u]=A<d?n+A*i:o;return p.unshift(n),p},c=function(t,e,r,n){var i,o,s,a,l=(1<<r)-1,u=0,h=0,c=4*t.length-Math.ceil(r*n/8);for(t[t.length-1]<<=8*c,i=0;i<n;i++)0===h&&(s=t[u++],h=32),h>=r?(o=s>>>h-r&l,h-=r):(o=(s&l)<<(a=r-h)&l,o+=(s=t[u++])>>>(h=32-a)),e[i]=o;return e},A=function(t,e,r,n){var i,o,s,a,l=(1<<r)-1,u=0,h=0,c=0;for(i=0;i<n;i++)0===h&&(s=t[u++],h=32,c=0),h>=r?(o=s>>>c&l,h-=r,c+=r):(o=s>>>c&l,h=32-(a=r-h),o|=((s=t[u++])&(1<<a)-1)<<r-a,c=a),e[i]=o;return e},f={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(t){for(var e=65535,r=65535,n=t.length,i=Math.floor(n/2),o=0;i;){var s=i>=359?359:i;i-=s;do{e+=t[o++]<<8,r+=e+=t[o++]}while(--s);e=(65535&e)+(e>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=e+=t[o]<<8),((r=(65535&r)+(r>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(t,e){var r=e.ptr,n=new Uint8Array(t,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var o,s=new DataView(t,r,8),a=s.getInt32(0,!0);if(i.fileVersion=a,r+=4,a>=3&&(i.checksum=s.getUint32(4,!0),r+=4),s=new DataView(t,r,12),i.height=s.getUint32(0,!0),i.width=s.getUint32(4,!0),r+=8,a>=4?(i.numDims=s.getUint32(8,!0),r+=4):i.numDims=1,s=new DataView(t,r,40),i.numValidPixel=s.getUint32(0,!0),i.microBlockSize=s.getInt32(4,!0),i.blobSize=s.getInt32(8,!0),i.imageType=s.getInt32(12,!0),i.maxZError=s.getFloat64(16,!0),i.zMin=s.getFloat64(24,!0),i.zMax=s.getFloat64(32,!0),r+=40,e.headerInfo=i,e.ptr=r,a>=3&&(o=a>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(t,r-o,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(t,e){var r=e.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),o=this.readSubArray(t,e.ptr,n,i),s=this.readSubArray(t,e.ptr+i,n,i);e.ptr+=2*i;var a,l=!0;for(a=0;a<r.numDims;a++)if(o[a]!==s[a]){l=!1;break}return r.minValues=o,r.maxValues=s,l},readSubArray:function(t,e,r,n){var i;if(r===Uint8Array)i=new Uint8Array(t,e,n);else{var o=new ArrayBuffer(n);new Uint8Array(o).set(new Uint8Array(t,e,n)),i=new r(o)}return i},readMask:function(t,e){var r,n,i=e.ptr,o=e.headerInfo,s=o.width*o.height,a=o.numValidPixel,l=new DataView(t,i,4),u={};if(u.numBytes=l.getUint32(0,!0),i+=4,(0===a||s===a)&&0!==u.numBytes)throw"invalid mask";if(0===a)r=new Uint8Array(Math.ceil(s/8)),u.bitset=r,n=new Uint8Array(s),e.pixels.resultMask=n,i+=u.numBytes;else if(u.numBytes>0){r=new Uint8Array(Math.ceil(s/8));var h=(l=new DataView(t,i,u.numBytes)).getInt16(0,!0),c=2,A=0,f=0;do{if(h>0)for(;h--;)r[A++]=l.getUint8(c++);else for(f=l.getUint8(c++),h=-h;h--;)r[A++]=f;h=l.getInt16(c,!0),c+=2}while(c<u.numBytes);if(-32768!==h||A<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(s);var p=0,d=0;for(d=0;d<s;d++)7&d?(p=r[d>>3],p<<=7&d):p=r[d>>3],128&p&&(n[d]=1);e.pixels.resultMask=n,u.bitset=r,i+=u.numBytes}return e.ptr=i,e.mask=u,!0},readDataOneSweep:function(t,e,r,n){var i,o=e.ptr,s=e.headerInfo,a=s.numDims,l=s.width*s.height,u=s.imageType,h=s.numValidPixel*f.getDataTypeSize(u)*a,c=e.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(t,o,h);else{var A=new ArrayBuffer(h);new Uint8Array(A).set(new Uint8Array(t,o,h)),i=new r(A)}if(i.length===l*a)e.pixels.resultPixels=n?f.swapDimensionOrder(i,l,a,r,!0):i;else{e.pixels.resultPixels=new r(l*a);var p=0,d=0,g=0,y=0;if(a>1){if(n){for(d=0;d<l;d++)if(c[d])for(y=d,g=0;g<a;g++,y+=l)e.pixels.resultPixels[y]=i[p++]}else for(d=0;d<l;d++)if(c[d])for(y=d*a,g=0;g<a;g++)e.pixels.resultPixels[y+g]=i[p++]}else for(d=0;d<l;d++)c[d]&&(e.pixels.resultPixels[d]=i[p++])}return o+=h,e.ptr=o,!0},readHuffmanTree:function(t,e){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(t,e.ptr,16);if(e.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),o=n.getInt32(8,!0),s=n.getInt32(12,!0);if(o>=s)return!1;var a=new Uint32Array(s-o);f.decodeBits(t,e,a);var l,u,h,c,A=[];for(l=o;l<s;l++)A[u=l-(l<i?0:i)]={first:a[l-o],second:null};var d=t.byteLength-e.ptr,g=Math.ceil(d/4),y=new ArrayBuffer(4*g);new Uint8Array(y).set(new Uint8Array(t,e.ptr,d));var m,v=new Uint32Array(y),_=0,w=0;for(m=v[0],l=o;l<s;l++)(c=A[u=l-(l<i?0:i)].first)>0&&(A[u].second=m<<_>>>32-c,32-_>=c?32===(_+=c)&&(_=0,m=v[++w]):(_+=c-32,m=v[++w],A[u].second|=m>>>32-_));var b,x=0,E=new p;for(l=0;l<A.length;l++)void 0!==A[l]&&(x=Math.max(x,A[l].first));b=x>=r?r:x;var C,S,B,I,T,P=[];for(l=o;l<s;l++)if((c=A[u=l-(l<i?0:i)].first)>0)if(C=[c,u],c<=b)for(S=A[u].second<<b-c,B=1<<b-c,h=0;h<B;h++)P[S|h]=C;else for(S=A[u].second,T=E,I=c-1;I>=0;I--)S>>>I&1?(T.right||(T.right=new p),T=T.right):(T.left||(T.left=new p),T=T.left),0!==I||T.val||(T.val=C[1]);return{decodeLut:P,numBitsLUTQick:b,numBitsLUT:x,tree:E,stuffedData:v,srcPtr:w,bitPos:_}},readHuffman:function(t,e,r,n){var i,o,s,a,l,u,h,c,A,p=e.headerInfo.numDims,d=e.headerInfo.height,g=e.headerInfo.width,y=g*d,m=this.readHuffmanTree(t,e),v=m.decodeLut,_=m.tree,w=m.stuffedData,b=m.srcPtr,x=m.bitPos,E=m.numBitsLUTQick,C=m.numBitsLUT,S=0===e.headerInfo.imageType?128:0,B=e.pixels.resultMask,I=0;x>0&&(b++,x=0);var T,P=w[b],F=1===e.encodeMode,L=new r(y*p),M=L;if(p<2||F){for(T=0;T<p;T++)if(p>1&&(M=new r(L.buffer,y*T,y),I=0),e.headerInfo.numValidPixel===g*d)for(c=0,u=0;u<d;u++)for(h=0;h<g;h++,c++){if(o=0,l=a=P<<x>>>32-E,32-x<E&&(l=a|=w[b+1]>>>64-x-E),v[l])o=v[l][1],x+=v[l][0];else for(l=a=P<<x>>>32-C,32-x<C&&(l=a|=w[b+1]>>>64-x-C),i=_,A=0;A<C;A++)if(!(i=a>>>C-A-1&1?i.right:i.left).left&&!i.right){o=i.val,x=x+A+1;break}x>=32&&(x-=32,P=w[++b]),s=o-S,F?(s+=h>0?I:u>0?M[c-g]:I,s&=255,M[c]=s,I=s):M[c]=s}else for(c=0,u=0;u<d;u++)for(h=0;h<g;h++,c++)if(B[c]){if(o=0,l=a=P<<x>>>32-E,32-x<E&&(l=a|=w[b+1]>>>64-x-E),v[l])o=v[l][1],x+=v[l][0];else for(l=a=P<<x>>>32-C,32-x<C&&(l=a|=w[b+1]>>>64-x-C),i=_,A=0;A<C;A++)if(!(i=a>>>C-A-1&1?i.right:i.left).left&&!i.right){o=i.val,x=x+A+1;break}x>=32&&(x-=32,P=w[++b]),s=o-S,F?(h>0&&B[c-1]?s+=I:u>0&&B[c-g]?s+=M[c-g]:s+=I,s&=255,M[c]=s,I=s):M[c]=s}}else for(c=0,u=0;u<d;u++)for(h=0;h<g;h++)if(c=u*g+h,!B||B[c])for(T=0;T<p;T++,c+=y){if(o=0,l=a=P<<x>>>32-E,32-x<E&&(l=a|=w[b+1]>>>64-x-E),v[l])o=v[l][1],x+=v[l][0];else for(l=a=P<<x>>>32-C,32-x<C&&(l=a|=w[b+1]>>>64-x-C),i=_,A=0;A<C;A++)if(!(i=a>>>C-A-1&1?i.right:i.left).left&&!i.right){o=i.val,x=x+A+1;break}x>=32&&(x-=32,P=w[++b]),s=o-S,M[c]=s}e.ptr=e.ptr+4*(b+1)+(x>0?4:0),e.pixels.resultPixels=L,p>1&&!n&&(e.pixels.resultPixels=f.swapDimensionOrder(L,y,p,r))},decodeBits:function(t,e,r,n,i){var o=e.headerInfo,s=o.fileVersion,f=0,p=t.byteLength-e.ptr>=5?5:t.byteLength-e.ptr,d=new DataView(t,e.ptr,p),g=d.getUint8(0);f++;var y=g>>6,m=0===y?4:3-y,v=(32&g)>0,_=31&g,w=0;if(1===m)w=d.getUint8(f),f++;else if(2===m)w=d.getUint16(f,!0),f+=2;else{if(4!==m)throw"Invalid valid pixel count type";w=d.getUint32(f,!0),f+=4}var b,x,E,C,S,B,I,T,P,F=2*o.maxZError,L=o.numDims>1?o.maxValues[i]:o.zMax;if(v){for(e.counter.lut++,T=d.getUint8(f),f++,C=Math.ceil((T-1)*_/8),S=Math.ceil(C/4),x=new ArrayBuffer(4*S),E=new Uint8Array(x),e.ptr+=f,E.set(new Uint8Array(t,e.ptr,C)),I=new Uint32Array(x),e.ptr+=C,P=0;T-1>>>P;)P++;C=Math.ceil(w*P/8),S=Math.ceil(C/4),x=new ArrayBuffer(4*S),(E=new Uint8Array(x)).set(new Uint8Array(t,e.ptr,C)),b=new Uint32Array(x),e.ptr+=C,B=s>=3?h(I,_,T-1,n,F,L):l(I,_,T-1,n,F,L),s>=3?u(b,r,P,w,B):a(b,r,P,w,B)}else e.counter.bitstuffer++,P=_,e.ptr+=f,P>0&&(C=Math.ceil(w*P/8),S=Math.ceil(C/4),x=new ArrayBuffer(4*S),(E=new Uint8Array(x)).set(new Uint8Array(t,e.ptr,C)),b=new Uint32Array(x),e.ptr+=C,s>=3?null==n?A(b,r,P,w):u(b,r,P,w,!1,n,F,L):null==n?c(b,r,P,w):a(b,r,P,w,!1,n,F,L))},readTiles:function(t,e,r,n){var i=e.headerInfo,o=i.width,s=i.height,a=o*s,l=i.microBlockSize,u=i.imageType,h=f.getDataTypeSize(u),c=Math.ceil(o/l),A=Math.ceil(s/l);e.pixels.numBlocksY=A,e.pixels.numBlocksX=c,e.pixels.ptr=0;var p,d,g,y,m,v,_,w,b,x,E=0,C=0,S=0,B=0,I=0,T=0,P=0,F=0,L=0,M=0,O=0,k=0,N=0,R=0,U=0,D=new r(l*l),Q=s%l||l,G=o%l||l,j=i.numDims,H=e.pixels.resultMask,z=e.pixels.resultPixels,V=i.fileVersion>=5?14:15,K=i.zMax;for(S=0;S<A;S++)for(I=S!==A-1?l:Q,B=0;B<c;B++)for(M=S*o*l+B*l,O=o-(T=B!==c-1?l:G),w=0;w<j;w++){if(j>1?(x=z,M=S*o*l+B*l,z=new r(e.pixels.resultPixels.buffer,a*w*h,a),K=i.maxValues[w]):x=null,P=t.byteLength-e.ptr,d={},U=0,F=(p=new DataView(t,e.ptr,Math.min(10,P))).getUint8(0),U++,b=i.fileVersion>=5?4&F:0,L=F>>6&255,(F>>2&V)!=(B*l>>3&V))throw"integrity issue";if(b&&0===w)throw"integrity issue";if((m=3&F)>3)throw e.ptr+=U,"Invalid block encoding ("+m+")";if(2!==m)if(0===m){if(b)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=U,k=(k=I*T*h)<(N=t.byteLength-e.ptr)?k:N,g=new ArrayBuffer(k%h==0?k:k+h-k%h),new Uint8Array(g).set(new Uint8Array(t,e.ptr,k)),y=new r(g),R=0,H)for(E=0;E<I;E++){for(C=0;C<T;C++)H[M]&&(z[M]=y[R++]),M++;M+=O}else for(E=0;E<I;E++){for(C=0;C<T;C++)z[M++]=y[R++];M+=O}e.ptr+=R*h}else if(v=f.getDataTypeUsed(b&&u<6?4:u,L),_=f.getOnePixel(d,U,v,p),U+=f.getDataTypeSize(v),3===m)if(e.ptr+=U,e.counter.constantoffset++,H)for(E=0;E<I;E++){for(C=0;C<T;C++)H[M]&&(z[M]=b?Math.min(K,x[M]+_):_),M++;M+=O}else for(E=0;E<I;E++){for(C=0;C<T;C++)z[M]=b?Math.min(K,x[M]+_):_,M++;M+=O}else if(e.ptr+=U,f.decodeBits(t,e,D,_,w),U=0,b)if(H)for(E=0;E<I;E++){for(C=0;C<T;C++)H[M]&&(z[M]=D[U++]+x[M]),M++;M+=O}else for(E=0;E<I;E++){for(C=0;C<T;C++)z[M]=D[U++]+x[M],M++;M+=O}else if(H)for(E=0;E<I;E++){for(C=0;C<T;C++)H[M]&&(z[M]=D[U++]),M++;M+=O}else for(E=0;E<I;E++){for(C=0;C<T;C++)z[M++]=D[U++];M+=O}else{if(b)if(H)for(E=0;E<I;E++)for(C=0;C<T;C++)H[M]&&(z[M]=x[M]),M++;else for(E=0;E<I;E++)for(C=0;C<T;C++)z[M]=x[M],M++;e.counter.constant++,e.ptr+=U}}j>1&&!n&&(e.pixels.resultPixels=f.swapDimensionOrder(e.pixels.resultPixels,a,j,r))},formatFileInfo:function(t){return{fileIdentifierString:t.headerInfo.fileIdentifierString,fileVersion:t.headerInfo.fileVersion,imageType:t.headerInfo.imageType,height:t.headerInfo.height,width:t.headerInfo.width,numValidPixel:t.headerInfo.numValidPixel,microBlockSize:t.headerInfo.microBlockSize,blobSize:t.headerInfo.blobSize,maxZError:t.headerInfo.maxZError,pixelType:f.getPixelType(t.headerInfo.imageType),eofOffset:t.eofOffset,mask:t.mask?{numBytes:t.mask.numBytes}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,maxValue:t.headerInfo.zMax,minValue:t.headerInfo.zMin,noDataValue:t.noDataValue}}},constructConstantSurface:function(t,e){var r=t.headerInfo.zMax,n=t.headerInfo.zMin,i=t.headerInfo.maxValues,o=t.headerInfo.numDims,s=t.headerInfo.height*t.headerInfo.width,a=0,l=0,u=0,h=t.pixels.resultMask,c=t.pixels.resultPixels;if(h)if(o>1){if(e)for(a=0;a<o;a++)for(u=a*s,r=i[a],l=0;l<s;l++)h[l]&&(c[u+l]=r);else for(l=0;l<s;l++)if(h[l])for(u=l*o,a=0;a<o;a++)c[u+o]=i[a]}else for(l=0;l<s;l++)h[l]&&(c[l]=r);else if(o>1&&n!==r)if(e)for(a=0;a<o;a++)for(u=a*s,r=i[a],l=0;l<s;l++)c[u+l]=r;else for(l=0;l<s;l++)for(u=l*o,a=0;a<o;a++)c[u+a]=i[a];else for(l=0;l<s*o;l++)c[l]=r},getDataTypeArray:function(t){var e;switch(t){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:default:e=Float32Array;break;case 7:e=Float64Array}return e},getPixelType:function(t){var e;switch(t){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:default:e="F32";break;case 7:e="F64"}return e},isValidPixelValue:function(t,e){if(null==e)return!1;var r;switch(t){case 0:r=e>=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(t){var e=0;switch(t){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=t}return e},getDataTypeUsed:function(t,e){var r=t;switch(t){case 2:case 4:r=t-e;break;case 3:case 5:r=t-2*e;break;case 6:r=0===e?t:1===e?2:1;break;case 7:r=0===e?t:t-2*e+1;break;default:r=t}return r},getOnePixel:function(t,e,r,n){var i=0;switch(r){case 0:i=n.getInt8(e);break;case 1:i=n.getUint8(e);break;case 2:i=n.getInt16(e,!0);break;case 3:i=n.getUint16(e,!0);break;case 4:i=n.getInt32(e,!0);break;case 5:i=n.getUInt32(e,!0);break;case 6:i=n.getFloat32(e,!0);break;case 7:i=n.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(t,e,r,n,i){var o=0,s=0,a=0,l=0,u=t;if(r>1)if(u=new n(e*r),i)for(o=0;o<e;o++)for(l=o,a=0;a<r;a++,l+=e)u[l]=t[s++];else for(o=0;o<e;o++)for(l=o,a=0;a<r;a++,l+=e)u[s++]=t[l];return u}},p=function(t,e,r){this.val=t,this.left=e,this.right=r},d={decode:function(t,e){var r=(e=e||{}).noDataValue,n=0,i={};if(i.ptr=e.inputOffset||0,i.pixels={},f.readHeaderInfo(t,i)){var o=i.headerInfo,s=o.fileVersion,a=f.getDataTypeArray(o.imageType);if(s>5)throw"unsupported lerc version 2."+s;f.readMask(t,i),o.numValidPixel===o.width*o.height||i.pixels.resultMask||(i.pixels.resultMask=e.maskData);var l=o.width*o.height;i.pixels.resultPixels=new a(l*o.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var u,h=!e.returnPixelInterleavedDims;if(0!==o.numValidPixel)if(o.zMax===o.zMin)f.constructConstantSurface(i,h);else if(s>=4&&f.checkMinMaxRanges(t,i))f.constructConstantSurface(i,h);else{var c=new DataView(t,i.ptr,2),A=c.getUint8(0);if(i.ptr++,A)f.readDataOneSweep(t,i,a,h);else if(s>1&&o.imageType<=1&&Math.abs(o.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||s<4&&p>1)throw"Invalid Huffman flag "+p;p?f.readHuffman(t,i,a,h):f.readTiles(t,i,a,h)}else f.readTiles(t,i,a,h)}i.eofOffset=i.ptr,e.inputOffset?(u=i.headerInfo.blobSize+e.inputOffset-i.ptr,Math.abs(u)>=1&&(i.eofOffset=e.inputOffset+i.headerInfo.blobSize)):(u=i.headerInfo.blobSize-i.ptr,Math.abs(u)>=1&&(i.eofOffset=i.headerInfo.blobSize));var d={width:o.width,height:o.height,pixelData:i.pixels.resultPixels,minValue:o.zMin,maxValue:o.zMax,validPixelCount:o.numValidPixel,dimCount:o.numDims,dimStats:{minValues:o.minValues,maxValues:o.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&f.isValidPixelValue(o.imageType,r)){var g=i.pixels.resultMask;for(n=0;n<l;n++)g[n]||(d.pixelData[n]=r);d.noDataValue=r}return i.noDataValue=r,e.returnFileInfo&&(d.fileInfo=f.formatFileInfo(i)),d}},getBandCount:function(t){for(var e=0,r=0,n={ptr:0,pixels:{}};r<t.byteLength-58;)f.readHeaderInfo(t,n),r+=n.headerInfo.blobSize,e++,n.ptr=r;return e}},d),_=(g=new ArrayBuffer(4),y=new Uint8Array(g),new Uint32Array(g)[0]=1,1===y[0]),w={decode:function(t,e){if(!_)throw"Big endian system is not supported.";var r,n,i=(e=e||{}).inputOffset||0,o=new Uint8Array(t,i,10),s=String.fromCharCode.apply(null,o);if("CntZImage"===s.trim())r=m,n=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;r=v,n=2}for(var a,l,u,h,c,A,f=0,p=t.byteLength-10,d=[],g={width:0,height:0,pixels:[],pixelType:e.pixelType,mask:null,statistics:[]},y=0;i<p;){var w=r.decode(t,{inputOffset:i,encodedMaskData:a,maskData:u,returnMask:0===f,returnEncodedMask:0===f,returnFileInfo:!0,returnPixelInterleavedDims:e.returnPixelInterleavedDims,pixelType:e.pixelType||null,noDataValue:e.noDataValue||null});i=w.fileInfo.eofOffset,u=w.maskData,0===f&&(a=w.encodedMaskData,g.width=w.width,g.height=w.height,g.dimCount=w.dimCount||1,g.pixelType=w.pixelType||w.fileInfo.pixelType,g.mask=u),n>1&&(u&&d.push(u),w.fileInfo.mask&&w.fileInfo.mask.numBytes>0&&y++),f++,g.pixels.push(w.pixelData),g.statistics.push({minValue:w.minValue,maxValue:w.maxValue,noDataValue:w.noDataValue,dimStats:w.dimStats})}if(n>1&&y>1){for(A=g.width*g.height,g.bandMasks=d,(u=new Uint8Array(A)).set(d[0]),h=1;h<d.length;h++)for(l=d[h],c=0;c<A;c++)u[c]=u[c]&l[c];g.maskData=u}return g}};t.exports?t.exports=w:this.Lerc=w}()}({get exports(){return Egt},set exports(t){Egt=t}});const Cgt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{constructor(t){super(),this.planarConfiguration=void 0!==t.PlanarConfiguration?t.PlanarConfiguration:1,this.samplesPerPixel=void 0!==t.SamplesPerPixel?t.SamplesPerPixel:1,this.addCompression=t.LercParameters[1]}decodeBlock(t){switch(this.addCompression){case 0:break;case 1:t=wgt(new Uint8Array(t)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return Egt.decode(t,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}},Symbol.toStringTag,{value:"Module"})),Sgt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends XAt{constructor(){if(super(),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(t,e){const r=new Blob([e]),n=await createImageBitmap(r);let i;"undefined"!=typeof document?(i=document.createElement("canvas"),i.width=n.width,i.height=n.height):i=new OffscreenCanvas(n.width,n.height);const o=i.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,n.width,n.height).data.buffer}}},Symbol.toStringTag,{value:"Module"}));var Bgt=Worker;const Igt=Object.freeze(Object.defineProperty({__proto__:null,create:function(){const t='function e(e,t,r,n,i,a,o){try{var s=e[a](o),f=s.value}catch(e){return void r(e)}s.done?t(f):Promise.resolve(f).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,f,"next",t)}function f(t){e(o,i,a,s,f,"throw",t)}s(void 0)}))}}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var n={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=h;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var f=c(e,t,r);if("normal"===f.type){if(n=r.done?m:d,f.arg===v)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n=m,r.method="throw",r.arg=f.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function w(){}function g(){}var b={};l(b,o,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(D([])));x&&x!==n&&i.call(x,o)&&(b=x);var _=g.prototype=y.prototype=Object.create(b);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(a,o,s,f){var l=c(e[a],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,f)}),(function(e){n("throw",e,s,f)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,f)}))}f(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function D(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return w.prototype=g,l(_,"constructor",g),l(g,"constructor",w),w.displayName=l(g,f,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,f,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},A(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(_),l(_,f,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var f=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(f&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n);var i=n.exports,a=new Map;function o(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return a.set(e,t)}))}function s(e){return f.apply(this,arguments)}function f(){return(f=t(i.mark((function e(t){var r,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}o([void 0,1],(function(){return Promise.resolve().then((function(){return _})).then((function(e){return e.default}))})),o(5,(function(){return Promise.resolve().then((function(){return S})).then((function(e){return e.default}))})),o(6,(function(){throw new Error("old style JPEG compression is not supported.")})),o(7,(function(){return Promise.resolve().then((function(){return L})).then((function(e){return e.default}))})),o([8,32946],(function(){return Promise.resolve().then((function(){return Ne})).then((function(e){return e.default}))})),o(32773,(function(){return Promise.resolve().then((function(){return Ye})).then((function(e){return e.default}))})),o(34887,(function(){return Promise.resolve().then((function(){return ut})).then((function(e){return e.default}))})),o(50001,(function(){return Promise.resolve().then((function(){return dt})).then((function(e){return e.default}))}));var l=globalThis;function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function w(e,t,r){for(var n=0,i=e.length,a=i/r;i>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),f=0;f<a;++f)for(var l=0;l<r;++l)e[r*f+l]=s[(r-l-1)*a+f]}function g(e,t,r,n,i,a){if(!t||1===t)return e;for(var o=0;o<i.length;++o){if(i[o]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var s=i[0]/8,f=2===a?1:i.length,l=0;l<n&&!(l*f*r*s>=e.byteLength);++l){var u=void 0;if(2===t){switch(i[0]){case 8:u=new Uint8Array(e,l*f*r*s,f*r*s);break;case 16:u=new Uint16Array(e,l*f*r*s,f*r*s/2);break;case 32:u=new Uint32Array(e,l*f*r*s,f*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}y(u,f)}else 3===t&&w(u=new Uint8Array(e,l*f*r*s,f*r*s),f,s)}return e}l.addEventListener("message",function(){var e=t(i.mark((function e(t){var r,n,a,o,f,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=r.id,a=r.fileDirectory,o=r.buffer,e.next=3,s(a);case 3:return f=e.sent,e.next=6,f.decode(a,o);case 6:u=e.sent,l.postMessage({decoded:u,id:n},[u]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var b=function(){function e(){u(this,e)}var r;return h(e,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,s=o?t.TileWidth:t.ImageWidth,f=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",g(n,a,s,f,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var x=function(e){p(r,b);var t=k(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),_=Object.freeze({__proto__:null,default:x});function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function P(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function I(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,a=9,o=0;function s(){i=258,a=9}function f(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),a=8-n,o=t+r-8*(i+1),s=8*(i+2)-(t+r),f=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var l=e[i]&Math.pow(2,8-n)-1,u=l<<=r-a;if(i+1<e.length){var c=e[i+1]>>>s;u+=c<<=Math.max(0,r-f)}if(o>8&&i+2<e.length){var h=8*(i+3)-(t+r);u+=e[i+2]>>>h}return u}(e,o,a);return o+=a,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function u(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var c=[];s();for(var h,d=new Uint8Array(e),p=f(d);257!==p;){if(256===p){for(s(),p=f(d);256===p;)p=f(d);if(257===p)break;if(p>256)throw new Error("corrupted code at scanline ".concat(p));P(c,u(p)),h=p}else if(p<i){var m=u(p);P(c,m),l(h,m[m.length-1]),h=p}else{var v=u(h);if(!v)throw new Error("Bogus entry. Not in dictionary, ".concat(h," / ").concat(i,", position: ").concat(o));P(c,v),c.push(v[v.length-1]),l(h,v[v.length-1]),h=p}i+1>=Math.pow(2,a)&&(12===a?h=void 0:a++),p=f(d)}return new Uint8Array(c)}var U=function(e){p(r,b);var t=A(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return I(e).buffer}}]),r}(),S=Object.freeze({__proto__:null,default:U});function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var D=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function E(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var a,o=n[0],s=0;s<i;s++){for(var f=0;f<e[s];f++){for((o=n.pop()).children[o.index]=t[r];o.index>0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;r++}s+1<i&&(n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a)}return n[0].children}function B(e,t,n,i,a,o,s,f,l){var u=n.mcusPerLine,c=n.progressive,h=t,d=t,p=0,m=0;function v(){if(m>0)return m--,p>>m&1;if(255===(p=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((p<<8|t).toString(16)))}return m=7,p>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==r(n))throw new Error("invalid huffman sequence")}return null}function w(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function g(e){var t=w(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var k,x=0;function _(e,t,r,n,i){var a=r%u,o=(r/u|0)*e.v+n,s=a*e.h+i;t(e,e.blocks[o][s])}function A(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var P,I,U,S,T,E,B=i.length;E=c?0===o?0===f?function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=v()<<l}:0===f?function(e,t){if(b>0)b--;else for(var r=o,n=s;r<=n;){var i=y(e.huffmanTableAC),a=15&i,f=i>>4;if(0===a){if(f<15){b=w(f)+(1<<f)-1;break}r+=16}else t[D[r+=f]]=g(a)*(1<<l),r++}}:function(e,t){for(var r=o,n=s,i=0;r<=n;){var a=D[r],f=t[a]<0?-1:1;switch(x){case 0:var u=y(e.huffmanTableAC),c=15&u;if(i=u>>4,0===c)i<15?(b=w(i)+(1<<i),x=4):(i=16,x=1);else{if(1!==c)throw new Error("invalid ACn encoding");k=g(c),x=i?2:3}continue;case 1:case 2:t[a]?t[a]+=(v()<<l)*f:0==--i&&(x=2===x?3:0);break;case 3:t[a]?t[a]+=(v()<<l)*f:(t[a]=k<<l,x=0);break;case 4:t[a]&&(t[a]+=(v()<<l)*f)}r++}4===x&&0==--b&&(x=0)}:function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var a=y(e.huffmanTableAC),o=15&a,s=a>>4;if(0===o){if(s<15)break;i+=16}else t[D[i+=s]]=g(o),i++}};var O,M,C=0;M=1===B?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn;for(var L=a||M;C<M;){for(I=0;I<B;I++)i[I].pred=0;if(b=0,1===B)for(P=i[0],T=0;T<L;T++)A(P,E,C),C++;else for(T=0;T<L;T++){for(I=0;I<B;I++){var R=P=i[I],V=R.h,G=R.v;for(U=0;U<G;U++)for(S=0;S<V;S++)_(P,E,C,U,S)}if(++C===M)break}if(m=0,(O=e[d]<<8|e[d+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;d+=2}return d-h}function O(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,a=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function f(e,r,n){var i,a,o,s,f,l,u,c,h,d,p=t.quantizationTable,m=n;for(d=0;d<64;d++)m[d]=e[d]*p[d];for(d=0;d<8;++d){var v=8*d;0!==m[1+v]||0!==m[2+v]||0!==m[3+v]||0!==m[4+v]||0!==m[5+v]||0!==m[6+v]||0!==m[7+v]?(i=5793*m[0+v]+128>>8,a=5793*m[4+v]+128>>8,o=m[2+v],s=m[6+v],f=2896*(m[1+v]-m[7+v])+128>>8,c=2896*(m[1+v]+m[7+v])+128>>8,l=m[3+v]<<4,h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+128>>8,o=1567*o-3784*s+128>>8,s=h,h=f-(u=m[5+v]<<4)+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+v]=i+c,m[7+v]=i-c,m[1+v]=a+u,m[6+v]=a-u,m[2+v]=o+l,m[5+v]=o-l,m[3+v]=s+f,m[4+v]=s-f):(h=5793*m[0+v]+512>>10,m[0+v]=h,m[1+v]=h,m[2+v]=h,m[3+v]=h,m[4+v]=h,m[5+v]=h,m[6+v]=h,m[7+v]=h)}for(d=0;d<8;++d){var y=d;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(i=5793*m[0+y]+2048>>12,a=5793*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],f=2896*(m[8+y]-m[56+y])+2048>>12,c=2896*(m[8+y]+m[56+y])+2048>>12,l=m[24+y],h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+2048>>12,o=1567*o-3784*s+2048>>12,s=h,h=f-(u=m[40+y])+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+y]=i+c,m[56+y]=i-c,m[8+y]=a+u,m[48+y]=a-u,m[16+y]=o+l,m[40+y]=o-l,m[24+y]=s+f,m[32+y]=s-f):(h=5793*n[d+0]+8192>>14,m[0+y]=h,m[8+y]=h,m[16+y]=h,m[24+y]=h,m[32+y]=h,m[40+y]=h,m[48+y]=h,m[56+y]=h)}for(d=0;d<64;++d){var w=128+(m[d]+8>>4);r[d]=w<0?0:w>255?255:w}}for(var l=0;l<i;l++){for(var u=l<<3,c=0;c<8;c++)r.push(new Uint8Array(a));for(var h=0;h<n;h++){f(t.blocks[l][h],s,o);for(var d=0,p=h<<3,m=0;m<8;m++)for(var v=r[u+m],y=0;y<8;y++)v[p+y]=s[d++]}}return r}var M=function(){function e(){u(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return h(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var a=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),f=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=a*t.h,u=o*t.v,c=[],h=0;h<u;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=f,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=a,e.mcusPerColumn=o}var i,a,o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(i=void 0,a=void 0,i=r(),a=e.subarray(t,t+i-2),t+=a.length,a);65504===o&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===o&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var f=r()+t-2;t<f;){var l=e[t++],u=new Int32Array(64);if(l>>4==0)for(var c=0;c<64;c++){u[D[c]]=e[t++]}else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){u[D[h]]=r()}}this.quantizationTables[15&l]=u}break;case 65472:case 65473:case 65474:r();for(var d={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,v=0;v<p;v++){m=e[t];var y=e[t+1]>>4,w=15&e[t+1],g=e[t+2];d.componentsOrder.push(m),d.components[m]={h:y,v:w,quantizationIdx:g},t+=3}n(d),this.frames.push(d);break;case 65476:for(var b=r(),k=2;k<b;){for(var x=e[t++],_=new Uint8Array(16),A=0,P=0;P<16;P++,t++)_[P]=e[t],A+=_[P];for(var I=new Uint8Array(A),U=0;U<A;U++,t++)I[U]=e[t];k+=17+A,x>>4==0?this.huffmanTablesDC[15&x]=E(_,I):this.huffmanTablesAC[15&x]=E(_,I)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var S=e[t++],T=[],O=this.frames[0],M=0;M<S;M++){var C=O.components[e[t++]],L=e[t++];C.huffmanTableDC=this.huffmanTablesDC[L>>4],C.huffmanTableAC=this.huffmanTablesAC[15&L],T.push(C)}var R=e[t++],V=e[t++],G=e[t++],F=B(e,t,O,T,this.resetInterval,R,V,G>>4,15&G);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];r[a].quantizationTable=this.quantizationTables[r[a].quantizationIdx],delete r[a].quantizationIdx}for(var o=e[0],s=o.components,f=o.componentsOrder,l=[],u=o.samplesPerLine,c=o.scanLines,h=0;h<f.length;h++){var d=s[f[h]];l.push({lines:O(0,d),scaleX:d.h/o.maxH,scaleY:d.v/o.maxV})}for(var p=new Uint8Array(u*c*l.length),m=0,v=0;v<c;++v)for(var y=0;y<u;++y)for(var w=0;w<l.length;++w){var g=l[w];p[m]=g.lines[0|v*g.scaleY][0|y*g.scaleX],++m}return p}}]),e}(),C=function(e){p(r,b);var t=T(r);function r(e){var n;return u(this,r),(n=t.call(this)).reader=new M,e.JPEGTables&&n.reader.parse(e.JPEGTables),n}return h(r,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),r}(),L=Object.freeze({__proto__:null,default:C});function R(e){for(var t=e.length;--t>=0;)e[t]=0}R(new Array(576)),R(new Array(60)),R(new Array(512)),R(new Array(256)),R(new Array(29)),R(new Array(30));var V=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0},G=new Uint32Array(function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}()),F=function(e,t,r,n){var i=G,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},N=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Z=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==r(n))throw new TypeError(n+"must be non-object");for(var i in n)N(n,i)&&(e[i]=n[i])}}return e},K=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r].length;for(var i=new Uint8Array(t),a=0,o=0,s=e.length;a<s;a++){var f=e[a];i.set(f,o),o+=f.length}return i},H=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){H=!1}for(var Y=new Uint8Array(256),X=0;X<256;X++)Y[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;Y[254]=Y[254]=1;var W=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},q=function(e,t){var r,n,i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var a=new Array(2*i);for(n=0,r=0;r<i;){var o=e[r++];if(o<128)a[n++]=o;else{var s=Y[o];if(s>4)a[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r<i;)o=o<<6|63&e[r++],s--;s>1?a[n++]=65533:o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}(a,n)},J=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Y[e[r]]>t?r:t};var Q=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,P=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=I.dmax,f=I.wsize,l=I.whave,u=I.wnext,c=I.window,h=I.hold,d=I.bits,p=I.lencode,m=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=p[h&v];t:for(;;){if(h>>>=g=w>>>24,d-=g,0===(g=w>>>16&255))P[i++]=65535&w;else{if(!(16&g)){if(0==(64&g)){w=p[(65535&w)+(h&(1<<g)-1)];continue t}if(32&g){I.mode=12;break e}e.msg="invalid literal/length code",I.mode=30;break e}b=65535&w,(g&=15)&&(d<g&&(h+=A[r++]<<d,d+=8),b+=h&(1<<g)-1,h>>>=g,d-=g),d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=m[h&y];r:for(;;){if(h>>>=g=w>>>24,d-=g,!(16&(g=w>>>16&255))){if(0==(64&g)){w=m[(65535&w)+(h&(1<<g)-1)];continue r}e.msg="invalid distance code",I.mode=30;break e}if(k=65535&w,d<(g&=15)&&(h+=A[r++]<<d,(d+=8)<g&&(h+=A[r++]<<d,d+=8)),(k+=h&(1<<g)-1)>s){e.msg="invalid distance too far back",I.mode=30;break e}if(h>>>=g,d-=g,k>(g=i-a)){if((g=k-g)>l&&I.sane){e.msg="invalid distance too far back",I.mode=30;break e}if(x=0,_=c,0===u){if(x+=f-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}else if(u<g){if(x+=f+u-g,(g-=u)<b){b-=g;do{P[i++]=c[x++]}while(--g);if(x=0,u<b){b-=g=u;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}}else if(x+=u-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}for(;b>2;)P[i++]=_[x++],P[i++]=_[x++],P[i++]=_[x++],b-=3;b&&(P[i++]=_[x++],b>1&&(P[i++]=_[x++]))}else{x=i-k;do{P[i++]=P[x++],P[i++]=P[x++],P[i++]=P[x++],b-=3}while(b>2);b&&(P[i++]=P[x++],b>1&&(P[i++]=P[x++]))}break}}break}}while(r<n&&i<o);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),I.hold=h,I.bits=d},ee=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),te=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),re=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ne=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ie=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d,p,m,v,y=s.bits,w=0,g=0,b=0,k=0,x=0,_=0,A=0,P=0,I=0,U=0,S=null,T=0,D=new Uint16Array(16),E=new Uint16Array(16),B=null,O=0;for(w=0;w<=15;w++)D[w]=0;for(g=0;g<n;g++)D[t[r+g]]++;for(x=y,k=15;k>=1&&0===D[k];k--);if(x>k&&(x=k),0===k)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<k&&0===D[b];b++);for(x<b&&(x=b),P=1,w=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(E[1]=0,w=1;w<15;w++)E[w+1]=E[w]+D[w];for(g=0;g<n;g++)0!==t[r+g]&&(o[E[t[r+g]]++]=g);if(0===e?(S=B=o,d=19):1===e?(S=ee,T-=257,B=te,O-=257,d=256):(S=re,B=ne,d=-1),U=0,g=0,w=b,h=a,_=x,A=0,u=-1,c=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=w-A,o[g]<d?(m=0,v=o[g]):o[g]>d?(m=B[O+o[g]],v=S[T+o[g]]):(m=96,v=0),f=1<<w-A,b=l=1<<_;do{i[h+(U>>A)+(l-=f)]=p<<24|m<<16|v|0}while(0!==l);for(f=1<<w-1;U&f;)f>>=1;if(0!==f?(U&=f-1,U+=f):U=0,g++,0==--D[w]){if(w===k)break;w=t[r+o[g]]}if(w>x&&(U&c)!==u){for(0===A&&(A=x),h+=b,P=1<<(_=w-A);_+A<k&&!((P-=D[_+A])<=0);)_++,P<<=1;if(I+=1<<_,1===e&&I>852||2===e&&I>592)return 1;i[u=U&c]=x<<24|_<<16|h-a|0}}return 0!==U&&(i[h+U]=w-A<<24|64<<16|0),s.bits=x,0},ae=j.Z_FINISH,oe=j.Z_BLOCK,se=j.Z_TREES,fe=j.Z_OK,le=j.Z_STREAM_END,ue=j.Z_NEED_DICT,ce=j.Z_STREAM_ERROR,he=j.Z_DATA_ERROR,de=j.Z_MEM_ERROR,pe=j.Z_BUF_ERROR,me=j.Z_DEFLATED,ve=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function ye(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var we,ge,be=function(e){if(!e||!e.state)return ce;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,fe},ke=function(e){if(!e||!e.state)return ce;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,be(e)},xe=function(e,t){var r;if(!e||!e.state)return ce;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ce:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ke(e))},_e=function(e,t){if(!e)return ce;var r=new ye;e.state=r,r.window=null;var n=xe(e,t);return n!==fe&&(e.state=null),n},Ae=!0,Pe=function(e){if(Ae){we=new Int32Array(512),ge=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ie(1,e.lens,0,288,we,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ie(2,e.lens,0,32,ge,0,e.work,{bits:5}),Ae=!1}e.lencode=we,e.lenbits=9,e.distcode=ge,e.distbits=5},Ie=function(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Ue={inflateReset:ke,inflateReset2:xe,inflateResetKeep:be,inflateInit:function(e){return _e(e,15)},inflateInit2:_e,inflate:function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=0,U=new Uint8Array(4),S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ce;12===(r=e.state).mode&&(r.mode=13),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,c=s,h=f,_=fe;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&r.wrap&&35615===l){r.check=0,U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0),l=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&l)!==me){e.msg="unknown compression method",r.mode=30;break}if(u-=4,x=8+(15&(l>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&l?10:12,l=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.flags=l,(255&r.flags)!==me){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.time=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,U[2]=l>>>16&255,U[3]=l>>>24&255,r.check=F(r.check,U,4,0)),l=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),x)),512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=r.check=ve(l),l=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,ue;e.adler=r.check=1,r.mode=12;case 12:if(t===oe||t===se)break e;case 13:if(r.last){l>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(r.last=1&l,u-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(Pe(r),r.mode=20,t===se){l>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,u=0,r.mode=15,t===se)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>f&&(d=f),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,f-=d,o+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.nlen=257+(31&l),l>>>=5,u-=5,r.ndist=1+(31&l),l>>>=5,u-=5,r.ncode=4+(15&l),l>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.lens[S[r.have++]]=7&l,l>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=ie(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(w<16)l>>>=v,u-=v,r.lens[r.have++]=w;else{if(16===w){for(P=v+2;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=v,u-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}x=r.lens[r.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===w){for(P=v+3;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=3+(7&(l>>>=v)),l>>>=3,u-=3}else{for(P=v+7;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=11+(127&(l>>>=v)),l>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=x}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,A={bits:r.lenbits},_=ie(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=ie(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===se)break e;case 20:r.mode=21;case 21:if(s>=6&&f>=258){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,$(e,h),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(y&&0==(240&y)){for(g=v,b=y,k=w;y=(I=r.lencode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,r.length=w,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(I=r.distcode[l&(1<<r.distbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&y)){for(g=v,b=y,k=w;y=(I=r.distcode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,64&y){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(d=h-f,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===f)break e;i[o++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?F(r.check,i,h,o-h):V(r.check,i,h,o-h)),h=f,(r.flags?l:ve(l))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=0,u=0}r.mode=29;case 29:_=le;break e;case 30:_=he;break e;case 31:return de;default:return ce}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==ae))&&Ie(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?F(r.check,i,h,e.next_out-h):V(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===h||t===ae)&&_===fe&&(_=pe),_},inflateEnd:function(e){if(!e||!e.state)return ce;var t=e.state;return t.window&&(t.window=null),e.state=null,fe},inflateGetHeader:function(e,t){if(!e||!e.state)return ce;var r=e.state;return 0==(2&r.wrap)?ce:(r.head=t,t.done=!1,fe)},inflateSetDictionary:function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ce:11===r.mode&&V(1,t,n,0)!==r.check?he:Ie(e,t,n,n)?(r.mode=31,de):(r.havedict=1,fe):ce},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Te=Object.prototype.toString,De=j.Z_NO_FLUSH,Ee=j.Z_FINISH,Be=j.Z_OK,Oe=j.Z_STREAM_END,Me=j.Z_NEED_DICT,Ce=j.Z_STREAM_ERROR,Le=j.Z_DATA_ERROR,Re=j.Z_MEM_ERROR;function Ve(e){this.options=Z({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Q,this.strm.avail_out=0;var r=Ue.inflateInit2(this.strm,t.windowBits);if(r!==Be)throw new Error(z[r]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=W(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ue.inflateSetDictionary(this.strm,t.dictionary))!==Be))throw new Error(z[r])}function Ge(e,t){var r=new Ve(t);if(r.push(e),r.err)throw r.msg||z[r.err];return r.result}Ve.prototype.push=function(e,t){var r,n,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ee:De,"[object ArrayBuffer]"===Te.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(r=Ue.inflate(a,n))===Me&&s&&((r=Ue.inflateSetDictionary(a,s))===Be?r=Ue.inflate(a,n):r===Le&&(r=Me));a.avail_in>0&&r===Oe&&a.state.wrap>0&&0!==e[a.next_in];)Ue.inflateReset(a),r=Ue.inflate(a,n);switch(r){case Ce:case Le:case Me:case Re:return this.onEnd(r),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||r===Oe))if("string"===this.options.to){var f=J(a.output,a.next_out),l=a.next_out-f,u=q(a.output,f);a.next_out=l,a.avail_out=o-l,l&&a.output.set(a.output.subarray(f,f+l),0),this.onData(u)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Be||0!==i){if(r===Oe)return r=Ue.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Be&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=K(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Fe={Inflate:Ve,inflate:Ge,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ge(e,t)},ungzip:Ge,constants:j}.inflate;function ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var je=function(e){p(r,b);var t=ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return Fe(new Uint8Array(e)).buffer}}]),r}(),Ne=Object.freeze({__proto__:null,default:je});function Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var Ke,He=function(e){p(r,b);var t=Ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var a=t.getUint8(n+1);i=-i;for(var o=0;o<=i;++o)r.push(a);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),r}(),Ye=Object.freeze({__proto__:null,default:He}),Xe={exports:{}};Ke=Xe,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */\nfunction(){var e,t,r,n,i,a,o,s,f,l,u,c,h,d,p,m,v=(e={defaultNoDataValue:-34027999387901484e22,decode:function(a,o){var s=(o=o||{}).encodedMaskData||null===o.encodedMaskData,f=i(a,o.inputOffset||0,s),l=null!==o.noDataValue?o.noDataValue:e.defaultNoDataValue,u=t(f,o.pixelType||Float32Array,o.encodedMaskData,l,o.returnMask),c={width:f.width,height:f.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:f.pixels.maxValue,noDataValue:l};return u.resultMask&&(c.maskData=u.resultMask),o.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),o.returnFileInfo&&(c.fileInfo=r(f),o.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(f))),c}},t=function(e,t,r,n,i){var o,s,f,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,h=Math.floor(e.width/u),d=Math.floor(e.height/c),p=2*e.maxZError,m=Number.MAX_VALUE;r=r||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),i&&r&&(f=new Uint8Array(e.width*e.height));for(var v,y,w=new Float32Array(h*d),g=0;g<=c;g++){var b=g!==c?d:e.height%c;if(0!==b)for(var k=0;k<=u;k++){var x=k!==u?h:e.width%u;if(0!==x){var _,A,P,I,U=g*e.width*d+k*h,S=e.width-x,T=e.pixels.blocks[l];if(T.encoding<2?(0===T.encoding?_=T.rawData:(a(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,w,e.pixels.maxValue),_=w),A=0):P=2===T.encoding?0:T.offset,r)for(y=0;y<b;y++){for(7&U&&(I=r[U>>3],I<<=7&U),v=0;v<x;v++)7&U||(I=r[U>>3]),128&I?(f&&(f[U]=1),m=m>(o=T.encoding<2?_[A++]:P)?o:m,s[U++]=o):(f&&(f[U]=0),s[U++]=n),I<<=1;U+=S}else if(T.encoding<2)for(y=0;y<b;y++){for(v=0;v<x;v++)m=m>(o=_[A++])?o:m,s[U++]=o;U+=S}else for(m=m>P?P:m,y=0;y<b;y++){for(v=0;v<x;v++)s[U++]=P;U+=S}if(1===T.encoding&&A!==T.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:f,minValue:m}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},n=0;n<t;n++){var i=e.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},i=function(e,t,r){var n={},i=new Uint8Array(e,t,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(n.fileVersion=a.getInt32(0,!0),n.imageType=a.getInt32(4,!0),n.height=a.getUint32(8,!0),n.width=a.getUint32(12,!0),n.maxZError=a.getFloat64(16,!0),t+=24,!r)if(a=new DataView(e,t,16),n.mask={},n.mask.numBlocksY=a.getUint32(0,!0),n.mask.numBlocksX=a.getUint32(4,!0),n.mask.numBytes=a.getUint32(8,!0),n.mask.maxValue=a.getFloat32(12,!0),t+=16,n.mask.numBytes>0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(a=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),f=2,l=0;do{if(s>0)for(;s--;)o[l++]=a.getUint8(f++);else{var u=a.getUint8(f++);for(s=-s;s--;)o[l++]=u}s=a.getInt16(f,!0),f+=2}while(f<n.mask.numBytes);if(-32768!==s||l<o.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=o,t+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));a=new DataView(e,t,16),n.pixels={},n.pixels.numBlocksY=a.getUint32(0,!0),n.pixels.numBlocksX=a.getUint32(4,!0),n.pixels.numBytes=a.getUint32(8,!0),n.pixels.maxValue=a.getFloat32(12,!0),t+=16;var c=n.pixels.numBlocksX,h=n.pixels.numBlocksY,d=c+(n.width%c>0?1:0),p=h+(n.height%h>0?1:0);n.pixels.blocks=new Array(d*p);for(var m=0,v=0;v<p;v++)for(var y=0;y<d;y++){var w=0,g=e.byteLength-t;a=new DataView(e,t,Math.min(10,g));var b={};n.pixels.blocks[m++]=b;var k=a.getUint8(0);if(w++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=a.getInt8(1),w++;else if(1===k)b.offset=a.getInt16(1,!0),w+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=a.getFloat32(1,!0),w+=4}if(1===b.encoding)if(k=a.getUint8(w),w++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=a.getUint8(w),w++;else if(1===k)b.numValidPixels=a.getUint16(w,!0),w+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=a.getUint32(w,!0),w+=4}}var x;if(t+=w,3!==b.encoding)if(0===b.encoding){var _=(n.pixels.numBytes-1)/4;if(_!==Math.floor(_))throw"uncompressed block has invalid length";x=new ArrayBuffer(4*_),new Uint8Array(x).set(new Uint8Array(e,t,4*_));var A=new Float32Array(x);b.rawData=A,t+=4*_}else if(1===b.encoding){var P=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),I=Math.ceil(P/4);x=new ArrayBuffer(4*I),new Uint8Array(x).set(new Uint8Array(e,t,P)),b.stuffedData=new Uint32Array(x),t+=P}}else t++}return n.eofOffset=t,n},a=function(e,t,r,n,i,a,o){var s,f,l,u=(1<<t)-1,c=0,h=0,d=Math.ceil((o-n)/i),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===h&&(l=e[c++],h=32),h>=t)f=l>>>h-t&u,h-=t;else{var m=t-h;f=(l&u)<<m&u,f+=(l=e[c++])>>>(h=32-m)}a[s]=f<d?n+f*i:o}return a},e),y=(o=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d=(1<<r)-1,p=0,m=0,v=4*e.length-Math.ceil(r*n/8);if(e[e.length-1]<<=8*v,i)for(f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=i[l];else for(h=Math.ceil((s-a)/o),f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=l<h?a+l*o:s},s=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32),c>=t?(h=o>>>c-t&s,c-=t):(h=(o&s)<<(u=t-c)&s,h+=(o=e[f++])>>>(c=32-u)),d[l]=h<m?n+h*i:a;return d.unshift(n),d},f=function(e,t,r,n,i,a,o,s){var f,l,u,c,h=(1<<r)-1,d=0,p=0,m=0;if(i)for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=i[l];else{var v=Math.ceil((s-a)/o);for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=l<v?a+l*o:s}return t},l=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=0,p=[],m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32,d=0),c>=t?(h=o>>>d&s,c-=t,d+=t):(h=o>>>d&s,c=32-(u=t-c),h|=((o=e[f++])&(1<<u)-1)<<t-u,d=u),p[l]=h<m?n+h*i:a;return p.unshift(n),p},u=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=4*e.length-Math.ceil(r*n/8);for(e[e.length-1]<<=8*c,i=0;i<n;i++)0===u&&(o=e[l++],u=32),u>=r?(a=o>>>u-r&f,u-=r):(a=(o&f)<<(s=r-u)&f,a+=(o=e[l++])>>>(u=32-s)),t[i]=a;return t},c=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=0;for(i=0;i<n;i++)0===u&&(o=e[l++],u=32,c=0),u>=r?(a=o>>>c&f,u-=r,c+=r):(a=o>>>c&f,u=32-(s=r-u),a|=((o=e[l++])&(1<<s)-1)<<r-s,c=s),t[i]=a;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,n=e.length,i=Math.floor(n/2),a=0;i;){var o=i>=359?359:i;i-=o;do{t+=e[a++]<<8,r+=t+=e[a++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[a]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var a,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(i.fileVersion=s,r+=4,s>=3&&(i.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),i.height=o.getUint32(0,!0),i.width=o.getUint32(4,!0),r+=8,s>=4?(i.numDims=o.getUint32(8,!0),r+=4):i.numDims=1,o=new DataView(e,r,40),i.numValidPixel=o.getUint32(0,!0),i.microBlockSize=o.getInt32(4,!0),i.blobSize=o.getInt32(8,!0),i.imageType=o.getInt32(12,!0),i.maxZError=o.getFloat64(16,!0),i.zMin=o.getFloat64(24,!0),i.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=i,t.ptr=r,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-a,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),a=this.readSubArray(e,t.ptr,n,i),o=this.readSubArray(e,t.ptr+i,n,i);t.ptr+=2*i;var s,f=!0;for(s=0;s<r.numDims;s++)if(a[s]!==o[s]){f=!1;break}return r.minValues=a,r.maxValues=o,f},readSubArray:function(e,t,r,n){var i;if(r===Uint8Array)i=new Uint8Array(e,t,n);else{var a=new ArrayBuffer(n);new Uint8Array(a).set(new Uint8Array(e,t,n)),i=new r(a)}return i},readMask:function(e,t){var r,n,i=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,f=new DataView(e,i,4),l={};if(l.numBytes=f.getUint32(0,!0),i+=4,(0===s||o===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(o/8)),l.bitset=r,n=new Uint8Array(o),t.pixels.resultMask=n,i+=l.numBytes;else if(l.numBytes>0){r=new Uint8Array(Math.ceil(o/8));var u=(f=new DataView(e,i,l.numBytes)).getInt16(0,!0),c=2,h=0,d=0;do{if(u>0)for(;u--;)r[h++]=f.getUint8(c++);else for(d=f.getUint8(c++),u=-u;u--;)r[h++]=d;u=f.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==u||h<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(o);var p=0,m=0;for(m=0;m<o;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,l.bitset=r,i+=l.numBytes}return t.ptr=i,t.mask=l,!0},readDataOneSweep:function(e,t,r,n){var i,a=t.ptr,o=t.headerInfo,s=o.numDims,f=o.width*o.height,l=o.imageType,u=o.numValidPixel*h.getDataTypeSize(l)*s,c=t.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(e,a,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,a,u)),i=new r(d)}if(i.length===f*s)t.pixels.resultPixels=n?h.swapDimensionOrder(i,f,s,r,!0):i;else{t.pixels.resultPixels=new r(f*s);var p=0,m=0,v=0,y=0;if(s>1){if(n){for(m=0;m<f;m++)if(c[m])for(y=m,v=0;v<s;v++,y+=f)t.pixels.resultPixels[y]=i[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*s,v=0;v<s;v++)t.pixels.resultPixels[y+v]=i[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=i[p++])}return a+=u,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(e,t.ptr,16);if(t.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),a=n.getInt32(8,!0),o=n.getInt32(12,!0);if(a>=o)return!1;var s=new Uint32Array(o-a);h.decodeBits(e,t,s);var f,l,u,c,p=[];for(f=a;f<o;f++)p[l=f-(f<i?0:i)]={first:s[f-a],second:null};var m=e.byteLength-t.ptr,v=Math.ceil(m/4),y=new ArrayBuffer(4*v);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,g=new Uint32Array(y),b=0,k=0;for(w=g[0],f=a;f<o;f++)(c=p[l=f-(f<i?0:i)].first)>0&&(p[l].second=w<<b>>>32-c,32-b>=c?32===(b+=c)&&(b=0,w=g[++k]):(b+=c-32,w=g[++k],p[l].second|=w>>>32-b));var x=0,_=0,A=new d;for(f=0;f<p.length;f++)void 0!==p[f]&&(x=Math.max(x,p[f].first));_=x>=r?r:x;var P,I,U,S,T,D=[];for(f=a;f<o;f++)if((c=p[l=f-(f<i?0:i)].first)>0)if(P=[c,l],c<=_)for(I=p[l].second<<_-c,U=1<<_-c,u=0;u<U;u++)D[I|u]=P;else for(I=p[l].second,T=A,S=c-1;S>=0;S--)I>>>S&1?(T.right||(T.right=new d),T=T.right):(T.left||(T.left=new d),T=T.left),0!==S||T.val||(T.val=P[1]);return{decodeLut:D,numBitsLUTQick:_,numBitsLUT:x,tree:A,stuffedData:g,srcPtr:k,bitPos:b}},readHuffman:function(e,t,r,n){var i,a,o,s,f,l,u,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,v=t.headerInfo.width,y=v*m,w=this.readHuffmanTree(e,t),g=w.decodeLut,b=w.tree,k=w.stuffedData,x=w.srcPtr,_=w.bitPos,A=w.numBitsLUTQick,P=w.numBitsLUT,I=0===t.headerInfo.imageType?128:0,U=t.pixels.resultMask,S=0;_>0&&(x++,_=0);var T,D=k[x],E=1===t.encodeMode,B=new r(y*p),O=B;if(p<2||E){for(T=0;T<p;T++)if(p>1&&(O=new r(B.buffer,y*T,y),S=0),t.headerInfo.numValidPixel===v*m)for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(o+=u>0?S:l>0?O[c-v]:S,o&=255,O[c]=o,S=o):O[c]=o}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++)if(U[c]){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(u>0&&U[c-1]?o+=S:l>0&&U[c-v]?o+=O[c-v]:o+=S,o&=255,O[c]=o,S=o):O[c]=o}}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++)if(c=l*v+u,!U||U[c])for(T=0;T<p;T++,c+=y){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,O[c]=o}t.ptr=t.ptr+4*(x+1)+(_>0?4:0),t.pixels.resultPixels=B,p>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,i){var a=t.headerInfo,h=a.fileVersion,d=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),v=m.getUint8(0);d++;var y=v>>6,w=0===y?4:3-y,g=(32&v)>0,b=31&v,k=0;if(1===w)k=m.getUint8(d),d++;else if(2===w)k=m.getUint16(d,!0),d+=2;else{if(4!==w)throw"Invalid valid pixel count type";k=m.getUint32(d,!0),d+=4}var x,_,A,P,I,U,S,T,D,E=2*a.maxZError,B=a.numDims>1?a.maxValues[i]:a.zMax;if(g){for(t.counter.lut++,T=m.getUint8(d),d++,P=Math.ceil((T-1)*b/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),A=new Uint8Array(_),t.ptr+=d,A.set(new Uint8Array(e,t.ptr,P)),S=new Uint32Array(_),t.ptr+=P,D=0;T-1>>>D;)D++;P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,U=h>=3?l(S,b,T-1,n,E,B):s(S,b,T-1,n,E,B),h>=3?f(x,r,D,k,U):o(x,r,D,k,U)}else t.counter.bitstuffer++,D=b,t.ptr+=d,D>0&&(P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,h>=3?null==n?c(x,r,D,k):f(x,r,D,k,!1,n,E,B):null==n?u(x,r,D,k):o(x,r,D,k,!1,n,E,B))},readTiles:function(e,t,r,n){var i=t.headerInfo,a=i.width,o=i.height,s=a*o,f=i.microBlockSize,l=i.imageType,u=h.getDataTypeSize(l),c=Math.ceil(a/f),d=Math.ceil(o/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,v,y,w,g,b,k,x,_,A=0,P=0,I=0,U=0,S=0,T=0,D=0,E=0,B=0,O=0,M=0,C=0,L=0,R=0,V=0,G=new r(f*f),F=o%f||f,z=a%f||f,j=i.numDims,N=t.pixels.resultMask,Z=t.pixels.resultPixels,K=i.fileVersion>=5?14:15,H=i.zMax;for(I=0;I<d;I++)for(S=I!==d-1?f:F,U=0;U<c;U++)for(O=I*a*f+U*f,M=a-(T=U!==c-1?f:z),k=0;k<j;k++){if(j>1?(_=Z,O=I*a*f+U*f,Z=new r(t.pixels.resultPixels.buffer,s*k*u,s),H=i.maxValues[k]):_=null,D=e.byteLength-t.ptr,m={},V=0,E=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),V++,x=i.fileVersion>=5?4&E:0,B=E>>6&255,(E>>2&K)!=(U*f>>3&K))throw"integrity issue";if(x&&0===k)throw"integrity issue";if((w=3&E)>3)throw t.ptr+=V,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(x)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=V,C=(C=S*T*u)<(L=e.byteLength-t.ptr)?C:L,v=new ArrayBuffer(C%u==0?C:C+u-C%u),new Uint8Array(v).set(new Uint8Array(e,t.ptr,C)),y=new r(v),R=0,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=y[R++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=y[R++];O+=M}t.ptr+=R*u}else if(g=h.getDataTypeUsed(x&&l<6?4:l,B),b=h.getOnePixel(m,V,g,p),V+=h.getDataTypeSize(g),3===w)if(t.ptr+=V,t.counter.constantoffset++,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=x?Math.min(H,_[O]+b):b),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=x?Math.min(H,_[O]+b):b,O++;O+=M}else if(t.ptr+=V,h.decodeBits(e,t,G,b,k),V=0,x)if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]+_[O]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=G[V++]+_[O],O++;O+=M}else if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=G[V++];O+=M}else{if(x)if(N)for(A=0;A<S;A++)for(P=0;P<T;P++)N[O]&&(Z[O]=_[O]),O++;else for(A=0;A<S;A++)for(P=0;P<T;P++)Z[O]=_[O],O++;t.counter.constant++,t.ptr+=V}}j>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(t.pixels.resultPixels,s,j,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,i=e.headerInfo.maxValues,a=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,f=0,l=0,u=e.pixels.resultMask,c=e.pixels.resultPixels;if(u)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)u[f]&&(c[l+f]=r);else for(f=0;f<o;f++)if(u[f])for(l=f*a,s=0;s<a;s++)c[l+a]=i[s]}else for(f=0;f<o;f++)u[f]&&(c[f]=r);else if(a>1&&n!==r)if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)c[l+f]=r;else for(f=0;f<o;f++)for(l=f*a,s=0;s<a;s++)c[l+s]=i[s];else for(f=0;f<o*a;f++)c[f]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var i=0;switch(r){case 0:i=n.getInt8(t);break;case 1:i=n.getUint8(t);break;case 2:i=n.getInt16(t,!0);break;case 3:i=n.getUint16(t,!0);break;case 4:i=n.getInt32(t,!0);break;case 5:i=n.getUInt32(t,!0);break;case 6:i=n.getFloat32(t,!0);break;case 7:i=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(e,t,r,n,i){var a=0,o=0,s=0,f=0,l=e;if(r>1)if(l=new n(t*r),i)for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[f]=e[o++];else for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[o++]=e[f];return l}},d=function(e,t,r){this.val=e,this.left=t,this.right=r},{decode:function(e,t){var r=(t=t||{}).noDataValue,n=0,i={};i.ptr=t.inputOffset||0,i.pixels={},h.readHeaderInfo(e,i);var a=i.headerInfo,o=a.fileVersion,s=h.getDataTypeArray(a.imageType);if(o>5)throw"unsupported lerc version 2."+o;h.readMask(e,i),a.numValidPixel===a.width*a.height||i.pixels.resultMask||(i.pixels.resultMask=t.maskData);var f=a.width*a.height;i.pixels.resultPixels=new s(f*a.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,u=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)h.constructConstantSurface(i,u);else if(o>=4&&h.checkMinMaxRanges(e,i))h.constructConstantSurface(i,u);else{var c=new DataView(e,i.ptr,2),d=c.getUint8(0);if(i.ptr++,d)h.readDataOneSweep(e,i,s,u);else if(o>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?h.readHuffman(e,i,s,u):h.readTiles(e,i,s,u)}else h.readTiles(e,i,s,u)}i.eofOffset=i.ptr,t.inputOffset?(l=i.headerInfo.blobSize+t.inputOffset-i.ptr,Math.abs(l)>=1&&(i.eofOffset=t.inputOffset+i.headerInfo.blobSize)):(l=i.headerInfo.blobSize-i.ptr,Math.abs(l)>=1&&(i.eofOffset=i.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:i.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&h.isValidPixelValue(a.imageType,r)){var v=i.pixels.resultMask;for(n=0;n<f;n++)v[n]||(m.pixelData[n]=r);m.noDataValue=r}return i.noDataValue=r,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(i)),m},getBandCount:function(e){for(var t=0,r=0,n={ptr:0,pixels:{}};r<e.byteLength-58;)h.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,t++,n.ptr=r;return t}}),w=(p=new ArrayBuffer(4),m=new Uint8Array(p),new Uint32Array(p)[0]=1,1===m[0]),g={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var r,n,i=(t=t||{}).inputOffset||0,a=new Uint8Array(e,i,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())r=v,n=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;r=y,n=2}for(var s,f,l,u,c,h,d=0,p=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},b=0;i<p;){var k=r.decode(e,{inputOffset:i,encodedMaskData:s,maskData:l,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});i=k.fileInfo.eofOffset,l=k.maskData,0===d&&(s=k.encodedMaskData,g.width=k.width,g.height=k.height,g.dimCount=k.dimCount||1,g.pixelType=k.pixelType||k.fileInfo.pixelType,g.mask=l),n>1&&(l&&m.push(l),k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&b++),d++,g.pixels.push(k.pixelData),g.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}if(n>1&&b>1){for(h=g.width*g.height,g.bandMasks=m,(l=new Uint8Array(h)).set(m[0]),u=1;u<m.length;u++)for(f=m[u],c=0;c<h;c++)l[c]=l[c]&f[c];g.maskData=l}return g}};Ke.exports?Ke.exports=g:this.Lerc=g}();var We=Xe.exports,qe={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Je={};for(var Qe in qe)qe.hasOwnProperty(Qe)&&(Je[qe[Qe]]=parseInt(Qe,10));Je.BitsPerSample,Je.ExtraSamples,Je.SampleFormat,Je.StripByteCounts,Je.StripOffsets,Je.StripRowCounts,Je.TileByteCounts,Je.TileOffsets,Je.SubIFDs;var $e={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},et={};for(var tt in $e)$e.hasOwnProperty(tt)&&(et[$e[tt]]=parseInt(tt,10));var rt=1,nt=0,it=1,at={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},ot={};for(var st in at)at.hasOwnProperty(st)&&(ot[at[st]]=parseInt(st,10));function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var lt=function(e){p(r,b);var t=ft(r);function r(e){var n;return u(this,r),(n=t.call(this)).planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,n.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,n.addCompression=e.LercParameters[rt],n}return h(r,[{key:"decodeBlock",value:function(e){switch(this.addCompression){case nt:break;case it:e=Fe(new Uint8Array(e)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return We.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),r}(),ut=Object.freeze({__proto__:null,default:lt});function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var ht=function(e){p(a,b);var r,n=ct(a);function a(){var e;if(u(this,a),e=n.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return e}return h(a,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Blob([r]),e.next=3,createImageBitmap(n);case 3:return a=e.sent,"undefined"!=typeof document?((o=document.createElement("canvas")).width=a.width,o.height=a.height):o=new OffscreenCanvas(a.width,a.height),(s=o.getContext("2d")).drawImage(a,0,0),e.abrupt("return",s.getImageData(0,0,a.width,a.height).data.buffer);case 8:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]),a}(),dt=Object.freeze({__proto__:null,default:ht});';return new Bgt("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}},Symbol.toStringTag,{value:"Module"}));
|