PageSourceSearch

https://indoorequal.org/maplibre-gl-worker-dev.78c2356d.js

js indoorequal.org collected 2026-10-02 06:30:28 UTC 464,902 bytes, 3 lines download raw bytes

1function e(e,t,r,i){Object.defineProperty(e,t,{get:r,set:i,enumerable:!0,configurable:!0})}var t=globalThis,r={},i={},n=t.parcelRequire94c2;null==n&&((n=function(e){if(e in r)return r[e].exports;if(e in i){var t=i[e];delete i[e];var n={id:e,exports:{}};return r[e]=n,t.call(n.exports,n,n.exports),n.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){i[e]=t},t.parcelRequire94c2=n);var a=n.register;a("8gjpy",function(t,r){Object.defineProperty(t.exports,"__esModule",{value:!0,configurable:!0}),e(t.exports,"default",()=>b);var i=n("b1foO"),a=class{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(e,t,r){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=(0,i.C)(t,r);e._featureFilter=(0,i._n)(e.filter,`layers[${t.id}].filter`,r),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];for(let e of(this.familiesBySource={},(0,i.vn)(Object.values(this._layerConfigs),this.keyCache))){let t=e.map(e=>this._layers[e.id]),r=t[0];if(r.isHidden())continue;let i=r.source||"",n=this.familiesBySource[i];n||=this.familiesBySource[i]={};let a=r.sourceLayer||"_geojsonTileLayer",s=n[a];(s||=n[a]=[]).push(t)}}},s=class{constructor(e){let t={},r=[];for(let i in e){let n=e[i],a=t[i]={};for(let e in n){let t=n[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;let i={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};r.push(i),a[e]={rect:i,metrics:t.metrics}}}let{w:n,h:a}=(0,i.L)(r),s=new(0,i.Tt)({width:n||1,height:a||1});for(let r in e){let n=e[r];for(let e in n){let a=n[+e];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;let o=t[r][e].rect;i.Tt.copy(a.bitmap,s,{x:0,y:0},{x:o.x+1,y:o.y+1},a.bitmap)}}this.image=s,this.positions=t}};(0,i.in)("GlyphAtlas",s);var o=class{constructor(e){this.tileID=new(0,i._)(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,t,r,n,a){this.data=e,this.collisionBoxArray=new(0,i.Bt);let o=new(0,i.d)(Object.keys(e.layers).sort()),u=new(0,i.c)(this.tileID,this.promoteId);u.bucketLayerIDs=[];let h={},c={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:a},p=t.familiesBySource[this.source];for(let t in p){let n=e.layers[t];if(!n)continue;1===n.version&&(0,i.Rr)(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let a=o.encode(t),s=[];for(let e=0;e<n.length;e++){let r=n.feature(e),i=u.getId(r,t);s.push({feature:r,id:i,index:e,sourceLayerIndex:a})}for(let e of p[t]){let t=e[0];t.source!==this.source&&(0,i.Rr)(`layer.source = ${t.source} does not equal this.source = ${this.source}`),t.isHidden(this.zoom,!0)||(l(e,this.zoom,r),(h[t.id]=t.createBucket({index:u.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:a,sourceID:this.source})).populate(s,c,this.tileID.canonical),u.bucketLayerIDs.push(e.map(e=>e.id)))}}let f=(0,i.br)(c.glyphDependencies,e=>Object.keys(e).map(Number));for(let e of this.inFlightDependencies)e?.abort();this.inFlightDependencies=[];let d=Promise.resolve({});if(Object.keys(f).length){let e=new AbortController;this.inFlightDependencies.push(e),d=n.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},e)}let y=Object.keys(c.iconDependencies),m=Promise.resolve({});if(y.length){let e=new AbortController;this.inFlightDependencies.push(e),m=n.sendAsync({type:"GI",data:{icons:y,source:this.source,tileID:this.tileID,type:"icons"}},e)}
1let g=Object.keys(c.patternDependencies),x=Promise.resolve({});if(g.length){let e=new AbortController;this.inFlightDependencies.push(e),x=n.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},e)}let v=c.dashDependencies,b=Promise.resolve({});if(Object.keys(v).length){let e=new AbortController;this.inFlightDependencies.push(e),b=n.sendAsync({type:"GDA",data:{dashes:v}},e)}let[w,_,S,A]=await Promise.all([d,m,x,b]),k=new s(w),I=new(0,i.F)(_,S);for(let e in h){let t=h[e];t instanceof i.O?(l(t.layers,this.zoom,r),(0,i.n)({bucket:t,glyphMap:w,glyphPositions:k.positions,imageMap:_,imagePositions:I.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:c.subdivisionGranularity})):t.hasDependencies&&(t instanceof i.pt||t instanceof i.q||t instanceof i.W)&&(l(t.layers,this.zoom,r),t.addFeatures(c,this.tileID.canonical,I.patternPositions,A))}return{buckets:Object.values(h).filter(e=>!e.isEmpty()),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:k.image,imageAtlas:I,dashPositions:A,glyphMap:this.returnDependencies?w:null,iconMap:this.returnDependencies?_:null,glyphPositions:this.returnDependencies?k.positions:null}}};function l(e,t,r){let n=new(0,i.en)(t);for(let t of e)t.recalculate(n,r)}var u=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(e,t){this.loading[e]=t}finishLoading(e){delete this.loading[e]}abort(e){let t=this.loading[e];t?.abort&&(t.abort.abort(),delete this.loading[e])}getParsing(e){return this.parsing[e]}setParsing(e,t){this.parsing[e]=t}removeParsing(e){delete this.parsing[e]}markLoaded(e,t){this.loaded[e]=t}getLoaded(e){let t=this.loaded[e];if(t)return t}removeLoaded(e){delete this.loaded[e]}clearLoaded(){this.loaded={}}},h=class{constructor(e){this.start=`${e}#start`,this.end=`${e}#end`,this.measure=e,performance.mark(this.start)}finish(){performance.mark(this.end);let e=performance.getEntriesByName(this.measure);return 0===e.length&&(performance.measure(this.measure,this.start,this.end),e=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),e}},c=class{constructor(e,t,r,i,n){this.type=e,this.properties=r||{},this.extent=n,this.pointsArray=t,this.id=i}loadGeometry(){return this.pointsArray.map(e=>e.map(e=>new(0,i.Vi)(e.x,e.y)))}},p=class{constructor(e,t,r){this.version=2,this._myFeatures=e,this.name=t,this.length=e.length,this.extent=r}feature(e){return this._myFeatures[e]}},f=class{constructor(){this.layers={}}addLayer(e){this.layers[e.name]=e}},d=class{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.tileState=new u,this.overzoomedTileResultCache=new(0,i.o)(1e3)}loadVectorTile(e,t){try{return{vectorTile:"mlt"!==e.encoding?new(0,i.dt)(new(0,i.V)(t)):new(0,i.l)(t),rawData:t}}catch(s){let r=new Uint8Array(t),n=31===r[0]&&139===r[1],a=`Unable to parse the tile at ${e.request.url}, `;throw n?a+="please make sure the data is not gzipped and that you have configured the relevant header in the server":a+=`got error: ${(0,i.rr)(s).message}`,Error(a)}}async loadTile(e){let{uid:t,overzoomParameters:r}=e;r&&(e.request=r.overzoomRequest);let n=this._startRequestTiming(e),a=new o(e);this.tileState.startLoading(t,a);let s=new AbortController;a.abort=s;try{let o=await (0,i.En)(e.request,s);if(e.etag&&e.etag===o.etag)return this.tileState.finishLoading(t),this._getEtagUnmodifiedResult(o,n);let l=this.loadVectorTile(e,o.data);if(this.tileState.finishLoading(t),!l)return null;let{vectorTile:u,rawData:h}=l;r&&({vectorTile:u,rawData:h}=this._getOverzoomTile(e,u));let c=this._getExpiryData(o),p=this._finishRequestTiming(n);a.vectorTile=u,this.tileState.markLoaded(t,a);let f={rawData:h,cacheControl:c,resourceTiming:p};return this.tileState.setParsing(t,f),await this._parseWorkerTile(a,e)}catch(e){throw this.tileState.finishLoading(t),this.tileState.markLoaded(t,a),e}}_getEtagUnmodifiedResult(e,t){let r=this._getExpiryData(e),n=this._finishRequestTiming(t);return(0,i.ar)({etagUnmodified:!0},r,n)}async _parseWorkerTile(e,t){let r=this.tileState.getParsing(e.uid),n=await e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(r){let{rawData:a,cacheControl:s,resourceTiming:o}=r,l=t.overzoomParameters?"mvt":t.encoding;n=(0,i.ar)({rawTileData:a.slice(0),encoding:l},n,s,o),this.tileState.removeParsing(e.uid)}return n}
1_getExpiryData({expires:e,cacheControl:t,etag:r}){let i={};return e&&(i.expires=e),t&&(i.cacheControl=t),r&&(i.etag=r),i}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new h(e.request.url)}_finishRequestTiming(e){let t=e?.finish();return t?{resourceTiming:JSON.parse(JSON.stringify(t))}:{}}_getOverzoomTile(e,t){let{tileID:r,source:n,overzoomParameters:a}=e,{maxZoomTileID:s}=a,o=`${s.key}_${r.key}_${e.request?.url}`,l=this.overzoomedTileResultCache.get(o);if(l)return l;let u=new f,h=this.layerIndex.familiesBySource[n];for(let e in h){let n=t.layers[e];if(!n)continue;let a=function(e,t,r){let{extent:n}=e,a=Math.pow(2,r.z-t.z),s=(r.x-t.x*a)*n,o=(r.y-t.y*a)*n,l=[];for(let t=0;t<e.length;t++){let r=e.feature(t),u=r.loadGeometry();for(let e of u)for(let t of e)t.x=t.x*a-s,t.y=t.y*a-o;0!==(u=(0,i.i)(u,r.type,-128,-128,n+128,n+128)).length&&l.push(new c(r.type,u,r.properties,r.id,n))}return new p(l,e.name,n)}(n,s,r.canonical);a.length>0&&u.addLayer(a)}let d={vectorTile:u,rawData:(0,i.m)(u).buffer};return this.overzoomedTileResultCache.set(o,d),d}async reloadTile(e){let t=e.uid,r=this.tileState.getLoaded(t);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=e.showCollisionBoxes,await this._parseWorkerTile(r,e)}async abortTile(e){this.tileState.abort(e.uid)}async removeTile(e){this.tileState.removeLoaded(e.uid)}},y=class{constructor(){this.loaded={}}async loadTile(e){let{uid:t,encoding:r,rawImageData:n,redFactor:a,greenFactor:s,blueFactor:o,baseShift:l}=e,u=n.width+2,h=n.height+2,c=(0,i.pr)(n)?new(0,i.Et)({width:u,height:h},await (0,i.dr)(n,-1,-1,u,h)):n,p=new(0,i.yt)(t,c,r,a,s,o,l);return this.loaded||={},this.loaded[t]=p,p}removeTile(e){let t=this.loaded,r=e.uid;t?.[r]&&delete t[r]}},m=class{constructor(e,t,r,i=g){this.actor=e,this.layerIndex=t,this.availableImages=r,this.tileState=new u,this._createGeoJSONIndex=i}loadVectorTile(e){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:t,x:r,y:n}=e.tileID.canonical,a=this._geoJSONIndex.getTile(t,r,n);if(!a)return null;let s=new(0,i.p)(a.features,{version:2,extent:i.Hr});return{vectorTile:s,rawData:(0,i.m)(s,i.zn).buffer}}async loadTile(e){let{uid:t}=e,r=new o(e);r.abort=new AbortController;try{let i=this.loadVectorTile(e);if(!i)return null;let{vectorTile:n,rawData:a}=i;return r.vectorTile=n,this.tileState.markLoaded(t,r),this.tileState.setParsing(t,{rawData:a}),await this._parseWorkerTile(r,e)}catch(e){throw this.tileState.markLoaded(t,r),e}}async _parseWorkerTile(e,t){let r=this.tileState.getParsing(e.uid),n=await e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(r){let{rawData:t}=r;n=(0,i.ar)({rawTileData:t.slice(0),encoding:"mvt"},n),this.tileState.removeParsing(e.uid)}return n}async abortTile(e){this.tileState.abort(e.uid)}async removeTile(e){this.tileState.removeLoaded(e.uid)}async loadData(e){this._pendingRequest?.abort();let t=this._startRequestTiming(e);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(e,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let r={};return e.request&&(r.data=e.data),this._finishRequestTiming(t,e,r),r}catch(e){if(delete this._pendingRequest,!(0,i.Ln)(e))throw e;return{abandoned:!0}}}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new h(e.request.url)}_finishRequestTiming(e,t,r){let i=e?.finish();i&&(r.resourceTiming={[t.source]:JSON.parse(JSON.stringify(i))})}async reloadTile(e){let t=e.uid,r=this.tileState.getLoaded(t);return r?r.vectorTile?(r.showCollisionBoxes=e.showCollisionBoxes,await this._parseWorkerTile(r,e)):void 0:await this.loadTile(e)}async loadAndProcessGeoJSON(e,t){if(e.request&&(e.data=(await (0,i.Dn)(e.request,t)).data),e.data){e.data=this._filterGeoJSON(e.data,e.filter,e.source),this._geoJSONIndex=this._createGeoJSONIndex(e.data,e);return}if(e.dataDiff){this._geoJSONIndex??=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},e),this._geoJSONIndex.updateData(e.dataDiff,this._getFilterPredicate(e.filter,e.source));return}if(e.updateCluster&&this._geoJSONIndex.updateClusterOptions(e.geojsonVtOptions.cluster,x(e)),null==this._geoJSONIndex)throw Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}_filterGeoJSON(e,t,r){if("FeatureCollection"!==e.type)return e;let i=this._getFilterPredicate(t,r);return i?{type:"FeatureCollection",features:e.features.filter(e=>i(e))}:e}_getFilterPredicate(e,t){if("boolean"!=typeof e&&!e?.length)return;let r=(0,i.pn)(e,`sources.${t}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return e=>r.value.evaluate({zoom:0},e)}async removeSource(e){this._pendingRequest?.abort()}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getClusterChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getClusterLeaves(e.clusterId,e.limit,e.offset)}};function g(e,t){let r=(0,i.ar)(t.geojsonVtOptions||{},{updateable:!0,clusterOptions:x(t)});return new(0,i.G)(e,r)}function x({geojsonVtOptions:e,clusterProperties:t,source:r}){if(!t||!e.clusterOptions)return e.clusterOptions;let n={},a={},s={accumulated:null,zoom:0},o={properties:null},l=Object.keys(t);for(let e of l){let[s,o]=t[e],l=(0,i.pn)(o,`sources.${r}.clusterProperties.${e}[1]`),u=(0,i.pn)("string"==typeof s?[s,["accumulated"],["get",e]]:s,`sources.${r}.clusterProperties.${e}[0]`);n[e]=l.value,a[e]=u.value}return e.clusterOptions.map=e=>{o.properties=e;let t={};for(let e of l)t[e]=n[e].evaluate(s,o);return t},e.clusterOptions.reduce=(e,t)=>{for(let r of(o.properties=t,l))s.accumulated=e[r],e[r]=a[r].evaluate(s,o)},e.clusterOptions}async function v(e){if(e.endsWith(".mjs"))return void await import(e);let t=await fetch(e,{credentials:"same-origin"});if(!t.ok)throw Error(`Failed to load ${e}: ${t.status}`);let r=await t.text();if(/^[ \t]*(import|export)\s/m.test(r)){let e=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{await import(e)}finally{URL.revokeObjectURL(e)}return}globalThis.eval(r)}var b=class{constructor(e){this.self=e,this.actor=new(0,i.S)(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={}
1,this.globalStates=new Map,this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=i.Mn,this.self.removeProtocol=i.Pn,this.self.registerRTLTextPlugin=e=>{i.tn.setMethods(e)},this.self.makeRequest=i.An,this.actor.registerMessageHandler("LDT",(e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t)),this.actor.registerMessageHandler("RDT",async(e,t)=>{this._getDEMWorkerSource(e,t.source).removeTile(t)}),this.actor.registerMessageHandler("GCEZ",async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterExpansionZoom(t)),this.actor.registerMessageHandler("GCC",async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterChildren(t)),this.actor.registerMessageHandler("GCL",async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterLeaves(t)),this.actor.registerMessageHandler("LD",(e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t)),this.actor.registerMessageHandler("LT",(e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t)),this.actor.registerMessageHandler("RT",(e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t)),this.actor.registerMessageHandler("AT",(e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t)),this.actor.registerMessageHandler("RMT",(e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t)),this.actor.registerMessageHandler("RS",async(e,t)=>{if(!this.workerSources[e]?.[t.type]?.[t.source])return;let r=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==r.removeSource&&r.removeSource(t)}),this.actor.registerMessageHandler("RM",async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler("SR",async(e,t)=>{this.referrer=t}),this.actor.registerMessageHandler("SRPS",(e,t)=>this._syncRTLPluginState(e,t)),this.actor.registerMessageHandler("IS",async(e,t)=>{await v(t)}),this.actor.registerMessageHandler("SI",(e,t)=>this._setImages(e,t)),this.actor.registerMessageHandler("UL",async(e,t)=>{this._getLayerIndex(e).update(t.layers,t.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler("UGS",async(e,t)=>{let r=this._getGlobalState(e);for(let e in t)r[e]=t[e]}),this.actor.registerMessageHandler("SL",async(e,t)=>{this._getLayerIndex(e).replace(t,this._getGlobalState(e))})}_getGlobalState(e){let t=this.globalStates.get(e);return t||(t={},this.globalStates.set(e,t)),t}async _setImages(e,t){for(let r in this.availableImages[e]=t,this.workerSources[e]){let i=this.workerSources[e][r];for(let e in i)i[e].availableImages=t}}async _syncRTLPluginState(e,t){return await i.tn.syncState(t,v)}_getAvailableImages(e){let t=this.availableImages[e];return t||[]}_getLayerIndex(e){let t=this.layerIndexes[e];return t||(this.layerIndexes[e]=new a)}_getWorkerSource(e,t,r){if(this.workerSources[e]||={},this.workerSources[e][t]||={},!this.workerSources[e][t][r]){let i={sendAsync:(t,r)=>(t.targetMapId=e,this.actor.sendAsync(t,r))};switch(t){case"vector":this.workerSources[e][t][r]=new d(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new m(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](i,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||={},this.demWorkerSources[e][t]||=new y,this.demWorkerSources[e][t]}};(0,i.vr)(self)&&(self.worker=new b(self))}),a("b1foO",function(t,r){let i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,S,A,k;e(t.exports,"Vi",()=>ei),e(t.exports,"Hr",()=>ed),e(t.exports,"zn",()=>ey),e(t.exports,"rr",()=>em),e(t.exports,"ar",()=>ex),e(t.exports,"br",()=>ev),e(t.exports,"Rr",()=>e_),e(t.exports,"vr",()=>eA),e(t.exports,"pr",()=>ek),e(t.exports,"dr",()=>eT),e(t.exports,"Ln",()=>eF),e(t.exports,"Mn",()=>eB),e(t.exports,"Pn",()=>eC),e(t.exports,"An",()=>eR),e(t.exports,"Dn",()=>eN),e(t.exports,"En",()=>eU),e(t.exports,"pn",()=>iA),e(t.exports,"_n",()=>iO),e(t.exports,"vn",()=>ij),e(t.exports,"in",()=>nm),e(t.exports,"tn",()=>nP),e(t.exports,"en",()=>nF),e(t.exports,"Bt",()=>aw),e(t.exports,"Tt",()=>sV),e(t.exports,"Et",()=>sL),e(t.exports,"yt",()=>sG),e(t.exports,"pt",()=>ok),e(t.exports,"dt",()=>oB),e(t.exports,"q",()=>oU),e(t.exports,"G",()=>lI),e(t.exports,"W",()=>lF),e(t.exports,"V",()=>lW),e(t.exports,"L",()=>l7),e(t.exports,"F",()=>ue),e(t.exports,"O",()=>ud),e(t.exports,"C",()=>uw),e(t.exports,"S",()=>uA),e(t.exports,"_",()=>uT),e(t.exports,"p",()=>uB),e(t.exports,"m",()=>uC),e(t.exports,"d",()=>uR),e(t.exports,"l",()=>h2),e(t.exports,"c",()=>h3),e(t.exports,"o",()=>h4),e(t.exports,"i",()=>h8),e(t.exports,"n",()=>cm);var I,T,E,M,D,P,F,z,B,C,V,L,O,$,R,N,U,q,j,G,X,Y,Z,W,H=Object.create,K=Object.defineProperty,J=Object.getOwnPropertyDescriptor,Q=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty,er=(e,t)=>()=>(t||(e((t={exports:{}}
1).exports,t),e=null),t.exports);function ei(e,t){this.x=e,this.y=t}ei.prototype={clone(){return new ei(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this},_rotateAround(e,t){let r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:ei},ei.convert=function(e){if(e instanceof ei)return e;if(Array.isArray(e))return new ei(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new ei(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};var en="u">typeof Float32Array?Float32Array:Array;function ea(){var e=new en(3);return en!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function es(e,t,r){var i=new en(3);return i[0]=e,i[1]=t,i[2]=r,i}function eo(){var e=new en(4);return en!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function el(){var e=new en(2);return en!=Float32Array&&(e[0]=0,e[1]=0),e}function eu(e){var t=new en(2);return t[0]=e[0],t[1]=e[1],t}function eh(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function ec(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e}function ep(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}ea(),I=new en(4),en!=Float32Array&&(I[0]=0,I[1]=0,I[2]=0,I[3]=0),ea(),es(1,0,0),es(0,1,0),eo(),eo(),T=new en(9),en!=Float32Array&&(T[1]=0,T[2]=0,T[3]=0,T[5]=0,T[6]=0,T[7]=0),T[0]=1,T[4]=1,T[8]=1;var ef=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e};el();let ed=8192,ey="__$json__:";function em(e){return e instanceof Error?e:Error("string"==typeof e?e:String(e))}function eg(e,t,r){return Math.min(r,Math.max(t,e))}function ex(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function ev(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function eb(e){return Array.isArray(e)?e.map(eb):"object"==typeof e&&e?ev(e,eb):e}S=-.75,A=2.7-3*.1;let ew={};function e_(e){ew[e]||("u">typeof console&&console.warn(e),ew[e]=!0)}function eS(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function eA(e){return"u">typeof WorkerGlobalScope&&void 0!==e&&e instanceof WorkerGlobalScope}function ek(e){return"u">typeof ImageBitmap&&e instanceof ImageBitmap}async function eI(e,t,r,i,n){if("u"<typeof VideoFrame)throw Error("VideoFrame not supported");let a=new VideoFrame(e,{timestamp:0});try{let s,o,l,u,h=a?.format;if(!h||!(h.startsWith("BGR")||h.startsWith("RGB")))throw Error(`Unrecognized format ${h}`);let c=h.startsWith("BGR"),p=new Uint8ClampedArray(i*n*4);if(await a.copyTo(p,(s=(Math.max(0,r)-r)*i*4+4*Math.max(-t,0),o=Math.max(0,t),l=Math.max(0,r),u=Math.min(e.width,t+i),{rect:{x:o,y:l,width:u-o,height:Math.min(e.height,r+n)-l},layout:[{offset:s,stride:4*i}]})),c)for(let e=0;e<p.length;e+=4){let t=p[e];p[e]=p[e+2],p[e+2]=t}return p}finally{a.close()}}async function eT(e,t,r,o,l){let u,h,c;if(function(){if(null==n&&(n=!1,i??="u">typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap)){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let r=4*t;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){n=!0;break}}}return n||!1}())try{return await eI(e,t,r,o,l)}catch{}return u=e.width,h=e.height,a&&s||(s=(a=new OffscreenCanvas(u,h)).getContext("2d",{willReadFrequently:!0})),a.width=u,a.height=h,s.drawImage(e,0,0,u,h),c=s.getImageData(t,r,o,l),s.clearRect(0,0,u,h),c.data}function eE(e,t,r,i){return e.addEventListener(t,r,i),{unsubscribe:()=>{e.removeEventListener(t,r,i)}}}function eM(e){return e*Math.PI/180}let eD="AbortError";
1var eP=class extends Error{constructor(e=eD){super(e instanceof Error?e.message:e),this.name=eD,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function eF(e){return e instanceof Error&&"AbortError"===e.name}let ez={};function eB(e,t){ez[e]=t}function eC(e){delete ez[e]}let eV="global-dispatcher";var eL=class extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}};function eO(){if(eA(self))return self.worker?.referrer;if("blob:"===window.location.protocol)try{return window.parent.location.href}catch{}return window.location.href}async function e$(e,t){let r,i,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:eO(),referrerPolicy:e.referrerPolicy,signal:t.signal});"json"!==e.type||n.headers.has("Accept")||n.headers.set("Accept","application/json");try{r=await fetch(n)}catch(t){if(eF(t))throw t;throw new eL(0,em(t).message,e.url,new Blob)}if(!r.ok){let t=await r.blob();throw new eL(r.status,r.statusText,e.url,t)}i="arrayBuffer"===e.type||"image"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text();let a=await i;var s=t.signal;if(s.aborted)throw new eP(s.reason);return{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}}let eR=async function(e,t){var r;let i;if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let i=ez[(r=e.url).substring(0,r.indexOf("://"))];if(i){let r=await i(e,t);return r.data||"arrayBuffer"!==e.type?r:ex(r,{data:new ArrayBuffer(0)})}if(eA(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:eV},t)}if(!((i=e.url).startsWith("file:")||eO()?.startsWith("file:")&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return e$(e,t);if(eA(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:eV},t)}return new Promise((r,i)=>{let n=new XMLHttpRequest;for(let t in n.open(e.method||"GET",e.url,!0),("arrayBuffer"===e.type||"image"===e.type)&&(n.responseType="arraybuffer"),e.headers)n.setRequestHeader(t,e.headers[t]);"json"===e.type&&(n.responseType="text",e.headers?.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===e.credentials,n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!t.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let t=n.response;if("json"===e.type)try{t=JSON.parse(n.response)}catch(e){i(e);return}r({data:t,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new eL(n.status,n.statusText,e.url,t))}},t.signal.addEventListener("abort",()=>{n.abort(),i(new eP(t.signal.reason))}),n.send(e.body)})},eN=(e,t)=>eR(ex(e,{type:"json"}),t),eU=(e,t)=>eR(ex(e,{type:"arrayBuffer"}),t);function eq(e,t,r){r[e]?.includes(t)||(r[e]||=[],r[e].push(t))}function ej(e,t,r){if(r?.[e]){let i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}var eG=class{constructor(e,t={}){ex(this,t),this.type=e}},eX=class extends eG{constructor(e,t={}){super("error",ex({error:e},t))}},eY=class{on(e,t){return this._listeners||={},eq(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return ej(e,t,this._listeners),ej(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||={},eq(e,t,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,t){let r="string"==typeof e?new eG(e,t||{}):e,i=r.type;if(this.listens(i)){for(let e of(r.target=this,this._listeners?.[i]?.slice()??[]))e.call(this,r);for(let e of this._oneTimeListeners?.[i]?.slice()??[])ej(i,e,this._oneTimeListeners),e.call(this,r);let e=this._eventedParent;e&&(ex(r,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),e.fire(r))}else r instanceof eX&&console.error(r.error);return this}listens(e){return!!(this._listeners?.[e]?.length||this._oneTimeListeners?.[e]?.length||this._eventedParent?.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}};let eZ={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"}
vendor: 14,404 bytes, line 1
1,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image
vendor: 19,782 bytes, line 1
1"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}}
1,eW=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var eH=class{constructor(e,t,r,i,n="error"){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),this.severity=n,null!=t&&t.__line__&&(this.line=t.__line__)}}
1,eK=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},eJ=class e{constructor(e,t=[]){for(let[r,i]of(this.parent=e,this.bindings={},t))this.bindings[r]=i}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}};let eQ={kind:"null"},e0={kind:"number"},e1={kind:"string"},e2={kind:"boolean"},e3={kind:"color"},e5={kind:"projectionDefinition"},e6={kind:"object"},e4={kind:"value"},e8={kind:"collator"},e7={kind:"formatted"},e9={kind:"padding"},te={kind:"colorArray"},tt={kind:"numberArray"},tr={kind:"resolvedImage"},ti={kind:"variableAnchorOffsetCollection"};function tn(e,t){return{kind:"array",itemType:e,N:t}}function ta(e){if("array"!==e.kind)return e.kind;{let t=ta(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}}let ts=[eQ,e0,e1,e2,e3,e5,e7,e6,tn(e4),e9,tt,te,tr,ti];function to(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!to(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if("value"===e.kind){for(let e of ts)if(!to(e,t))return null}return`Expected ${ta(e)} but found ${ta(t)} instead.`}function tl(e,t){return t.some(t=>t.kind===e.kind)}function tu(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function th(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}let tc=4/29,tp=6/29,tf=6/29*3*(6/29),td=6/29*(6/29)*(6/29),ty=Math.PI/180,tm=180/Math.PI;function tg(e){return(e%=360)<0&&(e+=360),e}function tx([e,t,r,i]){let n,a;e=tv(e);let s=tb((.2225045*e+.7168786*(t=tv(t))+.0606169*(r=tv(r)))/1);e===t&&t===r?n=a=s:(n=tb((.4360747*e+.3850649*t+.1430804*r)/.96422),a=tb((.0139322*e+.0971045*t+.7141733*r)/.82521));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function tv(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function tb(e){return e>td?Math.pow(e,1/3):e/tf+tc}function tw([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,s=isNaN(r)?n:n-r/200;return n=+tS(n),[t_(3.1338561*(a=.96422*tS(a))-1.6168667*n-.4906146*(s=.82521*tS(s))),t_(-.9787684*a+1.9161415*n+.033454*s),t_(.0719453*a-.2289914*n+1.4052427*s),i]}function t_(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function tS(e){return e>tp?e*e*e:tf*(e-tc)}let tA=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function tk(e,t){return tA(e,t)?e[t]:void 0}function tI(e){return parseInt(e.padEnd(2,e),16)/255}function tT(e,t){return tE(t?e/100:e,0,1)}function tE(e,t,r){return Math.min(Math.max(t,e),r)}function tM(e){return!e.some(Number.isNaN)}let tD={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
1ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function tP(e,t,r){return e.map((e,i)=>e+r*(t[i]-e))}var tF=class e{constructor(e,t,r,i=1,n=!0){this.r=e,this.g=t,this.b=r,this.a=i,!n&&(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,r,i]))}static{this.black=new e(0,0,0,1)}static{this.white=new e(1,1,1,1)}static{this.transparent=new e(0,0,0,0)}static{this.red=new e(1,0,0,1)}static parse(t){if(t instanceof e)return t;if("string"!=typeof t)return;let r=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=tk(tD,e);if(t){let[e,r,i]=t;return[e/255,r/255,i/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[tI(e.slice(r,r+=t)),tI(e.slice(r,r+=t)),tI(e.slice(r,r+=t)),tI(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,r,i,n,a,s,o,l,u,h,c,p]=t,f=[n||" ",o||" ",h].join("");if("  "===f||"  /"===f||",,"===f||",,,"===f){let e=[i,s,u].join(""),t="%%%"===e?100:255*(""===e);if(t){let e=[tE(r/t,0,1),tE(a/t,0,1),tE(l/t,0,1),c?tT(+c,p):1];if(tM(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,i,n,a,s,o,l,u]=r,h=[i||" ",a||" ",o].join("");if("  "===h||"  /"===h||",,"===h||",,,"===h){let e=[+t,tE(+n,0,100),tE(+s,0,100),l?tT(+l,u):1];if(tM(e))return function([e,t,r,i]){function n(i){let n=(i+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(n-3,9-n,1))}return e=tg(e),t/=100,r/=100,[n(0),n(8),n(4),i]}(e)}}}(t);if(r)return new e(...r,!1)}get rgb(){let{r:e,g:t,b:r,a:i}=this,n=i||1/0;return this.overwriteGetter("rgb",[e/n,t/n,r/n,i])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,r,i,n]=tx(e),a=Math.sqrt(r*r+i*i);return[Math.round(1e4*a)?tg(Math.atan2(i,r)*tm):0/0,a,t,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tx(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,i]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${i})`}static interpolate(t,r,i,n="rgb"){switch(n){case"rgb":{let[n,a,s,o]=tP(t.rgb,r.rgb,i);return new e(n,a,s,o,!1)}case"hcl":{let n,a,[s,o,l,u]=t.hcl,[h,c,p,f]=r.hcl;if(isNaN(s)||isNaN(h))isNaN(s)?isNaN(h)?n=0/0:(n=h,(1===l||0===l)&&(a=c)):(n=s,(1===p||0===p)&&(a=o));else{let e=h-s;h>s&&e>180?e-=360:h<s&&s-h>180&&(e+=360),n=s+i*e}let[d,y,m,g]=function([e,t,r,i]){return tw([r,Math.cos(e=isNaN(e)?0:e*ty)*t,Math.sin(e)*t,i])}([n,a??o+i*(c-o),l+i*(p-l),u+i*(f-u)]);return new e(d,y,m,g,!1)}case"lab":{let[n,a,s,o]=tw(tP(t.lab,r.lab,i));return new e(n,a,s,o,!1)}}}},tz=class{constructor(e,t,r){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};let tB=["bottom","center","top"];var tC=class{constructor(e,t,r,i,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},tV=class e{constructor(e){this.sections=e}static fromString(t){return new e([new tC(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}},tL=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1)&&!(t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new e(tP(t.values,r.values,i))}},tO=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t]);if(Array.isArray(t)){for(let e of t)if("number"!=typeof e)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new e(tP(t.values,r.values,i))}},t$=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("string"==typeof t){let r=tF.parse(t);if(!r)return;return new e([r])}if(!Array.isArray(t))return;let r=[];for(let e of t){if("string"!=typeof e)return;let t=tF.parse(e);if(!t)return;r.push(t)}return new e(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n="rgb"){let a=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(tF.interpolate(t.values[e],r.values[e],i,n));return new e(a)}}
1,tR=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}};let tN=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var tU=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){let r=t[e],i=t[e+1];if("string"!=typeof r||!tN.has(r)||!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n){let a=t.values,s=r.values;if(a.length!==s.length)throw new tR(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`,n);let o=[];for(let e=0;e<a.length;e+=2){if(a[e]!==s[e])throw new tR(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${a[e]}, to[${e}]: ${s[e]}`,n);o.push(a[e]);let[t,r]=a[e+1],[l,u]=s[e+1];o.push([t+i*(l-t),r+i*(u-r)])}return new e(o)}},tq=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},tj=class e{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}toString(){return this.from===this.to&&1===this.transition?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,r,i){return new e(t,r,i)}static parse(t){return t instanceof e?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new e(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new e(t.from,t.to,t.transition):"string"==typeof t?new e(t,t,1):void 0}};function tG(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function tX(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof tj||e instanceof tF||e instanceof tz||e instanceof tV||e instanceof tL||e instanceof tO||e instanceof t$||e instanceof tU||e instanceof tq)return!0;if(Array.isArray(e)){for(let t of e)if(!tX(t))return!1;return!0}if("object"!=typeof e)return!1;for(let t in e)if(!tX(e[t]))return!1;return!0}function tY(e){if(null===e)return eQ;if("string"==typeof e)return e1;if("boolean"==typeof e)return e2;{if("number"==typeof e)return e0;if(e instanceof tF)return e3;if(e instanceof tj)return e5;if(e instanceof tz)return e8;if(e instanceof tV)return e7;if(e instanceof tL)return e9;if(e instanceof tO)return tt;if(e instanceof t$)return te;if(e instanceof tU)return ti;if(e instanceof tq)return tr;if(!Array.isArray(e))return e6;let t,r=e.length;for(let r of e){let e=tY(r);if(t){if(t===e)continue;t=e4;break}t=e}return tn(t||e4,r)}}function tZ(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof tF||e instanceof tj||e instanceof tV||e instanceof tL||e instanceof tO||e instanceof t$||e instanceof tU||e instanceof tq?e.toString():JSON.stringify(e)}var tW=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,r){if(2!==t.length)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!tX(t[1]))return r.error("invalid value");let i=t[1],n=tY(i),a=r.expectedType;return"array"===n.kind&&0===n.N&&a&&"array"===a.kind&&("number"!=typeof a.N||0===a.N)&&(n=a),new e(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};let tH={string:e1,number:e0,boolean:e2,object:e6};var tK=class e{constructor(e,t,r){this.type=e,this.args=t,this.key=r}static parse(t,r){let i;if(t.length<2)return r.error("Expected at least one argument.");let n=1,a=t[0];if("array"===a){let e,a;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in tH)||"object"===i)return r.error('The item type argument of "array" must be one of string, number, boolean',1);e=tH[i],n++}else e=e4;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}
vendor: 7,525 bytes, line 1
1i=tn(e,a)}else{if(!tH[a])throw Error(`Types doesn't contain name = ${a}`);i=tH[a]}let s=[];for(;n<t.length;n++){let e=r.parse(t[n],n,e4);if(!e)return null;s.push(e)}return new e(i,s,r.key)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!to(this.type,tY(r)))return r;if(t===this.args.length-1)throw new tR(`Expected value to be of type ${ta(this.type)}, but found ${ta(tY(r))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};let tJ={"to-boolean":e2,"to-color":e3,"to-number":e0,"to-string":e1};var tQ=class e{constructor(e,t,r){this.type=e,this.args=t,this.key=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!tJ[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return r.error("Expected one argument.");let n=tJ[i],a=[];for(let e=1;e<t.length;e++){let i=r.parse(t[e],e,e4);if(!i)return null;a.push(i)}return new e(n,a,r.key)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let i of this.args){if(t=i.evaluate(e),r=null,t instanceof tF)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:tG(t[0],t[1],t[2],t[3])))return new tF(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new tR(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let i=tL.parse(t);if(i)return i}throw new tR(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"numberArray":{let t;for(let r of this.args){t=r.evaluate(e);let i=tO.parse(t);if(i)return i}throw new tR(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"colorArray":{let t;for(let r of this.args){t=r.evaluate(e);let i=t$.parse(t);if(i)return i}throw new tR(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let i=tU.parse(t);if(i)return i}throw new tR(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"number":{let t=null;for(let r of this.args){if(null===(t=r.evaluate(e)))return 0;let i=Number(t);if(!isNaN(i))return i}throw new tR(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case"formatted":return tV.fromString(tZ(this.args[0].evaluate(e)));case"resolvedImage":return tq.fromString(tZ(this.args[0].evaluate(e)));case"projectionDefinition":{let t=this.args[0].evaluate(e);if(tj.parse(t))return t;throw new tR(`Could not parse projectionDefinition from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}default:return tZ(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};let t0=["Unknown","Point","LineString","Polygon"];var t1=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?t0[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=tF.parse(e),this._parseColorCache.set(e,t)),t}},t2=class e{constructor(e,t,r=[],i,n=new eJ,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=n,this.errors=a,this.expectedType=i,this._isConstant=t}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]);let r=this.key;function i(e,t,i){return"assert"===i?new tK(t,[e],r):"coerce"===i?new tQ(t,[e],r):e}if(Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let r=e[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let n=this.registry[r];if(n){let r=n.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,n=r.type;if(("string"===e.kind||"number"===e.kind||"boolean"===e.kind||"object"===e.kind||"array"===e.kind)&&"value"===n.kind)r=i(r,e,t.typeAnnotation||"assert");else if("projectionDefinition"===e.kind&&["string","array","value"].includes(n.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(n.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(n.kind)||"colorArray"===e.kind&&["value","string","array"].includes(n.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(n.kind))r=i(r,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,n))return null}if(!(r instanceof tW)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){let e=new t1;try{r=new tW(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,r,i){let n="number"==typeof t?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new e(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...t){let r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new eK(r,e))}checkSubtype(e,t){let r=to(e,t);return r&&this.error(r),r}},t3=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let e=1;e<t.length-1;e+=2){let n=t[e];if("string"!=typeof n)return r.error(`Expected string, but found ${typeof n} instead.`,e);if(/[^a-zA-Z0-9_]/.test(n))return r.error("Variable names must contain only alphanumeric characters or '_'.",e);let a=r.parse(t[e+1],e+1);if(!a)return null;i.push([n,a])}let n=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return n?new e(i,n):null}outputDefined(){return this.result.outputDefined()}},t5=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");let i=t[1];return r.scope.has(i)?new e(i,r.scope.get(i)):r.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}
vendor: 1,620 bytes, line 1
1,t6=class e{constructor(e,t,r,i){this.type=e,this.index=t,this.input=r,this.key=i}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,e0),n=r.parse(t[2],2,tn(r.expectedType||e4));return i&&n?new e(n.type.itemType,i,n,r.key):null}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new tR(`Array index out of bounds: ${t} < 0.`,this.key);if(t>=r.length)throw new tR(`Array index out of bounds: ${t} > ${r.length-1}.`,this.key);if(t!==Math.floor(t))throw new tR(`Array index must be an integer, but found ${t} instead.`,this.key);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},t4=class e{constructor(e,t,r){this.needle=e,this.haystack=t,this.key=r,this.type=e2}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,e4),n=r.parse(t[2],2,e4);return i&&n?tl(i.type,[e2,e1,e0,eQ,e4])?new e(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ta(i.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!tu(t,["boolean","string","number","null"]))throw new tR(`Expected first argument to be of type boolean, string, number or null, but found ${ta(tY(t))} instead.`,this.key);if(!tu(r,["string","array"]))throw new tR(`Expected second argument to be of type array or string, but found ${ta(tY(r))} instead.`,this.key);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}
1,t8=class e{constructor(e,t,r,i){this.needle=e,this.haystack=t,this.key=r,this.fromIndex=i,this.type=e0}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,e4),n=r.parse(t[2],2,e4);if(!i||!n)return null;if(!tl(i.type,[e2,e1,e0,eQ,e4]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ta(i.type)} instead`);if(4!==t.length)return new e(i,n,r.key);{let a=r.parse(t[3],3,e0);return a?new e(i,n,r.key,a):null}}evaluate(e){let t,r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!tu(r,["boolean","string","number","null"]))throw new tR(`Expected first argument to be of type boolean, string, number or null, but found ${ta(tY(r))} instead.`,this.key);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),tu(i,["string"])){let e=i.indexOf(r,t);return -1===e?-1:[...i.slice(0,e)].length}if(tu(i,["array"]))return i.indexOf(r,t);throw new tR(`Expected second argument to be of type array or string, but found ${ta(tY(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},t7=class e{constructor(e,t,r,i,n,a){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a}static parse(t,r){let i,n;if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let a={},s=[];for(let e=2;e<t.length-1;e+=2){let o=t[e],l=t[e+1];Array.isArray(o)||(o=[o]);let u=r.concat(e);if(0===o.length)return u.error("Expected at least one branch label.");for(let e of o){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");else if(i){if(u.checkSubtype(i,tY(e)))return null}else i=tY(e);if(void 0!==a[String(e)])return u.error("Branch labels must be unique.");a[String(e)]=s.length}let h=r.parse(l,e,n);if(!h)return null;n=n||h.type,s.push(h)}let o=r.parse(t[1],1,e4);if(!o)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||"value"!==o.type.kind&&r.concat(1).checkSubtype(i,o.type)?null:new e(i,n,o,a,s,l)}evaluate(e){let t=this.input.evaluate(e);return(tY(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},t9=class e{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(t,r){let i;if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let n=[];for(let e=1;e<t.length-1;e+=2){let a=r.parse(t[e],e,e2);if(!a)return null;let s=r.parse(t[e+1],e+1,i);if(!s)return null;n.push([a,s]),i=i||s.type}let a=r.parse(t[t.length-1],t.length-1,i);if(!a)return null;if(!i)throw Error("Can't infer output type");return new e(i,n,a)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},re=class e{constructor(e,t,r,i,n){this.type=e,this.input=t,this.beginIndex=r,this.key=i,this.endIndex=n}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,e4),n=r.parse(t[2],2,e0);if(!i||!n)return null;if(!tl(i.type,[tn(e4),e1,e4]))return r.error(`Expected first argument to be of type array or string, but found ${ta(i.type)} instead`);if(4!==t.length)return new e(i.type,i,n,r.key);{let a=r.parse(t[3],3,e0);return a?new e(i.type,i,n,r.key,a):null}}evaluate(e){let t,r=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(this.endIndex&&(t=this.endIndex.evaluate(e)),tu(r,["string"]))return[...r].slice(i,t).join("");if(tu(r,["array"]))return r.slice(i,t);throw new tR(`Expected first argument to be of type array or string, but found ${ta(tY(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function rt(e,t,r){let i,n,a=e.length-1,s=0,o=a,l=0;for(;s<=o;)if(i=e[l=Math.floor((s+o)/2)],n=e[l+1],i<=t){if(l===a||t<n)return l;s=l+1}else if(i>t)o=l-1;else throw new tR("Input is not a number.",r);return 0}
1var rr=class e{constructor(e,t,r,i){for(let[n,a]of(this.type=e,this.input=t,this.key=i,this.labels=[],this.outputs=[],r))this.labels.push(n),this.outputs.push(a)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(t[1],1,e0);if(!i)return null;let n=[],a=null;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);for(let e=1;e<t.length;e+=2){let i=1===e?-1/0:t[e],s=t[e+1],o=e,l=e+1;if("number"!=typeof i)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(n.length&&n[n.length-1][0]>=i)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);let u=r.parse(s,l,a);if(!u)return null;a=a||u.type,n.push([i,u])}return new e(a,i,n,r.key)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);let n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[rt(t,i,this.key)].evaluate(e)}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}},ri=class e{constructor(e,t,r,i,n,a){for(let[s,o]of(this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.key=a,this.labels=[],this.outputs=[],n))this.labels.push(s),this.outputs.push(o)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=rn(t,e.base,r,i);else if("linear"===e.name)n=rn(t,1,r,i);else if("cubic-bezier"===e.name){var a,s,o,l;let u,h,c,p,f,d,y=e.controlPoints;n=(a=y[0],s=y[1],o=y[2],l=y[3],u=3*a,h=3*(o-a)-u,c=1-u-h,p=3*s,f=3*(l-s)-p,d=1-p-f,function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let r=e;for(let i=0;i<8;i++){let i=((c*r+h)*r+u)*r-e;if(Math.abs(i)<t)return((d*r+f)*r+p)*r;let n=(3*c*r+2*h)*r+u;if(1e-6>Math.abs(n))break;r-=i/n}let i=0,n=1;r=e;for(let a=0;a<20;a++){let a=((c*r+h)*r+u)*r;if(Math.abs(a-e)<t)break;e>a?i=r:n=r,r=(i+n)*.5}return((d*r+f)*r+p)*r})(rn(t,1,r,i))}return n}static parse(t,r){let[i,n,a,...s]=t;if(!Array.isArray(n)||0===n.length)return r.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let e=n[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);let e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(a=r.parse(a,2,e0)))return null;let o=[],l=null;("interpolate-hcl"===i||"interpolate-lab"===i)&&r.expectedType!=te?l=e3:r.expectedType&&"value"!==r.expectedType.kind&&(l=r.expectedType);for(let e=0;e<s.length;e+=2){let t=s[e],i=s[e+1],n=e+3,a=e+4;if("number"!=typeof t)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(o.length&&o[o.length-1][0]>=t)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);let u=r.parse(i,a,l);if(!u)return null;l=l||u.type,o.push([t,u])}return th(l,e0)||th(l,e5)||th(l,e3)||th(l,e9)||th(l,tt)||th(l,te)||th(l,ti)||th(l,tn(e0))?new e(l,i,n,a,o,r.key):r.error(`Type ${ta(l)} is not interpolatable.`)}evaluate(t){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let s=rt(r,n,this.key),o=r[s],l=r[s+1],u=e.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(t),c=i[s+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return h+u*(c-
1h);case"color":return tF.interpolate(h,c,u);case"padding":return tL.interpolate(h,c,u);case"colorArray":return t$.interpolate(h,c,u);case"numberArray":return tO.interpolate(h,c,u);case"variableAnchorOffsetCollection":return tU.interpolate(h,c,u,this.key);case"array":return tP(h,c,u);case"projectionDefinition":return tj.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return tF.interpolate(h,c,u,"hcl");case"colorArray":return t$.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return tF.interpolate(h,c,u,"lab");case"colorArray":return t$.interpolate(h,c,u,"lab")}}}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function rn(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}let ra={color:tF.interpolate,number:function(e,t,r){return e+r*(t-e)},padding:tL.interpolate,numberArray:tO.interpolate,colorArray:t$.interpolate,variableAnchorOffsetCollection:tU.interpolate,array:tP};var rs=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&"value"!==n.kind&&(i=n);let a=[];for(let e of t.slice(1)){let t=r.parse(e,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,a.push(t)}if(!i)throw Error("No output type");return n&&a.some(e=>to(n,e.type))?new e(e4,a):new e(i,a)}evaluate(e){let t,r=null,i=0;for(let n of this.args)if(i++,(r=n.evaluate(e))&&r instanceof tq&&!r.available&&(t||(t=r.name),r=null,i===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function ro(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function rl(e,t,r,i){return 0===i.compare(t,r)}function ru(e,t,r){let i="=="!==e&&"!="!==e;
1return class n{constructor(e,t,r,i){this.lhs=e,this.rhs=t,this.key=r,this.collator=i,this.type=e2,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],a=t.parse(e[1],1,e4);if(!a)return null;if(!ro(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${ta(a.type)}'.`);let s=t.parse(e[2],2,e4);if(!s)return null;if(!ro(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${ta(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${ta(a.type)}' and '${ta(s.type)}'.`);i&&("value"===a.type.kind&&"value"!==s.type.kind?a=new tK(s.type,[a],t.key):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new tK(a.type,[s],t.key)));let o=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(o=t.parse(e[3],3,e8)))return null}return new n(a,s,t.key,o)}evaluate(n){let a=this.lhs.evaluate(n),s=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){let t=tY(a),r=tY(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new tR(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let e=tY(a),r=tY(s);if("string"!==e.kind||"string"!==r.kind)return t(n,a,s)}return this.collator?r(n,a,s,this.collator.evaluate(n)):t(n,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}let rh=ru("==",function(e,t,r){return t===r},rl),rc=ru("!=",function(e,t,r){return t!==r},function(e,t,r,i){return!rl(e,t,r,i)}),rp=ru("<",function(e,t,r){return t<r},function(e,t,r,i){return 0>i.compare(t,r)}),rf=ru(">",function(e,t,r){return t>r},function(e,t,r,i){return i.compare(t,r)>0}),rd=ru("<=",function(e,t,r){return t<=r},function(e,t,r,i){return 0>=i.compare(t,r)}),ry=ru(">=",function(e,t,r){return t>=r},function(e,t,r,i){return i.compare(t,r)>=0});var rm=class e{constructor(e,t,r){this.type=e8,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");let i=t[1];if("object"!=typeof i||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,e2);if(!n)return null;let a=r.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,e2);if(!a)return null;let s=null;return!i.locale||(s=r.parse(i.locale,1,e1))?new e(n,a,s):null}evaluate(e){return new tz(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},rg=class e{constructor(e,t,r,i,n,a){this.type=e1,this.number=e,this.locale=t,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=a}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,e0);if(!i)return null;let n=t[2];if("object"!=typeof n||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&!(a=r.parse(n.locale,1,e1)))return null;let s=null;if(n.currency&&!(s=r.parse(n.currency,1,e1)))return null;let o=null;if(n.unit&&!(o=r.parse(n.unit,1,e1)))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&!(l=r.parse(n["min-fraction-digits"],1,e0)))return null;let u=null;return!n["max-fraction-digits"]||(u=r.parse(n["max-fraction-digits"],1,e0))?new e(i,a,s,o,l,u):null}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},rx=class e{constructor(e){this.type=e7,this.sections=e}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let e=1;e<=t.length-1;++e){let i=t[e];if(a&&"object"==typeof i&&!Array.isArray(i)){a=!1;let e=null;if(i["font-scale"]&&!(e=r.parse(i["font-scale"],1,e0)))return null;let t=null;if(i["text-font"]&&!(t=r.parse(i["text-font"],1,tn(e1))))return null;let s=null;if(i["text-color"]&&!(s=r.parse(i["text-color"],1,e3)))return null;let o=null;if(i["vertical-align"]){if("string"==typeof i["vertical-align"]&&!tB.includes(i["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${i["vertical-align"]}' instead.`);if(!(o=r.parse(i["vertical-align"],1,e1)))return null}let l=n[n.length-1];l.scale=e,l.font=t,l.textColor=s,l.verticalAlign=o}else{let i=r.parse(t[e],1,e4);if(!i)return null;let s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:i,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(n)}evaluate(e){return new tV(this.sections.map(t=>{let r=t.content.evaluate(e);return tY(r)===tr?new tC("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new tC(tZ(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}},rv=class e{constructor(e){this.type=tr,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,e1);return i?new e(i):r.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=tq.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}},rb=class e{constructor(e,t){this.input=e,this.key=t,this.type=e0}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=r.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?r.error(`Expected argument of type string or array, but found ${ta(i.type)} instead.`):new e(i,r.key):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new tR(`Expected value to be of type string or array, but found ${ta(tY(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}};function rw(e,t){let r=Math.pow(2,t.z);return[360*((e[0]/8192+t.x)/r)-180,360/Math.PI*Math.atan(Math.exp((180-360*((e[1]/8192+t.y)/r))*Math.PI/180)
1)-90]}function r_(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function rS(e,t){return!(e[0]<=t[0])&&!(e[2]>=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function rA(e,t,r,i){var n,a;let s=[t[0]-e[0],t[1]-e[1]];return 0!=(n=[i[0]-r[0],i[1]-r[1]],n[0]*(a=s)[1]-n[1]*a[0])&&!!(rT(e,t,r,i)&&rT(r,i,e,t))}function rk(e,t,r=!1){let i=!1;for(let s of t)for(let t=0;t<s.length-1;t++){var n,a;if(function(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return i*s-a*n==0&&i*a<=0&&n*s<=0}(e,s[t],s[t+1]))return r;n=s[t],a=s[t+1],n[1]>e[1]!=a[1]>e[1]&&e[0]<(a[0]-n[0])*(e[1]-n[1])/(a[1]-n[1])+n[0]&&(i=!i)}return i}function rI(e,t){for(let r of e)if(!rk(r,t))return!1;for(let r=0;r<e.length-1;++r)if(function(e,t,r){for(let i of r)for(let r=0;r<i.length-1;++r)if(rA(e,t,i[r],i[r+1]))return!0;return!1}(e[r],e[r+1],t))return!1;return!0}function rT(e,t,r,i){let n=e[0]-r[0],a=e[1]-r[1],s=t[0]-r[0],o=t[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],h=n*u-l*a,c=s*u-l*o;return!!(h>0)&&!!(c<0)||!!(h<0)&&!!(c>0)}function rE(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let i=0;i<e[n].length;i++){let s=function(e,t){let r=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(r*n*8192),Math.round(i*n*8192)]}(e[n][i],r);r_(t,s),a.push(s)}i.push(a)}return i}function rM(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=rE(e[n],t,r);i.push(a)}return i}function rD(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let t=.5*i,n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}r_(t,e)}function rP(e,t,r,i){let n=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[];for(let i of e)for(let e of i){let i=[e.x+a[0],e.y+a[1]];rD(i,t,r,n),s.push(i)}return s}function rF(e,t,r,i){let n=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[];for(let r of e){let e=[];for(let i of r){let r=[i.x+a[0],i.y+a[1]];r_(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=n/2){for(let e of(t[0]=t[1]=1/0,t[2]=t[3]=-1/0,s))for(let i of e)rD(i,t,r,n)}return s}var rz=class e{constructor(e,t){this.type=e2,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(tX(t[1])){let r=t[1];if("FeatureCollection"===r.type){let t=[];for(let e of r.features){let{type:r,coordinates:i}=e.geometry;"Polygon"===r&&t.push(i),"MultiPolygon"===r&&t.push(...i)}if(t.length)return new e(r,{type:"MultiPolygon",coordinates:t})}else if("Feature"===r.type){let t=r.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new e(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=rE(t.coordinates,i,n),s=rP(e.geometry(),r,i,n);if(!rS(r,i))return!1;for(let e of s)if(!rk(e,a))return!1}if("MultiPolygon"===t.type){let a=rM(t.coordinates,i,n),s=rP(e.geometry(),r,i,n);if(!rS(r,i))return!1;for(let e of s)if(!function(e,t){for(let r of t)if(rk(e,r))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries);else if("LineString"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=rE(t.coordinates,i,n),s=rF(e.geometry(),r,i,n);if(!rS(r,i))return!1;for(let e of s)if(!rI(e,a))return!1}if("MultiPolygon"===t.type){let a=rM(t.coordinates,i,n),s=rF(e.geometry(),r,i,n);if(!rS(r,i))return!1;for(let e of s)if(!function(e,t){for(let r of t)if(rI(e,r))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},rB=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=(e<<1)+1,a=i+1;if(a<this.length&&0>r(t[a],t[i])&&(i=a),r(t[i],n)>=0)break;t[e]=t[i],e=i}t[e]=n}};function rC(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function rV(e,t){let r,i;if(e.length<=1)return[e];let n=[];for(let t of e){let e=function(e){let t=0;for(let r=0,i=e.length,n=i-1,a,s;r<i;n=r++)a=e[r],t+=((s=e[n]).x-a.x)*(a.y+s.y);return t}(t);0!==e&&(t.area=Math.abs(e),void 0===i&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(!function e(t,r,i=0,n=t.length-1,a=function(e,t){return e<t?-1:+(e>t)}){for(;n>i;){if(n-i>600){let s=n-i+1,o=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(s-u)/s)*(o-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-o*u/s+h)),Math.min(n,Math.floor(r+(s-o)*u/s+h)),a)}let s=t[r],o=i,l=n;for(rC(t,i,r),a(t[n],s)>0&&rC(t,i,n);o<l;){for(rC(t,o,l),o++,l--;0>a(t[o],s);)o++;for(;a(t[l],s)>0;)l--}0===a(t[i],s)?rC(t,i,l):rC(t,++l,n),l<=r&&(i=l+1),r<=l&&(n=l-1)}}(n[e],t,1,n[e].length-1,rL),n[e]=n[e].slice(0,t));return n}function rL(e,t){return t.area-e.area}let rO=Math.PI/180;var r$=class{constructor(e){let t=6378.137*rO*1e3,r=Math.cos(e*rO),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=t*n*r,this.ky=t*n*i*.9933056200098587}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r,i,n,a,s=1/0;for(let o=0;o<e.length-1;o++){let l=e[o][0],u=e[o][1],h=this.wrap(e[o+1][0]-l)*this.kx,c=(e[o+1][1]-u)*this.ky,p=0;
1(0!==h||0!==c)&&((p=(this.wrap(t[0]-l)*this.kx*h+(t[1]-u)*this.ky*c)/(h*h+c*c))>1?(l=e[o+1][0],u=e[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p));let f=(h=this.wrap(t[0]-l)*this.kx)*h+(c=(t[1]-u)*this.ky)*c;f<s&&(s=f,r=l,i=u,n=o,a=p)}return{point:[r,i],index:n,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function rR(e,t){return t[0]-e[0]}function rN(e){return e[1]-e[0]+1}function rU(e,t){return e[1]>=e[0]&&e[1]<t}function rq(e,t){if(e[0]>e[1])return[null,null];let r=rN(e);if(t){if(2===r)return[e,null];let t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];let i=Math.floor(r/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function rj(e,t){if(!rU(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=t[0];i<=t[1];++i)r_(r,e[i]);return r}function rG(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let e of r)r_(t,e);return t}function rX(e){return -1/0!==e[0]&&-1/0!==e[1]&&1/0!==e[2]&&1/0!==e[3]}function rY(e,t,r){if(!rX(e)||!rX(t))return 0/0;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function rZ(e,t,r){let i=r.pointOnLine(t,e);return r.distance(e,i.point)}function rW(e,t,r,i,n){return Math.min(Math.min(rZ(e,[r,i],n),rZ(t,[r,i],n)),Math.min(rZ(r,[e,t],n),rZ(i,[e,t],n)))}function rH(e,t){for(let r of e)for(let e of r)if(rk(e,t,!0))return!0;return!1}function rK(e,t,r,i,n,a){if(!a)return;let s=rY(rj(i,a),n,r);s<t&&e.push([s,a,[0,0]])}function rJ(e,t,r,i,n,a,s){if(!a||!s)return;let o=rY(rj(i,a),rj(n,s),r);o<t&&e.push([o,a,s])}function rQ(e,t,r,i,n=1/0){let a=Math.min(i.distance(e[0],r[0][0]),n);if(0===a)return a;let s=new rB([[0,[0,e.length-1],[0,0]]],rR),o=rG(r);for(;s.length>0;){let n=s.pop();if(n[0]>=a)continue;let l=n[1],u=t?50:100;if(rN(l)<=u){if(!rU(l,e.length))return 0/0;if(t){let t=function(e,t,r,i){if(!rU(t,e.length))return 0/0;for(let i=t[0];i<=t[1];++i)if(rk(e[i],r,!0))return 0;let n=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],s=e[a+1];for(let e of r)for(let r=0,a=e.length,o=a-1;r<a;o=r++){let a=e[o],l=e[r];if(rA(t,s,a,l))return 0;n=Math.min(n,rW(t,s,a,l,i))}}return n}(e,l,r,i);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t)if(0===(a=Math.min(a,function(e,t,r){if(rk(e,t,!0))return 0;let i=1/0;for(let n of t){let t=n[0],a=n[n.length-1];if(t!==a&&0===(i=Math.min(i,rZ(e,[a,t],r))))break;let s=r.pointOnLine(n,e);if(0===(i=Math.min(i,r.distance(e,s.point))))break}return i}(e[t],r,i))))return 0}else{let r=rq(l,t);rK(s,a,i,e,o,r[0]),rK(s,a,i,e,o,r[1])}}return a}function r0(e,t,r,i,n,a=1/0){let s=Math.min(a,n.distance(e[0],r[0]));if(0===s)return s;let o=new rB([[0,[0,e.length-1],[0,r.length-1]]],rR);for(;o.length>0;){let a=o.pop();if(a[0]>=s)continue;let l=a[1],u=a[2],h=t?50:100,c=i?50:100;if(rN(l)<=h&&rN(u)<=c){if(!rU(l,e.length)&&rU(u,r.length))return 0/0;if(t&&i)s=Math.min(s,function(e,t,r,i,n){if(!(rU(t,e.length)&&rU(i,r.length)))return 1/0;let a=1/0;for(let s=t[0];s<t[1];++s){let t=e[s],o=e[s+1];for(let e=i[0];e<i[1];++e){let i=r[e],s=r[e+1];if(rA(t,o,i,s))return 0;a=Math.min(a,rW(t,o,i,s,n))}}return a}(e,l,r,u,n));else if(t&&!i){let t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(0===(s=Math.min(s,rZ(r[e],t,n))))return s}else if(!t&&i){let t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(0===(s=Math.min(s,rZ(e[r],t,n))))return s}else s=Math.min(s,function(e,t,r,i,n){if(!(rU(t,e.length)&&rU(i,r.length)))return 0/0;let a=1/0;for(let s=t[0];s<=t[1];++s)for(let t=i[0];t<=i[1];++t)if(0===(a=Math.min(a,n.distance(e[s],r[t]))))return a;return a}(e,l,r,u,n))}else{let a=rq(l,t),h=rq(u,i);rJ(o,s,n,e,r,a[0],h[0]),rJ(o,s,n,e,r,a[0],h[1]),rJ(o,s,n,e,r,a[1],h[0]),rJ(o,s,n,e,r,a[1],h[1])}}return s}function r1(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}var r2=class e{constructor(e,t){this.type=e0,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(tX(t[1])){let r=t[1];if("FeatureCollection"===r.type)return new e(r,r.features.map(e=>r1(e.geometry)).flat());if("Feature"===r.type)return new e(r,r1(r.geometry));if("type"in r&&"coordinates"in r)return new e(r,r1(r))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=e.geometry(),i=r.flat().map(t=>rw([t.x,t.y],e.canonical));if(0===r.length)return 0/0;let n=new r$(i[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,r0(i,!1,[e.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,r0(i,!1,e.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,rQ(i,!1,e.coordinates,n,a))}if(0===a)break}return a}(e,this.geometries);else if("LineString"===e.geometryType())return function(e,t){let r=e.geometry(),i=r.flat().map(t=>rw([t.x,t.y],e.canonical));if(0===r.length)return 0/0;let n=new r$(i[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,r0(i,!0,[e.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,r0(i,!0,e.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,rQ(i,!0,e.coordinates,n,a))}if(0===a)break}return a}(e,this.geometries);else if("Polygon"===e.geometryType())return function(e,t){let r=e.geometry();if(0===r.length||0===r[0].length)return 0/0;let i=rV(r,0).map(t=>t.map(t=>t.map(t=>rw([t.x,t.y],e.canonical)))),n=new r$(i[0][0][0][1]),a=1/0;for(let e of t)for(let t of i){switch(e.type){case"Point":a=Math.min(a,rQ([e.coordinates],!1,t,n,a));break;case"LineString":a=Math.min(a,rQ(e.coordinates,!0,t,n,a));break;case"Polygon":a=Math.min(a,function(e,t,r,i=1/0){let n=rG(e),a=rG(t);if(1/0!==i&&rY(n,a,r)>=i)return i;
1if(rS(n,a)){if(rH(e,t))return 0}else if(rH(t,e))return 0;let s=1/0;for(let i of e)for(let e=0,n=i.length,a=n-1;e<n;a=e++){let n=i[a],o=i[e];for(let e of t)for(let t=0,i=e.length,a=i-1;t<i;a=t++){let i=e[a],l=e[t];if(rA(n,o,i,l))return 0;s=Math.min(s,rW(n,o,i,l,r))}}return s}(t,e.coordinates,n,a))}if(0===a)return a}return a}(e,this.geometries)}return 0/0}eachChild(){}outputDefined(){return!0}},r3=class e{constructor(e){this.key=e,this.type=e4}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return null==i?r.error("Global state property must be defined."):"string"!=typeof i?r.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new e(i)}evaluate(e){let t=e.globals?.globalState;return t&&0!==Object.keys(t).length?tk(t,this.key)??null:null}eachChild(){}outputDefined(){return!1}};let r5={"==":rh,"!=":rc,">":rf,"<":rp,">=":ry,"<=":rd,array:tK,at:t6,boolean:tK,case:t9,coalesce:rs,collator:rm,format:rx,image:rv,in:t4,"index-of":t8,interpolate:ri,"interpolate-hcl":ri,"interpolate-lab":ri,length:rb,let:t3,literal:tW,match:t7,number:tK,"number-format":rg,object:tK,slice:re,step:rr,string:tK,"to-boolean":tQ,"to-color":tQ,"to-number":tQ,"to-string":tQ,var:t5,within:rz,distance:r2,"global-state":r3};var r6=class e{constructor(e,t,r,i,n){this.name=e,this.type=t,this._evaluate=r,this.args=i,this.key=n}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=e.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),l=null;for(let[n,s]of o){l=new t2(r.registry,ie,r.path,null,r.scope);let o=[],u=!1;for(let e=1;e<t.length;e++){let r=t[e],i=Array.isArray(n)?n[e-1]:n.type,a=l.parse(r,1+o.length,i);if(!a){u=!0;break}o.push(a)}if(!u){if(Array.isArray(n)&&n.length!==o.length){l.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);continue}for(let e=0;e<o.length;e++){let t=Array.isArray(n)?n[e]:n.type,r=o[e];l.concat(e+1).checkSubtype(t,r.type)}if(0===l.errors.length)return new e(i,a,s,o,r.key)}}if(1===o.length)r.errors.push(...l.errors);else{let e=(o.length?o:s).map(([e])=>{var t;return Array.isArray(t=e)?`(${t.map(ta).join(", ")})`:`(${ta(t.type)}...)`}).join(" | "),i=[];for(let e=1;e<t.length;e++){let n=r.parse(t[e],1+i.length);if(!n)return null;i.push(ta(n.type))}r.error(`Expected arguments of type ${e}, but found (${i.join(", ")}) instead.`)}return null}static register(t,r){for(let i in e.definitions=r,r)t[i]=e}};function r4(e,[t,r,i,n],a){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let s=n?n.evaluate(e):1,o=tG(t,r,i,s);if(o)throw new tR(o,a);return new tF(t/255,r/255,i/255,s,!1)}function r8(e,t){return e in t&&void 0!==t[e]}function r7(e,t){let r=t[e];return void 0===r?null:r}function r9(e){return{type:e}}function ie(e){if(e instanceof t5)return ie(e.boundExpression);if(e instanceof r6&&"error"===e.name)return!1;if(e instanceof rm)return!1;if(e instanceof rz)return!1;if(e instanceof r2)return!1;else if(e instanceof r3)return!1;let t=e instanceof tQ||e instanceof tK,r=!0;return e.eachChild(e=>{r=t?r&&ie(e):r&&e instanceof tW}),!!r&&it(e)&&ii(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function it(e){if(e instanceof r6){if("get"===e.name&&1===e.args.length)return!1;else if("feature-state"===e.name)return!1;else if("has"===e.name&&1===e.args.length)return!1;else if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;else if(/^filter-/.test(e.name))return!1}if(e instanceof rz||e instanceof r2)return!1;let t=!0;return e.eachChild(e=>{t&&!it(e)&&(t=!1)}),t}function ir(e){if(e instanceof r6&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!ir(e)&&(t=!1)}),t}function ii(e,t){if(e instanceof r6&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!ii(e,t)&&(r=!1)}),r}function ia(e){return{result:"success",value:e}}function is(e){return{result:"error",value:e}}function io(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function il(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function iu(e){return!!e.expression&&e.expression.interpolated}function ih(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function ic(e){if(e instanceof Number)return"number";if(e instanceof String)return"string";if(e instanceof Boolean)return"boolean";if(Array.isArray(e))return"array";if(null===e)return"null";else return typeof e}function ip(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&tY(e)===e6}function id(e){return e}function iy(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function im(e,t,r,i,n){return iy(typeof r===n?i[r]:void 0,e.default,t.default)}function ig(e,t,r){if("number"!==ic(r))return iy(e.default,t.default);let i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=rt(e.stops.map(e=>e[0]),r,"");return e.stops[n][1]}function ix(e,t,r){var i,n,a;
vendor: 4,794 bytes, line 1
1let s,o,l=void 0!==e.base?e.base:1;if("number"!==ic(r))return iy(e.default,t.default);let u=e.stops.length;if(1===u||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[u-1][0])return e.stops[u-1][1];let h=rt(e.stops.map(e=>e[0]),r,""),c=(i=r,n=l,a=e.stops[h][0],s=e.stops[h+1][0]-a,o=i-a,0===s?0:1===n?o/s:(Math.pow(n,o)-1)/(Math.pow(n,s)-1)),p=e.stops[h][1],f=e.stops[h+1][1],d=ra[t.type]||id;return"function"==typeof p.evaluate?{evaluate(...t){let r=p.evaluate.apply(void 0,t),i=f.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return d(r,i,c,e.colorSpace)}}:d(p,f,c,e.colorSpace)}function iv(e,t,r){switch(t.type){case"color":r=tF.parse(r);break;case"formatted":r=tV.fromString(r.toString());break;case"resolvedImage":r=tq.fromString(r.toString());break;case"padding":r=tL.parse(r);break;case"colorArray":r=t$.parse(r);break;case"numberArray":r=tO.parse(r);break;default:ic(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return iy(r,e.default,t.default)}r6.register(r5,{error:[{kind:"error"},[e1],(e,[t],r)=>{throw new tR(t.evaluate(e),r)}],typeof:[e1,[e4],(e,[t])=>ta(tY(t.evaluate(e)))],"to-rgba":[tn(e0,4),[e3],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[255*r,255*i,255*n,a]}],rgb:[e3,[e0,e0,e0],r4],rgba:[e3,[e0,e0,e0,e0],r4],has:{type:e2,overloads:[[[e1],(e,[t])=>r8(t.evaluate(e),e.properties())],[[e1,e6],(e,[t,r])=>r8(t.evaluate(e),r.evaluate(e))]]},get:{type:e4,overloads:[[[e1],(e,[t])=>r7(t.evaluate(e),e.properties())],[[e1,e6],(e,[t,r])=>r7(t.evaluate(e),r.evaluate(e))]]},"feature-state":[e4,[e1],(e,[t])=>r7(t.evaluate(e),e.featureState||{})],properties:[e6,[],e=>e.properties()],"geometry-type":[e1,[],e=>e.geometryType()],id:[e4,[],e=>e.id()],zoom:[e0,[],e=>e.globals.zoom],"heatmap-density":[e0,[],e=>e.globals.heatmapDensity||0],elevation:[e0,[],e=>e.globals.elevation||0],"line-progress":[e0,[],e=>e.globals.lineProgress||0],accumulated:[e4,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[e0,r9(e0),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[e0,r9(e0),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:e0,overloads:[[[e0,e0],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[e0],(e,[t])=>-t.evaluate(e)]]},"/":[e0,[e0,e0],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[e0,[e0,e0],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[e0,[],()=>Math.LN2],pi:[e0,[],()=>Math.PI],e:[e0,[],()=>Math.E],"^":[e0,[e0,e0],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[e0,[e0],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[e0,[e0],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[e0,[e0],(e,[t])=>Math.log(t.evaluate(e))],log2:[e0,[e0],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[e0,[e0],(e,[t])=>Math.sin(t.evaluate(e))],cos:[e0,[e0],(e,[t])=>Math.cos(t.evaluate(e))],tan:[e0,[e0],(e,[t])=>Math.tan(t.evaluate(e))],asin:[e0,[e0],(e,[t])=>Math.asin(t.evaluate(e))],acos:[e0,[e0],(e,[t])=>Math.acos(t.evaluate(e))],atan:[e0,[e0],(e,[t])=>Math.atan(t.evaluate(e))],min:[e0,r9(e0),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[e0,r9(e0),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[e0,[e0],(e,[t])=>Math.abs(t.evaluate(e))],round:[e0,[e0],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[e0,[e0],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[e0,[e0],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[e2,[e1,e4],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[e2,[e4],(e,[t])=>e.id()===t.value],"filter-type-==":[e2,[e1],(e,[t])=>e.geometryType()===t.value],"filter-<":[e2,[e1,e4],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[e2,[e4],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[e2,[e1,e4],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[e2,[e4],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[e2,[e1,e4],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[e2,[e4],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[e2,[e1,e4],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[e2,[e4],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[e2,[e4],(e,[t])=>{let r=t.value,i=e.properties();return r in i&&void 0!==i[r]}],"filter-has-id":[e2,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[e2,[tn(e1)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[e2,[tn(e4)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[e2,[e1,tn(e4)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[e2,[e1,tn(e4)],(e,[t,r])=>(function(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}
1return!1})(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:e2,overloads:[[[e2,e2],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[r9(e2),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:e2,overloads:[[[e2,e2],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[r9(e2),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[e2,[e2],(e,[t])=>!t.evaluate(e)],"is-supported-script":[e2,[e1],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[e1,[e1],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[e1,[e1],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[e1,r9(e4),(e,t)=>t.map(t=>tZ(t.evaluate(e))).join("")],split:[tn(e1),[e1,e1],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[e1,[tn(e1),e1],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[e1,[e8],(e,[t])=>t.evaluate(e).resolvedLocale()]});var ib=class{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new t1,this._defaultValue=r?iD(r):null,this._enumValues=r&&"enum"===r.type?r.values:null,this._globalState=i,this._rootKey=t}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=iP(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._globalState&&(e=iP(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new tR(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`,"");return e}catch(r){let e=r instanceof tR?r.path:"",t=`${e}|${r.message}`;return!this._warningHistory[t]&&(this._warningHistory[t]=!0,"u">typeof console&&console.warn(iw(this._rootKey,e,r.message,this._defaultValue))),this._defaultValue}}};function iw(e,t,r,i){return`${e}${t}: ${r}${null==i?"":` Falling back to ${String(i)}.`}`}function i_(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function iS(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in r5}function iA(e,t,r,i){var n;let a;i_(t);let s=new t2(r5,ie,[],r?(n=r,a={color:e3,string:e1,number:e0,enum:e1,boolean:e2,formatted:e7,padding:e9,numberArray:tt,colorArray:te,projectionDefinition:e5,resolvedImage:tr,variableAnchorOffsetCollection:ti},"array"===n.type?tn(a[n.value]||e4,n.length):a[n.type]):void 0),o=s.parse(e,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return o?ia(new ib(o,t,r,i)):is(s.errors)}var ik=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!ir(t.expression),this.globalStateRefs=iM(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=iP(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=iP(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}},iI=class{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!ir(t.expression),this.globalStateRefs=iM(t.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=iP(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=iP(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?ri.interpolationFactor(this.interpolationType,e,t,r):0}};
1function iT(e,t,r,i){let n=iA(e,t,r,i);if("error"===n.result)return n;let a=n.value.expression,s=it(a);if(!s&&!io(r))return is([new eK("","data expressions not supported")]);let o=ii(a,["zoom"]);if(!o&&!il(r))return is([new eK("","zoom expressions not supported")]);let l=function e(t){let r=null;if(t instanceof t3)r=e(t.result);else if(t instanceof rs){for(let i of t.args)if(r=e(i))break}else(t instanceof rr||t instanceof ri)&&t.input instanceof r6&&"zoom"===t.input.name&&(r=t);return r instanceof eK||t.eachChild(t=>{let i=e(t);i instanceof eK?r=i:!r&&i?r=new eK("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new eK("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}(a);if(!l&&!o)return is([new eK("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof eK)return is([l]);if(l instanceof ri&&!iu(r))return is([new eK("",'"interpolate" expressions cannot be used with this property')]);if(!l)return ia(s?new ik("constant",n.value,i):new ik("source",n.value,i));let u=l instanceof ri?l.interpolation:void 0;return ia(s?new iI("camera",n.value,l.labels,u,i):new iI("composite",n.value,l.labels,u,i))}var iE=class e{constructor(e,t,r){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,i_(t),this._parameters=e,this._specification=r,this._rootKey=t,this._defaultValue=iD(r),this._warningHistory={};let i=function e(t,r){var i;let n,a,s=t.stops&&"object"==typeof t.stops[0][0],o=s||void 0!==t.property,l=t.type||(iu(r)?"exponential":"interval"),u=function(e){switch(e.type){case"color":return tF.parse;case"padding":return tL.parse;case"numberArray":return tO.parse;case"colorArray":return t$.parse;default:return null}}(r);if(u&&((t=ih({},t)).stops&&(t.stops=t.stops.map(e=>[e[0],u(e[1])])),t.default?t.default=u(t.default):t.default=u(r.default)),t.colorSpace&&"rgb"!==(i=t.colorSpace)&&"hcl"!==i&&"lab"!==i)throw Error(`Unknown color space: "${t.colorSpace}"`);let h=function(e){switch(e){case"exponential":return ix;case"interval":return ig;case"categorical":return im;case"identity":return iv;default:throw Error(`Unknown function type "${e}"`)}}(l);if("categorical"===l){for(let e of(n=Object.create(null),t.stops))n[e[0]]=e[1];a=typeof t.stops[0][0]}if(s){let i={},n=[];for(let e=0;e<t.stops.length;e++){let r=t.stops[e],a=r[0].zoom;void 0===i[a]&&(i[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},n.push(a)),i[a].stops.push([r[0].value,r[1]])}let a=[];for(let t of n)a.push([i[t].zoom,e(i[t],r)]);let s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:ri.interpolationFactor.bind(void 0,s),zoomStops:a.map(e=>e[0]),evaluate:({zoom:e},i)=>ix({stops:a,base:t.base},r,e).evaluate(e,i)}}if(!s&&o)return{kind:"source",evaluate(e,i){let s=i&&i.properties?i.properties[t.property]:void 0;return void 0===s?iy(t.default,r.default):h(t,r,s,n,a)}};{let e="exponential"===l?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:e,interpolationFactor:ri.interpolationFactor.bind(void 0,e),zoomStops:t.stops.map(e=>e[0]),evaluate:({zoom:e})=>h(t,r,e,n,a)}}}(this._parameters,this._specification);this.kind=i.kind,this.interpolationFactor=i.interpolationFactor,this.zoomStops=i.zoomStops,this.interpolationType=i.interpolationType,this._innerEvaluate=i.evaluate}evaluate(e,t){try{return this._innerEvaluate(e,t)}catch(r){let e=r instanceof Error?r.message:String(r),t=`|${e}`;return!this._warningHistory[t]&&(this._warningHistory[t]=!0,"u">typeof console&&console.warn(iw(this._rootKey,"",e,this._defaultValue))),this._defaultValue}}static deserialize(t){return new e(t._parameters,t._rootKey,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function iM(e,t=new Set){return e instanceof r3&&t.add(e.key),e.eachChild(e=>{iM(e,t)}),t}function iD(e){if("color"===e.type&&ip(e.default))return new tF(0,0,0,0);switch(e.type){case"color":return tF.parse(e.default)||null;case"padding":return tL.parse(e.default)||null;case"numberArray":return tO.parse(e.default)||null;case"colorArray":return t$.parse(e.default)||null;case"variableAnchorOffsetCollection":return tU.parse(e.default)||null;case"projectionDefinition":return tj.parse(e.default)||null;default:return void 0===e.default?null:e.default}}function iP(e,t){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=e??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:t}}function iF(e){return"legacy"!==function e(t){if("boolean"==typeof t)return"neutral";if(!Array.isArray(t)||0===t.length)return"legacy";switch(t[0]){case"has":if(t.length<2||"$id"===t[1]||"$type"===t[1])return"legacy";return 2===t.length?"neutral":"expression";case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":case"none":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"any":case"all":var r=t.slice(1);let i=!1;for(let t of r){let r=e(t);if("expression"===r)return"expression";"legacy"===r&&(i=!0)}return i?"legacy":"neutral";default:return"expression"}}(e)}function iz(e){return"$type"===e?["geometry-type"]:"$id"===e?["id"]:["get",e]}function iB(e){if(("<"===e[0]||"<="===e[0]||">"===e[0]||">="===e[0])&&"$type"===e[1])return`"$type" cannot be use with operator "${e[0]}"`;let t=function(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":if(3!==e.length||"string"!=typeof e[1])return null;return[e[0],iz(e[1]),e[2]];case"in":case"!in":{if(e.length<2||"string"!=typeof e[1])return null;let t=["in",iz(e[1]),["literal",e.slice(2)]];return"!in"===e[0]?["!",t]:t}case"has":case"!has":{if(2!==e.length||"string"!=typeof e[1]||"$type"===e[1]||"$id"===e[1])return null;let t=["has",e[1]];return"!has"===e[0]?["!",t]:t}default:return null}}(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function iC(e,t,r){let i=r[e];return Array.isArray(i)?iF(i)?iV(i,t.concat(e)):{path:t.concat(e),legacyFilter:i}:null}function iV(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let r=1;r<e.length;r++){let i=iC(r,t,e);if(i)return i}break;case"!":{let r=iC(1,t,e);if(r)return r;break}case"case":for(let r=1;r<e.length-1;r+=2){let i=iC(r,t,e);if(i)return i}}return null}let iL={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function iO(e,t,r){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};iF(e)?function(e,t){let r=iV(e);if(!r||"u"<typeof console)return;let i=r.path.map(e=>`[${e}]`).join("");console.warn(`${t}${i}: ${iB(r.legacyFilter)}`)}(e,t):e=function e(t){if(!t)return!0;let r=t[0];return t.length<=1?"any"!==r:"=="===r?iR(t[1],t[2],"=="):"!="===r?iq(iR(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?iR(t[1],t[2],r):"any"===r?["any"].concat(t.slice(1).map(e)):"all"===r?["all"].concat(t.slice(1).map(e)):"none"===r?["all"].concat(t.slice(1).map(e).map(iq)):"in"===r?iN(t[1],t.slice(2)):"!in"===r?iq(iN(t[1],t.slice(2))):"has"===r?iU(t[1]):"!has"!==r||iq(iU(t[1]))}(e);let i=iA(e,t,iL,r);if("error"!==i.result)return{filter:(e,t,r)=>i.value.evaluate(e,t,{},r),needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let r=1;r<t.length;r++)if(e(t[r]))return!0;return!1}(e),getGlobalStateRefs:()=>iM(i.value.expression)};throw Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "))}function i$(e,t){return e<t?-1:+(e>t)}function iR(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function iN(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:if(t.length>200&&!t.some(e=>typeof e!=typeof t[0]))return["filter-in-large",e,["literal",t.sort(i$)]];return["filter-in-small",e,["literal",t]]}}function iU(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function iq(e){return["!",e]}function ij(e,t){let r={};for(let i=0;i<e.length;i++){let n=t&&t[e[i].id]||function(e){let t="";for(let r of eW)t+=`/${function e(t){let r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){let r="[";for(let i of t)r+=`${e(i)},`;return`${r}]`}let i=Object.keys(t).sort(),n="{";for(let r=0;r<i.length;r++)n+=`${JSON.stringify(i[r])}:${e(t[i[r]])},`;return`${n}}`}(e[r])}`;return t}(e[i]);t&&(t[e[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(e[i])}let i=[];for(let e in r)i.push(r[e]);return i}function iG(e){let t=e.key,r=e.value;return r?[new eH(t,r,"constants have been deprecated as of v8")]:[]}function iX(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function iY(e){if(Array.isArray(e))return e.map(iY);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=iY(e[r]);return t}return iX(e)}function iZ(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec,l=[],u=ic(r);if("object"!==u)return[new eH(t,r,`object expected, ${u}
1 found`)];for(let e in r){let u,h=e.split(".")[0],c=tk(i,h)||i["*"];if(tk(n,h))u=n[h];else if(tk(i,h)){if(void 0===r[e])continue;u=o}else if(n["*"])u=n["*"];else if(i["*"])u=o;else{l.push(new eH(t,r[e],`unknown property "${e}"`));continue}l=l.concat(u({key:(t?`${t}.`:t)+e,value:r[e],valueSpec:c,style:a,styleSpec:s,object:r,objectKey:e,validateSpec:o},r))}for(let e in i)!n[e]&&i[e].required&&void 0===i[e].default&&void 0===r[e]&&l.push(new eH(t,r,`missing required property "${e}"`));return l}function iW(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.key,o=e.arrayElementValidator||i;if("array"!==ic(t))return[new eH(s,t,`array expected, ${ic(t)} found`)];if(r.length&&t.length!==r.length)return[new eH(s,t,`array length ${r.length} expected, length ${t.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),"object"===ic(r.value)&&(l=r.value);let u=[];for(let r=0;r<t.length;r++)u=u.concat(o({array:t,arrayIndex:r,value:t[r],valueSpec:l,validateSpec:e.validateSpec,style:n,styleSpec:a,key:`${s}[${r}]`}));return u}function iH(e){let t=e.key,r=e.value,i=e.valueSpec,n=ic(r);return("number"===n&&r!=r&&(n="NaN"),"number"!==n)?[new eH(t,r,`number expected, ${n} found`)]:"minimum"in i&&r<i.minimum?[new eH(t,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new eH(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]}function iK(e){let t,r,i,n=e.valueSpec,a=iX(e.value.type),s={},o="categorical"!==a&&void 0===e.value.property,l="array"===ic(e.value.stops)&&"array"===ic(e.value.stops[0])&&"object"===ic(e.value.stops[0][0]),u=iZ({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new eH(e.key,e.value,'identity function may not have a "stops" property')];let t=[],r=e.value;return t=t.concat(iW({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===ic(r)&&0===r.length&&t.push(new eH(e.key,r,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&o&&u.push(new eH(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||u.push(new eH(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!iu(e.valueSpec)&&u.push(new eH(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(o||io(e.valueSpec)?o&&!il(e.valueSpec)&&u.push(new eH(e.key,e.value,"zoom functions not supported")):u.push(new eH(e.key,e.value,"property functions not supported"))),("categorical"===a||l)&&void 0===e.value.property&&u.push(new eH(e.key,e.value,'"property" property is required')),u;function h(e){let t=[],a=e.value,o=e.key;if("array"!==ic(a))return[new eH(o,a,`array expected, ${ic(a)} found`)];if(2!==a.length)return[new eH(o,a,`array length 2 expected, length ${a.length} found`)];if(l){if("object"!==ic(a[0]))return[new eH(o,a,`object expected, ${ic(a[0])} found`)];if(void 0===a[0].zoom)return[new eH(o,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new eH(o,a,"object stop key must have value")];if(i&&i>iX(a[0].zoom))return[new eH(o,a[0].zoom,"stop zoom values must appear in ascending order")];iX(a[0].zoom)!==i&&(i=iX(a[0].zoom),r=void 0,s={}),t=t.concat(iZ({key:`${o}[0]`,value:a[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:iH,value:c}}))}else t=t.concat(c({key:`${o}[0]`,value:a[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},a));return iS(iY(a[1]))?t.concat([new eH(`${o}[1]`,a[1],"expressions are not allowed in function stops.")]):t.concat(e.validateSpec({key:`${o}[1]`,value:a[1],valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function c(e,i){let o=ic(e.value),l=iX(e.value),u=null!==e.value?e.value:i;if(t){if(o!==t)return[new eH(e.key,u,`${o} stop domain type must match previous stop domain type ${t}`)]}else t=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new eH(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==a){let t=`number expected, ${o} found`;return io(n)&&void 0===a&&(t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new eH(e.key,u,t)]}return"categorical"!==a||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===o&&void 0!==r&&l<r?[new eH(e.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in s)?[new eH(e.key,u,"stop domain values must be unique")]:(s[l]=!0,[]):[new eH(e.key,u,`integer expected, found ${l}`)]}}function iJ(e){let t=("property"===e.expressionContext?iT:iA)(iY(e.value),e.key,e.valueSpec);if("error"===t.result)return t.value.map(t=>new eH(`${e.key}${t.key}`,e.value,t.message));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new eH(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!ir(r))return[new eH(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!ir(r))return[new eH(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!ii(r,["zoom","feature-state"]))return[new eH(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!it(r))return[new eH(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function iQ(e){let t=e.key,r=e.value,i=ic(r);return"string"!==i?[new eH(t,r,`color expected, ${i} found`)]:tF.parse(String(r))?[]:[new eH(t,r,`color expected, "${r}" found`)]}function i0(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(iX(r))&&n.push(new eH(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(i.values).indexOf(iX(r))&&n.push(new eH(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function i1(e){let t,r=iY(e.value);return iF(r)?[...(t=iV(r))?[new eH(`${e.key}${t.path.map(e=>`[${e}]`).join("")}`,function(e,t){let r=e;for(let e of t)r=r[e];return r}(e.value,t.path),iB(t.legacyFilter),null,"warning")]:[],...iJ(ih({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:function e(t){let r,i=t.value,n=t.key;if("array"!==ic(i))return[new eH(n,i,`array expected, ${ic(i)} found`)];let a=t.styleSpec,s=[];if(i.length<1)return[new eH(n,i,"filter array must have at least 1 element")];switch(s=s.concat(i0({key:`${n}[0]`,value:i[0],valueSpec:a.filter_operator,style:t.style,styleSpec:t.styleSpec})),iX(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===iX(i[1])&&s.push(new eH(n,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":3!==i.length&&s.push(new eH(n,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&"string"!==(r=ic(i[1]))&&s.push(new eH(`${n}
1[1]`,i[1],`string expected, ${r} found`));for(let e=2;e<i.length;e++)r=ic(i[e]),"$type"===iX(i[1])?s=s.concat(i0({key:`${n}[${e}]`,value:i[e],valueSpec:a.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&s.push(new eH(`${n}[${e}]`,i[e],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let r=1;r<i.length;r++)s=s.concat(e({key:`${n}[${r}]`,value:i[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":r=ic(i[1]),2!==i.length?s.push(new eH(n,i,`filter array for "${i[0]}" operator must have 2 elements`)):"string"!==r&&s.push(new eH(`${n}[1]`,i[1],`string expected, ${r} found`))}return s}(e)}function i2(e,t){let r,i=e.key,n=e.validateSpec,a=e.style,s=e.styleSpec,o=e.value,l=e.objectKey,u=s[`${t}_${e.layerType}`];if(!u)return[];let h=l.match(/^(.*)-transition$/);if("paint"===t&&h&&u[h[1]]&&u[h[1]].transition)return n({key:i,value:o,valueSpec:s.transition,style:a,styleSpec:s});let c=e.valueSpec||u[l];if(!c)return[new eH(i,o,`unknown property "${l}"`)];if("string"===ic(o)&&io(c)&&!c.tokens&&(r=/^{([^}]+)}$/.exec(o)))return[new eH(i,o,`"${l}" does not support interpolation syntax
2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(r[1])} }\`.`)];let p=[];return"symbol"===e.layerType&&"text-font"===l&&ip(iY(o))&&"identity"===iX(o.type)&&p.push(new eH(i,o,'"text-font" does not support identity functions')),p.concat(n({key:e.key,value:o,valueSpec:c,style:a,styleSpec:s,expressionContext:"property",propertyType:t,propertyKey:l}))}function i3(e){return i2(e,"paint")}function i5(e){return i2(e,"layout")}function i6(e){let t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;if("object"!==ic(r))return[new eH(i,r,`object expected, ${ic(r)} found`)];r.type||r.ref||t.push(new eH(i,r,'either "type" or "ref" is required'));let s=iX(r.type),o=iX(r.ref);if(r.id){let a=iX(r.id);for(let s=0;s<e.arrayIndex;s++){let e=n.layers[s];iX(e.id)===a&&t.push(new eH(i,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach(e=>{e in r&&t.push(new eH(i,r[e],`"${e}" is prohibited for ref layers`))}),n.layers.forEach(t=>{iX(t.id)===o&&(e=t)}),e?e.ref?t.push(new eH(i,r.ref,"ref cannot reference another ref layer")):s=iX(e.type):t.push(new eH(i,r.ref,`ref layer "${o}" not found`))}else if("background"!==s)if(r.source){let e=n.sources&&n.sources[r.source],a=e&&iX(e.type);e?"vector"===a&&"raster"===s?t.push(new eH(i,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===s||"raster-dem"!==a&&"color-relief"===s?t.push(new eH(i,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==s?t.push(new eH(i,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s&&"color-relief"!==s?t.push(new eH(i,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===s&&r.paint&&r.paint["line-gradient"]&&("geojson"!==a||!e.lineMetrics)&&t.push(new eH(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new eH(i,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new eH(i,r.source,`source "${r.source}" not found`))}else t.push(new eH(i,r,'missing required property "source"'));return"raster"===s&&r.paint?.resampling&&r.paint?.["raster-resampling"]&&t.push(new eH(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(iZ({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:i1,layout:e=>iZ({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>
2i5(ih({layerType:s},e))}}),paint:e=>iZ({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>i3(ih({layerType:s},e))}})}}))}function i4(e){let t=e.value,r=e.key,i=ic(t);return"string"!==i?[new eH(r,t,`string expected, ${i} found`)]:[]}let i8={promoteId:function({key:e,value:t}){if("string"===ic(t))return i4({key:e,value:t});{let r=[];for(let i in t)r.push(...i4({key:`${e}.${i}`,value:t[i]}));return r}}};function i7(e){let t,r=e.value,i=e.key,n=e.styleSpec,a=e.style,s=e.validateSpec;if(!r.type)return[new eH(i,r,'"type" is required')];let o=iX(r.type);switch(o){case"vector":case"raster":return iZ({key:i,value:r,valueSpec:n[`source_${o.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:i8,validateSpec:s});case"raster-dem":return function(e){let t=e.sourceName??"",r=e.value,i=e.styleSpec,n=i.source_raster_dem,a=e.style,s=[],o=ic(r);if(void 0===r)return s;if("object"!==o)return s.push(new eH("source_raster_dem",r,`object expected, ${o} found`)),s;let l="custom"===iX(r.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let o in r)!l&&u.includes(o)?s.push(new eH(o,r[o],`In "${t}": "${o}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):n[o]?s=s.concat(e.validateSpec({key:o,value:r[o],valueSpec:n[o],validateSpec:e.validateSpec,style:a,styleSpec:i})):s.push(new eH(o,r[o],`unknown property "${o}"`));return s}({sourceName:i,value:r,style:e.style,styleSpec:n,validateSpec:s});case"geojson":if(t=iZ({key:i,value:r,valueSpec:n.source_geojson,style:a,styleSpec:n,validateSpec:s,objectElementValidators:i8}),r.cluster)for(let e in r.clusterProperties){let[n,a]=r.clusterProperties[e],o="string"==typeof n?[n,["accumulated"],["get",e]]:n;t.push(...iJ({key:`${i}.${e}.map`,value:a,validateSpec:s,expressionContext:"cluster-map"})),t.push(...iJ({key:`${i}.${e}.reduce`,value:o,validateSpec:s,expressionContext:"cluster-reduce"}))}return t;case"video":return iZ({key:i,value:r,valueSpec:n.source_video,style:a,validateSpec:s,styleSpec:n});case"image":return iZ({key:i,value:r,valueSpec:n.source_image,style:a,validateSpec:s,styleSpec:n});case"canvas":return[new eH(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return i0({key:`${i}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:s,styleSpec:n})}}function i9(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],s=ic(t);if(void 0===t)return a;
2if("object"!==s)return a.concat([new eH("light",t,`object expected, ${s} found`)]);for(let s in t){let o=s.match(/^(.*)-transition$/);a=o&&i[o[1]]&&i[o[1]].transition?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r})):i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new eH(s,t[s],`unknown property "${s}"`)])}return a}function ne(e){let t=e.value,r=e.styleSpec,i=r.sky,n=e.style,a=ic(t);if(void 0===t)return[];if("object"!==a)return[new eH("sky",t,`object expected, ${a} found`)];let s=[];for(let a in t)s=i[a]?s.concat(e.validateSpec({key:a,value:t[a],valueSpec:i[a],style:n,styleSpec:r})):s.concat([new eH(a,t[a],`unknown property "${a}"`)]);return s}function nt(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],s=ic(t);if(void 0===t)return a;if("object"!==s)return a.concat([new eH("terrain",t,`object expected, ${s} found`)]);for(let s in t)a=i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new eH(s,t[s],`unknown property "${s}"`)]);return a}function nr(e){let t=[],r=e.value,i=e.key;if(!Array.isArray(r))return i4({key:i,value:r});{let n=[],a=[];for(let s in r)r[s].id&&n.includes(r[s].id)&&t.push(new eH(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new eH(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),t=t.concat(iZ({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}}function ni(e){return!!e&&e.constructor===Object}function nn(e){return ni(e.value)?[]:[new eH(e.key,e.value,`object expected, ${ic(e.value)} found`)]}let na={"*":()=>[],array:iW,boolean:function(e){let t=e.value,r=e.key,i=ic(t);return"boolean"!==i?[new eH(r,t,`boolean expected, ${i} found`)]:[]},number:iH,color:iQ,constants:iG,enum:i0,filter:i1,function:iK,layer:i6,object:iZ,source:i7,light:i9,sky:ne,terrain:nt,projection:function(e){let t=e.value,r=e.styleSpec,i=r.projection,n=e.style,a=ic(t);if(void 0===t)return[];if("object"!==a)return[new eH("projection",t,`object expected, ${a} found`)];let s=[];for(let a in t)s=i[a]?s.concat(e.validateSpec({key:a,value:t[a],valueSpec:i[a],style:n,styleSpec:r})):s.concat([new eH(a,t[a],`unknown property "${a}"`)]);return s},projectionDefinition:function(e){var t;let r=e.key,i=e.value,n=ic(i=i instanceof String?i.valueOf():i);return"array"!==n||Array.isArray(t=i)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]||["interpolate","step","literal"].includes(i[0])?["array","string"].includes(n)?[]:[new eH(r,i,`projection expected, invalid type "${n}" found`)]:[new eH(r,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:i4,formatted:function(e){return 0===i4(e).length?[]:iJ(e)},resolvedImage:function(e){return 0===i4(e).length?[]:iJ(e)},padding:function(e){let t=e.key,r=e.value;if("array"!==ic(r))return iH({key:t,value:r,valueSpec:{}});{if(r.length<1||r.length>4)return[new eH(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}},numberArray:function(e){let t=e.key,r=e.value;if("array"!==ic(r))return iH({key:t,value:r,valueSpec:{}});{let i={type:"number"};if(r.length<1)return[new eH(t,r,"array length at least 1 expected, length 0 found")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}},colorArray:function(e){let t=e.key,r=e.value;if("array"!==ic(r))return iQ({key:t,value:r,valueSpec:{}});{if(r.length<1)return[new eH(t,r,"array length at least 1 expected, length 0 found")];let e=[];for(let i=0;i<r.length;i++)e=e.concat(iQ({key:`${t}[${i}]`,value:r[i],valueSpec:{}}));return e}},variableAnchorOffsetCollection:function(e){let t=e.key,r=e.value,i=ic(r),n=e.styleSpec;if("array"!==i||r.length<1||r.length%2!=0)return[new eH(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let i=0;i<r.length;i+=2)a=(a=a.concat(i0({key:`${t}[${i}]`,value:r[i],valueSpec:n.layout_symbol["text-anchor"]}))).concat(iW({key:`${t}[${i+1}]`,value:r[i+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:n}));return a},sprite:nr,state:nn,fontFaces:function(e){let t=e.key,r=e.value,i=e.validateSpec,n=e.styleSpec,a=e.style;if(!ni(r))return[new eH(t,r,`object expected, ${ic(r)} found`)];let s=[];for(let e in r){let o=r[e],l=ic(o);if("string"===l)s.push(...i4({key:`${t}.${e}`,value:o}));else if("array"===l){let r={url:{type:"string",required:!0}
vendor: 4,979 bytes, line 2
2,"unicode-range":{type:"array",value:"string"}};for(let[l,u]of o.entries())s.push(...iZ({key:`${t}.${e}[${l}]`,value:u,valueSpec:r,styleSpec:n,style:a,validateSpec:i}))}else s.push(new eH(`${t}.${e}`,o,`string or array expected, ${l} found`))}return s}};function ns(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return(e.validateSpec=ns,r.expression&&ip(iX(t)))?iK(e):r.expression&&iS(iY(t))?iJ(e):r.type&&na[r.type]?na[r.type](e):iZ(ih({},e,{valueSpec:r.type?i[r.type]:r}))}function no(e){let t=e.value,r=e.key,i=i4(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new eH(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new eH(r,t,'"glyphs" url must include a "{range}" token'))),i}function nl(e,t=eZ){let r=[];return r=r.concat(ns({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:ns,objectElementValidators:{glyphs:no,"*":()=>[]}})),e.constants&&(r=r.concat(iG({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:ns}))),nh(r)}function nu(e){return function(t){return e(Object.assign({},t,{validateSpec:ns}))}}function nh(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function nc(e){return function(...t){return nh(e.apply(this,t))}}nl.source=nc(nu(i7)),nl.sprite=nc(nu(nr)),nl.glyphs=nc(nu(no)),nl.light=nc(nu(i9)),nl.sky=nc(nu(ne)),nl.terrain=nc(nu(nt)),nl.state=nc(nu(nn)),nl.layer=nc(nu(i6)),nl.filter=nc(nu(i1)),nl.paintProperty=nc(nu(i3)),nl.layoutProperty=nc(nu(i5));let np={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};var nf=class{constructor(e,t,r){this._rootKey=t,this._globalState=r,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(null==e||"visible"===e||"none"===e){this._literalValue="none"===e?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let t=iA(e,this._rootKey,np,this._globalState);if("error"===t.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(t.value.map(e=>`${e.key}: ${e.message}`).join(", "));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=iM(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};Object.keys(eZ).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-"));var nd=class e{constructor(e,t,r){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],r=n[2],this.d=t+2*r;for(let e=0;e<this.d*this.d;e++){let t=n[3+e],r=n[3+e+1];i.push(t===r?null:n.subarray(t,r))}let a=n[3+i.length],s=n[3+i.length+1];this.keys=n.subarray(a,s),this.bboxes=n.subarray(s),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;let n=r/t*e;this.min=-n,this.max=e+n}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,i,n,a){this.cells[n].push(a)}query(e,t,r,i,n){let a=this.min,s=this.max;if(e<=a&&t<=a&&s<=r&&s<=i&&!n)return[...this.keys];{let a=[];return this._forEachCell(e,t,r,i,this._queryCell,a,{},n),a}}_queryCell(e,t,r,i,n,a,s,o){let l=this.cells[n];if(null!==l){let n=this.keys,u=this.bboxes;for(let h of l)if(void 0===s[h]){let l=4*h;(o?o(u[l+0],u[l+1],u[l+2],u[l+3]):e<=u[l+2]&&t<=u[l+3]&&r>=u[l+0]&&i>=u[l+1])?(s[h]=!0,a.push(n[h])):s[h]=!1}}}_forEachCell(e,t,r,i,n,a,s,o){let l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i);for(let p=l;p<=h;p++)for(let l=u;l<=c;l++){let u=this.d*l+p;if((!o||o(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&n.call(this,e,t,r,i,u,a,s,o))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,r=0;for(let e of this.cells)r+=e.length;let i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let n=t;for(let t=0;t<e.length;t++){let r=e[t];i[3+t]=n,i.set(r,n),n+=r.length}return i[3+e.length]=n,i.set(this.keys,n),n+=this.keys.length,i[3+e.length+1]=n,i.set(this.bboxes,n),n+=this.bboxes.length,i.buffer}static serialize(e,t){let r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(t){return new e(t.buffer)}};let ny={};function nm(e,t,r={}){if(ny[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}
2),ny[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(let e in nm("Object",Object),nm("Set",Set),nm("TransferableGridIndex",nd),nm("Color",tF),nm("Error",Error),nm("AJAXError",eL),nm("ResolvedImage",tq),nm("StylePropertyFunction",iE),nm("StyleExpression",ib,{omit:["_evaluator"]}),nm("ZoomDependentExpression",iI),nm("ZoomConstantExpression",ik),nm("CompoundExpression",r6,{omit:["_evaluate"]}),r5)r5[e]._classRegistryKey||nm(`Expression_${e}`,r5[e]);function ng(e){return e&&"u">typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor?.name==="ArrayBuffer")}function nx(e){let t=e.constructor;return e.$name||t._classRegistryKey}function nv(e){return!function(e){if(null===e||"object"!=typeof e)return!1;let t=nx(e);return t&&"Object"!==t}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||ng(e)||ek(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function nb(e,t){if(nv(e))return(ng(e)||ek(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let i of e)r.push(nb(i,t));return r}if("object"!=typeof e)throw Error(`can't serialize object of type ${typeof e}`);let r=nx(e);if(!r)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!ny[r])throw Error(`${r} is not registered.`);let{klass:i}=ny[r],n=i.serialize?i.serialize(e,t):{};if(i.serialize){if(n===t?.[t.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let i in e){if(!e.hasOwnProperty(i)||ny[r].omit.includes(i))continue;let a=e[i];void 0!==a&&(n[i]=ny[r].shallow.includes(i)?a:nb(a,t))}e instanceof Error&&(n.message=e.message)}if(n.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(n.$name=r),n}function nw(e){if(nv(e))return e;if(Array.isArray(e))return e.map(nw);if("object"!=typeof e)throw Error(`can't deserialize object of type ${typeof e}`);let t=nx(e)||"Object";if(!ny[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:r}=ny[t];if(!r)throw Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let n=e[r];i[r]=ny[t].shallow.includes(r)?n:nw(n)}return i}var n_=class{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}};function nS(e){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function nA(e){return/\s/u.test(String.fromCodePoint(e))}function nk(e){for(let t of e)if(nS(t.codePointAt(0)))return!0;return!1}function nI(e){return RegExp(e.map(e=>{try{return RegExp(`\\p{sc=${e}}`,"u").source}catch{return null}}).filter(e=>e).join("|"),"u")}let nT=nI(["Arab","Dupl","Mong","Ougr","Syrc"]);function nE(e){return!(nS(e)||/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e)))}
2let nM=nI(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function nD(e){return nM.test(String.fromCodePoint(e))}let nP=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(nP.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,t){if(this.isParsed())return this.getState();if("loading"!==e.pluginStatus)return this.setState(e),e;let r=e.pluginURL,i=new Promise(e=>{this.loadScriptResolve=e}),n=new Promise(e=>setTimeout(()=>e(),this.TIMEOUT));if(await t(r),await Promise.race([i,n]),this.isParsed()){let e={pluginStatus:"loaded",pluginURL:r};return this.setState(e),e}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};var nF=class{constructor(e,t){this.isSupportedScript=nz,this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new n_,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new n_,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}};function nz(e){var t="loaded"===nP.getRTLTextPluginStatus();for(let r of e)if(!function(e,t){return!(!t&&nD(e))&&!/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(e))}(r.codePointAt(0),t))return!1;return!0}
vendor: 4,570 bytes, line 2
2var nB=class{constructor(e,t,r,i){this.property=e,this.value=t,this.expression=function(e,t,r,i){if(ip(e))return new iE(e,t,r);if(iS(e)){let n=iT(e,t,r,i);if("error"===n.result)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(", "));return n.value}{let t=e;return"color"===r.type&&"string"==typeof e?t=tF.parse(e):"padding"===r.type&&("number"==typeof e||Array.isArray(e))?t=tL.parse(e):"numberArray"===r.type&&("number"==typeof e||Array.isArray(e))?t=tO.parse(e):"colorArray"===r.type&&("string"==typeof e||Array.isArray(e))?t=t$.parse(e):"variableAnchorOffsetCollection"===r.type&&Array.isArray(e)?t=tU.parse(e):"projectionDefinition"===r.type&&"string"==typeof e&&(t=tj.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>t}}}(void 0===t?e.specification.default:t,r,e.specification,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}},nC=class{constructor(e,t,r){this.property=e,this.value=new nB(e,void 0,t,r)}transitioned(e,t){return new nL(this.property,this.value,t,ex({},e.transition,this.transition),e.now)}untransitioned(){return new nL(this.property,this.value,null,{},0)}},nV=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return eb(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new nC(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new nB(this._values[e].property,null===t?void 0:eb(t),this._propertyRootKey(e),this._globalState)}getTransition(e){return eb(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new nC(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=eb(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let i=this.getTransition(t);void 0!==i&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){let r=new nO(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new nO(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},nL=class{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(!a)return n;if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;{if(i<this.begin)return a.possiblyEvaluate(e,t,r);let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,function(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(s))}}},nO=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new nN(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},n$=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return void 0!==this._values[e].value}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return eb(this._values[e].value)}setValue(e,t){this._values[e]=new nB(this._values[e].property,null===t?void 0:eb(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new nN(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}},nR=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}
2evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}},nN=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};function nU(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function nq(e,t){let r=nU(e),i=nU(t);return void 0!==r&&void 0!==i&&r!==i}var nj=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){if(nq(e,t))return e_(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=ra[this.specification.type];return i?i(e,t,r):e}},nG=class{constructor(e,t,r){this.specification=e,this.name=t,this.overrides=r}possiblyEvaluate(e,t,r,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new nR(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)},t):new nR(this,e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new nR(this,{kind:"constant",value:void 0},e.parameters);if(nq(e.value.value,t.value.value))return e_(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=ra[this.specification.type];return i?new nR(this,{kind:"constant",value:i(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,i,n,a){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,a)}},nX=class extends nG{possiblyEvaluate(e,t,r,i){if(void 0===e.value)return new nR(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i),a="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n;return new nR(this,{kind:"constant",value:this._calculate(a,a,a,t)},t)}return"camera"===e.expression.kind?new nR(this,{kind:"constant",value:this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t)},t):new nR(this,e.expression,t)}evaluate(e,t,r,i,n,a){if("source"===e.kind){let s=e.evaluate(t,r,i,n,a);return this._calculate(s,s,s,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},nY=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){if(void 0!==e.value){if("constant"!==e.expression.kind)return this._calculate(e.expression.evaluate(new nF(Math.floor(t.zoom-1),t)),e.expression.evaluate(new nF(Math.floor(t.zoom),t)),e.expression.evaluate(new nF(Math.floor(t.zoom+1),t)),t);{let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},nZ=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}},nW=class{constructor(e){for(let t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new nB(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[t]=new nC(r,r.name,void 0);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}};nm("DataDrivenProperty",nG),nm("DataConstantProperty",nj),nm("CrossFadedDataDrivenProperty",nX),nm("CrossFadedProperty",nY),nm("ColorRampProperty",nZ);let nH=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",nK=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";var nJ=class extends eY{constructor(e,t,r){var i;if(super(),this.id=e.id,this.type=e.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(i=this.visibility,new nf(i,`layers[${this.id}].layout.visibility`,r)),"custom"===e.type)return;if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=iO(e.filter,`layers[${this.id}].filter`,r)),t.layout&&(this._unevaluatedLayout=new n$(t.layout,`layers[${this.id}].layout`,r)),t.paint){for(let i in this._transitionablePaint=new nV(t.paint,`layers[${this.id}].paint`,r),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new nN(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=iO(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if("visibility"===e)return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+nH);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values)for(let r of this._unevaluatedLayout._values[t].getGlobalStateRefs())e.add(r);for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let r=this._transitionablePaint._values[t].value;for(let i of r.getGlobalStateRefs()){let n=e.get(i)??[];n.push({name:t,value:r.value}),e.set(i,n)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,r={}){if("visibility"===e){this.visibility=t,this._visibilityExpression.setValue(t),this.recalculateVisibility();return}this._transitionablePaint?.hasProperty(e)?this.fire(new eX(Error(e+nH))):null!=t&&this._val
vendor: 1,894 bytes, line 2
2idate(nl.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,r)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith("-transition")){let t=e.slice(0,-11);if("visibility"===t||this._unevaluatedLayout?.hasProperty(t))throw Error(e+nK);return this._transitionablePaint.getTransition(t)}if("visibility"===e||this._unevaluatedLayout?.hasProperty(e))throw Error(e+nK);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if("visibility"===e||this._unevaluatedLayout?.hasProperty(e))return this.fire(new eX(Error(e+nK))),!1;if(null!=t&&this._validate(nl.paintProperty,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let r=this._transitionablePaint._values[e],i="cross-faded-data-driven"===r.property.specification["property-type"],n=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let s=this._transitionablePaint._values[e].value;return s.isDataDriven()||n||i||this._handleOverridablePaintPropertyUpdate(e,a,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e=this.minzoom,t=!1){return!!(this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom))||!!this.maxzoom&&e>=this.maxzoom||"none"===this._evaluatedVisibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}
2serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(e.layout||={},e.layout.visibility=this.visibility),function(e,t){let r={};for(let i in e)t.call(this,e[i],i,e)&&(r[i]=e[i]);return r}(e,(e,t)=>void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length))}_validate(e,t,r,i,n={}){return function(e,t,r,i){if(i?.validate===!1)return!1;var n=t({styleSpec:eZ,...r});let a=!1;for(let t of n){if("warning"===t.severity){e_(t.message);continue}e.fire(new eX(Error(t.message))),a=!0}return a}(this,e,{key:t,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof nR&&io(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}},nQ={get paint(){return o=o||new nW({"raster-opacity":new nj(eZ.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new nj(eZ.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new nj(eZ.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new nj(eZ.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new nj(eZ.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new nj(eZ.paint_raster["raster-contrast"],"raster-contrast"),resampling:new nj(eZ.paint_raster.resampling,"resampling"),"raster-resampling":new nj(eZ.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new nj(eZ.paint_raster["raster-fade-duration"],"raster-fade-duration")})}},n0=class extends nJ{constructor(e,t){super(e,nQ,t)}};let n1={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};var n2=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},n3=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function n5(e,t=1){let r=0,i=0;return{members:e.map(e=>{let n=n1[e.type].BYTES_PER_ELEMENT,a=r=n6(r,Math.max(t,n)),s=e.components||1;return i=Math.max(i,n),r+=n*s,{name:e.name,type:e.type,components:s,offset:a}}),size:n6(r,Math.max(i,t)),alignment:t}}function n6(e,t){return Math.ceil(e/t)*t}var n4=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}};n4.prototype.bytesPerElement=4,nm("StructArrayLayout2i4",n4);var n8=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}
vendor: 4,085 bytes, line 2
2emplace(e,t,r,i){let n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}};n8.prototype.bytesPerElement=6,nm("StructArrayLayout3i6",n8);var n7=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}};n7.prototype.bytesPerElement=8,nm("StructArrayLayout4i8",n7);var n9=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};n9.prototype.bytesPerElement=12,nm("StructArrayLayout2i4i12",n9);var ae=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=4*e,l=8*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,e}};ae.prototype.bytesPerElement=8,nm("StructArrayLayout2i4ub8",ae);var at=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}};at.prototype.bytesPerElement=8,nm("StructArrayLayout2f8",at);var ar=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,i,n,a,s,o,l,u)}emplace(e,t,r,i,n,a,s,o,l,u,h){let c=10*e;return this.uint16[c+0]=t,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,e}};ar.prototype.bytesPerElement=20,nm("StructArrayLayout10ui20",ar);var ai=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,s,o)}emplace(e,t,r,i,n,a,s,o,l){let u=8*e;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,e}};ai.prototype.bytesPerElement=16,nm("StructArrayLayout8ui16",ai);var an=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,h,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,a,s,o,l,u,h,c)}emplace(e,t,r,i,n,a,s,o,l,u,h,c,p){let f=12*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=o,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=h,this.int16[f+10]=c,this.int16[f+11]=p,e}};an.prototype.bytesPerElement=24,nm("StructArrayLayout4i4ui4i24",an);var aa=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}};aa.prototype.bytesPerElement=12,nm("StructArrayLayout3f12",aa);var as=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[+e+0]=t,e}};
2as.prototype.bytesPerElement=4,nm("StructArrayLayout1ul4",as);var ao=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,s,o,l)}emplace(e,t,r,i,n,a,s,o,l,u){let h=10*e;return this.int16[h+0]=t,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[5*e+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,e}};ao.prototype.bytesPerElement=20,nm("StructArrayLayout6i1ul2ui20",ao);var al=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};al.prototype.bytesPerElement=12,nm("StructArrayLayout2i2i2i12",al);var au=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let s=4*e,o=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,e}};au.prototype.bytesPerElement=16,nm("StructArrayLayout2f1f2i16",au);var ah=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=16*e,l=4*e,u=8*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,e}};ah.prototype.bytesPerElement=16,nm("StructArrayLayout2ub2f2i16",ah);var ac=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}};ac.prototype.bytesPerElement=6,nm("StructArrayLayout3ui6",ac);var ap=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m){let g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m)}emplace(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=24*e,v=12*e,b=48*e;return this.int16[x+0]=t,this.int16[x+1]=r,this.uint16[x+2]=i,this.uint16[x+3]=n,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=o,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=h,this.float32[v+7]=c,this.float32[v+8]=p,this.uint8[b+36]=f,this.uint8[b+37]=d,this.uint8[b+38]=y,this.uint32[v+10]=m,this.int16[x+22]=g,e}};ap.prototype.bytesPerElement=48,nm("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ap);var af=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,S,A,k,I,T){let E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,S,A,k,I,T)}emplace(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,S,A,k,I,T,E){let M=32*e,D=16*e;return this.int16[M+0]=t,this.int16[M+1]=r,this.int16[M+2]=i,this.int16[M+3]=n,this.int16[M+4]=a,this.int16[M+5]=s,this.int16[M+6]=o,this.int16[M+7]=l,this.uint16[M+8]=u,this.uint16[M+9]=h,this.uint16[M+10]=c,this.uint16[M+11]=p,this.uint16[M+12]=f,this.uint16[M+13]=d,this.uint16[M+14]=y,this.uint16[M+15]=m,this.uint16[M+16]=g,this.uint16[M+17]=x,this.uint16[M+18]=v,this.uint16[M+19]=b,this.uint16[M+20]=w,this.uint16[M+21]=_,this.uint16[M+22]=S,this.uint32[D+12]=A,this.float32[D+13]=k,this.float32[D+14]=I,this.uint16[M+30]=T,this.uint16[M+31]=E,e}};af.prototype.bytesPerElement=64,nm("StructArrayLayout8i15ui1ul2f2ui64",af);var ad=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[+e+0]=t,e}};
vendor: 4,857 bytes, line 2
2ad.prototype.bytesPerElement=4,nm("StructArrayLayout1f4",ad);var ay=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[6*e+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}};ay.prototype.bytesPerElement=12,nm("StructArrayLayout1ui2f12",ay);var am=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=4*e;return this.uint32[2*e+0]=t,this.uint16[n+2]=r,this.uint16[n+3]=i,e}};am.prototype.bytesPerElement=8,nm("StructArrayLayout1ul2ui8",am);var ag=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}};ag.prototype.bytesPerElement=4,nm("StructArrayLayout2ui4",ag);var ax=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[+e+0]=t,e}};ax.prototype.bytesPerElement=2,nm("StructArrayLayout1ui2",ax);var av=class extends n3{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}};av.prototype.bytesPerElement=16,nm("StructArrayLayout4f16",av);var ab=class extends n2{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new ei(this.anchorPointX,this.anchorPointY)}};ab.prototype.size=20;var aw=class extends ao{get(e){return new ab(this,e)}};nm("CollisionBoxArray",aw);var a_=class extends n2{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};a_.prototype.size=48;var aS=class extends ap{get(e){return new a_(this,e)}};nm("PlacedSymbolArray",aS);var aA=class extends n2{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}
2get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};aA.prototype.size=64;var ak=class extends af{get(e){return new aA(this,e)}};nm("SymbolInstanceArray",ak);var aI=class extends ad{getoffsetX(e){return this.float32[+e+0]}};nm("GlyphOffsetArray",aI);var aT=class extends n8{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}};nm("SymbolLineVertexArray",aT);var aE=class extends n2{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};aE.prototype.size=12;var aM=class extends ay{get(e){return new aE(this,e)}};nm("TextAnchorOffsetArray",aM);var aD=class extends n2{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};aD.prototype.size=8;var aP=class extends am{get(e){return new aD(this,e)}};nm("FeatureIndexArray",aP);var aF=class extends n4{},az=class extends n4{},aB=class extends n4{},aC=class extends n9{},aV=class extends ae{},aL=class extends at{},aO=class extends ar{},a$=class extends ai{},aR=class extends an{},aN=class extends aa{},aU=class extends as{},aq=class extends al{},aj=class extends ah{},aG=class extends ac{},aX=class extends ag{};let aY=n5([{name:"a_pos",components:2,type:"Int16"}],4),aZ=aY.members;aY.size,aY.alignment;var aW=class e{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(t,r,i,n){let a=this.segments[this.segments.length-1];return(t>e.MAX_VERTEX_ARRAY_LENGTH&&e_(`Max vertices per segment is ${e.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${e.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)?this.createNewSegment(r,i,n):a}createNewSegment(e,t,r){let i={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==r&&(i.sortKey=r),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,t,r){return this.prepareSegment(0,e,t,r)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,r,i,n){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};function aH(e,t){return 256*(e=eg(Math.floor(e),0,255))+(t=eg(Math.floor(t),0,255))}aW.MAX_VERTEX_ARRAY_LENGTH=65535,nm("SegmentVector",aW);let aK=n5([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),aJ=n5([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var aQ=er((e,t)=>
2{void 0!==t&&(t.exports=function(e,t){for(var r,i,n=3&e.length,a=e.length-n,s=t,o=0;o<a;)i=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24,++o,s^=i=(65535&(i=(i=(65535&i)*0xcc9e2d51+(((i>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|i>>>17))*0x1b873593+(((i>>>16)*0x1b873593&65535)<<16)|0,s=(65535&(r=(65535&(s=s<<13|s>>>19))*5+(((s>>>16)*5&65535)<<16)|0))+27492+(((r>>>16)+58964&65535)<<16);switch(i=0,n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i^=255&e.charCodeAt(o),s^=i=(65535&(i=(i=(65535&i)*0xcc9e2d51+(((i>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|i>>>17))*0x1b873593+(((i>>>16)*0x1b873593&65535)<<16)|0}return s^=e.length,s^=s>>>16,s=(65535&s)*0x85ebca6b+(((s>>>16)*0x85ebca6b&65535)<<16)|0,s^=s>>>13,s=(65535&s)*0xc2b2ae35+(((s>>>16)*0xc2b2ae35&65535)<<16)|0,(s^=s>>>16)>>>0})}),a0=er((e,t)=>{t.exports=function(e,t){for(var r,i=e.length,n=t^i,a=0;i>=4;)r=(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))*0x5bd1e995+(((r>>>16)*0x5bd1e995&65535)<<16),r^=r>>>24,n=(65535&n)*0x5bd1e995+(((n>>>16)*0x5bd1e995&65535)<<16)^(r=(65535&r)*0x5bd1e995+(((r>>>16)*0x5bd1e995&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n^=255&e.charCodeAt(a),n=(65535&n)*0x5bd1e995+(((n>>>16)*0x5bd1e995&65535)<<16)}return n^=n>>>13,n=(65535&n)*0x5bd1e995+(((n>>>16)*0x5bd1e995&65535)<<16),(n^=n>>>15)>>>0}}),a1=((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,n=Q(t),a=0,s=n.length;a<s;a++)i=n[a],et.call(e,i)||void 0===i||K(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(r=J(t,i))||r.enumerable});return e})(K(null!=(k=(er((e,t)=>{var r=aQ(),i=a0();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i}))())?H(ee(k)):{},"default",{value:k,enumerable:!0}),k),a2=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(a3(e)),this.positions.push(t,r,i)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let t=a3(e),r=0,i=this.ids.length-1;for(;r<i;){let e=r+i>>1;this.ids[e]>=t?i=e:r=e+1}let n=[];for(;this.ids[r]===t;){let e=this.positions[3*r],t=this.positions[3*r+1],i=this.positions[3*r+2];n.push({index:e,start:t,end:i}),r++}return n}static serialize(e,t){let r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return function e(t,r,i,n){for(;i<n;){let a=t[i+n>>1],s=i-1,o=n+1;for(;;){do s++;while(t[s]<a)do o--;while(t[o]>a)if(s>=o)break;a5(t,s,o),a5(r,3*s,3*o),a5(r,3*s+1,3*o+1),a5(r,3*s+2,3*o+2)}o-i<n-o?(e(t,r,i,o),i=o+1):(e(t,r,o+1,n),n=o)}}(r,i,0,r.length-1),t&&t.push(r.buffer,i.buffer),{ids:r,positions:i}}static deserialize(t){let r=new e;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};function a3(e){let t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:(0,a1.default)(String(e))}function a5(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}nm("FeaturePositionMap",a2);var a6=class{constructor(e,t){this.gl=e.gl,this.location=t}},a4=class extends a6{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},a8=class extends a6{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},a7=class extends a6{constructor(e,t){super(e,t),this.current=tF.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};function a9(e){return[aH(255*e.r,255*e.g),aH(255*e.b,255*e.a)]}var se=class{constructor(e,t,r){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new a7(e,t):new a4(e,t)}},st=class{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}
vendor: 4,411 bytes, line 2
2setUniform(e,t,r,i){let n=null;"u_pattern_to"===i?n=this.patternTo:"u_pattern_from"===i?n=this.patternFrom:"u_dasharray_to"===i?n=this.dashTo:"u_dasharray_from"===i?n=this.dashFrom:"u_pixel_ratio_to"===i?n=this.pixelRatioTo:"u_pixel_ratio_from"===i&&(n=this.pixelRatioFrom),null!==n&&e.set(n)}getBinding(e,t,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new a8(e,t):new a4(e,t)}},sr=class{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,t,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new nF(0,r),t,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new nF(0,n),r,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){let i=a9(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},si=class{constructor(e,t,r,i,n,a){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,r){let i=this.expression.evaluate(new nF(this.zoom,r),t,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new nF(this.zoom+1,r),t,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,i,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new nF(this.zoom,n),r,i),s=this.expression.evaluate(new nF(this.zoom+1,n),r,i);this._setPaintValue(e,t,a,s)}_setPaintValue(e,t,r,i){if("color"===this.type){let n=a9(r),a=a9(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],a[0],a[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=eg(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new a4(e,t)}},sn=class{constructor(e,t,r,i,n,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,this.getPositionIds(t),r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,this.getPositionIds(r),n)}_setPaintValues(e,t,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let r=e;r<t;r++)this.emplace(this.zoomInPaintVertexArray,r,a,s),this.emplace(this.zoomOutPaintVertexArray,r,o,s)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},sa=class extends sn{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return aK.members}
2emplace(e,t,r,i){e.emplace(t,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},ss=class extends sn{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return aJ.members}emplace(e,t,r,i){e.emplace(t,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},so=class{constructor(e,t,r){this.binders={},this._buffers=[];let i=[];for(let s in e.paint._values){var n,a;if(!r(s))continue;let o=e.paint.get(s);if(!(o instanceof nR)||!io(o.property.specification))continue;let l=(n=s,a=e.type,({"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]})[n]||[n.replace(`${a}-`,"").replace(/-/g,"_")]),u=o.value,h=o.property.specification.type,c=o.property.useIntegerZoom,p=o.property.specification["property-type"],f="cross-faded"===p||"cross-faded-data-driven"===p;if("constant"===u.kind)this.binders[s]=f?new st(u.value,l):new se(u.value,l,h),i.push(`/u_${s}`);else if("source"===u.kind||f){let r=su(s,h,"source");this.binders[s]=f?"line-dasharray"===s?new ss(u,h,c,t,r,e.id):new sa(u,h,c,t,r,e.id):new sr(u,l,h,r),i.push(`/a_${s}`)}else{let e=su(s,h,"composite");this.binders[s]=new si(u,l,h,c,t,e),i.push(`/z_${s}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof sr||t instanceof si?t.maxValue:0}populatePaintArrays(e,t,r){for(let i in this.binders){let n=this.binders[i];(n instanceof sr||n instanceof si||n instanceof sn)&&n.populatePaintArray(e,t,r)}}setConstantPatternPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof st&&i.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof st&&i.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let a=!1;for(let s of e)for(let e of t.getPositions(s.id)){let t=r.feature(e.index);for(let r in this.binders){let o=this.binders[r];(o instanceof sr||o instanceof si||o instanceof sn)&&!0===o.expression.isStateDependent&&(o.expression=i.paint.get(r).value,o.updatePaintArray(e.start,e.end,t,s.state,n),a=!0)}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof se||r instanceof st)&&e.push(...r.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof sr||r instanceof si)for(let t of r.paintVertexAttributes)e.push(t.name);else if(r instanceof sn)for(let t of r.getVertexAttributes())e.push(t.name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof se||r instanceof st||r instanceof si)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof se||n instanceof st||n instanceof si){for(let a of n.uniformNames)if(t[a]){let s=n.getBinding(e,t[a],a);
2r.push({name:a,property:i,binding:s})}}}return r}setUniforms(e,t,r,i){for(let{name:e,property:n,binding:a}of t)this.binders[n].setUniform(a,i,r.get(n),e)}updatePaintBuffers(e){for(let t in this._buffers=[],this.binders){let r=this.binders[t];if(e&&r instanceof sn){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof sr||r instanceof si)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof sr||r instanceof si||r instanceof sn)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof sr||t instanceof si||t instanceof sn)&&t.destroy()}}},sl=class{constructor(e,t,r=()=>!0){for(let i of(this.programConfigurations={},e))this.programConfigurations[i.id]=new so(i,t,r);this.needsUpload=!1,this._featureMap=new a2,this._bufferOffset=0}populatePaintArrays(e,t,r,i){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function su(e,t,r){return({"line-pattern":{source:aO,composite:aO},"fill-pattern":{source:aO,composite:aO},"fill-extrusion-pattern":{source:aO,composite:aO},"line-dasharray":{source:a$,composite:a$}})[e]?.[r]||({color:{source:at,composite:av},number:{source:ad,composite:at}})[t][r]}nm("ConstantBinder",se),nm("CrossFadedConstantBinder",st),nm("SourceExpressionBinder",sr),nm("CrossFadedPatternBinder",sa),nm("CrossFadedDasharrayBinder",ss),nm("CompositeExpressionBinder",si),nm("ProgramConfiguration",so,{omit:["_buffers"]}),nm("ProgramConfigurationSet",sl);function sh(e){let t=ed/e.extent,r=e.loadGeometry();for(let e of r)for(let r of e){let e=Math.round(r.x*t),i=Math.round(r.y*t);r.x=eg(e,-16384,16383),r.y=eg(i,-16384,16383),(e<r.x||e>r.x+1||i<r.y||i>r.y+1)&&e_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function sc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?sh(e):[]}}var sp=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new az,this.indexArray=new aG,this.segments=new aW,this.programConfigurations=new sl(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){let i=this.layers[0],n=[],a=null,s=!1,o="heatmap"===i.type;"circle"===i.type&&(s=!(a=i.layout.get("circle-sort-key")).isConstant(),o||="map"===i.paint.get("circle-pitch-alignment"));let l=o?t.subdivisionGranularity.circle:1,u=new nF(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:i,index:o,sourceLayerIndex:l}of e){let e=sc(t,h);if(!this.layers[0]._featureFilter.filter(u,e,r))continue;let c=s?a.evaluate(e,{},r):void 0,p={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:h?e.geometry:sh(t),patterns:{},sortKey:c};n.push(p)}for(let i of(s&&n.sort((e,t)=>
2e.sortKey-t.sortKey),n)){let{geometry:n,index:a,sourceLayerIndex:s}=i,o=e[a].feature;this.addFeature(i,n,a,r,l),t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,aZ),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let r of t)for(let t of r){let r=t.x,i=t.y;if(r<0||r>=8192||i<0||i>=8192)continue;let n=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),h=n.vertexLength;for(let e=0;e<s;e++)for(let t=0;t<s;t++){var o,l,u;o=this.layoutVertexArray,l=a[t],u=a[e],o.emplaceBack(-32768+8*r+l,-32768+8*i+u)}for(let e=0;e<s-1;e++)for(let t=0;t<s-1;t++){let r=h+e*s+t,i=h+(e+1)*s+t;this.indexArray.emplaceBack(r,i+1,r+1),this.indexArray.emplaceBack(r,i,i+1)}n.vertexLength+=s*s,n.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:{},canonical:i})}};function sf(e,t,r){return!!sv(e,t)||sm(t,e,r)}function sd(e,t){if(1===e.length)return sx(t,e[0]);for(let r of t)for(let t of r)if(sv(e,t))return!0;for(let r of e)if(sx(t,r))return!0;for(let r of t)if(sy(e,r))return!0;return!1}function sy(e,t){if(0===e.length||0===t.length)return!1;for(let s=0;s<e.length-1;s++){let o=e[s],l=e[s+1];for(let e=0;e<t.length-1;e++){var r,i,n,a;let s=t[e];if(r=o,i=l,eS(r,n=s,a=t[e+1])!==eS(i,n,a)&&eS(r,i,n)!==eS(r,i,a))return!0}}return!1}function sm(e,t,r){let i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++)if(sg(e,t[r-1],t[r])<i)return!0;return!1}function sg(e,t,r){let i=t.distSqr(r);if(0===i)return e.distSqr(t);let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return n<0?e.distSqr(t):n>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(n)._add(t))}function sx(e,t){let r=!1,i,n;for(let a of e)for(let e=0,s=a.length-1;e<a.length;s=e++)i=a[e],n=a[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(r=!r);return r}function sv(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){let a=e[i],s=e[n];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function sb(e,t,r){let i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function sw(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function s_(e,t,r,i,n){if(!t[0]&&!t[1])return e;let a=ei.convert(t)._mult(n);"viewport"===r&&a._rotate(-i);let s=[];for(let t of e)s.push(t.sub(a));return s}function sS({queryGeometry:e,size:t},r){return sf(e,r,t)}function sA({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return sf(e,a,t*(r.projectTileCoordinates(a.x,a.y,i,n).signedDistanceFromCamera/r.cameraToCenterDistance))}function sk({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){let s=r.projectTileCoordinates(a.x,a.y,i,n).signedDistanceFromCamera,o=t*(r.cameraToCenterDistance/s);return sf(e,sE(a,r,i,n),o)}function sI({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return sf(e,sE(a,r,i,n),t)}function sT({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a="map",pitchScale:s="map"},o){let l="map"===a?"map"===s?sS:sA:"map"===s?sk:sI,u={queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n};for(let e of o)for(let t of e)if(l(u,t))return!0;return!1}function sE(e,t,r,i){let n=t.projectTileCoordinates(e.x,e.y,r,i).point;return new ei((.5*n.x+.5)*t.width,(-(.5*n.y)+.5)*t.height)}nm("CircleBucket",sp,{omit:["layers"]});var sM={get paint(){return u=u||new nW({"circle-radius":new nG(eZ.paint_circle["circle-radius"],"cir
2cle-radius"),"circle-color":new nG(eZ.paint_circle["circle-color"],"circle-color"),"circle-blur":new nG(eZ.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new nG(eZ.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new nj(eZ.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new nj(eZ.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new nj(eZ.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new nj(eZ.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new nG(eZ.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new nG(eZ.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new nG(eZ.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})},get layout(){return l=l||new nW({"circle-sort-key":new nG(eZ.layout_circle["circle-sort-key"],"circle-sort-key")})}},sD=class extends nJ{constructor(e,t){super(e,sM,t)}createBucket(e){return new sp(e)}queryRadius(e){return sb("circle-radius",this,e)+sb("circle-stroke-width",this,e)+sw(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l,u,h=s_(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),p=this.paint.get("circle-pitch-scale"),f=this.paint.get("circle-pitch-alignment");if("map"===f)l=h,u=c*a;else l=h.map(e=>sE(e,n,s,o)),u=c;return sT({queryGeometry:l,size:u,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:f,pitchScale:p},i)}},sP=class extends sp{};nm("HeatmapBucket",sP,{omit:["layers"]});var sF={get paint(){return h=h||new nW({"heatmap-radius":new nG(eZ.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new nG(eZ.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new nj(eZ.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new nZ(eZ.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new nj(eZ.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})}};function sz(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${t*r*i}`)}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function sB(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=sz({},{width:t,height:r},i);sC(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function sC(e,t,r,i,n,a){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=e.data,o=t.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let u=((r.y+l)*e.width+r.x)*a,h=((i.y+l)*t.width+i.x)*a;for(let e=0;e<n.width*a;e++)o[h+e]=s[u+e]}return t}var sV=class e{constructor(e,t){sz(this,e,1,t)}resize(e){sB(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){sC(e,t,r,i,n,1)}},sL=class e{constructor(e,t){sz(this,e,4,t)}resize(e){sB(this,e,4)}replace(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){sC(e,t,r,i,n,4)}setPixel(e,t,r){let i=(e*this.width+t)*4;this.data[i+0]=Math.round(255*r.r/r.a),this.data[i+1]=Math.round(255*r.g/r.a),this.data[i+2]=Math.round(255*r.b/r.a),this.data[i+3]=Math.round(255*r.a)}};function sO(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=4){let i=e[r+3];t[r+0]=Math.round(e[r+0]*i/255),t[r+1]=Math.round(e[r+1]*i/255),t[r+2]=Math.round(e[r+2]*i/255),t[r+3]=i}return t}nm("AlphaImage",sV),nm("RGBAImage",sL);var s$=class extends nJ{createBucket(e){return new sP(e)}constructor(e,t){super(e,sF,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=function(e){let t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new sL({width:r,height:i});if(Math.log(r)/Math.LN2%1!=0)throw Error(`width is not a power of 2 - ${r}`);let a=(i,a,s)=>{t[e.evaluationKey]=s;let o=e.expression.evaluate(t);n.setPixel(i/4/r,a/4,o)};if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,s=0;i<r;i++,s+=4){let o=i/(r-1),{start:l,end:u}=e.clips[t];a(n,s,l*(1-o)+u*o)}else for(let e=0,t=0;e<r;e++,t+=4)a(0,t,e/(r-1));return n}({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete("big-fb")}queryRadius(e){return sb("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return sT({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,r)*a,transform:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}},sR={get paint(){return c=c||new nW({"hillshade-illumination-direction":new nj(eZ.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new nj(eZ.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new nj(eZ.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new nj(eZ.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new nj(eZ.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new nj(eZ.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new nj(eZ.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new nj(eZ.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new nj(eZ.paint_hillshade.resampling,"resampling")})}},sN=class extends nJ{constructor(e,t){super(e,sR,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(e.length,t.length,r.length,i.length);e=e.concat(Array(n-e.length).fill(e.at(-1))),t=t.concat(Array(n-t.length).fill(t.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=t.map(eM);return{directionRadians:e.map(eM),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}},sU={get paint(){return p=p||new nW({"color-relief-opacity":new nj(eZ["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new nZ(eZ["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new nj(eZ["paint_color-relief"].resampling,"resampling")})}};function sq(e){return"data"in e}
2var sj=class{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,i)}update(e,t,r){let{width:i,height:n}=e,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!t?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.filter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&t?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let t=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,t,o.RGBA8,i,n),sq(e)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:t}=e;l&&t&&(t=sO(t)),t&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,t)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,e)}else sq(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(e,o));else{let{x:t,y:a}=r||{x:0,y:0};sq(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,l,t,a,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(e,t,a,o))}this.useMipmap&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,r,i,n){let{data:a}=e;t&&a&&(a=sO(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(e,t,r,i){i.texSubImage2D(i.TEXTURE_2D,0,t,r,i.RGBA,i.UNSIGNED_BYTE,e)}_updateRawData(e,t,r,i,n,a,s){let{data:o}=e;t&&o&&(o=sO(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(e,t,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.useMipmap||(r=n.LINEAR),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},sG=class e{static{this.byteViewCache=new WeakMap}constructor(t,r,i,n=1,a=1,s=1,o=0){if(this.uid=t,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void e_(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;let l=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),e.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;e<l;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(l,e)]=this.data[this._idx(l-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,l)]=this.data[this._idx(e,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)];let u=this._getByteView();this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let e=0;e<l;e++)for(let t=0;t<l;t++){let r=4*this._idx(e,t),i=this._unpackAtIndex(u,r);i>this.max&&(this.max=i),i<this.min&&(this.min=i)}}get(e,t){let r=this._getByteView(),i=4*this._idx(e,t);return this._unpackAtIndex(r,i)}sampleBilinear(e,t){let r=Math.floor(e),i=Math.floor(t);if(r<-1||r>=this.dim||i<-1||i>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);let n=this._getByteView(),a=((i+1)*this.stride+r+1)*4,s=4*this.stride,o=e-r,l=t-i;return this._unpackAtIndex(n,a)*(1-o)*(1-l)+this._unpackAtIndex(n,a+4)*o*(1-l)+this._unpackAtIndex(n,a+s)*(1-o)*l+this._unpackAtIndex(n,a+s+4)*o*l}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);return(t+1)*this.stride+(e+1)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}pack(e){return sX(e,this.getUnpackVector())}getPixels(){return new sL({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,t,r){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(t){case -1:i=n-1;break;case 1:n=i+1}switch(r){case -1:a=s-1;break;case 1:s=a+1}let o=-t*this.dim,l=-r*this.dim;for(let t=a;t<s;t++)for(let r=i;r<n;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+o,t+l)]}_getByteView(){let t=e.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),e.byteViewCache.set(this,t)),t}_unpackAtIndex(e,t){return this.unpack(e[t],e[t+1],e[t+2])}};function sX(e,t){let r=t[0],i=t[1],n=t[2],a=t[3],s=Math.min(r,i,n),o=Math.round((e+a)/s);return{r:Math.floor(o*s/r)%256,g:Math.floor(o*s/i)%256,b:Math.floor(o*s/n)%256}}nm("DEMData",sG);var sY=class extends nJ{constructor(e,t){super(e,sU,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof ik&&r._styleExpression.expression instanceof ri){this.colorRampExpression=r;let e=r._styleExpression.expression;for(let r of(t.elevationStops=e.labels,t.colorStops=[],t.elevationStops))t.colorStops.push(e.evaluate({globals:{elevation:r}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[tF.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let i={elevationStops:[],colorStops:[]},n=(t.elevationStops.length-1)/(e-1);for(let e=0;e<t.elevationStops.length-.5;e+=n)i.elevationStops.push(t.elevationStops[Math.round(e)]),i.colorStops.push(t.colorStops[Math.round(e)]);return e_(`Too many colors in specification of ${this.id}
2 color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(t),n=new sL({width:i.colorStops.length,height:1}),a=new sL({width:i.colorStops.length,height:1});for(let e=0;e<i.elevationStops.length;e++){let t=sX(i.elevationStops[e],r);a.setPixel(0,e,new tF(t.r/255,t.g/255,t.b/255,1)),n.setPixel(0,e,i.colorStops[e])}return this.colorRampTextures={elevationTexture:new sj(e,a,e.gl.RGBA),colorTexture:new sj(e,n,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}};let sZ=n5([{name:"a_pos",components:2,type:"Int16"}],4),sW=sZ.members;function sH(e,t,r){let i=r.patternDependencies,n=!1;for(let r of t){let t=r.paint.get(`${e}-pattern`);t.isConstant()||(n=!0);let a=t.constantOr(null);a&&(n=!0,i[a.to]=!0,i[a.from]=!0)}return n}function sK(e,t,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let i of t){let t=i.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:a-1},r,{},n.availableImages),o=t.evaluate({zoom:a},r,{},n.availableImages),l=t.evaluate({zoom:a+1},r,{},n.availableImages);e=e?.name?e.name:e,o=o?.name?o.name:o,l=l?.name?l.name:l,s[e]=!0,s[o]=!0,s[l]=!0,r.patterns[i.id]={min:e,mid:o,max:l}}}return r}sZ.size,sZ.alignment;let sJ=new Set,sQ=!1;function s0(e,t,r,i,n){let a=null;if(n===function(e,t,r,i){let n=0;for(let a=t,s=r-i;a<r;a+=i)n+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return n}(e,t,r,i)>0)for(let n=t;n<r;n+=i)a=oy(n/i|0,e[n],e[n+1],a);else for(let n=r-i;n>=t;n-=i)a=oy(n/i|0,e[n],e[n+1],a);return a&&oh(a,a.next)&&(om(a),a=a.next),a}function s1(e,t=e){let r=t===e,i=e,n;do n=!1,i!==i.next&&(0===sJ.size||!sJ.has(i))&&(oh(i,i.next)||0===ou(i.prev,i,i.next))?((r||i===t)&&(t=i.prev),sQ=!0,om(i),i=i.prev,n=!0):(r||i!==t)&&(i=i.next,n=!r);while(n||i!==t)return t}let s2=!1;function s3(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}let s5=new Float64Array(0),s6=0,s4=[],s8=[];function s7(e,t){let r=e;do{let e=s6++;s4[e]=r;let i=1/0,n=1/0,a=-1/0,s=-1/0,o=0;do{let t=r.next;r.z=e,r.x<i&&(i=r.x),r.x>a&&(a=r.x),r.y<n&&(n=r.y),r.y>s&&(s=r.y),t.x<i&&(i=t.x),t.x>a&&(a=t.x),t.y<n&&(n=t.y),t.y>s&&(s=t.y),r=t}while(++o<16&&r!==t)s8[e]=r;let l=4*e;s5[l]=i,s5[l+1]=n,s5[l+2]=a,s5[l+3]=s}while(r!==t)}function s9(e){let t=s8[e];for(;t.prev.next!==t;)t=t.next;return s8[e]=t,t}function oe(e){let t=s4[e];for(;t.prev.next!==t;)t=t.next;return s4[e]=t,t}let ot=[],or=[],oi=new Uint32Array(0),on=new Uint32Array(0),oa=new Uint32Array(256);function os(e,t,r,i,n,a){oa.fill(0);for(let t=0;t<e;t++)oa[r[t]>>>a&255]++;let s=0;for(let e=0;e<256;e++){let t=oa[e];oa[e]=s,s+=t}for(let s=0;s<e;s++){let e=r[s],o=oa[e>>>a&255]++;i[o]=t[s],n[o]=e}}function oo(e,t,r,i,n){return(e=((e=((e=((e=((e=(e-r)*n|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-i)*n|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function ol(e,t,r,i,n,a,s,o){return(n-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function ou(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function oh(e,t){return e.x===t.x&&e.y===t.y}function oc(e,t,r,i,n=!0){let a=ou(e,t,r),s=ou(e,t,i),o=ou(r,i,e),l=ou(r,i,t);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)||!!n&&!!(0===a&&op(e,r,t)||0===s&&op(e,i,t)||0===o&&op(r,e,i)||0===l&&op(r,t,i))}function op(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function of(e,t){return 0>ou(e.prev,e,e.next)?ou(e,t,e.next)>=0&&ou(e,e.prev,t)>=0:0>ou(e,t,e.prev)||0>ou(e,e.next,t)}function od(e,t){let r=og(e.i,e.x,e.y),i=og(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function oy(e,t,r,i){let n=og(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function om(e){var t,r;let i;e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),s2&&(t=e.prev,r=e.next,i=4*t.z,r.x<s5[i]&&(s5[i]=r.x),r.y<s5[i+1]&&(s5[i+1]=r.y),r.x>s5[i+2]&&(s5[i+2]=r.x),r.y>s5[i+3]&&(s5[i+3]=r.y))}function og(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}var ox=class{constructor(e,t){if(t>e)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}},ov=class e{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new e({fill:new ox(0,0),line:new ox(0,0),tile:new ox(0,0),stencil:new ox(0,0),circle:1})}};nm("SubdivisionGranularityExpression",ox),nm("SubdivisionGranularitySetting",ov);var ob=class{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=ed/e,this._canonical=t}_getKey(e,t){return e+=32768,(t+=32768)|e<<16}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=0|Math.round(e),i=0|Math.round(t),n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(e,t){let r=[];for(let i=0;i<t.length;i+=3){let n=t[i],a=t[i+1],s=t[i+2],o=e[2*n],l=e[2*n+1],u=e[2*a],h=e[2*a+1],c=e[2*s],p=e[2*s+1],f=h-l;(u-o)*(p-l)-f*(c-o)>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}(this._vertexBuffer,e);let t=[],r=e.length;for(let i=0;i<r;i+=3){let r=[e[i+0],e[i+1],e[i+2]],n=[this._vertexBuffer[2*e[i+0]+0],this._vertexBuffer[2*e[i+0]+1],this._vertexBuffer[2*e[i+1]+0],this._vertexBuffer[2*e[i+1]+1],this._vertexBuffer[2*e[i+2]+0],this._vertexBuffer[2*e[i+2]+1]],a=1/0,s=1/0,o=-1/0,l=-1/0;for(let e=0;e<3;e++){let t=n[2*e],r=n[2*e+1];a=Math.min(a,t),o=Math.max(o,t),s=Math.min(s,r),l=Math.max(l,r)}if(a===o||s===l)continue;let u=Math.floor(a/this._granularityCellSize),h=Math.ceil(o/this._granularityCellSize),c=Math.floor(s/this._granularityCellSize),p=Math.ceil(l/this._granularityCellSize);if(u===h&&c===p){t.push(...r);continue}for(let e=c;e<p;e++){let i=this._scanlineGenerateVertexRingForCellRow(e,n,r);!function(e,t,r){if(0===t.length)throw Error("Subdivision vertex ring is empty.");let i=0,n=e[2*t[0]];for(let r=1;r<t.length;r++){let a=e[2*t[r]];a<n&&(n=a,i=r)}let a=t.length,s=i,o=(s+1)%a;for(;;){let i=s-1>=0?s-1:a-1,n=(o+1)%a,l=e[2*t[i]],u=e[2*t[i]+1],h=e[2*t[n]],c=e[2*t[n]+1],p=e[2*t[s]],f=e[2*t[s]+1],d=e[2*t[o]],y=e[2*t[o]+1],m=!1;if(l<h)m=!0;else if(l>h)m=!1;else{let e=y-f,t=-(d-p),r=f<y?1:-1;((l-p)*e+(u-f)*t)*r>((h-p)*e+(c-f)*t)*r&&(m=!0)}if(m){let e=t[i],n=t[s],l=t[o];e!==n&&e!==l&&n!==l&&r.push(l,n,e),--s<0&&(s=a-1)}else{let e=t[n],i=t[s],l=t[o];e!==i&&e!==l&&i!==l&&r.push(l,i,e),++o>=a&&(o=0)}if(i===n)break}}(this._vertexBuffer,i,t)}}return t}_scanlineGenerateVertexRingForCellRow(e,t,r){let i=e*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let e=0;e<3;e++){let s=t[2*e],o=t[2*e+1],l=t[(e+1)*2%6],u=t[((e+1)*2+1)%6],h=t[(e+2)*2%6],c=t[((e+2)*2+1)%6],p=l-s,f=u-o,d=0===p,y=0===f,m=(i-o)/f,g=(n-o)/f,x=Math.min(m,g),v=Math.max(m,g);if(!y&&(x>=1||v<=0)||y&&(o<i||o>n)){u>=i&&u<=n&&a.push(r[(e+1)%3]);continue}if(!y&&x>0){let e=s+p*x,t=o+f*x;a.push(this._vertexToIndex(e,t))}let b=s+p*Math.max(x,0),w=s+p*Math.min(v,1);if(d||this._generateIntraEdgeVertices(a,s,o,l,u,b,w),!y&&v<1){let e=s+p*v,t=o+f*v;a.push(this._vertexToIndex(e,t))}(y||u>=i&&u<=n)&&a.push(r[(e+1)%3]),!y&&(u<=i||u>=n)&&this._generateInterEdgeVertices(a,s,o,l,u,h,c,w,i,n)}return a}_generateIntraEdgeVertices(e,t,r,i,n,a,s){let o=i-t,l=n-r,u=0===l,h=u?Math.min(t,i):Math.min(a,s),c=u?Math.max(t,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;
2if(u?t<i:a<s)for(let i=p;i<=f;i++){let n=i*this._granularityCellSize,a=r+l*(n-t)/o;e.push(this._vertexToIndex(n,a))}else for(let i=f;i>=p;i--){let n=i*this._granularityCellSize,a=r+l*(n-t)/o;e.push(this._vertexToIndex(n,a))}}_generateInterEdgeVertices(e,t,r,i,n,a,s,o,l,u){let h=s-n,c=(l-n)/h,p=(u-n)/h,f=Math.min(c,p),d=Math.max(c,p),y=i+(a-i)*f,m=Math.floor(Math.min(y,o)/this._granularityCellSize)+1,g=Math.ceil(Math.max(y,o)/this._granularityCellSize)-1,x=o<y,v=0===h;if(v&&(s===l||s===u))return;if(v||f>=1||d<=0){let e=r-s,i=a+(t-a)*Math.min((l-s)/e,(u-s)/e);m=Math.floor(Math.min(i,o)/this._granularityCellSize)+1,g=Math.ceil(Math.max(i,o)/this._granularityCellSize)-1,x=o<i}let b=n-r>0?u:l;if(x)for(let t=m;t<=g;t++){let r=t*this._granularityCellSize;e.push(this._vertexToIndex(r,b))}else for(let t=g;t>=m;t--){let r=t*this._granularityCellSize;e.push(this._vertexToIndex(r,b))}}_generateOutline(e){let t=[];for(let r of e){let e=o_(r,this._granularity,!0),i=this._pointArrayToIndices(e),n=[];for(let e=1;e<i.length;e++)n.push(i[e-1]),n.push(i[e]);t.push(n)}return t}_handlePoles(e){let t=!1,r=!1;this._canonical&&(0===this._canonical.y&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(t||r)&&this._fillPoles(e,t,r)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let r=e[t+1];-32768===r&&(e[t+1]=-32767),32767===r&&(e[t+1]=32766)}}_generatePoleQuad(e,t,r,i,n,a){i>n!=(-32768===a)?(e.push(t),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(r),e.push(this._vertexToIndex(n,a))):(e.push(r),e.push(t),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(n,a)),e.push(r)),e.push(this._vertexToIndex(i,a))}_fillPoles(e,t,r){let i=this._vertexBuffer,n=e.length;for(let a=2;a<n;a+=3){let n=e[a-2],s=e[a-1],o=e[a],l=i[2*n],u=i[2*n+1],h=i[2*s],c=i[2*s+1],p=i[2*o],f=i[2*o+1];t&&(0===u&&0===c&&this._generatePoleQuad(e,n,s,l,h,-32768),0===c&&0===f&&this._generatePoleQuad(e,s,o,h,p,-32768),0===f&&0===u&&this._generatePoleQuad(e,o,n,p,l,-32768)),r&&(u===ed&&c===ed&&this._generatePoleQuad(e,n,s,l,h,32767),c===ed&&f===ed&&this._generatePoleQuad(e,s,o,h,p,32767),f===ed&&u===ed&&this._generatePoleQuad(e,o,n,p,l,32767))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){let r;if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:i,holeIndices:n}=function(e){let t=[],r=[];for(let i of e)if(0!==i.length)for(let n of(i!==e[0]&&t.push(r.length/2),i))r.push(n.x),r.push(n.y);return{flattened:r,holeIndices:t}}(e);this._initializeVertices(i);try{let e=function(e,t,r=2){let i=t&&t.length,n=i?t[0]*r:e.length;sJ.size&&sJ.clear();let a=s0(e,0,n,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(i&&(a=function(e,t,r,i){var n,a;let s,o=[];for(let r=0,n=t.length;r<n;r++){let a=s0(e,t[r]*i,r<n-1?t[r+1]*i:e.length,i,!1);a===a.next&&sJ.add(a),o.push(function(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e)return r}(a))}o.sort(s3),n=e.length/i,a=t.length,s=Math.ceil((n+2*a)/16)+a+2,s5.length<4*s&&(s5=new Float64Array(4*s)),s6=0,s7(r,r),s2=!0;for(let e=0;e<o.length;e++)r=function(e,t){let r=function(e,t){let r,i=t,n=e.x,a=e.y,s=-1/0;if(oh(e,i))return i;for(let t=0,o=0;t<s6;t++,o+=4){if(a<s5[o+1]||a>s5[o+3]||s5[o]>n||s5[o+2]<=s)continue;let l=s9(t);i=oe(t);do{if(i.prev.next===i){if(oh(e,i.next))return i.next;else if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){let e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>s&&(s=e,r=i.x<i.next.x?i:i.next,e===n))return r}}i=i.next}while(i!==l)}if(!r)return null;let o=r.x,l=r.y,u=Math.min(a,l),h=Math.max(a,l),c=1/0;for(let t=0,d=0;t<s6;t++,d+=4){if(s5[d+2]<o||s5[d]>n||s5[d+3]<u||s5[d+1]>h)continue;let y=s9(t);i=oe(t);do{if(i.prev.next===i&&n>=i.x&&i.x>=o&&n!==i.x&&ol(a<l?n:s,a,o,l,a<l?s:n,a,i.x,i.y)){var p,f;let t=Math.abs(a-i.y)/(n-i.x);(of(i,e)||i.y===a&&i.next.y===a&&i.next.x>n)&&(t<c||t===c&&(i.x>r.x||i.x===r.x&&(p=r,f=i,0>ou(p.prev,p,f.prev)&&0>ou(f.next,p,p.next))))&&(r=i,c=t)}i=i.next}while(i!==y)}return r}(e,t);if(!r)return t;let i=od(r,e);return s7(r,i.next.next),s1(i,i.next),s1(r,r.next)}(o[e],r);return s2=!1,s1(r)}(e,t,a,r)),e.length>80*r){o=e[0],l=e[1];let t=o,i=l;for(let a=r;a<n;a+=r){let r=e[a],n=e[a+1];r<o&&(o=r),n<l&&(l=n),r>t&&(t=r),n>i&&(i=n)}u=0!==(u=Math.max(t-o,i-l))?32767/u:0}return function e(t,r,i,n,a){a&&function(e,t,r,i){let n=e,a=0;do n.z=oo(n.x,n.y,t,r,i),ot[a++]=n,n=n.next;while(n!==e)!function(e){if(e<=32){for(let t=1;t<e;t++){let e=ot[t],r=e.z,i=t-1;for(;i>=0&&ot[i].z>r;)ot[i+1]=ot[i],i--;ot[i+1]=e}return}oi.length<e&&(oi=new Uint32Array(e),on=new Uint32Array(e),or=Array(e));for(let t=0;t<e;t++)oi[t]=ot[t].z;os(e,ot,oi,or,on,0),os(e,or,on,ot,oi,8),os(e,ot,oi,or,on,16),os(e,or,on,ot,oi,24)}(a);let s=null;for(let e=0;e<a;
2e++){let t=ot[e];t.prevZ=s,s&&(s.nextZ=t),s=t}s.nextZ=null}(t,i,n,a);let s=t,o=!1;for(;t.prev!==t.next;){let l=t.prev,u=t.next;if(0>ou(l,t,u)&&(a?function(e,t,r,i){let n=e.prev,a=e.next,s=n.x,o=e.x,l=a.x,u=n.y,h=e.y,c=a.y,p=Math.min(s,o,l),f=Math.min(u,h,c),d=Math.max(s,o,l),y=Math.max(u,h,c),m=oo(p,f,t,r,i),g=oo(d,y,t,r,i),x=e.prevZ;for(;x&&x.z>=m;){if(x.x>=p&&x.x<=d&&x.y>=f&&x.y<=y&&x!==a&&(s!==x.x||u!==x.y)&&ol(s,u,o,h,l,c,x.x,x.y)&&ou(x.prev,x,x.next)>=0)return!1;x=x.prevZ}let v=e.nextZ;for(;v&&v.z<=g;){if(v.x>=p&&v.x<=d&&v.y>=f&&v.y<=y&&v!==a&&(s!==v.x||u!==v.y)&&ol(s,u,o,h,l,c,v.x,v.y)&&ou(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}(t,i,n,a):function(e){let t=e.prev,r=e.next,i=t.x,n=e.x,a=r.x,s=t.y,o=e.y,l=r.y,u=Math.min(i,n,a),h=Math.min(s,o,l),c=Math.max(i,n,a),p=Math.max(s,o,l),f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=c&&f.y>=h&&f.y<=p&&(i!==f.x||s!==f.y)&&ol(i,s,n,o,a,l,f.x,f.y)&&ou(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}(t))){r.push(l.i,t.i,u.i),om(t),t=u,s=u;continue}if((t=u)===s){if(sQ=!1,t=s1(t),sQ){s=t;continue}if(!o){s=t=function(e,t){let r=e,i=!1;do{let n=r.prev,a=r.next.next;oc(n,r,r.next,a,!1)&&of(n,a)&&of(a,n)&&(t.push(n.i,r.i,a.i),om(r),om(r.next),r=e=a,i=!0),r=r.next}while(r!==e)return i?s1(r):r}(t,r),o=!0;continue}!function(t,r,i,n,a){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&function(e,t){let r=oh(e,t)&&ou(e.prev,e,e.next)>0&&ou(t.prev,t,t.next)>0;return e.next.i!==t.i&&(r||of(e,t)&&of(t,e)&&(0!==ou(e.prev,e,t.prev)||0!==ou(e,t.prev,t)))&&!function(e,t){let r=Math.min(e.x,t.x),i=Math.max(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.y,t.y),s=e;do{let o=s.next;if(s.x>i&&o.x>i||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<n&&o.y<n){s=o;continue}if(s.i!==e.i&&o.i!==e.i&&s.i!==t.i&&o.i!==t.i&&oc(s,o,e,t))return!0;s=o}while(s!==e)return!1}(e,t)&&(r||function(e,t){let r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let e=r.next;r.y>a!=e.y>a&&n<(e.x-r.x)*(a-r.y)/(e.y-r.y)+r.x&&(i=!i),r=e}while(r!==e)return i}(e,t))}(s,t)){let o=od(s,t);s=s1(s,s.next),o=s1(o,o.next),e(s,r,i,n,a),e(o,r,i,n,a);return}t=t.next}s=s.next}while(s!==t)}(t,r,i,n,a);break}}}(a,s,o,l,u),s}(i,n),t=this._convertIndices(i,e);r=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let a=[];return t&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(r),this._granularity>=2&&this._canonical?.z===0&&(r=this._removeTrianglesOutsideTileX(r),a=a.map(e=>this._removeLinesOutsideTileX(e))),{verticesFlattened:this._vertexBuffer,indicesTriangles:r,indicesLineList:a}}_vertexOutsideTileX(e){let t=this._vertexBuffer[2*e];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=3)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||this._vertexOutsideTileX(e[r+2])||t.push(e[r],e[r+1],e[r+2]);return t}_removeLinesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=2)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||t.push(e[r],e[r+1]);return t}_convertIndices(e,t){let r=[];for(let i of t){let t=e[2*i],n=e[2*i+1];r.push(this._vertexToIndex(t,n))}return r}_pointArrayToIndices(e){let t=[];for(let r of e)t.push(this._vertexToIndex(r.x,r.y));return t}};function ow(e,t,r,i=!0){return new ob(r,t).subdividePolygonInternal(e,i)}function o_(e,t,r=!1){if(!e||e.length<1||e.length<2)return[];let i=e[0],n=e[e.length-1],a=r&&(i.x!==n.x||i.y!==n.y);if(t<2)if(a)return[...e,e[0]];else return[...e];let s=Math.floor(ed/t),o=[];o.push(new ei(e[0].x,e[0].y));let l=e.length,u=a?l:l-1;for(let t=0;t<u;t++){let r=e[t],i=t<l-1?e[t+1]:e[0],n=r.x,a=r.y,u=i.x,h=i.y,c=n!==u,p=a!==h;if(!c&&!p)continue;let f=u-n,d=h-a,y=Math.abs(f),m=Math.abs(d),g=n,x=a;for(;;){let e=f>0?(Math.floor(g/s)+1)*s:(Math.ceil(g/s)-1)*s,t=d>0?(Math.floor(x/s)+1)*s:(Math.ceil(x/s)-1)*s,r=Math.abs(g-e),i=Math.abs(x-t),n=Math.abs(x-h),a=c?r/y:1/0,l=p?i/m:1/0;if((Math.abs(g-u)<=r||!c)&&(n<=i||!p))break;if(a<l&&c||!p){let t=new ei(g=e,Math.round(x+=d*a));(o[o.length-1].x!==t.x||o[o.length-1].y!==t.y)&&o.push(t)}else{let e=new ei(Math.round(g+=f*l),x=t);(o[o.length-1].x!==e.x||o[o.length-1].y!==e.y)&&o.push(e)}}let v=new ei(u,h);(o[o.length-1].x!==v.x||o[o.length-1].y!==v.y)&&o.push(v)}return o}function oS(e,t,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(u<aW.MAX_VERTEX_ARRAY_LENGTH){let c,p,f=t.prepareSegment(u,r,i),d=f.vertexLength;for(let e=0;e<a.length;e+=3)i.emplaceBack(d+a[e],d+a[e+1],d+a[e+2]);f.vertexLength+=u,f.primitiveLength+=a.length/3,h&&(c=(p=s.prepareSegment(u,r,o)).vertexLength,p.vertexLength+=u);for(let t=0;t<n.length;t+=2)e(n[t],n[t+1]);if(h)for(let e of l){for(let t=1;t<e.length;t+=2)o.emplaceBack(c+e[t-1],c+e[t]);p.primitiveLength+=e.length/2}}else(function(e,t,r,i,n,a){let s=[];for(let e=0;e<i.length/2;e++)s.push(-1);let o={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),h=u.vertexLength;for(let c=2;c<n.length;c+=3){let p=n[c-2],f=n[c-1],d=n[c],y=s[p]<l,m=s[f]<l,g=s[d]<l,x=+!!y+ +!!m+ +!!g;u.vertexLength+x>aW.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=oA(s,i,a,o,p,y,u),b=oA(s,i,a,o,f,m,u),w=oA(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+w-l),u.primitiveLength++}})(t,r,i,n,a,e),h&&function(e,t,r,i,n,a){let s=[];for(let e=0;e<i.length/2;e++)s.push(-1);let o={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),h=u.vertexLength;for(let c of n)for(let n=1;n<c.length;n+=2){let p=c[n-1],f=c[n],d=s[p]<l,y=s[f]<l,m=+!!d+ +!!y;u.vertexLength+m>aW.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=o.count,d=!0,y=!0,h=0);let g=oA(s,i,a,o,p,d,u),x=oA(s,i,a,o,f,y,u);r.emplaceBack(h+g-l,h+x-l),u.primitiveLength++}}(s,r,o,n,l,e),t.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}
2function oA(e,t,r,i,n,a,s){if(!a)return e[n];{let a=i.count;return r(t[2*n],t[2*n+1]),e[n]=i.count,i.count++,s.vertexLength++,a}}var ok=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new aB,this.indexArray=new aG,this.indexArray2=new aX,this.programConfigurations=new sl(e.layers,e.zoom),this.segments=new aW,this.segments2=new aW,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.hasDependencies=sH("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new nF(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of e){let e=sc(l,o);if(!this.layers[0]._featureFilter.filter(s,e,r))continue;let p=n?i.evaluate(e,{},r,t.availableImages):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?e.geometry:sh(l),patterns:{},sortKey:p};a.push(f)}for(let i of(n&&a.sort((e,t)=>
vendor: 1,160 bytes, line 2
2e.sortKey-t.sortKey),a)){let{geometry:n,index:a,sourceLayerIndex:s}=i;if(this.hasDependencies){let e=sK("fill",this.layers,i,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{},t.subdivisionGranularity);let o=e[a].feature;t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures(e,t,r){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,r,e.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sW),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}
2addFeature(e,t,r,i,n,a){for(let e of rV(t,500)){let t=ow(e,i,a.fill.getGranularityForZoomLevel(i.z)),r=this.layoutVertexArray;oS((e,t)=>{r.emplaceBack(e,t)},this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}};nm("FillBucket",ok,{omit:["layers","patternFeatures"]});var oI={get paint(){return d=d||new nW({"fill-antialias":new nj(eZ.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new nG(eZ.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new nj(eZ.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new nG(eZ.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new nG(eZ.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new nj(eZ.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new nj(eZ.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new nX(eZ.paint_fill["fill-pattern"],"fill-pattern")})},get layout(){return f=f||new nW({"fill-sort-key":new nG(eZ.layout_fill["fill-sort-key"],"fill-sort-key")})}},oT=class extends nJ{constructor(e,t){super(e,oI,t)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new ok(e)}queryRadius(){return sw(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:r,pixelsToTileUnits:i}){return sd(s_(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),t)}isTileClipped(){return!0}};let oE=n5([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),oM=n5([{name:"a_centroid",components:2,type:"Int16"}],4),oD=oE.members;oE.size,oE.alignment;var oP=class{constructor(e,t,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n;e.pos<t;){let t=e.readVarint();if(8===t)this.id=e.readVarint();else if(18===t){let t=e.readVarint()+e.pos;for(;e.pos<t;){let t=i[e.readVarint()],r=n[e.readVarint()];this.properties[t]=r}}else 24===t?this.type=e.readVarint():(34===t&&(this._geometry=e.pos),e.skip(t))}}loadGeometry(){let e;if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,i=[],n=1,a=0,s=0,o=0;for(;t.pos<r;){if(a<=0){let e=t.readVarint();if(n=7&e,0==(a=e>>3))continue}if(a--,1===n)s+=t.readSVarint(),o+=t.readSVarint(),e&&i.push(e),e=[new ei(s,o)];else if(2===n)s+=t.readSVarint(),o+=t.readSVarint(),e&&e.push(new ei(s,o));else if(7===n)e&&e.push(e[0].clone());else throw Error(`unknown command ${n}`)}return e&&i.push(e),i}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;e.pos<t;){if(i<=0){let t=e.readVarint();if(r=7&t,0==(i=t>>3))continue}if(i--,1===r||2===r)n+=e.readSVarint(),a+=e.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>u&&(u=a);else if(7!==r)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(e,t,r){let i,n=this.extent*Math.pow(2,r),a=this.extent*e,s=this.extent*t,o=this.loadGeometry();function l(e){return[(e.x+a)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+s)*2/n)*Math.PI))-90]}function u(e){return e.map(l)}if(1===this.type){let e=[];for(let t of o)e.push(t[0]);let t=u(e);i=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){let e=o.map(u);i=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else if(3===this.type){let e=oF(o),t=[];for(let r of e)t.push(r.map(u));i=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}else throw Error("unknown feature type");let h={type:"Feature",geometry:i,properties:this.properties};return null!=this.id&&(h.id=this.id),h}};function oF(e){let t,r,i=e.length;if(i<=1)return[e];let n=[];for(let a=0;a<i;a++){let i=function(e){let t=0;for(let r=0,i=e.length,n=i-1,a,s;r<i;n=r++)a=e[r],t+=((s=e[n]).x-a.x)*(a.y+s.y);return t}(e[a]);0!==i&&(void 0===r&&(r=i<0),r===i<0?(t&&n.push(t),t=[e[a]]):t&&t.push(e[a]))}return t&&n.push(t),n}oP.types=["Unknown","Point","LineString","Polygon"];var oz=class{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos<t;){let t=e.readVarint();10===t?this.name=e.readString():18===t?(this._features.push(e.pos),e.skip(t)):26===t?this._keys.push(e.readString()):34===t?this._values.push(function(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let r=e.readVarint();t=10===r?e.readString():21===r?e.readFloat():25===r?e.readDouble():32===r?e.readVarint(!0):40===r?e.readVarint():48===r?e.readSVarint():56===r?e.readBoolean():(e.ski
2p(r),null)}if(null==t)throw Error("unknown feature value");return t}(e)):40===t?this.extent=e.readVarint():120===t?this.version=e.readVarint():e.skip(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new oP(this._pbf,t,this.extent,this._keys,this._values)}},oB=class{constructor(e,t=e.length){let r=Object.create(null);for(;e.pos<t;){let t=e.readVarint();if(26===t){let t=new oz(e,e.readVarint()+e.pos);t.length&&(r[t.name]=t)}else e.skip(t)}this.layers=r}},oC=class e{constructor(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){var t;let r;return new e((t=this.lng,-180==(r=((t- -180)%360+360)%360+-180)?180:r),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,r=this.lat*t,i=e.lat*t;return 6371008.8*Math.acos(Math.min(Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t),1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new e(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};let oV=2*Math.PI*6371008.8;function oL(e){return oV*Math.cos(e*Math.PI/180)}function oO(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var o$=class e{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(t,r=0){let i=oC.convert(t);return new e((180+i.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i.lat*Math.PI/360)))/360,r/oL(i.lat))}toLngLat(){return new oC(360*this.x-180,oO(this.y))}toAltitude(){return this.z*oL(oO(this.y))}meterInMercatorCoordinateUnits(){return 1/oV*(1/Math.cos(oO(this.y)*Math.PI/180))}};function oR(e,t,r){if(t<=0||!e||0===e.length)return e;let i=function(e,t){var r,i;let n,a=(r=ed/2,i=ed/2,new o$(r/ed*(n=1/(1<<t.z))+t.x*n,i/ed*n+t.y*n)).toLngLat();return e*o$.fromLngLat(a).meterInMercatorCoordinateUnits()*((1<<t.z)*ed)}(t,r);return e.map(e=>(function(e,t){if(!e||e.length<3)return e;let r=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=r?e.length-1:e.length;if(i<3)return e;let n=e.map(e=>{var t,r,i;return t=e.x,r=e.y,(i=new en(2))[0]=t,i[1]=r,i}),a=[];for(let e=0;e<i;e++)!function(e,t,r,i,n){var a,s,o,l,u,h,c,p;let f=ef(el(),t,r),d=ef(el(),i,r),y=ep(f),m=ep(d);if(y<1e-6||m<1e-6)return e.push(eu(r));eh(f,f,1/y),eh(d,d,1/m);let g=f[0]*d[0]+f[1]*d[1];if(Math.abs(g)>Math.cos(5*Math.PI/180))return e.push(eu(r));let x=Math.min(n,.2*y,.2*m),v=ec(el(),r,f,x),b=ec(el(),r,d,x),w=(a=el(),a[0]=f[0]+d[0],a[1]=f[1]+d[1],a);(l=(s=w[0])*s+(o=w[1])*o)>0&&(l=1/Math.sqrt(l)),w[0]=w[0]*l,w[1]=w[1]*l;let _=Math.sqrt((1+g)/2),S=ec(el(),r,w,x/_),A=ef(el(),v,S),k=ef(el(),b,S),I=(u=A[0],h=A[1],Math.abs(Math.atan2(h*(c=k[0])-u*(p=k[1]),u*c+h*p))),T=Math.sign(A[0]*k[1]-A[1]*k[0]),E=Math.max(2,Math.ceil(I/(Math.PI/6)-1e-6));for(let t=0;t<=E;t++){let r=T*I*(t/E);e.push(function(e,t,r,i){var n=t[0]-r[0],a=t[1]-r[1],s=Math.sin(i),o=Math.cos(i);return e[0]=n*o-a*s+r[0],e[1]=n*s+a*o+r[1],e}(el(),v,S,r))}}(a,n[(e-1+i)%i],n[e],n[(e+1)%i],t);return r&&a.length>0&&a.push(eu(a[0])),a.map(e=>new ei(e[0],e[1]))})(e,i))}function oN(e,t,r,i,n,a,s,o){e.emplaceBack(t,r,2*Math.floor(8192*i)+s,8192*n*2,8192*a*2,Math.round(o))}var oU=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new aC,this.centroidVertexArray=new aF,this.indexArray=new aG,this.programConfigurations=new sl(e.layers,e.zoom),this.segments=new aW,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.features=[],this.hasDependencies=sH("fill-extrusion",this.layers,t);let i=new nF(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=n._featureFilter.needGeometry;for(let{feature:o,id:l,index:u,sourceLayerIndex:h}of e){let e=sc(o,s);if(!n._featureFilter.filter(i,e,r))continue;let c=s?e.geometry:sh(o),p={id:l,sourceLayerIndex:h,index:u,geometry:a>0?oR(c,a,r):c,properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(sK("fill-extrusion",this.layers,p,{zoom:this.zoom},t)):this.addFeature(p,p.geometry,u,r,{},t.subdivisionGranularity),t.featureIndex.insert(o,p.geometry,u,h,this.index,!0)}}addFeatures(e,t,r){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,t,r,e.subdivisionGranularity)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,oD),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,oM.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n,a){let s=this.layers[0],o=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0;for(let r of rV(o>0?oR(t,o,i):t,500)){let t={x:0,y:0,sampleCount:0},n=this.layoutVertexArray.length;this.processPolygon(t,i,e,r,a);let s=this.layoutVertexArray.length-n,o=Math.floor(t.x/t.sampleC
2ount),l=Math.floor(t.y/t.sampleCount);for(let e=0;e<s;e++)this.centroidVertexArray.emplaceBack(o,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}processPolygon(e,t,r,i,n){if(i.length<1||oq(i[0]))return;for(let t of i)0!==t.length&&function(e,t){for(let r=0;r<t.length;r++){let i=t[r];(r!==t.length-1||t[0].x!==i.x||t[0].y!==i.y)&&(e.x+=i.x,e.y+=i.y,e.sampleCount++)}}(e,t);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(t.z),o="Polygon"===oP.types[r.type];for(let e of i){if(0===e.length||oq(e))continue;let t=o_(e,s,o);this._generateSideFaces(t,a)}if(!o)return;let l=ow(i,t,s,!1),u=this.layoutVertexArray;oS((e,t)=>{oN(u,e,t,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let r=0;for(let a=1;a<e.length;a++){var i,n;let s=e[a],o=e[a-1];if(i=s,n=o,i.x===n.x&&(i.x<0||i.x>8192)||i.y===n.y&&(i.y<0||i.y>8192))continue;t.segment.vertexLength+4>aW.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let l=s.sub(o)._perp()._unit(),u=o.dist(s);r+u>32768&&(r=0),oN(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,0,r),oN(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,1,r),r+=u,oN(this.layoutVertexArray,o.x,o.y,l.x,l.y,0,0,r),oN(this.layoutVertexArray,o.x,o.y,l.x,l.y,0,1,r);let h=t.segment.vertexLength;this.indexArray.emplaceBack(h,h+2,h+1),this.indexArray.emplaceBack(h+1,h+2,h+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};function oq(e){return e.every(e=>e.x<0)||e.every(e=>e.x>8192)||e.every(e=>e.y<0)||e.every(e=>e.y>8192)}nm("FillExtrusionBucket",oU,{omit:["layers","features"]});var oj={get paint(){return m=m||new nW({"fill-extrusion-opacity":new nj(eZ["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new nG(eZ["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new nj(eZ["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new nj(eZ["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new nX(eZ["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new nG(eZ["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new nG(eZ["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new nj(eZ["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})},get layout(){return y=y||new nW({"fill-extrusion-rounded-corner-distance":new nj(eZ["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})}},oG=class extends nJ{constructor(e,t){super(e,oj,t)}createBucket(e){return new oU(e)}queryRadius(){return sw(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=s_(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),h=function(e,t){let r=[];for(let i of e){let e=[i.x,i.y,0,1];!function(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3];e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s}(e,e,t),r.push(new ei(e[0]/e[3],e[1]/e[3]))}return r}(o,s),c=function(e,t,r,i){let n=[],a=[],s=i[8]*t,o=i[9]*t,l=i[10]*t,u=i[11]*t,h=i[8]*r,c=i[9]*r,p=i[10]*r,f=i[11]*r;for(let t of e){let e=[],r=[];for(let n of t){let t=n.x,a=n.y,d=i[0]*t+i[4]*a+i[12],y=i[1]*t+i[5]*a+i[13],m=i[2]*t+i[6]*a+i[14],g=i[3]*t+i[7]*a+i[15],x=d+s,v=y+o,b=m+l,w=g+u,_=d+h,S=y+c,A=m+p,k=g+f,I=new ei(x/w,v/w);I.z=b/w,e.push(I);let T=new ei(_/k,S/k);T.z=A/k,r.push(T)}n.push(e),a.push(r)}return[n,a]}(i,u,l,s);return function(e,t,r){let i=1/0;sd(r,t)&&(i=oY(r,t[0]));for(let n=0;n<t.length;n++){let a=t[n],s=e[n];for(let e=0;e<a.length-1;e++){let t=a[e],n=a[e+1],o=s[e],l=[t,n,s[e+1],o,t];(function(e,t){for(let r of e)if(sv(t,r))return!0;for(let r of t)if(sv(e,r))return!0;return sy(e,t)})(r,l)&&(i=Math.min(i,oY(r,l)))}}return 1/0!==i&&i}(c[0],c[1],h)}};function oX(e,t){return e.x*t.x+e.y*t.y}function oY(e,t){if(1===e.length){let r,i=0,n=t[i++];for(;!r||n.equals(r);)if(!(r=t[i++]))return 1/0;for(;i<t.length;i++){let a=t[i],s=e[0],o=r.sub(n),l=a.sub(n),u=s.sub(n),h=oX(o,o),c=oX(o,l),p=oX(l,l),f=oX(u,o),d=oX(u,l),y=h*p-c*c,m=(p*f-c*d)/y,g=(h*d-c*f)/y,x=1-m-g,v=n.z*x+r.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let r of t)e=Math.min(e,r.z);return e}}function oZ(e,t,r,i){let n={id:null==e?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(t){case"Point":case"MultiPoint":oH(n,r);break;case"LineString":oH(n,r.points);break;case"Polygon":oH(n,r[0].points);break;case"MultiLineString":for(let e of r)oH(n,e.points);break;case"MultiPolygon":for(let e of r)oH(n,e[0].points)}return n}function oW(e){e.points.length>64&&(e.points=new Float64Array(e.points))}function oH(e,t){for(let r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function oK(e,t){let r=[];switch(e.type){case"FeatureCollection":for(let i=0;i<e.features.length;i++)oJ(r,e.features[i],t,i);break;case"Feature":oJ(r,e,t);break;default:oJ(r,{type:"Feature",geometry:e,properties:void 0},t)}return r}function oJ(e,t,r,i,n=0){var a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w;if(!t.geometry)return;if(n>
21024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if("GeometryCollection"===t.geometry.type)return void function(e,t,r,i,n,a=0){for(let s of r.geometries)oJ(e,{id:t.id,type:"Feature",geometry:s,properties:t.properties},i,n,a)}(e,t,t.geometry,r,i,n+1);if(!t.geometry.coordinates?.length)return;let _=(a=t,s=r,o=i,s.promoteId?a.properties?.[s.promoteId]:s.generateId?o||0:a.id),S=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2);switch(t.geometry.type){case"Point":let A;l=e,u=_,h=t.geometry,c=t.properties,(A=[]).push(o1(h.coordinates[0]),o2(h.coordinates[1]),0),l.push(oZ(u,"Point",A,c));return;case"MultiPoint":!function(e,t,r,i){let n=[];for(let e of r.coordinates)n.push(o1(e[0]),o2(e[1]),0);e.push(oZ(t,"MultiPoint",n,i))}(e,_,t.geometry,t.properties);return;case"LineString":let k;p=e,f=_,d=t.geometry,y=S,m=t.properties,k={points:[]},oQ(d.coordinates,k,y,!1),p.push(oZ(f,"LineString",k,m));return;case"MultiLineString":!function(e,t,r,i,n,a){if(n.lineMetrics)for(let n of r.coordinates){let r={points:[]};oQ(n,r,i,!1),e.push(oZ(t,"LineString",r,a))}else{let n=[];o0(r.coordinates,n,i,!1),e.push(oZ(t,"MultiLineString",n,a))}}(e,_,t.geometry,S,r,t.properties);return;case"Polygon":let I;g=e,x=_,v=t.geometry,b=S,w=t.properties,I=[],o0(v.coordinates,I,b,!0),g.push(oZ(x,"Polygon",I,w));return;case"MultiPolygon":!function(e,t,r,i,n){let a=[];for(let e of r.coordinates){let t=[];o0(e,t,i,!0),a.push(t)}e.push(oZ(t,"MultiPolygon",a,n))}(e,_,t.geometry,S,t.properties);return;default:throw Error("Input data is not a valid GeoJSON object.")}}function oQ(e,t,r,i){let n,a,s=0;for(let r=0;r<e.length;r++){let o=o1(e[r][0]),l=o2(e[r][1]);t.points.push(o,l,0),r>0&&(i?s+=(n*l-o*a)/2:s+=Math.sqrt(Math.pow(o-n,2)+Math.pow(l-a,2))),n=o,a=l}let o=t.points.length-3;t.points[2]=1,r>0&&function e(t,r,i,n){let a,s=n,o=r+(i-r>>1),l=i-r,u=t[r],h=t[r+1],c=t[i],p=t[i+1];for(let e=r+3;e<i;e+=3){let r=function(e,t,r,i,n,a){let s=n-r,o=a-i;if(0!==s||0!==o){let l=((e-r)*s+(t-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return(s=e-r)*s+(o=t-i)*o}(t[e],t[e+1],u,h,c,p);if(r>s){a=e,s=r;continue}if(r===s){let t=Math.abs(e-o);t<l&&(a=e,l=t)}}s>n&&(a-r>3&&e(t,r,a,n),t[a+2]=s,i-a>3&&e(t,a,i,n))}(t.points,0,o,r),t.points[o+2]=1,oW(t),t.size=Math.abs(s),t.start=0,t.end=t.size}function o0(e,t,r,i){for(let n=0;n<e.length;n++){let a={points:[]};oQ(e[n],a,r,i),t.push(a)}}function o1(e){return e/360+.5}function o2(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function o3(e){let t={type:"Feature",geometry:function(e){let{type:t,geometry:r}=e;switch(t){case"Point":return{type:t,coordinates:function(e,t){return[o6(e),o4(t)]}(r[0],r[1])};case"MultiPoint":return{type:t,coordinates:o5(r)};case"LineString":return{type:t,coordinates:o5(r.points)};case"MultiLineString":case"Polygon":return{type:t,coordinates:r.map(e=>o5(e.points))};case"MultiPolygon":return{type:t,coordinates:r.map(e=>e.map(e=>o5(e.points)))}}}(e),properties:e.tags};return null!=e.id&&(t.id=e.id),t}function o5(e){let t=[];for(let n=0;n<e.length;n+=3){var r,i;t.push((r=e[n],i=e[n+1],[o6(r),o4(i)]))}return t}function o6(e){return(e-.5)*360}function o4(e){return 360*Math.atan(Math.exp((180-360*e)*Math.PI/180))/Math.PI-90}function o8(e,t,r,i,n,a,s,o){if(r/=t,i/=t,a>=r&&s<i)return e;if(s<r||a>=i)return null;let l=[];for(let t of e){let e=0===n?t.minX:t.minY,a=0===n?t.maxX:t.maxY;if(e>=r&&a<i){l.push(t);continue}if(!(a<r)&&!(e>=i))switch(t.type){case"Point":case"MultiPoint":!function(e,t,r,i,n){let a=[];if(function(e,t,r,i,n){for(let a=0;a<e.length;a+=3){let s=e[a+n];s>=r&&s<=i&&lt(t,e[a],e[a+1],e[a+2])}}(e.geometry,a,r,i,n),!a.length)return;let s=3===a.length?"Point":"MultiPoint";t.push(oZ(e.id,s,a,e.tags))}(t,l,r,i,n);continue;case"LineString":!function(e,t,r,i,n,a){let s=[];if(o7(e.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let r of s)t.push(oZ(e.id,"LineString",r,e.tags));return}if(s.length>1)return t.push(oZ(e.id,"MultiLineString",s,e.tags));t.push(oZ(e.id,"LineString",s[0],e.tags))}}(t,l,r,i,n,o);continue;case"MultiLineString":!function(e,t,r,i,n){let a=[];if(le(e.geometry,a,r,i,n,!1),a.length){if(1===a.length)return t.push(oZ(e.id,"LineString",a[0],e.tags));t.push(oZ(e.id,"MultiLineString",a,e.tags))}}(t,l,r,i,n);continue;case"Polygon":!function(e,t,r,i,n){let a=[];le(e.geometry,a,r,i,n,!0),a.length&&t.push(oZ(e.id,"Polygon",a,e.tags))}(t,l,r,i,n);continue;case"MultiPolygon":!function(e,t,r,i,n){let a=[];for(let t of e.geometry){let e=[];le(t,e,r,i,n,!0),e.length&&a.push(e)}a.length&&t.push(oZ(e.id,"MultiPolygon",a,e.tags))}(t,l,r,i,n);continue}}return l.length?l:null}function o7(e,t,r,i,n,a,s){let o,l,u=o9(e),h=0===n?lr:li,c=e.start;for(let p=0;p<e.points.length-3;p+=3){let f=e.points[p],d=e.points[p+1],y=e.points[p+2],m=e.points[p+3],g=e.points[p+4],x=0===n?f:d,v=0===n?m:g,b=!1;s&&(o=Math.sqrt(Math.pow(f-m,2)+Math.pow(d-g,2))),x<r?v>r&&(l=h(u,f,d,m,g,r),s&&(u.start=c+o*l)):x>i?v<i&&(l=h(u,f,d,m,g,i),s&&(u.start=c+o*l)):lt(u.points,f,d,y),v<r&&x>=r&&(l=h(u,f,d,m,g,r),b=!0),v>
2i&&x<=i&&(l=h(u,f,d,m,g,i),b=!0),!a&&b&&(s&&(u.end=c+o*l),t.push(u),u=o9(e)),s&&(c+=o)}let p=e.points.length-3,f=e.points[p],d=e.points[p+1],y=e.points[p+2],m=0===n?f:d;m>=r&&m<=i&&lt(u.points,f,d,y),p=u.points.length-3,a&&p>=3&&(u.points[p]!==u.points[0]||u.points[p+1]!==u.points[1])&&lt(u.points,u.points[0],u.points[1],u.points[2]),u.points.length&&(oW(u),t.push(u))}function o9(e){return{points:[],size:e.size,start:e.start,end:e.end}}function le(e,t,r,i,n,a){for(let s of e)o7(s,t,r,i,n,a,!1)}function lt(e,t,r,i){e.push(t,r,i)}function lr(e,t,r,i,n,a){let s=(a-t)/(i-t);return lt(e.points,a,r+(n-r)*s,1),s}function li(e,t,r,i,n,a){let s=(a-r)/(n-r);return lt(e.points,t+(i-t)*s,a,1),s}function ln(e,t){let r=t.buffer/t.extent,i=e,n=o8(e,1,-1-r,r,0,-1,2,t),a=o8(e,1,1-r,2+r,0,-1,2,t);return(n||a)&&(i=o8(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=la(n,1).concat(i)),a&&(i=i.concat(la(a,-1)))),i}function la(e,t){let r=[];for(let i of e)switch(i.type){case"Point":case"MultiPoint":{let e=function(e,t){let r=[];for(let i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}(i.geometry,t);r.push(oZ(i.id,i.type,e,i.tags));continue}case"LineString":{let e=ls(i.geometry,t);r.push(oZ(i.id,i.type,e,i.tags));continue}case"MultiLineString":case"Polygon":{let e=[];for(let r of i.geometry)e.push(ls(r,t));r.push(oZ(i.id,i.type,e,i.tags));continue}case"MultiPolygon":{let e=[];for(let r of i.geometry){let i=[];for(let e of r)i.push(ls(e,t));e.push(i)}r.push(oZ(i.id,i.type,e,i.tags));continue}}return r}function ls(e,t){let r={points:[],size:e.size};void 0!==e.start&&(r.start=e.start,r.end=e.end);for(let i=0;i<e.points.length;i+=3)r.points.push(e.points[i]+t,e.points[i+1],e.points[i+2]);return oW(r),r}function lo(e,t){if(t.removeAllProperties)return{};let r={...e||{}};if(t.removeProperties)for(let e of t.removeProperties)delete r[e];if(t.addOrUpdateProperties)for(let{key:e,value:i}of t.addOrUpdateProperties)r[e]=i;return r}let ll=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],lu=new Uint32Array(96);var lh=class e{static from(t){if(!t||void 0===t.byteLength||t.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(t,0,2);if(219!==r)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(1!==n)throw Error(`Got v${n} data when expected v1.`);let a=ll[15&i];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new e(o,s,a,void 0,t)}constructor(e,t=64,r=Float64Array,i=ArrayBuffer,n){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=ll.indexOf(this.ArrayType),s=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-o%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${r}.`);if(n)this.data=n,this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+o+l,2*e),this._pos=2*e,this._finished=!0;else{let n=this.data=new i(8+s+o+l);this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+o+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(n,0,2).set([219,16+a]),new Uint16Array(n,2,1)[0]=t,new Uint32Array(n,4,1)[0]=e}}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return function e(t,r,i,n,a,s){if(a-n<=i)return;let o=n+a>>1;(function e(t,r,i,n,a,s){for(;a>n;){if(a-n>600){let o=a-n+1,l=i-n+1,u=Math.log(o),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(o-h)/o)*(l-o/2<0?-1:1);e(t,r,i,Math.max(n,Math.floor(i-l*h/o+c)),Math.min(a,Math.floor(i+(o-l)*h/o+c)),s)}let o=r[2*i+s],l=n,u=a;for(lc(t,r,n,i),r[2*a+s]>o&&lc(t,r,n,a);l<u;){for(lc(t,r,l,u),l++,u--;r[2*l+s]<o;)l++;for(;r[2*u+s]>o;)u--}r[2*n+s]===o?lc(t,r,n,u):lc(t,r,++u,a),u<=i&&(n=u+1),i<=u&&(a=u-1)}})(t,r,o,n,a,s),e(t,r,i,n,o-1,1-s),e(t,r,i,o+1,a,1-s)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}
2range(e,t,r,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:s}=this;lu[0]=0,lu[1]=n.length-1,lu[2]=0;let o=3,l=[];for(;o>0;){let u=lu[--o],h=lu[--o],c=lu[--o];if(h-c<=s){for(let s=c;s<=h;s++){let o=a[2*s],u=a[2*s+1];o>=e&&o<=r&&u>=t&&u<=i&&l.push(n[s])}continue}let p=c+h>>1,f=a[2*p],d=a[2*p+1];f>=e&&f<=r&&d>=t&&d<=i&&l.push(n[p]),(0===u?e<=f:t<=d)&&(lu[o++]=c,lu[o++]=p-1,lu[o++]=1-u),(0===u?r>=f:i>=d)&&(lu[o++]=p+1,lu[o++]=h,lu[o++]=1-u)}return l}within(e,t,r){let i=[];return this.withinInto(e,t,r,i),i}withinInto(e,t,r,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:s}=this;lu[0]=0,lu[1]=n.length-1,lu[2]=0;let o=3,l=0,u=r*r;for(;o>0;){let h=lu[--o],c=lu[--o],p=lu[--o];if(c-p<=s){for(let r=p;r<=c;r++)lf(a[2*r],a[2*r+1],e,t)<=u&&(i[l++]=n[r]);continue}let f=p+c>>1,d=a[2*f],y=a[2*f+1];lf(d,y,e,t)<=u&&(i[l++]=n[f]),(0===h?e-r<=d:t-r<=y)&&(lu[o++]=p,lu[o++]=f-1,lu[o++]=1-h),(0===h?e+r>=d:t+r>=y)&&(lu[o++]=f+1,lu[o++]=c,lu[o++]=1-h)}return l}};function lc(e,t,r,i){lp(e,r,i),lp(t,2*r,2*i),lp(t,2*r+1,2*i+1)}function lp(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function lf(e,t,r,i){let n=e-r,a=t-i;return n*n+a*a}let ld={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e};var ly=class{constructor(e){this.options=Object.assign(Object.create(ld),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){let t=[];for(let r of e){if(!r.geometry)continue;let[e,i]=r.geometry.coordinates,[n,a]=[o1(e),o2(i)],s={id:r.id,type:"Point",geometry:[n,a],tags:r.properties};t.push(s)}this.createIndex(t)}initialize(e){let t=[];for(let r of e)"Point"===r.type&&t.push(r);this.createIndex(t)}updateIndex(e,t,r){this.options=Object.assign(Object.create(ld),r.clusterOptions),this.initialize(e)}createIndex(e){let{log:t,minZoom:r,maxZoom:i}=this.options;t&&console.time("total time");let n=`prepare ${e.length} points`;t&&console.time(n),this.points=e;let a=[];for(let t=0;t<e.length;t++){let r=e[t];if(!r?.geometry)continue;let[i,n]=r.geometry;i=Math.fround(i),n=Math.fround(n),a.push(i,n,1/0,t,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this.createTree(a);t&&console.timeEnd(n);for(let e=i;e>=r;e--){let r=Date.now();s=this.trees[e]=this.createTree(this.cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,Date.now()-r)}t&&console.timeEnd("total time")}getClusters(e,t){return this.getClustersInternal(e,t).map(e=>o3(e))}getClustersInternal(e,t){let r=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),n=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){let e=this.getClustersInternal([r,i,180,a],t),s=this.getClustersInternal([-180,i,n,a],t);return e.concat(s)}let s=this.trees[this.limitZoom(t)],o=s.range(o1(r),o2(a),o1(n),o2(i)),l=s.flatData,u=[];for(let e of o){var h,c,p;let t=this.stride*e;u.push(l[t+5]>1?(h=l,c=t,p=this.clusterProps,{id:h[c+3],type:"Point",tags:lm(h,c,p),geometry:[h[c],h[c+1]]}):this.points[l[t+3]])}return u}getChildren(e){let t=this.getOriginId(e),r=this.getOriginZoom(e),i=Error("No cluster with the specified id: "+e),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(t*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),o=a[t*this.stride],l=a[t*this.stride+1],u=n.within(o,l,s),h=[];for(let t of u){var c,p,f;let r=t*this.stride;a[r+4]===e&&h.push(a[r+5]>1?(c=a,p=r,f=this.clusterProps,{type:"Feature",id:c[p+3],properties:lm(c,p,f),geometry:{type:"Point",coordinates:[o6(c[p]),o4(c[p+1])]}}):o3(this.points[a[r+3]]))}if(0===h.length)throw i;return h}getLeaves(e,t,r){t=t||10,r=r||0;let i=[];return this.appendLeaves(i,e,t,r,0),i}getTile(e,t,r){let i=this.trees[this.limitZoom(e)];if(!i)return null;let n=Math.pow(2,e),{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:t,y:r,z:e};return this.addTileFeatures(i.range((t-o)/n,l,(t+1+o)/n,u),i.flatData,t,r,n,h),0===t&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),t===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,t,r,i,n){for(let a of this.getChildren(t)){let t=a.properties;if(t?.cluster?n+t.point_count<=i?n+=t.point_count:n=this.appendLeaves(e,t.cluster_id,r,i,n):n<i?n++:e.push(a),e.length===r)break}return n}createTree(e){let t=new lh(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.flatData=e,t.data=null,t}addTileFeatures(e,t,r,i,n,a){for(let s of e){let e,o,l,u,h=s*this.stride,c=t[h+5]>1;if(c)e=lm(t,h,this.clusterProps),o=t[h],l=t[h+1];else{let r=this.points[t[h+3]];e=r.tags,[o,l]=r.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(o*n-r)),Math.round(this.options.extent*(l*n-i))]],tags:e};void 0!==(u=c||this.options.generateId?t[h+3]:this.points[t[h+3]].id)&&(p.id=u),a.features.push(p)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,t){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*Math.pow(2,t)),o=e.flatData,l=[],u=this.stride;for(let r=0;r<o.length;r+=u){if(o[r+2]<=t)continue;o[r+2]=t;let i=o[r],h=o[r+1],c=e.within(o[r],o[r+1],s),p=o[r+5],f=p;for(let e of c){let r=e*u;o[r+2]>t&&(f+=o[r+5])}if(f>p&&f>=a){let e,a=i*p,s=h*p,d=-1,y=(r/u<<5)+(t+1)+this.points.length;for(let i of c){let l=i*u;if(o[l+2]<=t)continue;o[l+2]=t;let h=o[l+5];a+=o[l]*h,s+=o[l+1]*h,o[l+4]=y,n&&(e||(e=this.map(o,r,!0),d=this.clusterProps.length,this.clusterProps.push(e)),n(e,this.map(o,l)))}o[r+4]=y,l.push(a/f,s/f,1/0,y,-1,f),n&&l.push(d)}else{for(let e=0;e<u;e++)l.push(o[r+e]);if(f>1)for(let e of c){let r=e*u;if(!(o[r+2]<=t)){o[r+2]=t;for(let e=0;e<u;e++)l.push(o[r+e])}}}}return l}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,t,r){if(e[t+5]>1){let i=this.clusterProps[e[t+6]];return r?Object.assign({},i):i}let i=this.points[e[t+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function lm(e,t,r){let i=e[t+5],n=i>=1e4?`${Math.round(i/1e3)}
2k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=e[t+6];return Object.assign(-1===a?{}:Object.assign({},r[a]),{cluster:!0,cluster_id:e[t+3],point_count:i,point_count_abbreviated:n})}let lg="geojsonvt_clip_start",lx="geojsonvt_clip_end";function lv(e,t,r,i,n){let a=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),s={transformed:!1,features:[],source:null,x:r,y:i,z:t,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:e.length};for(let t of e)!function(e,t,r,i){switch(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),t.type){case"Point":case"MultiPoint":!function(e,t){let r=[];for(let i=0;i<t.geometry.length;i+=3)r.push(t.geometry[i],t.geometry[i+1]),e.numPoints++,e.numSimplified++;if(!r.length)return;let i={type:1,tags:t.tags||null,geometry:r};null!==t.id&&(i.id=t.id),e.features.push(i)}(e,t);return;case"LineString":!function(e,t,r,i){let n=[];if(lb(n,t.geometry,e,r,!1,!1),!n.length)return;let a=t.tags||null;if(i.lineMetrics){for(let e in a={},t.tags)a[e]=t.tags[e];a[lg]=t.geometry.start/t.geometry.size,a[lx]=t.geometry.end/t.geometry.size}let s={type:2,tags:a,geometry:n};null!==t.id&&(s.id=t.id),e.features.push(s)}(e,t,r,i);return;case"MultiLineString":case"Polygon":!function(e,t,r){let i=[];for(let n=0;n<t.geometry.length;n++)lb(i,t.geometry[n],e,r,"Polygon"===t.type,0===n);if(!i.length)return;let n={type:"Polygon"===t.type?3:2,tags:t.tags||null,geometry:i};null!==t.id&&(n.id=t.id),e.features.push(n)}(e,t,r);return;case"MultiPolygon":!function(e,t,r){let i=[];for(let n=0;n<t.geometry.length;n++){let a=t.geometry[n];for(let t=0;t<a.length;t++)lb(i,a[t],e,r,!0,0===t)}if(!i.length)return;let n={type:3,tags:t.tags||null,geometry:i};null!==t.id&&(n.id=t.id),e.features.push(n)}(e,t,r);return}}(s,t,a,n);return s}function lb(e,t,r,i,n,a){let s=i*i;if(i>0&&t.size<(n?s:i)){r.numPoints+=t.points.length/3;return}let o=[];for(let e=0;e<t.points.length;e+=3)(0===i||t.points[e+2]>s)&&(r.numSimplified++,o.push(t.points[e],t.points[e+1])),r.numPoints++;n&&function(e,t){let r=0;for(let t=0,i=e.length,n=i-2;t<i;n=t,t+=2)r+=(e[t]-e[n])*(e[t+1]+e[n+1]);if(r>0===t)for(let t=0,r=e.length;t<r/2;t+=2){let i=e[t],n=e[t+1];e[t]=e[r-2-t],e[t+1]=e[r-1-t],e[r-2-t]=i,e[r-1-t]=n}}(o,a),e.push(o)}function lw(e,t){if(e.transformed)return e;let r=1<<e.z,i=e.x,n=e.y;for(let a of e.features)1===a.type?function(e,t,r,i,n){let a=e.geometry,s=[];for(let e=0;e<a.length;e+=2)s.push(l_(a[e],a[e+1],t,r,i,n));e.geometry=s}(a,t,r,i,n):function(e,t,r,i,n){let a=e.geometry,s=[];for(let e of a){let a=[];for(let s=0;s<e.length;s+=2)a.push(l_(e[s],e[s+1],t,r,i,n));s.push(a)}e.geometry=s}(a,t,r,i,n);return e.transformed=!0,e}function l_(e,t,r,i,n,a){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-a))]}var lS=class{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(e,t,r){r.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(t),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=lv(e,i,n,a,r);s.source=e;let o=lA(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let e=`z${i}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,t,r){return null}getTile(e,t,r){let i,{extent:n,debug:a}=this.options,s=1<<e,o=lA(e,t=t+s&s-1,r);if(this.tiles[o])return lw(this.tiles[o],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);let l=e,u=t,h=r;for(;!i&&l>0;)l--,u>>=1,h>>=1,i=this.tiles[lA(l,u,h)];return i?.source&&(a>1&&(console.log("found parent tile z%d-%d-%d",l,u,h),console.time("drilling down")),this.splitTile(i.source,l,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[o])?lw(this.tiles[o],n):null}splitTile(e,t,r,i,n,a,s){let o=[e,t,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),t=o.pop(),e=o.pop();let h=1<<t,c=lA(t,r,i),p=this.tiles[c];if(!p&&(u>1&&console.time("creation"),p=this.tiles[c]=lv(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i,id:c}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(p.source=e,null==n){if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else if(t===l.maxZoom||t===n)continue;else if(null!=n){let e=n-t;if(r!==a>>e||i!==s>>e)continue}if(p.source=null,!e.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,w=o8(e,h,r-f,r+y,0,p.minX,p.maxX,l),_=o8(e,h,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=o8(w,h,i-f,i+y,1,p.minY,p.maxY,l),x=o8(w,h,i+d,i+m,1,p.minY,p.maxY,l)),_&&(v=o8(_,h,i-f,i+y,1,p.minY,p.maxY,l),b=o8(_,h,i+d,i+m,1,p.minY,p.maxY,l)),u>
21&&console.timeEnd("clipping"),o.push(g||[],t+1,2*r,2*i),o.push(x||[],t+1,2*r,2*i+1),o.push(v||[],t+1,2*r+1,2*i),o.push(b||[],t+1,2*r+1,2*i+1)}}invalidateTiles(e){if(!e.length)return;let t=this.options,{debug:r}=t,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let t of e)i=Math.min(i,t.minX),n=Math.max(n,t.maxX),a=Math.min(a,t.minY),s=Math.max(s,t.maxY);let o=t.buffer/t.extent,l=new Set;for(let t in this.tiles){let u=this.tiles[t],h=1<<u.z,c=(u.x-o)/h,p=(u.x+1+o)/h,f=(u.y-o)/h,d=(u.y+1+o)/h;if(n<c||i>=p||s<f||a>=d)continue;let y=!1;for(let t of e)if(t.maxX>=c&&t.minX<p&&t.maxY>=f&&t.minY<d){y=!0;break}if(y){if(r){r>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",u.z,u.x,u.y,u.numFeatures,u.numPoints,u.numSimplified);let e=`z${u.z}`;this.stats[e]=(this.stats[e]||0)-1,this.total--}delete this.tiles[t],l.add(t)}}l.size&&(this.tileCoords=this.tileCoords.filter(e=>!l.has(e.id)))}};function lA(e,t,r){return((1<<e)*r+t)*32+e}let lk={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:ld,debug:0};var lI=class{constructor(e,t){let r=(t=this.options=Object.assign({},lk,t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw Error("promoteId and generateId cannot be used together.");let i=oK(e,t);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles")),i=ln(i,t),t.updateable&&(this.source=i),this.initializeIndex(i,t)}initializeIndex(e,t){this.tileIndex=t.cluster?new ly(t.clusterOptions):new lS(t),e.length&&this.tileIndex.initialize(e)}getTile(e,t,r){return(e*=1,t*=1,r*=1,e<0||e>24)?null:this.tileIndex.getTile(e,t,r)}updateData(e,t){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:i,source:n}=function(e,t,r){var i,n;let a=(i=t,n=r,i?{removeAll:i.removeAll,remove:new Set(i.remove||[]),add:new Map(i.add?.map(e=>[n.promoteId?e.properties[n.promoteId]:e.id,e])),update:new Map(i.update?.map(e=>[e.id,e]))}:{remove:new Set,add:new Map,update:new Map}),s=[];if(a.removeAll&&(s=e,e=[]),a.remove.size||a.add.size){let t=[];for(let r of e)(a.remove.has(r.id)||a.add.has(r.id))&&t.push(r);if(t.length){s=s.concat(t);let r=new Set(t.map(e=>e.id));e=e.filter(e=>!r.has(e.id))}if(a.add.size){let t=oK({type:"FeatureCollection",features:Array.from(a.add.values())},r);t=ln(t,r),s=s.concat(t),e=e.concat(t)}}if(a.update.size){let t=new Map,i=[];for(let r of e)a.update.has(r.id)?t.set(r.id,[...t.get(r.id)||[],r]):i.push(r);for(let[e,n]of a.update){let a=t.get(e);if(!a||0===a.length)continue;let o=function(e,t,r){let i=!!t.newGeometry,n=t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0;if(i){let i=e[0],a=oK({type:"FeatureCollection",features:[{type:"Feature",id:i.id,geometry:t.newGeometry,properties:n?lo(i.tags,t):i.tags}]},r);return ln(a,r)}if(n){let r=[];for(let i of e){let e={...i};e.tags=lo(e.tags,t),r.push(e)}return r}return e}(a,n,r);s=s.concat(a,o),i=i.concat(o)}e=i}return{affected:s,source:e}}(this.source,e,r);t&&({affected:i,source:n}=this.filterUpdate(n,i,t)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(e,t,r){let i=new Set;for(let n of e)void 0!=n.id&&(r(o3(n))||(t.push(n),i.add(n.id)));return{affected:t,source:e=e.filter(e=>!i.has(e.id))}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map(e=>o3(e))}}updateClusterOptions(e,t){let r=this.options.cluster;(this.options.cluster=e,this.options.clusterOptions=t,r==e)?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(e){return this.tileIndex.getClusterExpansionZoom(e)}getClusterChildren(e){return this.tileIndex.getChildren(e)}getClusterLeaves(e,t,r){return this.tileIndex.getLeaves(e,t,r)}};let lT=n5([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),lE=lT.members;lT.size,lT.alignment;let lM=n5([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),lD=lM.members;lM.size,lM.alignment;let lP=Math.cos(Math.PI/180*37.5);var lF=class{constructor(e){for(let t of(this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers))this.gradients[t.id]={};this.layoutVertexArray=new aV,this.layoutVertexArray2=new aL,this.indexArray=new aG,this.programConfigurations=new sl(e.layers,e.zoom),this.segments=new aW,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.hasDependencies=sH("line",this.layers,t)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new nF(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:l,index:u,sourceLayerIndex:h}of e){let e=sc(t,o);if(!this.layers[0]._featureFilter.filter(s,e,r))continue;let c=n?i.evaluate(e,{},r):void 0,p={id:l,properties:t.properties,type:t.type,sourceLayerIndex:h,index:u,geometry:o?e.geometry:sh(t),patterns:{},dashes:{},sortKey:c};a.push(p)}for(let i of(n&&a.sort((e,t)=>
2e.sortKey-t.sortKey),a)){let{geometry:n,index:a,sourceLayerIndex:s}=i;this.hasDependencies?(sH("line",this.layers,t)?sK("line",this.layers,i,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,i,this.zoom,t),this.patternFeatures.push(i)):this.addFeature(i,n,a,r,{},{},t.subdivisionGranularity);let o=e[a].feature;t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures(e,t,r,i){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,i,e.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,lD)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lE),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties[lg],end:+e.properties[lx]}}addFeature(e,t,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(e,{}),u=o.get("line-cap").evaluate(e,{}),h=o.get("line-miter-limit").evaluate(e,{}),c=o.get("line-round-limit").evaluate(e,{});for(let r of(this.lineClips=this.lineFeatureClips(e),t))this.addLine(r,e,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(e,t,r,i,n,a,s,o){let l,u,h,c,p;this.distance=0,this.scaledDistance=0,this.totalDistance=0;let f=s?o.line.getGranularityForZoomLevel(s.z):1;if(e=o_(e,f),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let d="Polygon"===oP.types[t.type],y=e.length;for(;y>=2&&e[y-1].equals(e[y-2]);)y--;let m=0;for(;m<y-1&&e[m].equals(e[m+1]);)m++;if(y-m<(d?3:2))return;"bevel"===r&&(n=1.05);let g=this.overscaling<=16?15*ed/(512*this.overscaling):0,x=this.segments.prepareSegment(10*y,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,d&&(l=e[y-2],p=e[m].sub(l)._unit()._perp());for(let t=m;t<y;t++){if((h=t===y-1?d?e[m+1]:void 0:e[t+1])&&e[t].equals(h))continue;p&&(c=p),l&&(u=l),l=e[t],p=h?h.sub(l)._unit()._perp():c;let s=(c||=p).add(p);(0!==s.x||0!==s.y)&&s._unit();let o=c.x*p.x+c.y*p.y,f=s.x*p.x+s.y*p.y,v=0!==f?1/f:1/0,b=2*Math.sqrt(2-2*f),w=f<lP&&u&&h,_=c.x*p.y-c.y*p.x>0;if(w&&t>m){let e=l.dist(u);if(e>2*g){let t=l.sub(l.sub(u)._mult(g/e)._round());this.updateDistance(u,t),this.addCurrentVertex(t,c,0,0,x),u=t}}let S=u&&h,A=S?r:d?"butt":i;if(S&&"round"===A&&(v<a?A="miter":v<=2&&(A="fakeround")),"miter"===A&&v>n&&(A="bevel"),"bevel"===A&&(v>2&&(A="flipbevel"),v<n&&(A="miter")),u&&this.updateDistance(u,l),"miter"===A)s._mult(v),this.addCurrentVertex(l,s,0,0,x);else if("flipbevel"===A){if(v>100)s=p.mult(-1);else{let e=v*c.add(p).mag()/c.sub(p).mag();s._perp()._mult(e*(_?-1:1))}this.addCurrentVertex(l,s,0,0,x),this.addCurrentVertex(l,s.mult(-1),0,0,x)}else if("bevel"===A||"fakeround"===A){let e=-Math.sqrt(v*v-1),t=_?e:0,r=_?0:e;if(u&&this.addCurrentVertex(l,c,t,r,x),"fakeround"===A){let e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;
2if(.5!==r){let e=r-.5,t=1.0904+o*(-3.2452+o*(3.55645-1.43519*o)),i=.848013+o*(-1.06021+.215638*o);r+=r*e*(r-1)*(t*e*e+i)}let i=p.sub(c)._mult(r)._add(c)._unit()._mult(_?-1:1);this.addHalfVertex(l,i.x,i.y,!1,_,0,x)}}h&&this.addCurrentVertex(l,p,-t,-r,x)}else if("butt"===A)this.addCurrentVertex(l,s,0,0,x);else if("square"===A){let e=u?1:-1;this.addCurrentVertex(l,s,e,e,x)}else"round"===A&&(u&&(this.addCurrentVertex(l,c,0,0,x),this.addCurrentVertex(l,c,1,1,x,!0)),h&&(this.addCurrentVertex(l,p,-1,-1,x,!0),this.addCurrentVertex(l,p,0,0,x)));if(w&&t<y-1){let e=l.dist(h);if(e>2*g){let t=l.add(h.sub(l)._mult(g/e)._round());this.updateDistance(l,t),this.addCurrentVertex(t,p,0,0,x),l=t}}}}addCurrentVertex(e,t,r,i,n,a=!1){let s=t.x+t.y*r,o=t.y-t.x*r,l=-t.x+t.y*i,u=-t.y-t.x*i;this.addHalfVertex(e,s,o,a,!1,r,n),this.addHalfVertex(e,l,u,a,!0,-i,n),this.distance>16384&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a))}addHalfVertex({x:e,y:t},r,i,n,a,s,o){let l=(this.lineClips?32767*this.scaledDistance:this.scaledDistance)*.5;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!n,(t<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(0===s?0:s<0?-1:1)+1|(63&l)<<2,l>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let e=t.paint.get("line-dasharray");if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,r,i){for(let n of e){let e=n.paint.get("line-dasharray");if(!e||"constant"===e.value.kind)continue;let a="round"===n.layout.get("line-cap").evaluate(t,{}),s={dasharray:e.value.evaluate({zoom:r-1},t,{}),round:a},o={dasharray:e.value.evaluate({zoom:r},t,{}),round:a},l={dasharray:e.value.evaluate({zoom:r+1},t,{}),round:a},u=`${s.dasharray.join(",")},${s.round}`,h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`;i.dashDependencies[u]=s,i.dashDependencies[h]=o,i.dashDependencies[c]=l,t.dashes[n.id]={min:u,mid:h,max:c}}}};nm("LineBucket",lF,{omit:["layers","patternFeatures"]});var lz={get paint(){return x=x||new nW({"line-opacity":new nG(eZ.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new nj(eZ.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new nG(eZ.paint_line["line-color"],"line-color"),"line-translate":new nj(eZ.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new nj(eZ.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new nG(eZ.paint_line["line-width"],"line-width"),"line-gap-width":new nG(eZ.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new nG(eZ.paint_line["line-offset"],"line-offset"),"line-blur":new nG(eZ.paint_line["line-blur"],"line-blur"),"line-dasharray":new nX(eZ.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new nX(eZ.paint_line["line-pattern"],"line-pattern"),"line-gradient":new nZ(eZ.paint_line["line-gradient"],"line-gradient")})},get layout(){return g=g||new nW({"line-cap":new nG(eZ.layout_line["line-cap"],"line-cap"),"line-join":new nG(eZ.layout_line["line-join"],"line-join"),"line-miter-limit":new nG(eZ.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new nG(eZ.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new nG(eZ.layout_line["line-sort-key"],"line-sort-key")})}},lB=class extends nG{possiblyEvaluate(e,t){return t=new nF(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=ex({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}},lC=class extends nJ{constructor(e,t){super(e,lz,t),this.gradientVersion=0,v||((v=new lB(lz.paint.properties["line-width"].specification,"line-floorwidth")).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this.gradientExpression();void 0!==e._styleExpression?this.stepInterpolant=e._styleExpression.expression instanceof rr:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=v.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new lF(e)}queryRadius(e){return function(e,t){return t>0?t+2*e:e}(sb("line-width",this,e),sb("line-gap-width",this,e))/2+Math.abs(sb("line-offset",this,e))+sw(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=s_(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*function(e,t){return t>0?t+2*e:e}(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);for(let e of(l&&(i=function(e,t){let r=[];for(let i of e){let e=function(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=t.at(-1);
2(0===r||n&&!i.equals(n))&&t.push(i)}return t}(i),n=[];for(let r=0;r<e.length;r++){let i=e[r],a=e[r-1],s=e[r+1],o=0===r?new ei(0,0):i.sub(a)._unit()._perp(),l=r===e.length-1?new ei(0,0):s.sub(i)._unit()._perp(),u=o._add(l)._unit(),h=u.x*l.x+u.y*l.y;0!==h&&u._mult(1/h),n.push(u._mult(t)._add(i))}r.push(n)}return r}(i,l*a)),i)){if(s.length>=3){for(let t of e)if(sv(s,t))return!0}if(function(e,t,r){if(e.length>1){if(sy(e,t))return!0;for(let i of t)if(sm(i,e,r))return!0}for(let i of e)if(sm(i,t,r))return!0;return!1}(s,e,o))return!0}return!1}isTileClipped(){return!0}};let lV=n5([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),lL=n5([{name:"a_projected_pos",components:3,type:"Float32"}],4);n5([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let lO=n5([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);n5([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let l$=n5([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);n5([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),n5([{name:"triangle",components:3,type:"Uint16"}]),n5([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),n5([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),n5([{type:"Float32",name:"offsetX"}]),n5([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),n5([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let lR={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},lN={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},lU={40:!0};function lq(e,t,r,i,n,a){if("fontStack"in t){let i=r[t.fontStack]?.[e];return i?i.metrics.advance*t.scale+n:0}{let e=i[t.imageName];return e?e.displaySize[0]*t.scale*24/a+n:0}}function lj(e,t,r,i){let n=Math.pow(e-t,2);if(i)if(e<t)return n/2;else return 2*n;return n+Math.abs(r)*r}function lG(e,t,r,i,n,a){let s=null,o=lj(t,r,n,a);for(let e of i){let i=lj(t-e.x,r,n,a)+e.badness;i<=o&&(s=e,o=i)}return{index:e,x:t,priorBreak:s,badness:o}}var lX=class e{constructor(e="",t=[],r=[]){this.text=e,this.sections=t,this.sectionIndex=r,this.imageSectionID=null}static fromFeature(t,r){let i=new e;for(let e of t.sections)e.image?i.addImageSection(e):i.addTextSection(e,r);return i}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=function(e){let t="",r={premature:!0,value:void 0},i=e[Symbol.iterator](),n=i.next(),a=e[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!nE(s.value.codePointAt(0))||lR[s.value])&&(r.premature||!nE(r.value.codePointAt(0))||lR[r.value])&&lR[n.value]?t+=lR[n.value]:t+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return t}(this.text)}hasZeroWidthSpaces(){return this.text.includes("​")}trim(){let e=this.text.match(/^\s*/),t=e?e[0].length:0,r=this.text.match(/\S\s*$/),i=r?r[0].length-1:0;this.text=this.text.substring(t,this.text.length-i),this.sectionIndex=this.sectionIndex.slice(t,this.sectionIndex.length-i)}substring(t,r){let i=[...this.text].slice(t,r).join(""),n=this.sectionIndex.slice(t,r);return new e(i,this.sections,n)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>
2Math.max(e,this.sections[t].scale),0)}getMaxImageSize(e){let t=0,r=0;for(let i=0;i<this.length();i++){let n=this.getSection(i);if("imageName"in n){let i=e[n.imageName];if(!i)continue;let a=i.displaySize;t=Math.max(t,a[0]),r=Math.max(r,a[1])}}return{maxImageWidth:t,maxImageHeight:r}}addTextSection(e,t){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||t});let r=this.sections.length-1;this.sectionIndex.push(...[...e.text].map(()=>r))}addImageSection(e){let t=e.image?e.image.name:"";if(0===t.length)return void e_("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:t}),this.sectionIndex.push(this.sections.length-1)):e_("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,t,r,i,n){let a=[],s=this.determineAverageLineWidth(e,t,r,i,n),o=this.hasZeroWidthSpaces(),l=0,u=0,h=this.text[Symbol.iterator](),c=h.next(),p=this.text[Symbol.iterator]();p.next();let f=p.next(),d=this.text[Symbol.iterator]();d.next(),d.next();let y=d.next();for(;!c.done;){let t=this.getSection(u),m=c.value.codePointAt(0);if(nA(m)||(l+=lq(m,t,r,i,e,n)),!f.done){let e=/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(m)),r=f.value.codePointAt(0);(lN[m]||e||"imageName"in t||!y.done&&lU[r])&&a.push(lG(u+1,l,s,a,function(e,t,r){let i=0;return 10===e&&(i-=1e4),r&&(i+=150),(40===e||65288===e)&&(i+=50),(41===t||65289===t)&&(i+=50),i}(m,r,e&&o),!1))}u++,c=h.next(),f=p.next(),y=d.next()}return function e(t){return t?e(t.priorBreak).concat(t.index):[]}(lG(this.length(),l,s,a,0,!0))}determineAverageLineWidth(e,t,r,i,n){let a=0,s=0;for(let t of this.text){let o=this.getSection(s);a+=lq(t.codePointAt(0),o,r,i,e,n),s++}let o=Math.max(1,Math.ceil(a/t));return a/o}};let lY=1/0x100000000,lZ="u"<typeof TextDecoder?null:new TextDecoder("utf-8");var lW=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,r=this.length){let i;for(;i=this.nextField(r);)e(i,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getUint32(this.pos+4,!0);return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getInt32(this.pos+4,!0);return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,r=t[this.pos++];if(r<128)return r;let i=127&r,n;return(i|=(127&(n=t[this.pos++]))<<7,n<128||(i|=(127&(n=t[this.pos++]))<<14,n<128||(i|=(127&(n=t[this.pos++]))<<21,n<128)))?i:function(e,t,r){let i,n,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128||(i|=(127&(n=a[r.pos++]))<<3,n<128)||(i|=(127&(n=a[r.pos++]))<<10,n<128)||(i|=(127&(n=a[r.pos++]))<<17,n<128)||(i|=(127&(n=a[r.pos++]))<<24,n<128)||(i|=(1&(n=a[r.pos++]))<<31,n<128))return lK(e,i,t);throw Error("Expected varint not more than 10 bytes")}(i|=(15&(n=t[this.pos]))<<28,e,this)}readSVarint(){let e=this.readVarint();return e%2==1?-((e+1)/2):e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return(this.pos=e,e-t>=12&&lZ)?lZ.decode(this.buf.subarray(t,e)):function(e,t,r){let i="",n=t;
2for(;n<r;){let t,a,s,o=e[n],l=null,u=o>239?4:o>223?3:o>191?2:1;if(n+u>r)break;1===u?o<128&&(l=o):2===u?(192&(t=e[n+1]))==128&&(l=(31&o)<<6|63&t)<=127&&(l=null):3===u?(t=e[n+1],a=e[n+2],(192&t)==128&&(192&a)==128&&((l=(15&o)<<12|(63&t)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(t=e[n+1],a=e[n+2],s=e[n+3],(192&t)==128&&(192&a)==128&&(192&s)==128&&((l=(15&o)<<18|(63&t)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=u}return i}(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=7&t,this._valueStart=this.pos,t>>>3}skip(e){let t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else if(1===t)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}},lH=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*lY),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*lY),!0),this.pos+=8}writeVarint(e){if((e=+e||0)>=0&&e<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=e;return}e>0xfffffff||e<0?function(e,t){var r,i,n,a;let s,o,l;if(e>=0?(s=e%0x100000000|0,o=e/0x100000000|0):(s=~(-e%0x100000000),o=~(-e/0x100000000),0xffffffff^s?s=s+1|0:(s=0,o=o+1|0)),e>=0xffffffffffffffff||e<-0xffffffffffffffff)throw Error("Given varint doesn't fit into 10 bytes");t.realloc(10),r=s,(i=t).buf[i.pos++]=127&r|128,r>>>=7,i.buf[i.pos++]=127&r|128,r>>>=7,i.buf[i.pos++]=127&r|128,r>>>=7,i.buf[i.pos++]=127&r|128,r>>>=7,i.buf[i.pos]=127&r,n=o,a=t,l=(7&n)<<4,a.buf[a.pos++]|=l|128*!!(n>>>=3),n&&(a.buf[a.pos++]=127&n|128*!!(n>>>=7),!n||(a.buf[a.pos++]=127&n|128*!!(n>>>=7),n&&(a.buf[a.pos++]=127&n|128*!!(n>>>=7),!n||(a.buf[a.pos++]=127&n|128*!!(n>>>=7),n&&(a.buf[a.pos++]=127&n)))))}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|128*(e>127),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|128*(e>127),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|128*(e>127),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?-(2*e)-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;let t=this.pos;this.pos=function(e,t,r){for(let i=0,n,a;i<t.length;i++){if((n=t.charCodeAt(i))>55295&&n<57344)if(a)if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,a=n;continue}else n=a-55296<<10|n-56320|65536,a=null;else{n>56319||i+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):a=n;continue}else a&&(e[r++]=239,e[r++]=191,e[r++]=189,a=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);let r=this.pos-t;r>=128&&lJ(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t),this.buf.set(e,this.pos),this.pos+=t}writeRawMessage(e,t){this.pos++;let r=this.pos;e(t,this);let i=this.pos-r;i>=128&&lJ(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,t,r){this.writeTag(e,2),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,lQ,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,l0,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,l3,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,l1,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,l2,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,l5,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,l6,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,l4,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,l8,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}
2writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function lK(e,t,r){return r?0x100000000*t+(e>>>0):(t>>>0)*0x100000000+(e>>>0)}function lJ(e,t,r){let i=t<=16383?1:t<=2097151?2:t<=0xfffffff?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i),r.buf.copyWithin(e+i,e,r.pos)}function lQ(e,t){let r=e.length,i=t.buf,n=t.pos,a=t.length;for(let s=0;s<r;s++){let r=e[s];if(r<0||n+10>a){t.pos=n,t.writeVarint(r),i=t.buf,n=t.pos,a=t.length;continue}for(;r>127;)i[n++]=r%128|128,r=Math.floor(r/128);i[n++]=r}t.pos=n}function l0(e,t){for(let r=0;r<e.length;r++)t.writeSVarint(e[r])}function l1(e,t){for(let r=0;r<e.length;r++)t.writeFloat(e[r])}function l2(e,t){for(let r=0;r<e.length;r++)t.writeDouble(e[r])}function l3(e,t){for(let r=0;r<e.length;r++)t.writeBoolean(e[r])}function l5(e,t){for(let r=0;r<e.length;r++)t.writeFixed32(e[r])}function l6(e,t){for(let r=0;r<e.length;r++)t.writeSFixed32(e[r])}function l4(e,t){for(let r=0;r<e.length;r++)t.writeFixed64(e[r])}function l8(e,t){for(let r=0;r<e.length;r++)t.writeSFixed64(e[r])}function l7(e){let t=0,r=0;for(let i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort((e,t)=>t.h-e.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let t of e)for(let e=i.length-1;e>=0;e--){let r=i[e];if(!(t.w>r.w)&&!(t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){let t=i.pop();t&&e<i.length&&(i[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):(t.w===r.w||i.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:n,h:a,fill:t/(n*a)||0}}var l9=class{constructor(e,{pixelRatio:t,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},ue=class{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[];let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:s}=l7(n),o=new sL({width:a||1,height:s||1});for(let t in e){let i=e[t];
2if(i.isWebGLImage)continue;let n=r[t].paddedRect;sL.copy(i.data,o,{x:0,y:0},{x:n.x+1,y:n.y+1},i.data)}for(let e in t){let r=t[e],n=i[e].paddedRect,a=n.x+1,s=n.y+1,l=r.data.width,u=r.data.height;sL.copy(r.data,o,{x:0,y:0},{x:a,y:s},r.data),sL.copy(r.data,o,{x:0,y:u-1},{x:a,y:s-1},{width:l,height:1}),sL.copy(r.data,o,{x:0,y:0},{x:a,y:s+u},{width:l,height:1}),sL.copy(r.data,o,{x:l-1,y:0},{x:a-1,y:s},{width:1,height:u}),sL.copy(r.data,o,{x:0,y:0},{x:a+l,y:s},{width:1,height:u})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new l9(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){for(let r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t||!e.needsFirstWebGLRender&&e.version===t.version)return;e.needsFirstWebGLRender=!1,e.version=t.version;let[i,n]=e.tl,a=t.userImage?.data;if("function"!=typeof a?.renderWithWebGL)return void r.update(t.data,void 0,{x:i,y:n});let{width:s,height:o}=t.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:s,height:o}),r.context.setDirty()}};nm("ImagePosition",l9),nm("ImageAtlas",ue);var ut=((E=ut||{})[E.none=0]="none",E[E.horizontal=1]="horizontal",E[E.vertical=2]="vertical",E[E.horizontalOnly=3]="horizontalOnly",E);function ur(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d){let y,m=lX.fromFeature(e,n);2===c&&m.verticalizePunctuation();let g=m.determineLineBreaks(u,a,t,i,f),{processBidirectionalText:x,processStyledBidirectionalText:v}=nP;if(x&&1===m.sections.length)for(let e of(y=[],g=g.map(e=>m.toCodeUnitIndex(e)),x(m.toString(),g))){let t=[...e].map(()=>0);y.push(new lX(e,m.sections,t))}else if(v){y=[],g=g.map(e=>m.toCodeUnitIndex(e));let e=0,t=[];for(let r of m.text)t.push(...Array(r.length).fill(m.sectionIndex[e])),e++;for(let e of v(m.text,t,g)){let t=[],r="";for(let i of e[0])t.push(e[1][r.length]),r+=i;y.push(new lX(e[0],m.sections,t))}}else y=function(e,t){let r=[],i=0;for(let n of t)r.push(e.substring(i,n)),i=n;return i<e.length()&&r.push(e.substring(i,e.length())),r}(m,g);let b=[],w={positionedLines:b,text:m.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(e,t,r,i,n,a,s,o,l,u,h,c){let p=0,f=0,d=0,y=0,m="right"===o?1:.5*("left"!==o),g=24/c,x=0;for(let s of n){s.trim();let n=s.getMaxScale(),o={positionedGlyphs:[],lineOffset:0};e.positionedLines[x]=o;let c=o.positionedGlyphs,v=0;if(!s.length()){f+=a,++x;continue}let b=function(e,t,r){let i=24*t.getMaxScale(),{maxImageWidth:n,maxImageHeight:a}=t.getMaxImageSize(e),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}(i,s,g),w=0;for(let a of s.text){let o,d=s.getSection(w),y=a.codePointAt(0),m=function(e,t,r){return!(1===e||!t&&!nS(r)||t&&(nA(r)||/\p{sc=Arab}/u.test(String.fromCodePoint(r))))}(l,h,y),x={glyph:y,imageName:null,x:p,y:f+-17,vertical:m,scale:1,fontStack:"",sectionIndex:s.getSectionIndex(w),metrics:null,rect:null};if("fontStack"in d){if(!(o=function(e,t,r,i,n,a){let s,o=function(e,t,r,i){if(e?.rect)return e;let n=t[r.fontStack]?.[i];return n?{rect:null,metrics:n.metrics}:null}(a[e.fontStack]?.[t],n,e,t);if(null===o)return null;if(r)s=i.verticalLineContentWidth-24*e.scale;else{let t=un(e.verticalAlign);s=(i.horizontalLineContentHeight-24*e.scale)*t}return{rect:o.rect,metrics:o.metrics,baselineOffset:s}}(d,y,m,b,t,r)))continue;x.fontStack=d.fontStack}else{if(e.iconsInText=!0,d.scale*=g,!(o=function(e,t,r,i,n){let a,s=n[e.imageName];if(!s)return null;let o=s.paddedRect,l=s.displaySize,u={width:l[0],height:l[1],left:1,top:-3,advance:t?l[1]:l[0]};if(t)a=i.verticalLineContentWidth-l[1]*e.scale;else{let t=un(e.verticalAlign);a=(i.horizontalLineContentHeight-l[1]*e.scale)*t}return{rect:o,metrics:u,baselineOffset:a,imageOffset:(t?l[0]:l[1])*e.scale-24*r}}(d,m,n,b,i)))continue;v=Math.max(v,o.imageOffset),x.imageName=d.imageName}let{rect:_,metrics:S,baselineOffset:A}=o;x.y+=A,x.scale=d.scale,x.metrics=S,x.rect=_,c.push(x),m?(e.verticalizable=!0,p+=("imageName"in d?S.advance:24)*d.scale+u):p+=S.advance*d.scale+u,w++}0!==c.length&&(d=Math.max(p-u,d),function(e,t,r){if(0===r)return;let i=e[t],n=i.metrics.advance*i.scale,a=(e[t].x+n)*r;for(let r=0;r<=t;r++)e[r].x-=a}(c,c.length-1,m)),p=0,o.lineOffset=Math.max(v,(n-1)*24);let _=a*n+v;f+=_,y=Math.max(_,y),++x}let{horizontalAlign:v,verticalAlign:b}=ui(s);(function(e,t,r,i,n,a,s,o,l){let u=(t-r)*n,h=0;for(let t of(h=a!==s?-o*i- -17:-i*l*s+.5*s,e))for(let e of t.positionedGlyphs)e.x+=u,e.y+=h})(e.positionedLines,m,v,b,d,y,a,f,n.length),e.top+=-b*f,e.bottom=e.top+f,e.left+=-v*d,e.right=e.left+d}(w,t,r,i,y,s,o,l,c,u,p,d),!function(e){for(let t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(b)&&w}function ui(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function un(e){switch(e){case"top":return 0;case"center":return .5;default:return 1}}function ua(e){let t=e.left,r=e.top,i=e.right-t,n=e.bottom-r,a=e.image.content[2]-e.image.content[0],s=e.image.content[3]-e.image.content[1],o=e.image.textFitWidth??"stretchOrShrink",l=e.image.textFitHeight??"stretchOrShrink",u=a/s;if("proportional"===l){if("stretchOnly"===o&&i/n<u||"proportional"===o){let e=Math.ceil(n*u);t*=e/i,i=e}}else if("proportional"===o&&"stretchOnly"===l&&0!==u&&i/n>u){let e=Math.ceil(i/u);r*=e/n,n=e}return{x1:t,y1:r,x2:t+i,y2:r+n}}function us(e,t,r,i,n,a){let s,o,l,u,h,c=e.image;
2if(c.content){let e=c.content,t=c.pixelRatio||1;s=[e[0]/t,e[1]/t,c.displaySize[0]-e[2]/t,c.displaySize[1]-e[3]/t]}let p=t.left*a,f=t.right*a;"width"===r||"both"===r?(h=n[0]+p-i[3],l=n[0]+f+i[1]):l=(h=n[0]+(p+f-c.displaySize[0])/2)+c.displaySize[0];let d=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(o=n[1]+d-i[0],u=n[1]+y+i[2]):u=(o=n[1]+(d+y-c.displaySize[1])/2)+c.displaySize[1],{image:c,top:o,right:l,bottom:u,left:h,collisionPadding:s}}function uo(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new nF(e+1))};{if("source"===r.kind)return{kind:"source"};let{zoomStops:t,interpolationType:i}=r,n=0;for(;n<t.length&&t[n]<=e;)n++;let a=n=Math.max(0,n-1);for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);let s=t[n],o=t[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:o,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:o,minSize:r.evaluate(new nF(s)),maxSize:r.evaluate(new nF(o)),interpolationType:i}}}function ul(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}let uu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function uh(e,t,r,i,n,a,s,o,l,u,h,c,p){let f=o?Math.min(32640,Math.round(o[0])):0,d=o?Math.min(32640,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),a,s,(f<<1)+ +!!l,d,16*u,16*h,256*c,256*p)}function uc(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}var up=class{constructor(e){this.layoutVertexArray=new aR,this.indexArray=new aG,this.programConfigurations=e,this.segments=new aW,this.dynamicLayoutVertexArray=new aN,this.opacityVertexArray=new aU,this.hasVisibleVertices=!1,this.placedSymbolArray=new aS}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,i){!this.isEmpty()&&(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lV.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,lL.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,uu,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};nm("SymbolBuffers",up);var uf=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new aW,this.collisionVertexArray=new aj}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,lO.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};nm("CollisionBuffers",uf);var ud=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=uo(this.zoom,t["text-size"]),this.iconSizeData=uo(this.zoom,t["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap="never"!==ul(r,"text-overlap","text-allow-overlap")||"never"!==ul(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==n&&!i.isConstant();let a="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(e=>ut[e])),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID}createArrays(){this.text=new up(new sl(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new up(new sl(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new aI,this.lineVertexArray=new aT,this.symbolInstances=new ak,this.textAnchorOffsets=new aM}
2calculateGlyphDependencies(e,t,r,i,n){for(let a of e)if(t[a.codePointAt(0)]=!0,(r||i)&&n){let e=lR[a];e&&(t[e.codePointAt(0)]=!0)}}populate(e,t,r){let i=this.layers[0],n=i.layout,a=n.get("text-font"),s=n.get("text-field"),o=n.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof tV&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==o.value.kind||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=t.iconDependencies,p=t.glyphDependencies,f=t.availableImages,d=new nF(this.zoom);for(let{feature:t,id:s,index:o,sourceLayerIndex:y}of e){let e,m,g=i._featureFilter.needGeometry,x=sc(t,g);if(!i._featureFilter.filter(d,x,r))continue;if(g||(x.geometry=sh(t)),l){let t=i.getValueAndResolveTokens("text-field",x,r,f),n=tV.factory(t);this.hasRTLText||=function(e){for(let t of e.sections)if(function(e){for(let t of e)if(nD(t.codePointAt(0)))return!0;return!1}(t.text))return!0;return!1}(n),(!this.hasRTLText||"unavailable"===nP.getRTLTextPluginStatus()||this.hasRTLText&&nP.isParsed())&&(e=function(e,t,r){for(let i of e.sections)i.text=function(e,t,r){let i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),nP.applyArabicShaping&&(e=nP.applyArabicShaping(e)),e}(i.text,t,r);return e}(n,i,x))}if(u){let e=i.getValueAndResolveTokens("icon-image",x,r,f);m=e instanceof tq?e:tq.fromString(e)}if(!e&&!m)continue;let v=this.sortFeaturesByKey?h.evaluate(x,{},r):void 0,b={id:s,text:e,icon:m,index:o,sourceLayerIndex:y,geometry:x.geometry,properties:t.properties,type:oP.types[t.type],sortKey:v};if(this.features.push(b),m&&(c[m.name]=!0),e){let t=a.evaluate(x,{},r).join(","),i="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");for(let r of(this.allowVerticalPlacement=this.writingModes?.includes(2),e.sections))if(r.image)c[r.image.name]=!0;else{let n=nk(e.toString()),a=r.fontStack||t;p[a]||={},this.calculateGlyphDependencies(r.text,p[a],i,this.allowVerticalPlacement,n)}}}"line"===n.get("symbol-placement")&&(this.features=function(e){let t={},r={},i=[],n=0;function a(t){i.push(e[t]),n++}function s(e,t,n){let a=r[e];return delete r[e],r[t]=a,i[a].geometry[0].pop(),i[a].geometry[0]=i[a].geometry[0].concat(n[0]),a}function o(e,r,n){let a=t[r];return delete t[r],t[e]=a,i[a].geometry[0].shift(),i[a].geometry[0]=n[0].concat(i[a].geometry[0]),a}function l(e,t,r){let i=r?t[0][t[0].length-1]:t[0][0];return`${e}:${i.x}:${i.y}`}for(let u=0;u<e.length;u++){let h=e[u],c=h.geometry,p=h.text?h.text.toString():null;if(!p){a(u);continue}let f=l(p,c),d=l(p,c,!0);if(f in r&&d in t&&r[f]!==t[d]){let e=o(f,d,c),n=s(f,d,i[e].geometry);delete t[f],delete r[d],r[l(p,i[n].geometry,!0)]=n,i[e].geometry=null}else f in r?s(f,d,c):d in t?o(f,d,c):(a(u),t[f]=n-1,r[d]=n-1)}return i.filter(e=>e.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((e,t)=>
vendor: 2,091 bytes, line 2
2e.sortKey-t.sortKey)}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),n={};for(let i=e.segment+1;i<t.length;i++)n[i]={x:t[i].x,y:t[i].y,tileUnitDistanceFromAnchor:r},i<t.length-1&&(r+=t[i+1].dist(t[i]));for(let r=e.segment||0;r>=0;r--)n[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r>0&&(i+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){let t=n[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,i,n,a,s,o,l,u,h,c){let p=e.indexArray,f=e.layoutVertexArray,d=e.segments.prepareSegment(4*t.length,f,p,this.canOverlap?a.sortKey:void 0),y=this.glyphOffsetArray.length,m=d.vertexLength,g=this.allowVerticalPlacement&&2===s?Math.PI/2:0,x=a.text&&a.text.sections;for(let i=0;i<t.length;i++){let{tl:n,tr:s,bl:l,br:u,tex:h,pixelOffsetTL:y,pixelOffsetBR:m,minFontScaleX:v,minFontScaleY:b,glyphOffset:w,isSDF:_,sectionIndex:S}=t[i],A=d.vertexLength,k=w[1];uh(f,o.x,o.y,n.x,k+n.y,h.x,h.y,r,_,y.x,y.y,v,b),uh(f,o.x,o.y,s.x,k+s.y,h.x+h.w,h.y,r,_,m.x,y.y,v,b),uh(f,o.x,o.y,l.x,k+l.
vendor: 4,152 bytes, line 2
2y,h.x,h.y+h.h,r,_,y.x,m.y,v,b),uh(f,o.x,o.y,u.x,k+u.y,h.x+h.w,h.y+h.h,r,_,m.x,m.y,v,b),uc(e.dynamicLayoutVertexArray,o,g),p.emplaceBack(A,A+2,A+1),p.emplaceBack(A+1,A+2,A+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w[0]),(i===t.length-1||S!==t[i+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(f.length,a,a.index,{imagePositions:{},canonical:c,formattedSection:x?.[S]})}e.placedSymbolArray.emplaceBack(o.x,o.y,y,this.glyphOffsetArray.length-y,m,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,h)}_addCollisionDebugVertex(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,h=n.collisionVertexArray,c=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,a,c,p,new ei(e,t)),this._addCollisionDebugVertex(u,h,a,c,p,new ei(r,t)),this._addCollisionDebugVertex(u,h,a,c,p,new ei(r,i)),this._addCollisionDebugVertex(u,h,a,c,p,new ei(e,i)),o.vertexLength+=4;let f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){let e=this.collisionBoxArray.get(n),t=e.x1,a=e.y1,s=e.x2,o=e.y2;this.addCollisionDebugVertices(t,a,s,o,i?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new uf(aq,l$.members,aX),this.iconCollisionBox=new uf(aq,l$.members,aX);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,a,s,o,l){let u={};for(let i=t;i<r;i++){let t=e.get(i);u.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},u.textFeatureIndex=t.featureIndex;break}for(let t=i;t<n;t++){let r=e.get(t);u.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalTextFeatureIndex=r.featureIndex;break}for(let t=a;t<s;t++){let r=e.get(t);u.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.iconFeatureIndex=r.featureIndex;break}for(let t=o;t<l;t++){let r=e.get(t);u.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalIconFeatureIndex=r.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+2,t+1),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let s=this.symbolInstances.get(e);i.push(0|Math.round(t*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return a.sort((e,t)=>
2i[e]-i[t]||n[t]-n[e]),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1)&&!(this.icon.segments.get().length>1)){for(let t of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);let r=[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex];for(let e=0;e<r.length;e++){let t=r[e];t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};nm("SymbolBucket",ud,{omit:["layers","collisionBoxArray","features","compareText"]}),ud.MAX_GLYPHS=65535,ud.addDynamicAttributes=uc;var uy={get paint(){return w=w||new nW({"icon-opacity":new nG(eZ.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new nG(eZ.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new nG(eZ.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new nG(eZ.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new nG(eZ.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new nj(eZ.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new nj(eZ.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new nG(eZ.paint_symbol["text-opacity"],"text-opacity"),"text-color":new nG(eZ.paint_symbol["text-color"],"text-color",{runtimeType:e3,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new nG(eZ.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new nG(eZ.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new nG(eZ.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new nj(eZ.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new nj(eZ.paint_symbol["text-translate-anchor"],"text-translate-anchor")})},get layout(){return b=b||new nW({"symbol-placement":new nj(eZ.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new nj(eZ.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new nj(eZ.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new nG(eZ.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new nj(eZ.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new nj(eZ.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new nj(eZ.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new nj(eZ.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new nj(eZ.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new nj(eZ.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new nG(eZ.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new nj(eZ.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new nj(eZ.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new nG(eZ.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new nG(eZ.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new nG(eZ.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new nj(eZ.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new nG(eZ.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new nG(eZ.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new nj(eZ.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new nj(eZ.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new nj(eZ.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new nG(eZ.layout_symbol["text-field"],"text-field"),"text-font":new nG(eZ.layout_symbol["text-font"],"text-font"),"text-size":new nG(eZ.layout_symbol["text-size"],"text-size"),"text-max-width":new nG(eZ.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new nj(eZ.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new nG(eZ.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new nG(eZ.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new nG(eZ.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new nj(eZ.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new nG(eZ.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new nG(eZ.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new nj(eZ.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new nj(eZ.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new nG(eZ.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new nj(eZ.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new nj(eZ.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new nG(eZ.layout_symbol["text-transform"],"text-transform"),"text-offset":new nG(eZ.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new nj(eZ.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new nj(eZ.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new nj(eZ.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new nj(eZ.layout_symbol["text-optional"],"text-optional")})}},um=class{constructor(e){if(void 0===e.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:eQ,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}};nm("FormatSectionOverride",um,{omit:["defaultValue"]});var ug=class e extends nJ{constructor(e,t){super(e,uy,t)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.includes(r)||t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,i){let n=this.layout.get(e).evaluate(t,{},r,i),a=this._unevaluatedLayout._values[e];if(!a.isDataDriven()&&!iS(a.value)&&n){var s;return s=t.properties,n.replace(/{([^{}]+)}/g,(e,t)=>s&&t in s?String(s[t]):"")}return n}createBucket(e){return new ud(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of uy.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),i=new ib(new um(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n="constant"===r.value.kind||"source"===r.value.kind?new ik("source",i):new iI("composite",i,r.value.zoomStops),this.paint._values[t]=new nR(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let r=e.get("text-field"),i=uy.paint.properties[t],n=!1,a=e=>{for(let t of e)if(i.overrides?.hasOverride(t)){n=!0;return}};if("constant"===r.value.kind&&r.value.value instanceof tV)a(r.value.value.sections);else if("source"===r.value.kind||"composite"===r.value.kind){let e=t=>{n||(t instanceof tW&&tY(t.value)===e7?a(t.value.sections):t instanceof rx?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}},ux={get paint(){return _=_||new nW({"background-color":new nj(eZ.paint_background["background-color"],"background-color"),"background-pattern":new nY(eZ.paint_background["background-pattern"],"background-pattern"),"background-opacity":new nj(eZ.paint_background["background-opacity"],"background-opacity")})}},uv=class extends nJ{constructor(e,t){super(e,ux,t)}},ub=class extends nJ{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function uw(e,t){if("custom"===e.type)return new ub(e,t);switch(e.type){case"background":return new uv(e,t);case"circle":return new sD(e,t);case"color-relief":return new sY(e,t);case"fill":return new oT(e,t);case"fill-extrusion":return new oG(e,t);case"heatmap":return new s$(e,t);case"hillshade":return new sN(e,t);case"line":return new lC(e,t);case"raster":return new n0(e,t);case"symbol":return new ug(e,t)}}var u_=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};let uS={once:!0};var uA=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new u_(()=>this.process()),this.subscription=eE(this.target,"message",e=>this.receive(e),!1),this.globalScope=eA(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((r,i)=>{let n=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=t?eE(t.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let r={id:n,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};
2this.target.postMessage(r),i(new eP(t.signal.reason))},uS):null;this.resolveRejects[n]={resolve:e=>{a?.unsubscribe(),r(e)},reject:e=>{a?.unsubscribe(),i(e)}};let s=[],o={...e,id:n,sourceMapId:this.mapId,origin:location.origin,data:nb(e.data,s)};this.target.postMessage(o,{transfer:s})})}receive(e){let t=e.data,r=t.id,i=["file://","resource://android","null"],n=[t.origin,location.origin],a=t.origin===location.origin,s=n.some(e=>i.includes(e));if((a||s)&&(!t.targetMapId||this.mapId===t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];let e=this.abortControllers[r];delete this.abortControllers[r],e&&e.abort();return}if(eA(self)||t.mustQueue){this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if("<response>"===t.type){let r=this.resolveRejects[e];if(delete this.resolveRejects[e],!r)return;t.error?r.reject(em(nw(t.error))):r.resolve(nw(t.data));return}if(!this.messageHandlers[t.type])return void this.completeTask(e,null,null);let r=nw(t.data),i=new AbortController;this.abortControllers[e]=i;try{let n=await this.messageHandlers[t.type](t.sourceMapId,r,i);this.completeTask(e,null,n)}catch(t){this.completeTask(e,em(t))}}completeTask(e,t,r){let i=[];delete this.abortControllers[e];let n={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?nb(t):null,data:nb(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},uk=class{constructor(e,t,r){if(e<0||e>25||r<0||r>=Math.pow(2,e)||t<0||t>=Math.pow(2,e))throw Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=uE(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){var i,n,a;let s,o,l=(i=this.x,n=this.y,s=uD(256*i,256*(n=Math.pow(2,a=this.z)-n-1),a),o=uD((i+1)*256,(n+1)*256,a),`${s[0]},${s[1]},${o[0]},${o[1]}`),u=function(e,t,r){let i="";for(let n=e;n>0;n--){let e=1<<n-1;i+=(t&e?1:0)+(r&e?2:0)}return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,u).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=Math.pow(2,this.z);return new ei((e.x*t-this.x)*ed,(e.y*t-this.y)*ed)}toString(){return`${this.z}/${this.x}/${this.y}`}},uI=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=uE(e,t.z,t.z,t.x,t.y)}},uT=class e{constructor(e,t,r,i,n){if(this.terrainRttPosMatrix32f=null,e<r)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new uk(r,+i,+n),this.key=uE(t,e,r,i,n)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?uE(this.wrap*t,e,this.canonical.z,this.canonical.x,this.canonical.y):uE(this.wrap*t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;
2if(0===e.overscaledZ)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return!(t<0)&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new e(r,this.wrap,r,i,n),new e(r,this.wrap,r,i+1,n),new e(r,this.wrap,r,i,n+1),new e(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new uI(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new o$(e.x-this.wrap,e.y))}normalizeCoordinates(t,r,i=ed){if(t>=0&&t<i&&r>=0&&r<i)return{tileID:this,x:t,y:r};let n=Math.floor(t/i),a=Math.floor(r/i),s=this.canonical.z,o=1<<s,l=this.canonical.y+a;if(l<0||l>=o)return null;let u=this.canonical.x+n,h=this.wrap;return u<0?(h-=Math.ceil(-u/o),u=(u%o+o)%o):u>=o&&(h+=Math.floor(u/o),u%=o),{tileID:new e(this.overscaledZ,h,s,u,l),x:t-n*i,y:r-a*i}}};function uE(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);let a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}let uM=6378137*Math.PI;function uD(e,t,r){let i=2*uM/256/Math.pow(2,r);return[e*i-uM,t*i-uM]}nm("CanonicalTileID",uk),nm("OverscaledTileID",uT,{omit:["terrainRttPosMatrix32f"]});var uP=class e{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(t){let r=new e;return r.extend(t(new ei(this.minX,this.minY))),r.extend(t(new ei(this.maxX,this.minY))),r.extend(t(new ei(this.minX,this.maxY))),r.extend(t(new ei(this.maxX,this.maxY))),r}static fromPoints(t){let r=new e;for(let e of t)r.extend(e);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},uF=class{constructor(e,t){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=t,"id"in e&&("string"==typeof e.id?this.id=parseInt(e.id,10):"number"!=typeof e.id||isNaN(e.id)||(this.id=e.id))}loadGeometry(){let e=[];for(let t of 1===this.feature.type?[this.feature.geometry]:this.feature.geometry){let r=[];for(let e of t)r.push(new ei(e[0],e[1]));e.push(r)}return e}};let uz="_geojsonTileLayer";var uB=class{constructor(e,t){this.layers={[uz]:this},this.name=uz,this.version=t?t.version:1,this.extent=t?t.extent:4096,this.length=e.length,this.features=e}feature(e){return new uF(this.features[e],this.extent)}};function uC(e,t=""){let r=new lH;return function(e,t,r=""){for(let i in e.layers)t.writeMessage(3,(e,t)=>(function(e,t,r=""){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let r=0;r<e.length;r++)i.feature=e.feature(r),t.writeMessage(2,uV,i);for(let e of i.keys)t.writeStringField(3,e);for(let e of i.values)t.writeMessage(4,u$,e)})(e,t,r),e.layers[i])}(e,r,t),r.finish()}function uV(e,t){if(!e.feature)return;let r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,uL,e),t.writeVarintField(3,r.type),t.writeMessage(4,uO,r)}function uL(e,t){for(let r in e.feature?.properties){let i=e.feature.properties[r],n=e.keycache[r];if(null==i)continue;void 0===n&&(e.keys.push(r),n=e.keys.length-1,e.keycache[r]=n),t.writeVarint(n),"string"!=typeof i&&"boolean"!=typeof i&&"number"!=typeof i&&(i=e.jsonPrefix+JSON.stringify(i));let a=typeof i+":"+i,s=e.valuecache[a];void 0===s&&(e.values.push(i),s=e.values.length-1,e.valuecache[a]=s),t.writeVarint(s)}}function uO(e,t){let r=e.loadGeometry(),i=e.type,n=0,a=0;for(let s of r){let r=1;1===i&&(r=s.length),t.writeVarint((r<<3)+1);let o=3===i?s.length-1:s.length;for(let e=0;e<o;e++){1===e&&1!==i&&t.writeVarint((o-1<<3)+2);let r=s[e].x-n,l=s[e].y-a;t.writeVarint(r<<1^r>>31),t.writeVarint(l<<1^l>>31),n+=r,a+=l}3===e.type&&t.writeVarint(15)}}function u$(e,t){let r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}var uR=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},uN=class{constructor(e,t,r,i,n){for(let n in this.type="Feature",this._vectorTileFeature=e,this._x=r,this._y=i,this._z=t,e.properties)"string"==typeof e.properties[n]&&e.properties[n].startsWith("__$json__:")&&(e.properties[n]=JSON.parse(e.properties[n].slice(10)));this.properties=e.properties,this.id=n}
2projectPoint(e,t,r,i){return[(e.x+t)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+r)*2/i)*Math.PI))-90]}projectLine(e,t,r,i){return e.map(e=>this.projectPoint(e,t,r,i))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,t=e.extent*Math.pow(2,this._z),r=e.extent*this._x,i=e.extent*this._y,n=e.loadGeometry();switch(e.type){case 1:{let e=[];for(let t of n)e.push(t[0]);let a=this.projectLine(e,r,i,t);this._geometry=1===e.length?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a};break}case 2:{let e=n.map(e=>this.projectLine(e,r,i,t));this._geometry=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e};break}case 3:{let e=oF(n),a=[];for(let n of e)a.push(n.map(e=>this.projectLine(e,r,i,t)));this._geometry=1===a.length?{type:"Polygon",coordinates:a[0]}:{type:"MultiPolygon",coordinates:a};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&"_x"!==t&&"_y"!==t&&"_z"!==t&&(e[t]=this[t]);return e}},uU=class{constructor(e,t,r){this._name=e,this.dataBuffer=t,"number"==typeof r?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},uq=class extends uU{},uj=class extends uq{getValueFromBuffer(e){return this.dataBuffer[e]}},uG=class extends uq{getValueFromBuffer(e){return this.dataBuffer[e]}}
2,uX=class extends uU{constructor(e,t,r,i){super(e,t,i),this.delta=r}},uY=class extends uX{constructor(e,t,r,i){super(e,Int32Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},uZ=class extends uU{constructor(e,t,r,i){super(e,i?Int32Array.of(t):Uint32Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},uW=class{constructor(e,t,r,i,n=4096){if(this._name=e,this._geometryVector=t,this._idVector=r,this._propertyVectors=i,this._extent=n,0===e.length)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let e=this.idVector.getValue(r);i=this.containsMaxSafeIntegerValues(this.idVector)&&null!==e?Number(e):e}let n={coordinates:t[r],type:this.geometryVector.geometryType(r)},a={};for(let e of this.propertyVectors){if(!e)continue;let t=e.name,i=e.getValue(r);null!==i&&(a[t]=i)}e.push({id:i,geometry:n,properties:a})}return e}containsMaxSafeIntegerValues(e){return e instanceof uj||e instanceof uZ||e instanceof uY||e instanceof uG}},uH=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}};(M=R||(R={})).NONE="NONE",M.DELTA="DELTA",M.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",M.RLE="RLE",M.MORTON="MORTON",M.PDE="PDE",(D=N||(N={})).NONE="NONE",D.FAST_PFOR="FAST_PFOR",D.VARINT="VARINT";let uK=new Uint32Array(33);uK[0]=0;for(let e=1;e<=32;e++)uK[e]=32===e?0xffffffff:0xffffffff>>>32-e;let uJ=function(){var e;if(!Number.isFinite(65536))return 65536;let t=(e=Math.floor(65536))-e%256;return 0===t?256:t}(),uQ=3*uJ/256+uJ|0;function u0(){let e=new Uint8Array(uQ);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function u1(e,t,r){let i=new Uint32Array(r),n=0,a=t.get();for(let t=0;t<i.length;t++){let t=e[a++],r=127&t;if(t<128||(r|=(127&(t=e[a++]))<<7,t<128)||(r|=(127&(t=e[a++]))<<14,t<128)||(r|=(127&(t=e[a++]))<<21,t<128)){i[n++]=r;continue}r|=(15&(t=e[a++]))<<28,i[n++]=r}return t.set(a),i}function u2(e,t,r){let i=new BigUint64Array(r);for(let r=0;r<i.length;r++)i[r]=function(e,t){let r=0n,i=0,n=t.get();for(;n<e.length;){let t=e[n++];if(r|=BigInt(127&t)<<BigInt(i),(128&t)==0)break;if((i+=7)>=64)throw Error("Varint too long")}return t.set(n),r}(e,t);return i}function u3(e){return e>>>1^-(1&e)}function u5(e){return e>>1n^-(1n&e)}function u6(e){return e%2==1?-((e+1)/2):e/2}function u4(e,t,r){if(void 0===r){r=0;for(let i=0;i<t;i++)r+=e[i]}let i=new Uint32Array(r),n=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];i.fill(s,n,n+a),n+=a}return i}function u8(e,t,r){if(void 0===r){r=0;for(let i=0;i<t;i++)r+=Number(e[i])}let i=new BigUint64Array(r),n=0;for(let r=0;r<t;r++){let a=Number(e[r]),s=e[r+t];i.fill(s,n,n+a),n+=a}return i}function u7(e,t,r){let i=new Float64Array(r),n=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];i.fill(s,n,n+a),n+=a}return i}function u9(e){let t=new Int32Array(e.length);t[0]=u3(e[0]);let r=e.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let r=e[i],n=e[i+1],a=e[i+2],s=e[i+3];t[i]=u3(r)+t[i-1],t[i+1]=u3(n)+t[i],t[i+2]=u3(a)+t[i+1],t[i+3]=u3(s)+t[i+2]}for(;i!==e.length;++i)t[i]=u3(e[i])+t[i-1];return t}function he(e){let t=new BigInt64Array(e.length);t[0]=u5(e[0]);let r=e.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let r=e[i],n=e[i+1],a=e[i+2],s=e[i+3];t[i]=u5(r)+t[i-1],t[i+1]=u5(n)+t[i],t[i+2]=u5(a)+t[i+1],t[i+3]=u5(s)+t[i+2]}for(;i!==t.length;++i)t[i]=u5(e[i])+t[i-1];return t}function ht(e){let t=e.length/4*4,r=1;if(t>=4)for(let i=e[0];r<t-4;r+=4)i=e[r]+=i,i=e[r+1]+=i,i=e[r+2]+=i,i=e[r+3]+=i;for(;r!==e.length;)e[r]+=e[r-1],++r}
2function hr(e,t,r,i){if(e.length<2)return new Int32Array(e);let n=new Int32Array(e.length),a=u3(e[0]),s=u3(e[1]);n[0]=hi(Math.round(a*t),r,i),n[1]=hi(Math.round(s*t),r,i);let o=e.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let o=e[l],u=e[l+1],h=u3(o)+a,c=u3(u)+s;n[l]=hi(Math.round(h*t),r,i),n[l+1]=hi(Math.round(c*t),r,i);let p=e[l+2],f=e[l+3];a=u3(p)+h,s=u3(f)+c,n[l+2]=hi(Math.round(a*t),r,i),n[l+3]=hi(Math.round(s*t),r,i)}for(;l!==e.length;l+=2)a+=u3(e[l]),s+=u3(e[l+1]),n[l]=hi(Math.round(a*t),r,i),n[l+1]=hi(Math.round(s*t),r,i);return n}function hi(e,t,r){return Math.min(r,Math.max(t,e))}function hn(e){let t=new Uint32Array(e.length);t[0]=u3(e[0])>>>0;for(let r=1;r<e.length;r++)t[r]=t[r-1]+u3(e[r])>>>0;return t}function ha(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,u5(e[0]));for(let r=1;r<e.length;r++)t[r]=BigInt.asUintN(64,t[r-1]+u5(e[r]));return t}(P=U||(U={})).PRESENT="PRESENT",P.DATA="DATA",P.OFFSET="OFFSET",P.LENGTH="LENGTH",(F=q||(q={})).NONE="NONE",F.SINGLE="SINGLE",F.SHARED="SHARED",F.VERTEX="VERTEX",F.MORTON="MORTON",F.FSST="FSST",(z=j||(j={})).VERTEX="VERTEX",z.INDEX="INDEX",z.STRING="STRING",z.KEY="KEY",(B=G||(G={})).VAR_BINARY="VAR_BINARY",B.GEOMETRIES="GEOMETRIES",B.PARTS="PARTS",B.RINGS="RINGS",B.TRIANGLES="TRIANGLES",B.SYMBOL="SYMBOL",B.DICTIONARY="DICTIONARY";let hs=[U.PRESENT,U.DATA,U.OFFSET,U.LENGTH],ho=[R.NONE,R.DELTA,R.COMPONENTWISE_DELTA,R.RLE,R.MORTON,R.PDE],hl=[N.NONE,N.FAST_PFOR,N.VARINT],hu=[q.NONE,q.SINGLE,q.SHARED,q.VERTEX,q.MORTON,q.FSST],hh=[j.VERTEX,j.INDEX,j.STRING,j.KEY],hc=[G.VAR_BINARY,G.GEOMETRIES,G.PARTS,G.RINGS,G.TRIANGLES,G.SYMBOL,G.DICTIONARY];function hp(e,t){var r,i;let n,a,s=function(e,t){let r=e[t.get()],i=hs[r>>4],n={};switch(i){case U.DATA:n={dictionaryType:hu[15&r]};break;case U.OFFSET:n={offsetType:hh[15&r]};break;case U.LENGTH:n={lengthType:hc[15&r]}}t.increment();let a=e[t.get()],s=ho[a>>5],o=ho[a>>2&7],l=hl[3&a];t.increment();let u=u1(e,t,2),h=u[0];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:u[1],decompressedCount:h}}(e,t);return s.logicalLevelTechnique1===R.MORTON?(r=s,n=u1(e,t,2),{physicalStreamType:r.physicalStreamType,logicalStreamType:r.logicalStreamType,logicalLevelTechnique1:r.logicalLevelTechnique1,logicalLevelTechnique2:r.logicalLevelTechnique2,physicalLevelTechnique:r.physicalLevelTechnique,numValues:r.numValues,byteLength:r.byteLength,decompressedCount:r.decompressedCount,numBits:n[0],coordinateShift:n[1]}):(R.RLE===s.logicalLevelTechnique1||R.RLE===s.logicalLevelTechnique2)&&N.NONE!==s.physicalLevelTechnique?(i=s,a=u1(e,t,2),{physicalStreamType:i.physicalStreamType,logicalStreamType:i.logicalStreamType,logicalLevelTechnique1:i.logicalLevelTechnique1,logicalLevelTechnique2:i.logicalLevelTechnique2,physicalLevelTechnique:i.physicalLevelTechnique,numValues:i.numValues,byteLength:i.byteLength,decompressedCount:a[1],runs:a[0],numRleValues:a[1]}):s}(C=X||(X={}))[C.FLAT=0]="FLAT",C[C.CONST=1]="CONST",C[C.SEQUENCE=2]="SEQUENCE",C[C.DICTIONARY=3]="DICTIONARY",C[C.FSST_DICTIONARY=4]="FSST_DICTIONARY";var hf=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8);return(this.values[t]>>e%8&1)==1}set(e,t){let r=Math.floor(e/8);this.values[r]=this.values[r]|!!t<<e%8}getInt(e){let t=Math.floor(e/8);return this.values[t]>>e%8&1}size(){return this._size}getBuffer(){return this.values}};function hd(e,t,r){if(!t)return e;let i=t.size(),n=new e.constructor(i),a=0;for(let s=0;s<i;s++)n[s]=t.get(s)?e[a++]:r;return n}function hy(e,t,r,i,n){let a;var s=hx(e,t,r),o=r,l=i,u=n;switch(o.logicalLevelTechnique1){case R.DELTA:if(o.logicalLevelTechnique2===R.RLE){if(!u)return function(e,t,r){let i=new Int32Array(r),n=0,a=0;for(let r=0;r<t;r++){let s=e[r],o=u3(e[r+t]);for(let e=0;e<s;e++)a+=o,i[n++]=a}return i}(s,o.runs,o.numRleValues);a=u9(s=u4(s,o.runs,o.numRleValues))}else a=u9(s);break;case R.RLE:a=function(e,t,r){if(void 0===r){r=0;for(let i=0;i<t;i++)r+=e[i]}let i=new Int32Array(r),n=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];s=u3(s),i.fill(s,n,n+a),n+=a}return i}(s,o.runs,o.numRleValues);break;case R.MORTON:ht(s),a=new Int32Array(s);break;case R.COMPONENTWISE_DELTA:if(l&&!u)return hr(s,l.scale,l.min,l.max);a=function(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);
2t[0]=u3(e[0]),t[1]=u3(e[1]);let r=e.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let r=e[i],n=e[i+1],a=e[i+2],s=e[i+3];t[i]=u3(r)+t[i-2],t[i+1]=u3(n)+t[i-1],t[i+2]=u3(a)+t[i],t[i+3]=u3(s)+t[i+1]}for(;i!==e.length;i+=2)t[i]=u3(e[i])+t[i-2],t[i+1]=u3(e[i+1])+t[i-1];return t}(s);break;case R.NONE:a=function(e){let t=new Int32Array(e.length);for(let r=0;r<e.length;r++)t[r]=u3(e[r]);return t}(s);break;default:throw Error(`The specified Logical level technique is not supported: ${o.logicalLevelTechnique1}`)}return u?hd(a,u,0):a}function hm(e,t,r,i,n){let a;var s,o=hx(e,t,r),l=r,u=i,h=n;switch(l.logicalLevelTechnique1){case R.DELTA:a=l.logicalLevelTechnique2===R.RLE?hn(u4(o,l.runs,l.numRleValues)):hn(o);break;case R.RLE:a=u4(o,l.runs,l.numRleValues);break;case R.MORTON:ht(o),a=o;break;case R.COMPONENTWISE_DELTA:if(u&&!h){s=u.scale,a=new Uint32Array(hr(o,s,u.min,u.max))}else a=function(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=u3(e[0])>>>0,t[1]=u3(e[1])>>>0;for(let r=2;r<e.length;r+=2)t[r]=t[r-2]+u3(e[r])>>>0,t[r+1]=t[r-1]+u3(e[r+1])>>>0;return t}(o);break;case R.NONE:a=o;break;default:throw Error(`The specified Logical level technique is not supported: ${l.logicalLevelTechnique1}`)}return h?hd(a,h,0):a}function hg(e,t,r){return function(e,t){if(t.logicalLevelTechnique1===R.DELTA&&t.logicalLevelTechnique2===R.NONE){let t=new Int32Array(e.length+1);t[0]=0,t[1]=u3(e[0]);let r=t[1];for(let i=2;i!==t.length;++i)r+=u3(e[i-1]),t[i]=t[i-1]+r;return new Uint32Array(t)}if(t.logicalLevelTechnique1===R.RLE&&t.logicalLevelTechnique2===R.NONE)return function(e,t,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let r=0;r<t;r++){let s=e[r],o=e[r+t];for(let e=n;e<n+s;e++)i[e]=o+a,a=i[e];n+=s}return i}(e,t.runs,t.numRleValues);if(t.logicalLevelTechnique1===R.NONE&&t.logicalLevelTechnique2===R.NONE){let r=0;for(let t=0;t<e.length;t++)e[t]+=r,r=e[t];let i=new Uint32Array(t.numValues+1);return i[0]=0,i.set(e,1),i}if(t.logicalLevelTechnique1===R.DELTA&&t.logicalLevelTechnique2===R.RLE){let r=function(e,t,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let r=0;r<t;r++){let s=e[r],o=e[r+t];o=u3(o);for(let e=n;e<n+s;e++)i[e]=o+a,a=i[e];n+=s}return i}(e,t.runs,t.numRleValues);return ht(r),new Uint32Array(r)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}(hx(e,t,r),r)}function hx(e,t,r){let i=r.physicalLevelTechnique;switch(i){case N.FAST_PFOR:var n,a;return n=r.numValues,function(e,t,r,i,n){let a=i.get();if((3&r)!=0)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=function(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let r=new Uint32Array(Math.max(16,2*t));return e.encodedWords=r,r}(n,s);!function(e,t,r,i){if(t<0||r<0||t+r>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${r}, bytes.length=${e.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${s}`);if(n>0){let r=e.byteOffset+t;if((3&r)==0){let t=new Uint32Array(e.buffer,r,n);for(let e=0;e<n;e++)i[e]=0|function(e){let t=e>>>0;return((255&t)<<24|(65280&t)<<8|t>>>8&65280|t>>>24&255)>>>0}(t[e])}else for(let r=0;r<n;r++){let n=t+4*r;i[r]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]}}if(a){let a=t+4*n,s=r-4*n,o=0;for(let t=0;t<s;t++)o|=e[a+t]<<24-8*t;i[n]=0|o}}(e,a,r,o);let l=function(e,t,r){let i=0,n=0,a=new Uint32Array(t),s=r??u0();if(e.length>0){let t=0|e[i];if(i=i+1|0,(255&t)!=0)throw Error(`FastPFOR decode: invalid alignedLength=${t} (expected multiple of 256)`);if(n+t>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${t}, out.length=${a.length})`);i=function(e,t,r,i,n,a){let s=i+(n-n%256),o=i,l=r;for(;o!==s;){let r=Math.min(uJ,s-o);l=function(e,t,r,i,n,a){let s=0|r,o=0|e[s];if(o<=0||s+o>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=s+o|0,u=e[l]>>>0,h=u+3>>>2,c=l+1,p=c+h;if(p>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${u} (metaInts=${h}, pageStart=${s}, packedEnd=${l}
2, byteContainerStart=${c}) causes bitmapPos=${p} out of bounds (encoded.length=${e.length})`);let f=function(e,t,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(2*r),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if((3&n.byteOffset)==0){let r=i.byteContainerI32;(!r||r.buffer!==n.buffer||r.byteOffset!==n.byteOffset||r.length<a)&&(r=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),r.set(e.subarray(t,t+a))}else for(let r=0;r<a;r=r+1|0){let i=0|e[t+r|0],a=r<<2;n[a]=255&i,n[a+1|0]=i>>>8&255,n[a+2|0]=i>>>16&255,n[a+3|0]=i>>>24&255}let s=3&r;if(s>0){let r=0|e[t+a|0],i=a<<2;for(let e=0;e<s;e=e+1|0)n[i+e|0]=r>>>(e<<3)&255}return n}(e,c,u,a),d=function(e,t,r){let i=0|e[t++],n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if((i>>>a-1&1)==0)continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let s=e[t++]>>>0,o=function(e){var t;return(t=e+31)-t%32}(s),l=s*a+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let u=n[a];(!u||u.length<o)&&(u=n[a]=new Uint32Array(o));let h=0;for(;h<s;h=h+32|0)(function(e,t,r,i,n){switch(n){case 2:let a,s,o;a=i,s=e[t]>>>0,o=e[t+1]>>>0,r[a++]=s>>>0&3,r[a++]=s>>>2&3,r[a++]=s>>>4&3,r[a++]=s>>>6&3,r[a++]=s>>>8&3,r[a++]=s>>>10&3,r[a++]=s>>>12&3,r[a++]=s>>>14&3,r[a++]=s>>>16&3,r[a++]=s>>>18&3,r[a++]=s>>>20&3,r[a++]=s>>>22&3,r[a++]=s>>>24&3,r[a++]=s>>>26&3,r[a++]=s>>>28&3,r[a++]=s>>>30&3,r[a++]=o>>>0&3,r[a++]=o>>>2&3,r[a++]=o>>>4&3,r[a++]=o>>>6&3,r[a++]=o>>>8&3,r[a++]=o>>>10&3,r[a++]=o>>>12&3,r[a++]=o>>>14&3,r[a++]=o>>>16&3,r[a++]=o>>>18&3,r[a++]=o>>>20&3,r[a++]=o>>>22&3,r[a++]=o>>>24&3,r[a++]=o>>>26&3,r[a++]=o>>>28&3,r[a]=o>>>30&3;return;case 3:let l,u,h,c;l=i,u=e[t]>>>0,h=e[t+1]>>>0,c=e[t+2]>>>0,r[l++]=u>>>0&7,r[l++]=u>>>3&7,r[l++]=u>>>6&7,r[l++]=u>>>9&7,r[l++]=u>>>12&7,r[l++]=u>>>15&7,r[l++]=u>>>18&7,r[l++]=u>>>21&7,r[l++]=u>>>24&7,r[l++]=u>>>27&7,r[l++]=(u>>>30|(1&h)<<2)&7,r[l++]=h>>>1&7,r[l++]=h>>>4&7,r[l++]=h>>>7&7,r[l++]=h>>>10&7,r[l++]=h>>>13&7,r[l++]=h>>>16&7,r[l++]=h>>>19&7,r[l++]=h>>>22&7,r[l++]=h>>>25&7,r[l++]=h>>>28&7,r[l++]=(h>>>31|(3&c)<<1)&7,r[l++]=c>>>2&7,r[l++]=c>>>5&7,r[l++]=c>>>8&7,r[l++]=c>>>11&7,r[l++]=c>>>14&7,r[l++]=c>>>17&7,r[l++]=c>>>20&7,r[l++]=c>>>23&7,r[l++]=c>>>26&7,r[l]=c>>>29&7;return;case 4:let p,f,d,y,m;p=i,f=e[t]>>>0,d=e[t+1]>>>0,y=e[t+2]>>>0,m=e[t+3]>>>0,r[p++]=f>>>0&15,r[p++]=f>>>4&15,r[p++]=f>>>8&15,r[p++]=f>>>12&15,r[p++]=f>>>16&15,r[p++]=f>>>20&15,r[p++]=f>>>24&15,r[p++]=f>>>28&15,r[p++]=d>>>0&15,r[p++]=d>>>4&15,r[p++]=d>>>8&15,r[p++]=d>>>12&15,r[p++]=d>>>16&15,r[p++]=d>>>20&15,r[p++]=d>>>24&15,r[p++]=d>>>28&15,r[p++]=y>>>0&15,r[p++]=y>>>4&15,r[p++]=y>>>8&15,r[p++]=y>>>12&15,r[p++]=y>>>16&15,r[p++]=y>>>20&15,r[p++]=y>>>24&15,r[p++]=y>>>28&15,r[p++]=m>>>0&15,r[p++]=m>>>4&15,r[p++]=m>>>8&15,r[p++]=m>>>12&15,r[p++]=m>>>16&15,r[p++]=m>>>20&15,r[p++]=m>>>24&15,r[p]=m>>>28&15;return;case 5:let g,x,v,b,w,_;g=i,x=e[t]>>>0,v=e[t+1]>>>0,b=e[t+2]>>>0,w=e[t+3]>>>0,_=e[t+4]>>>0,r[g++]=x>>>0&31,r[g++]=x>>>5&31,r[g++]=x>>>10&31,r[g++]=x>>>15&31,r[g++]=x>>>20&31,r[g++]=x>>>25&31,r[g++]=(x>>>30|(7&v)<<2)&31,r[g++]=v>>>3&31,r[g++]=v>>>8&31,r[g++]=v>>>13&31,r[g++]=v>>>18&31,r[g++]=v>>>23&31,r[g++]=(v>>>28|(1&b)<<4)&31,r[g++]=b>>>1&31,r[g++]=b>>>6&31,r[g++]=b>>>11&31,r[g++]=b>>>16&31,r[g++]=b>>>21&31,r[g++]=b>>>26&31,r[g++]=(b>>>31|(15&w)<<1)&31,r[g++]=w>>>4&31,r[g++]=w>>>9&31,r[g++]=w>>>14&31,r[g++]=w>>>19&31,r[g++]=w>>>24&31,r[g++]=(w>>>29|(3&_)<<3)&31,r[g++]=_>>>2&31,r[g++]=_>>>7&31,r[g++]=_>>>12&31,r[g++]=_>>>17&31,r[g++]=_>>>22&31,r[g]=_>>>27&31;return;case 6:let S,A,k,I,T,E,M;S=i,A=e[t]>>>0,k=e[t+1]>>>0,I=e[t+2]>>>0,T=e[t+3]>>>0,E=e[t+4]>>>0,M=e[t+5]>>>0,r[S++]=A>>>0&63,r[S++]=A>>>6&63,r[S++]=A>>>12&63,r[S++]=A>>>18&63,r[S++]=A>>>24&63,r[S++]=(A>>>30|(15&k)<<2)&63,r[S++]=k>>>4&63,r[S++]=k>>>10&63,r[S++]=k>>>16&63,r[S++]=k>>>22&63,r[S++]=(k>>>28|(3&I)<<4)&63,r[S++]=I>>>2&63,r[S++]=I>>>8&63,r[S++]=I>>>14&63,r[S++]=I>>>20&63,r[S++]=I>>>26&63,r[S++]=T>>>0&63,r[S++]=T>>>6&63,r[S++]=T>>>12&63,r[S++]=T>>>18&63,r[S++]=T>>>24&63,r[S++]=(T>>>30|(15&E)<<2)&63,r[S++]=E>>>4&63,r[S++]=E>>>10&63,r[S++]=E>>>16&63,r[S++]=E>>>22&63,r[S++]=(E>>>28|(3&M)<<4)&63,r[S++]=M>>>2&63,r[S++]=M>>>8&63,r[S++]=M>>>14&63,r[S++]=M>>>20&63,r[S]=M>>>26&63;return;case 7:let D,P,F,z,B,C,V,L;D=i,P=e[t]>>>0,F=e[t+1]>>>0,z=e[t+2]>>>0,B=e[t+3]>>>0,C=e[t+4]>>>0,V=e[t+5]>>>0,L=e[t+6]>>>0,r[D++]=P>>>0&127,r[D++]=P>>>7&127,r[D++]=P>>>14&127,r[D++]=P>>>21&127,r[D++]=(P>>>28|(7&F)<<4)&127,r[D++]=F>>>3&127,r[D++]=F>>>10&127,r[D++]=F>>>17&127,r[D++]=F>>>24&127,r[D++]=(F>>>31|(63&z)<<1)&127,r[D++]=z>>>6&127,r[D++]=z>>>13&127,r[D++]=z>>>20&127,r[D++]=(z>>>27|(3&B)<<5)&127,r[D++]=B>>>2&127,r[D++]=B>>>9&127,r[D++]=B>>>16&127,r[D++]=B>>>23&127,r[D++]=(B>>>30|(31&C)<<2)&127,r[D++]=C>>>5&127,r[D++]=C>>>12&127,r[D++]=C>>>19&127,r[D++]=(C>>>26|(1&V)<<6)&127,r[D++]=V>>>1&127,r[D++]=V>>>8&127,r[D++]=V>>>15&127,r[D++]=V>>>22&127,r[D++]=(V>>>29|(15&L)<<3)&127,r[D++]=L>>>4&127,r[D++]=L>>>11&127,r[D++]=L>>>18&127,r[D]=L>>>25&127;return;case 8:let O,$,R,N,U,q,j,G,X;O=i,$=e[t]>>>0,R=e[t+1]>>>0,N=e[t+2]>>>0,U=e[t+3]>>>0,q=e[t+4]>>>0,j=e[t+5]>>>0,G=e[t+6]>>>0,X=e[t+7]>>>0,r[O++]=$>>>0&255,r[O++]=$>>>8&255,r[O++]=$>>>16&255,r[O++]=$>>>24&255,r[O++]=R>>>0&255,r[O++]=R>>>8&255,r[O++]=R>>>16&255,r[O++]=R>>>24&255,r[O++]=N>
2>>0&255,r[O++]=N>>>8&255,r[O++]=N>>>16&255,r[O++]=N>>>24&255,r[O++]=U>>>0&255,r[O++]=U>>>8&255,r[O++]=U>>>16&255,r[O++]=U>>>24&255,r[O++]=q>>>0&255,r[O++]=q>>>8&255,r[O++]=q>>>16&255,r[O++]=q>>>24&255,r[O++]=j>>>0&255,r[O++]=j>>>8&255,r[O++]=j>>>16&255,r[O++]=j>>>24&255,r[O++]=G>>>0&255,r[O++]=G>>>8&255,r[O++]=G>>>16&255,r[O++]=G>>>24&255,r[O++]=X>>>0&255,r[O++]=X>>>8&255,r[O++]=X>>>16&255,r[O]=X>>>24&255;return;case 9:let Y,Z,W,H,K,J,Q,ee,et,er;Y=i,Z=e[t]>>>0,W=e[t+1]>>>0,H=e[t+2]>>>0,K=e[t+3]>>>0,J=e[t+4]>>>0,Q=e[t+5]>>>0,ee=e[t+6]>>>0,et=e[t+7]>>>0,er=e[t+8]>>>0,r[Y++]=Z>>>0&511,r[Y++]=Z>>>9&511,r[Y++]=Z>>>18&511,r[Y++]=(Z>>>27|(15&W)<<5)&511,r[Y++]=W>>>4&511,r[Y++]=W>>>13&511,r[Y++]=W>>>22&511,r[Y++]=(W>>>31|(255&H)<<1)&511,r[Y++]=H>>>8&511,r[Y++]=H>>>17&511,r[Y++]=(H>>>26|(7&K)<<6)&511,r[Y++]=K>>>3&511,r[Y++]=K>>>12&511,r[Y++]=K>>>21&511,r[Y++]=(K>>>30|(127&J)<<2)&511,r[Y++]=J>>>7&511,r[Y++]=J>>>16&511,r[Y++]=(J>>>25|(3&Q)<<7)&511,r[Y++]=Q>>>2&511,r[Y++]=Q>>>11&511,r[Y++]=Q>>>20&511,r[Y++]=(Q>>>29|(63&ee)<<3)&511,r[Y++]=ee>>>6&511,r[Y++]=ee>>>15&511,r[Y++]=(ee>>>24|(1&et)<<8)&511,r[Y++]=et>>>1&511,r[Y++]=et>>>10&511,r[Y++]=et>>>19&511,r[Y++]=(et>>>28|(31&er)<<4)&511,r[Y++]=er>>>5&511,r[Y++]=er>>>14&511,r[Y]=er>>>23&511;return;case 10:let ei,en,ea,es,eo,el,eu,eh,ec,ep,ef;ei=i,en=e[t]>>>0,ea=e[t+1]>>>0,es=e[t+2]>>>0,eo=e[t+3]>>>0,el=e[t+4]>>>0,eu=e[t+5]>>>0,eh=e[t+6]>>>0,ec=e[t+7]>>>0,ep=e[t+8]>>>0,ef=e[t+9]>>>0,r[ei++]=en>>>0&1023,r[ei++]=en>>>10&1023,r[ei++]=en>>>20&1023,r[ei++]=(en>>>30|(255&ea)<<2)&1023,r[ei++]=ea>>>8&1023,r[ei++]=ea>>>18&1023,r[ei++]=(ea>>>28|(63&es)<<4)&1023,r[ei++]=es>>>6&1023,r[ei++]=es>>>16&1023,r[ei++]=(es>>>26|(15&eo)<<6)&1023,r[ei++]=eo>>>4&1023,r[ei++]=eo>>>14&1023,r[ei++]=(eo>>>24|(3&el)<<8)&1023,r[ei++]=el>>>2&1023,r[ei++]=el>>>12&1023,r[ei++]=el>>>22&1023,r[ei++]=eu>>>0&1023,r[ei++]=eu>>>10&1023,r[ei++]=eu>>>20&1023,r[ei++]=(eu>>>30|(255&eh)<<2)&1023,r[ei++]=eh>>>8&1023,r[ei++]=eh>>>18&1023,r[ei++]=(eh>>>28|(63&ec)<<4)&1023,r[ei++]=ec>>>6&1023,r[ei++]=ec>>>16&1023,r[ei++]=(ec>>>26|(15&ep)<<6)&1023,r[ei++]=ep>>>4&1023,r[ei++]=ep>>>14&1023,r[ei++]=(ep>>>24|(3&ef)<<8)&1023,r[ei++]=ef>>>2&1023,r[ei++]=ef>>>12&1023,r[ei]=ef>>>22&1023;return;case 11:let ed,ey,em,eg,ex,ev,eb,ew,e_,eS,eA,ek;ed=i,ey=e[t]>>>0,em=e[t+1]>>>0,eg=e[t+2]>>>0,ex=e[t+3]>>>0,ev=e[t+4]>>>0,eb=e[t+5]>>>0,ew=e[t+6]>>>0,e_=e[t+7]>>>0,eS=e[t+8]>>>0,eA=e[t+9]>>>0,ek=e[t+10]>>>0,r[ed++]=ey>>>0&2047,r[ed++]=ey>>>11&2047,r[ed++]=(ey>>>22|(1&em)<<10)&2047,r[ed++]=em>>>1&2047,r[ed++]=em>>>12&2047,r[ed++]=(em>>>23|(3&eg)<<9)&2047,r[ed++]=eg>>>2&2047,r[ed++]=eg>>>13&2047,r[ed++]=(eg>>>24|(7&ex)<<8)&2047,r[ed++]=ex>>>3&2047,r[ed++]=ex>>>14&2047,r[ed++]=(ex>>>25|(15&ev)<<7)&2047,r[ed++]=ev>>>4&2047,r[ed++]=ev>>>15&2047,r[ed++]=(ev>>>26|(31&eb)<<6)&2047,r[ed++]=eb>>>5&2047,r[ed++]=eb>>>16&2047,r[ed++]=(eb>>>27|(63&ew)<<5)&2047,r[ed++]=ew>>>6&2047,r[ed++]=ew>>>17&2047,r[ed++]=(ew>>>28|(127&e_)<<4)&2047,r[ed++]=e_>>>7&2047,r[ed++]=e_>>>18&2047,r[ed++]=(e_>>>29|(255&eS)<<3)&2047,r[ed++]=eS>>>8&2047,r[ed++]=eS>>>19&2047,r[ed++]=(eS>>>30|(511&eA)<<2)&2047,r[ed++]=eA>>>9&2047,r[ed++]=eA>>>20&2047,r[ed++]=(eA>>>31|(1023&ek)<<1)&2047,r[ed++]=ek>>>10&2047,r[ed]=ek>>>21&2047;return;case 12:let eI,eT,eE,eM,eD,eP,eF,ez,eB,eC,eV,eL,eO;eI=i,eT=e[t]>>>0,eE=e[t+1]>>>0,eM=e[t+2]>>>0,eD=e[t+3]>>>0,eP=e[t+4]>>>0,eF=e[t+5]>>>0,ez=e[t+6]>>>0,eB=e[t+7]>>>0,eC=e[t+8]>>>0,eV=e[t+9]>>>0,eL=e[t+10]>>>0,eO=e[t+11]>>>0,r[eI++]=eT>>>0&4095,r[eI++]=eT>>>12&4095,r[eI++]=(eT>>>24|(15&eE)<<8)&4095,r[eI++]=eE>>>4&4095,r[eI++]=eE>>>16&4095,r[eI++]=(eE>>>28|(255&eM)<<4)&4095,r[eI++]=eM>>>8&4095,r[eI++]=eM>>>20&4095,r[eI++]=eD>>>0&4095,r[eI++]=eD>>>12&4095,r[eI++]=(eD>>>24|(15&eP)<<8)&4095,r[eI++]=eP>>>4&4095,r[eI++]=eP>>>16&4095,r[eI++]=(eP>>>28|(255&eF)<<4)&4095,r[eI++]=eF>>>8&4095,r[eI++]=eF>>>20&4095,r[eI++]=ez>>>0&4095,r[eI++]=ez>>>12&4095,r[eI++]=(ez>>>24|(15&eB)<<8)&4095,r[eI++]=eB>>>4&4095,r[eI++]=eB>>>16&4095,r[eI++]=(eB>>>28|(255&eC)<<4)&4095,r[eI++]=eC>>>8&4095,r[eI++]=eC>>>20&4095,r[eI++]=eV>>>0&4095,r[eI++]=eV>>>12&4095,r[eI++]=(eV>>>24|(15&eL)<<8)&4095,r[eI++]=eL>>>4&4095,r[eI++]=eL>>>16&4095,r[eI++]=(eL>>>28|(255&eO)<<4)&4095,r[eI++]=eO>>>8&4095,r[eI]=eO>>>20&4095;return;case 16:let e$,eR,eN,eU,eq,ej,eG,eX,eY,eZ,eW,eH,eK,eJ,eQ,e0,e1;e$=i,eR=e[t]>>>0,eN=e[t+1]>>>0,eU=e[t+2]>>>0,eq=e[t+3]>>>0,ej=e[t+4]>>>0,eG=e[t+5]>>>0,eX=e[t+6]>>>0,eY=e[t+7]>>>0,eZ=e[t+8]>>>0,eW=e[t+9]>>>0,eH=e[t+10]>>>0,eK=e[t+11]>>>0,eJ=e[t+12]>>>0,eQ=e[t+13]>>>0,e0=e[t+14]>>>0,e1=e[t+15]>>>0,r[e$++]=eR>>>0&65535,r[e$++]=eR>>>16&65535,r[e$++]=eN>>>0&65535,r[e$++]=eN>>>16&65535,r[e$++]=eU>>>0&65535,r[e$++]=eU>>>16&65535,r[e$++]=eq>>>0&65535,r[e$++]=eq>>>16&65535,r[e$++]=ej>>>0&65535,r[e$++]=ej>>>16&65535,r[e$++]=eG>>>0&65535,r[e$++]=eG>>>16&65535,r[e$++]=eX>>>0&65535,r[e$++]=eX>>>16&65535,r[e$++]=eY>>>0&65535,r[e$++]=eY>>>16&65535,r[e$++]=eZ>>>0&65535,r[e$++]=eZ>>>16&65535,r[e$++]=eW>>>0&65535,r[e$++]=eW>>>16&65535,r[e$++]=eH>>>0&65535,r[e$++]=eH>>>16&65535,r[e$++]=eK>>>0&65535,r[e$++]=eK>>>16&65535,r[e$++]=eJ>>>0&65535,r[e$++]=eJ>>>16&65535,r[e$++]=eQ>>>0&65535,r[e$++]=eQ>>>16&65535,r[e$++]=e0>>>0&65535,r[e$++]=e0>>>16&65535,r[e$++]=e1>>>0&65535,r[e$]=e1>>>16&65535;return;case 32:for(let n=0;n<32;n=n+1|0)r[i+n|0]=0|e[t+n|0];return}let e2=uK[n]>>>0,e3=t,e5=0,e6=e[e3]>>>0;for(let t=0;t<32;t++)if(e5+n<=32){let a=e6>>>e5&e2;r[i+t]=0|a,32===(e5+=n)&&(e5=0,e3++,31!==t&&(e6=e[e3]>>>0))}else{let a=32-e5,s=(e6>>>e5|((e6=e[++e3]>>>0)&uK[n-a]>>>0)<<a)&e2;r[i+t]=0|s,e5=n-a}})(e,t,u,h,a),t=t+a|0;t=t-((h-s|0)*a>>>5)|0,r.exceptionSizes[a]=s}return t}(e,p,a);return a.dataPointers.fill(0),!function(e,t,r,i,n,a,s,o,l,u){let h=0|r,c=0;for(let t=0;t<s;t=t+1|0){let r=function(e,t,r,i){if(r+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${t})`);let n=e[r++],a=e[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}(o,l,c,t);c=r.bytePosIn;let i=r.bitWidth,s=r.exceptionCount,p=a+256*t|0;switch(i){case 0:n.fill(0,p,p+256);break;case 32:for(let t=0;t<256;t=t+1|0)n[p+t|0]=0|e[h+t|0];h=h+256|0;break;default:h=function(e,t,r,i,n){switch(n){case 1:let a=i,s=t;for(let t=0;t<8;t++){let t=e[s++]>>>0;r[a++]=t>>
2>0&1,r[a++]=t>>>1&1,r[a++]=t>>>2&1,r[a++]=t>>>3&1,r[a++]=t>>>4&1,r[a++]=t>>>5&1,r[a++]=t>>>6&1,r[a++]=t>>>7&1,r[a++]=t>>>8&1,r[a++]=t>>>9&1,r[a++]=t>>>10&1,r[a++]=t>>>11&1,r[a++]=t>>>12&1,r[a++]=t>>>13&1,r[a++]=t>>>14&1,r[a++]=t>>>15&1,r[a++]=t>>>16&1,r[a++]=t>>>17&1,r[a++]=t>>>18&1,r[a++]=t>>>19&1,r[a++]=t>>>20&1,r[a++]=t>>>21&1,r[a++]=t>>>22&1,r[a++]=t>>>23&1,r[a++]=t>>>24&1,r[a++]=t>>>25&1,r[a++]=t>>>26&1,r[a++]=t>>>27&1,r[a++]=t>>>28&1,r[a++]=t>>>29&1,r[a++]=t>>>30&1,r[a++]=t>>>31&1}break;case 2:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0;r[n++]=t>>>0&3,r[n++]=t>>>2&3,r[n++]=t>>>4&3,r[n++]=t>>>6&3,r[n++]=t>>>8&3,r[n++]=t>>>10&3,r[n++]=t>>>12&3,r[n++]=t>>>14&3,r[n++]=t>>>16&3,r[n++]=t>>>18&3,r[n++]=t>>>20&3,r[n++]=t>>>22&3,r[n++]=t>>>24&3,r[n++]=t>>>26&3,r[n++]=t>>>28&3,r[n++]=t>>>30&3,r[n++]=i>>>0&3,r[n++]=i>>>2&3,r[n++]=i>>>4&3,r[n++]=i>>>6&3,r[n++]=i>>>8&3,r[n++]=i>>>10&3,r[n++]=i>>>12&3,r[n++]=i>>>14&3,r[n++]=i>>>16&3,r[n++]=i>>>18&3,r[n++]=i>>>20&3,r[n++]=i>>>22&3,r[n++]=i>>>24&3,r[n++]=i>>>26&3,r[n++]=i>>>28&3,r[n++]=i>>>30&3}}(e,t,r,i);break;case 3:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,s=e[a++]>>>0;r[n++]=t>>>0&7,r[n++]=t>>>3&7,r[n++]=t>>>6&7,r[n++]=t>>>9&7,r[n++]=t>>>12&7,r[n++]=t>>>15&7,r[n++]=t>>>18&7,r[n++]=t>>>21&7,r[n++]=t>>>24&7,r[n++]=t>>>27&7,r[n++]=(t>>>30|(1&i)<<2)&7,r[n++]=i>>>1&7,r[n++]=i>>>4&7,r[n++]=i>>>7&7,r[n++]=i>>>10&7,r[n++]=i>>>13&7,r[n++]=i>>>16&7,r[n++]=i>>>19&7,r[n++]=i>>>22&7,r[n++]=i>>>25&7,r[n++]=i>>>28&7,r[n++]=(i>>>31|(3&s)<<1)&7,r[n++]=s>>>2&7,r[n++]=s>>>5&7,r[n++]=s>>>8&7,r[n++]=s>>>11&7,r[n++]=s>>>14&7,r[n++]=s>>>17&7,r[n++]=s>>>20&7,r[n++]=s>>>23&7,r[n++]=s>>>26&7,r[n++]=s>>>29&7}}(e,t,r,i);break;case 4:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0;r[n++]=t>>>0&15,r[n++]=t>>>4&15,r[n++]=t>>>8&15,r[n++]=t>>>12&15,r[n++]=t>>>16&15,r[n++]=t>>>20&15,r[n++]=t>>>24&15,r[n++]=t>>>28&15,r[n++]=i>>>0&15,r[n++]=i>>>4&15,r[n++]=i>>>8&15,r[n++]=i>>>12&15,r[n++]=i>>>16&15,r[n++]=i>>>20&15,r[n++]=i>>>24&15,r[n++]=i>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15}}(e,t,r,i);break;case 5:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0;r[n++]=t>>>0&31,r[n++]=t>>>5&31,r[n++]=t>>>10&31,r[n++]=t>>>15&31,r[n++]=t>>>20&31,r[n++]=t>>>25&31,r[n++]=(t>>>30|(7&i)<<2)&31,r[n++]=i>>>3&31,r[n++]=i>>>8&31,r[n++]=i>>>13&31,r[n++]=i>>>18&31,r[n++]=i>>>23&31,r[n++]=(i>>>28|(1&s)<<4)&31,r[n++]=s>>>1&31,r[n++]=s>>>6&31,r[n++]=s>>>11&31,r[n++]=s>>>16&31,r[n++]=s>>>21&31,r[n++]=s>>>26&31,r[n++]=(s>>>31|(15&o)<<1)&31,r[n++]=o>>>4&31,r[n++]=o>>>9&31,r[n++]=o>>>14&31,r[n++]=o>>>19&31,r[n++]=o>>>24&31,r[n++]=(o>>>29|(3&l)<<3)&31,r[n++]=l>>>2&31,r[n++]=l>>>7&31,r[n++]=l>>>12&31,r[n++]=l>>>17&31,r[n++]=l>>>22&31,r[n++]=l>>>27&31}}(e,t,r,i);break;case 6:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;r[n++]=t>>>0&63,r[n++]=t>>>6&63,r[n++]=t>>>12&63,r[n++]=t>>>18&63,r[n++]=t>>>24&63,r[n++]=(t>>>30|(15&i)<<2)&63,r[n++]=i>>>4&63,r[n++]=i>>>10&63,r[n++]=i>>>16&63,r[n++]=i>>>22&63,r[n++]=(i>>>28|(3&s)<<4)&63,r[n++]=s>>>2&63,r[n++]=s>>>8&63,r[n++]=s>>>14&63,r[n++]=s>>>20&63,r[n++]=s>>>26&63,r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(15&l)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(3&u)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63}}(e,t,r,i);break;case 7:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0;r[n++]=t>>>0&127,r[n++]=t>>>7&127,r[n++]=t>>>14&127,r[n++]=t>>>21&127,r[n++]=(t>>>28|(7&i)<<4)&127,r[n++]=i>>>3&127,r[n++]=i>>>10&127,r[n++]=i>>>17&127,r[n++]=i>>>24&127,r[n++]=(i>>>31|(63&s)<<1)&127,r[n++]=s>>>6&127,r[n++]=s>>>13&127,r[n++]=s>>>20&127,r[n++]=(s>>>27|(3&o)<<5)&127,r[n++]=o>>>2&127,r[n++]=o>>>9&127,r[n++]=o>>>16&127,r[n++]=o>>>23&127,r[n++]=(o>>>30|(31&l)<<2)&127,r[n++]=l>>>5&127,r[n++]=l>>>12&127,r[n++]=l>>>19&127,r[n++]=(l>>>26|(1&u)<<6)&127,r[n++]=u>>>1&127,r[n++]=u>>>8&127,r[n++]=u>>>15&127,r[n++]=u>>>22&127,r[n++]=(u>>>29|(15&h)<<3)&127,r[n++]=h>>>4&127,r[n++]=h>>>11&127,r[n++]=h>>>18&127,r[n++]=h>>>25&127}}(e,t,r,i);break;case 8:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0,c=e[a++]>>>0;r[n++]=t>>>0&255,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=i>>>0&255,r[n++]=i>>>8&255,r[n++]=i>>>16&255,r[n++]=i>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255}}(e,t,r,i);break;case 16:let o=i,l=t;for(let t=0;t<128;t++){let t=e[l++]>>>0;r[o++]=65535&t,r[o++]=t>>
2>16&65535}break;default:!function(e,t,r,i,n){let a=uK[n]>>>0,s=t,o=0,l=e[s]>>>0,u=i;for(let t=0;t<8;t++){for(let t=0;t<32;t++)if(o+n<=32){let i=l>>>o&a;r[u+t]=0|i,32===(o+=n)&&(o=0,s++,31!==t&&(l=e[s]>>>0))}else{let i=32-o,h=l>>>o;l=e[++s]>>>0;let c=n-i,p=(h|(l&-1>>>32-c>>>0)<<i)&a;r[u+t]=0|p,o=c}u+=32,o=0,t<7&&(l=e[s]>>>0)}}(e,t,r,i,n)}return t+(n<<3)|0}(e,h,n,p,i)}s>0&&(c=function(e,t,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=function(e,t,r,i,n,a){if(r+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${t})`);let s=e[r++];if(s<i||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${t-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}(n,a,s,r,i,l);if(s=c,1===h){let a=1<<r;for(let r=0;r<i;r=r+1|0){let r=n[s++];e[r+t|0]|=a}return s}let p=o.dataToBePacked[h];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=0|f[h],y=0|o.exceptionSizes[h];if(d+i>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let a=0;a<i;a=a+1|0){let i=n[s++],a=0|p[d++];e[i+t|0]|=a<<r}return f[h]=d,s}(n,p,i,s,o,l,c,u,t))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${e.length})`)}(e,s,s+1|0,l,t,0|i,n/256|0,f,u,a),d}(e,t,l,o,r,a),o=o+r|0}return l}(e,a,i,n,t,s),n=n+t|0}let o=e.length-i|0,l=t-n|0;return!function(e,t,r,i,n,a){if(0===a)return;let s=0,o=t,l=t+r,u=n,h=n+a,c=0,p=0;for(;o<l&&u<h;){let t=e[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,c|=(127&t)<<p,(128&t)!=0)i[u++]=0|c,c=0,p=0;else if((p+=7)>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${p}, partial=${c}, decoded=${u-n}/${a}, inPos=${o}, inEnd=${l})`)}if(u!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${u-n}, expected=${a}, consumedWords=${o-t}/${r}, vbyteStart=${t}, vbyteEnd=${l})`)}(e,i,o,a,n,l),a}(o.subarray(0,s),t,n.decoderWorkspace);return i.add(r),l}(e,n,a=r.byteLength,t,function(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);return{encodedWords:new Uint32Array(Math.max(16,0|e)),decoderWorkspace:u0()}}(a>>>2));case N.VARINT:return u1(e,t,r.numValues);case N.NONE:{let i=t.get(),n=r.byteLength;return t.add(n),new Uint32Array(e.subarray(i,t.get()))}default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function hv(e,t,r){let i=hx(e,t,r);return 1===i.length?r.logicalLevelTechnique1===R.DELTA?u3(i[0]):i[0]:i[1]}function hb(e,t,r){var i=hx(e,t,r);if(2===i.length){let e=u3(i[1]);return[e,e]}return[u3(i[2]),u3(i[3])]}function hw(e,t,r){var i=u2(e,t,r.numValues);if(2===i.length){let e=u5(i[1]);return[e,e]}return[u5(i[2]),u5(i[3])]}function h_(e,t,r,i){let n;var a=u2(e,t,r.numValues),s=r,o=i;switch(s.logicalLevelTechnique1){case R.DELTA:n=s.logicalLevelTechnique2===R.RLE?ha(u8(a,s.runs,s.numRleValues)):ha(a);break;case R.RLE:n=u8(a,s.runs,s.numRleValues);break;case R.NONE:n=a;break;default:throw Error(`The specified Logical level technique is not supported: ${s.logicalLevelTechnique1}`)}return o?hd(n,o,0n):n}function hS(e,t,r){let i=u2(e,t,r.numValues);return 1===i.length?r.logicalLevelTechnique1===R.DELTA?u5(i[0]):i[0]:i[1]}function hA(e,t,r,i,n="int32"){let a=e.logicalLevelTechnique1;if(a===R.RLE)return 1===e.runs?X.CONST:X.FLAT;if(a!==R.DELTA||e.logicalLevelTechnique2!==R.RLE)return 1===e.numValues?X.CONST:X.FLAT;let s=t instanceof hf?t.size():t;if(e.numRleValues!==s)return X.FLAT;if(1===e.runs)return X.SEQUENCE;if(2!==e.runs)return 1===e.numValues?X.CONST:X.FLAT;let o=i.get();if(e.physicalLevelTechnique===N.VARINT)return!function(e,t,r){let i=new uH(t.get());if("int64"===r){let t=u2(e,i,4);
2return 2n===t[2]&&2n===t[3]}let n=u1(e,i,4);return 2===n[2]&&2===n[3]}(r,i,n)?1===e.numValues?X.CONST:X.FLAT:X.SEQUENCE;let l=i.get(),u=new Int32Array(r.buffer,r.byteOffset+l,4);return(i.set(o),2===u[2]&&2===u[3])?X.SEQUENCE:1===e.numValues?X.CONST:X.FLAT}var hk=class extends uq{getValueFromBuffer(e){return this.dataBuffer[e]}},hI=class extends uX{constructor(e,t,r,i){super(e,BigInt64Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function hT(e,t,r){return{x:hE(e,t)-r,y:hE(e>>1,t)-r}}function hE(e,t){let r=0;for(let i=0;i<t;i++)r|=(e&1<<2*i)>>i;return r}function hM(e,t,r,i,n,a,s){return e===W.MORTON?function(e,t,r,i,n,a){let s=Array(n?i+1:i);for(let n=0;n<i;n++){let i=hT(e[t[r+n]],a.numBits,a.coordinateShift);s[n]=new ei(i.x,i.y)}return n&&(s[s.length-1]=s[0]),s}(t,r,i,n,a,s):function(e,t,r,i,n){let a=Array(n?i+1:i);for(let n=0;n<2*i;n+=2){let i=2*t[r+n/2],s=e[i],o=e[i+1];a[n/2]=new ei(s,o)}return n&&(a[a.length-1]=a[0]),a}(t,r,i,n,a)}function hD(e,t,r,i){let n=Array(i?r+1:r);for(let i=0;i<2*r;i+=2){let r=e[t+i],a=e[t+i+1];n[i/2]=new ei(r,a)}return i&&(n[n.length-1]=n[0]),n}(V=Y||(Y={}))[V.POINT=0]="POINT",V[V.LINESTRING=1]="LINESTRING",V[V.POLYGON=2]="POLYGON",V[V.MULTIPOINT=3]="MULTIPOINT",V[V.MULTILINESTRING=4]="MULTILINESTRING",V[V.MULTIPOLYGON=5]="MULTIPOLYGON",(L=Z||(Z={}))[L.POINT=0]="POINT",L[L.LINESTRING=1]="LINESTRING",L[L.POLYGON=2]="POLYGON",(O=W||(W={}))[O.MORTON=0]="MORTON",O[O.VEC_2=1]="VEC_2",O[O.VEC_3=2]="VEC_3";var hP=class{constructor(e,t,r,i,n){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],r=hT(this.vertexBuffer[t],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[r.x,r.y]}let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return function(e){let t=Array(e.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=e.mortonSettings,u=e.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=e.vertexOffsets,d=!f||0===f.length,y=e.containsPolygonGeometry(),m=e.vertexBuffer;for(let u=0;u<e.numGeometries;u++){let g=e.geometryType(u);switch(g){case Y.POINT:{let u,y;if(d)u=m[s++],y=m[s++];else if(e.vertexBufferType===W.MORTON){let e=hT(m[f[o++]],l.numBits,l.coordinateShift);u=e.x,y=e.y}else{let e=2*f[o++];u=m[e],y=m[e+1]}t[a++]=[[new ei(u,y)]],h&&n++,c&&r++,p&&i++}break;case Y.MULTIPOINT:{let e=h[n]-h[n-1];n++;let l=Array(e);if(d)for(let t=0;t<e;t++){let e=m[s++],r=m[s++];l[t]=new ei(e,r)}else for(let t=0;t<e;t++){let e=2*f[o++],r=m[e],i=m[e+1];l[t]=new ei(r,i)}t[a++]=l.map(e=>[e]),r+=e,i+=e}break;case Y.LINESTRING:{let u,g;y?(u=p[i]-p[i-1],i++):u=c[r]-c[r-1],r++,d?(g=hD(m,s,u,!1),s+=2*u):(g=hM(e.vertexBufferType,m,f,o,u,!1,l),o+=u),t[a++]=[g],h&&n++}break;case Y.POLYGON:{let u,y=c[r]-c[r-1];r++;let g=Array(y-1),x=p[i]-p[i-1];if(i++,d){u=hD(m,s,x,!0),s+=2*x;for(let e=0;e<g.length;e++)x=p[i]-p[i-1],i++,g[e]=hD(m,s,x,!0),s+=2*x}else{u=hM(e.vertexBufferType,m,f,o,x,!0,l),o+=x;for(let t=0;t<g.length;t++)x=p[i]-p[i-1],i++,g[t]=hM(e.vertexBufferType,m,f,o,x,!0,l),o+=x}t[a++]=[u].concat(g),h&&n++}break;case Y.MULTILINESTRING:{let u=h[n]-h[n-1];n++;let g=Array(u);for(let t=0;t<u;t++){let n;if(y?(n=p[i]-p[i-1],i++):n=c[r]-c[r-1],r++,d)g[t]=hD(m,s,n,!1),s+=2*n;else{let r=hM(e.vertexBufferType,m,f,o,n,!1,l);g[t]=r,o+=n}}t[a++]=g}break;case Y.MULTIPOLYGON:{let u=h[n]-h[n-1];n++;let y=Array(u);for(let t=0;t<u;t++){let n,a=c[r]-c[r-1];r++;let u=Array(a-1),h=p[i]-p[i-1];i++,d?(n=hD(m,s,h,!0),s+=2*h):(n=hM(e.vertexBufferType,m,f,o,h,!0,l),o+=h);for(let t=0;t<u.length;t++){let r=p[i]-p[i-1];i++,d?(u[t]=hD(m,s,r,!0),s+=2*r):(u[t]=hM(e.vertexBufferType,m,f,o,r,!0,l),o+=r)}y[t]=[n].concat(u)}t[a++]=y.flat()}break;default:throw Error(`The specified geometry type (${g}) is currently not supported.`)}}return t}(this)}get mortonSettings(){return this._mortonSettings}},hF=class extends hP{constructor(e,t,r,i,n,a,s){super(r,i,n,a,s),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Y.POLYGON||this._geometryType===Y.MULTIPOLYGON}containsSingleGeometryType(){return!0}},hz=class extends hP{constructor(e,t,r,i,n,a){super(e,r,i,n,a),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Y.POLYGON||this.geometryType(e)===Y.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}
2,hB=class{constructor(e,t,r,i){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let e=Array(this.numGeometries),t=this._topologyVector,r=t.partOffsets,i=t.ringOffsets,n=t.geometryOffsets,a=0,s=1,o=1,l=1;for(let t=0;t<this.numGeometries;t++)switch(this.geometryType(t)){case Y.POLYGON:{let u=r[s]-r[s-1];s++;let h=[];for(let e=0;e<u;e++){let e=i[o]-i[o-1];o++;let t=[];for(let r=0;r<e;r++){let e=this._vertexBuffer[a++],r=this._vertexBuffer[a++];t.push(new ei(e,r))}t.length>0&&t.push(t[0]),h.push(t)}e[t]=h,n&&l++}break;case Y.MULTIPOLYGON:{let u=n[l]-n[l-1];l++;let h=[];for(let e=0;e<u;e++){let e=r[s]-r[s-1];s++;for(let t=0;t<e;t++){let e=i[o]-i[o-1];o++;let t=[];for(let r=0;r<e;r++){let e=this._vertexBuffer[a++],r=this._vertexBuffer[a++];t.push(new ei(e,r))}t.length>0&&t.push(t[0]),h.push(t)}}e[t]=h}}return e}[Symbol.iterator](){return null}},hC=class extends hB{constructor(e,t,r,i,n,a){super(r,i,n,a),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}},hV=class extends hB{constructor(e,t,r,i,n){super(t,r,i,n),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function hL(e,t,r){let i=new Uint32Array(e.length+1),n=0;i[0]=n;let a=0;for(let s=0;s<e.length;s++)n=i[s+1]=n+(e[s]>r?t[a++]:1);return i}function hO(e,t,r,i){let n=new Uint32Array(t[t.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l<e.length;l++){let u=e[l],h=t[l+1]-t[l];if(5===u||2===u||i&&(4===u||1===u))for(let e=0;e<h;e++)a=n[s++]=a+r[o++];else for(let e=0;e<h;e++)n[s++]=++a}return n}var h$=class extends uU{constructor(e,t,r){super(e,t.getBuffer(),r),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},hR=class extends uq{getValueFromBuffer(e){return this.dataBuffer[e]}}
2,hN=class extends uU{constructor(e,t,r,i){super(e,i?BigInt64Array.of(t):BigUint64Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}};function hU(e,t,r){for(let i=0;i<e;i++){let e=hp(t,r);r.add(e.byteLength)}}function hq(e,t,r,i,n){let a=function(e,t,r,i){let n=new Uint8Array(t),a=0,s=i.get()+r;for(;a<t&&!(i.get()>=s);){let r=e[i.increment()];if(r<=127){let s=r+3,o=e[i.increment()],l=Math.min(a+s,t);n.fill(o,a,l),a=l}else{let s=256-r;for(let r=0;r<s&&a<t;r++)n[a++]=e[i.increment()]}}return i.set(s),n}(e,Math.ceil(t/8),r,i);return n?function(e,t,r){if(!r)return e;let i=r.size(),n=new hf(e,t),a=new hf(new Uint8Array(Math.ceil(i/8)),i),s=0;for(let e=0;e<i;e++){let t=!!r.get(e)&&n.get(s++);a.set(e,t)}return a.getBuffer()}(a,t,n):a}let hj=new TextDecoder;function hG(e,t,r){return r-t>=12?hj.decode(e.subarray(t,r)):function(e,t,r){let i="",n=t;for(;n<r;){let t,a,s,o=e[n],l=null,u=o>239?4:o>223?3:o>191?2:1;if(n+u>r)break;1===u?o<128&&(l=o):2===u?(192&(t=e[n+1]))==128&&(l=(31&o)<<6|63&t)<=127&&(l=null):3===u?(t=e[n+1],a=e[n+2],(192&t)==128&&(192&a)==128&&((l=(15&o)<<12|(63&t)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(t=e[n+1],a=e[n+2],s=e[n+3],(192&t)==128&&(192&a)==128&&(192&s)==128&&((l=(15&o)<<18|(63&t)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=u}return i}(e,t,r)}
2var hX=class extends uU{constructor(e,t,r,i){super(e,r,i),this.offsetBuffer=t}},hY=class extends hX{constructor(e,t,r,i){super(e,t,r,i??t.length-1)}getValueFromBuffer(e){let t=this.offsetBuffer[e],r=this.offsetBuffer[e+1];return hG(this.dataBuffer,t,r)}},hZ=class extends hX{constructor(e,t,r,i,n){super(e,r,i,n??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e],r=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return hG(this.dataBuffer,r,i)}},hW=class extends hX{constructor(e,t,r,i,n,a,s){super(e,r,i,s??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a}getValueFromBuffer(e){null==this.decodedDictionary&&(null==this.symbolLengthBuffer&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=function(e,t,r){let i=[],n=Array(t.length).fill(0);for(let e=1;e<t.length;e++)n[e]=n[e-1]+t[e-1];for(let a=0;a<r.length;a++)if(255===r[a])i.push(r[++a]);else{let s=t[r[a]],o=n[r[a]];for(let t=0;t<s;t++)i.push(e[o+t])}return new Uint8Array(i)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let t=this.indexBuffer[e],r=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return hG(this.decodedDictionary,r,i)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),r=e[0];for(let i=1;i<e.length;i++){let n=e[i];t[i-1]=n-r,r=n}return t}};function hH(e){return e instanceof hf}function hK(e){switch(e){case 0:case 1:case 2:case 3:{let t={};t.nullable=(1&e)!=0,t.columnScope=0;let r={};return r.type="logicalType",r.logicalType=0,r.longID=(2&e)!=0,t.scalarType=r,t.type="scalarType",t}case 4:{let e={};e.nullable=!1,e.columnScope=0;let t={};return t.type="physicalType",t.physicalType=0,e.type="complexType",e.complexType=t,e}case 30:{let e={};e.nullable=!1,e.columnScope=0;let t={};return t.type="physicalType",t.physicalType=1,e.type="complexType",e.complexType=t,e}default:let t;var r=e;switch(r){case 10:case 11:t=0;break;case 12:case 13:t=1;break;case 14:case 15:t=2;break;case 16:case 17:t=3;break;case 18:case 19:t=4;break;case 20:case 21:t=5;break;case 22:case 23:t=6;break;case 24:case 25:t=7;break;case 26:case 27:t=8;break;case 28:case 29:t=9;break;default:return null}let i={};i.nullable=(1&r)!=0,i.columnScope=0;let n={};return n.type="physicalType",n.physicalType=t,i.type="scalarType",i.scalarType=n,i}}let hJ=new TextDecoder;function hQ(e,t){let r=u1(e,t,1)[0];if(0===r)return"";let i=t.get(),n=e.subarray(i,i+r);return t.add(r),hJ.decode(n)}var h0=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Y.POINT:case Y.MULTIPOINT:this.type=1;break;case Y.LINESTRING:case Y.MULTILINESTRING:this.type=2;break;case Y.POLYGON:case Y.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let r=[];for(let e of t)r.push(new ei(e.x,e.y));e.push(r)}return e}},h1=class{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new h0(this.features[e],this.extent)}},h2=class{constructor(e){this.layers={};let t=function(e,t=!0){let r=new uH(0),i=[];for(;r.get()<e.length;){let h=u1(e,r,1)[0]>>>0,c=r.get()+h;if(c>e.length)throw Error(`Block overruns tile: ${c} > ${e.length}`);if(u1(e,r,1)[0]>>>0!=1){r.set(c);continue}let[p,f]=function(e,t){let r={};r.featureTables=[];let i={};if(i.name=hQ(e,t),0===i.name.length)throw Error("Missing layer name");let n=u1(e,t,1)[0]>>>0,a=u1(e,t,1)[0]>>>0;i.columns=Array(a);for(let r=0;r<a;r++)i.columns[r]=function(e,t){let r=u1(e,t,1)[0]>>>0,i=hK(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(r>=10?i.name=hQ(e,t):r>=0&&r<=3?i.name="id":4===r&&(i.name="geometry"),30===r){let r=u1(e,t,1)[0]>>>0,n=i.complexType;n.children=Array(r);for(let i=0;i<r;i++)n.children[i]=function e(t,r){let i=u1(t,r,1)[0]>>>0;if(i<10||i>
230)throw Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);let n=hK(i);if(i>=10&&(n.name=hQ(t,r)),30===i){let i=u1(t,r,1)[0]>>>0;n.complexType.children=Array(i);for(let a=0;a<i;a++)n.complexType.children[a]=e(t,r)}return{name:n.name,nullable:n.nullable,scalarField:n.scalarType,complexField:n.complexType,type:"scalarType"===n.type?"scalarField":"complexField"}}(e,t)}return i}(e,t);return r.featureTables.push(i),[r,n]}(e,r),d=p.featureTables[0],y=null,m=null,g=[],x=0;for(let i of d.columns){let h=i.name;if("scalarType"===i.type&&i.scalarType?.type==="logicalType"&&0===i.scalarType.logicalType){let n=null;if(i.nullable){let t=hp(e,r),i=r.get(),a=hq(e,t.numValues,t.byteLength,r);r.set(i+t.byteLength),n=new hf(a,t.numValues)}let a=hp(e,r);x=n?n.size():a.decompressedCount,y=function(e,t,r,i,n,a,s=!1){let o=t.scalarType;if(o?.type!=="logicalType"||0!==o.logicalType)throw Error(`ID column must be a logical ID scalar type: ${i}`);let l=o.longID?6:4,u="number"==typeof a?void 0:a,h=hA(n,a,e,r,6===l?"int64":"int32");if(4===l)switch(h){case X.FLAT:return new uj(i,hm(e,r,n,void 0,u),a);case X.SEQUENCE:{let t=hb(e,r,n);return new uY(i,t[0],t[1],n.numRleValues)}case X.CONST:return new uZ(i,hv(e,r,n),a,!1)}switch(h){case X.FLAT:if(s)return new uG(i,function(e,t,r){switch(t.logicalLevelTechnique1){case R.DELTA:return t.logicalLevelTechnique2===R.RLE&&(e=u7(e,t.runs,t.numRleValues)),!function(e){e[0]=u6(e[0]);let t=e.length/4*4,r=1;if(t>=4)for(;r<t-4;r+=4){let t=e[r],i=e[r+1],n=e[r+2],a=e[r+3];e[r]=u6(t)+e[r-1],e[r+1]=u6(i)+e[r],e[r+2]=u6(n)+e[r+1],e[r+3]=u6(a)+e[r+2]}for(;r!==e.length;++r)e[r]=u6(e[r])+e[r-1]}(e),e;case R.RLE:var i,n;return i=e,n=t,r?function(e,t,r){let i=new Float64Array(r),n=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];s=u6(s),i.fill(s,n,n+a),n+=a}return i}(i,n.runs,n.numRleValues):u7(i,n.runs,n.numRleValues);case R.NONE:return r&&function(e){for(let t=0;t<e.length;t++)e[t]=u6(e[t])}(e),e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}(function(e,t,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=function(e,t){let r,i;return(i=e[t.get()],t.increment(),r=127&i,i<128||(i=e[t.get()],t.increment(),r|=(127&i)<<7,i<128||(i=e[t.get()],t.increment(),r|=(127&i)<<14,i<128||(i=e[t.get()],t.increment(),r|=(127&i)<<21,i<128))))?r:function(e,t,r){let i,n;if(n=t[r.get()],r.increment(),i=(112&n)>>4,n<128||(n=t[r.get()],r.increment(),i|=(127&n)<<3,n<128)||(n=t[r.get()],r.increment(),i|=(127&n)<<10,n<128)||(n=t[r.get()],r.increment(),i|=(127&n)<<17,n<128)||(n=t[r.get()],r.increment(),i|=(127&n)<<24,n<128)||(n=t[r.get()],r.increment(),i|=(1&n)<<31,n<128))return 0x100000000*i+(e>>>0);throw Error("Expected varint not more than 10 bytes")}(r|=(15&(i=e[t.get()]))<<28,e,t)}(e,t);return i}(e,r,n.numValues),n,!1),a);return new hk(i,h_(e,r,n,u),a);case X.SEQUENCE:{let t=hw(e,r,n);return new hI(i,t[0],t[1],n.numRleValues)}case X.CONST:return new hN(i,hS(e,r,n),a,!1)}throw Error("Vector type not supported for id column.")}(e,i,r,h,a,n??x,t)}else if("complexType"===i.type&&i.complexType?.type==="physicalType"&&0===i.complexType.physicalType){let t=u1(e,r,1)[0];if(0===x){let t=r.get();x=hp(e,r).decompressedCount,r.set(t)}m=function(e,t,r,i,n){var a,s,o,l,u,h,c,p,f,d,y,m,g,x;let v,b,w,_,S,A,k,I,T,E,M,D=hp(e,r);if(hA(D,i,e,r)===X.CONST){let p,f,d,y,m=hv(e,r,D);for(let i=0;i<t-1;i++){let t=hp(e,r);switch(t.physicalStreamType){case U.LENGTH:switch(t.logicalStreamType.lengthType){case G.GEOMETRIES:p=hg(e,r,t);break;case G.PARTS:f=hg(e,r,t);break;case G.RINGS:d=hg(e,r,t);break;case G.TRIANGLES:y=hg(e,r,t)}break;case U.OFFSET:switch(t.logicalStreamType.offsetType){case j.VERTEX:v=hm(e,r,t);break;case j.INDEX:_=hm(e,r,t)}break;case U.DATA:q.VERTEX===t.logicalStreamType.dictionaryType?b=hy(e,r,t,n):(w={numBits:t.numBits,coordinateShift:t.coordinateShift},b=hm(e,r,t,n))}}if(_)return void 0!==p||void 0!==f?new hC(i,m,y,_,b,{geometryOffsets:p,partOffsets:f,ringOffsets:d}):new hC(i,m,y,_,b,void 0);return void 0===w?(a={geometryOffsets:p,partOffsets:f,ringOffsets:d},s=v,o=b,new hF(i,m,W.VEC_2,a,s,o)):(l={geometryOffsets:p,partOffsets:f,ringOffsets:d},u=v,h=b,c=w,new hF(i,m,W.MORTON,l,u,h,c))}let P=hm(e,r,D);for(let i=0;i<t-1;i++){let t=hp(e,r);switch(t.physicalStreamType){case U.LENGTH:switch(t.logicalStreamType.lengthType){case G.GEOMETRIES:S=hm(e,r,t);break;case G.PARTS:A=hm(e,r,t);break;case G.RINGS:k=hm(e,r,t);break;case G.TRIANGLES:I=hg(e,r,t)}break;case U.OFFSET:switch(t.logicalStreamType.offsetType){case j.VERTEX:v=hm(e,r,t);break;case j.INDEX:_=hm(e,r,t)}break;case U.DATA:q.VERTEX===t.logicalStreamType.dictionaryType?b=hy(e,r,t,n):(w={numBits:t.numBits,coordinateShift:t.coordinateShift},b=hm(e,r,t,n))}}return(S?(T=hL(P,S,2),A&&k?(E=hO(P,T,A,!1),M=function(e,t,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let s=1,o=1,l=0;for(let u=0;u<e.length;u++){let h=e[u],c=t[u+1]-t[u];
2if(0!==h&&3!==h)for(let e=0;e<c;e++){let e=r[s]-r[s-1];s++;for(let t=0;t<e;t++)a=n[o++]=a+i[l++]}else for(let e=0;e<c;e++)n[o++]=++a,s++}return n}(P,T,E,k)):A&&(E=function(e,t,r){let i=new Uint32Array(t[t.length-1]+1),n=0;i[0]=n;let a=1,s=0;for(let o=0;o<e.length;o++){let l=e[o],u=t[o+1]-t[o];if(4===l||1===l)for(let e=0;e<u;e++)n=i[a++]=n+r[s++];else for(let e=0;e<u;e++)i[a++]=++n}return i}(P,T,A))):A&&k?(E=hL(P,A,1),M=hO(P,E,k,!0)):A&&(E=hL(P,A,0)),_&&!E)?new hV(P,I,_,b,void 0):_?new hV(P,I,_,b,{geometryOffsets:T,partOffsets:E,ringOffsets:M}):void 0===w?(p={geometryOffsets:T,partOffsets:E,ringOffsets:M},f=v,d=b,new hz(W.VEC_2,P,p,f,d)):(y={geometryOffsets:T,partOffsets:E,ringOffsets:M},m=v,g=b,x=w,new hz(W.MORTON,P,y,m,g,x))}(e,t,r,x,void 0)}else{var n,a,s,o,l,u;let t=!function(e){if("scalarType"===e.type){let t=e.scalarType;if("physicalType"===t.type)switch(t.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if("logicalType"===t.type)return!1}else if("complexType"===e.type){let t=e.complexType;if("physicalType"===t.type)switch(t.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}(i)?1:u1(e,r,1)[0];if(0===t)continue;let h=(n=e,a=r,s=i,o=t,l=x,u=void 0,"scalarType"===s.type?u&&!u.has(s.name)?(hU(o,n,a),null):function(e,t,r,i,n,a){let s=null;if(0===e)return null;if(a.nullable){let e=hp(t,r),i=e.numValues,n=r.get(),a=hq(t,i,e.byteLength,r);r.set(n+e.byteLength),s=new hf(a,e.numValues)}let o=s??i;switch(n.physicalType){case 4:case 3:return function(e,t,r,i,n){let a=hp(e,t),s=hA(a,n,e,t),o=3===i.physicalType;if(s===X.FLAT){let i=hH(n)?n:void 0,s=o?hy(e,t,a,void 0,i):hm(e,t,a,void 0,i);return new uj(r.name,s,n)}if(s===X.SEQUENCE){let i=hb(e,t,a);return new uY(r.name,i[0],i[1],a.numRleValues)}let l=o?function(e,t,r){let i=hx(e,t,r);return 1===i.length?u3(i[0]):u3(i[1])}(e,t,a):hv(e,t,a);return new uZ(r.name,l,n,o)}(t,r,a,n,o);case 9:{let i=a.nullable?e-1:e;return function(e,t,r,i,n){var a,s,o,l,u,h,c,p,f,d,y,m;let g=null,x=null,v=null,b=null,w=null,_=n??null,S=null,A=null;for(let e=0;e<i;e++){let e=hp(t,r);switch(e.physicalStreamType){case U.PRESENT:{let i=new hf(hq(t,e.numValues,e.byteLength,r),e.numValues);_=n??i;break}case U.OFFSET:x=hm(t,r,e,void 0,_);break;case U.LENGTH:{let i=hg(t,r,e);G.DICTIONARY===e.logicalStreamType.lengthType?g=i:G.SYMBOL===e.logicalStreamType.lengthType?b=i:S=i;break}case U.DATA:{let i=t.subarray(r.get(),r.get()+e.byteLength);r.add(e.byteLength);let n=e.logicalStreamType.dictionaryType;q.FSST===n?w=i:q.SINGLE===n||q.SHARED===n?v=i:q.NONE===n&&(A=i)}}}return a=e,s=w,o=x,l=g,u=v,h=b,c=_,(s?new hW(a,o,l,u,h,s,c):null)??(p=e,f=v,d=x,y=g,m=_,f?m?new hZ(p,d,y,f,m):new hZ(p,d,y,f):null)??function(e,t,r,i,n){if(!t||!r)return null;if(i)return n?new hZ(e,i,t,r,n):new hZ(e,i,t,r);if(n&&n.size()!==t.length-1){let i=new Uint32Array(n.size()),a=0;for(let e=0;e<n.size();e++)n.get(e)?i[e]=a++:i[e]=0;return new hZ(e,i,t,r,n)}return n?new hY(e,t,r,n):new hY(e,t,r)}(e,S,A,x,_)}(a.name,t,r,i,s)}case 0:return function(e,t,r,i){let n=hp(e,t),a=n.numValues,s=t.get(),o=hH(i)?i:void 0,l=hq(e,a,n.byteLength,t,o);t.set(s+n.byteLength);let u=new hf(l,a);return new h$(r.name,u,i)}(t,r,a,o);case 6:case 5:return function(e,t,r,i,n){let a=hp(e,t),s=hA(a,i,e,t,"int64"),o=5===n.physicalType;if(s===X.FLAT){let n=hH(i)?i:void 0,s=o?function(e,t,r){let i;switch(t.logicalLevelTechnique1){case R.DELTA:if(t.logicalLevelTechnique2===R.RLE){if(!r)return function(e,t,r){let i=new BigInt64Array(r),n=0,a=0n;for(let r=0;r<t;r++){let s=Number(e[r]),o=u5(e[r+t]);for(let e=0;e<s;e++)a+=o,i[n++]=a}return i}(e,t.runs,t.numRleValues);i=he(e=u8(e,t.runs,t.numRleValues))}else i=he(e);break;case R.RLE:i=function(e,t,r){if(void 0===r){r=0;for(let i=0;i<t;i++)r+=Number(e[i])}let i=new BigInt64Array(r),n=0;for(let r=0;r<t;r++){let a=Number(e[r]),s=e[r+t];s=u5(s),i.fill(s,n,n+a),n+=a}return i}(e,t.runs,t.numRleValues);break;case R.NONE:i=function(e){let t=new BigInt64Array(e.length);for(let r=0;r<e.length;r++)t[r]=u5(e[r]);return t}(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?hd(i,r,0n):i}(u2(e,t,a.numValues),a,n):h_(e,t,a,n);return new hk(r.name,s,i)}if(s===X.SEQUENCE){let i=hw(e,t,a);return new hI(r.name,i[0],i[1],a.numRleValues)}let l=o?function(e,t,r){let i=u2(e,t,r.numValues);return 1===i.length?u5(i[0]):u5(i[1])}(e,t,a):hS(e,t,a);return new hN(r.name,l,i,o)}(t,r,a,o,n);case 7:return function(e,t,r,i){var n;let a,s,o,l=hp(e,t),u=hH(i)?i:void 0,h=(n=l.numValues,s=(a=t.get())+n*Float32Array.BYTES_PER_ELEMENT,o=new Float32Array(new Uint8Array(e.subarray(a,s)).buffer),(t.set(s),u)?hd(o,u,0):o);return new hR(r.name,h,i)}(t,r,a,o);case 8:return function(e,t,r,i){var n;let a,s,o,l=hp(e,t),u=hH(i)?i:void 0,h=(n=l.numValues,s=(a=t.get())+n*Float64Array.BYTES_PER_ELEMENT,o=new Float64Array(new Uint8Array(e.subarray(a,s)).buffer),(t.set(s),u)?hd(o,u,0):o);return new uG(r.name,h,i)}(t,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}(o,n,a,l,s.scalarType,s):0===o?null:function(e,t,r,i){let n=null,a=null,s=null,o=null,l=!1;for(;!l;){let r=hp(e,t);switch(r.physicalStreamType){case U.LENGTH:G.DICTIONARY===r.logicalStreamType.lengthType?n=hg(e,t,r):s=hg(e,t,r);break;case U.DATA:q.SINGLE===r.logicalStreamType.dictionaryType||q.SHARED===r.logicalStreamType.dictionaryType?(a=e.subarray(t.get(),t.get()+r.byteLength),l=!0):o=e.subarray(t.get(),t.get()+r.byteLength),t.add(r.byteLength)}}let u=r.complexType.children,h=[],c=0;for(let l of u){let u,p=u1(e,t,1)[0];if(0===p)continue;let f=l.name?`${r.name}${l.name}`:r.name;if(i&&!i.has(f)){hU(p,e,t);continue}if("scalarField"!==l.type||9!==l.scalarField.physicalType)throw Error("Currently only scalar string fields are implemented for a struct.");if(p>1&&!l.nullable||1===p&&l.nullable)throw Error(`The number of streams for the child field ${l.name} does not match its nullability. nullibilty: ${l.nullable}, numStreams: ${p}`);
2if(l.nullable){let r=hp(e,t);u=new hf(hq(e,r.numValues,r.byteLength,t),r.numValues)}let d=hm(e,t,hp(e,t),void 0,u);h[c++]=o?new hW(f,d,n,a,s,o,u):new hZ(f,d,n,a,u)}return h}(n,a,s,u));if(h)if(Array.isArray(h))for(let e of h)g.push(e);else g.push(h)}}let v=new uW(d.name,m,y,g,f);i.push(v),r.set(c)}return i}(new Uint8Array(e));this.layers=t.reduce((e,t)=>({...e,[t.name]:new h1(t)}),{})}},h3=class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new nd(ed,16,0),this.grid3D=new nd(ed,16,0),this.featureIndexArray=new aP,this.promoteId=t}insert(e,t,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let e of t){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)t[0]=Math.min(t[0],r.x),t[1]=Math.min(t[1],r.y),t[2]=Math.max(t[2],r.x),t[3]=Math.max(t[3],r.y);t[0]<8192&&t[1]<8192&&t[2]>=0&&t[3]>=0&&o.insert(s,t[0],t[1],t[2],t[3])}}loadVTLayers(){return this.vtLayers||("mlt"===this.encoding?this.vtLayers=new h2(this.rawTileData).layers:this.vtLayers=new oB(new lW(this.rawTileData)).layers,this.sourceLayerCoder=new uR(this.vtLayers?Object.keys(this.vtLayers).sort():[uz])),this.vtLayers}query(e,t,r,i){let n;this.loadVTLayers();let a=e.params,s=ed/e.tileSize/e.scale,o=iO(a.filter,"queryRenderedFeatures filter",a.globalState),l=e.queryGeometry,u=e.queryPadding*s,h=uP.fromPoints(l),c=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=uP.fromPoints(e.cameraQueryGeometry).expandBy(u);for(let t of this.grid3D.query(p.minX,p.minY,p.maxX,p.maxY,(t,r,i,n)=>(function(e,t,r,i,n){for(let a of e)if(t<=a.x&&r<=a.y&&i>=a.x&&n>=a.y)return!0;let a=[new ei(t,r),new ei(t,n),new ei(i,n),new ei(i,r)];if(e.length>2){for(let t of a)if(sv(e,t))return!0}for(let t=0;t<e.length-1;t++)if(function(e,t,r){let i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;let a=eS(e,t,r[0]);return a!==eS(e,t,r[1])||a!==eS(e,t,r[2])||a!==eS(e,t,r[3])}(e[t],e[t+1],a))return!0;return!1})(e.cameraQueryGeometry,t-u,r-u,i+u,n+u)))c.push(t);c.sort(h6);let f={};for(let u of c){if(u===n)continue;n=u;let h=this.featureIndexArray.get(u),c=null;this.loadMatchingFeature(f,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,o,a.layers,a.availableImages,t,r,i,(t,r,i)=>(c||=sh(t),r.queryIntersectsFeature({queryGeometry:l,feature:t,featureState:i,geometry:c,zoom:this.z,transform:e.transform,pixelsToTileUnits:s,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return f}loadMatchingFeature(e,t,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[t];if(a&&!c.some(e=>a.has(e)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let e=sc(f,!0);if(!n.filter(new nF(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new nF(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let t of c){if(a&&!a.has(t))continue;let r=o[t];if(!r)continue;let n={};d&&u&&(n=u.getState(r.sourceLayer||"_geojsonTileLayer",d));let c=ex({},l[t]);c.paint=h5(c.paint,r.paint,f,n,s),c.layout=h5(c.layout,r.layout,f,n,s);let p=!h||h(f,r,n);if(!p)continue;let y=new uN(f,this.z,this.x,this.y,d);y.layer=c;let m=e[t];void 0===m&&(m=e[t]=[]),m.push({featureIndex:i,feature:y,intersectionZ:p})}}lookupSymbolFeatures(e,t,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=iO(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let n of e)this.loadMatchingFeature(l,r,i,n,u,a,s,o,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){let i="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];"boolean"==typeof(r=e.properties[i])&&(r=Number(r)),void 0===r&&e.properties?.cluster&&this.promoteId&&(r=Number(e.properties.cluster_id))}return r}};function h5(e,t,r,i,n){return ev(e,(e,a)=>{let s=t instanceof nN?t.get(a):null;return s?.evaluate?s.evaluate(r,i,n):s})}function h6(e,t){return t-e}nm("FeatureIndex",h3,{omit:["rawTileData","sourceLayerCoder"]});var h4=class{constructor(e){this.maxEntries=e,this.map=new Map}get(e){let t=this.map.get(e);return void 0!==t&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>
2=this.maxEntries){let e=this.map.keys().next().value;this.map.delete(e)}this.map.set(e,t)}clear(){this.map.clear()}};function h8(e,t,r,i,n,a){let s=h7(e,t,r,n,0);return h7(s,t,i,a,1)}function h7(e,t,r,i,n){switch(t){case 1:var a=e,s=r,o=i,l=n;let u=[];for(let e of a)for(let t of e){let e=0===l?t.x:t.y;e>=s&&e<=o&&u.push([t])}return u;case 2:return h9(e,r,i,n,!1);case 3:return h9(e,r,i,n,!0)}return[]}function h9(e,t,r,i,n){let a=[];for(let s of e){let e=function(e,t,r,i,n){let a=0===i?ce:ct,s=[],o=[];for(let l=0;l<e.length-1;l++){let u=e[l],h=e[l+1],c=0===i?u.x:u.y,p=0===i?h.x:h.y,f=!1;c<t?p>t&&s.push(a(u,h,t)):c>r?p<r&&s.push(a(u,h,r)):s.push(u),p<t&&c>=t&&(s.push(a(u,h,t)),f=!0),p>r&&c<=r&&(s.push(a(u,h,r)),f=!0),!n&&f&&(o.push(s),s=[])}let l=e.length-1,u=0===i?e[l].x:e[l].y;return u>=t&&u<=r&&s.push(e[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new ei(s[0].x,s[0].y)),s.length>0&&o.push(s),o}(s,t,r,i,n);e.length>0&&a.push(...e)}return a}function ce(e,t,r){let i=(r-e.x)/(t.x-e.x);return new ei(r,e.y+(t.y-e.y)*i)}function ct(e,t,r){let i=(r-e.y)/(t.y-e.y);return new ei(e.x+(t.x-e.x)*i,r)}
vendor: 2,652 bytes, line 2
2var cr=class e extends ei{constructor(e,t,r,i){super(e,t),this.angle=r,void 0!==i&&(this.segment=i)}clone(){return new e(this.x,this.y,this.angle,this.segment)}};function ci(e,t,r,i,n){if(void 0===t.segment||0===r)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(--s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;let l=[],u=0;for(;o<r/2;){let t=e[s-1],r=e[s],a=e[s+1];if(!a)return!1;let h=t.angleTo(r)-r.angleTo(a);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:h}),u+=h;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=r.dist(a)}return!0}function cn(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function ca(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function cs(e,t,r,i){let n=[],a=e.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(e,t)=>e+t[1]-t[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,w=0,_=y,S=0,A=m;if(a.content&&i){let t=a.content,r=t[2]-t[0],i=t[3]-t[1];(a.textFitWidth||a.textFitHeight)&&(u=ua(e)),g=co(h,0,t[0]),v=co(c,0,t[1]),x=co(h,t[0],t[2]),b=co(c,t[1],t[3]),w=t[0]-g,S=t[1]-v,_=r-x,A=i-b}let k=u.x1,I=u.y1,T=u.x2-k,E=u.y2-I,M=(e,i,n,o)=>{var l,u,h,c,p,y,m,M,D,P,F,z,B,C,V,L;let O=(l=e.stretch-g,l/x*T+k),$=(u=e.fixed-w,h=_,c=e.stretch,u-h*c/f),R=(p=i.stretch-v,p/b*E+I),N=(y=i.fixed-S,m=A,M=i.stretch,y-m*M/d),U=(D=n.stretch-g,D/x*T+k),q=(P=n.fixed-w,F=_,z=n.stretch,P-F*z/f),j=(B=o.stretch-v,B/b*E+I),G=(C=o.fixed-S,V=A,L=o.stretch,C-V*L/d),X=new ei(O,R),Y=new ei(U,R),Z=new ei(U,j),W=new ei(O,j),H=new ei($/s,N/s),K=new ei(q/s,G/s),J=t*Math.PI/180;if(J){let e=Math.sin(J),t=Math.cos(J),r=[t,-e,e,t];X._matMult(r),Y._matMult(r),W._matMult(r),Z._matMult(r)}let Q=e.stretch+e.fixed,ee=n.stretch+n.fixed,et=i.stretch+i.fixed,er=o.stretch+o.fixed;return{tl:X,tr:Y,bl:W,br:Z,tex:{x:a.paddedRect.x+1+Q,y:a.paddedRect.y+1+et,w:ee-Q,h:er-et},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:H,pixelOffsetBR:K,minFontScaleX:_/s/T,minFontScaleY:A/s/E,isSDF:r}};if(i&&(a.stretchX||a.stretchY)){let e=cl(h,y,f),t=cl(c,m,d);for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++){let r=t[e],s=t[e+1];n.push(M(i,r,a,s))}}}else n.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));return n}function co(e,t,r){let i=0;for(let n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function cl(e,t,r){let i=[{fixed:-1,stretch:0}];for(let[t,r]of e){let e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}
2),i.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return i.push({fixed:t+1,stretch:r}),i}nm("Anchor",cr);var cu=class{constructor(e,t,r,i,n,a,s,o,l,u){if(this.boxStartIndex=e.length,l){let e=a.top,t=a.bottom,r=a.collisionPadding;r&&(e-=r[1],t+=r[3]);let i=t-e;i>0&&(i=Math.max(10,i),this.circleDiameter=i)}else{let l=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?ua(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*s-o[0],l.y2=l.y2*s+o[2],l.x1=l.x1*s-o[3],l.x2=l.x2*s+o[1];let h=a.collisionPadding;if(h&&(l.x1-=h[0]*s,l.y1-=h[1]*s,l.x2+=h[2]*s,l.y2+=h[3]*s),u){let e=new ei(l.x1,l.y1),t=new ei(l.x2,l.y1),r=new ei(l.x1,l.y2),i=new ei(l.x2,l.y2),n=u*Math.PI/180;e._rotate(n),t._rotate(n),r._rotate(n),i._rotate(n),l.x1=Math.min(e.x,t.x,r.x,i.x),l.x2=Math.max(e.x,t.x,r.x,i.x),l.y1=Math.min(e.y,t.y,r.y,i.y),l.y2=Math.max(e.y,t.y,r.y,i.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,r,i,n)}this.boxEndIndex=e.length}},ch=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=(e<<1)+1,a=i+1;if(a<this.length&&0>r(t[a],t[i])&&(i=a),r(t[i],n)>=0)break;t[e]=t[i],e=i}t[e]=n}};function cc(e,t){return t.max-e.max}
2var cp=class{constructor(e,t,r,i){this.p=new ei(e,t),this.h=r,this.d=function(e,t){let r=!1,i=1/0;for(let n of t)for(let t=0,a=n.length,s=a-1;t<a;s=t++){let a=n[t],o=n[s];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r),i=Math.min(i,sg(e,a,o))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}};let cf=(($={})[$.center=1]="center",$[$.left=2]="left",$[$.right=3]="right",$[$.top=4]="top",$[$.bottom=5]="bottom",$[$["top-left"]=6]="top-left",$[$["top-right"]=7]="top-right",$[$["bottom-left"]=8]="bottom-left",$[$["bottom-right"]=9]="bottom-right",$);function cd(e,t){return 1/0!==t[1]?function(e,t,r){let i=0,n=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=-r+7}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}return[i,n]}(e,t[0],t[1]):function(e,t){let r=0,i=0;t<0&&(t=0);let n=t/Math.SQRT2;switch(e){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=-n+7;break;case"bottom":i=-t+7;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}return[r,i]}(e,t[0])}function cy(e,t,r){let i=e.layout,n=i.get("text-variable-anchor-offset")?.evaluate(t,{},r);if(n){let e=n.values,t=[];for(let r=0;r<e.length;r+=2){let i=t[r]=e[r],n=e[r+1].map(e=>24*e);i.startsWith("top")?n[1]-=7:i.startsWith("bottom")&&(n[1]+=7),t[r+1]=n}return new tU(t)}let a=i.get("text-variable-anchor");if(a){let n;n=void 0!==e._unevaluatedLayout.getValue("text-radial-offset")?[24*i.get("text-radial-offset").evaluate(t,{},r),1/0]:i.get("text-offset").evaluate(t,{},r).map(e=>24*e);let s=[];for(let e of a)s.push(e,cd(e,n));return new tU(s)}return null}function cm(e){e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=ed/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new nF(e.bucket.zoom+1),e.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new nF(e.bucket.zoom+1),e.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new nF(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new nF(t),e.canonical),n["text-size"].possiblyEvaluate(new nF(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new nF(t),e.canonical),n["icon-size"].possiblyEvaluate(new nF(r),e.canonical)]}let s=24*i.get("text-line-height"),o="viewport"!==i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement"),l=i.get("text-keep-upright"),u=i.get("text-size");for(let t of e.bucket.features){let n,h=i.get("text-font").evaluate(t,{},e.canonical).join(","),c=u.evaluate(t,{},e.canonical),p=a.layoutTextSize.evaluate(t,{},e.canonical),f=a.layoutIconSize.evaluate(t,{},e.canonical),d={horizontal:{},vertical:void 0},y=t.text,m=[0,0];if(y){let n=y.toString(),a=24*i.get("text-letter-spacing").evaluate(t,{},e.canonical),u=!function(e){for(let r of e){var t;if(t=r.codePointAt(0),nT.test(String.fromCodePoint(t)))return!1}return!0}(n)?0:a,f=i.get("text-anchor").evaluate(t,{},e.canonical),g=cy(r,t,e.canonical);if(!g){let r=i.get("text-radial-offset").evaluate(t,{},e.canonical);m=r?cd(f,[24*r,1/0]):i.get("text-offset").evaluate(t,{},e.canonical).map(e=>24*e)}let x=o?"center":i.get("text-justify").evaluate(t,{},e.canonical),v="point"===i.get("symbol-placement")?24*i.get("text-max-width").evaluate(t,{},e.canonical):1/0,b=()=>{e.bucket.allowVerticalPlacement&&nk(n)&&(d.vertical=ur(y,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,s,f,"left",u,m,2,!0,p,c))};if(!o&&g){let t=new Set;if("auto"===x)for(let e=0;e<g.values.length;e+=2)t.add(cg(g.values[e]));else t.add(x);let r=!1;for(let i of t)if(!d.horizontal[i])if(r)d.horizontal[i]=d.horizontal[0];else{let t=ur(y,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,s,"center",i,u,m,1,!1,p,c);t&&(d.horizontal[i]=t,r=1===t.positionedLines.length)}b()}else{"auto"===x&&(x=cg(f));let t=ur(y,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,s,f,x,u,m,1,!1,p,c);t&&(d.horizontal[x]=t),b(),nk(n)&&o&&l&&(d.vertical=ur(y,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,s,f,x,u,m,2,!1,p,c))}}let g=!1;if(t.icon?.name){let r=e.imageMap[t.icon.name];r&&(n=function(e,t,r){let{horizontalAlign:i,verticalAlign:n}=ui(r),a=t[0],s=t[1],o=a-e.displaySize[0]*i,l=o+e.displaySize[0],u=s-e.displaySize[1]*n;return{image:e,top:u,bottom:u+e.displaySize[1],left:o,right:l}}(e.imagePositions[t.icon.name],i.get("icon-offset").evaluate(t,{},e.canonical),i.get("icon-anchor").evaluate(t,{},e.canonical)),g=!!r.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=g:e.bucket.sdfIcons!==g&&e_("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),r.pixelRatio!==e.bucket.pixelRatio?e.bucket.iconsNeedLinear=!0:0!==i.get("icon-rotate").constantOr(1)&&(e.bucket.iconsNeedLinear=!0))}let x=cv(d.horizontal)||d.vertical;e.bucket.iconsInText||=!!x&&x.iconsInText,(x||n)&&function(e,t,r,i,n,a,s,o,l,u,h,c){let p,f=a.textMaxSize.evaluate(t,{});void 0===f&&(f=s);let d=e.layers[0].layout,y=d.get("icon-offset").evaluate(t,{},h),m=cv(r.horizontal),g=s/24,x=e.tilePixelRatio*g,v=e.tilePixelRatio*f/24,b=e.tilePixelRatio*o,w=e.tilePixelRatio*d.get("symbol-spacing"),_=d.get("text-padding")*e.tilePixelRatio,S=function(e,t,r,i=1){let n=e.get("icon-padding").evaluate(t,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}(d,t,h,e.tilePixelRatio),A=d.get("text-max-angle")/180*Math.PI,k="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),I="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),T=d.get("symbol-placement"),E=w/2,M=d.get("icon-text-fit");i&&"none"!==M&&(e.allowVerticalPlacement&&r.vertical&&(p=us(i,r.vertical,M,d.get("icon-text-fit-padding"),y,g)),m&&(i=us(i,m,M,d.get("icon-text-fit-padding"),y,g)));let D=h?c.line.getGranularityForZoomLevel(h.z):1,P=(o,c)=>
2{c.x<0||c.x>=8192||c.y<0||c.y>=8192||function(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,S,A){let k,I,T,E,M=e.addToLineVertexArray(t,r),D=0,P=0,F=0,z=0,B=-1,C=-1,V={},L=(0,a1.default)("");if(e.allowVerticalPlacement&&i.vertical){let e=o.layout.get("text-rotate").evaluate(b,{},S)+90;T=new cu(l,t,u,h,c,i.vertical,p,f,d,e),s&&(E=new cu(l,t,u,h,c,s,m,g,d,e))}if(n){let r=o.layout.get("icon-rotate").evaluate(b,{}),i="none"!==o.layout.get("icon-text-fit"),a=cs(n,r,_,i),p=s?cs(s,r,_,i):void 0;I=new cu(l,t,u,h,c,n,m,g,!1,r),D=4*a.length;let f=e.iconSizeData,d=null;"source"===f.kind?(d=[128*o.layout.get("icon-size").evaluate(b,{})])[0]>32640&&e_(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===f.kind&&((d=[128*w.compositeIconSizes[0].evaluate(b,{},S),128*w.compositeIconSizes[1].evaluate(b,{},S)])[0]>32640||d[1]>32640)&&e_(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),e.addSymbols(e.icon,a,d,v,x,b,0,t,M.lineStartIndex,M.lineLength,-1,S),B=e.icon.placedSymbolArray.length-1,p&&(P=4*p.length,e.addSymbols(e.icon,p,d,v,x,b,2,t,M.lineStartIndex,M.lineLength,-1,S),C=e.icon.placedSymbolArray.length-1)}let O=Object.keys(i.horizontal);for(let r of O){let n=i.horizontal[r];k||(L=(0,a1.default)(n.text),k=new cu(l,t,u,h,c,n,p,f,d,o.layout.get("text-rotate").evaluate(b,{},S)));let s=1===n.positionedLines.length;if(F+=cx(e,t,n,a,o,d,b,y,M,i.vertical?1:3,s?O:[r],V,B,w,S),s)break}i.vertical&&(z+=cx(e,t,i.vertical,a,o,d,b,y,M,2,["vertical"],V,C,w,S));let $=k?k.boxStartIndex:e.collisionBoxArray.length,R=k?k.boxEndIndex:e.collisionBoxArray.length,N=T?T.boxStartIndex:e.collisionBoxArray.length,U=T?T.boxEndIndex:e.collisionBoxArray.length,q=I?I.boxStartIndex:e.collisionBoxArray.length,j=I?I.boxEndIndex:e.collisionBoxArray.length,G=E?E.boxStartIndex:e.collisionBoxArray.length,X=E?E.boxEndIndex:e.collisionBoxArray.length,Y=-1,Z=(e,t)=>e?.circleDiameter?Math.max(e.circleDiameter,t):t;Y=Z(k,-1),Y=Z(T,Y),Y=Z(I,Y);let W=+((Y=Z(E,Y))>-1);W&&(Y*=A/24),e.glyphOffsetArray.length>=ud.MAX_GLYPHS&&e_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);let H=cy(o,b,S),[K,J]=function(e,t){let r=e.length,i=t?.values;if(i?.length>0)for(let t=0;t<i.length;t+=2){let r=cf[i[t]],n=i[t+1];e.emplaceBack(r,n[0],n[1])}return[r,e.length]}(e.textAnchorOffsets,H);e.symbolInstances.emplaceBack(t.x,t.y,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical||-1,B,C,L,$,R,N,U,q,j,G,X,u,F,z,D,P,W,0,p,Y,K,J)}(e,c,o,r,i,n,p,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,x,[_,_,_,_],k,l,b,S,I,y,t,a,u,h,s)};if("line"===T)for(let n of function(e,t,r){let i=[];for(let n of e){let e;for(let a=0;a<n.length-1;a++){let s=n[a],o=n[a+1];if(s.x<0&&o.x<0)continue;if(s.x<0?s=new ei(0,s.y+(o.y-s.y)*((0-s.x)/(o.x-s.x)))._round():o.x<0&&(o=new ei(0,s.y+(o.y-s.y)*((0-s.x)/(o.x-s.x)))._round()),s.y<0&&o.y<0)continue;if(s.y<0?s=new ei(s.x+(o.x-s.x)*((0-s.y)/(o.y-s.y)),0)._round():o.y<0&&(o=new ei(s.x+(o.x-s.x)*((0-s.y)/(o.y-s.y)),0)._round()),!(s.x>=t)||!(o.x>=t))s.x>=t?s=new ei(t,s.y+(o.y-s.y)*((t-s.x)/(o.x-s.x)))._round():o.x>=t&&(o=new ei(t,s.y+(o.y-s.y)*((t-s.x)/(o.x-s.x)))._round()),s.y>=r&&o.y>=r||(s.y>=r?s=new ei(s.x+(o.x-s.x)*((r-s.y)/(o.y-s.y)),r)._round():o.y>=r&&(o=new ei(s.x+(o.x-s.x)*((r-s.y)/(o.y-s.y)),r)._round()),e&&s.equals(e[e.length-1])||(e=[s],i.push(e)),e.push(o))}}return i}(t.geometry,ed,ed)){let t=o_(n,D);for(let n of function(e,t,r,i,n,a,s,o){let l=i?.6*24*a:0,u=ca(i,n),h=u*a,c=0===e[0].x||e[0].x===o||0===e[0].y||e[0].y===o;return t-h<t/4&&(t=h+t/4),function e(t,r,i,n,a,s,o,l,u){let h=s/2,c=cn(t),p=0,f=r-i,d=[];for(let e=0;e<t.length-1;e++){let r=t[e],o=t[e+1],l=r.dist(o),y=o.angleTo(r);for(;f+i<p+l;){let m=((f+=i)-p)/l,g=ra.number(r.x,o.x,m),x=ra.number(r.y,o.y,m);if(g>=0&&g<u&&x>=0&&x<u&&f-h>=0&&f+h<=c){let r=new cr(g,x,y,e);r._round(),(!n||ci(t,r,s,n,a))&&d.push(r)}}p+=l}return l||d.length||o||(d=e(t,p/2,i,n,a,s,o,!0,u)),d}(e,c?t/2*s%t:(u/2+48)*a*s%t,t,l,r,h,c,!1,o)}(t,w,A,r.vertical||m,i,v,e.overscaling,ed))m&&function(e,t,r,i){let n=e.compareText;if(t in n){let e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<r)return!0}else n[t]=[];return n[t].push(i),!1}(e,m.text,E,n)||P(t,n)}else if("line-center"===T){for(let e of t.geometry)if(e.length>
21){let t=o_(e,D),n=function(e,t,r,i,n){let a=r?.6*24*n:0,s=ca(r,i)*n,o=0,l=cn(e)/2;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1],u=i.dist(n);if(o+u>l){let h=(l-o)/u,c=new cr(ra.number(i.x,n.x,h),ra.number(i.y,n.y,h),n.angleTo(i),r);if(c._round(),!a||ci(e,c,s,a,t))return c;return}o+=u}}(t,A,r.vertical||m,i,v);n&&P(t,n)}}else if("Polygon"===t.type)for(let e of rV(t.geometry,0)){let t=function(e,t=1){let r=uP.fromPoints(e[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new ch([],cc),{minX:s,minY:o,maxX:l,maxY:u}=r;if(0===i)return new ei(s,o);for(let t=s;t<l;t+=i)for(let r=o;r<u;r+=i)a.push(new cp(t+n,r+n,n,e));let h=function(e){let t=0,r=0,i=0,n=e[0];for(let e=0,a=n.length,s=a-1;e<a;s=e++){let a=n[e],o=n[s],l=a.x*o.y-o.x*a.y;r+=(a.x+o.x)*l,i+=(a.y+o.y)*l,t+=3*l}return new cp(r/t,i/t,0,e)}(e),c=h;for(;a.length;){let r=a.pop();(r.d>c.d||!c.d)&&(c=r),r.max-c.d<=t||(n=r.h/2,a.push(new cp(r.p.x-n,r.p.y-n,n,e)),a.push(new cp(r.p.x+n,r.p.y-n,n,e)),a.push(new cp(r.p.x-n,r.p.y+n,n,e)),a.push(new cp(r.p.x+n,r.p.y+n,n,e)))}return h.d>0&&c.d-h.d<=t?h.p:c.p}(e,16);P(o_(e[0],D,!0),new cr(t.x,t.y,0))}else if("LineString"===t.type)for(let e of t.geometry){let t=o_(e,D);P(t,new cr(t[0].x,t[0].y,0))}else if("Point"===t.type)for(let e of t.geometry)for(let t of e)P([t],new cr(t.x,t.y,0))}(e.bucket,t,d,n,e.imageMap,a,p,f,m,g,e.canonical,e.subdivisionGranularity)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}function cg(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function cx(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=function(e,t,r,i,n,a,s){let o=r.layout.get("text-rotate").evaluate(n,{})*Math.PI/180,l=[];for(let r of e.positionedLines)for(let n of r.positionedGlyphs){if(!n.rect)continue;let u=n.rect||{},h=4,c=!0,p=1,f=0,d=(i||s)&&n.vertical,y=n.metrics.advance*n.scale/2;if(s&&e.verticalizable){let e=(n.scale-1)*24,t=(24-n.metrics.width*n.scale)/2;f=r.lineOffset/2-(n.imageName?-t:e)}if(n.imageName){let e=a[n.imageName];c=e.sdf,h=1/(p=e.pixelRatio)}let m=i?[n.x+y,n.y]:[0,0],g=i?[0,0]:[n.x+y+t[0],n.y+t[1]-f],x=[0,0];d&&(x=g,g=[0,0]);let v=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-h)*n.scale-y+g[0],w=(-n.metrics.top-h)*n.scale+g[1],_=b+u.w/v*n.scale/p,S=w+u.h/v*n.scale/p,A=new ei(b,w),k=new ei(_,w),I=new ei(b,S),T=new ei(_,S);if(d){let e=new ei(-y,y- -17),t=-Math.PI/2,r=12-y,i=n.imageName?r:0,a=new ei(22-r,-i),s=new ei(...x);A._rotateAround(t,e)._add(a)._add(s),k._rotateAround(t,e)._add(a)._add(s),I._rotateAround(t,e)._add(a)._add(s),T._rotateAround(t,e)._add(a)._add(s)}if(o){let e=Math.sin(o),t=Math.cos(o),r=[t,-e,e,t];A._matMult(r),k._matMult(r),I._matMult(r),T._matMult(r)}let E=new ei(0,0),M=new ei(0,0);l.push({tl:A,tr:k,bl:I,br:T,tex:u,writingMode:e.writingMode,glyphOffset:m,sectionIndex:n.sectionIndex,isSDF:c,pixelOffsetTL:E,pixelOffsetBR:M,minFontScaleX:0,minFontScaleY:0})}return l}(r,o,n,a,s,i,e.allowVerticalPlacement),m=e.textSizeData,g=null;for(let r of("source"===m.kind?(g=[128*n.layout.get("text-size").evaluate(s,{})])[0]>32640&&e_(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===m.kind&&((g=[128*f.compositeTextSizes[0].evaluate(s,{},d),128*f.compositeTextSizes[1].evaluate(s,{},d)])[0]>32640||g[1]>32640)&&e_(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),e.addSymbols(e.text,y,g,o,a,s,u,t,l.lineStartIndex,l.lineLength,p,d),h))c[r]=e.text.placedSymbolArray.length-1;return 4*y.length}function cv(e){for(let t in e)return e[t];return null}}),n("8gjpy");
3//# sourceMappingURL=maplibre-gl-worker-dev.78c2356d.js.map

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.