1import{K as t,X as i,C as e,l as o,a as r,M as n,Y as s,I as l,Z as h}from"./greativ-QBfb03oOUx7i8sJesDQ0JuLqqE6cQAJEC42pD78YK1s-DJIl6iVC.js";import{t as a,s as u}from"./greativ-XEZZeNk2FVu2aytwx140tVa5DMotwN1bKS4Cz9xl3h0-CJo0-XsD.js";import{a as c,b as g,c as d,h as m,w as p,I as _,R as T}from"./greativ-T8yxuQLkl7F0llxji50tgnFS7YUmZi9eHBowla9znYk-jy1DDJIX.js";import{a as F,n as x,j as f,g as z,d as R,B as S,E as j}from"./greativ-F5iuGK2PU_m7j5WHEqs1hDt-XkjQjLh96_PJT6xJYIg-CNO2v3p2.js";import{D as C,c as E,d as G}from"./greativ-Hn-eSsHX3u3wbgU1o_HVrPD7k5442AEWNy_67zWgLVw-O9cudnnf.js";import{c as v,e as P,f as b,m as Z}from"./greativ--dp9za5RRnzH-g4oWDfmA2cCjxeiyx706XJjgn9-dlI-BqwXq6Og.js";import{T as U}from"./greativ-4nfgq6xcU-1kEu7p2EYeLUJ8BRoPH8Ku3gmbqShPH0M-D0aW9BBo.js";import{S as y}from"./greativ-pTDA6evCed9ZigoJ6dcB4hijNd1422NK7SLmG_5Fcw8-BXMvmu_2.js";import"./greativ-u50BiAALzIACoCgIcFJhSB7sEwrRiLKEY_ra9t8WfmQ-BfctFkZx.js";import"./greativ-O_xu_xjQeqDF9WIcBCr_oZvbThaPTSw3cgUrMbuM7p8-DdyAqq93.js";import"./greativ-F6da_KeRMxtR74itX8hi6igekt6HoQ8HsCl8en0pB6I-D9bTDmXx.js";const A=[0,0,0];class w{constructor(i){let e;if(this.minZoom=void 0!==i.minZoom?i.minZoom:0,this.resolutions_=i.resolutions,F(x(this.resolutions_,((t,i)=>i-t)),"`resolutions` must be sorted in descending order"),!i.origins)for(let t=0,r=this.resolutions_.length-1;t<r;++t)if(e){if(this.resolutions_[t]/this.resolutions_[t+1]!==e){e=void 0;break}}else e=this.resolutions_[t]/this.resolutions_[t+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==i.origin?i.origin:null,this.origins_=null,void 0!==i.origins&&(this.origins_=i.origins,F(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const o=i.extent;void 0===o||this.origin_||this.origins_||(this.origin_=t(o)),F(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,void 0!==i.tileSizes&&(this.tileSizes_=i.tileSizes,F(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=void 0!==i.tileSize?i.tileSize:this.tileSizes_?null:C,F(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=void 0!==o?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==i.sizes?this.fullTileRanges_=i.sizes.map(((t,i)=>{const e=new c(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(o){const t=this.getTileRangeForExtentAndZ(o,i);e.minX=Math.max(t.minX,e.minX),e.maxX=Math.min(t.maxX,e.maxX),e.minY=Math.max(t.minY,e.minY),e.maxY=Math.min(t.maxY,e.maxY)}return e})):o&&this.calculateTileRanges_(o)}forEachTileCoord(t,i,e){const o=this.getTileRangeForExtentAndZ(t,i);for(let r=o.minX,n=o.maxX;r<=n;++r)for(let t=o.minY,s=o.maxY;t<=s;++t)e([i,r,t])}forEachTileCoordParentTileRange(t,i,e,o){let r,n,s,l=null,h=t[0]-1;for(2===this.zoomFactor_?(n=t[1],s=t[2]):l=this.getTileCoordExtent(t,o);h>=this.minZoom;){if(void 0!==n&&void 0!==s?(n=Math.floor(n/2),s=Math.floor(s/2),r=g(n,n,s,s,e)):r=this.getTileRangeForExtentAndZ(l,h,e),i(h,r))return!0;--h}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,i,e){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){const e=2*t[1],o=2*t[2];return g(e,e+1,o,o+1,i)}const o=this.getTileCoordExtent(t,e||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,i)}return null}getTileRangeForTileCoordAndZ(t,i,e){if(i>this.maxZoom||i<this.minZoom)return null;const o=t[0],r=t[1],n=t[2];if(i===o)return g(r,n,r,n,e);if(this.zoomFactor_){const t=Math.pow(this.zoomFactor_,i-o),s=Math.floor(r*t),l=Math.floor(n*t);if(i<o)return g(s,s,l,l,e);const h=Math.floor(t*(r+1))-1,a=Math.floor(t*(n+1))-1;return g(s,h,l,a,e)}const s=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,i,e)}getTileRangeForExtentAndZ(t,i,e){this.getTileCoordForXYAndZ_(t[0],t[3],i,!1,A);const o=A[1],r=A[2];this.getTileCoordForXYAndZ_(t[2],t[1],i,!0,A);return g(o,A[1],r,A[2],e)}getTileCoordCenter(t){const i=this.getOrigin(t[0]),e=this.getResolution(t[0]),o=a(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*o[0]*e,i[1]-(t[2]+.5)*o[1]*e]}getTileCoordExtent(t,e){const o=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=a(this.getTileSize(t[0]),this.tmpSize_),s=o[0]+t[1]*n[0]*r,l=o[1]-(t[2]+1)*n[1]*r,h=s+n[0]*r,u=l+n[1]*r;return i(s,l,h,u,e)}getTileCoordForCoordAndResolution(t,i,e){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,e)}
1getTileCoordForXYAndResolution_(t,i,e,o,r){const n=this.getZForResolution(e),s=e/this.getResolution(n),l=this.getOrigin(n),h=a(this.getTileSize(n),this.tmpSize_);let u=s*(t-l[0])/e/h[0],c=s*(l[1]-i)/e/h[1];return o?(u=P(u,5)-1,c=P(c,5)-1):(u=b(u,5),c=b(c,5)),d(n,u,c,r)}getTileCoordForXYAndZ_(t,i,e,o,r){const n=this.getOrigin(e),s=this.getResolution(e),l=a(this.getTileSize(e),this.tmpSize_);let h=(t-n[0])/s/l[0],u=(n[1]-i)/s/l[1];return o?(h=P(h,5)-1,u=P(u,5)-1):(h=b(h,5),u=b(u,5)),d(e,h,u,r)}getTileCoordForCoordAndZ(t,i,e){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,e)}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,i){const e=f(this.resolutions_,t,i||0);return v(e,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,i){return E(i,0,i.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const i=this.resolutions_.length,e=new Array(i);for(let o=this.minZoom;o<i;++o)e[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=e}}function X(t){let i=t.getDefaultTileGrid();return i||(i=function(t,i,e,o){const r=M(t);return function(t,i,e,o){o=void 0!==o?o:"top-left";const r=L(t,i,e);return new w({extent:t,origin:s(t,o),resolutions:r,tileSize:e})}(r,i,e,o)}(t),t.setDefaultTileGrid(i)),i}function L(t,i,e,n){i=void 0!==i?i:G,e=a(void 0!==e?e:C);const s=o(t),l=r(t);n=n>0?n:Math.max(l/e[0],s/e[1]);const h=i+1,u=new Array(h);for(let o=0;o<h;++o)u[o]=n/Math.pow(2,o);return u}function M(t){let o=(t=e(t)).getExtent();if(!o){const e=180*n.degrees/t.getMetersPerUnit();o=i(-e,-e,e,e)}return o}const D=/\{z\}/g,Y=/\{x\}/g,O=/\{y\}/g,k=/\{-y\}/g;function K(t,i){return function(e,o,r){if(!e)return;let n;const s=e[0];if(i){const t=i.getFullTileRange(s);t&&(n=t.getHeight()-1)}return function(t,i,e,o,r){return t.replace(D,i.toString()).replace(Y,e.toString()).replace(O,o.toString()).replace(k,(function(){if(void 0===r)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-o).toString()}))}(t,s,e[1],e[2],n)}}function I(t,i){const e=t.length,o=new Array(e);for(let r=0;r<e;++r)o[r]=K(t[r],i);return function(t){if(1===t.length)return t[0];return function(i,e,o){if(!i)return;const r=m(i),n=Z(r,t.length);return t[n](i,e,o)}}(o)}class H extends y{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_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;const i=[256,256];this.tileGrid&&a(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),i),this.tmpSize=[0,0],this.key_=t.key||z(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 i=t?this.getTileGridForProjection(t):this.tileGrid;return i?i.getResolutions():null}getTile(t,i,e,o,r){return R()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:X(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,i,e){const o=this.getTileGridForProjection(e),r=this.getTilePixelRatio(i),n=a(o.getTileSize(t),this.tmpSize);return 1==r?n:u(n,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,i){const e=void 0!==i?i:this.getProjection(),o=void 0!==i?this.getTileGridForProjection(e):this.tileGrid||this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=function(t,i,e){const o=i[0],n=t.getTileCoordCenter(i),s=M(e);if(!l(s,n)){const i=r(s),e=Math.ceil((s[0]-n[0])/i);return n[0]+=i*e,t.getTileCoordForCoordAndZ(n,o)}return i}(o,t,e)),p(t,o)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class q extends S{constructor(t,i){super(t),this.tile=i}}const B="tileloadstart",J="tileloadend",N="tileloaderror";class Q extends H{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===Q.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 i=t.target,e=z(i),o=i.getState();let r;o==U.LOADING?(this.tileLoadingKeys_[e]=!0,r=B):e in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[e],r=o==U.ERROR?N:o==U.LOADED?J:void 0),null!=r&&this.dispatchEvent(new q(r,i))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,i){this.tileUrlFunction=t,void 0!==i?this.setKey(i):this.changed()}setUrl(t){const i=function(t){const i=[];let e=/\{([a-z])-([a-z])\}/.exec(t);
1if(e){const o=e[1].charCodeAt(0),r=e[2].charCodeAt(0);let n;for(n=o;n<=r;++n)i.push(t.replace(e[0],String.fromCharCode(n)));return i}if(e=/\{(\d+)-(\d+)\}/.exec(t),e){const o=parseInt(e[2],10);for(let r=parseInt(e[1],10);r<=o;r++)i.push(t.replace(e[0],r.toString()));return i}return i.push(t),i}(t);this.urls=i,this.setUrls(i)}setUrls(t){this.urls=t;const i=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(I(t,this.tileGrid),i):this.setKey(i)}tileUrlFunction(t,i,e){}}class W extends Q{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:V,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:_,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!h(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const i=this.getProjection();if(this.tileGrid&&(!i||h(i,t)))return this.tileGrid;const e=z(t);return e in this.tileGridForProjection||(this.tileGridForProjection[e]=X(t)),this.tileGridForProjection[e]}createTile_(t,i,e,o,r,n){const s=[t,i,e],l=this.getTileCoordForTileUrlFunction(s,r),h=l?this.tileUrlFunction(l,o,r):void 0,a=new this.tileClass(s,void 0!==h?U.IDLE:U.EMPTY,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return a.key=n,a.addEventListener(j.CHANGE,this.handleTileChange.bind(this)),a}getTile(t,i,e,o,r){const n=this.getProjection();if(!n||!r||h(n,r))return this.getTileInternal(t,i,e,o,n||r);const s=[t,i,e],l=this.getKey(),a=this.getTileGridForProjection(n),u=this.getTileGridForProjection(r),c=this.getTileCoordForTileUrlFunction(s,r),g=new T(n,a,r,u,s,c,this.getTilePixelRatio(o),this.getGutter(),((t,i,e,o)=>this.getTileInternal(t,i,e,o,n)),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return g.key=l,g}getTileInternal(t,i,e,o,r){const n=this.getKey();return this.createTile_(t,i,e,o,r,n)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,i){const o=e(t);if(o){const t=z(o);t in this.tileGridForProjection||(this.tileGridForProjection[t]=i)}}}function V(t,i){t.getImage().src=i}class $ extends W{constructor(t){const i=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",o=void 0!==t.tileGrid?t.tileGrid:function(t){const i=t||{},o=i.extent||e("EPSG:3857").getExtent(),r={extent:o,minZoom:i.minZoom,tileSize:i.tileSize,resolutions:L(o,i.maxZoom,i.tileSize,i.maxResolution)};return new w(r)}({extent:M(i),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:i,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}}export{$ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.