UNPKG

ol-cesium-vue-components

Version:

Vue components for OpenLayers and Cesium integration

3 lines 108 kB
(function(N,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("vue"),require("ol"),require("cesium")):typeof define=="function"&&define.amd?define(["exports","vue","ol","cesium"],w):(N=typeof globalThis<"u"?globalThis:N||self,w(N.VueWeatherMap={},N.Vue,N.ol,N.Cesium))})(this,function(N,w,Rt,Ai){"use strict";var No=Object.defineProperty;var Xo=(N,w,Rt)=>w in N?No(N,w,{enumerable:!0,configurable:!0,writable:!0,value:Rt}):N[w]=Rt;var Pi=(N,w,Rt)=>Xo(N,typeof w!="symbol"?w+"":w,Rt);function Fi(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const Oi=Fi(Ai),X={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function gn(i){const t=pt();for(let e=0,n=i.length;e<n;++e)Jt(t,i[e]);return t}function Li(i,t,e){const n=Math.min.apply(null,i),s=Math.min.apply(null,t),r=Math.max.apply(null,i),o=Math.max.apply(null,t);return vt(n,s,r,o,e)}function _n(i,t,e){let n,s;return t<i[0]?n=i[0]-t:i[2]<t?n=t-i[2]:n=0,e<i[1]?s=i[1]-e:i[3]<e?s=e-i[3]:s=0,n*n+s*s}function Ie(i,t){return mn(i,t[0],t[1])}function mn(i,t,e){return i[0]<=t&&t<=i[2]&&i[1]<=e&&e<=i[3]}function Rn(i,t){const e=i[0],n=i[1],s=i[2],r=i[3],o=t[0],a=t[1];let l=X.UNKNOWN;return o<e?l=l|X.LEFT:o>s&&(l=l|X.RIGHT),a<n?l=l|X.BELOW:a>r&&(l=l|X.ABOVE),l===X.UNKNOWN&&(l=X.INTERSECTING),l}function pt(){return[1/0,1/0,-1/0,-1/0]}function vt(i,t,e,n,s){return s?(s[0]=i,s[1]=t,s[2]=e,s[3]=n,s):[i,t,e,n]}function Qt(i){return vt(1/0,1/0,-1/0,-1/0,i)}function bi(i,t){const e=i[0],n=i[1];return vt(e,n,e,n,t)}function Ni(i,t,e,n,s){const r=Qt(s);return pn(r,i,t,e,n)}function Xi(i,t){return i[0]==t[0]&&i[2]==t[2]&&i[1]==t[1]&&i[3]==t[3]}function Gi(i,t){return t[0]<i[0]&&(i[0]=t[0]),t[2]>i[2]&&(i[2]=t[2]),t[1]<i[1]&&(i[1]=t[1]),t[3]>i[3]&&(i[3]=t[3]),i}function Jt(i,t){t[0]<i[0]&&(i[0]=t[0]),t[0]>i[2]&&(i[2]=t[0]),t[1]<i[1]&&(i[1]=t[1]),t[1]>i[3]&&(i[3]=t[1])}function pn(i,t,e,n,s){for(;e<n;e+=s)Di(i,t[e],t[e+1]);return i}function Di(i,t,e){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}function yn(i,t){let e;return e=t(te(i)),e||(e=t(ee(i)),e)||(e=t(ne(i)),e)||(e=t(yt(i)),e)?e:!1}function we(i){let t=0;return ie(i)||(t=P(i)*W(i)),t}function te(i){return[i[0],i[1]]}function ee(i){return[i[2],i[1]]}function Pt(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function zi(i,t){let e;if(t==="bottom-left")e=te(i);else if(t==="bottom-right")e=ee(i);else if(t==="top-left")e=yt(i);else if(t==="top-right")e=ne(i);else throw new Error("Invalid corner");return e}function ji(i,t,e,n,s){const[r,o,a,l,c,h,u,d]=En(i,t,e,n);return vt(Math.min(r,a,c,u),Math.min(o,l,h,d),Math.max(r,a,c,u),Math.max(o,l,h,d),s)}function En(i,t,e,n){const s=t*n[0]/2,r=t*n[1]/2,o=Math.cos(e),a=Math.sin(e),l=s*o,c=s*a,h=r*o,u=r*a,d=i[0],g=i[1];return[d-l+u,g-c-h,d-l-u,g-c+h,d+l-u,g+c+h,d+l+u,g+c-h,d-l+u,g-c-h]}function W(i){return i[3]-i[1]}function At(i,t,e){const n=e||pt();return Ut(i,t)?(i[0]>t[0]?n[0]=i[0]:n[0]=t[0],i[1]>t[1]?n[1]=i[1]:n[1]=t[1],i[2]<t[2]?n[2]=i[2]:n[2]=t[2],i[3]<t[3]?n[3]=i[3]:n[3]=t[3]):Qt(n),n}function yt(i){return[i[0],i[3]]}function ne(i){return[i[2],i[3]]}function P(i){return i[2]-i[0]}function Ut(i,t){return i[0]<=t[2]&&i[2]>=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function ie(i){return i[2]<i[0]||i[3]<i[1]}function Zi(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i}function Yi(i,t,e){let n=!1;const s=Rn(i,t),r=Rn(i,e);if(s===X.INTERSECTING||r===X.INTERSECTING)n=!0;else{const o=i[0],a=i[1],l=i[2],c=i[3],h=t[0],u=t[1],d=e[0],g=e[1],f=(g-u)/(d-h);let _,m;r&X.ABOVE&&!(s&X.ABOVE)&&(_=d-(g-c)/f,n=_>=o&&_<=l),!n&&r&X.RIGHT&&!(s&X.RIGHT)&&(m=g-(d-l)*f,n=m>=a&&m<=c),!n&&r&X.BELOW&&!(s&X.BELOW)&&(_=d-(g-a)/f,n=_>=o&&_<=l),!n&&r&X.LEFT&&!(s&X.LEFT)&&(m=g-(d-o)*f,n=m>=a&&m<=c)}return n}function Ui(i,t,e,n){if(ie(i))return Qt(e);let s=[];s=[i[0],i[1],i[2],i[1],i[2],i[3],i[0],i[3]],t(s,s,2);const r=[],o=[];for(let a=0,l=s.length;a<l;a+=2)r.push(s[a]),o.push(s[a+1]);return Li(r,o,e)}function Ki(i,t){const e=t.getExtent(),n=Pt(i);if(t.canWrapX()&&(n[0]<e[0]||n[0]>=e[2])){const s=P(e),o=Math.floor((n[0]-e[0])/s)*s;i[0]-=o,i[2]-=o}return i}function Wi(i,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(i[0])||!isFinite(i[2]))return[[n[0],i[1],n[2],i[3]]];Ki(i,t);const s=P(n);if(P(i)>s,i[0]<n[0])return[[i[0]+s,i[1],n[2],i[3]],[n[0],i[1],i[2],i[3]]];if(i[2]>n[2])return[[i[0],i[1],n[2],i[3]],[n[0],i[1],i[2]-s,i[3]]]}return[i]}class Tn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function G(i,t){if(!i)throw new Error(t)}class ki{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof Tn&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return G(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return G(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){var e;return(e=this.entries_[t])==null?void 0:e.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){G(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function Vi(...i){console.warn(...i)}function D(i,t,e){return Math.min(Math.max(i,t),e)}function Bi(i,t,e,n,s,r){const o=s-e,a=r-n;if(o!==0||a!==0){const l=((i-e)*o+(t-n)*a)/(o*o+a*a);l>1?(e=s,n=r):l>0&&(e+=o*l,n+=a*l)}return Ft(i,t,e,n)}function Ft(i,t,e,n){const s=e-i,r=n-t;return s*s+r*r}function $i(i){const t=i.length;for(let n=0;n<t;n++){let s=n,r=Math.abs(i[n][n]);for(let a=n+1;a<t;a++){const l=Math.abs(i[a][n]);l>r&&(r=l,s=a)}if(r===0)return null;const o=i[s];i[s]=i[n],i[n]=o;for(let a=n+1;a<t;a++){const l=-i[a][n]/i[n][n];for(let c=n;c<t+1;c++)n==c?i[a][c]=0:i[a][c]+=l*i[n][c]}}const e=new Array(t);for(let n=t-1;n>=0;n--){e[n]=i[n][t]/i[n][n];for(let s=n-1;s>=0;s--)i[s][t]-=i[s][n]*e[n]}return e}function xn(i){return i*180/Math.PI}function rt(i){return i*Math.PI/180}function Ot(i,t){const e=i%t;return e*t<0?e+t:e}function qi(i,t,e){return i+e*(t-i)}function Se(i,t){const e=Math.pow(10,t);return Math.round(i*e)/e}function se(i,t){return Math.floor(Se(i,t))}function re(i,t){return Math.ceil(Se(i,t))}function ve(i,t,e){if(i>=t&&i<e)return i;const n=e-t;return((i-t)%n+n)%n+t}function Hi(i,t){return i[0]+=+t[0],i[1]+=+t[1],i}function oe(i,t){let e=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=t[n]){e=!1;break}return e}function Qi(i,t){const e=Math.cos(t),n=Math.sin(t),s=i[0]*e-i[1]*n,r=i[1]*e+i[0]*n;return i[0]=s,i[1]=r,i}const Pe={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Ae{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_||Pe[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 Kt=6378137,Lt=Math.PI*Kt,Ji=[-Lt,-Lt,Lt,Lt],ts=[-180,-85,180,85],ae=Kt*Math.log(Math.tan(Math.PI/2));class bt extends Ae{constructor(t){super({code:t,units:"m",extent:Ji,global:!0,worldExtent:ts,getPointResolution:function(e,n){return e/Math.cosh(n[1]/Kt)}})}}const Cn=[new bt("EPSG:3857"),new bt("EPSG:102100"),new bt("EPSG:102113"),new bt("EPSG:900913"),new bt("http://www.opengis.net/def/crs/EPSG/0/3857"),new bt("http://www.opengis.net/gml/srs/epsg.xml#3857")];function es(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n){t[r]=Lt*i[r]/180;let o=Kt*Math.log(Math.tan(Math.PI*(+i[r+1]+90)/360));o>ae?o=ae:o<-ae&&(o=-ae),t[r+1]=o}return t}function ns(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n)t[r]=180*i[r]/Lt,t[r+1]=360*Math.atan(Math.exp(i[r+1]/Kt))/Math.PI-90;return t}const is=6378137,Mn=[-180,-90,180,90],ss=Math.PI*is/180;class Et extends Ae{constructor(t,e){super({code:t,units:"degrees",extent:Mn,axisOrientation:e,global:!0,metersPerUnit:ss,worldExtent:Mn})}}const In=[new Et("CRS:84"),new Et("EPSG:4326","neu"),new Et("urn:ogc:def:crs:OGC:1.3:CRS84"),new Et("urn:ogc:def:crs:OGC:2:84"),new Et("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Et("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Et("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Fe={};function rs(i){return Fe[i]||Fe[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function os(i,t){Fe[i]=t}function wn(i){for(const t in i)delete i[t]}function as(i){let t;for(t in i)return!1;return!t}let Nt={};function Wt(i,t,e){const n=i.getCode(),s=t.getCode();n in Nt||(Nt[n]={}),Nt[n][s]=e}function Oe(i,t){return i in Nt&&t in Nt[i]?Nt[i][t]:null}const le=.9996,k=.00669438,ce=k*k,he=ce*k,Tt=k/(1-k),Sn=Math.sqrt(1-k),Xt=(1-Sn)/(1+Sn),vn=Xt*Xt,Le=vn*Xt,be=Le*Xt,Pn=be*Xt,An=1-k/4-3*ce/64-5*he/256,ls=3*k/8+3*ce/32+45*he/1024,cs=15*ce/256+45*he/1024,hs=35*he/3072,us=3/2*Xt-27/32*Le+269/512*Pn,ds=21/16*vn-55/32*be,fs=151/96*Le-417/128*Pn,gs=1097/512*be,ue=6378137;function _s(i,t,e){const n=i-5e5,o=(e.north?t:t-1e7)/le/(ue*An),a=o+us*Math.sin(2*o)+ds*Math.sin(4*o)+fs*Math.sin(6*o)+gs*Math.sin(8*o),l=Math.sin(a),c=l*l,h=Math.cos(a),u=l/h,d=u*u,g=d*d,f=1-k*c,_=Math.sqrt(1-k*c),m=ue/_,y=(1-k)/f,R=Tt*h**2,T=R*R,E=n/(m*le),p=E*E,v=p*E,S=v*E,I=S*E,F=I*E,z=a-u/y*(p/2-S/24*(5+3*d+10*R-4*T-9*Tt))+F/720*(61+90*d+298*R+45*g-252*Tt-3*T);let j=(E-v/6*(1+2*d+R)+I/120*(5-2*R+28*d-3*T+8*Tt+24*g))/h;return j=ve(j+rt(Ln(e.number)),-Math.PI,Math.PI),[xn(j),xn(z)]}const Fn=-80,On=84,ms=-180,Rs=180;function ps(i,t,e){i=ve(i,ms,Rs),t<Fn?t=Fn:t>On&&(t=On);const n=rt(t),s=Math.sin(n),r=Math.cos(n),o=s/r,a=o*o,l=a*a,c=rt(i),h=Ln(e.number),u=rt(h),d=ue/Math.sqrt(1-k*s**2),g=Tt*r**2,f=r*ve(c-u,-Math.PI,Math.PI),_=f*f,m=_*f,y=m*f,R=y*f,T=R*f,E=ue*(An*n-ls*Math.sin(2*n)+cs*Math.sin(4*n)-hs*Math.sin(6*n)),p=le*d*(f+m/6*(1-a+g)+R/120*(5-18*a+l+72*g-58*Tt))+5e5;let v=le*(E+d*o*(_/2+y/24*(5-a+9*g+4*g**2)+T/720*(61-58*a+l+600*g-330*Tt)));return e.north||(v+=1e7),[p,v]}function Ln(i){return(i-1)*6-180+3}const ys=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function bn(i){let t=0;for(const s of ys){const r=i.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let e=0,n=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(n=!0,e=t-32600),e?{number:e,north:n}:null}function Nn(i,t){return function(e,n,s,r){const o=e.length;s=s>1?s:2,r=r??s,n||(s>2?n=e.slice():n=new Array(o));for(let a=0;a<o;a+=r){const l=e[a],c=e[a+1],h=i(l,c,t);n[a]=h[0],n[a+1]=h[1]}return n}}function Es(i){return bn(i)?new Ae({code:i,units:"m"}):null}function Ts(i){const t=bn(i.getCode());return t?{forward:Nn(ps,t),inverse:Nn(_s,t)}:null}const xs=63710088e-1;function Xn(i,t,e){e=e||xs;const n=rt(i[1]),s=rt(t[1]),r=(s-n)/2,o=rt(t[0]-i[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}const Cs=[Ts],Ms=[Es];let Ne=!0;function Is(i){Ne=!1}function Xe(i,t){if(t!==void 0){for(let e=0,n=i.length;e<n;++e)t[e]=i[e];t=t}else t=i.slice();return t}function Ge(i){os(i.getCode(),i),Wt(i,i,Xe)}function ws(i){i.forEach(Ge)}function K(i){if(typeof i!="string")return i;const t=rs(i);if(t)return t;for(const e of Ms){const n=e(i);if(n)return n}return null}function Gn(i,t,e,n){i=K(i);let s;const r=i.getPointResolutionFunc();if(r)s=r(t,e);else{const o=i.getUnits();if(o=="degrees"&&!n||n=="degrees")s=t;else{const a=je(i,K("EPSG:4326"));if(!a&&o!=="degrees")s=t*i.getMetersPerUnit();else{let c=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];c=a(c,c,2);const h=Xn(c.slice(0,2),c.slice(2,4)),u=Xn(c.slice(4,6),c.slice(6,8));s=(h+u)/2}const l=i.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function Dn(i){ws(i),i.forEach(function(t){i.forEach(function(e){t!==e&&Wt(t,e,Xe)})})}function Ss(i,t,e,n){i.forEach(function(s){t.forEach(function(r){Wt(s,r,e),Wt(r,s,n)})})}function De(i,t){return i?typeof i=="string"?K(i):i:K(t)}function vs(i){return function(t,e,n,s){const r=t.length;n=n!==void 0?n:2,s=s??n,e=e!==void 0?e:new Array(r);for(let o=0;o<r;o+=s){const a=i(t.slice(o,o+n)),l=a.length;for(let c=0,h=s;c<h;++c)e[o+c]=c>=l?t[o+c]:a[c]}return e}}function ze(i,t){if(i===t)return!0;const e=i.getUnits()===t.getUnits();return(i.getCode()===t.getCode()||je(i,t)===Xe)&&e}function je(i,t){const e=i.getCode(),n=t.getCode();let s=Oe(e,n);if(s)return s;let r=null,o=null;for(const l of Cs)r||(r=l(i)),o||(o=l(t));if(!r&&!o)return null;const a="EPSG:4326";if(o)if(r)s=Ze(r.inverse,o.forward);else{const l=Oe(e,a);l&&(s=Ze(l,o.forward))}else{const l=Oe(a,n);l&&(s=Ze(r.inverse,l))}return s&&(Ge(i),Ge(t),Wt(i,t,s)),s}function Ze(i,t){return function(e,n,s,r){return n=i(e,n,s,r),t(n,n,s,r)}}function kt(i,t){const e=K(i),n=K(t);return je(e,n)}function zn(i,t,e){const n=kt(t,e);if(!n){const s=K(t).getCode(),r=K(e).getCode();throw new Error(`No transform available between ${s} and ${r}`)}return n(i,void 0,i.length)}function Ps(i,t,e,n){const s=kt(t,e);return Ui(i,s,void 0)}function jn(i,t){return i}function ot(i,t){return Ne&&!oe(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(Ne=!1,Vi("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function As(i,t){return i}function xt(i,t){return i}function Fs(){Dn(Cn),Dn(In),Ss(In,Cn,es,ns)}Fs();function de(i,t,e,n){return n!==void 0?(n[0]=i,n[1]=t,n[2]=e,n):[i,t,e]}function Os(i,t,e){return i+"/"+t+"/"+e}function Ls(i){return bs(i[0],i[1],i[2])}function bs(i,t,e){return(t<<i)+e}function Ns(i,t){const e=i[0],n=i[1],s=i[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(n,s):!0}function Xs(i,t,e){return e===void 0&&(e=[0,0]),e[0]=i[0]*t+.5|0,e[1]=i[1]*t+.5|0,e}function at(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}class Ye{constructor(t,e,n,s){this.minX=t,this.maxX=e,this.minY=n,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function Gt(i,t,e,n,s){return s!==void 0?(s.minX=i,s.maxX=t,s.minY=e,s.maxY=n,s):new Ye(i,t,e,n)}function Ue(i,t){return i>t?1:i<t?-1:0}function Ke(i,t,e){if(i[0]<=t)return 0;const n=i.length;if(t<=i[n-1])return n-1;if(typeof e=="function"){for(let s=1;s<n;++s){const r=i[s];if(r===t)return s;if(r<t)return e(t,i[s-1],r)>0?s-1:s}return n-1}if(e>0){for(let s=1;s<n;++s)if(i[s]<t)return s-1;return n-1}if(e<0){for(let s=1;s<n;++s)if(i[s]<=t)return s;return n-1}for(let s=1;s<n;++s){if(i[s]==t)return s;if(i[s]<t)return i[s-1]-t<t-i[s]?s-1:s}return n-1}function Gs(i,t){const e=Array.isArray(t)?t:[t],n=e.length;for(let s=0;s<n;s++)i[i.length]=e[s]}function Zn(i,t){const e=i.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(i[n]!==t[n])return!1;return!0}function Ds(i,t,e){const n=t||Ue;return i.every(function(s,r){if(r===0)return!0;const o=n(i[r-1],s);return!(o>0||o===0)})}function zs(i,t,e,n,s){return!yn(s,function(o){return!Ct(i,t,e,n,o[0],o[1])})}function Ct(i,t,e,n,s,r){let o=0,a=i[e-n],l=i[e-n+1];for(;t<e;t+=n){const c=i[t],h=i[t+1];l<=r?h>r&&(c-a)*(r-l)-(s-a)*(h-l)>0&&o++:h<=r&&(c-a)*(r-l)-(s-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function Yn(i,t,e,n,s,r){if(e.length===0||!Ct(i,t,e[0],n,s,r))return!1;for(let o=1,a=e.length;o<a;++o)if(Ct(i,e[o-1],e[o],n,s,r))return!1;return!0}function js(i,t,e,n,s){let r;for(t+=n;t<e;t+=n)if(r=s(i.slice(t-n,t),i.slice(t,t+n)),r)return r;return!1}function Un(i,t,e,n,s,r){return r=r??pn(pt(),i,t,e,n),Ut(s,r)?r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:js(i,t,e,n,function(o,a){return Yi(s,o,a)}):!1}function Kn(i,t,e,n,s){return!!(Un(i,t,e,n,s)||Ct(i,t,e,n,s[0],s[1])||Ct(i,t,e,n,s[0],s[3])||Ct(i,t,e,n,s[2],s[1])||Ct(i,t,e,n,s[2],s[3]))}function Zs(i,t,e,n,s){if(!Kn(i,t,e[0],n,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r<o;++r)if(zs(i,e[r-1],e[r],n,s)&&!Un(i,e[r-1],e[r],n,s))return!1;return!0}const Ys=42,We=256,Dt=[0,0,0],lt=5;class Wn{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,G(Ds(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s<r;++s)if(!e)e=this.resolutions_[s]/this.resolutions_[s+1];else if(this.resolutions_[s]/this.resolutions_[s+1]!==e){e=void 0;break}}this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,G(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const n=t.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=yt(n)),G(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,G(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:We,G(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n!==void 0?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map((s,r)=>{const o=new Ye(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)n([e,r,a])}forEachTileCoordParentTileRange(t,e,n,s){let r,o,a,l=null,c=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=Gt(o,o,a,a,n)):r=this.getTileRangeForExtentAndZ(l,c,n),e(c,r))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const r=t[1]*2,o=t[2]*2;return Gt(r,r+1,o,o+1,e)}const s=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;const s=t[0],r=t[1],o=t[2];if(e===s)return Gt(r,o,r,o,n);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,e-s),c=Math.floor(r*l),h=Math.floor(o*l);if(e<s)return Gt(c,c,h,h,n);const u=Math.floor(l*(r+1))-1,d=Math.floor(l*(o+1))-1;return Gt(c,u,h,d,n)}const a=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Dt);const s=Dt[1],r=Dt[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Dt);const o=Dt[1],a=Dt[2];return Gt(s,o,r,a,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),n=this.getResolution(t[0]),s=at(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*s[0]*n,e[1]-(t[2]+.5)*s[1]*n]}getTileCoordExtent(t,e){const n=this.getOrigin(t[0]),s=this.getResolution(t[0]),r=at(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*r[0]*s,a=n[1]-(t[2]+1)*r[1]*s,l=o+r[0]*s,c=a+r[1]*s;return vt(o,a,l,c,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)}getTileCoordForXYAndResolution_(t,e,n,s,r){const o=this.getZForResolution(n),a=n/this.getResolution(o),l=this.getOrigin(o),c=at(this.getTileSize(o),this.tmpSize_);let h=a*(t-l[0])/n/c[0],u=a*(l[1]-e)/n/c[1];return s?(h=re(h,lt)-1,u=re(u,lt)-1):(h=se(h,lt),u=se(u,lt)),de(o,h,u,r)}getTileCoordForXYAndZ_(t,e,n,s,r){const o=this.getOrigin(n),a=this.getResolution(n),l=at(this.getTileSize(n),this.tmpSize_);let c=(t-o[0])/a/l[0],h=(o[1]-e)/a/l[1];return s?(c=re(c,lt)-1,h=re(h,lt)-1):(c=se(c,lt),h=se(h,lt)),de(n,c,h,r)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){const n=Ke(this.resolutions_,t,e||0);return D(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return Kn(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,n=new Array(e);for(let s=this.minZoom;s<e;++s)n[s]=this.getTileRangeForExtentAndZ(t,s);this.fullTileRanges_=n}}function kn(i){let t=i.getDefaultTileGrid();return t||(t=ks(i),i.setDefaultTileGrid(t)),t}function Us(i,t,e){const n=t[0],s=i.getTileCoordCenter(t),r=ke(e);if(!Ie(r,s)){const o=P(r),a=Math.ceil((r[0]-s[0])/o);return s[0]+=o*a,i.getTileCoordForCoordAndZ(s,n)}return t}function Ks(i,t,e,n){n=n!==void 0?n:"top-left";const s=Vn(i,t,e);return new Wn({extent:i,origin:zi(i,n),resolutions:s,tileSize:e})}function Ws(i){const t=i||{},e=t.extent||K("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:Vn(e,t.maxZoom,t.tileSize,t.maxResolution)};return new Wn(n)}function Vn(i,t,e,n){t=t!==void 0?t:Ys,e=at(e!==void 0?e:We);const s=W(i),r=P(i);n=n>0?n:Math.max(r/e[0],s/e[1]);const o=t+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=n/Math.pow(2,l);return a}function ks(i,t,e,n){const s=ke(i);return Ks(s,t,e,n)}function ke(i){i=K(i);let t=i.getExtent();if(!t){const e=180*Pe.degrees/i.getMetersPerUnit();t=vt(-e,-e,e,e)}return t}const Vs=/\{z\}/g,Bs=/\{x\}/g,$s=/\{y\}/g,qs=/\{-y\}/g;function Hs(i,t,e,n,s){return i.replace(Vs,t.toString()).replace(Bs,e.toString()).replace($s,n.toString()).replace(qs,function(){if(s===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()})}function Qs(i){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(i);if(e){const n=e[1].charCodeAt(0),s=e[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(i.replace(e[0],String.fromCharCode(r)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(i),e){const n=parseInt(e[2],10);for(let s=parseInt(e[1],10);s<=n;s++)t.push(i.replace(e[0],s.toString()));return t}return t.push(i),t}function Js(i,t){return function(e,n,s){if(!e)return;let r;const o=e[0];if(t){const a=t.getFullTileRange(o);a&&(r=a.getHeight()-1)}return Hs(i,o,e[1],e[2],r)}}function tr(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Js(i[s],t);return er(n)}function er(i){return i.length===1?i[0]:function(t,e,n){if(!t)return;const s=Ls(t),r=Ot(s,i.length);return i[r](t,e,n)}}const zt={IDLE:0,LOADED:2,ERROR:3},nt={CHANGE:"change",ERROR:"error",LOAD:"load"};function Ve(){}function nr(i){let t,e,n;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==n||!Zn(s,e))&&(n=this,e=s,t=i.apply(this,arguments)),t}}class fe{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Bn extends Tn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=e?new fe(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let c=0,h=s.length;c<h;++c)if("handleEvent"in s[c]?l=s[c].handleEvent(r):l=s[c].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[n]===0){let c=a[n];for(delete a[n];c--;)this.removeEventListener(n,Ve);delete o[n]}return l}disposeInternal(){this.listeners_&&wn(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=Ve,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}function Mt(i,t,e,n,s){if(s){const o=e;e=function(a){return i.removeEventListener(t,e),o.call(n??this,a)}}else n&&n!==i&&(e=e.bind(n));const r={target:i,type:t,listener:e};return i.addEventListener(t,e),r}function ge(i,t,e,n){return Mt(i,t,e,n,!0)}function ct(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),wn(i))}const It=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";It.includes("safari")&&!It.includes("chrom")&&(It.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(It)),It.includes("webkit")&&It.includes("edge"),It.includes("macintosh");const ir=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,sr=typeof Image<"u"&&Image.prototype.decode;(function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i})();function rr(i,t,e){const n=i;let s=!0,r=!1,o=!1;const a=[ge(n,nt.LOAD,function(){o=!0,r||t()})];return n.src&&sr?(r=!0,n.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(ge(n,nt.ERROR,e)),function(){s=!1,a.forEach(ct)}}const x={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function $n(i){return Math.pow(i,3)}function or(i){return 1-$n(1-i)}function ar(i){return 3*i*i-2*i*i*i}function A(){throw new Error("Unimplemented abstract method.")}let lr=0;function $(i){return i.ol_uid||(i.ol_uid=String(++lr))}class Be extends Bn{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(nt.CHANGE)}release(){this.setState(x.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==x.EMPTY){if(this.state!==x.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){A()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=e-n+1e3/60;return s>=this.transition_?1:$n(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}function ht(i,t,e,n){let s;return e&&e.length?s=e.shift():ir?s=new OffscreenCanvas(i||300,t||300):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let $e;function qn(){return $e||($e=ht(1,1)),$e}function qe(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}class Hn extends Be{constructor(t,e,n,s,r,o){super(t,e,o),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=x.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=x.ERROR,this.unlistenImage_(),this.image_=cr(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=x.LOADED:this.state=x.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==x.ERROR&&(this.state=x.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==x.IDLE&&(this.state=x.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=rr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function cr(){const i=ht(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}let He;const jt=[];function Qn(i,t,e,n,s){i.beginPath(),i.moveTo(0,0),i.lineTo(t,e),i.lineTo(n,s),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(t,n)+1,Math.max(e,s)),i.restore()}function Qe(i,t){return Math.abs(i[t*4]-210)>2||Math.abs(i[t*4+3]-.75*255)>2}function hr(){if(He===void 0){const i=ht(6,6,jt);i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",Qn(i,4,5,4,0),Qn(i,4,5,0,5);const t=i.getImageData(0,0,3,3).data;He=Qe(t,0)||Qe(t,4)||Qe(t,8),qe(i),jt.push(i.canvas)}return He}function Jn(i,t,e,n){const s=zn(e,t,i);let r=Gn(t,n,e);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=i.getMetersPerUnit();a!==void 0&&(r/=a);const l=i.getExtent();if(!l||Ie(l,s)){const c=Gn(i,r,s)/r;isFinite(c)&&c>0&&(r/=c)}return r}function ur(i,t,e,n){const s=Pt(e);let r=Jn(i,t,s,n);return(!isFinite(r)||r<=0)&&yn(e,function(o){return r=Jn(i,t,o,n),isFinite(r)&&r>0}),r}function dr(i,t,e,n,s,r,o,a,l,c,h,u,d,g){const f=ht(Math.round(e*i),Math.round(e*t),jt);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(e,e);function _(p){return Math.round(p*e)/e}f.globalCompositeOperation="lighter";const m=pt();l.forEach(function(p,v,S){Gi(m,p.extent)});let y;const R=e/n,T=(u?1:1+Math.pow(2,-24))/R;y=ht(Math.round(P(m)*R),Math.round(W(m)*R),jt),u||(y.imageSmoothingEnabled=!1),l.forEach(function(p,v,S){if(p.image.width>0&&p.image.height>0){if(p.clipExtent){y.save();const b=(p.clipExtent[0]-m[0])*R,C=-(p.clipExtent[3]-m[3])*R,Y=P(p.clipExtent)*R,Z=W(p.clipExtent)*R;y.rect(u?b:Math.round(b),u?C:Math.round(C),u?Y:Math.round(b+Y)-Math.round(b),u?Z:Math.round(C+Z)-Math.round(C)),y.clip()}const I=(p.extent[0]-m[0])*R,F=-(p.extent[3]-m[3])*R,z=P(p.extent)*R,j=W(p.extent)*R;y.drawImage(p.image,c,c,p.image.width-2*c,p.image.height-2*c,u?I:Math.round(I),u?F:Math.round(F),u?z:Math.round(I+z)-Math.round(I),u?j:Math.round(F+j)-Math.round(F)),p.clipExtent&&y.restore()}});const E=yt(o);return a.getTriangles().forEach(function(p,v,S){const I=p.source,F=p.target;let z=I[0][0],j=I[0][1],b=I[1][0],C=I[1][1],Y=I[2][0],Z=I[2][1];const it=_((F[0][0]-E[0])/r),dt=_(-(F[0][1]-E[1])/r),O=_((F[1][0]-E[0])/r),L=_(-(F[1][1]-E[1])/r),V=_((F[2][0]-E[0])/r),wt=_(-(F[2][1]-E[1])/r),Q=z,J=j;z=0,j=0,b-=Q,C-=J,Y-=Q,Z-=J;const st=[[b,C,0,0,O-it],[Y,Z,0,0,V-it],[0,0,b,C,L-dt],[0,0,Y,Z,wt-dt]],tt=$i(st);if(!tt)return;if(f.save(),f.beginPath(),hr()||!u){f.moveTo(O,L);const U=4,St=it-O,gt=dt-L;for(let et=0;et<U;et++)f.lineTo(O+_((et+1)*St/U),L+_(et*gt/(U-1))),et!=U-1&&f.lineTo(O+_((et+1)*St/U),L+_((et+1)*gt/(U-1)));f.lineTo(V,wt)}else f.moveTo(O,L),f.lineTo(it,dt),f.lineTo(V,wt);f.clip(),f.transform(tt[0],tt[2],tt[1],tt[3],it,dt),f.translate(m[0]-Q,m[3]-J);let ft;if(y)ft=y.canvas,f.scale(T,-T);else{const U=l[0],St=U.extent;ft=U.image,f.scale(P(St)/ft.width,-W(St)/ft.height)}f.drawImage(ft,0,0),f.restore()}),y&&(qe(y),jt.push(y.canvas)),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(p,v,S){const I=p.target,F=(I[0][0]-E[0])/r,z=-(I[0][1]-E[1])/r,j=(I[1][0]-E[0])/r,b=-(I[1][1]-E[1])/r,C=(I[2][0]-E[0])/r,Y=-(I[2][1]-E[1])/r;f.beginPath(),f.moveTo(j,b),f.lineTo(F,z),f.lineTo(C,Y),f.closePath(),f.stroke()}),f.restore()),f.canvas}new Array(6);function _e(){return[1,0,0,1,0,0]}function q(i,t){const e=t[0],n=t[1];return t[0]=i[0]*e+i[2]*n+i[4],t[1]=i[1]*e+i[3]*n+i[5],t}function me(i,t,e,n,s,r,o,a){const l=Math.sin(r),c=Math.cos(r);return i[0]=n*c,i[1]=s*l,i[2]=-n*l,i[3]=s*c,i[4]=o*n*c-a*n*l+t,i[5]=o*s*l+a*s*c+e,i}function fr(i,t){const e=gr(t);G(e!==0,"Transformation matrix cannot be inverted");const n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5];return i[0]=o/e,i[1]=-s/e,i[2]=-r/e,i[3]=n/e,i[4]=(r*l-o*a)/e,i[5]=-(n*l-s*a)/e,i}function gr(i){return i[0]*i[3]-i[1]*i[2]}const _r=[1e5,1e5,1e5,1e5,2,2];function mr(i){return"matrix("+i.join(", ")+")"}function ti(i){return i.substring(7,i.length-1).split(",").map(parseFloat)}function Rr(i,t){const e=ti(i),n=ti(t);for(let s=0;s<6;++s)if(Math.round((e[s]-n[s])*_r[s])!==0)return!1;return!0}const pr=10,ei=.25;class yr{constructor(t,e,n,s,r,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const c=a?vs(T=>q(a,zn(T,this.targetProj_,this.sourceProj_))):kt(this.targetProj_,this.sourceProj_);this.transformInv_=function(T){const E=T[0]+"/"+T[1];return l[E]||(l[E]=c(T)),l[E]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&P(s)>=P(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?P(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?P(this.targetProj_.getExtent()):null;const h=yt(n),u=ne(n),d=ee(n),g=te(n),f=this.transformInv_(h),_=this.transformInv_(u),m=this.transformInv_(d),y=this.transformInv_(g),R=pr+(o?Math.max(0,Math.ceil(Math.log2(we(n)/(o*o*256*256)))):0);if(this.addQuad_(h,u,d,g,f,_,m,y,R),this.wrapsXInSource_){let T=1/0;this.triangles_.forEach(function(E,p,v){T=Math.min(T,E.source[0][0],E.source[1][0],E.source[2][0])}),this.triangles_.forEach(E=>{if(Math.max(E.source[0][0],E.source[1][0],E.source[2][0])-T>this.sourceWorldWidth_/2){const p=[[E.source[0][0],E.source[0][1]],[E.source[1][0],E.source[1][1]],[E.source[2][0],E.source[2][1]]];p[0][0]-T>this.sourceWorldWidth_/2&&(p[0][0]-=this.sourceWorldWidth_),p[1][0]-T>this.sourceWorldWidth_/2&&(p[1][0]-=this.sourceWorldWidth_),p[2][0]-T>this.sourceWorldWidth_/2&&(p[2][0]-=this.sourceWorldWidth_);const v=Math.min(p[0][0],p[1][0],p[2][0]);Math.max(p[0][0],p[1][0],p[2][0])-v<this.sourceWorldWidth_/2&&(E.source=p)}})}l={}}addTriangle_(t,e,n,s,r,o){this.triangles_.push({source:[s,r,o],target:[t,e,n]})}addQuad_(t,e,n,s,r,o,a,l,c){const h=gn([r,o,a,l]),u=this.sourceWorldWidth_?P(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&u>.5&&u<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=gn([t,e,n,s]);f=P(m)/this.targetWorldWidth_>ei||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>ei||f)}if(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Ut(h,this.maxSourceExtent_))return;let _=0;if(!f&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)f=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(c>0){if(!f){const m=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(m);let R;g?R=(Ot(r[0],d)+Ot(a[0],d))/2-Ot(y[0],d):R=(r[0]+a[0])/2-y[0];const T=(r[1]+a[1])/2-y[1];f=R*R+T*T>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(e[0]+n[0])/2,(e[1]+n[1])/2],y=this.transformInv_(m),R=[(s[0]+t[0])/2,(s[1]+t[1])/2],T=this.transformInv_(R);this.addQuad_(t,e,m,R,r,o,y,T,c-1),this.addQuad_(R,m,n,s,T,y,a,l,c-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.transformInv_(m),R=[(n[0]+s[0])/2,(n[1]+s[1])/2],T=this.transformInv_(R);this.addQuad_(t,m,R,s,r,y,T,l,c-1),this.addQuad_(m,e,n,R,y,o,a,T,c-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(_&11)==0&&this.addTriangle_(t,n,s,r,a,l),(_&14)==0&&this.addTriangle_(t,n,e,r,a,o),_&&((_&13)==0&&this.addTriangle_(e,s,t,o,l,r),(_&7)==0&&this.addTriangle_(e,s,n,o,l,a))}calculateSourceExtent(){const t=pt();return this.triangles_.forEach(function(e,n,s){const r=e.source;Jt(t,r[0]),Jt(t,r[1]),Jt(t,r[2])}),t}getTriangles(){return this.triangles_}}const Er=.5;class ni extends Be{constructor(t,e,n,s,r,o,a,l,c,h,u,d){super(r,x.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const g=s.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let _=this.sourceTileGrid_.getExtent();const m=f?At(g,f):g;if(we(m)===0){this.state=x.EMPTY;return}const y=t.getExtent();y&&(_?_=At(_,y):_=y);const R=s.getResolution(this.wrappedTileCoord_[0]),T=ur(t,n,m,R);if(!isFinite(T)||T<=0){this.state=x.EMPTY;return}const E=h!==void 0?h:Er;if(this.triangulation_=new yr(t,n,m,_,T*E,R),this.triangulation_.getTriangles().length===0){this.state=x.EMPTY;return}this.sourceZ_=e.getZForResolution(T);let p=this.triangulation_.calculateSourceExtent();if(_&&(t.canWrapX()?(p[1]=D(p[1],_[1],_[3]),p[3]=D(p[3],_[1],_[3])):p=At(p,_)),!we(p))this.state=x.EMPTY;else{let v=0,S=0;t.canWrapX()&&(v=P(y),S=Math.floor((p[0]-y[0])/v)),Wi(p.slice(),t).forEach(F=>{const z=e.getTileRangeForExtentAndZ(F,this.sourceZ_);for(let j=z.minX;j<=z.maxX;j++)for(let b=z.minY;b<=z.maxY;b++){const C=c(this.sourceZ_,j,b,a);if(C){const Y=S*v;this.sourceTiles_.push({tile:C,offset:Y})}}++S}),this.sourceTiles_.length===0&&(this.state=x.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{var s;const n=e.tile;if(n&&n.getState()==x.LOADED){const r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=e.offset,r[2]+=e.offset;const o=(s=this.clipExtent_)==null?void 0:s.slice();o&&(o[0]+=e.offset,o[2]+=e.offset),t.push({extent:r,clipExtent:o,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=x.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=dr(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=x.LOADED}this.changed()}load(){if(this.state==x.IDLE){this.state=x.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==x.IDLE||n==x.LOADING){t++;const s=Mt(e,nt.CHANGE,r=>{const o=e.getState();(o==x.LOADED||o==x.ERROR||o==x.EMPTY)&&(ct(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},n,s){e.getState()==x.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(ct),this.sourcesListenerKeys_=null}release(){this.canvas_&&(qe(this.canvas_.getContext("2d")),jt.push(this.canvas_),this.canvas_=null),super.release()}}const Tr={PROPERTYCHANGE:"propertychange"};class Vt extends Bn{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(nt.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Mt(this,t[r],e);return s}return Mt(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const s=t.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=ge(this,t[r],e)}else n=ge(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)xr(n);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)}}Vt.prototype.on,Vt.prototype.once,Vt.prototype.un;function xr(i){if(Array.isArray(i))for(let t=0,e=i.length;t<e;++t)ct(i[t]);else ct(i)}class ii extends fe{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}class Re extends Vt{constructor(t){super(),this.on,this.once,this.un,$(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new ii(n,t,e)),n=Tr.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new ii(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const s=this.values_||(this.values_={});if(n)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],as(this.values_)&&(this.values_=null),e||this.notify(t,n)}}}class Cr extends Re{constructor(t){super(),this.projection=K(t.projection),this.attributions_=si(t.attributions),this.attributionsCollapsible_=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(n,s){e.viewResolver=n,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_=si(t),this.changed()}setState(t){this.state_=t,this.changed()}}function si(i){return i?typeof i=="function"?i:(Array.isArray(i)||(i=[i]),t=>i):null}class Mr extends Cr{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&at(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tmpSize=[0,0],this.key_=t.key||$(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,n,s,r){return A()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:kn(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const s=this.getTileGridForProjection(n),r=this.getTilePixelRatio(e),o=at(s.getTileSize(t),this.tmpSize);return r==1?o:Xs(o,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){const n=e!==void 0?e:this.getProjection(),s=e!==void 0?this.getTileGridForProjection(n):this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Us(s,t,n)),Ns(t,s)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class Ir extends fe{constructor(t,e){super(t),this.tile=e}}const Je={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class tn extends Mr{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===tn.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,n=$(e),s=e.getState();let r;s==x.LOADING?(this.tileLoadingKeys_[n]=!0,r=Je.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=s==x.ERROR?Je.TILELOADERROR:s==x.LOADED?Je.TILELOADEND:void 0),r!=null&&this.dispatchEvent(new Ir(r,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=Qs(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
`);this.generateTileUrlFunction_?this.setTileUrlFunction(tr(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,n){}}class wr extends tn{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Sr,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:Hn,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!ze(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||ze(e,t)))return this.tileGrid;const n=$(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=kn(t)),this.tileGridForProjection[n]}createTile_(t,e,n,s,r,o){const a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,r),c=l?this.tileUrlFunction(l,s,r):void 0,h=new this.tileClass(a,c!==void 0?x.IDLE:x.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(nt.CHANGE,this.handleTileChange.bind(this)),h}getTile(t,e,n,s,r){const o=this.getProjection();if(!o||!r||ze(o,r))return this.getTileInternal(t,e,n,s,o||r);const a=[t,e,n],l=this.getKey(),c=this.getTileGridForProjection(o),h=this.getTileGridForProjection(r),u=this.getTileCoordForTileUrlFunction(a,r),d=new ni(o,c,r,h,a,u,this.getTilePixelRatio(s),this.getGutter(),(g,f,_,m)=>this.getTileInternal(g,f,_,m,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(t,e,n,s,r){const o=this.getKey();return this.createTile_(t,e,n,s,r,o)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const n=K(t);if(n){const s=$(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function Sr(i,t){i.getImage().src=t}class vr extends wr{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",n=t.tileGrid!==void 0?t.tileGrid:Ws({extent:ke(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}function Pr(i,t,e,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l<e;l+=n){const c=i[l],h=i[l+1];r[a++]=s[0]*c+s[2]*h+s[4],r[a++]=s[1]*c+s[3]*h+s[5];for(let u=2;u<o;u++)r[a++]=i[l+u]}return r&&r.length!=a&&(r.length=a),r}function Ar(i,t,e,n,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),c=r[0],h=r[1];let u=0;for(let d=t;d<e;d+=n){const g=i[d]-c,f=i[d+1]-h;o[u++]=c+g*a-f*l,o[u++]=h+g*l+f*a;for(let _=d+2;_<d+n;++_)o[u++]=i[_]}return o&&o.length!=u&&(o.length=u),o}function Fr(i,t,e,n,s,r,o,a){a=a||[];const l=o[0],c=o[1];let h=0;for(let u=t;u<e;u+=n){const d=i[u]-l,g=i[u+1]-c;a[h++]=l+s*d,a[h++]=c+r*g;for(let f=u+2;f<u+n;++f)a[h++]=i[f]}return a&&a.length!=h&&(a.length=h),a}function Or(i,t,e,n,s,r,o){o=o||[];let a=0;for(let l=t;l<e;l+=n){o[a++]=i[l]+s,o[a++]=i[l+1]+r;for(let c=l+2;c<l+n;++c)o[a++]=i[c]}return o&&o.length!=a&&(o.length=a),o}const ri=_e(),Lr=[NaN,NaN];class br extends Re{constructor(){super(),this.extent_=pt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=nr((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return A()}closestPointXY(t,e,n,s){return A()}containsXY(t,e){return this.closestPointXY(t,e,Lr,Number.MIN_VALUE)===0}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 A()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Qt(e),this.extentRevision_=this.getRevision()}return Zi(this.extent_,t)}rotate(t,e){A()}scale(t,e,n){A()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return A()}getType(){return A()}applyTransform(t){A()}intersectsExtent(t){return A()}translate(t,e){A()}transform(t,e){const n=K(t),s=n.getUnits()=="tile-pixels"?function(r,o,a){const l=n.getExtent(),c=n.getWorldExtent(),h=W(c)/W(l);me(ri,c[0],c[3],h,-h,0,0,0);const u=Pr(r,0,r.length,a,ri,o),d=kt(n,e);return d?d(u,u,a):u}:kt(n,e);return this.applyTransform(s),this}}class en extends br{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return A()}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=oi(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){A()}setLayout(t,e,n){let s;if(t)s=oi(t);else{for(let r=0;r<n;++r){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}s=e.length,t=Nr(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();Ar(n,0,n.length,s,t,e,n),this.changed()}}scale(t,e,n){e===void 0&&(e=t),n||(n=Pt(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();Fr(s,0,s.length,r,t,e,n,s),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();Or(n,0,n.length,s,t,e,n),this.changed()}}}function Nr(i){let t;return i==2?t="XY":i==3?t="XYZ":i==4&&(t="XYZM"),t}function oi(i){let t;return i=="XY"?t=2:i=="XYZ"||i=="XYM"?t=3:i=="XYZM"&&(t=4),t}function Xr(i,t,e,n){for(let s=0,r=e.length;s<r;++s)i[t++]=e[s];return t}function ai(i,t,e,n){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0;a<n;++a)i[t++]=o[a]}return t}function Gr(i,t,e,n,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=ai(i,t,e[o],n);s[r++]=l,t=l}return s.length=r,s}class nn extends en{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new nn(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){const r=this.flatCoordinates,o=Ft(t,e,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)n[l]=r[l];return n.length=a,o}return s}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return bi(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return mn(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Xr(this.flatCoordinates,0,t,this.stride),this.changed()}}function Dr(i,t,e,n,s,r,o){let a,l,c,h,u,d,g;const f=s[r+1],_=[];for(let R=0,T=e.length;R<T;++R){const E=e[R];for(h=i[E-n],d=i[E-n+1],a=t;a<E;a+=n)u=i[a],g=i[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(c=(f-d)/(g-d)*(u-h)+h,_.push(c)),h=u,d=g}let m=NaN,y=-1/0;for(_.sort(Ue),h=_[0],a=1,l=_.length;a<l;++a){u=_[a];const R=Math.abs(u-h);R>y&&(c=(h+u)/2,Yn(i,t,e,n,c,f)&&(m=c,y=R)),h=u}return isNaN(m)&&(m=s[r]),[m,f,y]}function zr(i,t,e,n){for(;t<e-n;){for(let s=0;s<n;++s){const r=i[t+s];i[t+s]=i[e-n+s],i[e-n+s]=r}t+=n,e-=n}}function li(i,t,e,n){let s=0,r=i[e-n],o=i[e-n+1];for(;t<e;t+=n){const a=i[t],l=i[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function jr(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=li(i,t,a,n);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;t=a}return!0}function ci(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=li(i,t,a,n);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&zr(i,t,a,n),t=a}return t}function Zr(i,t,e,n,s,r,o){const a=(e-t)/n;if(a<3){for(;t<e;t+=n)r[o++]=i[t],r[o++]=i[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const c=[t,e-n];let h=0;for(;c.length>0;){const u=c.pop(),d=c.pop();let g=0;const f=i[d],_=i[d+1],m=i[u],y=i[u+1];for(let R=d+n;R<u;R+=n){const T=i[R],E=i[R+1],p=Bi(T,E,f,_,m,y);p>g&&(h=R,g=p)}g>s&&(l[(h-t)/n]=1,d+n<h&&c.push(d,h),h+n<u&&c.push(h,u))}for(let u=0;u<a;++u)l[u]&&(r[o++]=i[t+u*n],r[o++]=i[t+u*n+1]);return o}function Zt(i,t){return t*Math.round(i/t)}function Yr(i,t,e,n,s,r,o){if(t==e)return o;let a=Zt(i[t],s),l=Zt(i[t+1],s);t+=n,r[o++]=a,r[o++]=l;let c,h;do if(c=Zt(i[t],s),h=Zt(i[t+1],s),t+=n,t==e)return r[o++]=c,r[o++]=h,o;while(c==a&&h==l);for(;t<e;){const u=Zt(i[t],s),d=Zt(i[t+1],s);if(t+=n,u==c&&d==h)continue;const g=c-a,f=h-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)){c=u,h=d;continue}r[o++]=c,r[o++]=h,a=c,l=h,c=u,h=d}return r[o++]=c,r[o++]=h,o}function Ur(i,t,e,n,s,r,o,a){for(let l=0,c=e.length;l<c;++l){const h=e[l];o=Yr(i,t,h,n,s,r,o),a.push(o),t=h}return o}function hi(i,t,e,n){let s=0;const r=i[e-n],o=i[e-n+1];let a=0,l=0;for(;t<e;t+=n){const c=i[t]-r,h=i[t+1]-o;s+=l*c-a*h,a=c,l=h}return s/2}function Kr(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=hi(i,t,a,n),t=a}return s}function ui(i,t,e,n,s,r,o){const a=i[t],l=i[t+1],c=i[e]-a,h=i[e+1]-l;let u;if(c===0&&h===0)u=t;else{const d=((s-a)*c+(r-l)*h)/(c*c+h*h);if(d>1)u=e;else if(d>0){for(let g=0;g<n;++g)o[g]=qi(i[t+g],i[e+g],d);o.length=n;return}else u=t}for(let d=0;d<n;++d)o[d]=i[u+d];o.length=n}function di(i,t,e,n,s){let r=i[t],o=i[t+1];for(t+=n;t<e;t+=n){const a=i[t],l=i[t+1],c=Ft(r,o,a,l);c>s&&(s=c),r=a,o=l}return s}function Wr(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=di(i,t,a,n,s),t=a}return s}function fi(i,t,e,n,s,r,o,a,l,c,h){if(t==e)return c;let u,d;if(s===0){if(d=Ft(o,a,i[t],i[t+1]),d<c){for(u=0;u<n;++u)l[u]=i[t+u];return l.length=n,d}return c}h=h||[NaN,NaN];let g=t+n;for(;g<e;)if(ui(i,g-n,g,n,o,a,h),d=Ft(o,a,h[0],h[1]),d<c){for(c=d,u=0;u<n;++u)l[u]=h[u];l.length=n,g+=n}else g+=n*Math.max((Math.sqrt(d)-Math.sqrt(c))/s|0,1);if(ui(i,e-n,t,n,o,a,h),d=Ft(o,a,h[0],h[1]),d<c){for(c=d,u=0;u<n;++u)l[u]=h[u];l.length=n}return c}function kr(i,t,e,n,s,r,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const g=e[u];c=fi(i,t,g,n,s,r,o,a,l,c,h),t=g}return c}function gi(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<e;o+=n)s[r++]=i.slice(o,o+n);return s.length=r,s}function Vr(i,t,e,n,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++]=gi(i,t,l,n,s[r]),t=l}return s.length=r,s}class Bt extends en{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 Bt(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,s){return s<_n(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),fi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,s))}getArea(){return hi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return gi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Bt(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ai(this.flatCoordinates,0,t,this.stride),this.changed()}}class pe extends en{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Gs(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new pe(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<_n(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),kr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,s))}containsXY(t,e){return Yn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Kr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),ci(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Vr(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Pt(this.getExtent());this.flatInteriorPoint_=Dr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new nn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new Bt(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,n=this.ends_,s=[];let r=0;for(let o=0,a=n.length;o<a;++o){const l=n[o],c=new Bt(e.slice(r,l),t);s.push(c),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;jr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ci(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Ur(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new pe(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return Zs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=Gr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function _i(i){if(ie(i))throw new Error("Cannot create polygon from empty extent");const t=i[0],e=i[1],n=i[2],s=i[3],r=[t,e,t,s,n,s,n,e,t,e];return new pe(r,"XY",[r.length])}function sn(i){return i instanceof Image||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageBitmap?i:null}const Br=new Error("disposed"),$r=[256,256];class mi extends Be{constructor(t){const e=x.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=sn(this.data_);return t?[t.width,t.height]:$r}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==x.IDLE&&this.state!==x.ERROR)return;this.state=x.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=x.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=x.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(Br),this.controller_=null),super.disposeInternal()}}const ut={ANIMATING:0,INTERACTING:1},qr=[NaN,NaN,NaN,0];let rn;function Hr(){return rn||(rn=ht(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),rn}const Qr=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Jr=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,to=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,eo=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function ye(i,t){return i.endsWith("%")?Number(i.substring(0,i.length-1))/t:Number(i)}function $t(i){throw new Error('failed to parse "'+i+'" as color')}function Ri(i){if(i.toLowerCase().startsWith("rgb")){const r=i.match(Jr)||i.match(Qr)||i.match(to);if(r){const o=r[4],a=100/255;return[D(ye(r[1],a)+.5|0,0,255),D(ye(r[2],a)+.5|0,0,255),D(ye(r[3],a)+.5|0,0,255),o!==void 0?D(ye(o,100),0,1):1]}$t(i)}if(i.startsWith("#")){if(eo.test(i)){const r=i.substring(1),o=r.length<=4?1:2,a=[0,0,0,255];for(let l=0,c=r.length;l<c;l+=o){let h=parseInt(r.substring(l,l+o),16);o===1&&(h+=h<<4),a[l/o]=h}return a[3]=a[3]/255,a}$t(i)}const t=Hr();t.fillStyle="#abcdef";let e=t.fillStyle;t.fillStyle=i,t.fillStyle===e&&(t.fillStyle="#fedcba",e=t.fillStyle,t.fillStyle=i,t.fillStyle===e&&$t(i));const n=t.fillStyle;if(n.startsWith("#")||n.startsWith("rgba"))return Ri(n);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);const s=Array.from(t.getImageData(0,0,1,1).data);return s[3]=Se(s[3]/255,3),s}const no=1024,qt={};let on=0;function io(i){if(i==="none")return qr;if(qt.hasOwnProperty(i))return qt[i];if(on>=no){let e=0;for(const n in qt)(e++&3)===0&&(delete qt[n],--on)}const t=Ri(i);t.length!==4&&$t(i);for(const e of t)isNaN(e)&&$t(i);return qt[i]=t,++on,t}function pi(i){return Array.isArray(i)?i:io(i)}class so extends fe{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}const Ht={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose"};class ro{constructor(){Pi(this,"pushMethodArgs_",(...t)=>(this.push_(t),this));this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(qn(),{get:(t,e)=>{if(typeof qn()[e]=="function")return this.push_(e),this.pushMethodArgs_},set:(t,e,n)=>(this.push_(e,n),!0)})}push_(...t){const e=this.instructions_,n=this.zIndex+this.offset_;e[n]||(e[n]=[]),e[n].push(...t)}pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n<s;++n){const r=e[n];if(typeof r=="function"){r(t);continue}const o=e[++n];if(typeof t[r]=="function")t[r](...o);else{if(typeof o=="function"){t[r]=o(t);continue}t[r]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const oo=5;class ao extends Vt{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=oo}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return A()}getData(t){return null}prepareFrame(t){return A()}renderFrame(t,e){return A()}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===zt.LOADED||e.getState()===zt.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=zt.LOADED&&e!=zt.ERROR&&t.addEventListener(nt.CHANGE,this.boundHandleImageChange_),e==zt.IDLE&&(t.load(),e=t.getState()),e==zt.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}let Yt=null;function lo(){Yt=ht(1,1,void 0,{willReadFrequently:!0})}class co extends ao{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=_e(),this.pixelTransform=_e(),this.inversePixelTransform=_e(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,n){Yt||lo(),Yt.clearRect(0,0,1,1);let s;try{Yt.drawImage(t,e,n,1,1,0,0,1,1),s=Yt.getImageData(0,0,1,1).data}catch{return Yt=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const s=this.getLayer().getClassName();let r,o;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&Zn(pi(t.style.backgroundColor),pi(n)))){const a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&Rr(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=ht();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&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=yt(n),r=ne(n),o=ee(n),a=te(n);q(e.coordinateToPixelTransform,s),q(e.coordinateToPixelTransform,r),q(e.coordinateToPixelTransform,o),q(e.coordinateToPixelTransform,a);const l=this.inversePixelTransform;q(l,s),q(l,r),q(l,o),q(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()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,o=t.pixelRatio,a=Math.round(P(n)/s*o),l=Math.round(W(n)/s*o);me(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,r,-a/2,-l/2),fr(this.inversePixelTransform,this.pixelTransform);const c=mr(this.pixelTransform);if(this.useContainer(e,c,this.getBackground(t)),!this.containerReused){const h=this.context.canvas;h.width!=a||h.height!=l?(h.width=a,h.height=l):this.context.clearRect(0,0,a,l),c!==h.style.transform&&(h.style.transform=c)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new so(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(Ht.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Ht.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new ro),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Ht.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Ht.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,s,r,o,a){const l=r/2,c=o/2,h=s/e,u=-h,d=-t[0]+a,g=-t[1];return me(this.tempTransform,l,c,h,u,-n,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const H={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function yi(i,t,e){return function(n,s,r,o,a){if(!n)return;if(!s&&!t)return n;const l=t?0:r[0]*s,c=t?0:r[1]*s,h=a?a[0]:0,u=a?a[1]:0;let d=i[0]+l/2+h,g=i[2]-l/2+h,f=i[1]+c/2+u,_=i[3]-c/2+u;d>g&&(d=(g+d)/2,g=d),f>_&&(f=(_+f)/2,_=f);let m=D(n[0],d,g),y=D(n[1],f,_);if(o&&e&&s){const R=30*s;m+=-R*Math.log(1+Math.max(0,d-n[0])/R)+R*Math.log(1+Math.max(0,n[0]-g)/R),y+=-R*Math.log(1+Math.max(0,f-n[1])/R)+R*Math.log(1+Math.max(0,n[1]-_)/R)}return[m,y]}}function ho(i){return i}function an(i,t,e,n){const s=P(t)/e[0],r=W(t)/e[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function ln(i,t,e){let n=Math.min(i,t);const s=50;return n*=Math.log(1+s*Math.max(0,i/t-1))/s+1,e&&(n=Math.max(n,e),n/=Math.log(1+s*Math.max(0,e/i-1))/s+1),D(n,e/2,t*2)}function uo(i,t,e,n){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=i[0],c=i[i.length-1],h=e?an(l,e,o,n):l;if(a)return t?ln(s,h,c):D(s,c,h);const u=Math.min(h,s),d=Math.floor(Ke(i,u,r));return i[d]>h&&d<i.length-1?i[d+1]:i[d]}}}function fo(i,t,e,n,s,r){return n=n!==void 0?n:!0,e=e!==void 0?e:0,function(o,a,l,c){if(o!==void 0){const h=s?an(t,s,l,r):t;if(c)return n?ln(o,h,e):D(o,e,h);const u=1e-9,d=Math.ceil(Math.log(t/h)/Math.log(i)-u),g=-a*(.5-u)+.5,f=Math.min(h,o),_=Math.floor(Math.log(t/f)/Math.log(i)+g),m=Math.max(d,_),y=t/Math.pow(i,m);return D(y,e,h)}}}function Ei(i,t,e,n,s){return e=e!==void 0?e:!0,function(r,o,a,l){if(r!==void 0){const c=n?an(i,n,a,s):i;return!e||!l?D(r,t,c):ln(r,c,t)}}}function go(i){if(i!==void 0)return 0}function Ti(i){if(i!==void 0)return i}function _o(i){const t=2*Math.PI/i;return function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function mo(i){const t=rt(5);return function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e}}const cn=0;class xi extends Re{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=De(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&&Is(),t.center&&(t.center=ot(t.center,this.projection_)),t.extent&&(t.extent=xt(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const a in H)delete e[a];this.setProperties(e,!0);const n=po(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const s=Ro(t),r=n.constraint,o=yo(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 n=this.getCenterInternal();if(n){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([n[0]+o,n[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 n=0;n<e.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=ot(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=ot(s.anchor,this.getProjection())),e[n]=s}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,n;e>1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let s=0;for(;s<e&&!this.isDef();++s){const h=arguments[s];h.center&&this.setCenterInternal(h.center),h.zoom!==void 0?this.setZoom(h.zoom):h.resolution&&this.setResolution(h.resolution),h.rotation!==void 0&&this.setRotation(h.rotation)}if(s===e){n&&Ee(n,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const c=[];for(;s<e;++s){const h=arguments[s],u={start:r,complete:!1,anchor:h.anchor,duration:h.duration!==void 0?h.duration:1e3,easing:h.easing||ar,callback:n};if(h.center&&(u.sourceCenter=o,u.targetCenter=h.center.slice(),o=u.targetCenter),h.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(h.zoom),a=u.targetResolution):h.resolution&&(u.sourceResolution=a,u.targetResolution=h.resolution,a=u.targetResolution),h.rotation!==void 0){u.sourceRotation=l;const d=Ot(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}Eo(u)?u.complete=!0:r+=u.duration,c.push(u)}this.animations_.push(c),this.setHint(ut.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[ut.ANIMATING]>0}getInteracting(){return this.hints_[ut.INTERACTING]>0}cancelAnimations(){this.setHint(ut.ANIMATING,-this.hints_[ut.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e<n;++e){const s=this.animations_[e];if(s[0].callback&&Ee(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 n=this.animations_.length-1;n>=0;--n){const s=this.animations_[n];let r=!0;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(l.complete)continue;const c=t-l.start;let h=l.duration>0?c/l.duration:1;h>=1?(l.complete=!0,h=1):r=!1;const u=l.easing(h);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?Ot(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_[n]=null,this.setHint(ut.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&Ee(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-e[0],s[1]-e[1]],Qi(n,t-this.getRotation()),Hi(n,e)),n}calculateCenterZoom(t,e){let n;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;n=[o,a]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],s=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*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&&jn(t,this.getProjection())}getCenterInternal(){return this.get(H.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 As(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();G(e,"The view center is not defined");const n=this.getResolution();G(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return G(s!==void 0,"The view rotation is not defined"),ji(e,n,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(H.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(xt(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=P(t)/e[0],s=W(t)/e[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(e/n)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(H.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/e;return function(o){return Math.log(n/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=hn(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,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,n,s;if(this.resolutions_){const r=Ke(this.resolutions_,t,1);e=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){var e;if((e=this.resolutions_)!=null&&e.length){if(this.resolutions_.length===1)return this.resolutions_[0];const n=D(Math.floor(t),0,this.resolutions_.length-2),s=this.resolutions_[n]/this.resolutions_[n+1];return this.resolutions_[n]/Math.pow(s,D(t-n,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(G(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){G(!ie(t),"Cannot fit empty extent provided as `geometry`");const s=xt(t,this.getProjection());n=_i(s)}else if(t.getType()==="Circle"){const s=xt(t.getExtent(),this.getProjection());n=_i(s),n.rotate(this.getRotation(),Pt(s))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=r.length;u<d;u+=o){const g=r[u]*n-r[u+1]*s,f=r[u]*s+r[u+1]*n;a=Math.min(a,g),l=Math.min(l,f),c=Math.max(c,g),h=Math.max(h,f)}return[a,l,c,h]}fitInternal(t,e){e=e||{};let n=e.size;n||(n=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,[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,r?0:1);const c=this.getRotation(),h=Math.sin(c),u=Math.cos(c),d=Pt(a);d[0]+=(s[1]-s[3])/2*l,d[1]+=(s[0]-s[2])/2*l;const g=d[0]*u-d[1]*h,f=d[1]*u+d[0]*h,_=this.getConstrainedCenter([g,f],l),m=e.callback?e.callback:Ve;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),Ee(m,!0))}centerOn(t,e,n){this.centerOnInternal(ot(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(hn(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,s){let r;const o=this.padding_;if(o&&t){const a=this.getViewportSizeMinusPadding_(-n),l=hn(t,s,[a[0]/2+o[3],a[1]/2+o[0]],e,n);r=[t[0]-l[0],t[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=jn(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&&ot(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,n);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=ot(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(s,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&ot(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 n=this.getAnimating()||this.getInteracting()||e,s=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,n),a=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(H.ROTATION)!==s&&this.set(H.ROTATION,s),this.get(H.RESOLUTION)!==o&&(this.set(H.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(H.CENTER)||!oe(this.get(H.CENTER),a))&&this.set(H.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,n){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}n=n||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==r||!this.getCenterInternal()||!oe(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:t,easing:or,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(ut.INTERACTING,1)}endInteraction(t,e,n){n=n&&ot(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(ut.INTERACTING,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function Ee(i,t){setTimeout(function(){i(t)},0)}function Ro(i){if(i.extent!==void 0){const e=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return yi(i.extent,i.constrainOnlyCenter,e)}const t=De(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,yi(e,!1,!1)}return ho}function po(i){let t,e,n,o=i.minZoom!==void 0?i.minZoom:cn,a=i.maxZoom!==void 0?i.maxZoom:28;const l=i.zoomFactor!==void 0?i.zoomFactor:2,c=i.multiWorld!==void 0?i.multiWorld:!1,h=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,u=i.showFullExtent!==void 0?i.showFullExtent:!1,d=De(i.projection,"EPSG:3857"),g=d.getExtent();let f=i.constrainOnlyCenter,_=i.extent;if(!c&&!_&&d.isGlobal()&&(f=!1,_=g),i.resolutions!==void 0){const m=i.resolutions;e=m[o],n=m[a]!==void 0?m[a]:m[m.length-1],i.constrainResolution?t=uo(m,h,!f&&_,u):t=Ei(e,n,h,!f&&_,u)}else{const y=(g?Math.max(P(g),W(g)):360*Pe.degrees/d.getMetersPerUnit())/We/Math.pow(2,cn),R=y/Math.pow(2,28-cn);e=i.maxResolution,e!==void 0?o=0:e=y/Math.pow(l,o),n=i.minResolution,n===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?n=e/Math.pow(l,a):n=y/Math.pow(l,a):n=R),a=o+Math.floor(Math.log(e/n)/Math.log(l)),n=e/Math.pow(l,a-o),i.constrainResolution?t=fo(l,e,n,h,!f&&_,u):t=Ei(e,n,h,!f&&_,u)}return{constraint:t,maxResolution:e,minResolution:n,minZoom:o,zoomFactor:l}}function yo(i){if(i.enableRotation!==void 0?i.enableRotation:!0){const e=i.constrainRotation;return e===void 0||e===!0?mo():e===!1?Ti:typeof e=="number"?_o(e):Ti}return go}function Eo(i){return!(i.sourceCenter&&i.targetCenter&&!oe(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function hn(i,t,e,n,s){const r=Math.cos(-s);let o=Math.sin(-s),a=i[0]*r-i[1]*o,l=i[1]*r+i[0]*o;a+=(t[0]/2-e[0])*n,l+=(e[1]-t[1]/2)*n,o=-o;const c=a*r-l*o,h=l*r+a*o;return[c,h]}const M={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 To extends Re{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[M.OPACITY]=t.opacity!==void 0?t.opacity:1,G(typeof e[M.OPACITY]=="number","Layer opacity must be a number"),e[M.VISIBLE]=t.visible!==void 0?t.visible:!0,e[M.Z_INDEX]=t.zIndex,e[M.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[M.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[M.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[M.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},n=this.getZIndex();return e.opacity=D(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,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 A()}getLayerStatesArray(t){return A()}getExtent(){return this.get(M.EXTENT)}getMaxResolution(){return this.get(M.MAX_RESOLUTION)}getMinResolution(){return this.get(M.MIN_RESOLUTION)}getMinZoom(){return this.get(M.MIN_ZOOM)}getMaxZoom(){return this.get(M.MAX_ZOOM)}getOpacity(){return this.get(M.OPACITY)}getSourceState(){return A()}getVisible(){return this.get(M.VISIBLE)}getZIndex(){return this.get(M.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(M.EXTENT,t)}setMaxResolution(t){this.set(M.MAX_RESOLUTION,t)}setMinResolution(t){this.set(M.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(M.MAX_ZOOM,t)}setMinZoom(t){this.set(M.MIN_ZOOM,t)}setOpacity(t){G(typeof t=="number","Layer opacity must be a number"),this.set(M.OPACITY,t)}setVisible(t){this.set(M.VISIBLE,t)}setZIndex(t){this.set(M.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}class xo extends To{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(M.SOURCE,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(M.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_&&(ct(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=Mt(t,nt.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0)),this.clearRenderer()),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 n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof xi?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;if(e.layerStatesArray){if(s=e.layerStatesArray.find(o=>o.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return Co(s,e.viewState)&&(!r||Ut(r,e.extent))}getAttributions(t){var r;if(!this.isVisible(t))return[];const e=(r=this.getSource())==null?void 0:r.getAttributions();if(!e)return[];const n=t instanceof xi?t.getViewStateAndExtent():t;let s=e(n);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(M.MAP,t)}getMapInternal(){return this.get(M.MAP)}setMap(t){this.mapPrecomposeKey_&&(ct(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(ct(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Mt(t,Ht.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=Mt(this,nt.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);G(!e.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(n)}setSource(t){this.set(M.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function Co(i,t){if(!i.visible)return!1;const e=t.resolution;if(e<i.minResolution||e>=i.maxResolution)return!1;const n=t.zoom;return n>i.minZoom&&n<=i.maxZoom}function un(i,t,e,n){return`${i},${Os(t,e,n)}`}function dn(i,t,e){if(!(e in i))return i[e]=new Set([t]),!0;const n=i[e],s=n.has(t);return s||n.add(t),!s}function Mo(i,t,e){const n=i[e];return n?n.delete(t):!1}function Ci(i,t){const e=i.layerStatesArray[i.layerIndex];e.extent&&(t=At(t,xt(e.extent,i.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(i.viewState.projection).getExtent();s&&(t=At(t,s))}return t}class Io extends co{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision_,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=pt(),this.tempTileRange_=new Ye(0,0,0,0),this.tempTileCoord_=de(0,0,0);const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new ki(n),this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,n,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=un(a.getKey(),t,e,n);let c;if(r.containsKey(l))c=r.get(l);else{if(c=a.getTile(t,e,n,s.pixelRatio,s.viewState.projection),!c)return null;r.set(l,c)}return c}getTile(t,e,n,s){const r=this.getOrCreateTile(t,e,n,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=q(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Ie(r,s))return null;const o=e.viewState,a=n.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(e.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(s,h),d=this.getTile(h,u[1],u[2],e);if(!d||d.getState()!==x.LOADED)continue;const g=l.getOrigin(h),f=at(l.getTileSize(h)),_=l.getResolution(h);let m;if(d instanceof Hn||d instanceof ni)m=d.getImage();else if(d instanceof mi){if(m=sn(d.getData()),!m)continue}else continue;const y=Math.floor(c*((s[0]-g[0])/_-u[1]*f[0])),R=Math.floor(c*((g[1]-s[1])/_-u[2]*f[1])),T=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(m,y+T,R+T)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const n=e.getRevision();return this.renderedRevision_?this.renderedRevision_!==n&&(this.renderedRevision_=n,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=n,!0}enqueueTiles(t,e,n,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=$(l);h in t.wantedTiles||(t.wantedTiles[h]={});const u=t.wantedTiles[h],d=a.getMapInternal(),g=Math.max(n-r,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),f=o.rotation,_=f?En(o.center,o.resolution,f,t.size):void 0;for(let m=n;m>=g;--m){const y=c.getTileRangeForExtentAndZ(e,m,this.tempTileRange_),R=c.getResolution(m);for(let T=y.minX;T<=y.maxX;++T)for(let E=y.minY;E<=y.maxY;++E){if(f&&!c.tileCoordIntersectsViewport([m,T,E],_))continue;const p=this.getTile(m,T,E,t);if(!p||!dn(s,p,m))continue;const S=p.getKey();if(u[S]=!0,p.getState()===x.IDLE&&!t.tileQueue.isKeyQueued(S)){const I=de(m,T,E,this.tempTileCoord_);t.tileQueue.enqueue([p,h,c.getTileCoordCenter(I),R])}}}}findStaleTile_(t,e){const n=this.tileCache_,s=t[0],r=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l<a.length;++l){const c=un(a[l],s,r,o);if(n.containsKey(c)){const h=n.peek(c);if(h.getState()===x.LOADED)return h.endTransition($(this)),dn(e,h,s),!0}}return!1}findAltTiles_(t,e,n,s){const r=t.getTileRangeForTileCoordAndZ(e,n,this.tempTileRange_);if(!r)return!1;let o=!0;const a=this.tileCache_,c=this.getLayer().getRenderSource().getKey();for(let h=r.minX;h<=r.maxX;++h)for(let u=r.minY;u<=r.maxY;++u){const d=un(c,n,h,u);let g=!1;if(a.containsKey(d)){const f=a.peek(d);f.getState()===x.LOADED&&(dn(s,f,n),g=!0)}g||(o=!1)}return o}renderFrame(t,e){this.renderComplete=!0;const n=t.layerStatesArray[t.layerIndex],s=t.viewState,r=s.projection,o=s.resolution,a=s.center,l=t.pixelRatio,c=this.getLayer(),h=c.getSource(),u=h.getTileGridForProjection(r),d=u.getZForResolution(o,h.zDirection),g=u.getResolution(d),f=h.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==f&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=f):this.renderedSourceKey_=f;let _=t.extent;const m=h.getTilePixelRatio(l);this.prepareContainer(t,e);const y=this.context.canvas.width,R=this.context.canvas.height,T=n.extent&&xt(n.extent);T&&(_=At(_,xt(n.extent)));const E=g*y/2/m,p=g*R/2/m,v=[a[0]-E,a[1]-p,a[0]+E,a[1]+p],S={};this.renderedTiles.length=0;const I=c.getPreload();if(t.nextExtent){const O=u.getZForResolution(s.nextResolution,h.zDirection),L=Ci(t,t.nextExtent);this.enqueueTiles(t,L,O,S,I)}const F=Ci(t,_);if(this.enqueueTiles(t,F,d,S,0),I>0&&setTimeout(()=>{this.enqueueTiles(t,F,d-1,S,I-1)},0),!(d in S))return this.container;const z=$(this),j=t.time;for(const O of S[d]){const L=O.getState();if(L===x.EMPTY)continue;const V=O.tileCoord;if(L===x.LOADED&&O.getAlpha(z,j)===1){O.endTransition(z);continue}if(L!==x.ERROR&&(this.renderComplete=!1),this.findStaleTile_(V,S)){Mo(S,O,d),t.animate=!0;continue}if(this.findAltTiles_(u,V,d+1,S))continue;const J=u.getMinZoom();for(let st=d-1;st>=J&&!this.findAltTiles_(u,V,st,S);--st);}const b=g/o*l/m,C=this.getRenderContext(t);me(this.tempTransform,y/2,R/2,b,b,0,-y/2,-R/2),n.extent&&this.clipUnrotated(C,t,T),h.getInterpolate()||(C.imageSmoothingEnabled=!1),this.preRender(C,t);const Y=Object.keys(S).map(Number);Y.sort(Ue);let Z;const it=[],dt=[];for(let O=Y.length-1;O>=0;--O){const L=Y[O],V=h.getTilePixelSize(L,l,r),Q=u.getResolution(L)/g,J=V[0]*Q*b,st=V[1]*Q*b,tt=u.getTileCoordForCoordAndZ(yt(v),L),ft=u.getTileCoordExtent(tt),U=q(this.tempTransform,[m*(ft[0]-v[0])/g,m*(v[3]-ft[3])/g]),St=m*h.getGutterForProjection(r);for(const gt of S[L]){if(gt.getState()!==x.LOADED)continue;const et=gt.tileCoord,wi=tt[1]-et[1],Oo=Math.round(U[0]-(wi-1)*J),Si=tt[2]-et[2],Lo=Math.round(U[1]-(Si-1)*st),_t=Math.round(U[0]-wi*J),mt=Math.round(U[1]-Si*st),xe=Oo-_t,Ce=Lo-mt,vi=Y.length===1;let fn=!1;Z=[_t,mt,_t+xe,mt,_t+xe,mt+Ce,_t,mt+Ce];for(let Me=0,bo=it.length;Me<bo;++Me)if(!vi&&L<dt[Me]){const B=it[Me];Ut([_t,mt,_t+xe,mt+Ce],[B[0],B[3],B[4],B[7]])&&(fn||(C.save(),fn=!0),C.beginPath(),C.moveTo(Z[0],Z[1]),C.lineTo(Z[2],Z[3]),C.lineTo(Z[4],Z[5]),C.lineTo(Z[6],Z[7]),C.moveTo(B[6],B[7]),C.lineTo(B[4],B[5]),C.lineTo(B[2],B[3]),C.lineTo(B[0],B[1]),C.clip())}it.push(Z),dt.push(L),this.drawTile(gt,t,_t,mt,xe,Ce,St,vi),fn&&C.restore(),this.renderedTiles.unshift(gt),this.updateUsedTiles(t.usedTiles,h,gt)}}if(this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Xi(this.renderedExtent_,v),this.renderedExtent_=v,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&C.restore(),C.imageSmoothingEnabled=!0,this.renderComplete){const O=(L,V)=>{const wt=$(h),Q=V.wantedTiles[wt],J=Q?Object.keys(Q).length:0;this.updateCacheSize(J),this.tileCache_.expireCache()};t.postRenderFunctions.push(O)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,n,s,r,o,a,l){let c;if(t instanceof mi){if(c=sn(t.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(t);if(!c)return;const h=this.getRenderContext(e),u=$(this),d=e.layerStatesArray[e.layerIndex],g=d.opacity*(l?t.getAlpha(u,e.time):1),f=g!==h.globalAlpha;f&&(h.save(),h.globalAlpha=g),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,n,s,r,o),f&&h.restore(),g!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const s=$(e);s in t||(t[s]={}),t[s][n.getKey()]=!0}}const Te={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class wo extends xo{constructor(t){t=t||{};const e=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Te.PRELOAD)}setPreload(t){this.set(Te.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Te.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Te.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class So extends wo{constructor(t){super(t)}createRenderer(){return new Io(this,{cacheSize:this.getCacheSize()})}}const vo=i=>new Rt.Map({target:i,layers:[new So({source:new vr({url:"https://webst01.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}"})})],view:new Rt.View({center:[0,0],zoom:2})}),Po=(i,t)=>{const e=new t({map:i}),n=e.getCesiumScene(),s=new Oi.UrlTemplateImageryProvider({url:"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"});return n.imageryLayers.removeAll(),n.imageryLayers.addImageryProvider(s),n.globe.maximumScreenSpaceError=3,n.globe.enableLighting=!0,n.fog.enabled=!1,n.skyAtmosphere.show=!0,e.setEnabled(!1),e},Ao={id:"map-container"},Mi=((i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e})(w.defineComponent({__name:"index",setup(i){const t=w.ref(!1),e=w.ref("3D");let n=null,s=null;const r=()=>{t.value=!t.value,t.value?(e.value="2D",s==null||s.setEnabled(!0)):(e.value="3D",s==null||s.setEnabled(!1))},o=()=>{const l=Ps([73.4977,18.1631,135.0953,53.5623],"EPSG:4326","EPSG:3857");n==null||n.getView().fit(l,{padding:[20,20,20,20],duration:1e3})};return w.onMounted(()=>{n=vo("map-container");const a=w.getCurrentInstance();a!=null&&a.proxy.$OLCesium&&(s=Po(n,a.proxy.$OLCesium)),o(),w.provide("map",n),w.provide("ol3d",s)}),(a,l)=>{const c=w.resolveComponent("el-button");return w.openBlock(),w.createElementBlock("div",Ao,[w.createVNode(c,{class:"ol-switch",onClick:l[0]||(l[0]=h=>r())},{default:w.withCtx(()=>[w.createTextVNode(w.toDisplayString(e.value),1)]),_:1}),w.createVNode(c,{class:"ol-location",onClick:o,icon:"Position"})])}}}),[["__scopeId","data-v-454a3460"]]),Ii=i=>{i.component("GlobeView",Mi)},Fo={install:Ii};N.GlobeView=Mi,N.default=Fo,N.install=Ii,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});