Agriculture-front-end/dist/assets/Modify.35edce3c.js

10 lines
182 KiB
JavaScript

import{Q as Li}from"./index.9f28707e.js";import{R as as}from"./index.030fe210.js";const or={1:"The view center is not defined",2:"The view resolution is not defined",3:"The view rotation is not defined",4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:"Invalid corner",14:"Invalid color",15:"Tried to get a value for a key that does not exist in the cache",16:"Tried to set a value for a key that is used already",17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:"Features must have an id set",27:"Features must have an id set",28:'`renderMode` must be `"hybrid"` or `"vector"`',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:"Transformation matrix cannot be inverted",33:"Invalid units",34:"Invalid geometry layout",36:"Unknown SRS type",37:"Unknown geometry type found",38:"`styleMapValue` has an unknown type",39:"Unknown geometry type",40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:"Question unknown, the answer is 42",43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:"The {-y} placeholder requires a tile grid with extent",56:"mapBrowserEvent must originate from a pointer event",57:"At least 2 conditions are required",59:"Invalid command found in the PBF",60:"Missing or invalid `size`",61:"Cannot determine IIIF Image API version from provided image information JSON",62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:"Layer opacity must be a number",66:"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:"A VectorTile source can only be rendered if it has a projection compatible with the view projection",69:"`width` or `height` cannot be provided together with `scale`"};class ar extends Error{constructor(t){const e=or[t];super(e),this.code=t,this.name="AssertionError",this.message=e}}const ls=ar;function B(n,t){if(!n)throw new ls(t)}const Y={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function _t(n){const t=Xt();for(let e=0,i=n.length;e<i;++e)ds(t,n[e]);return t}function ei(n,t,e){return e?(e[0]=n[0]-t,e[1]=n[1]-t,e[2]=n[2]+t,e[3]=n[3]+t,e):[n[0]-t,n[1]-t,n[2]+t,n[3]+t]}function lr(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n.slice()}function Fi(n,t,e){let i,s;return t<n[0]?i=n[0]-t:n[2]<t?i=t-n[2]:i=0,e<n[1]?s=n[1]-e:n[3]<e?s=e-n[3]:s=0,i*i+s*s}function hr(n,t){return hs(n,t[0],t[1])}function Ht(n,t){return n[0]<=t[0]&&t[2]<=n[2]&&n[1]<=t[1]&&t[3]<=n[3]}function hs(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function Si(n,t){const e=n[0],i=n[1],s=n[2],r=n[3],o=t[0],a=t[1];let l=Y.UNKNOWN;return o<e?l=l|Y.LEFT:o>s&&(l=l|Y.RIGHT),a<i?l=l|Y.BELOW:a>r&&(l=l|Y.ABOVE),l===Y.UNKNOWN&&(l=Y.INTERSECTING),l}function Xt(){return[1/0,1/0,-1/0,-1/0]}function ee(n,t,e,i,s){return s?(s[0]=n,s[1]=t,s[2]=e,s[3]=i,s):[n,t,e,i]}function cs(n){return ee(1/0,1/0,-1/0,-1/0,n)}function ze(n,t){const e=n[0],i=n[1];return ee(e,i,e,i,t)}function cr(n,t,e,i,s){const r=cs(s);return gs(r,n,t,e,i)}function us(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function ds(n,t){t[0]<n[0]&&(n[0]=t[0]),t[0]>n[2]&&(n[2]=t[0]),t[1]<n[1]&&(n[1]=t[1]),t[1]>n[3]&&(n[3]=t[1])}function gs(n,t,e,i,s){for(;e<i;e+=s)ur(n,t[e],t[e+1]);return n}function ur(n,t,e){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],e),n[2]=Math.max(n[2],t),n[3]=Math.max(n[3],e)}function dr(n,t){let e;return e=t(fs(n)),e||(e=t(_s(n)),e)||(e=t(ys(n)),e)||(e=t(ms(n)),e)?e:!1}function fs(n){return[n[0],n[1]]}function _s(n){return[n[2],n[1]]}function ge(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function gr(n,t,e,i,s){const[r,o,a,l,h,c,u,d]=fr(n,t,e,i);return ee(Math.min(r,a,h,u),Math.min(o,l,c,d),Math.max(r,a,h,u),Math.max(o,l,c,d),s)}function fr(n,t,e,i){const s=t*i[0]/2,r=t*i[1]/2,o=Math.cos(e),a=Math.sin(e),l=s*o,h=s*a,c=r*o,u=r*a,d=n[0],g=n[1];return[d-l+u,g-h-c,d-l-u,g-h+c,d+l-u,g+h+c,d+l+u,g+h-c,d-l+u,g-h-c]}function fe(n){return n[3]-n[1]}function ms(n){return[n[0],n[3]]}function ys(n){return[n[2],n[3]]}function st(n){return n[2]-n[0]}function at(n,t){return n[0]<=t[2]&&n[2]>=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function ps(n){return n[2]<n[0]||n[3]<n[1]}function _r(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n}function mr(n,t,e){let i=!1;const s=Si(n,t),r=Si(n,e);if(s===Y.INTERSECTING||r===Y.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],h=n[3],c=t[0],u=t[1],d=e[0],g=e[1],f=(g-u)/(d-c);let _,m;!!(r&Y.ABOVE)&&!(s&Y.ABOVE)&&(_=d-(g-h)/f,i=_>=o&&_<=l),!i&&!!(r&Y.RIGHT)&&!(s&Y.RIGHT)&&(m=g-(d-l)*f,i=m>=a&&m<=h),!i&&!!(r&Y.BELOW)&&!(s&Y.BELOW)&&(_=d-(g-a)/f,i=_>=o&&_<=l),!i&&!!(r&Y.LEFT)&&!(s&Y.LEFT)&&(m=g-(d-o)*f,i=m>=a&&m<=h)}return i}function xs(n,t){const e=t.getExtent(),i=ge(n);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){const s=st(e),o=Math.floor((i[0]-e[0])/s)*s;n[0]-=o,n[2]-=o}return n}function yr(n,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[e[0],n[1],e[2],n[3]]];xs(n,t);const i=st(e);if(st(n)>i)return[[e[0],n[1],e[2],n[3]]];if(n[0]<e[0])return[[n[0]+i,n[1],e[2],n[3]],[e[0],n[1],n[2],n[3]]];if(n[2]>e[2])return[[n[0],n[1],e[2],n[3]],[e[0],n[1],n[2]-i,n[3]]]}return[n]}const U={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"};class pr{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const xr=pr;class Sr{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const se=Sr;function Rr(n,t,e){let i,s;e=e||_e;let r=0,o=n.length,a=!1;for(;r<o;)i=r+(o-r>>1),s=+e(n[i],t),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function _e(n,t){return n>t?1:n<t?-1:0}function Ss(n,t,e){if(n[0]<=t)return 0;const i=n.length;if(t<=n[i-1])return i-1;if(typeof e=="function"){for(let s=1;s<i;++s){const r=n[s];if(r===t)return s;if(r<t)return e(t,n[s-1],r)>0?s-1:s}return i-1}if(e>0){for(let s=1;s<i;++s)if(n[s]<t)return s-1;return i-1}if(e<0){for(let s=1;s<i;++s)if(n[s]<=t)return s;return i-1}for(let s=1;s<i;++s){if(n[s]==t)return s;if(n[s]<t)return n[s-1]-t<t-n[s]?s-1:s}return i-1}function Cr(n,t,e){for(;t<e;){const i=n[t];n[t]=n[e],n[e]=i,++t,--e}}function Di(n,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let s=0;s<i;s++)n[n.length]=e[s]}function zt(n,t){const e=n.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(n[i]!==t[i])return!1;return!0}function Rs(){return!0}function me(){}function Er(n){let t=!1,e,i,s;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==s||!zt(r,i))&&(t=!0,s=this,i=r,e=n.apply(this,arguments)),e}}function Oi(n){for(const t in n)delete n[t]}function ye(n){let t;for(t in n)return!1;return!t}class Ir extends xr{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),s=i[t]||(i[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=e?new se(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let h=0,c=s.length;h<c;++h)if("handleEvent"in s[h]?l=s[h].handleEvent(r):l=s[h].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[i]===0){let h=a[i];for(delete a[i];h--;)this.removeEventListener(i,me);delete o[i]}return l}disposeInternal(){this.listeners_&&Oi(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){const i=this.listeners_&&this.listeners_[t];if(i){const s=i.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[s]=me,++this.pendingRemovals_[t]):(i.splice(s,1),i.length===0&&delete this.listeners_[t]))}}}const Cs=Ir;function k(){throw new Error("Unimplemented abstract method.")}let wr=0;function G(n){return n.ol_uid||(n.ol_uid=String(++wr))}function Tr(n){return Math.pow(n,3)}function Mr(n){return 1-Tr(1-n)}function Ar(n){return 3*n*n-2*n*n*n}const Ft=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Ft.includes("firefox");const vr=Ft.includes("safari")&&!Ft.includes("chrom");vr&&(Ft.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ft));Ft.includes("webkit")&&Ft.includes("edge");Ft.includes("macintosh");const bi=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Lr=typeof Image<"u"&&Image.prototype.decode;(function(){let n=!1;try{const t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n})();function lt(n,t,e,i){let s;return e&&e.length?s=e.shift():bi?s=new OffscreenCanvas(n||300,t||300):s=document.createElement("canvas"),n&&(s.width=n),t&&(s.height=t),s.getContext("2d",i)}function Fr(n){const t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}const N={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function xt(n,t,e,i,s){if(i&&i!==n&&(e=e.bind(i)),s){const o=e;e=function(){n.removeEventListener(t,e),o.apply(this,arguments)}}const r={target:n,type:t,listener:e};return n.addEventListener(t,e),r}function Ye(n,t,e,i){return xt(n,t,e,i,!0)}function St(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Oi(n))}function Dr(n,t,e){const i=n;let s=!0,r=!1,o=!1;const a=[Ye(i,U.LOAD,function(){o=!0,r||t()})];return i.src&&Lr?(r=!0,i.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(Ye(i,U.ERROR,e)),function(){s=!1,a.forEach(St)}}const Es={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Or{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Es[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Is=Or,Ae=6378137,qt=Math.PI*Ae,br=[-qt,-qt,qt,qt],kr=[-180,-85,180,85],Ge=Ae*Math.log(Math.tan(Math.PI/2));class jt extends Is{constructor(t){super({code:t,units:"m",extent:br,global:!0,worldExtent:kr,getPointResolution:function(e,i){return e/Math.cosh(i[1]/Ae)}})}}const _n=[new jt("EPSG:3857"),new jt("EPSG:102100"),new jt("EPSG:102113"),new jt("EPSG:900913"),new jt("http://www.opengis.net/def/crs/EPSG/0/3857"),new jt("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Pr(n,t,e){const i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let s=0;s<i;s+=e){t[s]=qt*n[s]/180;let r=Ae*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));r>Ge?r=Ge:r<-Ge&&(r=-Ge),t[s+1]=r}return t}function Gr(n,t,e){const i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let s=0;s<i;s+=e)t[s]=180*n[s]/qt,t[s+1]=360*Math.atan(Math.exp(n[s+1]/Ae))/Math.PI-90;return t}const Nr=6378137,mn=[-180,-90,180,90],Wr=Math.PI*Nr/180;class Ot extends Is{constructor(t,e){super({code:t,units:"degrees",extent:mn,axisOrientation:e,global:!0,metersPerUnit:Wr,worldExtent:mn})}}const yn=[new Ot("CRS:84"),new Ot("EPSG:4326","neu"),new Ot("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ot("urn:ogc:def:crs:OGC:2:84"),new Ot("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ot("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ot("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Ri={};function Br(n){return Ri[n]||Ri[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Xr(n,t){Ri[n]=t}let $t={};function Ve(n,t,e){const i=n.getCode(),s=t.getCode();i in $t||($t[i]={}),$t[i][s]=e}function zr(n,t){let e;return n in $t&&t in $t[n]&&(e=$t[n][t]),e}function j(n,t,e){return Math.min(Math.max(n,t),e)}function Yr(n,t,e,i,s,r){const o=s-e,a=r-i;if(o!==0||a!==0){const l=((n-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=s,i=r):l>0&&(e+=o*l,i+=a*l)}return Qt(n,t,e,i)}function Qt(n,t,e,i){const s=e-n,r=i-t;return s*s+r*r}function Wt(n){return n*Math.PI/180}function pn(n,t){const e=n%t;return e*t<0?e+t:e}function tt(n,t,e){return n+e*(t-n)}function Vr(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}function jr(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function ws(n,t){const e=n[0],i=n[1],s=t[0],r=t[1],o=s[0],a=s[1],l=r[0],h=r[1],c=l-o,u=h-a,d=c===0&&u===0?0:(c*(e-o)+u*(i-a))/(c*c+u*u||0);let g,f;return d<=0?(g=o,f=a):d>=1?(g=l,f=h):(g=o+d*c,f=a+d*u),[g,f]}function ot(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function Ur(n,t){const e=Math.cos(t),i=Math.sin(t),s=n[0]*e-n[1]*i,r=n[1]*e+n[0]*i;return n[0]=s,n[1]=r,n}function pe(n,t){const e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function xn(n,t){return Math.sqrt(pe(n,t))}function Zr(n,t){return pe(n,ws(n,t))}function Kr(n,t){if(t.canWrapX()){const e=st(t.getExtent()),i=Hr(n,t,e);i&&(n[0]-=i*e)}return n}function Hr(n,t,e){const i=t.getExtent();let s=0;return t.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(e=e||st(i),s=Math.floor((n[0]-i[0])/e)),s}const ki=63710088e-1;function qr(n,t,e){e=e||ki;const i=Wt(n[1]),s=Wt(t[1]),r=(s-i)/2,o=Wt(t[0]-n[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function ui(n,t){let e=0;for(let i=0,s=n.length;i<s-1;++i)e+=qr(n[i],n[i+1],t);return e}function Jr(n,t){t=t||{};const e=t.radius||ki,i=t.projection||"EPSG:3857",s=n.getType();s!=="GeometryCollection"&&(n=n.clone().transform(i,"EPSG:4326"));let r=0,o,a,l,h,c,u;switch(s){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":{o=n.getCoordinates(),r=ui(o,e);break}case"MultiLineString":case"Polygon":{for(o=n.getCoordinates(),l=0,h=o.length;l<h;++l)r+=ui(o[l],e);break}case"MultiPolygon":{for(o=n.getCoordinates(),l=0,h=o.length;l<h;++l)for(a=o[l],c=0,u=a.length;c<u;++c)r+=ui(a[c],e);break}case"GeometryCollection":{const d=n.getGeometries();for(l=0,h=d.length;l<h;++l)r+=Jr(d[l],t);break}default:throw new Error("Unsupported geometry type: "+s)}return r}function Ne(n,t){let e=0;const i=n.length;let s=n[i-1][0],r=n[i-1][1];for(let o=0;o<i;o++){const a=n[o][0],l=n[o][1];e+=Wt(a-s)*(2+Math.sin(Wt(r))+Math.sin(Wt(l))),s=a,r=l}return e*t*t/2}function $r(n,t){t=t||{};const e=t.radius||ki,i=t.projection||"EPSG:3857",s=n.getType();s!=="GeometryCollection"&&(n=n.clone().transform(i,"EPSG:4326"));let r=0,o,a,l,h,c,u;switch(s){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":{for(o=n.getCoordinates(),r=Math.abs(Ne(o[0],e)),l=1,h=o.length;l<h;++l)r-=Math.abs(Ne(o[l],e));break}case"MultiPolygon":{for(o=n.getCoordinates(),l=0,h=o.length;l<h;++l)for(a=o[l],r+=Math.abs(Ne(a[0],e)),c=1,u=a.length;c<u;++c)r-=Math.abs(Ne(a[c],e));break}case"GeometryCollection":{const d=n.getGeometries();for(l=0,h=d.length;l<h;++l)r+=$r(d[l],t);break}default:throw new Error("Unsupported geometry type: "+s)}return r}const Ts={info:1,warn:2,error:3,none:4};let Qr=Ts.info;function to(...n){Qr>Ts.warn||console.warn(...n)}let Ci=!0;function eo(n){Ci=!(n===void 0?!0:n)}function Ms(n,t){if(t!==void 0){for(let e=0,i=n.length;e<i;++e)t[e]=n[e];t=t}else t=n.slice();return t}function io(n,t){if(t!==void 0&&n!==t){for(let e=0,i=n.length;e<i;++e)t[e]=n[e];n=t}return n}function no(n){Xr(n.getCode(),n),Ve(n,n,Ms)}function so(n){n.forEach(no)}function ie(n){return typeof n=="string"?Br(n):n||null}function Sn(n){so(n),n.forEach(function(t){n.forEach(function(e){t!==e&&Ve(t,e,Ms)})})}function ro(n,t,e,i){n.forEach(function(s){t.forEach(function(r){Ve(s,r,e),Ve(r,s,i)})})}function Pi(n,t){return n?typeof n=="string"?ie(n):n:ie(t)}function oo(n,t){const e=n.getCode(),i=t.getCode();let s=zr(e,i);return s||(s=io),s}function Rn(n,t){const e=ie(n),i=ie(t);return oo(e,i)}function xe(n,t){return n}function V(n,t){return Ci&&!ot(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Ci=!1,to("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Gi(n,t){return n}function Jt(n,t){return n}function ao(){Sn(_n),Sn(yn),ro(yn,_n,Pr,Gr)}ao();const As={PROPERTYCHANGE:"propertychange"};class ii extends Cs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(U.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r<i;++r)s[r]=xt(this,t[r],e);return s}return xt(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const s=t.length;i=new Array(s);for(let r=0;r<s;++r)i[r]=Ye(this,t[r],e)}else i=Ye(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)lo(i);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],e);else this.removeEventListener(t,e)}}ii.prototype.on;ii.prototype.once;ii.prototype.un;function lo(n){if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)St(n[t]);else St(n)}const vs=ii;class Cn extends se{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class ho extends vs{constructor(t){super(),this.on,this.once,this.un,G(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new Cn(i,t,e)),i=As.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Cn(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const s=this.values_||(this.values_={});if(i)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){!t.values_||Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],ye(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const Dt=ho;class co extends Dt{constructor(t){super(),this.projection=ie(t.projection),this.attributions_=En(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(i,s){e.viewResolver=i,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=En(t),this.changed()}setState(t){this.state_=t,this.changed()}}function En(n){return n?Array.isArray(n)?function(t){return n}:typeof n=="function"?n:function(t){return[n]}:null}const uo=co,go=256;function Ls(n,t,e,i,s){let r;for(t+=i;t<e;t+=i)if(r=s(n.slice(t-i,t),n.slice(t,t+i)),r)return r;return!1}function fo(n,t,e,i,s){return!dr(s,function(o){return!kt(n,t,e,i,o[0],o[1])})}function kt(n,t,e,i,s,r){let o=0,a=n[e-i],l=n[e-i+1];for(;t<e;t+=i){const h=n[t],c=n[t+1];l<=r?c>r&&(h-a)*(r-l)-(s-a)*(c-l)>0&&o++:c<=r&&(h-a)*(r-l)-(s-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function Fs(n,t,e,i,s,r){if(e.length===0||!kt(n,t,e[0],i,s,r))return!1;for(let o=1,a=e.length;o<a;++o)if(kt(n,e[o-1],e[o],i,s,r))return!1;return!0}function Ni(n,t,e,i,s){const r=gs(Xt(),n,t,e,i);return at(s,r)?Ht(s,r)||r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:Ls(n,t,e,i,function(o,a){return mr(s,o,a)}):!1}function _o(n,t,e,i,s){return!!(Ni(n,t,e,i,s)||kt(n,t,e,i,s[0],s[1])||kt(n,t,e,i,s[0],s[3])||kt(n,t,e,i,s[2],s[1])||kt(n,t,e,i,s[2],s[3]))}function mo(n,t,e,i,s){if(!_o(n,t,e[0],i,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r<o;++r)if(fo(n,e[r-1],e[r],i,s)&&!Ni(n,e[r-1],e[r],i,s))return!1;return!0}function je(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}class Wi extends Dt{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new Wi(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(St(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=xt(t,U.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?yo(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function yo(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(B(typeof n.getZIndex=="function",41),t=[n]),function(){return t}}const In=Wi;new Array(6);function Lt(){return[1,0,0,1,0,0]}function po(n,t,e,i,s,r,o){return n[0]=t,n[1]=e,n[2]=i,n[3]=s,n[4]=r,n[5]=o,n}function xo(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function K(n,t){const e=t[0],i=t[1];return t[0]=n[0]*e+n[2]*i+n[4],t[1]=n[1]*e+n[3]*i+n[5],t}function So(n,t,e){return po(n,t,0,0,e,0,0)}function ve(n,t,e,i,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return n[0]=i*h,n[1]=s*l,n[2]=-i*l,n[3]=s*h,n[4]=o*i*h-a*i*l+t,n[5]=o*s*l+a*s*h+e,n}function Ro(n,t){const e=Co(t);B(e!==0,32);const i=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5];return n[0]=o/e,n[1]=-s/e,n[2]=-r/e,n[3]=i/e,n[4]=(r*l-o*a)/e,n[5]=-(i*l-s*a)/e,n}function Co(n){return n[0]*n[3]-n[1]*n[2]}let wn;function Eo(n){const t="matrix("+n.join(", ")+")";if(bi)return t;const e=wn||(wn=document.createElement("div"));return e.style.transform=t,e.style.transform}function Bt(n,t,e,i,s,r){r=r||[];let o=0;for(let a=t;a<e;a+=i){const l=n[a],h=n[a+1];r[o++]=s[0]*l+s[2]*h+s[4],r[o++]=s[1]*l+s[3]*h+s[5]}return r&&r.length!=o&&(r.length=o),r}function Ds(n,t,e,i,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],c=r[1];let u=0;for(let d=t;d<e;d+=i){const g=n[d]-h,f=n[d+1]-c;o[u++]=h+g*a-f*l,o[u++]=c+g*l+f*a;for(let _=d+2;_<d+i;++_)o[u++]=n[_]}return o&&o.length!=u&&(o.length=u),o}function Io(n,t,e,i,s,r,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=i){const d=n[u]-l,g=n[u+1]-h;a[c++]=l+s*d,a[c++]=h+r*g;for(let f=u+2;f<u+i;++f)a[c++]=n[f]}return a&&a.length!=c&&(a.length=c),a}function wo(n,t,e,i,s,r,o){o=o||[];let a=0;for(let l=t;l<e;l+=i){o[a++]=n[l]+s,o[a++]=n[l+1]+r;for(let h=l+2;h<l+i;++h)o[a++]=n[h]}return o&&o.length!=a&&(o.length=a),o}const Tn=Lt();class To extends Dt{constructor(){super(),this.extent_=Xt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Er(function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return k()}closestPointXY(t,e,i,s){return k()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return k()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&cs(e),this.extentRevision_=this.getRevision()}return _r(this.extent_,t)}rotate(t,e){k()}scale(t,e,i){k()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return k()}getType(){return k()}applyTransform(t){k()}intersectsExtent(t){return k()}translate(t,e){k()}transform(t,e){const i=ie(t),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),h=i.getWorldExtent(),c=fe(h)/fe(l);return ve(Tn,h[0],h[3],c,-c,0,0,0),Bt(r,0,r.length,a,Tn,o),Rn(i,e)(r,o,a)}:Rn(i,e);return this.applyTransform(s),this}}const Mo=To;class Ao extends Mo{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates=null}computeExtent(t){return cr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return k()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=Mn(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){k()}setLayout(t,e,i){let s;if(t)s=Mn(t);else{for(let r=0;r<i;++r){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}s=e.length,t=vo(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const s=this.getStride();Ds(i,0,i.length,s,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=ge(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();Io(s,0,s.length,r,t,e,i,s),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const s=this.getStride();wo(i,0,i.length,s,t,e,i),this.changed()}}}function vo(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function Mn(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function Lo(n,t,e){const i=n.getFlatCoordinates();if(!i)return null;const s=n.getStride();return Bt(i,0,i.length,s,t,e)}const ni=Ao;function Fo(n,t,e,i){for(let s=0,r=e.length;s<r;++s)n[t++]=e[s];return t}function Bi(n,t,e,i){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0;a<i;++a)n[t++]=o[a]}return t}function Do(n,t,e,i,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=Bi(n,t,e[o],i);s[r++]=l,t=l}return s.length=r,s}class Xi extends ni{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Xi(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,s){const r=this.flatCoordinates,o=Qt(t,e,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)i[l]=r[l];return i.length=a,o}return s}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(t){return ze(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return hs(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Fo(this.flatCoordinates,0,t,this.stride),this.changed()}}const Ei=Xi,Mt={ADD:"add",REMOVE:"remove"},An={LENGTH:"length"};class We extends se{constructor(t,e,i){super(t),this.element=e,this.index=i}}class Oo extends Dt{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,s=this.array_.length;i<s;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,s=e.length;i<s;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(An.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new We(Mt.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,s=e.length;i<s;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new We(Mt.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new We(Mt.REMOVE,s,t)),this.dispatchEvent(new We(Mt.ADD,e,t))}updateLength_(){this.set(An.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,s=this.array_.length;i<s;++i)if(this.array_[i]===t&&i!==e)throw new ls(58)}}const Ii=Oo;class bo{constructor(t){this.rbush_=new as(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[G(e)]=i}load(t,e){const i=new Array(e.length);for(let s=0,r=e.length;s<r;s++){const o=t[s],a=e[s],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[s]=l,this.items_[G(a)]=l}this.rbush_.load(i)}remove(t){const e=G(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){const i=this.items_[G(e)],s=[i.minX,i.minY,i.maxX,i.maxY];us(s,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(s){return s.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let s=0,r=t.length;s<r;s++)if(i=e(t[s]),i)return i;return i}isEmpty(){return ye(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return ee(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const wi=bo,Q={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function ko(n,t){return[[-1/0,-1/0,1/0,1/0]]}let Po=!1;function Go(n,t,e,i,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(e,i,s):n,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=Po,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const h=t.getType();let c;h=="json"||h=="text"?c=a.responseText:h=="xml"?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):h=="arraybuffer"&&(c=a.response),c?r(t.readFeatures(c,{extent:e,featureProjection:s}),t.readProjection(c)):o()}else o()},a.onerror=o,a.send()}function vn(n,t){return function(e,i,s,r,o){const a=this;Go(n,t,e,i,s,function(l,h){a.addFeatures(l),r!==void 0&&r(l)},o||me)}}class Et extends se{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class No extends uo{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=me,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(B(this.format_,7),this.loader_=vn(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:ko;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new wi:null,this.loadedExtentsRtree_=new wi,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,s;Array.isArray(t.features)?s=t.features:t.features&&(i=t.features,s=i.getArray()),!e&&i===void 0&&(i=new Ii(s)),s!==void 0&&this.addFeaturesInternal(s),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=G(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const s=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Et(Q.ADDFEATURE,t))}setupChangeEvents_(t,e){this.featureChangeKeys_[t]=[xt(e,U.CHANGE,this.handleFeatureChange_,this),xt(e,As.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(t,e){let i=!0;const s=e.getId();return s!==void 0&&(s.toString()in this.idIndex_?i=!1:this.idIndex_[s.toString()]=e),i&&(B(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],s=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=G(a);this.addToIndex_(l,a)&&i.push(a)}for(let r=0,o=i.length;r<o;r++){const a=i[r],l=G(a);this.setupChangeEvents_(l,a);const h=a.getGeometry();if(h){const c=h.getExtent();e.push(c),s.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(e,s),this.hasListener(Q.ADDFEATURE))for(let r=0,o=i.length;r<o;r++)this.dispatchEvent(new Et(Q.ADDFEATURE,i[r]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Q.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(Q.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(Mt.ADD,i=>{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(Mt.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(St);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(i);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Et(Q.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(s){if(s.getGeometry().intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){if(i.getGeometry().intersectsExtent(t)){const r=e(i);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),ye(this.nullGeometryFeatures_)||Di(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=yr(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],s=t[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||Rs,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){const c=h.getGeometry(),u=a;if(a=c.closestPointXY(i,s,o,a),a<u){r=h;const d=Math.sqrt(a);l[0]=i-d,l[1]=s-d,l[2]=i+d,l[3]=s+d}}}),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,i=G(e),s=e.getGeometry();if(!s)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);else{const o=s.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}const r=e.getId();if(r!==void 0){const o=r.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Et(Q.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:G(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&ye(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,i){const s=this.loadedExtentsRtree_,r=this.strategy_(t,e,i);for(let o=0,a=r.length;o<a;++o){const l=r[o];s.forEachInExtent(l,function(c){return Ht(c.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Et(Q.FEATURESLOADSTART)),this.loader_.call(this,l,e,i,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new Et(Q.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Et(Q.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,function(s){if(us(s.extent,t))return i=s,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=G(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=G(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(St),delete this.featureChangeKeys_[e];const s=t.getId();return s!==void 0&&delete this.idIndex_[s.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Et(Q.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e}setLoader(t){this.loader_=t}setUrl(t){B(this.format_,7),this.url_=t,this.setLoader(vn(t,this.format_))}}const Wo=No,O={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"};class Bo extends Dt{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[O.OPACITY]=t.opacity!==void 0?t.opacity:1,B(typeof e[O.OPACITY]=="number",64),e[O.VISIBLE]=t.visible!==void 0?t.visible:!0,e[O.Z_INDEX]=t.zIndex,e[O.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[O.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[O.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[O.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=j(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return k()}getLayerStatesArray(t){return k()}getExtent(){return this.get(O.EXTENT)}getMaxResolution(){return this.get(O.MAX_RESOLUTION)}getMinResolution(){return this.get(O.MIN_RESOLUTION)}getMinZoom(){return this.get(O.MIN_ZOOM)}getMaxZoom(){return this.get(O.MAX_ZOOM)}getOpacity(){return this.get(O.OPACITY)}getSourceState(){return k()}getVisible(){return this.get(O.VISIBLE)}getZIndex(){return this.get(O.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(O.EXTENT,t)}setMaxResolution(t){this.set(O.MAX_RESOLUTION,t)}setMinResolution(t){this.set(O.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(O.MAX_ZOOM,t)}setMinZoom(t){this.set(O.MIN_ZOOM,t)}setOpacity(t){B(typeof t=="number",64),this.set(O.OPACITY,t)}setVisible(t){this.set(O.VISIBLE,t)}setZIndex(t){this.set(O.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Xo=Bo,Se={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},nt={ANIMATING:0,INTERACTING:1},rt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Ln(n,t,e){return function(i,s,r,o,a){if(!i)return;if(!s&&!t)return i;const l=t?0:r[0]*s,h=t?0:r[1]*s,c=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+c,g=n[2]-l/2+c,f=n[1]+h/2+u,_=n[3]-h/2+u;d>g&&(d=(g+d)/2,g=d),f>_&&(f=(_+f)/2,_=f);let m=j(i[0],d,g),y=j(i[1],f,_);if(o&&e&&s){const p=30*s;m+=-p*Math.log(1+Math.max(0,d-i[0])/p)+p*Math.log(1+Math.max(0,i[0]-g)/p),y+=-p*Math.log(1+Math.max(0,f-i[1])/p)+p*Math.log(1+Math.max(0,i[1]-_)/p)}return[m,y]}}function zo(n){return n}function zi(n,t,e,i){const s=st(t)/e[0],r=fe(t)/e[1];return i?Math.min(n,Math.max(s,r)):Math.min(n,Math.min(s,r))}function Yi(n,t,e){let i=Math.min(n,t);const s=50;return i*=Math.log(1+s*Math.max(0,n/t-1))/s+1,e&&(i=Math.max(i,e),i/=Math.log(1+s*Math.max(0,e/n-1))/s+1),j(i,e/2,t*2)}function Yo(n,t,e,i){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=n[0],h=n[n.length-1],c=e?zi(l,e,o,i):l;if(a)return t?Yi(s,c,h):j(s,h,c);const u=Math.min(c,s),d=Math.floor(Ss(n,u,r));return n[d]>c&&d<n.length-1?n[d+1]:n[d]}}}function Vo(n,t,e,i,s,r){return i=i!==void 0?i:!0,e=e!==void 0?e:0,function(o,a,l,h){if(o!==void 0){const c=s?zi(t,s,l,r):t;if(h)return i?Yi(o,c,e):j(o,e,c);const u=1e-9,d=Math.ceil(Math.log(t/c)/Math.log(n)-u),g=-a*(.5-u)+.5,f=Math.min(c,o),_=Math.floor(Math.log(t/f)/Math.log(n)+g),m=Math.max(d,_),y=t/Math.pow(n,m);return j(y,e,c)}}}function Fn(n,t,e,i,s){return e=e!==void 0?e:!0,function(r,o,a,l){if(r!==void 0){const h=i?zi(n,i,a,s):n;return!e||!l?j(r,t,h):Yi(r,h,t)}}}function jo(n){if(n!==void 0)return 0}function Dn(n){if(n!==void 0)return n}function Uo(n){const t=2*Math.PI/n;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function Zo(n){return n=n||Wt(5),function(t,e){if(e)return t;if(t!==void 0)return Math.abs(t)<=n?0:t}}function On(n,t,e,i,s,r,o){const a=n[t],l=n[t+1],h=n[e]-a,c=n[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((s-a)*h+(r-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let g=0;g<i;++g)o[g]=tt(n[t+g],n[e+g],d);o.length=i;return}else u=t}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function Vi(n,t,e,i,s){let r=n[t],o=n[t+1];for(t+=i;t<e;t+=i){const a=n[t],l=n[t+1],h=Qt(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function Ko(n,t,e,i,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=Vi(n,t,a,i,s),t=a}return s}function ji(n,t,e,i,s,r,o,a,l,h,c){if(t==e)return h;let u,d;if(s===0){if(d=Qt(o,a,n[t],n[t+1]),d<h){for(u=0;u<i;++u)l[u]=n[t+u];return l.length=i,d}return h}c=c||[NaN,NaN];let g=t+i;for(;g<e;)if(On(n,g-i,g,i,o,a,c),d=Qt(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(d)-Math.sqrt(h))/s|0,1);if(r&&(On(n,e-i,t,i,o,a,c),d=Qt(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i}return h}function Ho(n,t,e,i,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const g=e[u];h=ji(n,t,g,i,s,r,o,a,l,h,c),t=g}return h}function Os(n,t,e,i,s,r,o){const a=(e-t)/i;if(a<3){for(;t<e;t+=i)r[o++]=n[t],r[o++]=n[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-i];let c=0;for(;h.length>0;){const u=h.pop(),d=h.pop();let g=0;const f=n[d],_=n[d+1],m=n[u],y=n[u+1];for(let p=d+i;p<u;p+=i){const x=n[p],C=n[p+1],R=Yr(x,C,f,_,m,y);R>g&&(c=p,g=R)}g>s&&(l[(c-t)/i]=1,d+i<c&&h.push(d,c),c+i<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(r[o++]=n[t+u*i],r[o++]=n[t+u*i+1]);return o}function bt(n,t){return t*Math.round(n/t)}function qo(n,t,e,i,s,r,o){if(t==e)return o;let a=bt(n[t],s),l=bt(n[t+1],s);t+=i,r[o++]=a,r[o++]=l;let h,c;do if(h=bt(n[t],s),c=bt(n[t+1],s),t+=i,t==e)return r[o++]=h,r[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=bt(n[t],s),d=bt(n[t+1],s);if(t+=i,u==h&&d==c)continue;const g=h-a,f=c-l,_=u-a,m=d-l;if(g*m==f*_&&(g<0&&_<g||g==_||g>0&&_>g)&&(f<0&&m<f||f==m||f>0&&m>f)){h=u,c=d;continue}r[o++]=h,r[o++]=c,a=h,l=c,h=u,c=d}return r[o++]=h,r[o++]=c,o}function Jo(n,t,e,i,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=qo(n,t,c,i,s,r,o),a.push(o),t=c}return o}function Pt(n,t,e,i,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<e;o+=i)s[r++]=n.slice(o,o+i);return s.length=r,s}function Ue(n,t,e,i,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=Pt(n,t,l,i,s[r]),t=l}return s.length=r,s}function bn(n,t,e,i,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=l.length===1&&l[0]===t?[]:Ue(n,t,l,i,s[r]),t=l[l.length-1]}return s.length=r,s}function bs(n,t,e,i){let s=0,r=n[e-i],o=n[e-i+1];for(;t<e;t+=i){const a=n[t],l=n[t+1];s+=o*a-r*l,r=a,o=l}return s/2}function $o(n,t,e,i){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=bs(n,t,a,i),t=a}return s}class Ze extends ni{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new Ze(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,s){return s<Fi(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ji(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,s))}getArea(){return bs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Pt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Os(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Ze(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Bi(this.flatCoordinates,0,t,this.stride),this.changed()}}const kn=Ze;function Qo(n,t,e,i,s,r,o){let a,l,h,c,u,d,g;const f=s[r+1],_=[];for(let p=0,x=e.length;p<x;++p){const C=e[p];for(c=n[C-i],d=n[C-i+1],a=t;a<C;a+=i)u=n[a],g=n[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(h=(f-d)/(g-d)*(u-c)+c,_.push(h)),c=u,d=g}let m=NaN,y=-1/0;for(_.sort(_e),c=_[0],a=1,l=_.length;a<l;++a){u=_[a];const p=Math.abs(u-c);p>y&&(h=(c+u)/2,Fs(n,t,e,i,h,f)&&(m=h,y=p)),c=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,f,y),o):[m,f,y]}function ta(n,t,e,i){for(;t<e-i;){for(let s=0;s<i;++s){const r=n[t+s];n[t+s]=n[e-i+s],n[e-i+s]=r}t+=i,e-=i}}function ks(n,t,e,i){let s=0,r=n[e-i],o=n[e-i+1];for(;t<e;t+=i){const a=n[t],l=n[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function ea(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=ks(n,t,a,i);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;t=a}return!0}function Pn(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=ks(n,t,a,i);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&ta(n,t,a,i),t=a}return t}class Ke extends ni{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Di(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Ke(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,s){return s<Fi(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ko(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ho(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,s))}containsXY(t,e){return Fs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return $o(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Pn(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Ue(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=ge(this.getExtent());this.flatInteriorPoint_=Qo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Ei(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new kn(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,s=[];let r=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],h=new kn(e.slice(r,l),t);s.push(h),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;ea(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Pn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Jo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new Ke(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return mo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Do(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Gn(n){if(ps(n))throw new Error("Cannot create polygon from empty extent");const t=n[0],e=n[1],i=n[2],s=n[3],r=[t,e,t,s,i,s,i,e,t,e];return new Ke(r,"XY",[r.length])}const di=0;class ia extends Dt{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Pi(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&eo(),t.center&&(t.center=V(t.center,this.projection_)),t.extent&&(t.extent=Jt(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const a in rt)delete e[a];this.setProperties(e,!0);const i=sa(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;const s=na(t),r=i.constraint,o=ra(t);this.constraints_={center:s,resolution:r,rotation:o},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const i=this.getCenterInternal();if(i){const s=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution(),o=r/2*(s[3]-e[3]+e[1]-s[1]),a=r/2*(s[0]-e[0]+e[2]-s[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let i=0;i<e.length;++i){let s=arguments[i];s.center&&(s=Object.assign({},s),s.center=V(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=V(s.anchor,this.getProjection())),e[i]=s}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,i;e>1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let s=0;for(;s<e&&!this.isDef();++s){const c=arguments[s];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(s===e){i&&Be(i,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;s<e;++s){const c=arguments[s],u={start:r,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||Ar,callback:i};if(c.center&&(u.sourceCenter=o,u.targetCenter=c.center.slice(),o=u.targetCenter),c.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(c.zoom),a=u.targetResolution):c.resolution&&(u.sourceResolution=a,u.targetResolution=c.resolution,a=u.targetResolution),c.rotation!==void 0){u.sourceRotation=l;const d=pn(c.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}oa(u)?u.complete=!0:r+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(nt.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[nt.ANIMATING]>0}getInteracting(){return this.hints_[nt.INTERACTING]>0}cancelAnimations(){this.setHint(nt.ANIMATING,-this.hints_[nt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e<i;++e){const s=this.animations_[e];if(s[0].callback&&Be(s[0].callback,!1),!t)for(let r=0,o=s.length;r<o;++r){const a=s[r];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let i=this.animations_.length-1;i>=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(l.complete)continue;const h=t-l.start;let c=l.duration>0?h/l.duration:1;c>=1?(l.complete=!0,c=1):r=!1;const u=l.easing(c);if(l.sourceCenter){const d=l.sourceCenter[0],g=l.sourceCenter[1],f=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(f-d),y=g+u*(_-g);this.targetCenter_=[m,y]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?pn(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(nt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&Be(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-e[0],s[1]-e[1]],Ur(i,t-this.getRotation()),jr(i,e)),i}calculateCenterZoom(t,e){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],s=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&xe(t,this.getProjection())}getCenterInternal(){return this.get(rt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return Gi(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();B(e,1);const i=this.getResolution();B(i!==void 0,2);const s=this.getRotation();return B(s!==void 0,3),gr(e,i,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(rt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Jt(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=st(t)/e[0],s=fe(t)/e[1];return Math.max(i,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(e/i)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(rt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/e;return function(o){return Math.log(i/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=gi(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,s;if(this.resolutions_){const r=Ss(this.resolutions_,t,1);e=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(i/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=j(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,j(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(B(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){B(!ps(t),25);const s=Jt(t,this.getProjection());i=Gn(s)}else if(t.getType()==="Circle"){const s=Jt(t.getExtent(),this.getProjection());i=Gn(s),i.rotate(this.getRotation(),ge(s))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=r.length;u<d;u+=o){const g=r[u]*i-r[u+1]*s,f=r[u]*s+r[u+1]*i;a=Math.min(a,g),l=Math.min(l,f),h=Math.max(h,g),c=Math.max(c,f)}return[a,l,h,c]}fitInternal(t,e){e=e||{};let i=e.size;i||(i=this.getViewportSizeMinusPadding_());const s=e.padding!==void 0?e.padding:[0,0,0,0],r=e.nearest!==void 0?e.nearest:!1;let o;e.minResolution!==void 0?o=e.minResolution:e.maxZoom!==void 0?o=this.getResolutionForZoom(e.maxZoom):o=0;const a=this.rotatedExtentForGeometry(t);let l=this.getResolutionForExtentInternal(a,[i[0]-s[1]-s[3],i[1]-s[0]-s[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,r?0:1);const h=this.getRotation(),c=Math.sin(h),u=Math.cos(h),d=ge(a);d[0]+=(s[1]-s[3])/2*l,d[1]+=(s[0]-s[2])/2*l;const g=d[0]*u-d[1]*c,f=d[1]*u+d[0]*c,_=this.getConstrainedCenter([g,f],l),m=e.callback?e.callback:me;e.duration!==void 0?this.animateInternal({resolution:l,center:_,duration:e.duration,easing:e.easing},m):(this.targetResolution_=l,this.targetCenter_=_,this.applyTargetState_(!1,!0),Be(m,!0))}centerOn(t,e,i){this.centerOnInternal(V(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(gi(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,s){let r;const o=this.padding_;if(o&&t){const a=this.getViewportSizeMinusPadding_(-i),l=gi(t,s,[a[0]/2+o[3],a[1]/2+o[0]],e,i);r=[t[0]-l[0],t[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=xe(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&V(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const i=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,i);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=V(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const i=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(s,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&V(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const i=this.getAnimating()||this.getInteracting()||e,s=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,i),a=this.constraints_.center(this.targetCenter_,o,r,i,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(rt.ROTATION)!==s&&this.set(rt.ROTATION,s),this.get(rt.RESOLUTION)!==o&&(this.set(rt.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(rt.CENTER)||!ot(this.get(rt.CENTER),a))&&this.set(rt.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=t!==void 0?t:200;const s=e||0,r=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,s,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,r,o));if(t===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,this.applyTargetState_();return}i=i||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==r||!this.getCenterInternal()||!ot(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:t,easing:Mr,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(nt.INTERACTING,1)}endInteraction(t,e,i){i=i&&V(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){!this.getInteracting()||(this.setHint(nt.INTERACTING,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){const i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}}function Be(n,t){setTimeout(function(){n(t)},0)}function na(n){if(n.extent!==void 0){const e=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return Ln(n.extent,n.constrainOnlyCenter,e)}const t=Pi(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Ln(e,!1,!1)}return zo}function sa(n){let t,e,i,o=n.minZoom!==void 0?n.minZoom:di,a=n.maxZoom!==void 0?n.maxZoom:28;const l=n.zoomFactor!==void 0?n.zoomFactor:2,h=n.multiWorld!==void 0?n.multiWorld:!1,c=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,u=n.showFullExtent!==void 0?n.showFullExtent:!1,d=Pi(n.projection,"EPSG:3857"),g=d.getExtent();let f=n.constrainOnlyCenter,_=n.extent;if(!h&&!_&&d.isGlobal()&&(f=!1,_=g),n.resolutions!==void 0){const m=n.resolutions;e=m[o],i=m[a]!==void 0?m[a]:m[m.length-1],n.constrainResolution?t=Yo(m,c,!f&&_,u):t=Fn(e,i,c,!f&&_,u)}else{const y=(g?Math.max(st(g),fe(g)):360*Es.degrees/d.getMetersPerUnit())/go/Math.pow(2,di),p=y/Math.pow(2,28-di);e=n.maxResolution,e!==void 0?o=0:e=y/Math.pow(l,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=e/Math.pow(l,a):i=y/Math.pow(l,a):i=p),a=o+Math.floor(Math.log(e/i)/Math.log(l)),i=e/Math.pow(l,a-o),n.constrainResolution?t=Vo(l,e,i,c,!f&&_,u):t=Fn(e,i,c,!f&&_,u)}return{constraint:t,maxResolution:e,minResolution:i,minZoom:o,zoomFactor:l}}function ra(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const e=n.constrainRotation;return e===void 0||e===!0?Zo():e===!1?Dn:typeof e=="number"?Uo(e):Dn}return jo}function oa(n){return!(n.sourceCenter&&n.targetCenter&&!ot(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function gi(n,t,e,i,s){const r=Math.cos(-s);let o=Math.sin(-s),a=n[0]*r-n[1]*o,l=n[1]*r+n[0]*o;a+=(t[0]/2-e[0])*i,l+=(e[1]-t[1]/2)*i,o=-o;const h=a*r-l*o,c=l*r+a*o;return[h,c]}const Nn=ia;class aa extends Xo{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(O.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(O.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(St(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=xt(t,U.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Nn?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;e.layerStatesArray?s=e.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return la(s,e.viewState)&&(!r||at(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];const s=t instanceof Nn?t.getViewStateAndExtent():t;let r=e(s);return Array.isArray(r)||(r=[r]),r}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(O.MAP,t)}getMapInternal(){return this.get(O.MAP)}setMap(t){this.mapPrecomposeKey_&&(St(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(St(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=xt(t,Se.PRECOMPOSE,function(e){const s=e.frameState.layerStatesArray,r=this.getLayerState(!1);B(!s.some(function(o){return o.layer===r.layer}),67),s.push(r)},this),this.mapRenderKey_=xt(this,U.CHANGE,t.render,t),this.changed())}setSource(t){this.set(O.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function la(n,t){if(!n.visible)return!1;const e=t.resolution;if(e<n.minResolution||e>=n.maxResolution)return!1;const i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}const ha=aa;class ca extends vs{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return k()}getData(t){return null}prepareFrame(t){return k()}renderFrame(t,e){return k()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(s,r)=>{const o=this.loadedTileCallback.bind(this,i,s);return t.forEachLoadedTile(e,s,r,o)}}forEachFeatureAtCoordinate(t,e,i,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===N.LOADED||e.getState()===N.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=N.LOADED&&e!=N.ERROR&&t.addEventListener(U.CHANGE,this.boundHandleImageChange_),e==N.IDLE&&(t.load(),e=t.getState()),e==N.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const ua=ca;class da extends se{constructor(t,e,i,s){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=s}}const ga=da,fa=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,_a=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ps(n){return typeof n=="string"?n:Gs(n)}function ma(n){const t=document.createElement("div");if(t.style.color=n,t.style.color!==""){document.body.appendChild(t);const e=getComputedStyle(t).color;return document.body.removeChild(t),e}return""}const ya=function(){const t={};let e=0;return function(i){let s;if(t.hasOwnProperty(i))s=t[i];else{if(e>=1024){let r=0;for(const o in t)(r++&3)===0&&(delete t[o],--e)}s=pa(i),t[i]=s,++e}return s}}();function He(n){return Array.isArray(n)?n:ya(n)}function pa(n){let t,e,i,s,r;if(_a.exec(n)&&(n=ma(n)),fa.exec(n)){const o=n.length-1;let a;o<=4?a=1:a=2;const l=o===4||o===8;t=parseInt(n.substr(1+0*a,a),16),e=parseInt(n.substr(1+1*a,a),16),i=parseInt(n.substr(1+2*a,a),16),l?s=parseInt(n.substr(1+3*a,a),16):s=255,a==1&&(t=(t<<4)+t,e=(e<<4)+e,i=(i<<4)+i,l&&(s=(s<<4)+s)),r=[t,e,i,s/255]}else n.startsWith("rgba(")?(r=n.slice(5,-1).split(",").map(Number),Wn(r)):n.startsWith("rgb(")?(r=n.slice(4,-1).split(",").map(Number),r.push(1),Wn(r)):B(!1,14);return r}function Wn(n){return n[0]=j(n[0]+.5|0,0,255),n[1]=j(n[1]+.5|0,0,255),n[2]=j(n[2]+.5|0,0,255),n[3]=j(n[3],0,1),n}function Gs(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const s=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+t+","+e+","+i+","+s+")"}const Bn=[];let Zt=null;function xa(){Zt=lt(1,1,void 0,{willReadFrequently:!0})}class Sa extends ua{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Lt(),this.pixelTransform=Lt(),this.inversePixelTransform=Lt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){Zt||xa(),Zt.clearRect(0,0,1,1);let s;try{Zt.drawImage(t,e,i,1,1,0,0,1,1),s=Zt.getImageData(0,0,1,1).data}catch{return Zt=null,null}return s}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){const s=this.getLayer().getClassName();let r,o;if(t&&t.className===s&&(!i||t&&t.style.backgroundColor&&zt(He(t.style.backgroundColor),He(i)))){const a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let a=r.style;a.position="absolute",a.width="100%",a.height="100%",o=lt();const l=o.canvas;r.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const s=ms(i),r=ys(i),o=_s(i),a=fs(i);K(e.coordinateToPixelTransform,s),K(e.coordinateToPixelTransform,r),K(e.coordinateToPixelTransform,o),K(e.coordinateToPixelTransform,a);const l=this.inversePixelTransform;K(l,s),K(l,r),K(l,o),K(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}dispatchRenderEvent_(t,e,i){const s=this.getLayer();if(s.hasListener(t)){const r=new ga(t,this.inversePixelTransform,i,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(Se.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(Se.POSTRENDER,t,e)}getRenderTransform(t,e,i,s,r,o,a){const l=r/2,h=o/2,c=s/e,u=-c,d=-t[0]+a,g=-t[1];return ve(this.tempTransform,l,h,c,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const Ra=Sa,Wl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAeCAYAAADQBxWhAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAJBSURBVEiJ7ZfPa9NgHMaf933j27jazTqRLq02tc0q6E4DZYfCEPwFuwzmwYPiQTz4H3gQ/wBRPHhxetB58CKIbKcNRKig11EGdutoHW6dP7aqXS2NTeKhjQSNW96tKyg+EEieNzyf9/3mG/KGwFY8kmCGmbJA+gD40TpVCKyMwWga8+9yAEAAgB0Ij1gUJ1oIchUxMWUsLD5hiEcSBDi/3cAGFXGru+sNZYaZaguwKWaYKdp8hm2TBdInQbBpYpMPhrimKr/62djgqMcIPxUBhm5c7eeaquhzhSXnYU/Ga47kZgYvDEfBdzAA4L2xoO13jZzqBwD9/cqa836uqeCaqoQf3RysFz+UAUCfzZcAAPp3ozT29K3zfkLV8F2n4TucCKgT9895nbUXFYYuPa7N5Mr29W8rrc3kyl/Gnr1GB5d2HR9Isj27A/pso4RsbzCwXrjxqVQGAN6rKsbq5/La81dZfNPrTiDgslKn7KYRaBIAQDL/4rI+V1jKn7w44TYu1EitkjC05/a1o9Hx0dMAQHycRsfvnem5c/2YSIZr964nfujgPjkZU6RISKYdMpOPaPupfycXyfg7yvsf+u9BrWpVBwDKGCFNz6w0PK8SfmUWhq9MSqFuX315pQYA8wNnH9aXP9ZEMjZVXhvYOBcDbhq6VXkqr8gHesvQ6nS2yDVVcduebKTqdLb4pzFC1fAttHZzvZEqlMDKtBEIAitDDUbT7YQajKYZSl9XaWenDIL4dgOJiSmrsPiS/HTa+AP1A194w/sdsoQRAAAAAElFTkSuQmCC";function Bl(n){return Li({url:"equipment/contractors",method:"get",params:n})}function Xl(n){return Li({url:"equipment/districtsBlocks",method:"get",params:n})}function zl(n){return Li({url:"equipment/cityAndCount",method:"get",params:n})}class Ui{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=je(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Ui({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return k()}getImage(t){return k()}getHitDetectionImage(){return k()}getPixelRatio(t){return 1}getImageState(){return k()}getImageSize(){return k()}getOrigin(){return k()}getSize(){return k()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=je(t)}listenImageChange(t){k()}load(){k()}unlistenImageChange(t){k()}}const Ns=Ui;function dt(n){return Array.isArray(n)?Gs(n):n}const Ca=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"),Xn=["style","variant","weight","size","lineHeight","family"],Ws=function(n){const t=n.match(Ca);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=Xn.length;i<s;++i){const r=t[i+1];r!==void 0&&(e[Xn[i]]=r)}return e.families=e.family.split(/,\s?/),e},Bs="10px sans-serif",H="#000",qe="round",Rt=[],Ct=0,ne="round",Re=10,Ce="#000",Ee="center",Je="middle",Gt=[0,0,0,0],Ie=1,It=new Dt;let Kt=null,Ti;const Mi={},Ea=function(){const t="32px ",e=["monospace","serif"],i=e.length,s="wmytzilWMYTZIL@#/&?$%10\uF013";let r,o;function a(h,c,u){let d=!0;for(let g=0;g<i;++g){const f=e[g];if(o=$e(h+" "+c+" "+t+f,s),u!=f){const _=$e(h+" "+c+" "+t+u+","+f,s);d=d&&_!=o}}return!!d}function l(){let h=!0;const c=It.getKeys();for(let u=0,d=c.length;u<d;++u){const g=c[u];It.get(g)<100&&(a.apply(this,g.split(`
`))?(Oi(Mi),Kt=null,Ti=void 0,It.set(g,100)):(It.set(g,It.get(g)+1,!0),h=!1))}h&&(clearInterval(r),r=void 0)}return function(h){const c=Ws(h);if(!c)return;const u=c.families;for(let d=0,g=u.length;d<g;++d){const f=u[d],_=c.style+`
`+c.weight+`
`+f;It.get(_)===void 0&&(It.set(_,100,!0),a(c.style,c.weight,f)||(It.set(_,0,!0),r===void 0&&(r=setInterval(l,32))))}}}(),Ia=function(){let n;return function(t){let e=Mi[t];if(e==null){if(bi){const i=Ws(t),s=Xs(t,"\u017Dg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=t,document.body.appendChild(n),e=n.offsetHeight,document.body.removeChild(n);Mi[t]=e}return e}}();function Xs(n,t){return Kt||(Kt=lt(1,1)),n!=Ti&&(Kt.font=n,Ti=Kt.font),Kt.measureText(t)}function $e(n,t){return Xs(n,t).width}function zn(n,t,e){if(t in e)return e[t];const i=t.split(`
`).reduce((s,r)=>Math.max(s,$e(n,r)),0);return e[t]=i,i}function wa(n,t){const e=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===`
`||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l;continue}const d=t[h+1]||n.font,g=$e(d,u);e.push(g),o+=g;const f=Ia(d);i.push(f),l=Math.max(l,f)}return{width:r,height:a,widths:e,heights:i,lineWidths:s}}function Ta(n,t,e,i,s,r,o,a,l,h,c){n.save(),e!==1&&(n.globalAlpha*=e),t&&n.setTransform.apply(n,t),i.contextInstructions?(n.translate(l,h),n.scale(c[0],c[1]),Ma(i,n)):c[0]<0||c[1]<0?(n.translate(l,h),n.scale(c[0],c[1]),n.drawImage(i,s,r,o,a,0,0,o,a)):n.drawImage(i,s,r,o,a,l,h,o*c[0],a*c[1]),n.restore()}function Ma(n,t){const e=n.contextInstructions;for(let i=0,s=e.length;i<s;i+=2)Array.isArray(e[i+1])?t[e[i]].apply(t,e[i+1]):t[e[i]]=e[i+1]}class Zi extends Ns{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new Zi({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_;if(!t)return null;const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const i=this.renderOptions_,s=lt(i.size*t,i.size*t);this.draw_(i,s,t),e=s.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return N.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius_,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const w=s;s=r,r=w}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=r*Math.sin(a),h=Math.sqrt(r*r-l*l),c=s-h,u=Math.sqrt(l*l+c*c),d=u/l;if(t==="miter"&&d<=i)return d*e;const g=e/2/d,f=e/2*(c/u),m=Math.sqrt((s+g)*(s+g)+f*f)-s;if(this.radius2_===void 0||t==="bevel")return m*2;const y=s*Math.sin(a),p=Math.sqrt(s*s-y*y),x=r-p,R=Math.sqrt(y*y+x*x)/y;if(R<=i){const w=R*e/2-r-s;return 2*Math.max(m,w)}return m*2}createRenderOptions(){let t=ne,e=0,i=null,s=0,r,o=0;this.stroke_&&(r=this.stroke_.getColor(),r===null&&(r=Ce),r=dt(r),o=this.stroke_.getWidth(),o===void 0&&(o=Ie),i=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=ne),e=this.stroke_.getMiterLimit(),e===void 0&&(e=Re));const a=this.calculateLineJoinSize_(t,o,e),l=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*l+a);return{strokeStyle:r,strokeWidth:o,size:h,lineDash:i,lineDashOffset:s,lineJoin:t,miterLimit:e}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let s=this.fill_.getColor();s===null&&(s=H),e.fillStyle=dt(s),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())}createHitDetectionCanvas_(t){if(this.fill_){let e=this.fill_.getColor(),i=0;if(typeof e=="string"&&(e=He(e)),e===null?i=1:Array.isArray(e)&&(i=e.length===4?e[3]:1),i===0){const s=lt(t.size,t.size);this.hitDetectionCanvas_=s.canvas,this.drawHitDetectionCanvas_(t,s)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{const s=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(e*=2);const r=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let a=0;a<e;a++){const l=r+a*o,h=a%2===0?i:s;t.lineTo(h*Math.cos(l),h*Math.sin(l))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=H,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())}}const zs=Zi;class Ki extends zs{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new Ki({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}const Hi=Ki;class qi{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new qi({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}const we=qi;class Aa{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];(t++&3)===0&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const s=Yn(t,e,i);return s in this.cache_?this.cache_[s]:null}set(t,e,i,s){const r=Yn(t,e,i);this.cache_[r]=s,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Yn(n,t,e){const i=e?Ps(e):"null";return t+":"+n+":"+i}const Vn=new Aa;let ce=null;class va extends Cs{constructor(t,e,i,s,r,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=s,this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=r,this.size_=i,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===N.LOADED){ce||(ce=lt(1,1,void 0,{willReadFrequently:!0})),ce.drawImage(this.image_,0,0);try{ce.getImageData(0,0,1,1),this.tainted_=!1}catch{ce=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(U.CHANGE)}handleImageError_(){this.imageState_=N.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=N.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_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=lt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===N.IDLE){this.image_||this.initializeImage_(),this.imageState_=N.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Dr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==N.LOADED)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const s=i.getContext("2d");s.scale(t,t),s.drawImage(e,0,0),s.globalCompositeOperation="multiply",s.fillStyle=Ps(this.color_),s.fillRect(0,0,i.width/t,i.height/t),s.globalCompositeOperation="destination-in",s.drawImage(e,0,0),this.canvas_[t]=i}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function La(n,t,e,i,s,r){let o=Vn.get(t,i,r);return o||(o=new va(n,t,e,i,s,r),Vn.set(t,i,r,o)),o}function jn(n,t,e,i){return e!==void 0&&i!==void 0?[e/n,i/t]:e!==void 0?e/n:i!==void 0?i/t:1}class Ji extends Ns{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;this.imgSize_=t.imgSize;let a=t.src;B(!(a!==void 0&&o),4),B(!o||o&&this.imgSize_,5),(a===void 0||a.length===0)&&o&&(a=o.src||G(o)),B(a!==void 0&&a.length>0,6),B(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),69);const l=t.src!==void 0?N.IDLE:N.LOADED;if(this.color_=t.color!==void 0?He(t.color):null,this.iconImage_=La(o,a,this.imgSize_!==void 0?this.imgSize_:null,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{const u=this.getImage(1);if(u instanceof HTMLCanvasElement||u.src&&u.complete)h=u.width,c=u.height;else{this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(jn(g[0],g[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(jn(h,c,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Ji({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:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==N.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==N.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(U.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(U.CHANGE,t)}}const Ys=Ji;class $i{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new $i({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const ue=$i;class At{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Un,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new At({geometry:t,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()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Un,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Fa(n){let t;if(typeof n=="function")t=n;else{let e;Array.isArray(n)?e=n:(B(typeof n.getZIndex=="function",41),e=[n]),t=function(){return e}}return t}let fi=null;function Da(n,t){if(!fi){const e=new we({color:"rgba(255,255,255,0.4)"}),i=new ue({color:"#3399CC",width:1.25});fi=[new At({image:new Hi({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return fi}function Oa(){const n={},t=[255,255,255,1],e=[0,153,255,1],i=3;return n.Polygon=[new At({fill:new we({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new At({stroke:new ue({color:t,width:i+2})}),new At({stroke:new ue({color:e,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new At({image:new Hi({radius:i*2,fill:new we({color:e}),stroke:new ue({color:t,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function Un(n){return n.getGeometry()}const Ai=At,ba="#333";class Qi{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=je(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new we({color:ba}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const t=this.getScale();return new Qi({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=je(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const ka=Qi;function Pa(n,t,e,i,s,r,o){let a,l;const h=(e-t)/i;if(h===1)a=t;else if(h===2)a=t,l=s;else if(h!==0){let c=n[t],u=n[t+1],d=0;const g=[0];for(let m=t+i;m<e;m+=i){const y=n[m],p=n[m+1];d+=Math.sqrt((y-c)*(y-c)+(p-u)*(p-u)),g.push(d),c=y,u=p}const f=s*d,_=Rr(g,f);_<0?(l=(f-g[-_-2])/(g[-_-1]-g[-_-2]),a=t+(-_-2)*i):a=t+_*i}o=o>1?o:2,r=r||new Array(o);for(let c=0;c<o;++c)r[c]=a===void 0?NaN:l===void 0?n[a+c]:tt(n[a+c],n[a+i+c],l);return r}function Ga(n,t,e,i,s,r){if(e==t)return null;let o;if(s<n[t+i-1])return r?(o=n.slice(t,t+i),o[i-1]=s,o):null;if(n[e-1]<s)return r?(o=n.slice(e-i,e),o[i-1]=s,o):null;if(s==n[t+i-1])return n.slice(t,t+i);let a=t/i,l=e/i;for(;a<l;){const d=a+l>>1;s<n[(d+1)*i-1]?l=d:a=d+1}const h=n[a*i-1];if(s==h)return n.slice((a-1)*i,(a-1)*i+i);const c=n[(a+1)*i-1],u=(s-h)/(c-h);o=[];for(let d=0;d<i-1;++d)o.push(tt(n[(a-1)*i+d],n[a*i+d],u));return o.push(s),o}function Vs(n,t,e,i){let s=n[t],r=n[t+1],o=0;for(let a=t+i;a<e;a+=i){const l=n[a],h=n[a+1];o+=Math.sqrt((l-s)*(l-s)+(h-r)*(h-r)),s=l,r=h}return o}class Qe extends ni{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){this.flatCoordinates?Di(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new Qe(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,s){return s<Fi(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ji(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,s))}forEachSegment(t){return Ls(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Pt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Pa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return Vs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=Os(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Qe(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Bi(this.flatCoordinates,0,t,this.stride),this.changed()}}const Yl=Qe;function Zn(n){return new Ai({fill:Te(n,""),stroke:Me(n,""),text:Na(n),image:Wa(n)})}function Te(n,t){const e=n[t+"fill-color"];if(!!e)return e==="none"?null:new we({color:e})}function Me(n,t){const e=n[t+"stroke-width"],i=n[t+"stroke-color"];if(!(!e&&!i))return new ue({width:e,color:i,lineCap:n[t+"stroke-line-cap"],lineJoin:n[t+"stroke-line-join"],lineDash:n[t+"stroke-line-dash"],lineDashOffset:n[t+"stroke-line-dash-offset"],miterLimit:n[t+"stroke-miter-limit"]})}function Na(n){const t=n["text-value"];return t?new ka({text:t,font:n["text-font"],maxAngle:n["text-max-angle"],offsetX:n["text-offset-x"],offsetY:n["text-offset-y"],overflow:n["text-overflow"],placement:n["text-placement"],repeat:n["text-repeat"],scale:n["text-scale"],rotateWithView:n["text-rotate-with-view"],rotation:n["text-rotation"],textAlign:n["text-align"],justify:n["text-justify"],textBaseline:n["text-baseline"],padding:n["text-padding"],fill:Te(n,"text-"),backgroundFill:Te(n,"text-background-"),stroke:Me(n,"text-"),backgroundStroke:Me(n,"text-background-")}):void 0}function Wa(n){const t=n["icon-src"],e=n["icon-img"];if(t||e)return new Ys({src:t,img:e,imgSize:n["icon-img-size"],anchor:n["icon-anchor"],anchorOrigin:n["icon-anchor-origin"],anchorXUnits:n["icon-anchor-x-units"],anchorYUnits:n["icon-anchor-y-units"],color:n["icon-color"],crossOrigin:n["icon-cross-origin"],offset:n["icon-offset"],displacement:n["icon-displacement"],opacity:n["icon-opacity"],scale:n["icon-scale"],width:n["icon-width"],height:n["icon-height"],rotation:n["icon-rotation"],rotateWithView:n["icon-rotate-with-view"],size:n["icon-size"],declutterMode:n["icon-declutter-mode"]});const i=n["shape-points"];if(i){const r="shape-";return new zs({points:i,fill:Te(n,r),stroke:Me(n,r),radius:n["shape-radius"],radius1:n["shape-radius1"],radius2:n["shape-radius2"],angle:n["shape-angle"],displacement:n["shape-displacement"],rotation:n["shape-rotation"],rotateWithView:n["shape-rotate-with-view"],scale:n["shape-scale"],declutterMode:n["shape-declutter-mode"]})}const s=n["circle-radius"];if(s){const r="circle-";return new Hi({radius:s,fill:Te(n,r),stroke:Me(n,r),displacement:n["circle-displacement"],scale:n["circle-scale"],rotation:n["circle-rotation"],rotateWithView:n["circle-rotate-with-view"],declutterMode:n["circle-declutter-mode"]})}}const Kn={RENDER_ORDER:"renderOrder"};class Ba extends ha{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Kn.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new as(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(Kn.RENDER_ORDER,t)}setStyle(t){let e;if(t===void 0)e=Da;else if(t===null)e=null;else if(typeof t=="function")e=t;else if(t instanceof Ai)e=t;else if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r<i;++r){const o=t[r];o instanceof Ai?s[r]=o:s[r]=Zn(o)}e=s}else e=Zn(t);this.style_=e,this.styleFunction_=t===null?void 0:Fa(this.style_),this.changed()}}const Xa=Ba,Le={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},Xe=[Le.FILL],vt=[Le.STROKE],Nt=[Le.BEGIN_PATH],Hn=[Le.CLOSE_PATH],E=Le;class za{drawCustom(t,e,i,s){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const js=za;class Ya extends js{constructor(t,e,i,s){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=s,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,r=this.coordinates;let o=r.length;for(let a=0,l=t.length;a<l;a+=e)s[0]=t[a],s[1]=t[a+1],hr(i,s)&&(r[o++]=s[0],r[o++]=s[1]);return o}appendFlatLineCoordinates(t,e,i,s,r,o){const a=this.coordinates;let l=a.length;const h=this.getBufferedMaxExtent();o&&(e+=s);let c=t[e],u=t[e+1];const d=this.tmpCoordinate_;let g=!0,f,_,m;for(f=e+s;f<i;f+=s)d[0]=t[f],d[1]=t[f+1],m=Si(h,d),m!==_?(g&&(a[l++]=c,a[l++]=u,g=!1),a[l++]=d[0],a[l++]=d[1]):m===Y.INTERSECTING?(a[l++]=d[0],a[l++]=d[1],g=!1):g=!0,c=d[0],u=d[1],_=m;return(r&&g||f===e+s)&&(a[l++]=c,a[l++]=u),l}drawCustomCoordinates_(t,e,i,s,r){for(let o=0,a=i.length;o<a;++o){const l=i[o],h=this.appendFlatLineCoordinates(t,e,l,s,!1,!1);r.push(h),e=l}return e}drawCustom(t,e,i,s){this.beginGeometry(t,e);const r=t.getType(),o=t.getStride(),a=this.coordinates.length;let l,h,c,u,d;switch(r){case"MultiPolygon":l=t.getOrientedFlatCoordinates(),u=[];const g=t.getEndss();d=0;for(let f=0,_=g.length;f<_;++f){const m=[];d=this.drawCustomCoordinates_(l,d,g[f],o,m),u.push(m)}this.instructions.push([E.CUSTOM,a,u,t,i,bn]),this.hitDetectionInstructions.push([E.CUSTOM,a,u,t,s||i,bn]);break;case"Polygon":case"MultiLineString":c=[],l=r=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(l,0,t.getEnds(),o,c),this.instructions.push([E.CUSTOM,a,c,t,i,Ue]),this.hitDetectionInstructions.push([E.CUSTOM,a,c,t,s||i,Ue]);break;case"LineString":case"Circle":l=t.getFlatCoordinates(),h=this.appendFlatLineCoordinates(l,0,l.length,o,!1,!1),this.instructions.push([E.CUSTOM,a,h,t,i,Pt]),this.hitDetectionInstructions.push([E.CUSTOM,a,h,t,s||i,Pt]);break;case"MultiPoint":l=t.getFlatCoordinates(),h=this.appendFlatPointCoordinates(l,o),h>a&&(this.instructions.push([E.CUSTOM,a,h,t,i,Pt]),this.hitDetectionInstructions.push([E.CUSTOM,a,h,t,s||i,Pt]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),h=this.coordinates.length,this.instructions.push([E.CUSTOM,a,h,t,i]),this.hitDetectionInstructions.push([E.CUSTOM,a,h,t,s||i]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[E.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[E.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let s,r,o=-1;for(e=0;e<i;++e)s=t[e],r=s[0],r==E.END_GEOMETRY?o=e:r==E.BEGIN_GEOMETRY&&(s[2]=e,Cr(this.hitDetectionInstructions,o,e),o=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const s=t.getColor();i.fillStyle=dt(s||H)}else i.fillStyle=void 0;if(e){const s=e.getColor();i.strokeStyle=dt(s||Ce);const r=e.getLineCap();i.lineCap=r!==void 0?r:qe;const o=e.getLineDash();i.lineDash=o?o.slice():Rt;const a=e.getLineDashOffset();i.lineDashOffset=a||Ct;const l=e.getLineJoin();i.lineJoin=l!==void 0?l:ne;const h=e.getWidth();i.lineWidth=h!==void 0?h:Ie;const c=e.getMiterLimit();i.miterLimit=c!==void 0?c:Re,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[E.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[E.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=s||r!=t.currentLineDash&&!zt(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[E.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=lr(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;ei(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const Fe=Ya;class Va extends Fe{constructor(t,e,i,s){super(t,e,i,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),s=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,s);this.instructions.push([E.DRAW_IMAGE,r,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([E.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),s=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,s);this.instructions.push([E.DRAW_IMAGE,r,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([E.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const i=t.getAnchor(),s=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=s[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const ja=Va;class Ua extends Fe{constructor(t,e,i,s){super(t,e,i,s)}drawFlatCoordinates_(t,e,i,s){const r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,s,!1,!1),a=[E.MOVE_TO_LINE_TO,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(t,e){const i=this.state,s=i.strokeStyle,r=i.lineWidth;if(s===void 0||r===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([E.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Rt,Ct],Nt);const o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(vt),this.endGeometry(e)}drawMultiLineString(t,e){const i=this.state,s=i.strokeStyle,r=i.lineWidth;if(s===void 0||r===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([E.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Rt,Ct],Nt);const o=t.getEnds(),a=t.getFlatCoordinates(),l=t.getStride();let h=0;for(let c=0,u=o.length;c<u;++c)h=this.drawFlatCoordinates_(a,h,o[c],l);this.hitDetectionInstructions.push(vt),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(vt),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(vt),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(Nt)}}const Za=Ua;class Ka extends Fe{constructor(t,e,i,s){super(t,e,i,s)}drawFlatCoordinatess_(t,e,i,s){const r=this.state,o=r.fillStyle!==void 0,a=r.strokeStyle!==void 0,l=i.length;this.instructions.push(Nt),this.hitDetectionInstructions.push(Nt);for(let h=0;h<l;++h){const c=i[h],u=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,c,s,!0,!a),g=[E.MOVE_TO_LINE_TO,u,d];this.instructions.push(g),this.hitDetectionInstructions.push(g),a&&(this.instructions.push(Hn),this.hitDetectionInstructions.push(Hn)),e=c}return o&&(this.instructions.push(Xe),this.hitDetectionInstructions.push(Xe)),a&&(this.instructions.push(vt),this.hitDetectionInstructions.push(vt)),e}drawCircle(t,e){const i=this.state,s=i.fillStyle,r=i.strokeStyle;if(s===void 0&&r===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([E.SET_FILL_STYLE,H]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([E.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Rt,Ct]);const o=t.getFlatCoordinates(),a=t.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const h=[E.CIRCLE,l];this.instructions.push(Nt,h),this.hitDetectionInstructions.push(Nt,h),i.fillStyle!==void 0&&(this.instructions.push(Xe),this.hitDetectionInstructions.push(Xe)),i.strokeStyle!==void 0&&(this.instructions.push(vt),this.hitDetectionInstructions.push(vt)),this.endGeometry(e)}drawPolygon(t,e){const i=this.state,s=i.fillStyle,r=i.strokeStyle;if(s===void 0&&r===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([E.SET_FILL_STYLE,H]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([E.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Rt,Ct]);const o=t.getEnds(),a=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(a,0,o,l),this.endGeometry(e)}drawMultiPolygon(t,e){const i=this.state,s=i.fillStyle,r=i.strokeStyle;if(s===void 0&&r===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([E.SET_FILL_STYLE,H]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([E.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Rt,Ct]);const o=t.getEndss(),a=t.getOrientedFlatCoordinates(),l=t.getStride();let h=0;for(let c=0,u=o.length;c<u;++c)h=this.drawFlatCoordinatess_(a,h,o[c],l);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let i=0,s=e.length;i<s;++i)e[i]=bt(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const qn=Ka;function Ha(n,t,e,i,s){const r=[];let o=e,a=0,l=t.slice(e,2);for(;a<n&&o+s<i;){const[h,c]=l.slice(-2),u=t[o+s],d=t[o+s+1],g=Math.sqrt((u-h)*(u-h)+(d-c)*(d-c));if(a+=g,a>=n){const f=(n-a+g)/g,_=tt(h,u,f),m=tt(c,d,f);l.push(_,m),r.push(l),l=[_,m],a==n&&(o+=s),a=0}else if(a<n)l.push(t[o+s],t[o+s+1]),o+=s;else{const f=g-a,_=tt(h,u,f/g),m=tt(c,d,f/g);l.push(_,m),r.push(l),l=[_,m],a=0,o+=s}}return a>0&&r.push(l),r}function qa(n,t,e,i,s){let r=e,o=e,a=0,l=0,h=e,c,u,d,g,f,_,m,y,p,x;for(u=e;u<i;u+=s){const C=t[u],R=t[u+1];f!==void 0&&(p=C-f,x=R-_,g=Math.sqrt(p*p+x*x),m!==void 0&&(l+=d,c=Math.acos((m*p+y*x)/(d*g)),c>n&&(l>a&&(a=l,r=h,o=u),l=0,h=u-s)),d=g,m=p,y=x),f=C,_=R}return l+=g,l>a?[h,u]:[r,o]}const ti={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Ja extends Fe{constructor(t,e,i,s){super(t,e,i,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[H]={fillStyle:H},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const i=this.textFillState_,s=this.textStrokeState_,r=this.textState_;if(this.text_===""||!r||!i&&!s)return;const o=this.coordinates;let a=o.length;const l=t.getType();let h=null,c=t.getStride();if(r.placement==="line"&&(l=="LineString"||l=="MultiLineString"||l=="Polygon"||l=="MultiPolygon")){if(!at(this.getBufferedMaxExtent(),t.getExtent()))return;let u;if(h=t.getFlatCoordinates(),l=="LineString")u=[h.length];else if(l=="MultiLineString")u=t.getEnds();else if(l=="Polygon")u=t.getEnds().slice(0,1);else if(l=="MultiPolygon"){const _=t.getEndss();u=[];for(let m=0,y=_.length;m<y;++m)u.push(_[m][0])}this.beginGeometry(t,e);const d=r.repeat,g=d?void 0:r.textAlign;let f=0;for(let _=0,m=u.length;_<m;++_){let y;d?y=Ha(d*this.resolution,h,f,u[_],c):y=[h.slice(f,u[_])];for(let p=0,x=y.length;p<x;++p){const C=y[p];let R=0,w=C.length;if(g==null){const T=qa(r.maxAngle,C,0,C.length,2);R=T[0],w=T[1]}for(let T=R;T<w;T+=c)o.push(C[T],C[T+1]);const L=o.length;f=u[_],this.drawChars_(a,L),a=L}}this.endGeometry(e)}else{let u=r.overflow?null:[];switch(l){case"Point":case"MultiPoint":h=t.getFlatCoordinates();break;case"LineString":h=t.getFlatMidpoint();break;case"Circle":h=t.getCenter();break;case"MultiLineString":h=t.getFlatMidpoints(),c=2;break;case"Polygon":h=t.getFlatInteriorPoint(),r.overflow||u.push(h[2]/this.resolution),c=3;break;case"MultiPolygon":const y=t.getFlatInteriorPoints();h=[];for(let p=0,x=y.length;p<x;p+=3)r.overflow||u.push(y[p+2]/this.resolution),h.push(y[p],y[p+1]);if(h.length===0)return;c=2;break}const d=this.appendFlatPointCoordinates(h,c);if(d===a)return;if(u&&(d-a)/2!==h.length/c){let y=a/2;u=u.filter((p,x)=>{const C=o[(y+x)*2]===h[x*c]&&o[(y+x)*2+1]===h[x*c+1];return C||--y,C})}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&this.updateFillStyle(this.state,this.createFill),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let g=r.padding;if(g!=Gt&&(r.scale[0]<0||r.scale[1]<0)){let y=r.padding[0],p=r.padding[1],x=r.padding[2],C=r.padding[3];r.scale[0]<0&&(p=-p,C=-C),r.scale[1]<0&&(y=-y,x=-x),g=[y,p,x,C]}const f=this.pixelRatio;this.instructions.push([E.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,g==Gt?Gt:g.map(function(y){return y*f}),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]);const _=1/f,m=this.state.fillStyle;r.backgroundFill&&(this.state.fillStyle=H,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([E.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,void 0,this.declutterImageWithText_,g,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?H:this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]),r.backgroundFill&&(this.state.fillStyle=m,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||Ee,justify:e.justify,textBaseline:e.textBaseline||Je,scale:e.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=ti[s.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([E.DRAW_CHARS,t,e,h,s.overflow,a,s.maxAngle,l,c,r,d*l,u,o,1]),this.hitDetectionInstructions.push([E.DRAW_CHARS,t,e,h,s.overflow,a&&H,s.maxAngle,1,c,r,d,u,o,1/l])}setTextStyle(t,e){let i,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=dt(o.getColor()||H)):(s=null,this.textFillState_=s);const a=t.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const f=a.getLineDash(),_=a.getLineDashOffset(),m=a.getWidth(),y=a.getMiterLimit();r.lineCap=a.getLineCap()||qe,r.lineDash=f?f.slice():Rt,r.lineDashOffset=_===void 0?Ct:_,r.lineJoin=a.getLineJoin()||ne,r.lineWidth=m===void 0?Ie:m,r.miterLimit=y===void 0?Re:y,r.strokeStyle=dt(a.getColor()||Ce)}i=this.textState_;const l=t.getFont()||Bs;Ea(l);const h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Je,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Gt,i.scale=h===void 0?[1,1]:h;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:G(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=s?typeof s.fillStyle=="string"?s.fillStyle:"|"+G(s.fillStyle):""}this.declutterImageWithText_=e}}const $a={Circle:qn,Default:Fe,Image:ja,LineString:Za,Polygon:qn,Text:Ja};class Qa{constructor(t,e,i,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const s in i){const r=i[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[i];s===void 0&&(s={},this.buildersByZIndex_[i]=s);let r=s[e];if(r===void 0){const o=$a[e];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}const Jn=Qa;function tl(n,t,e,i,s,r,o,a,l,h,c,u){let d=n[t],g=n[t+1],f=0,_=0,m=0,y=0;function p(){f=d,_=g,t+=i,d=n[t],g=n[t+1],y+=m,m=Math.sqrt((d-f)*(d-f)+(g-_)*(g-_))}do p();while(t<e-i&&y+m<r);let x=m===0?0:(r-y)/m;const C=tt(f,d,x),R=tt(_,g,x),w=t-i,L=y,T=r+a*l(h,s,c);for(;t<e-i&&y+m<T;)p();x=m===0?0:(T-y)/m;const v=tt(f,d,x),F=tt(_,g,x);let W;if(u){const A=[C,R,v,F];Ds(A,0,4,2,u,A,A),W=A[0]>A[2]}else W=C>v;const P=Math.PI,b=[],q=w+i===t;t=w,m=0,y=L,d=n[t],g=n[t+1];let I;if(q){p(),I=Math.atan2(g-_,d-f),W&&(I+=I>0?-P:P);const A=(v+C)/2,M=(F+R)/2;return b[0]=[A,M,(T-r)/2,I,s],b}s=s.replace(/\n/g," ");for(let A=0,M=s.length;A<M;){p();let D=Math.atan2(g-_,d-f);if(W&&(D+=D>0?-P:P),I!==void 0){let ct=D-I;if(ct+=ct>P?-2*P:ct<-P?2*P:0,Math.abs(ct)>o)return null}I=D;const X=A;let z=0;for(;A<M;++A){const ct=W?M-A-1:A,Yt=a*l(h,s[ct],c);if(t+i<e&&y+m<r+z+Yt/2)break;z+=Yt}if(A===X)continue;const ht=W?s.substring(M-X,M-A):s.substring(X,A);x=m===0?0:(r+z/2-y)/m;const S=tt(f,d,x),tn=tt(_,g,x);b.push([S,tn,z/2,D,ht]),r+=z}return b}const Ut=Xt(),wt=[],mt=[],yt=[],Tt=[];function $n(n){return n[3].declutterBox}const Qn=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 _i(n,t){return t==="start"?t=Qn.test(n)?"right":"left":t==="end"&&(t=Qn.test(n)?"left":"right"),ti[t]}function el(n,t,e){return e>0&&n.push(`
`,""),n.push(t,""),n}class il{constructor(t,e,i,s){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Lt(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,s){const r=t+e+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=Array.isArray(t),d=l.justify?ti[l.justify]:_i(Array.isArray(t)?t[0]:t,l.textAlign||Ee),g=s&&o.lineWidth?o.lineWidth:0,f=u?t:t.split(`
`).reduce(el,[]),{width:_,height:m,widths:y,heights:p,lineWidths:x}=wa(l,f),C=_+g,R=[],w=(C+2)*c[0],L=(m+g)*c[1],T={width:w<0?Math.floor(w):Math.ceil(w),height:L<0?Math.floor(L):Math.ceil(L),contextInstructions:R};(c[0]!=1||c[1]!=1)&&R.push("scale",c),s&&(R.push("strokeStyle",o.strokeStyle),R.push("lineWidth",g),R.push("lineCap",o.lineCap),R.push("lineJoin",o.lineJoin),R.push("miterLimit",o.miterLimit),R.push("setLineDash",[o.lineDash]),R.push("lineDashOffset",o.lineDashOffset)),i&&R.push("fillStyle",a.fillStyle),R.push("textBaseline","middle"),R.push("textAlign","center");const v=.5-d;let F=d*C+v*g;const W=[],P=[];let b=0,q=0,I=0,A=0,M;for(let D=0,X=f.length;D<X;D+=2){const z=f[D];if(z===`
`){q+=b,b=0,F=d*C+v*g,++A;continue}const ht=f[D+1]||l.font;ht!==M&&(s&&W.push("font",ht),i&&P.push("font",ht),M=ht),b=Math.max(b,p[I]);const S=[z,F+v*y[I]+d*(y[I]-x[A]),.5*(g+b)+q];F+=y[I],s&&W.push("strokeText",S),i&&P.push("fillText",S),++I}return Array.prototype.push.apply(R,W),Array.prototype.push.apply(R,P),this.labels_[r]=T,T}replayTextBackground_(t,e,i,s,r,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,s,r,o,a,l,h,c,u,d,g,f,_,m){a*=d[0],l*=d[1];let y=i-a,p=s-l;const x=r+h>t?t-h:r,C=o+c>e?e-c:o,R=f[3]+x*d[0]+f[1],w=f[0]+C*d[1]+f[2],L=y-f[3],T=p-f[0];(_||u!==0)&&(wt[0]=L,Tt[0]=L,wt[1]=T,mt[1]=T,mt[0]=L+R,yt[0]=mt[0],yt[1]=T+w,Tt[1]=yt[1]);let v;return u!==0?(v=ve(Lt(),i,s,1,1,u,-i,-s),K(v,wt),K(v,mt),K(v,yt),K(v,Tt),ee(Math.min(wt[0],mt[0],yt[0],Tt[0]),Math.min(wt[1],mt[1],yt[1],Tt[1]),Math.max(wt[0],mt[0],yt[0],Tt[0]),Math.max(wt[1],mt[1],yt[1],Tt[1]),Ut)):ee(Math.min(L,L+R),Math.min(T,T+w),Math.max(L,L+R),Math.max(T,T+w),Ut),g&&(y=Math.round(y),p=Math.round(p)),{drawImageX:y,drawImageY:p,drawImageW:x,drawImageH:C,originX:h,originY:c,declutterBox:{minX:Ut[0],minY:Ut[1],maxX:Ut[2],maxY:Ut[3],value:m},canvasTransform:v,scale:d}}replayImageOrLabel_(t,e,i,s,r,o,a){const l=!!(o||a),h=s.declutterBox,c=t.canvas,u=a?a[2]*s.scale[0]/2:0;return h.minX-u<=c.width/e&&h.maxX+u>=0&&h.minY-u<=c.height/e&&h.maxY+u>=0&&(l&&this.replayTextBackground_(t,wt,mt,yt,Tt,o,a),Ta(t,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){if(this.alignFill_){const e=K(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,s){const r=this.textStates[e],o=this.createLabel(t,e,s,i),a=this.strokeStates[i],l=this.pixelRatio,h=_i(Array.isArray(t)?t[0]:t,r.textAlign||Ee),c=ti[r.textBaseline||Je],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*r.scale[0],g=h*d+2*(.5-h)*u,f=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:g,anchorY:f}}execute_(t,e,i,s,r,o,a,l){let h;this.pixelCoordinates_&&zt(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Bt(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),xo(this.renderedTransform_,i));let c=0;const u=s.length;let d=0,g,f,_,m,y,p,x,C,R,w,L,T,v=0,F=0,W=null,P=null;const b=this.coordinateCache_,q=this.viewRotation_,I=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:q},M=this.instructions!=s||this.overlaps?0:200;let D,X,z,ht;for(;c<u;){const S=s[c];switch(S[0]){case E.BEGIN_GEOMETRY:D=S[1],ht=S[3],D.getGeometry()?a!==void 0&&!at(a,ht.getExtent())?c=S[2]+1:++c:c=S[2];break;case E.BEGIN_PATH:v>M&&(this.fill_(t),v=0),F>M&&(t.stroke(),F=0),!v&&!F&&(t.beginPath(),m=NaN,y=NaN),++c;break;case E.CIRCLE:d=S[1];const ct=h[d],Yt=h[d+1],Ks=h[d+2],Hs=h[d+3],en=Ks-ct,nn=Hs-Yt,sn=Math.sqrt(en*en+nn*nn);t.moveTo(ct+sn,Yt),t.arc(ct,Yt,sn,0,2*Math.PI,!0),++c;break;case E.CLOSE_PATH:t.closePath(),++c;break;case E.CUSTOM:d=S[1],g=S[2];const qs=S[3],Js=S[4],rn=S.length==6?S[5]:void 0;A.geometry=qs,A.feature=D,c in b||(b[c]=[]);const re=b[c];rn?rn(h,d,g,2,re):(re[0]=h[d],re[1]=h[d+1],re.length=2),Js(re,A),++c;break;case E.DRAW_IMAGE:d=S[1],g=S[2],C=S[3],f=S[4],_=S[5];let si=S[6];const $s=S[7],Qs=S[8],tr=S[9],on=S[10];let ri=S[11];const er=S[12];let De=S[13];const an=S[14],oe=S[15];if(!C&&S.length>=20){R=S[19],w=S[20],L=S[21],T=S[22];const J=this.drawLabelWithPointPlacement_(R,w,L,T);C=J.label,S[3]=C;const Vt=S[23];f=(J.anchorX-Vt)*this.pixelRatio,S[4]=f;const et=S[24];_=(J.anchorY-et)*this.pixelRatio,S[5]=_,si=C.height,S[6]=si,De=C.width,S[13]=De}let oi;S.length>25&&(oi=S[25]);let ai,Oe,be;S.length>17?(ai=S[16],Oe=S[17],be=S[18]):(ai=Gt,Oe=!1,be=!1),on&&I?ri+=q:!on&&!I&&(ri-=q);let ir=0;for(;d<g;d+=2){if(oi&&oi[ir++]<De/this.pixelRatio)continue;const J=this.calculateImageOrLabelDimensions_(C.width,C.height,h[d],h[d+1],De,si,f,_,Qs,tr,ri,er,r,ai,Oe||be,D),Vt=[t,e,C,J,$s,Oe?W:null,be?P:null];if(l){if(an==="none")continue;if(an==="obstacle"){l.insert(J.declutterBox);continue}else{let et,gt;if(oe){const $=g-d;if(!oe[$]){oe[$]=Vt;continue}if(et=oe[$],delete oe[$],gt=$n(et),l.collides(gt))continue}if(l.collides(J.declutterBox))continue;et&&(l.insert(gt),this.replayImageOrLabel_.apply(this,et)),l.insert(J.declutterBox)}}this.replayImageOrLabel_.apply(this,Vt)}++c;break;case E.DRAW_CHARS:const ln=S[1],hn=S[2],li=S[3],nr=S[4];T=S[5];const sr=S[6],cn=S[7],un=S[8];L=S[9];const hi=S[10];R=S[11],w=S[12];const dn=[S[13],S[13]],ci=this.textStates[w],ae=ci.font,le=[ci.scale[0]*cn,ci.scale[1]*cn];let he;ae in this.widths_?he=this.widths_[ae]:(he={},this.widths_[ae]=he);const gn=Vs(h,ln,hn,2),fn=Math.abs(le[0])*zn(ae,R,he);if(nr||fn<=gn){const J=this.textStates[w].textAlign,Vt=(gn-fn)*_i(R,J),et=tl(h,ln,hn,2,R,Vt,sr,Math.abs(le[0]),zn,ae,he,I?0:this.viewRotation_);t:if(et){const gt=[];let $,ke,Pe,Z,it;if(L)for($=0,ke=et.length;$<ke;++$){it=et[$],Pe=it[4],Z=this.createLabel(Pe,w,"",L),f=it[2]+(le[0]<0?-hi:hi),_=li*Z.height+(.5-li)*2*hi*le[1]/le[0]-un;const ft=this.calculateImageOrLabelDimensions_(Z.width,Z.height,it[0],it[1],Z.width,Z.height,f,_,0,0,it[3],dn,!1,Gt,!1,D);if(l&&l.collides(ft.declutterBox))break t;gt.push([t,e,Z,ft,1,null,null])}if(T)for($=0,ke=et.length;$<ke;++$){it=et[$],Pe=it[4],Z=this.createLabel(Pe,w,T,""),f=it[2],_=li*Z.height-un;const ft=this.calculateImageOrLabelDimensions_(Z.width,Z.height,it[0],it[1],Z.width,Z.height,f,_,0,0,it[3],dn,!1,Gt,!1,D);if(l&&l.collides(ft.declutterBox))break t;gt.push([t,e,Z,ft,1,null,null])}l&&l.load(gt.map($n));for(let ft=0,rr=gt.length;ft<rr;++ft)this.replayImageOrLabel_.apply(this,gt[ft])}}++c;break;case E.END_GEOMETRY:if(o!==void 0){D=S[1];const J=o(D,ht);if(J)return J}++c;break;case E.FILL:M?v++:this.fill_(t),++c;break;case E.MOVE_TO_LINE_TO:for(d=S[1],g=S[2],X=h[d],z=h[d+1],p=X+.5|0,x=z+.5|0,(p!==m||x!==y)&&(t.moveTo(X,z),m=p,y=x),d+=2;d<g;d+=2)X=h[d],z=h[d+1],p=X+.5|0,x=z+.5|0,(d==g-2||p!==m||x!==y)&&(t.lineTo(X,z),m=p,y=x);++c;break;case E.SET_FILL_STYLE:W=S,this.alignFill_=S[2],v&&(this.fill_(t),v=0,F&&(t.stroke(),F=0)),t.fillStyle=S[1],++c;break;case E.SET_STROKE_STYLE:P=S,F&&(t.stroke(),F=0),this.setStrokeStyle_(t,S),++c;break;case E.STROKE:M?F++:t.stroke(),++c;break;default:++c;break}}v&&this.fill_(t),F&&t.stroke()}execute(t,e,i,s,r,o){this.viewRotation_=s,this.execute_(t,e,i,this.instructions,r,void 0,void 0,o)}executeHitDetection(t,e,i,s,r){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,s,r)}}const nl=il,mi=["Polygon","Circle","LineString","Image","Text","Default"];class sl{constructor(t,e,i,s,r,o){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Lt(),this.createExecutors_(r)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(const e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);const s=t[e];for(const r in s){const o=s[r];i[r]=new nl(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let s=0,r=t.length;s<r;++s)if(t[s]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,s,r,o){s=Math.round(s);const a=s*2+1,l=ve(this.hitDetectionTransform_,s+.5,s+.5,1/e,-1/e,-i,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=lt(a,a,void 0,{willReadFrequently:!0}));const c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):h||c.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=Xt(),ds(u,t),ei(u,e*(this.renderBuffer_+s),u));const d=rl(s);let g;function f(R,w){const L=c.getImageData(0,0,a,a).data;for(let T=0,v=d.length;T<v;T++)if(L[d[T]]>0){if(!o||g!=="Image"&&g!=="Text"||o.includes(R)){const F=(d[T]-3)/4,W=s-F%a,P=s-(F/a|0),b=r(R,w,W*W+P*P);if(b)return b}c.clearRect(0,0,a,a);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(_e);let m,y,p,x,C;for(m=_.length-1;m>=0;--m){const R=_[m].toString();for(p=this.executorsByZIndex_[R],y=mi.length-1;y>=0;--y)if(g=mi[y],x=p[g],x!==void 0&&(C=x.executeHitDetection(c,l,i,f,u),C))return C}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],s=e[1],r=e[2],o=e[3],a=[i,s,i,o,r,o,r,s];return Bt(a,0,8,2,t,a),a}isEmpty(){return ye(this.executorsByZIndex_)}execute(t,e,i,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(_e),this.maxExtent_&&(t.save(),this.clip(t,i)),o=o||mi;let h,c,u,d,g,f;for(a&&l.reverse(),h=0,c=l.length;h<c;++h){const _=l[h].toString();for(g=this.executorsByZIndex_[_],u=0,d=o.length;u<d;++u){const m=o[u];f=g[m],f!==void 0&&f.execute(t,e,i,s,r,a)}}this.maxExtent_&&t.restore()}}const yi={};function rl(n){if(yi[n]!==void 0)return yi[n];const t=n*2+1,e=n*n,i=new Array(e+1);for(let r=0;r<=n;++r)for(let o=0;o<=n;++o){const a=r*r+o*o;if(a>e)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+r)*t+(n+o))*4+3),r>0&&l.push(((n-r)*t+(n+o))*4+3),o>0&&(l.push(((n+r)*t+(n-o))*4+3),r>0&&l.push(((n-r)*t+(n-o))*4+3))}const s=[];for(let r=0,o=i.length;r<o;++r)i[r]&&s.push(...i[r]);return yi[n]=s,s}const ts=sl;class ol extends js{constructor(t,e,i,s,r,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=s,this.transformRotation_=s?Vr(Math.atan2(s[1],s[0]),10):0,this.viewRotation_=r,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Lt()}drawImages_(t,e,i,s){if(!this.image_)return;const r=Bt(t,e,i,s,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let c=0,u=r.length;c<u;c+=2){const d=r[c]-this.imageAnchorX_,g=r[c+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const f=d+this.imageAnchorX_,_=g+this.imageAnchorY_;ve(a,f,_,1,1,h,-f,-_),o.setTransform.apply(o,a),o.translate(f,_),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_,d,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(t,e,i,s){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=Bt(t,e,i,s,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=s){const l=r[e]+this.textOffsetX_,h=r[e+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.translate(l-this.textOffsetX_,h-this.textOffsetY_),o.rotate(a),o.translate(this.textOffsetX_,this.textOffsetY_),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)):(this.textStrokeState_&&o.strokeText(this.text_,l,h),this.textFillState_&&o.fillText(this.text_,l,h))}}moveToLineTo_(t,e,i,s,r){const o=this.context_,a=Bt(t,e,i,s,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;r&&(l-=2);for(let h=2;h<l;h+=2)o.lineTo(a[h],a[h+1]);return r&&o.closePath(),i}drawRings_(t,e,i,s){for(let r=0,o=i.length;r<o;++r)e=this.moveToLineTo_(t,e,i[r],s,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Lo(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],s=e[3]-e[1],r=Math.sqrt(i*i+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(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);break}}drawFeature(t,e){const i=e.getGeometryFunction()(t);!i||(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let i=0,s=e.length;i<s;++i)this.drawGeometry(e[i])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(!!at(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,s=t.getFlatCoordinates();let r=0;const o=t.getEnds(),a=t.getStride();i.beginPath();for(let l=0,h=o.length;l<h;++l)r=this.moveToLineTo_(s,r,o[l],a,!1);i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const 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_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getOrientedFlatCoordinates();let s=0;const r=t.getEndss(),o=t.getStride();e.beginPath();for(let a=0,l=r.length;a<l;++a){const h=r[a];s=this.drawRings_(i,s,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),zt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,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})}setContextTextState_(t){const e=this.context_,i=this.contextTextState_,s=t.textAlign?t.textAlign:Ee;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=s&&(i.textAlign=s,e.textAlign=s),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const i=t.getColor();this.fillState_={fillStyle:dt(i||H)}}if(!e)this.strokeState_=null;else{const i=e.getColor(),s=e.getLineCap(),r=e.getLineDash(),o=e.getLineDashOffset(),a=e.getLineJoin(),l=e.getWidth(),h=e.getMiterLimit(),c=r||Rt;this.strokeState_={lineCap:s!==void 0?s:qe,lineDash:this.pixelRatio_===1?c:c.map(u=>u*this.pixelRatio_),lineDashOffset:(o||Ct)*this.pixelRatio_,lineJoin:a!==void 0?a:ne,lineWidth:(l!==void 0?l:Ie)*this.pixelRatio_,miterLimit:h!==void 0?h:Re,strokeStyle:dt(i||Ce)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*i,this.imageAnchorY_=s[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const g=e.getColor();this.textFillState_={fillStyle:dt(g||H)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const g=i.getColor(),f=i.getLineCap(),_=i.getLineDash(),m=i.getLineDashOffset(),y=i.getLineJoin(),p=i.getWidth(),x=i.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:qe,lineDash:_||Rt,lineDashOffset:m||Ct,lineJoin:y!==void 0?y:ne,lineWidth:p!==void 0?p:Ie,miterLimit:x!==void 0?x:Re,strokeStyle:dt(g||Ce)}}const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:Bs,textAlign:u!==void 0?u:Ee,textBaseline:d!==void 0?d:Je},this.text_=c!==void 0?Array.isArray(c)?c.reduce((g,f,_)=>g+=_%2?" ":f,""):c:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const al=ol,ut=.5;function ll(n,t,e,i,s,r,o){const a=n[0]*ut,l=n[1]*ut,h=lt(a,l);h.imageSmoothingEnabled=!1;const c=h.canvas,u=new al(h,ut,s,null,o),d=e.length,g=Math.floor((256*256*256-1)/d),f={};for(let m=1;m<=d;++m){const y=e[m-1],p=y.getStyleFunction()||i;if(!p)continue;let x=p(y,r);if(!x)continue;Array.isArray(x)||(x=[x]);const R=(m*g).toString(16).padStart(7,"#00000");for(let w=0,L=x.length;w<L;++w){const T=x[w],v=T.getGeometryFunction()(y);if(!v||!at(s,v.getExtent()))continue;const F=T.clone(),W=F.getFill();W&&W.setColor(R);const P=F.getStroke();P&&(P.setColor(R),P.setLineDash(null)),F.setText(void 0);const b=T.getImage();if(b){const M=b.getImageSize();if(!M)continue;const D=lt(M[0],M[1],void 0,{alpha:!1}),X=D.canvas;D.fillStyle=R,D.fillRect(0,0,X.width,X.height),F.setImage(new Ys({img:X,imgSize:M,anchor:b.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:b.getOrigin(),opacity:1,size:b.getSize(),scale:b.getScale(),rotation:b.getRotation(),rotateWithView:b.getRotateWithView()}))}const q=F.getZIndex()||0;let I=f[q];I||(I={},f[q]=I,I.Polygon=[],I.Circle=[],I.LineString=[],I.Point=[]);const A=v.getType();if(A==="GeometryCollection"){const M=v.getGeometriesArrayRecursive();for(let D=0,X=M.length;D<X;++D){const z=M[D];I[z.getType().replace("Multi","")].push(z,F)}}else I[A.replace("Multi","")].push(v,F)}}const _=Object.keys(f).map(Number).sort(_e);for(let m=0,y=_.length;m<y;++m){const p=f[_[m]];for(const x in p){const C=p[x];for(let R=0,w=C.length;R<w;R+=2){u.setStyle(C[R+1]);for(let L=0,T=t.length;L<T;++L)u.setTransform(t[L]),u.drawGeometry(C[R])}}}return h.getImageData(0,0,c.width,c.height)}function hl(n,t,e){const i=[];if(e){const s=Math.floor(Math.round(n[0])*ut),r=Math.floor(Math.round(n[1])*ut),o=(j(s,0,e.width-1)+j(r,0,e.height-1)*e.width)*4,a=e.data[o],l=e.data[o+1],c=e.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/t.length);c&&c%u===0&&i.push(t[c/u-1])}return i}const cl=.5,Us={Point:xl,LineString:ml,Polygon:Rl,MultiPoint:Sl,MultiLineString:yl,MultiPolygon:pl,GeometryCollection:_l,Circle:gl};function ul(n,t){return parseInt(G(n),10)-parseInt(G(t),10)}function dl(n,t){const e=vi(n,t);return e*e}function vi(n,t){return cl*n/t}function gl(n,t,e,i,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=n.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(r,o),l.drawCircle(t,i)}const a=e.getText();if(a&&a.getText()){const l=(s||n).getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,i)}}function es(n,t,e,i,s,r,o){let a=!1;const l=e.getImage();if(l){const h=l.getImageState();h==N.LOADED||h==N.ERROR?l.unlistenImageChange(s):(h==N.IDLE&&l.load(),l.listenImageChange(s),a=!0)}return fl(n,t,e,i,r,o),a}function fl(n,t,e,i,s,r){const o=e.getGeometryFunction()(t);if(!o)return;const a=o.simplifyTransformed(i,s);if(e.getRenderer())Zs(n,a,e,t);else{const h=Us[a.getType()];h(n,a,e,t,r)}}function Zs(n,t,e,i){if(t.getType()=="GeometryCollection"){const r=t.getGeometries();for(let o=0,a=r.length;o<a;++o)Zs(n,r[o],e,i);return}n.getBuilder(e.getZIndex(),"Default").drawCustom(t,i,e.getRenderer(),e.getHitDetectionRenderer())}function _l(n,t,e,i,s){const r=t.getGeometriesArray();let o,a;for(o=0,a=r.length;o<a;++o){const l=Us[r[o].getType()];l(n,r[o],e,i,s)}}function ml(n,t,e,i,s){const r=e.getStroke();if(r){const a=n.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawLineString(t,i)}const o=e.getText();if(o&&o.getText()){const a=(s||n).getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,i)}}function yl(n,t,e,i,s){const r=e.getStroke();if(r){const a=n.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawMultiLineString(t,i)}const o=e.getText();if(o&&o.getText()){const a=(s||n).getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,i)}}function pl(n,t,e,i,s){const r=e.getFill(),o=e.getStroke();if(o||r){const l=n.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawMultiPolygon(t,i)}const a=e.getText();if(a&&a.getText()){const l=(s||n).getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,i)}}function xl(n,t,e,i,s){const r=e.getImage(),o=e.getText();let a;if(r){if(r.getImageState()!=N.LOADED)return;let l=n;if(s){const c=r.getDeclutterMode();if(c!=="none")if(l=s,c==="obstacle"){const u=n.getBuilder(e.getZIndex(),"Image");u.setImageStyle(r,a),u.drawPoint(t,i)}else o&&o.getText()&&(a={})}const h=l.getBuilder(e.getZIndex(),"Image");h.setImageStyle(r,a),h.drawPoint(t,i)}if(o&&o.getText()){let l=n;s&&(l=s);const h=l.getBuilder(e.getZIndex(),"Text");h.setTextStyle(o,a),h.drawText(t,i)}}function Sl(n,t,e,i,s){const r=e.getImage(),o=e.getText();let a;if(r){if(r.getImageState()!=N.LOADED)return;let l=n;if(s){const c=r.getDeclutterMode();if(c!=="none")if(l=s,c==="obstacle"){const u=n.getBuilder(e.getZIndex(),"Image");u.setImageStyle(r,a),u.drawMultiPoint(t,i)}else o&&o.getText()&&(a={})}const h=l.getBuilder(e.getZIndex(),"Image");h.setImageStyle(r,a),h.drawMultiPoint(t,i)}if(o&&o.getText()){let l=n;s&&(l=s);const h=l.getBuilder(e.getZIndex(),"Text");h.setTextStyle(o,a),h.drawText(t,i)}}function Rl(n,t,e,i,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=n.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawPolygon(t,i)}const a=e.getText();if(a&&a.getText()){const l=(s||n).getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,i)}}class Cl extends Ra{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Xt(),this.wrappedRenderedExtent_=Xt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const s=e.extent,r=e.viewState,o=r.center,a=r.resolution,l=r.projection,h=r.rotation,c=l.getExtent(),u=this.getLayer().getSource(),d=e.pixelRatio,g=e.viewHints,f=!(g[nt.ANIMATING]||g[nt.INTERACTING]),_=this.compositionContext_,m=Math.round(e.size[0]*d),y=Math.round(e.size[1]*d),p=u.getWrapX()&&l.canWrapX(),x=p?st(c):null,C=p?Math.ceil((s[2]-c[2])/x)+1:1;let R=p?Math.floor((s[0]-c[0])/x):0;do{const w=this.getRenderTransform(o,a,h,d,m,y,R*x);t.execute(_,1,w,h,f,void 0,i)}while(++R<C)}setupCompositionContext_(){if(this.opacity_!==1){const t=lt(this.context.canvas.width,this.context.canvas.height,Bn);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,Fr(this.compositionContext_),Bn.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const i=t.pixelRatio,s=t.layerStatesArray[t.layerIndex];So(this.pixelTransform,1/i,1/i),Ro(this.inversePixelTransform,this.pixelTransform);const r=Eo(this.pixelTransform);this.useContainer(e,r,this.getBackground(t));const o=this.context,a=o.canvas,l=this.replayGroup_,h=this.declutterExecutorGroup;let c=l&&!l.isEmpty()||h&&!h.isEmpty();if(!c&&!(this.getLayer().hasListener(Se.PRERENDER)||this.getLayer().hasListener(Se.POSTRENDER)))return null;const u=Math.round(t.size[0]*i),d=Math.round(t.size[1]*i);a.width!=u||a.height!=d?(a.width=u,a.height=d,a.style.transform!==r&&(a.style.transform=r)):this.containerReused||o.clearRect(0,0,u,d),this.preRender(o,t);const g=t.viewState;g.projection,this.opacity_=s.opacity,this.setupCompositionContext_();let f=!1;if(c&&s.extent&&this.clipping){const _=Jt(s.extent);c=at(_,t.extent),f=c&&!Ht(_,t.extent),f&&this.clipUnrotated(this.compositionContext_,t,_)}return c&&this.renderWorlds(l,t),f&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==g.rotation&&(this.renderedRotation_=g.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];K(this.pixelTransform,i);const s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=i[0]*ut,d=i[1]*ut;c.push(this.getRenderTransform(s,r,o,ut,u,d,0).slice());const g=h.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Ht(f,l)){let _=l[0];const m=st(f);let y=0,p;for(;_<f[0];)--y,p=m*y,c.push(this.getRenderTransform(s,r,o,ut,u,d,p).slice()),_+=m;for(y=0,_=l[2];_>f[2];)++y,p=m*y,c.push(this.getRenderTransform(s,r,o,ut,u,d,p).slice()),_-=m}this.hitDetectionImageData_=ll(i,c,this.renderedFeatures_,h.getStyleFunction(),l,r,o)}e(hl(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(g,f,_){const m=G(g),y=h[m];if(y){if(y!==!0&&_<y.distanceSq){if(_===0)return h[m]=!0,r.splice(r.lastIndexOf(y),1),s(g,l,f);y.geometry=f,y.distanceSq=_}}else{if(_===0)return h[m]=!0,s(g,l,f);r.push(h[m]={feature:g,layer:l,geometry:f,distanceSq:_,callback:s})}};let u;const d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some(g=>u=g.forEachFeatureAtCoordinate(t,o,a,i,c,g===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(f=>f.value):null)),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const s=t.viewHints[nt.ANIMATING],r=t.viewHints[nt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,g=e.getRevision(),f=e.getRenderBuffer();let _=e.getRenderOrder();_===void 0&&(_=ul);const m=h.center.slice(),y=ei(l,f*u),p=y.slice(),x=[y.slice()],C=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!Ht(C,t.extent)){const I=st(C),A=Math.max(st(y)/2,I);y[0]=C[0]-A,y[2]=C[2]+A,Kr(m,c);const M=xs(x[0],c);M[0]<C[0]&&M[2]<C[2]?x.push([M[0]+I,M[1],M[2]+I,M[3]]):M[0]>C[0]&&M[2]>C[2]&&x.push([M[0]-I,M[1],M[2]-I,M[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==_&&Ht(this.wrappedRenderedExtent_,y))return zt(this.renderedExtent_,p)||(this.hitDetectionImageData_=null,this.renderedExtent_=p),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const R=new Jn(vi(u,d),y,u,d);let w;this.getLayer().getDeclutter()&&(w=new Jn(vi(u,d),y,u,d));let L;for(let I=0,A=x.length;I<A;++I)i.loadFeatures(x[I],u,c);const T=dl(u,d);let v=!0;const F=I=>{let A;const M=I.getStyleFunction()||e.getStyleFunction();if(M&&(A=M(I,u)),A){const D=this.renderFeature(I,T,A,R,L,w);v=v&&!D}},W=Gi(y),P=i.getFeaturesInExtent(W);_&&P.sort(_);for(let I=0,A=P.length;I<A;++I)F(P[I]);this.renderedFeatures_=P,this.ready=v;const b=R.finish(),q=new ts(y,u,d,i.getOverlaps(),b,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new ts(y,u,d,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=u,this.renderedRevision_=g,this.renderedRenderOrder_=_,this.renderedExtent_=p,this.wrappedRenderedExtent_=y,this.renderedCenter_=m,this.renderedProjection_=c,this.replayGroup_=q,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,s,r,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,h=i.length;l<h;++l)a=es(s,t,i[l],e,this.boundHandleStyleImageChange_,r,o)||a;else a=es(s,t,i,e,this.boundHandleStyleImageChange_,r,o);return a}}const El=Cl;class Il extends Xa{constructor(t){super(t)}createRenderer(){return new El(this)}}const wl=Il,pt={SINGLECLICK:"singleclick",CLICK:U.CLICK,DBLCLICK:U.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},is={ACTIVE:"active"};class Tl extends Dt{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(is.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(is.ACTIVE,t)}setMap(t){this.map_=t}}const Ml=Tl;class Al extends Ml{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==pt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==pt.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==pt.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==pt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}const vl=Al,Ll=function(n){const t=n.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Fl=Rs,Dl=function(n){return n.type==pt.SINGLECLICK},Ol=function(n){const t=n.originalEvent;return B(t!==void 0,56),t.isPrimary&&t.button===0},ns=0,de=1,ss=[0,0,0,0],te=[],pi={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class xi extends se{constructor(t,e,i){super(t),this.features=e,this.mapBrowserEvent=i}}class bl extends vl{constructor(t){super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:Ol,this.defaultDeleteCondition_=function(i){return Ll(i)&&Dl(i)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:Fl,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new wi,this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new wl({source:new Wo({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:Pl(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let e;if(t.features?e=t.features:t.source&&(this.source_=t.source,e=new Ii(this.source_.getFeatures()),this.source_.addEventListener(Q.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Q.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!e)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(Mt.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(Mt.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=t.snapToPointer===void 0?!this.hitDetection_:t.snapToPointer}addFeature_(t){const e=t.getGeometry();if(e){const s=this.SEGMENT_WRITERS_[e.getType()];s&&s(t,e)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(U.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Ii;const i=this.featuresBeingModified_.getArray();for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0,l=o.length;a<l;++a){const h=o[a].feature;h&&!i.includes(h)&&this.featuresBeingModified_.push(h)}}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new xi(pi.MODIFYSTART,this.featuresBeingModified_,t))}}removeFeature_(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(U.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(t){const e=this.rBush_,i=[];e.forEach(function(s){t===s.feature&&i.push(s)});for(let s=i.length-1;s>=0;--s){const r=i[s];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);e.remove(r)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){const e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){const i=e.getCoordinates(),s={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),s)}writeMultiPointGeometry_(t,e){const i=e.getCoordinates();for(let s=0,r=i.length;s<r;++s){const o=i[s],a={feature:t,geometry:e,depth:[s],index:s,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}}writeLineStringGeometry_(t,e){const i=e.getCoordinates();for(let s=0,r=i.length-1;s<r;++s){const o=i.slice(s,s+2),a={feature:t,geometry:e,index:s,segment:o};this.rBush_.insert(_t(o),a)}}writeMultiLineStringGeometry_(t,e){const i=e.getCoordinates();for(let s=0,r=i.length;s<r;++s){const o=i[s];for(let a=0,l=o.length-1;a<l;++a){const h=o.slice(a,a+2),c={feature:t,geometry:e,depth:[s],index:a,segment:h};this.rBush_.insert(_t(h),c)}}}writePolygonGeometry_(t,e){const i=e.getCoordinates();for(let s=0,r=i.length;s<r;++s){const o=i[s];for(let a=0,l=o.length-1;a<l;++a){const h=o.slice(a,a+2),c={feature:t,geometry:e,depth:[s],index:a,segment:h};this.rBush_.insert(_t(h),c)}}}writeMultiPolygonGeometry_(t,e){const i=e.getCoordinates();for(let s=0,r=i.length;s<r;++s){const o=i[s];for(let a=0,l=o.length;a<l;++a){const h=o[a];for(let c=0,u=h.length-1;c<u;++c){const d=h.slice(c,c+2),g={feature:t,geometry:e,depth:[a,s],index:c,segment:d};this.rBush_.insert(_t(d),g)}}}}writeCircleGeometry_(t,e){const i=e.getCenter(),s={feature:t,geometry:e,index:ns,segment:[i,i]},r={feature:t,geometry:e,index:de,segment:[i,i]},o=[s,r];s.featureSegments=o,r.featureSegments=o,this.rBush_.insert(ze(i),s);let a=e;this.rBush_.insert(a.getExtent(),r)}writeGeometryCollectionGeometry_(t,e){const i=e.getGeometriesArray();for(let s=0;s<i.length;++s){const r=i[s],o=this.SEGMENT_WRITERS_[r.getType()];o(t,r)}}createOrUpdateVertexFeature_(t,e,i){let s=this.vertexFeature_;return s?s.getGeometry().setCoordinates(t):(s=new In(new Ei(t)),this.vertexFeature_=s,this.overlay_.getSource().addFeature(s)),s.set("features",e),s.set("geometries",i),s}handleEvent(t){if(!t.originalEvent)return!0;this.lastPointerEvent_=t;let e;return!t.map.getView().getInteracting()&&t.type==pt.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(t.type!=pt.SINGLECLICK||!this.ignoreNextSingleClick_?e=this.removePoint():e=!0),t.type==pt.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(t)&&!e}handleDragEvent(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);const e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],s=[];for(let r=0,o=this.dragSegments_.length;r<o;++r){const a=this.dragSegments_[r],l=a[0],h=l.feature;i.includes(h)||i.push(h);const c=l.geometry;s.includes(c)||s.push(c);const u=l.depth;let d;const g=l.segment,f=a[1];for(;e.length<c.getStride();)e.push(g[f][e.length]);switch(c.getType()){case"Point":d=e,g[0]=e,g[1]=e;break;case"MultiPoint":d=c.getCoordinates(),d[l.index]=e,g[0]=e,g[1]=e;break;case"LineString":d=c.getCoordinates(),d[l.index+f]=e,g[f]=e;break;case"MultiLineString":d=c.getCoordinates(),d[u[0]][l.index+f]=e,g[f]=e;break;case"Polygon":d=c.getCoordinates(),d[u[0]][l.index+f]=e,g[f]=e;break;case"MultiPolygon":d=c.getCoordinates(),d[u[1]][u[0]][l.index+f]=e,g[f]=e;break;case"Circle":if(g[0]=e,g[1]=e,l.index===ns)this.changingFeature_=!0,c.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0,t.map.getView().getProjection();let _=xn(V(c.getCenter()),V(e));c.setRadius(_),this.changingFeature_=!1}break}d&&this.setGeometryCoordinates_(c,d)}this.createOrUpdateVertexFeature_(e,i,s)}handleDownEvent(t){if(!this.condition_(t))return!1;const e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;const i=this.vertexFeature_;if(i){t.map.getView().getProjection();const s=[],r=i.getGeometry().getCoordinates(),o=_t([r]),a=this.rBush_.getInExtent(o),l={};a.sort(kl);for(let h=0,c=a.length;h<c;++h){const u=a[h],d=u.segment;let g=G(u.geometry);const f=u.depth;if(f&&(g+="-"+f.join("-")),l[g]||(l[g]=new Array(2)),u.geometry.getType()==="Circle"&&u.index===de){const _=os(e,u);ot(_,r)&&!l[g][0]&&(this.dragSegments_.push([u,0]),l[g][0]=u);continue}if(ot(d[0],r)&&!l[g][0]){this.dragSegments_.push([u,0]),l[g][0]=u;continue}if(ot(d[1],r)&&!l[g][1]){if(l[g][0]&&l[g][0].index===0){let _=u.geometry.getCoordinates();switch(u.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":_=_[f[1]];case"Polygon":if(u.index!==_[f[0]].length-2)continue;break}}this.dragSegments_.push([u,1]),l[g][1]=u;continue}G(d)in this.vertexSegments_&&!l[g][0]&&!l[g][1]&&this.insertVertexCondition_(t)&&s.push(u)}s.length&&this.willModifyFeatures_(t,[s]);for(let h=s.length-1;h>=0;--h)this.insertVertex_(s[h],r)}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){const i=this.dragSegments_[e][0],s=i.geometry;if(s.getType()==="Circle"){const r=s.getCenter(),o=i.featureSegments[0],a=i.featureSegments[1];o.segment[0]=r,o.segment[1]=r,a.segment[0]=r,a.segment[1]=r,this.rBush_.update(ze(r),o);let l=s;this.rBush_.update(l.getExtent(),a)}else this.rBush_.update(_t(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new xi(pi.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)}handlePointerAtPixel_(t,e,i){const s=i||e.getCoordinateFromPixel(t);e.getView().getProjection();const r=function(l,h){return rs(s,l)-rs(s,h)};let o,a;if(this.hitDetection_){const l=typeof this.hitDetection_=="object"?h=>h===this.hitDetection_:void 0;e.forEachFeatureAtPixel(t,(h,c,u)=>{u&&(u=new Ei(xe(u.getCoordinates())));const d=u||h.getGeometry();if(d.getType()==="Point"&&h instanceof In&&this.features_.getArray().includes(h)){a=d;const g=h.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:h,geometry:a,segment:[g,g]}]}return!0},{layerFilter:l})}if(!o){const l=Jt(ze(s,ss)),h=e.getView().getResolution()*this.pixelTolerance_,c=Gi(ei(l,h,ss));o=this.rBush_.getInExtent(c)}if(o&&o.length>0){const l=o.sort(r)[0],h=l.segment;let c=os(s,l);const u=e.getPixelFromCoordinate(c);let d=xn(t,u);if(a||d<=this.pixelTolerance_){const g={};if(g[G(h)]=!0,this.snapToPointer_||(this.delta_[0]=c[0]-s[0],this.delta_[1]=c[1]-s[1]),l.geometry.getType()==="Circle"&&l.index===de)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(c,[l.feature],[l.geometry]);else{const f=e.getPixelFromCoordinate(h[0]),_=e.getPixelFromCoordinate(h[1]),m=pe(u,f),y=pe(u,_);d=Math.sqrt(Math.min(m,y)),this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(c=m>y?h[1]:h[0]),this.createOrUpdateVertexFeature_(c,[l.feature],[l.geometry]);const p={};p[G(l.geometry)]=!0;for(let x=1,C=o.length;x<C;++x){const R=o[x].segment;if(ot(h[0],R[0])&&ot(h[1],R[1])||ot(h[0],R[1])&&ot(h[1],R[0])){const w=G(o[x].geometry);w in p||(p[w]=!0,g[G(R)]=!0)}else break}}this.vertexSegments_=g;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(t,e){const i=t.segment,s=t.feature,r=t.geometry,o=t.depth,a=t.index;let l;for(;e.length<r.getStride();)e.push(0);switch(r.getType()){case"MultiLineString":l=r.getCoordinates(),l[o[0]].splice(a+1,0,e);break;case"Polygon":l=r.getCoordinates(),l[o[0]].splice(a+1,0,e);break;case"MultiPolygon":l=r.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,e);break;case"LineString":l=r.getCoordinates(),l.splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(r,l);const h=this.rBush_;h.remove(t),this.updateSegmentIndices_(r,a,o,1);const c={segment:[i[0],e],feature:s,geometry:r,depth:o,index:a};h.insert(_t(c.segment),c),this.dragSegments_.push([c,1]);const u={segment:[e,i[1]],feature:s,geometry:r,depth:o,index:a+1};h.insert(_t(u.segment),u),this.dragSegments_.push([u,0]),this.ignoreNextSingleClick_=!0}removePoint(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=pt.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);const e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new xi(pi.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1}removeVertex_(){const t=this.dragSegments_,e={};let i=!1,s,r,o,a,l,h,c,u,d,g,f;for(l=t.length-1;l>=0;--l)o=t[l],g=o[0],f=G(g.feature),g.depth&&(f+="-"+g.depth.join("-")),f in e||(e[f]={}),o[1]===0?(e[f].right=g,e[f].index=g.index):o[1]==1&&(e[f].left=g,e[f].index=g.index+1);for(f in e){switch(d=e[f].right,c=e[f].left,h=e[f].index,u=h-1,c!==void 0?g=c:g=d,u<0&&(u=0),a=g.geometry,r=a.getCoordinates(),s=r,i=!1,a.getType()){case"MultiLineString":r[g.depth[0]].length>2&&(r[g.depth[0]].splice(h,1),i=!0);break;case"LineString":r.length>2&&(r.splice(h,1),i=!0);break;case"MultiPolygon":s=s[g.depth[1]];case"Polygon":s=s[g.depth[0]],s.length>4&&(h==s.length-1&&(h=0),s.splice(h,1),i=!0,h===0&&(s.pop(),s.push(s[0]),u=s.length-1));break}if(i){this.setGeometryCoordinates_(a,r);const _=[];if(c!==void 0&&(this.rBush_.remove(c),_.push(c.segment[0])),d!==void 0&&(this.rBush_.remove(d),_.push(d.segment[1])),c!==void 0&&d!==void 0){const m={depth:g.depth,feature:g.feature,geometry:g.geometry,index:u,segment:_};this.rBush_.insert(_t(m.segment),m)}this.updateSegmentIndices_(a,h,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return i}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,i,s){this.rBush_.forEachInExtent(t.getExtent(),function(r){r.geometry===t&&(i===void 0||r.depth===void 0||zt(r.depth,i))&&r.index>e&&(r.index+=s)})}}function kl(n,t){return n.index-t.index}function rs(n,t,e){const i=t.geometry;if(i.getType()==="Circle"){let r=i;if(t.index===de){const o=pe(r.getCenter(),V(n)),a=Math.sqrt(o)-r.getRadius();return a*a}}const s=V(n);return te[0]=V(t.segment[0]),te[1]=V(t.segment[1]),Zr(s,te)}function os(n,t,e){const i=t.geometry;if(i.getType()==="Circle"&&t.index===de)return xe(i.getClosestPoint(V(n)));const s=V(n);return te[0]=V(t.segment[0]),te[1]=V(t.segment[1]),xe(ws(s,te))}function Pl(){const n=Oa();return function(t,e){return n.Point}}const Vl=bl;export{Hi as C,we as F,Yl as L,Vl as M,Ei as P,zs as R,Ai as S,ka as T,Wo as V,Wl as _,zl as a,Xl as b,ue as c,wl as d,Jr as e,$r as f,Bl as g};